public enum SymbolShape extends java.lang.Enum<SymbolShape>
Enum Constant and Description |
---|
CIRCLE
A circle
|
DECAGON
A decagon
|
HEPTAGON
A heptagon
|
HEXAGON
A hexagon
|
NONAGON
a nonagon
|
OCTAGON
An octagon
|
PENTAGON
A pentagon
|
SQUARE
A square
|
TRIANGLE
A triangle with sides of equal lengh
|
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
name |
(package private) double |
rotation |
(package private) int |
sides |
Modifier and Type | Method and Description |
---|---|
private java.awt.Shape |
buildPolygon(double cx,
double cy,
double radius) |
static java.util.Optional<SymbolShape> |
forName(java.lang.String val)
Get the shape with the given name
|
java.lang.String |
getName()
Get the MapCSS name for this shape
|
double |
getRotation()
Gets the rotation of the first point of this symbol.
|
int |
getSides()
Gets the number of normally straight sides this symbol has.
|
java.awt.Shape |
shapeAround(double x,
double y,
double size)
Create the path for this shape around the given position
|
static SymbolShape |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static SymbolShape[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final SymbolShape SQUARE
public static final SymbolShape CIRCLE
public static final SymbolShape TRIANGLE
public static final SymbolShape PENTAGON
public static final SymbolShape HEXAGON
public static final SymbolShape HEPTAGON
public static final SymbolShape OCTAGON
public static final SymbolShape NONAGON
public static final SymbolShape DECAGON
private final java.lang.String name
final int sides
final double rotation
public static SymbolShape[] values()
for (SymbolShape c : SymbolShape.values()) System.out.println(c);
public static SymbolShape valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic java.awt.Shape shapeAround(double x, double y, double size)
x
- The x positiony
- The y positionsize
- The size (width for rect, diameter for rest)private java.awt.Shape buildPolygon(double cx, double cy, double radius)
public int getSides()
public double getRotation()
public java.lang.String getName()
public static java.util.Optional<SymbolShape> forName(java.lang.String val)
val
- The name to search