com.jstatcom.component
Class MatrixBorder
- java.lang.Object
-
- javax.swing.border.AbstractBorder
-
- com.jstatcom.component.MatrixBorder
-
- All Implemented Interfaces:
- java.io.Serializable, javax.swing.border.Border
public final class MatrixBorder extends javax.swing.border.AbstractBorderThis border puts angular brackets [ ] around a component. It can be used to visualize a matrix or a range object. The appearance of the brackets can be configured via the constructor, but reasonable defaults are provided by static factory methods as well.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description MatrixBorder()Creates the defaultMatrixBorderinstance.MatrixBorder(int thick, int width, int outerTop, int innerTop, int outerLeft, int innerLeft)Creates aMatrixBorderinstance according to spacing and size parameters.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.awt.InsetsgetBorderInsets(java.awt.Component c)Overrides super method.java.awt.InsetsgetBorderInsets(java.awt.Component c, java.awt.Insets insets)Reinitialize the insets parameter with this border's current insets.static MatrixBordergetInstanceSmall()Gets aMatrixBorderthat is smaller than the default, for example to be used with default sized text fields.static MatrixBordergetInstanceThick()Gets aMatrixBorderthat is thicker than the default.booleanisBorderOpaque()This default implementation returns false.voidpaintBorder(java.awt.Component c, java.awt.Graphics g, int x, int y, int width, int height)Called by the repaint manager to paint this border.
-
-
-
Constructor Detail
-
MatrixBorder
public MatrixBorder()
Creates the defaultMatrixBorderinstance.
-
MatrixBorder
public MatrixBorder(int thick, int width, int outerTop, int innerTop, int outerLeft, int innerLeft)Creates aMatrixBorderinstance according to spacing and size parameters. Instead of this constructor, the static factory methods can be called for some reasonable variations of the defaultMatrixBorder.- Parameters:
thick- border thickness, default is 1width- width of the brackets, default is 8outerTop- space between outer top and bracket, default is 1innerTop- space between bracket and top of component, default is 3outerLeft- space between outer left and bracket, default is 1innerLeft- space between bracket and left of component, default is 3
-
-
Method Detail
-
getBorderInsets
public java.awt.Insets getBorderInsets(java.awt.Component c)
Overrides super method.- Specified by:
getBorderInsetsin interfacejavax.swing.border.Border- Overrides:
getBorderInsetsin classjavax.swing.border.AbstractBorder- Parameters:
c- the component for which this border insets value applies- Returns:
- the insets
-
getBorderInsets
public java.awt.Insets getBorderInsets(java.awt.Component c, java.awt.Insets insets)Reinitialize the insets parameter with this border's current insets. Overrides super method.- Overrides:
getBorderInsetsin classjavax.swing.border.AbstractBorder- Parameters:
c- the component for which this border insets value appliesinsets- the object to be reinitialized- Returns:
- the insets
-
getInstanceSmall
public static MatrixBorder getInstanceSmall()
Gets aMatrixBorderthat is smaller than the default, for example to be used with default sized text fields.- Returns:
- a new border instance
-
getInstanceThick
public static MatrixBorder getInstanceThick()
Gets aMatrixBorderthat is thicker than the default.- Returns:
- a new border instance
-
isBorderOpaque
public boolean isBorderOpaque()
This default implementation returns false. Overrides super method.- Specified by:
isBorderOpaquein interfacejavax.swing.border.Border- Overrides:
isBorderOpaquein classjavax.swing.border.AbstractBorder- Returns:
- false
-
paintBorder
public void paintBorder(java.awt.Component c, java.awt.Graphics g, int x, int y, int width, int height)Called by the repaint manager to paint this border.- Specified by:
paintBorderin interfacejavax.swing.border.Border- Overrides:
paintBorderin classjavax.swing.border.AbstractBorder
-
-
DMelt 3.0 © DataMelt by jWork.ORG