public class StrokeBorder extends AbstractBorder
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 JavaBeans™ has been added to the java.beans package. Please see XMLEncoder.
| Constructor and Description |
|---|
StrokeBorder(BasicStroke
Creates a border of the specified
stroke.
|
StrokeBorder(BasicStroke
Creates a border of the specified
stroke and
paint.
|
| Modifier and Type | Method and Description |
|---|---|
Insets |
getBorderInsets(Component
Reinitializes the
insets parameter with this border's current insets.
|
Paint |
getPaint()
Returns the
Paint object used to generate a color during the border rendering.
|
BasicStroke |
getStroke()
Returns the
BasicStroke object used to stroke a shape during the border rendering.
|
void |
paintBorder(Component
Paints the border for the specified component with the specified position and size.
|
getBaseline, getBaselineResizeBehavior, getBorderInsets, getInteriorRectangle, getInteriorRectangle, isBorderOpaquepublic StrokeBorder(BasicStrokestroke)
stroke. The component's foreground color will be used to render the border.
stroke - the
BasicStroke object used to stroke a shape
NullPointerException - if the specified
stroke is
null
@ConstructorProperties(value={"stroke","paint"}) public StrokeBorder(BasicStrokestroke, Paint paint)
stroke and
paint. If the specified
paint is
null, the component's foreground color will be used to render the border.
stroke - the
BasicStroke object used to stroke a shape
paint - the
Paint object used to generate a color
NullPointerException - if the specified
stroke is
null
public void paintBorder(Componentc, Graphics g, int x, int y, int width, int height)
Paint object, the component's foreground color will be used to render the border. If the component's foreground color is not available, the default color of the
Graphics object will be used.
paintBorder in interface
Border
paintBorder in class
AbstractBorder
c - the component for which this border is being painted
g - the paint graphics
x - the x position of the painted border
y - the y position of the painted border
width - the width of the painted border
height - the height of the painted border
NullPointerException - if the specified
g is
null
public InsetsgetBorderInsets(Component c, Insets insets)
insets parameter with this border's current insets. Every inset is the smallest (closest to negative infinity) integer value that is greater than or equal to the line width of the stroke that is used to paint the border.
getBorderInsets in class
AbstractBorder
c - the component for which this border insets value applies
insets - the
Insets object to be reinitialized
insets parameter
NullPointerException - if the specified
insets is
null
Math.ceil(double)
public BasicStrokegetStroke()
BasicStroke object used to stroke a shape during the border rendering.
BasicStroke object