Package de.tudresden.sumo.cmd
Class Polygon
- java.lang.Object
-
- de.tudresden.sumo.cmd.Polygon
-
public class Polygon extends Object
The Class Polygon.- Author:
- Mario Krumnow, Evamarie Wiessner
-
-
Constructor Summary
Constructors Constructor Description Polygon()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SumoCommand
add(String polygonID, SumoGeometry shape, SumoColor color, boolean fill, String polygonType, int layer)
Add a new polygon.static SumoCommand
getColor(String polygonID)
Returns the color of this polygon.static SumoCommand
getFilled(String polygonID)
Returns the shape of this polygon.static SumoCommand
getIDCount()
Returns the number of all Polygons in the network.static SumoCommand
getIDList()
Returns a list of IDs of all polygons.static SumoCommand
getParameter(String polygonID, String param)
Returns the chosen parameter.static SumoCommand
getShape(String polygonID)
Returns the shape of this polygon.static SumoCommand
getType(String polygonID)
Returns the type of the polygon.static SumoCommand
remove(String polygonID, int layer)
Remove a polygon.static SumoCommand
setColor(String polygonID, SumoColor color)
Set the color of this polygon.static SumoCommand
setFilled(String polygonID, boolean fill)
Set the color of this polygon.static SumoCommand
setParameter(String polygonID, String param, String value)
Sets the chosen parameter.static SumoCommand
setShape(String polygonID, SumoStringList shape)
Set the shape of this polygon.static SumoCommand
setType(String polygonID, String polygonType)
Set the type of the polygon.
-
-
-
Method Detail
-
getColor
public static SumoCommand getColor(String polygonID)
Returns the color of this polygon.- Parameters:
polygonID
- a string identifying the polygon- Returns:
- color of the polygon
-
getIDList
public static SumoCommand getIDList()
Returns a list of IDs of all polygons.- Returns:
- a list of IDs of all polygons
-
getIDCount
public static SumoCommand getIDCount()
Returns the number of all Polygons in the network.- Returns:
- the number of polygons in the network
-
getParameter
public static SumoCommand getParameter(String polygonID, String param)
Returns the chosen parameter.- Parameters:
polygonID
- a string identifying the polygonparam
- a string identifying the parameter- Returns:
- the specific parameter
-
setParameter
public static SumoCommand setParameter(String polygonID, String param, String value)
Sets the chosen parameter.- Parameters:
polygonID
- the polygon IDparam
- a string identifying the parametervalue
- a string identifying the new value- Returns:
- SumoCommand
-
getShape
public static SumoCommand getShape(String polygonID)
Returns the shape of this polygon.- Parameters:
polygonID
- a string identifying the polygon return the shape of the polygon- Returns:
- the shape
-
getFilled
public static SumoCommand getFilled(String polygonID)
Returns the shape of this polygon.- Parameters:
polygonID
- a string identifying the polygon return the shape of the polygon- Returns:
- the shape
-
getType
public static SumoCommand getType(String polygonID)
Returns the type of the polygon.- Parameters:
polygonID
- a string identifying the polygon- Returns:
- type of the polygon
-
add
public static SumoCommand add(String polygonID, SumoGeometry shape, SumoColor color, boolean fill, String polygonType, int layer)
Add a new polygon.- Parameters:
polygonID
- a string identifying the polygonshape
- shape of the polygoncolor
- value (r,g,b,a) of colorfill
- polygon is filled if the value is != 0polygonType
- type of the polygonlayer
- an integer identifying the layer- Returns:
- SumoCommand
-
remove
public static SumoCommand remove(String polygonID, int layer)
Remove a polygon.- Parameters:
polygonID
- a string identifying the polygonlayer
- an integer identifying the layer- Returns:
- SumoCommand
-
setColor
public static SumoCommand setColor(String polygonID, SumoColor color)
Set the color of this polygon.- Parameters:
polygonID
- a string identifying the polygoncolor
- value (r,g,b,a) of color- Returns:
- SumoCommand
-
setFilled
public static SumoCommand setFilled(String polygonID, boolean fill)
Set the color of this polygon.- Parameters:
polygonID
- a string identifying the polygonfill
- parameter if polygon should be filled- Returns:
- SumoCommand
-
setShape
public static SumoCommand setShape(String polygonID, SumoStringList shape)
Set the shape of this polygon.- Parameters:
polygonID
- a string identifying the polygonshape
- shape of the polygon- Returns:
- SumoCommand
-
setType
public static SumoCommand setType(String polygonID, String polygonType)
Set the type of the polygon.- Parameters:
polygonID
- a string identifying the polygonpolygonType
- type of the polygon- Returns:
- SumoCommand
-
-