public class EmptyBorder extends AbstractBorder
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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.
|
getInteriorRectangle, getInteriorRectangle
protected int left
protected int right
protected int top
protected int bottom
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.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 Border
paintBorder
in class AbstractBorder
c
- 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 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)
getBorderInsets
in class AbstractBorder
insets
- 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 Border
isBorderOpaque
in class AbstractBorder
false
.