|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.awt.BasicStroke
com.davisor.graphics.BetterStroke
BetterStroke extends standard BasicStroke with
functionality that was missing from it (in some
implementations, at least). These extensions are:
Unfortunately, some Java implementations - most notably the Sun
reference implementations - seem to treat BasicStrokes in a special
way. Instead of calling the createStrokedShape method
for stroke shapes, the low level graphics system operations use
BasicStroke attribute access methods, in order to construct some
kind of private stroke objects that do the stroking. This makes the
createStrokedShape method overloading useless.
createStrokedShape(java.awt.Shape),
NullStroke| Field Summary | |
static char |
DASHSEPARATOR
Stroke dash value separator (:). |
| Fields inherited from class java.awt.BasicStroke |
CAP_BUTT, CAP_ROUND, CAP_SQUARE, JOIN_BEVEL, JOIN_MITER, JOIN_ROUND |
| Constructor Summary | |
BetterStroke()
Constructs a new BetterStroke with defaults for all attributes. |
|
BetterStroke(float width)
Constructs a solid BetterStroke with the specified line width and with default values for the cap and join styles. |
|
BetterStroke(float width,
int cap,
int join)
Constructs a solid BetterStroke with the specified attributes. |
|
BetterStroke(float width,
int cap,
int join,
float miterlimit)
Constructs a solid BetterStroke with the specified attributes. |
|
BetterStroke(float width,
int cap,
int join,
float miterlimit,
float[] dash,
float dash_phase)
Constructs a new BetterStroke with the specified attributes. |
|
| Method Summary | |
int |
compareTo(java.lang.Object o)
Compares this stroke to other objects. |
java.awt.Shape |
createStrokedShape(java.awt.Shape shape)
Returns a Shape which interior defines the stroked outline of a specified Shape. |
java.lang.String |
toString()
Converts this stroke to a descriptive string. |
| Methods inherited from class java.awt.BasicStroke |
equals, getDashArray, getDashPhase, getEndCap, getLineJoin, getLineWidth, getMiterLimit, hashCode |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final char DASHSEPARATOR
| Constructor Detail |
public BetterStroke()
public BetterStroke(float width)
width - line width
public BetterStroke(float width,
int cap,
int join)
width - line widthcap - BasicStroke cap stylejoin - BasicStroke join style
public BetterStroke(float width,
int cap,
int join,
float miterlimit)
public BetterStroke(float width,
int cap,
int join,
float miterlimit,
float[] dash,
float dash_phase)
width - line widthcap - BasicStroke cap stylejoin - BasicStroke join stylemiterlimit - the limit to trim the miter joindash - the array representing the dashing patterndash_phase - the offset to start the dashing pattern| Method Detail |
public int compareTo(java.lang.Object o)
BasicStroke.equals(java.lang.Object),
CompareGraphics.compareTo(BasicStroke,BasicStroke)public java.lang.String toString()
The width, miterlimit and dashphase are floating point values. The cap style is one of:
The join style is one of:
The dash pattern is by colon (:) separated list of floating point values.
public java.awt.Shape createStrokedShape(java.awt.Shape shape)
shape - the shape boundary to be stroked
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||