本文整理匯總了Java中java.awt.ComponentOrientation.isHorizontal方法的典型用法代碼示例。如果您正苦於以下問題:Java ComponentOrientation.isHorizontal方法的具體用法?Java ComponentOrientation.isHorizontal怎麽用?Java ComponentOrientation.isHorizontal使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.awt.ComponentOrientation
的用法示例。
在下文中一共展示了ComponentOrientation.isHorizontal方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getPageAxisConstant
import java.awt.ComponentOrientation; //導入方法依賴的package包/類
public static int getPageAxisConstant()
{
if (PlatformFriend.RUNNING_ON_JAVA_14_OR_HIGHER)
{
return BoxLayout.PAGE_AXIS;
}
else
{
ComponentOrientation componentOrientation = ComponentOrientation.getOrientation(Locale.getDefault());
if (componentOrientation.isHorizontal())
return BoxLayout.Y_AXIS;
else
return BoxLayout.X_AXIS;
}
}
示例2: getLineAxisConstant
import java.awt.ComponentOrientation; //導入方法依賴的package包/類
public static int getLineAxisConstant()
{
if (PlatformFriend.RUNNING_ON_JAVA_14_OR_HIGHER)
{
return BoxLayout.LINE_AXIS;
}
else
{
ComponentOrientation componentOrientation = ComponentOrientation.getOrientation(Locale.getDefault());
if (componentOrientation.isHorizontal())
return BoxLayout.X_AXIS;
else
return BoxLayout.Y_AXIS;
}
}
示例3: AbstractButtonPanelBuilder
import java.awt.ComponentOrientation; //導入方法依賴的package包/類
/**
* Constructs a <code>AbstractFormBuilder</code>
* for the given FormLayout and layout container.
*
* @param layout the {@link FormLayout} to use
* @param container the layout container
*
* @throws NullPointerException if the layout or container is null
*/
protected AbstractButtonPanelBuilder(FormLayout layout, JPanel container) {
if (layout == null) {
throw new NullPointerException("The layout must not be null.");
}
if (container == null) {
throw new NullPointerException("The layout container must not be null.");
}
this.container = container;
this.layout = layout;
container.setLayout(layout);
setOpaque(false);
currentCellConstraints = new CellConstraints();
ComponentOrientation orientation = container.getComponentOrientation();
leftToRight = orientation.isLeftToRight()
|| !orientation.isHorizontal();
}
示例4: AbstractFormBuilder
import java.awt.ComponentOrientation; //導入方法依賴的package包/類
/**
* Constructs a <code>AbstractFormBuilder</code>
* for the given FormLayout and layout container.
*
* @param layout the {@link FormLayout} to use
* @param container the layout container
*
* @throws NullPointerException if the layout or container is null
*/
public AbstractFormBuilder(FormLayout layout, Container container) {
if (layout == null)
throw new NullPointerException("The layout must not be null.");
if (container == null)
throw new NullPointerException("The layout container must not be null.");
this.container = container;
this.layout = layout;
container.setLayout(layout);
currentCellConstraints = new CellConstraints();
ComponentOrientation orientation = container.getComponentOrientation();
leftToRight = orientation.isLeftToRight()
|| !orientation.isHorizontal();
}
示例5: resolveAxis
import java.awt.ComponentOrientation; //導入方法依賴的package包/類
/**
* Given one of the 4 axis values, resolve it to an absolute axis.
* The relative axis values, PAGE_AXIS and LINE_AXIS are converted
* to their absolute couterpart given the target's ComponentOrientation
* value. The absolute axes, X_AXIS and Y_AXIS are returned unmodified.
*
* @param axis the axis to resolve
* @param o the ComponentOrientation to resolve against
* @return the resolved axis
*/
private int resolveAxis( int axis, ComponentOrientation o ) {
int absoluteAxis;
if( axis == LINE_AXIS ) {
absoluteAxis = o.isHorizontal() ? X_AXIS : Y_AXIS;
} else if( axis == PAGE_AXIS ) {
absoluteAxis = o.isHorizontal() ? Y_AXIS : X_AXIS;
} else {
absoluteAxis = axis;
}
return absoluteAxis;
}
示例6: isHorizontalIn
import java.awt.ComponentOrientation; //導入方法依賴的package包/類
private boolean isHorizontalIn(Container parent)
{
ComponentOrientation orientation = parent.getComponentOrientation();
return this.way == X_AXIS
|| (this.way == LINE_AXIS
&& orientation.isHorizontal())
|| (this.way == PAGE_AXIS
&& (!orientation.isHorizontal()));
}
示例7: setComponentOrientation
import java.awt.ComponentOrientation; //導入方法依賴的package包/類
void setComponentOrientation(ComponentOrientation orientation) {
horizontal = orientation.isHorizontal();
leftToRight = orientation.isLeftToRight();
}
示例8: isRightToLeft
import java.awt.ComponentOrientation; //導入方法依賴的package包/類
public boolean isRightToLeft()
{
// Check layout orientation
ComponentOrientation orientation = _parent.getComponentOrientation();
return orientation.isHorizontal() && !orientation.isLeftToRight();
}
示例9: isLeftToRight
import java.awt.ComponentOrientation; //導入方法依賴的package包/類
private boolean isLeftToRight() {
ComponentOrientation orientation = getPanel().getComponentOrientation();
return orientation.isLeftToRight()
|| !orientation.isHorizontal();
}
示例10: AbstractButtonPanelBuilder
import java.awt.ComponentOrientation; //導入方法依賴的package包/類
/**
* Constructs an AbstractButtonPanelBuilder
* for the given FormLayout and layout container.
*
* @param layout the FormLayout to use
* @param container the layout container
*
* @throws NullPointerException if {@code layout} or {@code container} is {@code null}
*/
protected AbstractButtonPanelBuilder(FormLayout layout, JPanel container) {
super(layout, container);
opaque(false);
ComponentOrientation orientation = container.getComponentOrientation();
leftToRight = orientation.isLeftToRight()
|| !orientation.isHorizontal();
}
示例11: AbstractFormBuilder
import java.awt.ComponentOrientation; //導入方法依賴的package包/類
/**
* Constructs an AbstractFormBuilder
* for the given FormLayout and layout container.
*
* @param layout the FormLayout to use
* @param panel the layout container
*
* @throws NullPointerException if {@code layout} or {@code container} is {@code null}
*/
protected AbstractFormBuilder(FormLayout layout, JPanel panel) {
super(layout, panel);
ComponentOrientation orientation = panel.getComponentOrientation();
leftToRight = orientation.isLeftToRight()
|| !orientation.isHorizontal();
}