Class PolygonShape
- java.lang.Object
-
- uk.ac.starlink.ttools.plot2.layer.PolygonShape
-
@Equality public abstract class PolygonShape extends java.lang.Object
Object that knows how to draw a polygon.- Since:
- 5 Oct 2021
- Author:
- Mark Taylor
-
-
Field Summary
Fields Modifier and Type Field Description static PolygonShape[]POLYSHAPESArray of known shape instances.
-
Constructor Summary
Constructors Modifier Constructor Description protectedPolygonShape(java.lang.String name, java.lang.String description)Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract GlyphcreatePolygonGlyph(int x0, int y0, int[] xs, int[] ys, int np)Returns a glyph representing a polygon with the given vertices.java.lang.StringgetDescription()Returns a short description for this shape.java.lang.StringgetName()Returns this shape's name.java.lang.StringtoString()abstract PolygonShapetoThicker(int nthick)Returns a version of this shape with thicker lines; may be this object if line thickening would have no effect.
-
-
-
Field Detail
-
POLYSHAPES
public static final PolygonShape[] POLYSHAPES
Array of known shape instances.
-
-
Method Detail
-
createPolygonGlyph
public abstract Glyph createPolygonGlyph(int x0, int y0, int[] xs, int[] ys, int np)
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
public 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.- Parameters:
nthick- line thickness index >=0- Returns:
- thicker shape
-
getName
public java.lang.String getName()
Returns this shape's name.- Returns:
- name
-
getDescription
public java.lang.String getDescription()
Returns a short description for this shape.- Returns:
- human-readable plain-text description
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-