Class Polygon


  • public class Polygon
    extends java.lang.Object
    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​(java.lang.String polygonID, SumoGeometry shape, SumoColor color, boolean fill, java.lang.String polygonType, int layer)
      Add a new polygon.
      static SumoCommand getColor​(java.lang.String polygonID)
      Returns the color of this polygon.
      static SumoCommand getFilled​(java.lang.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​(java.lang.String polygonID, java.lang.String param)
      Returns the chosen parameter
      static SumoCommand getShape​(java.lang.String polygonID)
      Returns the shape of this polygon.
      static SumoCommand getType​(java.lang.String polygonID)
      Returns the type of the polygon.
      static SumoCommand remove​(java.lang.String polygonID, int layer)
      Remove a polygon.
      static SumoCommand setColor​(java.lang.String polygonID, SumoColor color)
      Set the color of this polygon.
      static SumoCommand setFilled​(java.lang.String polygonID, boolean fill)
      Set the color of this polygon.
      static SumoCommand setParameter​(java.lang.String polygonID, java.lang.String param, java.lang.String value)
      Sets the chosen parameter
      static SumoCommand setShape​(java.lang.String polygonID, SumoStringList shape)
      Set the shape of this polygon.
      static SumoCommand setType​(java.lang.String polygonID, java.lang.String polygonType)
      Set the type of the polygon.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Polygon

        public Polygon()
    • Method Detail

      • getColor

        public static SumoCommand getColor​(java.lang.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​(java.lang.String polygonID,
                                               java.lang.String param)
        Returns the chosen parameter
        Parameters:
        polygonID - a string identifying the polygon
        param - a string identifying the parameter
        Returns:
        the specific parameter
      • setParameter

        public static SumoCommand setParameter​(java.lang.String polygonID,
                                               java.lang.String param,
                                               java.lang.String value)
        Sets the chosen parameter
        Parameters:
        vehID - a string identifying the vehicle
        param - a string identifying the parameter
        value - a string identifying the new value
        Returns:
        SumoCommand
      • getShape

        public static SumoCommand getShape​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.String polygonID,
                                      SumoGeometry shape,
                                      SumoColor color,
                                      boolean fill,
                                      java.lang.String polygonType,
                                      int layer)
        Add a new polygon.
        Parameters:
        polygonID - a string identifying the polygon
        shape - shape of the polygon
        color - value (r,g,b,a) of color
        fill - polygon is filled if the value is != 0
        polygonType - type of the polygon
        layer - an integer identifying the layer
        Returns:
        SumoCommand
      • remove

        public static SumoCommand remove​(java.lang.String polygonID,
                                         int layer)
        Remove a polygon.
        Parameters:
        polygonID - a string identifying the polygon
        layer - an integer identifying the layer
        Returns:
        SumoCommand
      • setColor

        public static SumoCommand setColor​(java.lang.String polygonID,
                                           SumoColor color)
        Set the color of this polygon.
        Parameters:
        polygonID - a string identifying the polygon
        color - value (r,g,b,a) of color
        Returns:
        SumoCommand
      • setFilled

        public static SumoCommand setFilled​(java.lang.String polygonID,
                                            boolean fill)
        Set the color of this polygon.
        Parameters:
        polygonID - a string identifying the polygon
        fill - parameter if polygon should be filled
        Returns:
        SumoCommand
      • setShape

        public static SumoCommand setShape​(java.lang.String polygonID,
                                           SumoStringList shape)
        Set the shape of this polygon.
        Parameters:
        polygonID - a string identifying the polygon
        shape - shape of the polygon
        Returns:
        SumoCommand
      • setType

        public static SumoCommand setType​(java.lang.String polygonID,
                                          java.lang.String polygonType)
        Set the type of the polygon.
        Parameters:
        polygonID - a string identifying the polygon
        polygonType - type of the polygon
        Returns:
        SumoCommand