Class DrawingInfoShape<D extends Drawable>

  • Type Parameters:
    D - The drawable type for which this is the DrawingInfo
    All Implemented Interfaces:
    DrawingInfo

    public class DrawingInfoShape<D extends Drawable>
    extends java.lang.Object
    implements DrawingInfo
    DrawingInfoLine stores the drawing information about a shape. This can be interpreted by a visualization or animation class.

    Copyright (c) 2003-2020 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information www.simulation.tudelft.nl. The source code and binary code of this software is proprietary information of Delft University of Technology.
    Author:
    Alexander Verbraeck
    • Constructor Summary

      Constructors 
      Constructor Description
      DrawingInfoShape()
      Create an empty DrawingInfo object for a shape.
      DrawingInfoShape​(java.awt.Color fillColor)
      Create a DrawingInfo object for a shape that is filled, without a contour line.
      DrawingInfoShape​(java.awt.Color lineColor, float lineWidth)
      Create a DrawingInfo object for a shape that is not filled.
      DrawingInfoShape​(java.awt.Color lineColor, float lineWidth, java.awt.Color fillColor)
      Create a DrawingInfo object for a shape that is filled, with a contour line.
      DrawingInfoShape​(Colorer<D> fillColorer)
      Create a DrawingInfo object for a shape that is filled, without a contour line.
      DrawingInfoShape​(Colorer<D> lineColorer, float lineWidth)
      Create a DrawingInfo object for a shape that is not filled.
      DrawingInfoShape​(Colorer<D> lineColorer, float lineWidth, Colorer<D> fillColorer)
      Create a DrawingInfo object for a shape that is filled, with a contour line.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.awt.Color getFillColor​(D drawable)
      The returned color could be dependent on the state of the object for the fill color used.
      java.awt.Color getLineColor​(D drawable)
      The returned color could be dependent on the state of the object representing the line.
      float getLineWidth()  
      boolean isFilled()  
      boolean isStroked()  
      void setFillColor​(java.awt.Color fillColor)
      Set the fill color using a FixedColorer.
      void setFillColorer​(Colorer<D> fillColorer)
      Set the fill colorer.
      void setFilled​(boolean filled)  
      void setLineColor​(java.awt.Color lineColor)
      Set the line color using a FixedColorer.
      void setLineColorer​(Colorer<D> lineColorer)
      Set the line colorer.
      void setLineWidth​(float lineWidth)  
      void setStroked​(boolean stroked)  
      • Methods inherited from class java.lang.Object

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

      • DrawingInfoShape

        public DrawingInfoShape()
        Create an empty DrawingInfo object for a shape.
      • DrawingInfoShape

        public DrawingInfoShape​(java.awt.Color lineColor,
                                float lineWidth)
        Create a DrawingInfo object for a shape that is not filled.
        Parameters:
        lineColor - Color; the line color
        lineWidth - float; the line width, which could be relative and is open for interpretation by the visualization or animation class
      • DrawingInfoShape

        public DrawingInfoShape​(java.awt.Color lineColor,
                                float lineWidth,
                                java.awt.Color fillColor)
        Create a DrawingInfo object for a shape that is filled, with a contour line.
        Parameters:
        lineColor - Color; the line color
        lineWidth - float; the line width, which could be relative and is open for interpretation by the visualization or animation class
        fillColor - Color; the fill color
      • DrawingInfoShape

        public DrawingInfoShape​(java.awt.Color fillColor)
        Create a DrawingInfo object for a shape that is filled, without a contour line.
        Parameters:
        fillColor - Color; the fill color
      • DrawingInfoShape

        public DrawingInfoShape​(Colorer<D> lineColorer,
                                float lineWidth)
        Create a DrawingInfo object for a shape that is not filled.
        Parameters:
        lineColorer - Colorer<D>; the line colorer
        lineWidth - float; the line width, which could be relative and is open for interpretation by the visualization or animation class
      • DrawingInfoShape

        public DrawingInfoShape​(Colorer<D> lineColorer,
                                float lineWidth,
                                Colorer<D> fillColorer)
        Create a DrawingInfo object for a shape that is filled, with a contour line.
        Parameters:
        lineColorer - Colorer<D>; the line colorer
        lineWidth - float; the line width, which could be relative and is open for interpretation by the visualization or animation class
        fillColorer - Colorer<D>; the fill colorer
      • DrawingInfoShape

        public DrawingInfoShape​(Colorer<D> fillColorer)
        Create a DrawingInfo object for a shape that is filled, without a contour line.
        Parameters:
        fillColorer - Colorer<D>; the fill colorer
    • Method Detail

      • getFillColor

        public final java.awt.Color getFillColor​(D drawable)
        The returned color could be dependent on the state of the object for the fill color used. E.g., it turns red under certain circumstances.
        Parameters:
        drawable - D; the object that could influence the fill color
        Returns:
        the color of the fill
      • setFillColor

        public final void setFillColor​(java.awt.Color fillColor)
        Set the fill color using a FixedColorer.
        Parameters:
        fillColor - Color; fillColor to set
      • setFillColorer

        public final void setFillColorer​(Colorer<D> fillColorer)
        Set the fill colorer.
        Parameters:
        fillColorer - Colorer<D>; fillColorer to set
      • getLineColor

        public final java.awt.Color getLineColor​(D drawable)
        The returned color could be dependent on the state of the object representing the line. E.g., it turns red under certain circumstances.
        Parameters:
        drawable - D; the object that could influence the color of the line
        Returns:
        the color of the line
      • setLineColor

        public final void setLineColor​(java.awt.Color lineColor)
        Set the line color using a FixedColorer.
        Parameters:
        lineColor - Color; lineColor to set
      • setLineColorer

        public final void setLineColorer​(Colorer<D> lineColorer)
        Set the line colorer.
        Parameters:
        lineColorer - Colorer<D>; lineColorer to set
      • getLineWidth

        public final float getLineWidth()
        Returns:
        lineWidth
      • setLineWidth

        public final void setLineWidth​(float lineWidth)
        Parameters:
        lineWidth - float; set lineWidth
      • isFilled

        public final boolean isFilled()
        Returns:
        filled
      • setFilled

        public final void setFilled​(boolean filled)
        Parameters:
        filled - boolean; set filled
      • isStroked

        public final boolean isStroked()
        Returns:
        stroked
      • setStroked

        public final void setStroked​(boolean stroked)
        Parameters:
        stroked - boolean; set stroked