@Override public void paint(Graphics g, JComponent c) { // yet another dirty mac hack to prevent painting background outside of // border. if (hasMacTextFieldBorder(c)) { Insets borderInsets = layoutAndBorder.getRealBorderInsets(); borderInsets.left -= MAC_MARGIN.left; int height = c.getHeight() - borderInsets.bottom - borderInsets.top + MAC_MARGIN.bottom + MAC_MARGIN.top; int width = c.getWidth() - borderInsets.left - borderInsets.right + MAC_MARGIN.right; g.clipRect(borderInsets.left, borderInsets.top, width, height); } super.paint(g, c); }
@Override public void paint(Graphics g, JComponent c) { // yet another dirty mac hack to prevent painting background outside of // border. if (hasMacTextFieldBorder(c)) { Insets borderInsets = layoutAndBorder.getRealBorderInsets(); borderInsets.left -= MAC_MARGIN.left; int height = c.getHeight() - borderInsets.bottom - borderInsets.top + MAC_MARGIN.bottom + MAC_MARGIN.top; int width = c.getWidth() - borderInsets.left - borderInsets.right + MAC_MARGIN.right; g.clipRect(borderInsets.left, borderInsets.top, width, height); } super.paint(g, c); }
@Override public void paint(Graphics g, JComponent c) { // yet another dirty mac hack to prevent painting background outside of // border. if (hasMacTextFieldBorder(c)) { Insets borderInsets = layoutAndBorder.getRealBorderInsets(); borderInsets.left -= MAC_MARGIN.left; int height = c.getHeight() - borderInsets.bottom - borderInsets.top + MAC_MARGIN.bottom + MAC_MARGIN.top; int width = c.getWidth() - borderInsets.left - borderInsets.right + MAC_MARGIN.right; g.clipRect(borderInsets.left, borderInsets.top, width, height); } super.paint(g, c); }
@Override public void paint(Graphics g, JComponent c) { // yet another dirty mac hack to prevent painting background outside of // border. if (hasMacTextFieldBorder(c)) { Insets borderInsets = layoutAndBorder.getRealBorderInsets(); borderInsets.left -= MAC_MARGIN.left; int height = c.getHeight() - borderInsets.bottom - borderInsets.top + MAC_MARGIN.bottom + MAC_MARGIN.top; int width = c.getWidth() - borderInsets.left - borderInsets.right + MAC_MARGIN.right; g.clipRect(borderInsets.left, borderInsets.top, width, height); } super.paint(g, c); }
@Override public Dimension preferredLayoutSize(Container parent) { Dimension d = new Dimension(); // height of highest buddy. for (Component c : BuddySupport.getLeft(textField)) { d.height = Math.max(d.height, c.getPreferredSize().height); } for (Component c : BuddySupport.getRight(textField)) { d.height = Math.max(d.height, c.getPreferredSize().height); } Insets insets = getRealBorderInsets(); d.height += insets.top + insets.bottom; d.width += insets.left + insets.right; Insets outerMargin = BuddySupport.getOuterMargin(textField); if (outerMargin != null) { d.width += outerMargin.left + outerMargin.right; d.height += outerMargin.bottom + outerMargin.top; } return d; }
@Override public Dimension preferredLayoutSize(Container parent) { Dimension d = new Dimension(); // height of highest buddy. for (Component c : BuddySupport.getLeft(textField)) { d.height = Math.max(d.height, c.getPreferredSize().height); } for (Component c : BuddySupport.getRight(textField)) { d.height = Math.max(d.height, c.getPreferredSize().height); } Insets insets = getRealBorderInsets(); d.height += insets.top + insets.bottom; d.width += insets.left + insets.right; Insets outerMargin = BuddySupport.getOuterMargin(textField); if (outerMargin != null) { d.width += outerMargin.left + outerMargin.right; d.height += outerMargin.bottom + outerMargin.top; } return d; }
@Override public Dimension preferredLayoutSize(Container parent) { Dimension d = new Dimension(); // height of highest buddy. for (Component c : BuddySupport.getLeft(textField)) { d.height = Math.max(d.height, c.getPreferredSize().height); } for (Component c : BuddySupport.getRight(textField)) { d.height = Math.max(d.height, c.getPreferredSize().height); } Insets insets = getRealBorderInsets(); d.height += insets.top + insets.bottom; d.width += insets.left + insets.right; Insets outerMargin = BuddySupport.getOuterMargin(textField); if (outerMargin != null) { d.width += outerMargin.left + outerMargin.right; d.height += outerMargin.bottom + outerMargin.top; } return d; }
@Override public Dimension preferredLayoutSize(Container parent) { Dimension d = new Dimension(); // height of highest buddy. for (Component c : BuddySupport.getLeft(textField)) { d.height = Math.max(d.height, c.getPreferredSize().height); } for (Component c : BuddySupport.getRight(textField)) { d.height = Math.max(d.height, c.getPreferredSize().height); } Insets insets = getRealBorderInsets(); d.height += insets.top + insets.bottom; d.width += insets.left + insets.right; Insets outerMargin = BuddySupport.getOuterMargin(textField); if (outerMargin != null) { d.width += outerMargin.left + outerMargin.right; d.height += outerMargin.bottom + outerMargin.top; } return d; }
/** * @return the rectangle allocated by the text field, including the space * allocated by the child components left and right, the text fields * original border insets and the outer margin. * */ protected Rectangle getVisibleRect() { Rectangle alloc = SwingUtilities.getLocalBounds(textField); substractInsets(alloc, getRealBorderInsets()); substractInsets(alloc, BuddySupport.getOuterMargin(textField)); return alloc; }
/** * @return the rectangle allocated by the text field, including the space * allocated by the child components left and right, the text fields * original border insets and the outer margin. * */ protected Rectangle getVisibleRect() { Rectangle alloc = SwingUtilities.getLocalBounds(textField); substractInsets(alloc, getRealBorderInsets()); substractInsets(alloc, BuddySupport.getOuterMargin(textField)); return alloc; }
/** * @return the rectangle allocated by the text field, including the space * allocated by the child components left and right, the text fields * original border insets and the outer margin. * */ protected Rectangle getVisibleRect() { Rectangle alloc = SwingUtilities.getLocalBounds(textField); substractInsets(alloc, getRealBorderInsets()); substractInsets(alloc, BuddySupport.getOuterMargin(textField)); return alloc; }
/** * @return the rectangle allocated by the text field, including the space * allocated by the child components left and right, the text fields * original border insets and the outer margin. * */ protected Rectangle getVisibleRect() { Rectangle alloc = SwingUtilities.getLocalBounds(textField); substractInsets(alloc, getRealBorderInsets()); substractInsets(alloc, BuddySupport.getOuterMargin(textField)); return alloc; }