Class DrawingInfoShape<D extends org.opentrafficsim.core.animation.Drawable>
java.lang.Object
org.opentrafficsim.core.animation.DrawingInfoShape<D>
- Type Parameters:
D
- The drawable type for which this is the DrawingInfo
- All Implemented Interfaces:
DrawingInfo
public class DrawingInfoShape<D extends org.opentrafficsim.core.animation.Drawable>
extends Object
implements DrawingInfo
DrawingInfoLine stores the drawing information about a shape. This can be interpreted by a visualization or animation class.
Copyright (c) 2013-2023 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Alexander Verbraeck
-
Constructor Summary
ConstructorsConstructorDescriptionCreate an empty DrawingInfo object for a shape.DrawingInfoShape
(Color fillColor) Create a DrawingInfo object for a shape that is filled, without a contour line.DrawingInfoShape
(Color lineColor, float lineWidth) Create a DrawingInfo object for a shape that is not filled.DrawingInfoShape
(Color lineColor, float lineWidth, 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
Modifier and TypeMethodDescriptionfinal Color
getFillColor
(D drawable) The returned color could be dependent on the state of the object for the fill color used.final Color
getLineColor
(D drawable) The returned color could be dependent on the state of the object representing the line.final float
final boolean
isFilled()
final boolean
final void
setFillColor
(Color fillColor) Set the fill color using a FixedColorer.final void
setFillColorer
(Colorer<D> fillColorer) Set the fill colorer.final void
setFilled
(boolean filled) final void
setLineColor
(Color lineColor) Set the line color using a FixedColorer.final void
setLineColorer
(Colorer<D> lineColorer) Set the line colorer.final void
setLineWidth
(float lineWidth) final void
setStroked
(boolean stroked)
-
Constructor Details
-
DrawingInfoShape
public DrawingInfoShape()Create an empty DrawingInfo object for a shape. -
DrawingInfoShape
Create a DrawingInfo object for a shape that is not filled.- Parameters:
lineColor
- Color; the line colorlineWidth
- float; the line width, which could be relative and is open for interpretation by the visualization or animation class
-
DrawingInfoShape
Create a DrawingInfo object for a shape that is filled, with a contour line.- Parameters:
lineColor
- Color; the line colorlineWidth
- float; the line width, which could be relative and is open for interpretation by the visualization or animation classfillColor
- Color; the fill color
-
DrawingInfoShape
Create a DrawingInfo object for a shape that is filled, without a contour line.- Parameters:
fillColor
- Color; the fill color
-
DrawingInfoShape
Create a DrawingInfo object for a shape that is not filled.- Parameters:
lineColorer
- Colorer<D>; the line colorerlineWidth
- float; the line width, which could be relative and is open for interpretation by the visualization or animation class
-
DrawingInfoShape
Create a DrawingInfo object for a shape that is filled, with a contour line.- Parameters:
lineColorer
- Colorer<D>; the line colorerlineWidth
- float; the line width, which could be relative and is open for interpretation by the visualization or animation classfillColorer
- Colorer<D>; the fill colorer
-
DrawingInfoShape
Create a DrawingInfo object for a shape that is filled, without a contour line.- Parameters:
fillColorer
- Colorer<D>; the fill colorer
-
-
Method Details
-
getFillColor
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
Set the fill color using a FixedColorer.- Parameters:
fillColor
- Color; fillColor to set
-
setFillColorer
Set the fill colorer.- Parameters:
fillColorer
- Colorer<D>; fillColorer to set
-
getLineColor
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
Set the line color using a FixedColorer.- Parameters:
lineColor
- Color; lineColor to set
-
setLineColorer
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
-