Package ca.cgjennings.ui
Class CapsuleBorder
- java.lang.Object
-
- javax.swing.border.AbstractBorder
-
- ca.cgjennings.ui.CapsuleBorder
-
- All Implemented Interfaces:
java.io.Serializable
,javax.swing.border.Border
public class CapsuleBorder extends javax.swing.border.AbstractBorder
Draws a border with a horizontal capsule shape, rounded on the ends and with an optional thin border along the top and/or bottom.- Since:
- 3.0
- Author:
- Chris Jennings
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CapsuleBorder()
CapsuleBorder(int top, int bottom, int capWidth)
CapsuleBorder(java.awt.Paint borderPaint, java.awt.Paint capPaint)
CapsuleBorder(java.awt.Paint borderPaint, java.awt.Paint capPaint, int top, int bottom, int capWidth)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.Insets
getBorderInsets(java.awt.Component c)
java.awt.Insets
getBorderInsets(java.awt.Component c, java.awt.Insets insets)
java.awt.Paint
getBorderPaint()
int
getBottom()
java.awt.Paint
getCapPaint()
int
getCapWidth()
int
getTop()
boolean
isBorderOpaque()
void
paintBorder(java.awt.Component c, java.awt.Graphics g1, int x, int y, int width, int height)
void
setBorderPaint(java.awt.Paint borderPaint)
void
setBottom(int bottom)
void
setCapPaint(java.awt.Paint capPaint)
void
setCapWidth(int capWidth)
void
setTop(int top)
-
-
-
Constructor Detail
-
CapsuleBorder
public CapsuleBorder()
-
CapsuleBorder
public CapsuleBorder(int top, int bottom, int capWidth)
-
CapsuleBorder
public CapsuleBorder(java.awt.Paint borderPaint, java.awt.Paint capPaint)
-
CapsuleBorder
public CapsuleBorder(java.awt.Paint borderPaint, java.awt.Paint capPaint, int top, int bottom, int capWidth)
-
-
Method Detail
-
getBorderInsets
public java.awt.Insets getBorderInsets(java.awt.Component c)
- Specified by:
getBorderInsets
in interfacejavax.swing.border.Border
- Overrides:
getBorderInsets
in classjavax.swing.border.AbstractBorder
-
getBorderInsets
public java.awt.Insets getBorderInsets(java.awt.Component c, java.awt.Insets insets)
- Overrides:
getBorderInsets
in classjavax.swing.border.AbstractBorder
-
isBorderOpaque
public boolean isBorderOpaque()
- Specified by:
isBorderOpaque
in interfacejavax.swing.border.Border
- Overrides:
isBorderOpaque
in classjavax.swing.border.AbstractBorder
-
paintBorder
public void paintBorder(java.awt.Component c, java.awt.Graphics g1, int x, int y, int width, int height)
- Specified by:
paintBorder
in interfacejavax.swing.border.Border
- Overrides:
paintBorder
in classjavax.swing.border.AbstractBorder
-
getCapWidth
public int getCapWidth()
-
setCapWidth
public void setCapWidth(int capWidth)
-
getCapPaint
public java.awt.Paint getCapPaint()
-
setCapPaint
public void setCapPaint(java.awt.Paint capPaint)
-
getBorderPaint
public java.awt.Paint getBorderPaint()
-
setBorderPaint
public void setBorderPaint(java.awt.Paint borderPaint)
-
getTop
public int getTop()
-
setTop
public void setTop(int top)
-
getBottom
public int getBottom()
-
setBottom
public void setBottom(int bottom)
-
-