|
ChartCat 1.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectli.netcat.chart.util.Pen
Immutable class representing a pen. Its properties are used to paint a shape, i.e. fill it with a paint and stroke its outline. The pen has the following properties:
Constructor Summary | |
Pen(java.awt.Paint fillPaint)
Constructs a new pen using the given paint to fill shapes. |
|
Pen(java.awt.Stroke stroke,
java.awt.Paint outlinePaint)
Constructs a new pen using the given stroke and the given paint that is used to draw and fill shapes. |
|
Pen(java.awt.Stroke stroke,
java.awt.Paint outlinePaint,
java.awt.Paint fillPaint)
Constructs a new pen using the given stroke and the given paints. |
Method Summary | |
static Pen[] |
createFillPens(int fillFrom,
int fillTo)
Utility method that creates a series of pens with no stroke and no outline paint. |
static Pen[] |
createPens(int outlineFrom,
int outlineTo,
int fillFrom,
int fillTo)
Utility method that creates a series of pens with different draw and fill colors. |
static Pen[] |
createPens(java.awt.Stroke stroke,
int outlineFrom,
int outlineTo,
int fillFrom,
int fillTo)
Utility method that creates a series of pens with different draw and fill colors. |
Pen |
fillPaint(java.awt.Paint fillPaint)
Constructs a new pen object by using all properties of this instance and replacing its fill paint by the given paint. |
static Pen |
getDefaultCapButt()
Returns the default pen with butt caps. |
static Pen |
getDefaultCapRound()
Returns the default pen with round caps. |
static Pen |
getDefaultCapSquare()
Returns the default pen with square caps. |
static Pen |
getDefaultDashed()
Returns the default dashed pen. |
java.awt.Paint |
getFillPaint()
Returns the paint of this pen that is used to fill a shape. |
java.awt.Paint |
getOutlinePaint()
Returns the paint of this pen that is used to draw the outline of a shape. |
java.awt.Stroke |
getStroke()
Returns the stroke of this pen. |
Pen |
outlinePaint(java.awt.Paint outlinePaint)
Constructs a new pen object by using all properties of this instance and replacing its outline paint by the given paint. |
static void |
setDefaultCapButt(Pen pen)
Sets the default pen with butt caps. |
static void |
setDefaultCapRound(Pen pen)
Sets the default pen with round caps. |
static void |
setDefaultCapSquare(Pen pen)
Sets the default pen with square caps. |
static void |
setDefaultDashed(Pen pen)
Sets the default dashed pen. |
Pen |
stroke(java.awt.Stroke stroke)
Constructs a new pen by using all properties of this instance and replacing its stroke by the given stroke. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Pen(java.awt.Stroke stroke, java.awt.Paint outlinePaint)
stroke
- The stroke of the pen, can be null
.outlinePaint
- The paint of the pen that is used to draw the outline of a shape, can be null
.public Pen(java.awt.Paint fillPaint)
null
.
fillPaint
- The paint of the pen that is used to fill a shape, can be null
.public Pen(java.awt.Stroke stroke, java.awt.Paint outlinePaint, java.awt.Paint fillPaint)
stroke
- The stroke of the pen, can be null
.outlinePaint
- The paint of the pen that is used to draw the outline of a shape, can be null
.fillPaint
- The paint of the pen that is used to fill a shape, can be null
.Method Detail |
public static Pen[] createFillPens(int fillFrom, int fillTo)
fillFrom
- The lower color component for the fill colors. 0 <= fillFrom < 256.fillTo
- The upper color component for the fill colors. 0 <= fillTo < 256.public static Pen[] createPens(int outlineFrom, int outlineTo, int fillFrom, int fillTo)
outlineFrom
- The lower color component for the outline colors. 0 <= outlineFrom < 256.outlineTo
- The upper color component for the outline colors. 0 <= outlineTo < 256.fillFrom
- The lower color component for the fill colors. 0 <= fillFrom < 256.fillTo
- The upper color component for the fill colors. 0 <= fillTo < 256.public static Pen[] createPens(java.awt.Stroke stroke, int outlineFrom, int outlineTo, int fillFrom, int fillTo)
stroke
- The stroke used for all pens.outlineFrom
- The lower color component for the outline colors. 0 <= outlineFrom < 256.outlineTo
- The upper color component for the outline colors. 0 <= outlineTo < 256.fillFrom
- The lower color component for the fill colors. 0 <= fillFrom < 256.fillTo
- The upper color component for the fill colors. 0 <= fillTo < 256.public static Pen getDefaultCapRound()
null
.public static void setDefaultCapRound(Pen pen)
pen
- The new default pen with round caps, not null
.public static Pen getDefaultCapButt()
null
.public static void setDefaultCapButt(Pen pen)
pen
- The new default pen with butt caps, not null
.public static Pen getDefaultCapSquare()
null
.public static void setDefaultCapSquare(Pen pen)
pen
- The new default pen with square caps, not null
.public static Pen getDefaultDashed()
null
.public static void setDefaultDashed(Pen pen)
pen
- The new default dashed pen, not null
.public java.awt.Stroke getStroke()
null
.public java.awt.Paint getOutlinePaint()
null
.public java.awt.Paint getFillPaint()
null
.public Pen stroke(java.awt.Stroke stroke)
stroke
- The new stroke, might also be null
.
public Pen fillPaint(java.awt.Paint fillPaint)
fillPaint
- The new fill paint, can be null
.
public Pen outlinePaint(java.awt.Paint outlinePaint)
outlinePaint
- The new outline paint, can be null
.
|
ChartCat 1.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |