|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.border.AbstractBorder
javax.swing.plaf.basic.BasicBorders.MarginBorder
public static class BasicBorders.MarginBorder
An invisible, but spacing border whose margin is determined
by calling the getMargin()
method of the enclosed
component. If the enclosed component has no such method,
this border will not occupy any space.
Constructor Summary | |
---|---|
BasicBorders.MarginBorder()
Constructs a new MarginBorder. |
Method Summary | |
---|---|
Insets |
getBorderInsets(Component c)
Measures the width of this border. |
Insets |
getBorderInsets(Component c,
Insets insets)
Determines the insets of this border by calling the getMargin() method of the enclosed component. |
Methods inherited from class javax.swing.border.AbstractBorder |
---|
getInteriorRectangle, getInteriorRectangle, isBorderOpaque, paintBorder |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BasicBorders.MarginBorder()
Method Detail |
---|
public Insets getBorderInsets(Component c)
getBorderInsets
in interface Border
getBorderInsets
in class AbstractBorder
c
- the component whose border is to be measured.
left
, right
,
top
and bottom
fields indicate the
width of the border at the respective edge.getBorderInsets(java.awt.Component, java.awt.Insets)
public Insets getBorderInsets(Component c, Insets insets)
getMargin()
method of the enclosed component. The
resulting margin will be stored into the the left
,
right
, top
and bottom
fields of the passed insets
parameter.
Unfortunately, getMargin()
is not a method of
JComponent
or some other common superclass
of things with margins. While reflection could be used to
determine the existence of this method, this would be slow on
many virtual machines. Therefore, the current implementation
knows about AbstractButton.getMargin()
,
JPopupMenu.getMargin()
, JToolBar.getMargin()
, and JTextComponent
. If c
is an
instance of a known class, the respective
getMargin()
method is called to determine the
correct margin. Otherwise, a zero-width margin is returned.
getBorderInsets
in class AbstractBorder
c
- the component whose border is to be measured.insets
- an instance that will be overwritten and returned as the
result (null
not permitted).
insets
,
but with changed fields.AbstractBorder.getBorderInsets(Component)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |