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 TypeMethodDescriptionvoid
addLayoutComponent
(String name, Component comp) Does nothing.protected int
Returns the insets of the original border (without the margin!protected Rectangle
protected void
install
(JTextField textField) Installs aBuddyLayoutAndBorder
as a layout and border of the given text field.boolean
void
layoutContainer
(Container parent) minimumLayoutSize
(Container parent) void
paintBorder
(Component c, Graphics g, int x, int y, int width, int height) preferredLayoutSize
(Container parent) void
void
Does nothing.protected void
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.toString()
void
-
Constructor Details
-
BuddyLayoutAndBorder
public BuddyLayoutAndBorder()
-
-
Method Details
-
getBorderDelegate
-
install
Installs aBuddyLayoutAndBorder
as a layout and border of the given text field. Registers aPropertyChangeListener
to 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:
addLayoutComponent
in interfaceLayoutManager
-
minimumLayoutSize
- Specified by:
minimumLayoutSize
in interfaceLayoutManager
-
preferredLayoutSize
- Specified by:
preferredLayoutSize
in interfaceLayoutManager
-
removeLayoutComponent
Does nothing.- Specified by:
removeLayoutComponent
in interfaceLayoutManager
- See Also:
-
layoutContainer
- Specified by:
layoutContainer
in 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:
getBorderInsets
in 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:
isBorderOpaque
in interfaceBorder
-
paintBorder
- Specified by:
paintBorder
in interfaceBorder
-
propertyChange
implements PropertyChangeListener
- Specified by:
propertyChange
in interfacePropertyChangeListener
-
toString
-