本文整理汇总了Java中javax.swing.SwingConstants.LEADING属性的典型用法代码示例。如果您正苦于以下问题:Java SwingConstants.LEADING属性的具体用法?Java SwingConstants.LEADING怎么用?Java SwingConstants.LEADING使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类javax.swing.SwingConstants
的用法示例。
在下文中一共展示了SwingConstants.LEADING属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isLeadingAlign
static boolean isLeadingAlign(Component component) {
int alignment;
if (component instanceof ProfilerRenderer) {
alignment = ((ProfilerRenderer)component).getHorizontalAlignment();
} else if (component instanceof JLabel) {
alignment = ((JLabel)component).getHorizontalAlignment();
} else {
alignment = SwingConstants.LEADING;
}
return alignment == SwingConstants.LEADING ||
alignment == SwingConstants.LEFT ||
alignment == SwingConstants.CENTER;
}
示例2: isLeftAligned
private boolean isLeftAligned(AbstractButton button, int position) {
if (position == SwingConstants.WEST) {
boolean ltr = button.getComponentOrientation().isLeftToRight();
int hAlign = button.getHorizontalAlignment();
return ((ltr && (hAlign == SwingConstants.LEFT ||
hAlign == SwingConstants.LEADING)) ||
(!ltr && (hAlign == SwingConstants.TRAILING)));
}
return false;
}
示例3: isRightAligned
private boolean isRightAligned(AbstractButton button, int position) {
if (position == SwingConstants.EAST) {
boolean ltr = button.getComponentOrientation().isLeftToRight();
int hAlign = button.getHorizontalAlignment();
return ((ltr && (hAlign == SwingConstants.RIGHT ||
hAlign == SwingConstants.TRAILING)) ||
(!ltr && (hAlign == SwingConstants.LEADING)));
}
return false;
}