|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.javadocking.drag.painter.DefaultRectanglePainter
public class DefaultRectanglePainter
This rectangle painter paints the border of a rectangle and it can fill the rectangle.
By setting the line width the rectangle is painted multiple times.
It is possible to give a stroke and a color to the painter.
It is possible to set the arc width and arc height to paint rounded rectangles.
Constructor Summary | |
---|---|
DefaultRectanglePainter()
|
Method Summary | |
---|---|
int |
getArcHeight()
Gets the height of the angle arc. |
int |
getArcWidth()
Gets the width of the angle arc. |
java.awt.Color |
getBorderColor()
Gets the color that is used for painting the border. |
int |
getBorderCount()
Gets the number of times the border is painted. |
int |
getBorderShift()
Gets the number of pixels the border is shifted, each time it is painted. |
java.awt.Color |
getFillColor()
Gets the fill color for the rectangle. |
java.lang.String |
getLabel()
Gets the label that will be painted in the middle of the rectangle. |
java.awt.Color |
getLabelBackground()
Gets the label back ground color. |
java.awt.Color |
getLabelBorderColor()
Gets the label border. |
java.awt.Color |
getLabelForeground()
Gets the label fore ground color. |
java.awt.Stroke |
getStroke()
Gets the stroke that is used for painting the border. |
void |
paintRectangle(java.awt.Graphics graphics,
int x,
int y,
int width,
int height)
Paints a rectangle on the given graphics. |
void |
setArcHeight(int arcHeight)
Sets the height of the angle arc. |
void |
setArcWidth(int arcWidth)
Sets the width of the angle arc. |
void |
setBorderColor(java.awt.Color color)
Sets the color that is used for painting the border. |
void |
setBorderCount(int borderCount)
Sets the number of times the border is painted. |
void |
setBorderShift(int borderShift)
Sets the number of pixels the border is shifted, each time it is painted. |
void |
setFillColor(java.awt.Color fillColor)
Sets the fill color for the rectangle. |
void |
setLabel(java.lang.String label)
Sets the label that will be painted in the middle of the rectangle. |
void |
setLabelBackground(java.awt.Color labelBackground)
Gets the label back ground color. |
void |
setLabelBorderColor(java.awt.Color labelBorderColor)
Sets the label border. |
void |
setLabelForeground(java.awt.Color labelForeground)
Sets the label fore ground color. |
void |
setStroke(java.awt.Stroke stroke)
Sets the stroke that is used for painting the border. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultRectanglePainter()
Method Detail |
---|
public void paintRectangle(java.awt.Graphics graphics, int x, int y, int width, int height)
RectanglePainter
paintRectangle
in interface RectanglePainter
graphics
- The graphics on which the rectangle should be painted.x
- The x-position of the rectangle on the graphics.y
- The y-position of the rectangle on the graphics.width
- The width of the rectangle.height
- The height of the rectangle.public int getBorderCount()
Gets the number of times the border is painted.
The default is 4.
public void setBorderCount(int borderCount)
borderCount
- The number of times the border is painted.public int getBorderShift()
Gets the number of pixels the border is shifted, each time it is painted.
The default is 1.
public void setBorderShift(int borderShift)
borderShift
- The number of pixels the border is shifted, each time it is painted.public java.awt.Color getBorderColor()
Gets the color that is used for painting the border.
The default is (10, 80, 255).
public void setBorderColor(java.awt.Color color)
color
- The color that is used for painting the border.public java.awt.Stroke getStroke()
public void setStroke(java.awt.Stroke stroke)
stroke
- The stroke that is used for painting the border. If it is null, a normal line is painted.public int getArcHeight()
public void setArcHeight(int arcHeight)
arcHeight
- The height of the angle arc.public int getArcWidth()
public void setArcWidth(int arcWidth)
arcWidth
- The width of the angle arc.public java.awt.Color getFillColor()
public void setFillColor(java.awt.Color fillColor)
fillColor
- The fill color for the rectangle.public java.lang.String getLabel()
public void setLabel(java.lang.String label)
setLabel
in interface RectanglePainter
label
- The label that will be painted in the middle of the rectangle.public java.awt.Color getLabelBackground()
public void setLabelBackground(java.awt.Color labelBackground)
labelBackground
- The label back ground color.public java.awt.Color getLabelBorderColor()
public void setLabelBorderColor(java.awt.Color labelBorderColor)
labelBorderColor
- The label border.public java.awt.Color getLabelForeground()
public void setLabelForeground(java.awt.Color labelForeground)
labelForeground
- The label fore ground color.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |