Class PolygonShape
java.lang.Object
uk.ac.starlink.ttools.plot2.layer.PolygonShape
Object that knows how to draw a polygon.
- Since:
- 5 Oct 2021
- Author:
- Mark Taylor
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
PolygonShape
(String name, String description) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionabstract Glyph
createPolygonGlyph
(int x0, int y0, int[] xs, int[] ys, int np) Returns a glyph representing a polygon with the given vertices.Returns a short description for this shape.getName()
Returns this shape's name.toString()
abstract PolygonShape
toThicker
(int nthick) Returns a version of this shape with thicker lines; may be this object if line thickening would have no effect.
-
Field Details
-
POLYSHAPES
Array of known shape instances.
-
-
Constructor Details
-
PolygonShape
Constructor.- Parameters:
name
- namedescription
- short human-readable description
-
-
Method Details
-
createPolygonGlyph
Returns a glyph representing a polygon with the given vertices.- Parameters:
x0
- X coordinate of nominal centery0
- Y coordinate of nominal centerxs
- X coordinates of verticesys
- Y coordinates of verticesnp
- number of vertices
-
toThicker
Returns a version of this shape with thicker lines; may be this object if line thickening would have no effect.- Parameters:
nthick
- line thickness index >=0- Returns:
- thicker shape
-
getName
Returns this shape's name.- Returns:
- name
-
getDescription
Returns a short description for this shape.- Returns:
- human-readable plain-text description
-
toString
-