E - component typepublic class BorderPainter<E extends javax.swing.JComponent> extends AbstractPainter<E>
AbstractPainter,
Painter| Modifier and Type | Field and Description |
|---|---|
protected java.awt.Color |
color
Border color.
|
protected int |
round
Border round.
|
protected java.awt.Stroke |
stroke
Border stroke.
|
protected int |
width
Border width.
|
listeners, margin, opaque, preferredSize| Constructor and Description |
|---|
BorderPainter()
Constructs default border painter.
|
BorderPainter(java.awt.Color color)
Constructs border painter with a specified color.
|
BorderPainter(int width)
Constructs border painter with a specified width.
|
BorderPainter(int width,
java.awt.Color color)
Constructs border painter with a specified width and color.
|
| Modifier and Type | Method and Description |
|---|---|
protected java.awt.geom.RectangularShape |
getBorderShape(java.awt.Rectangle bounds)
Returns border shape for the specified limiting bounds.
|
java.awt.Color |
getColor()
Returns border color.
|
java.awt.Insets |
getMargin(E c)
Returns margin required for visual data provided by this painter.
|
java.awt.Dimension |
getPreferredSize(E c)
Returns preferred size required for proper painting of visual data provided by this painter.
|
int |
getRound()
Returns border round.
|
java.awt.Stroke |
getStroke()
Returns border stroke.
|
int |
getWidth()
Returns border width.
|
void |
paint(java.awt.Graphics2D g2d,
java.awt.Rectangle bounds,
E c)
Paints visual data onto the component graphics.
|
void |
setColor(java.awt.Color color)
Sets border color.
|
void |
setRound(int round)
Sets border round.
|
void |
setStroke(java.awt.Stroke stroke)
Sets border stroke.
|
void |
setWidth(int width)
Sets border width.
|
protected void |
updateStroke()
Updates border stroke depending on painter settings.
|
addPainterListener, install, isOpaque, p, removePainterListener, repaint, repaint, repaint, revalidate, setMargin, setMargin, setMargin, setOpaque, setPreferredSize, uninstall, updateAll, updateOpacityprotected int width
protected int round
protected java.awt.Color color
protected java.awt.Stroke stroke
public BorderPainter()
public BorderPainter(int width)
width - border widthpublic BorderPainter(java.awt.Color color)
color - border colorpublic BorderPainter(int width,
java.awt.Color color)
width - border widthcolor - border colorpublic int getWidth()
public void setWidth(int width)
width - new border widthpublic int getRound()
public void setRound(int round)
round - new border roundpublic java.awt.Color getColor()
public void setColor(java.awt.Color color)
color - new border colorpublic java.awt.Stroke getStroke()
public void setStroke(java.awt.Stroke stroke)
stroke - new border strokesetWidth(int),
setRound(int)protected void updateStroke()
public java.awt.Dimension getPreferredSize(E c)
getPreferredSize in interface Painter<E extends javax.swing.JComponent>getPreferredSize in class AbstractPainter<E extends javax.swing.JComponent>c - component to processpublic java.awt.Insets getMargin(E c)
public void paint(java.awt.Graphics2D g2d,
java.awt.Rectangle bounds,
E c)
g2d - component graphicsbounds - bounds for painter visual datac - component to processprotected java.awt.geom.RectangularShape getBorderShape(java.awt.Rectangle bounds)
bounds - limiting bounds