|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.swing.border.AbstractBorder
javax.swing.border.EmptyBorder
public class EmptyBorder
A border for leaving a specifiable number of pixels empty around the enclosed component. An EmptyBorder requires some space on each edge, but does not perform any drawing.
| Field Summary | |
|---|---|
protected int |
bottom
The number of pixels required at the bottom edge. |
protected int |
left
The number of pixels required at the left edge. |
protected int |
right
The number of pixels required at the right edge. |
protected int |
top
The number of pixels required at the top edge. |
| Constructor Summary | |
|---|---|
EmptyBorder(Insets borderInsets)
Constructs an empty border given the number of pixels required on each side, passed in an Insets object. |
|
EmptyBorder(int top,
int left,
int bottom,
int right)
Constructs an empty border given the number of pixels required on each side. |
|
| Method Summary | |
|---|---|
Insets |
getBorderInsets()
Measures the width of this border. |
Insets |
getBorderInsets(Component c)
Measures the width of this border. |
Insets |
getBorderInsets(Component c,
Insets insets)
Measures the width of this border, storing the results into a pre-existing Insets object. |
boolean |
isBorderOpaque()
Determines whether this border fills every pixel in its area when painting. |
void |
paintBorder(Component c,
Graphics g,
int x,
int y,
int width,
int height)
Performs nothing because an EmptyBorder does not paint any pixels. |
| Methods inherited from class javax.swing.border.AbstractBorder |
|---|
getInteriorRectangle, getInteriorRectangle |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int left
protected int right
protected int top
protected int bottom
| Constructor Detail |
|---|
public EmptyBorder(int top,
int left,
int bottom,
int right)
top - the number of pixels that the border will need
for its top edge.left - the number of pixels that the border will need
for its left edge.bottom - the number of pixels that the border will need
for its bottom edge.right - the number of pixels that the border will need
for its right edge.public EmptyBorder(Insets borderInsets)
borderInsets - the Insets for the new border.| Method Detail |
|---|
public void paintBorder(Component c,
Graphics g,
int x,
int y,
int width,
int height)
AbstractBorder.paintBorder(java.awt.Component, java.awt.Graphics, int, int, int, int) is a no-op as well,
it is overwritten in order to match the API of the Sun
reference implementation.
paintBorder in interface BorderpaintBorder in class AbstractBorderc - the component whose border is to be painted.g - the graphics for painting.x - the horizontal position for painting the border.y - the vertical position for painting the border.width - the width of the available area for painting the border.height - the height of the available area for painting the border.public Insets getBorderInsets(Component c)
getBorderInsets in interface BordergetBorderInsets in class AbstractBorderc - 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)
getBorderInsets in class AbstractBorderinsets - an Insets object for holding the result values.
After invoking this method, the left,
right, top and
bottom fields indicate the width of the
border at the respective edge.c - the component that the border applies to (ignored here,
subclasses may use it).
insets.getBorderInsets()public Insets getBorderInsets()
left, right,
top and bottom fields indicate the
width of the border at the respective edge.getBorderInsets(java.awt.Component, java.awt.Insets)public boolean isBorderOpaque()
false.
isBorderOpaque in interface BorderisBorderOpaque in class AbstractBorderfalse.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||