Package hec.gfx2d
Class G2dBorder
java.lang.Object
javax.swing.border.AbstractBorder
hec.gfx2d.G2dBorder
- All Implemented Interfaces:
Serializable
,Border
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected float[]
protected Color
protected boolean
protected int
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a line border with the specified color and a thickness = 1.Creates a line border with the specified color and thickness.Creates a line border with the specified color, thickness, and corner shape. -
Method Summary
Modifier and TypeMethodDescriptiongetBorderInsets
(Component c, Insets insets) Reinitialize the insets parameter with this Border's current Insets.float[]
Returns the color of the border.boolean
Returns whether this border will be drawn with rounded corners.int
Returns the thickness of the border.boolean
Returns whether or not the border is opaque.void
paintBorder
(Component c, Graphics g, int x, int y, int width, int height) Paints the border for the specified component with the specified position and size.void
setBorderStyle
(float[] borderStyle) Methods inherited from class javax.swing.border.AbstractBorder
getBaseline, getBaselineResizeBehavior, getBorderInsets, getInteriorRectangle, getInteriorRectangle
-
Field Details
-
thickness
protected int thickness -
lineColor
-
roundedCorners
protected boolean roundedCorners -
borderStyle
protected float[] borderStyle
-
-
Constructor Details
-
G2dBorder
Creates a line border with the specified color and a thickness = 1.- Parameters:
color
- the color for the border
-
G2dBorder
Creates a line border with the specified color and thickness.- Parameters:
color
- the color of the borderthickness
- the thickness of the border
-
G2dBorder
@ConstructorProperties({"lineColor","thickness","borderStyle"}) public G2dBorder(Color color, int thickness, float[] borderStyle) Creates a line border with the specified color, thickness, and corner shape.- Parameters:
color
- the color of the borderthickness
- the thickness of the border- Since:
- 1.3
-
-
Method Details
-
paintBorder
Paints the border for the specified component with the specified position and size.- Specified by:
paintBorder
in interfaceBorder
- Overrides:
paintBorder
in classAbstractBorder
- Parameters:
c
- the component for which this border is being paintedg
- the paint graphicsx
- the x position of the painted bordery
- the y position of the painted borderwidth
- the width of the painted borderheight
- the height of the painted border
-
getBorderInsets
Reinitialize the insets parameter with this Border's current Insets.- Overrides:
getBorderInsets
in classAbstractBorder
- Parameters:
c
- the component for which this border insets value appliesinsets
- the object to be reinitialized
-
getLineColor
Returns the color of the border. -
getThickness
public int getThickness()Returns the thickness of the border. -
getRoundedCorners
public boolean getRoundedCorners()Returns whether this border will be drawn with rounded corners.- Since:
- 1.3
-
isBorderOpaque
public boolean isBorderOpaque()Returns whether or not the border is opaque.- Specified by:
isBorderOpaque
in interfaceBorder
- Overrides:
isBorderOpaque
in classAbstractBorder
-
getBorderStyle
public float[] getBorderStyle() -
setBorderStyle
public void setBorderStyle(float[] borderStyle)
-