AbstractBorderpublic abstract class AbstractBorder extends Object implements Serializable, BorderA class that implements an empty border with no size.
This provides a convenient base class from which other border
classes can be easily derived.
Warning:
Serialized objects of this class will not be compatible with
future Swing releases. The current serialization support is
appropriate for short term storage or RMI between applications running
the same version of Swing. As of 1.4, support for long term storage
of all JavaBeansTM
has been added to the java.beans package.
Please see {@link java.beans.XMLEncoder}. |
Methods Summary |
---|
public java.awt.Insets | getBorderInsets(java.awt.Component c)This default implementation returns a new Insets
instance where the top , left ,
bottom , and
right fields are set to 0 .
return new Insets(0, 0, 0, 0);
| public java.awt.Insets | getBorderInsets(java.awt.Component c, java.awt.Insets insets)Reinitializes the insets parameter with this Border's current Insets.
insets.left = insets.top = insets.right = insets.bottom = 0;
return insets;
| public java.awt.Rectangle | getInteriorRectangle(java.awt.Component c, int x, int y, int width, int height)This convenience method calls the static method.
return getInteriorRectangle(c, this, x, y, width, height);
| public static java.awt.Rectangle | getInteriorRectangle(java.awt.Component c, javax.swing.border.Border b, int x, int y, int width, int height)Returns a rectangle using the arguments minus the
insets of the border. This is useful for determining the area
that components should draw in that will not intersect the border.
Insets insets;
if(b != null)
insets = b.getBorderInsets(c);
else
insets = new Insets(0, 0, 0, 0);
return new Rectangle(x + insets.left,
y + insets.top,
width - insets.right - insets.left,
height - insets.top - insets.bottom);
| public boolean | isBorderOpaque()This default implementation returns false. return false;
| static boolean | isLeftToRight(java.awt.Component c)
return c.getComponentOrientation().isLeftToRight();
| public void | paintBorder(java.awt.Component c, java.awt.Graphics g, int x, int y, int width, int height)This default implementation does no painting.
|
|