Class MapLinkData
java.lang.Object
org.opentrafficsim.editor.extensions.map.MapData
org.opentrafficsim.editor.extensions.map.MapLinkData
- All Implemented Interfaces:
Serializable
,Remote
,EventListener
,nl.tudelft.simulation.dsol.animation.Locatable
,org.djutils.base.Identifiable
,org.djutils.event.EventListener
,org.djutils.event.EventProducer
,org.opentrafficsim.base.geometry.OtsLocatable
,LinkAnimation.LinkData
,EvalWrapper.EvalListener
public class MapLinkData
extends MapData
implements LinkAnimation.LinkData, org.djutils.event.EventListener, org.djutils.event.EventProducer
LinkData for the editor Map. This class will also listen to any changes that may affect the link shape, maintain the drawn
layout, and maintain the priority animation.
Copyright (c) 2023-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Wouter Schakel
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final org.djutils.event.EventType
Event when layout is rebuilt.Fields inherited from interface org.djutils.event.EventProducer
FIRST_POSITION, LAST_POSITION
-
Constructor Summary
ConstructorDescriptionMapLinkData
(EditorMap map, XsdTreeNode linkNode, OtsEditor editor) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCoordinate
(XsdTreeNode node) The map was notified a new coordinate node was added.void
destroy()
Destroy this data object, e.g. remove self as listener.void
Notifies the listener that evaluation results may have changed.org.opentrafficsim.base.geometry.OtsBounds2d
org.djunits.value.vdouble.scalar.Length
Returns the A value from the clothoid.Returns whether the shape was applied as a Clothoid, an Arc, or as a Straight, depending on start and end position and direction.org.djunits.value.vdouble.scalar.LinearDensity
Returns the end curvature from the clothoid.org.djunits.value.vdouble.scalar.Length
Returns the length from the clothoid.org.djunits.value.vdouble.scalar.LinearDensity
Returns the start curvature from the clothoid.org.djutils.draw.line.PolyLine2d
org.djutils.event.EventListenerMap
getId()
getLaneData
(String laneId) Returns the editor lane data for the lane of given id.org.djutils.draw.point.OrientedPoint2d
boolean
void
notify
(org.djutils.event.Event event) void
Notification from the Map that a node (Ots.Network.Node) id was changed.void
removeCoordinate
(XsdTreeNode node) The map was notified a coordinate node was removed.toString()
Methods inherited from class org.opentrafficsim.editor.extensions.map.MapData
getEval, getMap, getNode, setInvalid, setValid, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.djutils.event.EventProducer
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, getEventTypesWithListeners, getListenerReferences, hasListeners, numberOfListeners, removeAllListeners, removeAllListeners, removeListener
Methods inherited from interface org.opentrafficsim.draw.network.LinkAnimation.LinkData
getZ
Methods inherited from interface nl.tudelft.simulation.dsol.animation.Locatable
getDirZ
-
Field Details
-
LAYOUT_REBUILT
public static final org.djutils.event.EventType LAYOUT_REBUILTEvent when layout is rebuilt.
-
-
Constructor Details
-
MapLinkData
Constructor.- Parameters:
map
- Map; map.linkNode
- XsdTreeNode; node Ots.Network.Link.editor
- OtsEditor; editor.
-
-
Method Details
-
destroy
public void destroy()Destroy this data object, e.g. remove self as listener. Override and call super if subclasses remove their own listeners. Using weak references for listeners is another option to deal with obsolete listening. -
getBounds
public org.opentrafficsim.base.geometry.OtsBounds2d getBounds()- Specified by:
getBounds
in interfacenl.tudelft.simulation.dsol.animation.Locatable
- Specified by:
getBounds
in interfaceorg.opentrafficsim.base.geometry.OtsLocatable
-
getId
- Specified by:
getId
in interfaceorg.djutils.base.Identifiable
-
getLocation
public org.djutils.draw.point.OrientedPoint2d getLocation()- Specified by:
getLocation
in interfaceLinkAnimation.LinkData
- Specified by:
getLocation
in interfacenl.tudelft.simulation.dsol.animation.Locatable
- Specified by:
getLocation
in interfaceorg.opentrafficsim.base.geometry.OtsLocatable
-
isConnector
public boolean isConnector()- Specified by:
isConnector
in interfaceLinkAnimation.LinkData
-
getDesignLine
public org.djutils.draw.line.PolyLine2d getDesignLine()- Specified by:
getDesignLine
in interfaceLinkAnimation.LinkData
-
notify
- Specified by:
notify
in interfaceorg.djutils.event.EventListener
- Throws:
RemoteException
-
addCoordinate
The map was notified a new coordinate node was added. The node may or may not be part of this link.- Parameters:
node
- XsdTreeNode; added coordinate node.
-
removeCoordinate
The map was notified a coordinate node was removed. The node may or may not be part of this link.- Parameters:
node
- XsdTreeNode; removed coordinate node.
-
getEventListenerMap
- Specified by:
getEventListenerMap
in interfaceorg.djutils.event.EventProducer
- Throws:
RemoteException
-
evalChanged
public void evalChanged()Notifies the listener that evaluation results may have changed.- Specified by:
evalChanged
in interfaceEvalWrapper.EvalListener
-
notifyNodeIdChanged
Notification from the Map that a node (Ots.Network.Node) id was changed.- Parameters:
node
- XsdTreeNode; node.
-
getLaneData
Returns the editor lane data for the lane of given id.- Parameters:
laneId
- String; id.- Returns:
- EditorLaneData; editor lane data for the lane of given id.
-
getClothoidStartCurvature
public org.djunits.value.vdouble.scalar.LinearDensity getClothoidStartCurvature()Returns the start curvature from the clothoid.- Returns:
- Length; start curvature from the clothoid.
-
getClothoidEndCurvature
public org.djunits.value.vdouble.scalar.LinearDensity getClothoidEndCurvature()Returns the end curvature from the clothoid.- Returns:
- Length; end curvature from the clothoid.
-
getClothoidLength
public org.djunits.value.vdouble.scalar.Length getClothoidLength()Returns the length from the clothoid.- Returns:
- Length; length from the clothoid.
-
getClothoidA
public org.djunits.value.vdouble.scalar.Length getClothoidA()Returns the A value from the clothoid.- Returns:
- Length; A value from the clothoid.
-
getClothoidAppliedShape
Returns whether the shape was applied as a Clothoid, an Arc, or as a Straight, depending on start and end position and direction.- Returns:
- String; "Clothoid", "Arc" or "Straight".
-
toString
-