public class HTMLAnimationPanel extends HTMLGridPanel implements nl.tudelft.simulation.event.EventListenerInterface, NamespaceChangeListener
Copyright (c) 2002-2019 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information https://simulation.tudelft.nl. The DSOL project is distributed under a three-clause BSD-style license, which can be found at https://simulation.tudelft.nl/dsol/3.0/license.html.
DOWN, extent, formatter, GRIDCOLOR, gridSize, homeExtent, htmlGraphics2D, lastDimension, LEFT, preferredSize, RIGHT, showGrid, showToolTip, size, UP, worldCoordinate, ZOOMFACTORABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
HTMLAnimationPanel(Rectangle2D extent,
Dimension size,
nl.tudelft.simulation.dsol.simulators.SimulatorInterface<?,?,?> simulator)
constructs a new AnimationPanel.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAllToggleGISButtonText(String header,
nl.tudelft.simulation.dsol.animation.D2.GisRenderable2D gisMap,
String toolTipText)
Add buttons for toggling all GIS layers on or off.
|
void |
addToggleAnimationButtonText(String name,
Class<? extends nl.tudelft.simulation.dsol.animation.Locatable> locatableClass,
String toolTipText,
boolean initiallyVisible)
Add a button for toggling an animatable class on or off.
|
void |
addToggleGISButtonText(String layerName,
String displayName,
nl.tudelft.simulation.dsol.animation.D2.GisRenderable2D gisMap,
String toolTipText)
Add a button to toggle a GIS Layer on or off.
|
void |
addToggleText(String text)
Add a text to explain animatable classes.
|
Rectangle2D |
fullExtent()
Calculate the full extent based on the current positions of the objects.
|
javax.vecmath.Point4i |
getDragLine() |
SortedSet<nl.tudelft.simulation.dsol.animation.D2.Renderable2DInterface<? extends nl.tudelft.simulation.dsol.animation.Locatable>> |
getElements() |
List<ToggleButtonInfo> |
getToggleButtons() |
void |
hideClass(Class<? extends nl.tudelft.simulation.dsol.animation.Locatable> locatableClass)
Set a class to be hidden in the animation to true.
|
void |
hideClass(String name)
Hide a Locatable class based on the name.
|
void |
hideGISLayer(String layerName)
Set a GIS layer to be hidden in the animation to true.
|
boolean |
isDragLineEnabled() |
boolean |
isShowClass(Class<? extends nl.tudelft.simulation.dsol.animation.Locatable> locatableClass)
Test whether a certain class needs to be shown on the screen or not.
|
boolean |
isShowElement(nl.tudelft.simulation.dsol.animation.D2.Renderable2DInterface<? extends nl.tudelft.simulation.dsol.animation.Locatable> element)
Test whether the element needs to be shown on the screen or not.
|
void |
namingExceptionThrown(NamingExceptionEvent namingEvent) |
void |
notify(nl.tudelft.simulation.event.EventInterface event) |
void |
objectAdded(NamingEvent namingEvent) |
void |
objectRemoved(NamingEvent namingEvent) |
void |
objectRenamed(NamingEvent namingEvent) |
void |
paintComponent(HTMLGraphics2D g2)
Draw the grid.
|
void |
setDragLineEnabled(boolean dragLineEnabled) |
void |
showClass(Class<? extends nl.tudelft.simulation.dsol.animation.Locatable> locatableClass)
Set a class to be shown in the animation to true.
|
void |
showClass(String name)
Show a Locatable class based on the name.
|
void |
showGISLayer(String layerName)
Set a GIS layer to be shown in the animation to true.
|
void |
toggleClass(Class<? extends nl.tudelft.simulation.dsol.animation.Locatable> locatableClass)
Toggle a class to be displayed in the animation to its reverse value.
|
void |
toggleGISLayer(String layerName)
Toggle a GIS layer to be displayed in the animation to its reverse value.
|
void |
zoomAll()
resets the panel to its an extent that covers all displayed objects.
|
displayWorldCoordinateToolTip, drawGrid, getBackground, getDrawingCommands, getExtent, getFont, getFontMetrics, getHeight, getPreferredSize, getSize, getToolTipText, getWidth, getWorldCoordinate, home, imageUpdate, isDirty, isShowGrid, isShowing, isShowToolTip, pan, repaint, setBackground, setFont, setPreferredSize, setShowGrid, setShowing, setShowToolTip, setSize, setToolTipText, setWorldCoordinate, showGrid, zoom, zoompublic HTMLAnimationPanel(Rectangle2D extent, Dimension size, nl.tudelft.simulation.dsol.simulators.SimulatorInterface<?,?,?> simulator) throws RemoteException
extent - Rectangle2D; the extent of the panelsize - Dimension; the size of the panel.simulator - SimulatorInterface<?,?,?>; the simulator of which we want to know the events for animationRemoteException - on network error for one of the listenerspublic void paintComponent(HTMLGraphics2D g2)
paintComponent in class HTMLGridPanelg2 - HTMLGraphics2D; the virtual Graphics2D canvas to enable writing to the browserpublic boolean isShowElement(nl.tudelft.simulation.dsol.animation.D2.Renderable2DInterface<? extends nl.tudelft.simulation.dsol.animation.Locatable> element)
element - Renderable2DInterface<? extends Locatable>; the renderable element to testpublic boolean isShowClass(Class<? extends nl.tudelft.simulation.dsol.animation.Locatable> locatableClass)
locatableClass - Class<? extends Locatable>; the class to testpublic void notify(nl.tudelft.simulation.event.EventInterface event)
throws RemoteException
notify in interface nl.tudelft.simulation.event.EventListenerInterfaceRemoteExceptionpublic void objectAdded(NamingEvent namingEvent)
objectAdded in interface NamespaceChangeListenerpublic void objectRemoved(NamingEvent namingEvent)
objectRemoved in interface NamespaceChangeListenerpublic void objectRenamed(NamingEvent namingEvent)
objectRenamed in interface NamespaceChangeListenerpublic void namingExceptionThrown(NamingExceptionEvent namingEvent)
namingExceptionThrown in interface NamingListenerpublic Rectangle2D fullExtent()
public void zoomAll()
public void showClass(Class<? extends nl.tudelft.simulation.dsol.animation.Locatable> locatableClass)
locatableClass - Class<? extends Locatable>; the class for which the animation has to be shown.public void hideClass(Class<? extends nl.tudelft.simulation.dsol.animation.Locatable> locatableClass)
locatableClass - Class<? extends Locatable>; the class for which the animation has to be hidden.public void toggleClass(Class<? extends nl.tudelft.simulation.dsol.animation.Locatable> locatableClass)
locatableClass - Class<? extends Locatable>; the class for which a visible animation has to be turned off or
vice versa.public final SortedSet<nl.tudelft.simulation.dsol.animation.D2.Renderable2DInterface<? extends nl.tudelft.simulation.dsol.animation.Locatable>> getElements()
public final javax.vecmath.Point4i getDragLine()
public final boolean isDragLineEnabled()
public final void setDragLineEnabled(boolean dragLineEnabled)
dragLineEnabled - boolean; the dragLineEnabled to set.public final void addToggleAnimationButtonText(String name, Class<? extends nl.tudelft.simulation.dsol.animation.Locatable> locatableClass, String toolTipText, boolean initiallyVisible)
name - String; the name of the buttonlocatableClass - Class<? extends Locatable>; the class for which the button holds (e.g., GTU.class)toolTipText - String; the tool tip text to show when hovering over the buttoninitiallyVisible - boolean; whether the class is initially shown or notpublic final void showClass(String name)
name - the name of the class to showpublic final void hideClass(String name)
name - the name of the class to hidepublic final void addToggleText(String text)
text - String; the text to showpublic final void addAllToggleGISButtonText(String header, nl.tudelft.simulation.dsol.animation.D2.GisRenderable2D gisMap, String toolTipText)
header - String; the name of the group of layersgisMap - GisRenderable2D; the GIS map for which the toggles have to be addedtoolTipText - String; the tool tip text to show when hovering over the buttonpublic final void addToggleGISButtonText(String layerName, String displayName, nl.tudelft.simulation.dsol.animation.D2.GisRenderable2D gisMap, String toolTipText)
layerName - String; the name of the layerdisplayName - String; the name to display next to the tick boxgisMap - GisRenderable2D; the maptoolTipText - String; the tool tip textpublic final void showGISLayer(String layerName)
layerName - String; the name of the GIS-layer that has to be shown.public final void hideGISLayer(String layerName)
layerName - String; the name of the GIS-layer that has to be hidden.public final void toggleGISLayer(String layerName)
layerName - String; the name of the GIS-layer that has to be turned off or vice versa.public final List<ToggleButtonInfo> getToggleButtons()
Copyright © 2014–2019 Delft University of Technology. All rights reserved.