Package org.opensourcephysics.display
Class CellBorder
java.lang.Object
javax.swing.border.AbstractBorder
org.opensourcephysics.display.CellBorder
- All Implemented Interfaces:
Serializable
,Border
A class which implements a line border on only the top and left hand side.
- Author:
- Wolfgang Christian
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCellBorder
(Color color) Creates a line border with the specified color and a thickness = 1.CellBorder
(Color color, int thickness) Creates a line border with the specified color and thickness. -
Method Summary
Modifier and TypeMethodDescriptionReturns the insets of the border.getBorderInsets
(Component c, Insets insets) Reinitialize the insets parameter with this Border's current Insets.Returns the color of the border.int
Returns the thickness of the border.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.Methods inherited from class javax.swing.border.AbstractBorder
getBaseline, getBaselineResizeBehavior, getInteriorRectangle, getInteriorRectangle, isBorderOpaque
-
Field Details
-
thickness
protected int thickness -
lineColor
-
-
Constructor Details
-
CellBorder
Creates a line border with the specified color and a thickness = 1.- Parameters:
color
- the color for the border
-
CellBorder
Creates a line border with the specified color and thickness.- Parameters:
color
- the color of the borderthickness
- the thickness of the border
-
-
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
Returns the insets of the border.- Specified by:
getBorderInsets
in interfaceBorder
- Overrides:
getBorderInsets
in classAbstractBorder
- Parameters:
c
- the component for which this border insets value applies
-
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.
-