本文整理匯總了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;
}