public class GeneralPath extends Object implements IRenderingElement
Modifier and Type | Field and Description |
---|---|
Color |
color
The color of the path.
|
List<PathElement> |
elements
The elements in the path.
|
boolean |
fill
Fill the shape instead of drawing outline.
|
double |
stroke
The width of the stroke.
|
static int |
WIND_EVEN_ODD |
static int |
WIND_NON_ZERO |
int |
winding
Winding rule for determining path interior.
|
Constructor and Description |
---|
GeneralPath(List<PathElement> elements,
Color color)
Make a path from a list of path elements.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(IRenderingVisitor v)
Converts this
TextElement into widget specific objects. |
GeneralPath |
outline(double newStroke)
Outline the general path with the specified stroke size.
|
static GeneralPath |
outlineOf(Shape shape,
double stroke,
Color color)
Create an outline path of the specified Java 2D Shape and color.
|
GeneralPath |
recolor(Color newColor)
Recolor the path with the specified color.
|
static GeneralPath |
shapeOf(Shape shape,
Color color)
Create a filled path of the specified Java 2D Shape and color.
|
public final Color color
public final double stroke
public final boolean fill
public final List<PathElement> elements
public final int winding
public static final int WIND_EVEN_ODD
PathIterator.WIND_EVEN_ODD
,
Constant Field Valuespublic static final int WIND_NON_ZERO
PathIterator.WIND_NON_ZERO
,
Constant Field Valuespublic GeneralPath(List<PathElement> elements, Color color)
elements
- the elements that make up the pathcolor
- the color of the pathpublic GeneralPath recolor(Color newColor)
newColor
- new path colorpublic GeneralPath outline(double newStroke)
newStroke
- new stroke sizepublic void accept(IRenderingVisitor v)
TextElement
into widget specific objects.accept
in interface IRenderingElement
v
- Toolkit specific widget factory.public static GeneralPath shapeOf(Shape shape, Color color)
shape
- Java 2D shapecolor
- the color to fill the shape withpublic static GeneralPath outlineOf(Shape shape, double stroke, Color color)
shape
- Java 2D shapecolor
- the color to draw the outline withCopyright © 2022. All rights reserved.