Class DraggableAnnotation
java.lang.Object
nl.tudelft.simulation.dsol.animation.d2.Renderable2d<L>
org.opentrafficsim.animation.OtsRenderable<L>
org.opentrafficsim.editor.extensions.map.edit.MapAnnotation<DraggableAnnotation.Draggable<?>>
org.opentrafficsim.editor.extensions.map.edit.DraggableAnnotation
- All Implemented Interfaces:
nl.tudelft.simulation.dsol.animation.d2.Renderable2dInterface<DraggableAnnotation.Draggable<?>>
Draggable by which the user can influence a value in the data structure.
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classData for draggable renderable.static enumUpdate mode option. -
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
ConstructorsConstructorDescriptionDraggableAnnotation(DraggableAnnotation.Draggable<?> source, EditorMap map) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddHelperAnnotation(HelperAnnotation annotation, DraggableAnnotation.UpdateMode updateMode) Add helper annotation.booleancontains(Point2d pointRelativeTo00, nl.tudelft.simulation.dsol.animation.d2.RenderableScale scale, double worldMargin, double pixelMargin, double xScale, double yScale) voiddelete()Delete represented data of draggable.voiddestroy(nl.tudelft.simulation.naming.context.Contextualized contextProvider) booleanReturns whether the draggable is deletable.voidmouseDragged(Point2d mousePoint) Mouse was dragged.voidmouseReleased(Point2d mousePoint) Mouse was released.voidpaint(Graphics2D graphics, ImageObserver observer) voidsetHighlightIfDeletable(boolean selected) Sets whether the draggable is highlighted based on whether it is selected, and it is deletable.voidShows the attribute and/or node in the tree that is affected by the draggable.Methods inherited from class org.opentrafficsim.editor.extensions.map.edit.MapAnnotation
getMap, px, pxMethods inherited from class org.opentrafficsim.animation.OtsRenderable
contains, isDynamic, resetRendering, setDynamic, setRenderingMethods inherited from class nl.tudelft.simulation.dsol.animation.d2.Renderable2d
bind2Context, contains, getId, getSource, isFlip, isRotate, isScale, isScaleObject, isScaleY, isTranslate, paint, paintComponent, setFlip, setRotate, setScale, setScaleObject, setScaleY, setTranslate, toString
-
Constructor Details
-
DraggableAnnotation
Constructor.- Parameters:
source- sourcemap- map
-
-
Method Details
-
setHighlightIfDeletable
public void setHighlightIfDeletable(boolean selected) Sets whether the draggable is highlighted based on whether it is selected, and it is deletable.- Parameters:
selected- whether the draggable is selected
-
isDeletable
public boolean isDeletable()Returns whether the draggable is deletable.- Returns:
- whether the draggable is deletable
-
showValue
Shows the attribute and/or node in the tree that is affected by the draggable.- Parameters:
editor- editor
-
delete
public void delete()Delete represented data of draggable. -
paint
- Specified by:
paintin classnl.tudelft.simulation.dsol.animation.d2.Renderable2d<DraggableAnnotation.Draggable<?>>
-
mouseDragged
Mouse was dragged.- Parameters:
mousePoint- world coordinate of mouse
-
mouseReleased
Mouse was released.- Parameters:
mousePoint- world coordinate of mouse
-
addHelperAnnotation
public void addHelperAnnotation(HelperAnnotation annotation, DraggableAnnotation.UpdateMode updateMode) Add helper annotation. The update mode determines when the location is updated, which is set to the location of the animated draggable.- Parameters:
annotation- annotationupdateMode- whether the annotation is update while dragging or only on mouse release
-
destroy
public void destroy(nl.tudelft.simulation.naming.context.Contextualized contextProvider) - Specified by:
destroyin interfacenl.tudelft.simulation.dsol.animation.d2.Renderable2dInterface<DraggableAnnotation.Draggable<?>>- Overrides:
destroyin classnl.tudelft.simulation.dsol.animation.d2.Renderable2d<DraggableAnnotation.Draggable<?>>
-
contains
public boolean contains(Point2d pointRelativeTo00, nl.tudelft.simulation.dsol.animation.d2.RenderableScale scale, double worldMargin, double pixelMargin, double xScale, double yScale) - Overrides:
containsin classOtsRenderable<DraggableAnnotation.Draggable<?>>
-