Class EditorMap
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.opentrafficsim.editor.extensions.map.EditorMap
- All Implemented Interfaces:
ImageObserver
,MenuContainer
,Serializable
,Remote
,EventListener
,Accessible
,org.djutils.event.EventListener
Editor map.
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:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
Field Summary
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Fields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
Method Summary
Modifier and TypeMethodDescriptionfinal void
addToggle
(String name, Class<? extends nl.tudelft.simulation.dsol.animation.Locatable> locatableClass, String iconPath, String toolTipText, boolean initiallyVisible, boolean idButton) Add a button for toggling an animatable class on or off.static EditorMap
Builds a map panel with an animator and context.(package private) nl.tudelft.simulation.naming.context.Contextualized
Returns the context.getData
(XsdTreeNode node) Returns the map data of the given XSD node.org.opentrafficsim.core.geometry.Flattener
Returns the network level flattener, or a 64 segment flattener of none specified.(package private) RoadLayoutListener
Returns the road layout listener from which aMapLinkData
can obtain offsets.void
notify
(org.djutils.event.Event event) void
reinitialize
(XsdTreeNode node) Reinitialize animation on object who's animator stores static information that depends on something that was changed.(package private) void
removeAnimation
(nl.tudelft.simulation.dsol.animation.d2.Renderable2d<?> animation) Remove animation.void
setInvalid
(MapData data) Set the data as being invalid to draw.void
Set the data as being valid to draw.Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Method Details
-
addToggle
public final void addToggle(String name, Class<? extends nl.tudelft.simulation.dsol.animation.Locatable> locatableClass, String iconPath, String toolTipText, boolean initiallyVisible, boolean idButton) Add a button for toggling an animatable class on or off. Button icons for which 'idButton' is true will be placed to the right of the previous button, which should be the corresponding button without the id. An example is an icon for showing/hiding the class 'Lane' followed by the button to show/hide the Lane ids.- Parameters:
name
- String; the name of the buttonlocatableClass
- Class<? extends Locatable>; the class for which the button holds (e.g., GTU.class)iconPath
- String; the path to the 24x24 icon to displaytoolTipText
- String; the tool tip text to show when hovering over the buttoninitiallyVisible
- boolean; whether the class is initially shown or notidButton
- boolean; id button that needs to be placed next to the previous button
-
build
Builds a map panel with an animator and context.- Parameters:
editor
- OtsEditor; editor.- Returns:
- Map; map.
- Throws:
RemoteException
- context binding problem.NamingException
- context binding problem.
-
notify
- Specified by:
notify
in interfaceorg.djutils.event.EventListener
- Throws:
RemoteException
-
setValid
Set the data as being valid to draw.- Parameters:
data
- MapData; data that is valid to draw.
-
setInvalid
Set the data as being invalid to draw.- Parameters:
data
- MapData; data that is invalid to draw.
-
reinitialize
Reinitialize animation on object who's animator stores static information that depends on something that was changed. This will create a new animation object. Only data objects that know their animations have static data, should call this. And only when information changed on which the static data depends.- Parameters:
node
- XsdTreeNode; node.
-
getData
Returns the map data of the given XSD node.- Parameters:
node
- XsdTreeNode; node.- Returns:
- MapData; map data of the given XSD node,
null
if no such data.
-
getRoadLayoutListener
Returns the road layout listener from which aMapLinkData
can obtain offsets.- Parameters:
node
- XsdTreeNode; node of a defined layout.- Returns:
- RoadLayoutListener; listener, can be used to obtain offsets.
-
removeAnimation
void removeAnimation(nl.tudelft.simulation.dsol.animation.d2.Renderable2d<?> animation) Remove animation.- Parameters:
animation
- Renderable2d<?>; animation to remove.
-
getContextualized
nl.tudelft.simulation.naming.context.Contextualized getContextualized()Returns the context.- Returns:
- Contextualized; context.
-
getNetworkFlattener
public org.opentrafficsim.core.geometry.Flattener getNetworkFlattener()Returns the network level flattener, or a 64 segment flattener of none specified.- Returns:
- Flattener; flattener.
-