Rectangle viewRect = vp.getViewRect(); int startingX = viewRect.x; boolean leftToRight = comp.getComponentOrientation().isLeftToRight(); int scrollMin = toScroll.getMinimum(); int scrollMax = toScroll.getMaximum() - toScroll.getModel().getExtent();
static boolean isLeftToRight( Component c ) { return c.getComponentOrientation().isLeftToRight(); }
int start = 0; boolean ttb = target.getComponentOrientation().isLeftToRight();
public void paintIcon(Component c, Graphics g, int x, int y) { if (c.getComponentOrientation().isLeftToRight()) { this.ltrIcon.paintIcon(c, g, x, y); } else { this.rtlIcon.paintIcon(c, g, x, y); } } }
/** * {@inheritDoc} */ public Insets getBorderInsets(Component c) { int horizontalInset = icon.getIconWidth() + (2 * padding); int iconPosition = bidiDecodeLeadingTrailing(c.getComponentOrientation(), this.iconPosition); if (iconPosition == SwingConstants.EAST) { return new Insets(0, 0, 0, horizontalInset); } return new Insets(0, horizontalInset, 0, 0); }
/** * {@inheritDoc} */ public Insets getBorderInsets(Component c) { int horizontalInset = icon.getIconWidth() + (2 * padding); int iconPosition = bidiDecodeLeadingTrailing(c.getComponentOrientation(), this.iconPosition); if (iconPosition == SwingConstants.EAST) { return new Insets(0, 0, 0, horizontalInset); } return new Insets(0, horizontalInset, 0, 0); }
public void paintIcon(final Component c, final Graphics graphics, final int x, final int y) { if (c.getComponentOrientation().isLeftToRight()) { _icon.paintIcon(c, graphics, x + _depth * SPACE, y); } else { _icon.paintIcon(c, graphics, x, y); } }
/** * {@inheritDoc} */ public Insets getBorderInsets(Component c) { int horizontalInset = icon.getIconWidth() + (2 * padding); int iconPosition = bidiDecodeLeadingTrailing(c.getComponentOrientation(), this.iconPosition); if (iconPosition == SwingConstants.EAST) { return new Insets(0, 0, 0, horizontalInset); } return new Insets(0, horizontalInset, 0, 0); }
@Override public void paintIcon(Component c, Graphics g, int x, int y) { if (icon == null) { return; } if (c.getComponentOrientation().isLeftToRight()) { icon.paintIcon(c, g, x+depth*space, y); } else { icon.paintIcon(c, g, x, y); } }
/** Convenience function for determining ComponentOrientation. Helps us * avoid having Munge directives throughout the code. */ static boolean isLeftToRight(Component c) { return c.getComponentOrientation().isLeftToRight(); } }
@Override public Insets getBorderInsets(Component c) { boolean ltr = c.getComponentOrientation().isLeftToRight(); return new Insets(0, ltr ? 1 : 0, 0, ltr ? 0 : 1); }
/** * {@inheritDoc} */ public Insets getBorderInsets(Component c) { int horizontalInset = icon.getIconWidth() + (2 * padding); int iconPosition = bidiDecodeLeadingTrailing(c.getComponentOrientation(), this.iconPosition); if (iconPosition == SwingConstants.EAST) { return new Insets(0, 0, 0, horizontalInset); } return new Insets(0, horizontalInset, 0, 0); }
public static boolean isLeftToRight(Component c) { if (c == null) { return true; } return c.getComponentOrientation().isLeftToRight(); }
public void paintIcon(Component c, Graphics g, int x, int y) { if (c.getComponentOrientation().isLeftToRight()) { icon.paintIcon(c, g, x + depth * space, y); } else { icon.paintIcon(c, g, x, y); } }
private int getJustification(Component c) { int justification = getTitleJustification(); if ((justification == LEADING) || (justification == DEFAULT_JUSTIFICATION)) { return c.getComponentOrientation().isLeftToRight() ? LEFT : RIGHT; } if (justification == TRAILING) { return c.getComponentOrientation().isLeftToRight() ? RIGHT : LEFT; } return justification; }
@Override public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { g.setColor(FlamingoUtilities.getColor(Color.gray, "Label.disabledForeground")); boolean ltr = c.getComponentOrientation().isLeftToRight(); int xToPaint = ltr ? x : x + width - 1; g.drawLine(xToPaint, y, xToPaint, y + height); } });
private static Point getFeedbackComponentOrigin(JComponent feedbackComponent, Component contentComponent) { boolean isLTR = contentComponent.getComponentOrientation().isLeftToRight(); int x = contentComponent.getX() + (isLTR ? 0 : contentComponent.getWidth() - 1) - feedbackComponent.getWidth() / 2; int y = contentComponent.getY() + contentComponent.getHeight() - feedbackComponent.getHeight() + 2; return new Point(x, y); }
static ShadowPopup getInstance(Component owner, Popup delegate, JPopupMenu contents, int x, int y) { if(SHADOW_POPUP_CACHE.empty()) { return new ShadowPopup(owner, delegate, contents, x, y); } ShadowPopup popup = (ShadowPopup)SHADOW_POPUP_CACHE.pop(); popup.init(owner, delegate, contents, x, y); if(DEBUG) System.out.println("ShadowPopup.getInstance, cache.size=" + SHADOW_POPUP_CACHE.size() + ", orientation is " + (owner.getComponentOrientation().isLeftToRight() ? "left-to-right" : "right-to-left")); return popup; }
private JLabel getLabel(Component c) { this.label.setText(getTitle()); this.label.setFont(getFont(c)); this.label.setForeground(getColor(c)); this.label.setComponentOrientation(c.getComponentOrientation()); this.label.setEnabled(c.isEnabled()); return this.label; } }
@Override public void paintIcon(Component c, Graphics g, int x, int y) { if (c.getComponentOrientation().isLeftToRight()) { x = paintOtherIcon(c, g, x, y); paintArrowIcon(c, g, x, y); } else { x = paintArrowIcon(c, g, x, y); paintOtherIcon(c, g, x, y); } }