/** * {@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); }
/** * {@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); }
/** * {@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 void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { int iconPosition = bidiDecodeLeadingTrailing(c.getComponentOrientation(), this.iconPosition); if (iconPosition == SwingConstants.NORTH_EAST) { iconBounds.y = y + padding; iconBounds.x = x + width - padding - icon.getIconWidth(); } else if (iconPosition == SwingConstants.EAST) { // EAST iconBounds.y = y + ((height - icon.getIconHeight()) / 2); iconBounds.x = x + width - padding - icon.getIconWidth(); } else if (iconPosition == SwingConstants.WEST) { iconBounds.y = y + ((height - icon.getIconHeight()) / 2); iconBounds.x = x + padding; } iconBounds.width = icon.getIconWidth(); iconBounds.height = icon.getIconHeight(); icon.paintIcon(c, g, iconBounds.x, iconBounds.y); }
/** * {@inheritDoc} */ public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { int iconPosition = bidiDecodeLeadingTrailing(c.getComponentOrientation(), this.iconPosition); if (iconPosition == SwingConstants.NORTH_EAST) { iconBounds.y = y + padding; iconBounds.x = x + width - padding - icon.getIconWidth(); } else if (iconPosition == SwingConstants.EAST) { // EAST iconBounds.y = y + ((height - icon.getIconHeight()) / 2); iconBounds.x = x + width - padding - icon.getIconWidth(); } else if (iconPosition == SwingConstants.WEST) { iconBounds.y = y + ((height - icon.getIconHeight()) / 2); iconBounds.x = x + padding; } iconBounds.width = icon.getIconWidth(); iconBounds.height = icon.getIconHeight(); icon.paintIcon(c, g, iconBounds.x, iconBounds.y); }
/** * {@inheritDoc} */ public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { int iconPosition = bidiDecodeLeadingTrailing(c.getComponentOrientation(), this.iconPosition); if (iconPosition == SwingConstants.NORTH_EAST) { iconBounds.y = y + padding; iconBounds.x = x + width - padding - icon.getIconWidth(); } else if (iconPosition == SwingConstants.EAST) { // EAST iconBounds.y = y + ((height - icon.getIconHeight()) / 2); iconBounds.x = x + width - padding - icon.getIconWidth(); } else if (iconPosition == SwingConstants.WEST) { iconBounds.y = y + ((height - icon.getIconHeight()) / 2); iconBounds.x = x + padding; } iconBounds.width = icon.getIconWidth(); iconBounds.height = icon.getIconHeight(); icon.paintIcon(c, g, iconBounds.x, iconBounds.y); }
/** * {@inheritDoc} */ public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { int iconPosition = bidiDecodeLeadingTrailing(c.getComponentOrientation(), this.iconPosition); if (iconPosition == SwingConstants.NORTH_EAST) { iconBounds.y = y + padding; iconBounds.x = x + width - padding - icon.getIconWidth(); } else if (iconPosition == SwingConstants.EAST) { // EAST iconBounds.y = y + ((height - icon.getIconHeight()) / 2); iconBounds.x = x + width - padding - icon.getIconWidth(); } else if (iconPosition == SwingConstants.WEST) { iconBounds.y = y + ((height - icon.getIconHeight()) / 2); iconBounds.x = x + padding; } iconBounds.width = icon.getIconWidth(); iconBounds.height = icon.getIconHeight(); icon.paintIcon(c, g, iconBounds.x, iconBounds.y); }
/** * {@inheritDoc} */ public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { int iconPosition = bidiDecodeLeadingTrailing(c.getComponentOrientation(), this.iconPosition); if (iconPosition == SwingConstants.NORTH_EAST) { iconBounds.y = y + padding; iconBounds.x = x + width - padding - icon.getIconWidth(); } else if (iconPosition == SwingConstants.EAST) { // EAST iconBounds.y = y + ((height - icon.getIconHeight()) / 2); iconBounds.x = x + width - padding - icon.getIconWidth(); } else if (iconPosition == SwingConstants.WEST) { iconBounds.y = y + ((height - icon.getIconHeight()) / 2); iconBounds.x = x + padding; } iconBounds.width = icon.getIconWidth(); iconBounds.height = icon.getIconHeight(); icon.paintIcon(c, g, iconBounds.x, iconBounds.y); }