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 void
addLayoutComponent(String name, Component comp)
Does nothing.protected int
centerY(Rectangle rect, Dimension size)
Border
getBorderDelegate()
Insets
getBorderInsets(Component c)
Insets
getRealBorderInsets()
Returns the insets of the original border (without the margin! Beware ofBasicBorders.MarginBorder
!).protected Rectangle
getVisibleRect()
protected void
install(JTextField textField)
Installs aBuddyLayoutAndBorder
as a layout and border of the given text field.boolean
isBorderOpaque()
void
layoutContainer(Container parent)
Dimension
minimumLayoutSize(Container parent)
void
paintBorder(Component c, Graphics g, int x, int y, int width, int height)
Dimension
preferredLayoutSize(Container parent)
void
propertyChange(PropertyChangeEvent evt)
void
removeLayoutComponent(Component comp)
Does nothing.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.String
toString()
void
uninstall()
-
-
-
Method Detail
-
install
protected void install(JTextField textField)
Installs aBuddyLayoutAndBorder
as a layout and border of the given text field. Registers aPropertyChangeListener
to 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:
addLayoutComponent
in interfaceLayoutManager
- See Also:
BuddySupport#add(javax.swing.JComponent, Position, JTextField)
-
minimumLayoutSize
public Dimension minimumLayoutSize(Container parent)
- Specified by:
minimumLayoutSize
in interfaceLayoutManager
-
preferredLayoutSize
public Dimension preferredLayoutSize(Container parent)
- Specified by:
preferredLayoutSize
in interfaceLayoutManager
-
removeLayoutComponent
public void removeLayoutComponent(Component comp)
Does nothing.- Specified by:
removeLayoutComponent
in interfaceLayoutManager
- See Also:
BuddySupport.remove(javax.swing.JComponent, JTextField)
-
layoutContainer
public void layoutContainer(Container parent)
- Specified by:
layoutContainer
in 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:
getBorderInsets
in 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:
isBorderOpaque
in interfaceBorder
-
paintBorder
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height)
- Specified by:
paintBorder
in interfaceBorder
-
propertyChange
public void propertyChange(PropertyChangeEvent evt)
- Specified by:
propertyChange
in interfacePropertyChangeListener
-
uninstall
public void uninstall()
-
-