Class MapAnnotation<L extends OtsShape>
java.lang.Object
nl.tudelft.simulation.dsol.animation.d2.Renderable2d<L>
org.opentrafficsim.animation.OtsRenderable<L>
org.opentrafficsim.editor.extensions.map.edit.MapAnnotation<L>
- Type Parameters:
L- locatable type
- All Implemented Interfaces:
nl.tudelft.simulation.dsol.animation.d2.Renderable2dInterface<L>
- Direct Known Subclasses:
DraggableAnnotation,HelperAnnotation,SelectionAnnotation
Convenience class where sub-classes can use
px(double) or px(float[]) to obtain a paint stroke defined at
pixel level for a locatable that is otherwise scaled in world coordinates.
Copyright (c) 2026-2026 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Wouter Schakel
-
Field Summary
Fields inherited from interface nl.tudelft.simulation.dsol.animation.d2.Renderable2dInterface
ANIMATION_OBJECT_COUNTER, FLIP_FLAG, ROTATE_FLAG, SCALE_FLAG, SCALE_OBJECT_FLAG, SCALE_Y_FLAG, TRANSLATE_FLAG -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected EditorMapgetMap()Returns the map.protected floatpx(double width) Returns a world line width that corresponds to a pixel width of the input value.protected float[]px(float[] dash) Scales the value in the input array such that an intended pixel dash pattern is translated in to current world coordinates.Methods inherited from class org.opentrafficsim.animation.OtsRenderable
contains, contains, isDynamic, resetRendering, setDynamic, setRenderingMethods inherited from class nl.tudelft.simulation.dsol.animation.d2.Renderable2d
bind2Context, contains, destroy, getId, getSource, isFlip, isRotate, isScale, isScaleObject, isScaleY, isTranslate, paint, paint, paintComponent, setFlip, setRotate, setScale, setScaleObject, setScaleY, setTranslate, toString
-
Constructor Details
-
MapAnnotation
Constructor.- Parameters:
source- sourcemap- map
-
-
Method Details
-
getMap
Returns the map.- Returns:
- map
-
px
protected float px(double width) Returns a world line width that corresponds to a pixel width of the input value.- Parameters:
width- intended pixel line width- Returns:
- world line width that corresponds to a pixel width of the input value
-
px
protected float[] px(float[] dash) Scales the value in the input array such that an intended pixel dash pattern is translated in to current world coordinates.- Parameters:
dash- dash pattern- Returns:
- input array
-