Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## nl.tudelft.simulation.dsol.animation.D2
Class Renderable2D

    java.lang.Object
      nl.tudelft.simulation.dsol.animation.D2.Renderable2D

All Implemented Interfaces:
  Renderable2DInterface

Direct Known Subclasses:
  EditableRenderable2D, ImageRenderable

public abstract class Renderable2D
extends java.lang.Object
implements Renderable2DInterface

The Renderable2D provides an easy accessible renderable object.

(c) copyright 2003 Delft University of Technology , the Netherlands.
See for project information www.simulation.tudelft.nl
License of use: General Public License (GPL) , no warranty

Version:
  2.0 10.11.2003
Author:
  Peter Jacobs

Nested Class Summary

Nested classes inherited from class nl.tudelft.simulation.dsol.animation.D2.Renderable2DInterface
`Renderable2DInterface.Util`

Field Summary
`protected boolean` | `flip` whether to flip the renderable after rotating 180 degrees
`protected boolean` | `rotate` whether to rotate the renderable
`protected boolean` | `scale` whether to scale the renderable when zooming in or out
`protected SimulatorInterface` | `simulator` simulator
`protected LocatableInterface` | `source` the source of the renderable
`protected boolean` | `translate` whether to translate the renderable when panning

Constructor Summary
`Renderable2D(LocatableInterface source, SimulatorInterface simulator)` constructs a new Renderable2D

Method Summary
`boolean` | `contains(java.awt.geom.Point2D pointWorldCoordinates, java.awt.geom.Rectangle2D extent, java.awt.Dimension screen)` does the shape contain the point
`void` | `destroy()` destroys an RenderableObject by unsubscribing it from the context.
`LocatableInterface` | `getSource()` gets the source of this renderable
`boolean` | `isFlip()`
`boolean` | `isRotate()`
`boolean` | `isScale()`
`boolean` | `isTranslate()`
`abstract void` | `paint(java.awt.Graphics2D graphics, java.awt.image.ImageObserver observer)` draws an animation on a worldcoordinates around [x,y=0,0]
`void` | `paint(java.awt.Graphics2D graphics, java.awt.geom.Rectangle2D extent, java.awt.Dimension screen, java.awt.image.ImageObserver observer)` paints the object on a 2D graphics object
`void` | `setFlip(boolean flip)`
`void` | `setRotate(boolean rotate)`
`void` | `setScale(boolean scale)`
`void` | `setTranslate(boolean translate)`
`java.lang.String` | `toString()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### rotate

    protected boolean rotate

  whether to rotate the renderable

### flip

    protected boolean flip

  whether to flip the renderable after rotating 180 degrees

### scale

    protected boolean scale

  whether to scale the renderable when zooming in or out

### translate

    protected boolean translate

  whether to translate the renderable when panning

### simulator

    protected SimulatorInterface simulator

  simulator

### source

    protected LocatableInterface source

  the source of the renderable

Constructor Detail

### Renderable2D

    public Renderable2D(LocatableInterface source,
                        SimulatorInterface simulator)

  constructs a new Renderable2D

Parameters:
  `source` - the source
  `simulator` - the simulator

Method Detail

### isFlip

    public boolean isFlip()

  Returns:
    Returns the flip.

### setFlip

    public void setFlip(boolean flip)

  Parameters:
    `flip` - The flip to set.

### isRotate

    public boolean isRotate()

  Returns:
    Returns the rotate.

### setRotate

    public void setRotate(boolean rotate)

  Parameters:
    `rotate` - The rotate to set.

### isScale

    public boolean isScale()

  Returns:
    Returns the scale.

### setScale

    public void setScale(boolean scale)

  Parameters:
    `scale` - The scale to set.

### getSource

    public LocatableInterface getSource()

  Description copied from interface: `Renderable2DInterface`
  gets the source of this renderable

  Specified by:
    `getSource` in interface `Renderable2DInterface`
  Returns:
    Locatable the source
  See Also:
    `Renderable2DInterface.getSource()`

### isTranslate

    public boolean isTranslate()

  Returns:
    Returns the translate.

### setTranslate

    public void setTranslate(boolean translate)

  Parameters:
    `translate` - The translate to set.

### paint

    public void paint(java.awt.Graphics2D graphics,
                      java.awt.geom.Rectangle2D extent,
                      java.awt.Dimension screen,
                      java.awt.image.ImageObserver observer)

  Description copied from interface: `Renderable2DInterface`
  paints the object on a 2D graphics object

  Specified by:
    `paint` in interface `Renderable2DInterface`
  Parameters:
    `graphics` - the graphics object
    `extent` - the extent of the panel
    `screen` - the screen of the panel
    `observer` - the observer of the renderableInterface
  See Also:
    `#paint(Graphics2D, Rectangle2D, Dimension,ImageObserver)`

### contains

    public boolean contains(java.awt.geom.Point2D pointWorldCoordinates,
                            java.awt.geom.Rectangle2D extent,
                            java.awt.Dimension screen)

  Description copied from interface: `Renderable2DInterface`
  does the shape contain the point

  Specified by:
    `contains` in interface `Renderable2DInterface`
  Parameters:
    `pointWorldCoordinates` - 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` - the extent of the panel.
    `screen` - the screen of the panel.
  Returns:
    whether the point is in the shape
  See Also:
    `#contains(java.awt.geom.Point2D, java.awt.geom.Rectangle2D, java.awt.Dimension)`

### destroy

    public void destroy()

  destroys an RenderableObject by unsubscribing it from the context.

  Specified by:
    `destroy` in interface `Renderable2DInterface`

### toString

    public java.lang.String toString()

  See Also:
    `Object.toString()`

### paint

    public abstract void paint(java.awt.Graphics2D graphics,
                               java.awt.image.ImageObserver observer)
                        throws java.rmi.RemoteException

  draws an animation on a worldcoordinates around [x,y=0,0]

  Parameters:
    `graphics` - the graphics object
    `observer` - the observer
  Throws:
    `java.rmi.RemoteException` - on network exception

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2002-2004 Delft University of Technology, the Netherlands. All Rights Reserved.