Package org.openstreetmap.josm.gui.draw
Enum Class SymbolShape
- All Implemented Interfaces:
Serializable,Comparable<SymbolShape>,Constable
A list of possible symbol shapes.
- Since:
- 10875
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate ShapebuildPolygon(double cx, double cy, double radius) static Optional<SymbolShape>Get the shape with the given namegetName()Get the MapCSS name for this shapedoubleGets the rotation of the first point of this symbol.intgetSides()Gets the number of normally straight sides this symbol has.shapeAround(double x, double y, double size) Create the path for this shape around the given positionstatic SymbolShapeReturns the enum constant of this class with the specified name.static SymbolShape[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
SQUARE
A square -
CIRCLE
A circle -
TRIANGLE
A triangle with sides of equal length -
PENTAGON
A pentagon -
HEXAGON
A hexagon -
HEPTAGON
A heptagon -
OCTAGON
An octagon -
NONAGON
a nonagon -
DECAGON
A decagon
-
-
Field Details
-
name
-
sides
-
rotation
-
-
Constructor Details
-
SymbolShape
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
shapeAround
Create the path for this shape around the given position- Parameters:
x- The x positiony- The y positionsize- The size (width for rect, diameter for rest)- Returns:
- The symbol.
- Since:
- 10875
-
buildPolygon
-
getSides
Gets the number of normally straight sides this symbol has. Returns 1 for a circle.- Returns:
- The sides of the symbol
-
getRotation
Gets the rotation of the first point of this symbol.- Returns:
- The rotation
-
getName
Get the MapCSS name for this shape- Returns:
- The name
-
forName
Get the shape with the given name- Parameters:
val- The name to search- Returns:
- The shape as optional
-