Interface Renderable2dInterface<L extends Locatable>
- Type Parameters:
L
- the Locatable class of the source that indicates the location of the Renderable on the screen
- All Superinterfaces:
Serializable
- All Known Subinterfaces:
GisRenderable2d
- All Known Implementing Classes:
ImageRenderable
,Renderable2d
,SingleImageRenderable
The Renderable2d interface defines the basic interface for 2d animation. This is a hard-to-use interface. It is implemented
by the easy-to-use Renderable2d class.
Copyright (c) 2002-2024 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://https://simulation.tudelft.nl/dsol/docs/latest/license.html.
- Author:
- Peter Jacobs
-
Method Summary
Modifier and TypeMethodDescriptionboolean
does the shape contain the point?void
destroy
(Contextualized contextProvider) destroys this editable.long
getId()
return the id of the renderable component.gets the source of this renderable.void
paintComponent
(Graphics2D graphics, Bounds2d extent, Dimension screenSize, RenderableScale renderableScale, ImageObserver observer) the overarching method that is called when painting, usually redirecting to paint(...) but possibly retrieving the drawing from a cache.
-
Method Details
-
paintComponent
void paintComponent(Graphics2D graphics, Bounds2d extent, Dimension screenSize, RenderableScale renderableScale, ImageObserver observer) the overarching method that is called when painting, usually redirecting to paint(...) but possibly retrieving the drawing from a cache.- Parameters:
graphics
- Graphics2D; the graphics objectextent
- Bounds2d; the extent of the panelscreenSize
- Dimension; the screen of the panelrenderableScale
- RenderableScale; the scale to use (usually RenderableScaleDefault where X/Y ratio is 1)observer
- ImageObserver; the observer of the renderableInterface
-
getSource
L getSource()gets the source of this renderable.- Returns:
- Locatable the source
-
contains
does the shape contain the point?- Parameters:
pointWorldCoordinates
- Point2d; the point in world coordinates. Default implementation is to intersect the 3D bounds on location.z and to return the bounds2D of this intersect.extent
- Bounds2d; the extent of the panel.- Returns:
- whether the point is in the shape
- Throws:
IllegalStateException
- when the renderable does not overlap with the extent
-
destroy
destroys this editable. How to do this must be implemented by the modeler.- Parameters:
contextProvider
- Contextualized; the object that can provide the context to bind and unbind the animation objects- Throws:
RemoteException
- RemoteExceptionNamingException
- NamingException
-
getId
long getId()return the id of the renderable component.- Returns:
- long; the id of the renderable component
-