Class GeneralPath
java.lang.Object
org.openscience.cdk.renderer.elements.GeneralPath
- All Implemented Interfaces:
IRenderingElement
A path of rendering elements from the elements.path package.
- Author:
- Arvid
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal ColorThe color of the path.final List<PathElement>The elements in the path.final booleanFill the shape instead of drawing outline.final doubleThe width of the stroke.static final intstatic final intfinal intWinding rule for determining path interior. -
Constructor Summary
ConstructorsConstructorDescriptionGeneralPath(List<PathElement> elements, Color color) Make a path from a list of path elements. -
Method Summary
Modifier and TypeMethodDescriptionvoidConverts thisTextElementinto widget specific objects.outline(double newStroke) Outline the general path with the specified stroke size.static GeneralPathCreate an outline path of the specified Java 2D Shape and color.Recolor the path with the specified color.static GeneralPathCreate a filled path of the specified Java 2D Shape and color.toArea()Convert the GeneralPath to an awt.Area.
-
Field Details
-
color
The color of the path. -
stroke
public final double strokeThe width of the stroke. -
fill
public final boolean fillFill the shape instead of drawing outline. -
elements
The elements in the path. -
winding
public final int windingWinding rule for determining path interior. -
WIND_EVEN_ODD
public static final int WIND_EVEN_ODD -
WIND_NON_ZERO
public static final int WIND_NON_ZERO
-
-
Constructor Details
-
GeneralPath
Make a path from a list of path elements.- Parameters:
elements- the elements that make up the pathcolor- the color of the path
-
-
Method Details
-
recolor
Recolor the path with the specified color.- Parameters:
newColor- new path color- Returns:
- the recolored path
-
outline
Outline the general path with the specified stroke size.- Parameters:
newStroke- new stroke size- Returns:
- the outlined path
-
accept
Converts thisTextElementinto widget specific objects.- Specified by:
acceptin interfaceIRenderingElement- Parameters:
v- Toolkit specific widget factory.
-
shapeOf
Create a filled path of the specified Java 2D Shape and color.- Parameters:
shape- Java 2D shapecolor- the color to fill the shape with- Returns:
- a new general path
-
outlineOf
Create an outline path of the specified Java 2D Shape and color.- Parameters:
shape- Java 2D shapecolor- the color to draw the outline with- Returns:
- a new general path
-
toArea
Convert the GeneralPath to an awt.Area.- Returns:
- the area
-