public class BuddyLayoutAndBorder extends Object implements LayoutManager, Border, PropertyChangeListener, UIResource
Modifier and Type | Field and Description |
---|---|
private Border |
borderDelegate |
private JTextField |
textField |
Constructor and Description |
---|
BuddyLayoutAndBorder() |
Modifier and Type | Method and 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!
|
protected Rectangle |
getVisibleRect() |
protected void |
install(JTextField textField)
Installs a
BuddyLayoutAndBorder 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.
|
private void |
substractInsets(Rectangle alloc,
Insets insets) |
String |
toString() |
void |
uninstall() |
private JTextField textField
private Border borderDelegate
public BuddyLayoutAndBorder()
protected void install(JTextField textField)
BuddyLayoutAndBorder
as a layout and border of the
given text field. Registers a PropertyChangeListener
to wrap any
subsequently set border on the text field.public Border getBorderDelegate()
protected void replaceBorderIfNecessary()
public void addLayoutComponent(String name, Component comp)
addLayoutComponent
in interface LayoutManager
BuddySupport#add(javax.swing.JComponent, Position, JTextField)
public Dimension minimumLayoutSize(Container parent)
minimumLayoutSize
in interface LayoutManager
public Dimension preferredLayoutSize(Container parent)
preferredLayoutSize
in interface LayoutManager
public void removeLayoutComponent(Component comp)
removeLayoutComponent
in interface LayoutManager
BuddySupport.remove(javax.swing.JComponent, JTextField)
public void layoutContainer(Container parent)
layoutContainer
in interface LayoutManager
protected Rectangle getVisibleRect()
private void substractInsets(Rectangle alloc, Insets insets)
public Insets getBorderInsets(Component c)
getBorderInsets
in interface Border
Border.getBorderInsets(java.awt.Component)
public Insets getRealBorderInsets()
BasicBorders.MarginBorder
!).public boolean isBorderOpaque()
isBorderOpaque
in interface Border
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height)
paintBorder
in interface Border
public void propertyChange(PropertyChangeEvent evt)
propertyChange
in interface PropertyChangeListener
public void uninstall()
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses