Class MapLinkData
java.lang.Object
org.opentrafficsim.editor.extensions.map.MapData
org.opentrafficsim.editor.extensions.map.MapLinkData
- All Implemented Interfaces:
EventListener,nl.tudelft.simulation.dsol.animation.Locatable,Identifiable,EventListener,EventProducer,OtsShape,LineLocatable,LinkAnimation.LinkData,EvalWrapper.EvalListener
public class MapLinkData
extends MapData
implements LinkAnimation.LinkData, EventListener, 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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassRemembers minimum and maximum start and end offset, to return the mean of both. -
Field Summary
FieldsFields inherited from interface org.djutils.event.EventProducer
FIRST_POSITION, LAST_POSITIONFields inherited from interface org.opentrafficsim.base.geometry.OtsShape
DEFAULT_POLYGON_SEGMENTS, WORLD_MARGIN_LINE -
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.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.Returns the end curvature from the clothoid.Returns the length from the clothoid.Returns the start curvature from the clothoid.getId()getLaneData(String laneId) Returns the editor lane data for the lane of given id.getLine()protected Collection<MapStripeData>Returns the stripes.booleanvoidvoidNotification 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, 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.LineLocatable
contains, signedDistanceMethods inherited from interface org.opentrafficsim.draw.network.LinkAnimation.LinkData
getZMethods inherited from interface org.opentrafficsim.base.geometry.OtsShape
contains, getAbsoluteBounds, getAbsoluteContour, getDirZ, getRelativeBounds, signedDistance
-
Field Details
-
LAYOUT_REBUILT
Event when layout is rebuilt.
-
-
Constructor Details
-
MapLinkData
Constructor.- Parameters:
map- map.linkNode- node Ots.Network.Link.editor- editor.
-
-
Method Details
-
destroy
public void destroy()Description copied from class:MapDataDestroy 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. -
getLocation
- Specified by:
getLocationin interfaceLinkAnimation.LinkData- Specified by:
getLocationin interfacenl.tudelft.simulation.dsol.animation.Locatable- Specified by:
getLocationin interfaceOtsShape
-
getAbsoluteContour
- Specified by:
getAbsoluteContourin interfaceOtsShape
-
getRelativeContour
- Specified by:
getRelativeContourin interfaceOtsShape
-
getId
- Specified by:
getIdin interfaceIdentifiable
-
isConnector
public boolean isConnector()- Specified by:
isConnectorin interfaceLinkAnimation.LinkData
-
getCenterLine
- Specified by:
getCenterLinein interfaceLinkAnimation.LinkData
-
getLine
- Specified by:
getLinein interfaceLineLocatable
-
notify
- Specified by:
notifyin interfaceEventListener
-
addCoordinate
The map was notified a new coordinate node was added. The node may or may not be part of this link.- Parameters:
node- 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- removed coordinate node.
-
getStripeData
Returns the stripes.- Returns:
- stripes
-
getEventListenerMap
- Specified by:
getEventListenerMapin interfaceEventProducer
-
evalChanged
public void evalChanged()Description copied from interface:EvalWrapper.EvalListenerNotifies 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- node.
-
getLaneData
Returns the editor lane data for the lane of given id.- Parameters:
laneId- id.- Returns:
- editor lane data for the lane of given id.
-
getClothoidStartCurvature
Returns the start curvature from the clothoid.- Returns:
- start curvature from the clothoid.
-
getClothoidEndCurvature
Returns the end curvature from the clothoid.- Returns:
- end curvature from the clothoid.
-
getClothoidLength
Returns the length from the clothoid.- Returns:
- length from the clothoid.
-
getClothoidA
Returns the A value from the clothoid.- Returns:
- 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:
- "Clothoid", "Arc" or "Straight".
-
toString
-