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 -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLayoutComponent(String name, Component comp) Does nothing.protected intReturns the insets of the original border (without the margin!protected Rectangleprotected voidinstall(JTextField textField) Installs aBuddyLayoutAndBorderas a layout and border of the given text field.booleanvoidlayoutContainer(Container parent) minimumLayoutSize(Container parent) voidpaintBorder(Component c, Graphics g, int x, int y, int width, int height) preferredLayoutSize(Container parent) voidvoidDoes nothing.protected voidWraps 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.toString()void
-
Constructor Details
-
BuddyLayoutAndBorder
public BuddyLayoutAndBorder()
-
-
Method Details
-
getBorderDelegate
-
install
Installs aBuddyLayoutAndBorderas a layout and border of the given text field. Registers aPropertyChangeListenerto wrap any subsequently set border on the text field.- Parameters:
textField- JTextField
-
uninstall
public void uninstall() -
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
Does nothing.- Specified by:
addLayoutComponentin interfaceLayoutManager
-
minimumLayoutSize
- Specified by:
minimumLayoutSizein interfaceLayoutManager
-
preferredLayoutSize
- Specified by:
preferredLayoutSizein interfaceLayoutManager
-
removeLayoutComponent
Does nothing.- Specified by:
removeLayoutComponentin interfaceLayoutManager- See Also:
-
layoutContainer
- Specified by:
layoutContainerin interfaceLayoutManager
-
centerY
- Parameters:
rect- Rectanglesize- Dimension- Returns:
- center of 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
- Specified by:
getBorderInsetsin interfaceBorder- See Also:
-
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
- Specified by:
paintBorderin interfaceBorder
-
propertyChange
implements PropertyChangeListener
- Specified by:
propertyChangein interfacePropertyChangeListener
-
toString
-