Package org.jdesktop.swingx.plaf
Class BuddyLayoutAndBorder
- java.lang.Object
-
- org.jdesktop.swingx.plaf.BuddyLayoutAndBorder
-
- All Implemented Interfaces:
LayoutManager,PropertyChangeListener,EventListener,Border,UIResource
public class BuddyLayoutAndBorder extends Object implements LayoutManager, Border, PropertyChangeListener, UIResource
-
-
Constructor Summary
Constructors Constructor Description BuddyLayoutAndBorder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddLayoutComponent(String name, Component comp)Does nothing.protected intcenterY(Rectangle rect, Dimension size)BordergetBorderDelegate()InsetsgetBorderInsets(Component c)InsetsgetRealBorderInsets()Returns the insets of the original border (without the margin! Beware ofBasicBorders.MarginBorder!).protected RectanglegetVisibleRect()protected voidinstall(JTextField textField)Installs aBuddyLayoutAndBorderas a layout and border of the given text field.booleanisBorderOpaque()voidlayoutContainer(Container parent)DimensionminimumLayoutSize(Container parent)voidpaintBorder(Component c, Graphics g, int x, int y, int width, int height)DimensionpreferredLayoutSize(Container parent)voidpropertyChange(PropertyChangeEvent evt)voidremoveLayoutComponent(Component comp)Does nothing.protected voidreplaceBorderIfNecessary()Wraps and replaces the text fields default border with this object, to honor the button margins and sizes of the search, clear and popup buttons and the layout style.StringtoString()voiduninstall()
-
-
-
Method Detail
-
install
protected void install(JTextField textField)
Installs aBuddyLayoutAndBorderas a layout and border of the given text field. Registers aPropertyChangeListenerto wrap any subsequently set border on the text field.
-
getBorderDelegate
public Border getBorderDelegate()
-
replaceBorderIfNecessary
protected void replaceBorderIfNecessary()
Wraps and replaces the text fields default border with this object, to honor the button margins and sizes of the search, clear and popup buttons and the layout style.
-
addLayoutComponent
public void addLayoutComponent(String name, Component comp)
Does nothing.- Specified by:
addLayoutComponentin interfaceLayoutManager- See Also:
BuddySupport#add(javax.swing.JComponent, Position, JTextField)
-
minimumLayoutSize
public Dimension minimumLayoutSize(Container parent)
- Specified by:
minimumLayoutSizein interfaceLayoutManager
-
preferredLayoutSize
public Dimension preferredLayoutSize(Container parent)
- Specified by:
preferredLayoutSizein interfaceLayoutManager
-
removeLayoutComponent
public void removeLayoutComponent(Component comp)
Does nothing.- Specified by:
removeLayoutComponentin interfaceLayoutManager- See Also:
BuddySupport.remove(javax.swing.JComponent, JTextField)
-
layoutContainer
public void layoutContainer(Container parent)
- Specified by:
layoutContainerin interfaceLayoutManager
-
getVisibleRect
protected Rectangle getVisibleRect()
- Returns:
- 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.
-
getBorderInsets
public Insets getBorderInsets(Component c)
- Specified by:
getBorderInsetsin interfaceBorder- See Also:
Border.getBorderInsets(java.awt.Component)
-
getRealBorderInsets
public Insets getRealBorderInsets()
Returns the insets of the original border (without the margin! Beware ofBasicBorders.MarginBorder!).- Returns:
- the insets of the border delegate
-
isBorderOpaque
public boolean isBorderOpaque()
- Specified by:
isBorderOpaquein interfaceBorder
-
paintBorder
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height)
- Specified by:
paintBorderin interfaceBorder
-
propertyChange
public void propertyChange(PropertyChangeEvent evt)
- Specified by:
propertyChangein interfacePropertyChangeListener
-
uninstall
public void uninstall()
-
-