public class Pen extends Object
Modifier and Type | Field and Description |
---|---|
static int |
CAP_BUTT |
static int |
CAP_MASK |
static int |
CAP_ROUND |
static int |
CAP_SQUARE |
Color |
color |
static int |
DASH |
static int |
DASHDOT |
static int |
DASHDOTDOT |
static int |
DOT |
static int |
JOIN_BEVEL |
static int |
JOIN_MASK |
static int |
JOIN_MITER |
static int |
JOIN_ROUND |
float |
miterLimit |
static int |
NULL |
static int |
SOLID |
int |
style |
static int |
STYLE_MASK |
int |
thickness |
Constructor and Description |
---|
Pen() |
Pen(Color color,
int style,
int thickness)
Create a new Pen object.
|
Pen(Color color,
int style,
int thickness,
float miterLimit)
Create a new Pen object.
|
Modifier and Type | Method and Description |
---|---|
void |
cache() |
Pen |
change(Color differentColor)
Deprecated.
- use getCopy().set(differentColor);
|
static Pen |
getCached() |
static Pen |
getCached(Color col,
int style,
int thickness) |
static Pen |
getCached(int r,
int g,
int b,
int style,
int thickness) |
static Pen |
getCached(Pen other) |
Pen |
getCopy() |
Pen |
set(Color color)
Set the color of the Pen and return itself.
|
Pen |
set(Color c,
int style,
int thickness)
Change the parameters of this Pen and return itself.
|
void |
set(Pen other) |
public Color color
public int style
public int thickness
public float miterLimit
public static final int SOLID
public static final int DASH
public static final int DOT
public static final int DASHDOT
public static final int DASHDOTDOT
public static final int NULL
public static final int STYLE_MASK
public static final int CAP_BUTT
public static final int CAP_SQUARE
public static final int CAP_ROUND
public static final int CAP_MASK
public static final int JOIN_BEVEL
public static final int JOIN_MITER
public static final int JOIN_ROUND
public static final int JOIN_MASK
public Pen(Color color, int style, int thickness)
color
- The color for the Pen object.style
- The style for the Pen object. This should be one of the constants SOLID, DASH, DOT, DASHDOT, DASHDOTDOT or NULL,
optionally ORed with one of the CAP_XXX values and JOIN_XXX values.thickness
- The thickness of the Pen (in pixels).public Pen(Color color, int style, int thickness, float miterLimit)
color
- The color for the Pen object.style
- The style for the Pen object. This should be one of the constants SOLID, DASH, DOT, DASHDOT, DASHDOTDOT or NULL, optionally ORed with
one of the CAP_XXX values and JOIN_XXX values.thickness
- The thickness of the Pen (in pixels).miterLimit
- A miterlimit for end joins.public Pen()
public Pen change(Color differentColor)
differentColor
- color to set a new Pen to.public Pen set(Color c, int style, int thickness)
c
- the new Color.style
- the new style.thickness
- the new thickness.public Pen set(Color color)
color
- the new Color.public void set(Pen other)
public Pen getCopy()
public static Pen getCached(int r, int g, int b, int style, int thickness)
public static Pen getCached()
public void cache()