public class BuddyLayoutAndBorder extends Object implements LayoutManager, Border, PropertyChangeListener, UIResource
| 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! Beware of
BasicBorders.MarginBorder!). |
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.
|
String |
toString() |
void |
uninstall() |
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 LayoutManagerBuddySupport#add(javax.swing.JComponent, Position, JTextField)public Dimension minimumLayoutSize(Container parent)
minimumLayoutSize in interface LayoutManagerpublic Dimension preferredLayoutSize(Container parent)
preferredLayoutSize in interface LayoutManagerpublic void removeLayoutComponent(Component comp)
removeLayoutComponent in interface LayoutManagerBuddySupport.remove(javax.swing.JComponent, JTextField)public void layoutContainer(Container parent)
layoutContainer in interface LayoutManagerprotected Rectangle getVisibleRect()
public Insets getBorderInsets(Component c)
getBorderInsets in interface BorderBorder.getBorderInsets(java.awt.Component)public Insets getRealBorderInsets()
BasicBorders.MarginBorder!).public boolean isBorderOpaque()
isBorderOpaque in interface Borderpublic void paintBorder(Component c, Graphics g, int x, int y, int width, int height)
paintBorder in interface Borderpublic void propertyChange(PropertyChangeEvent evt)
propertyChange in interface PropertyChangeListenerpublic void uninstall()
Copyright © 2017. All Rights Reserved.