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
FieldsModifier and TypeFieldDescriptionstatic final org.djutils.event.EventTypeEvent when layout is rebuilt.Fields inherited from interface org.djutils.event.EventProducer
FIRST_POSITION, LAST_POSITION -
Constructor Summary
ConstructorsConstructorDescriptionMapLinkData(EditorMap map, XsdTreeNode linkNode, OtsEditor editor) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCoordinate(XsdTreeNode node) The map was notified a new coordinate node was added.voiddestroy()Destroy this data object, e.g. remove self as listener.voidNotifies the listener that evaluation results may have changed.org.opentrafficsim.base.geometry.OtsBounds2dorg.djunits.value.vdouble.scalar.LengthReturns 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.LinearDensityReturns the end curvature from the clothoid.org.djunits.value.vdouble.scalar.LengthReturns the length from the clothoid.org.djunits.value.vdouble.scalar.LinearDensityReturns the start curvature from the clothoid.org.djutils.draw.line.PolyLine2dorg.djutils.event.EventListenerMapgetId()getLaneData(String laneId) Returns the editor lane data for the lane of given id.org.djutils.draw.point.OrientedPoint2dbooleanvoidnotify(org.djutils.event.Event event) voidNotification from the Map that a node (Ots.Network.Node) id was changed.voidremoveCoordinate(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, setValueMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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, removeListenerMethods inherited from interface org.opentrafficsim.draw.network.LinkAnimation.LinkData
getZMethods 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:
getBoundsin interfacenl.tudelft.simulation.dsol.animation.Locatable- Specified by:
getBoundsin interfaceorg.opentrafficsim.base.geometry.OtsLocatable
-
getId
- Specified by:
getIdin interfaceorg.djutils.base.Identifiable
-
getLocation
public org.djutils.draw.point.OrientedPoint2d getLocation()- Specified by:
getLocationin interfaceLinkAnimation.LinkData- Specified by:
getLocationin interfacenl.tudelft.simulation.dsol.animation.Locatable- Specified by:
getLocationin interfaceorg.opentrafficsim.base.geometry.OtsLocatable
-
isConnector
public boolean isConnector()- Specified by:
isConnectorin interfaceLinkAnimation.LinkData
-
getDesignLine
public org.djutils.draw.line.PolyLine2d getDesignLine()- Specified by:
getDesignLinein interfaceLinkAnimation.LinkData
-
notify
- Specified by:
notifyin 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:
getEventListenerMapin interfaceorg.djutils.event.EventProducer- Throws:
RemoteException
-
evalChanged
public void evalChanged()Notifies the listener that evaluation results may have changed.- Specified by:
evalChangedin 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
-