public Dimension getPreferredSize(JComponent c) { AbstractButton b = (AbstractButton) c; return BasicGraphicsUtils.getPreferredButtonSize(b, b.getIconTextGap()); }
@Override public Dimension getPreferredSize(JComponent c) { AbstractButton b = (AbstractButton) c; Dimension d = BasicGraphicsUtils.getPreferredButtonSize(b, b.getIconTextGap()); if (JideSwingUtilities.getOrientationOf(c) == SwingConstants.HORIZONTAL) { return d; } else { return new Dimension(d.height, d.width); // swap width and height } }
/** * {@inheritDoc} */ @Override public Dimension getPreferredSize() { if (getComponentCount() == 1 && getComponent(0) instanceof CellRendererPane) { return BasicGraphicsUtils.getPreferredButtonSize(fgStamp, getIconTextGap()); } return super.getPreferredSize(); }
/** * {@inheritDoc} */ @Override public Dimension getPreferredSize() { if (getComponentCount() == 1 && getComponent(0) instanceof CellRendererPane) { return BasicGraphicsUtils.getPreferredButtonSize(fgStamp, getIconTextGap()); } return super.getPreferredSize(); }
/** * {@inheritDoc} */ @Override public Dimension getPreferredSize() { if (getComponentCount() == 1 && getComponent(0) instanceof CellRendererPane) { return BasicGraphicsUtils.getPreferredButtonSize(fgStamp, getIconTextGap()); } return super.getPreferredSize(); }
/** * {@inheritDoc} */ @Override public Dimension getPreferredSize() { if (getComponentCount() == 1 && getComponent(0) instanceof CellRendererPane) { return BasicGraphicsUtils.getPreferredButtonSize(fgStamp, getIconTextGap()); } return super.getPreferredSize(); }
@Override public Dimension getPreferredSize(JComponent c) { if (!(c instanceof JMenu) || !((JMenu) c).isTopLevelMenu()) { return super.getPreferredSize(c); } AbstractButton b = (AbstractButton) c; boolean isHorizontal = true; if (JideSwingUtilities.getOrientationOf(c) == SwingConstants.VERTICAL) { isHorizontal = false; } // JDK PORTING HINT // JDK1.3: No getIconTextGap, use defaultTextIconGap Dimension d = BasicGraphicsUtils.getPreferredButtonSize(b, defaultTextIconGap); // d.width += b.getMargin().left + b.getMargin().right; // d.height += b.getMargin().bottom + b.getMargin().top; int size = ((JMenu) menuItem).isTopLevelMenu() ? _splitButtonMargin : _splitButtonMarginOnMenu; d.width += size; if (isHorizontal) return d; else return new Dimension(d.height, d.width); // swap width and height }
@Override public Dimension getPreferredSize(JComponent c) { if (!(c instanceof JMenu) || !((JMenu) c).isTopLevelMenu()) { return super.getPreferredSize(c); } AbstractButton b = (AbstractButton) c; boolean isHorizontal = true; if (JideSwingUtilities.getOrientationOf(c) == SwingConstants.VERTICAL) { isHorizontal = false; } // JDK PORTING HINT // JDK1.3: No getIconTextGap, use defaultTextIconGap Dimension d = BasicGraphicsUtils.getPreferredButtonSize(b, defaultTextIconGap); // d.width += b.getMargin().left + b.getMargin().right; // d.height += b.getMargin().bottom + b.getMargin().top; int size = ((JMenu) menuItem).isTopLevelMenu() ? _splitButtonMargin : _splitButtonMarginOnMenu; d.width += size; if (isHorizontal) return d; else return new Dimension(d.height, d.width); // swap width and height }