nl.tudelft.simulation.dsol.animation
Class Editable

java.lang.Object
  extended by nl.tudelft.simulation.event.EventProducer
      extended by nl.tudelft.simulation.dsol.animation.Editable
All Implemented Interfaces:
Serializable, LocatableInterface, EventProducerInterface

public abstract class Editable
extends EventProducer
implements LocatableInterface

An Editable object is a simulation object that can be edited by the user. That means that the user is capable of instantiating, moving, rotating, and editing the vertices that span up the shape of this object during the simulation.

(c) copyright 2002-2005 Delft University of Technology , the Netherlands.
See for project information www.simulation.tudelft.nl
License of use: Lesser General Public License (LGPL) , no warranty.

Since:
1.4
Version:
$Revision: 1.1 $ $Date: 2007/01/06 13:21:29 $
Author:
Peter Jacobs
See Also:
Serialized Form

Field Summary
protected  Bounds bounds
          the location of the bounds
protected  DirectedPoint location
          the location of the editable
static EventType LOCATION_CHANGED_EVENT
          LOCATION_CHANGED_EVENT the LOCATION_CHANGED_EVENT
protected  SimulatorInterface simulator
          the simulator to use
protected  CartesianPoint[] vertices
          the vertices
 
Fields inherited from class nl.tudelft.simulation.event.EventProducer
listeners
 
Fields inherited from interface nl.tudelft.simulation.event.EventProducerInterface
FIRST_POSITION, LAST_POSITION
 
Constructor Summary
Editable(SimulatorInterface simulator, DirectedPoint location)
          constructs a new Editable
 
Method Summary
 Bounds getBounds()
          returns the bounds of the locatable object.
 DirectedPoint getLocation()
          returns the location of an object
 CartesianPoint[] getVertices()
           
static Map listEditables()
          returns the editables as a list of name=class
 void setBounds(Bounds bounds)
          sets the bounds of this editable
 void setLocation(DirectedPoint location)
          sets the location of this editable.
 void setVertices(CartesianPoint[] vertices)
          sets the vertices of this editable
 
Methods inherited from class nl.tudelft.simulation.event.EventProducer
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, getEventTypes, removeAllListeners, removeAllListeners, removeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCATION_CHANGED_EVENT

public static final EventType LOCATION_CHANGED_EVENT
LOCATION_CHANGED_EVENT the LOCATION_CHANGED_EVENT


simulator

protected SimulatorInterface simulator
the simulator to use


location

protected DirectedPoint location
the location of the editable


bounds

protected Bounds bounds
the location of the bounds


vertices

protected CartesianPoint[] vertices
the vertices

Constructor Detail

Editable

public Editable(SimulatorInterface simulator,
                DirectedPoint location)
constructs a new Editable

Parameters:
simulator - the simulator to schedule on
location - the initial location
Method Detail

listEditables

public static Map listEditables()
returns the editables as a list of name=class

Returns:
the map

getVertices

public CartesianPoint[] getVertices()
Returns:
the vertices of the CartesianPoint

setBounds

public void setBounds(Bounds bounds)
sets the bounds of this editable

Parameters:
bounds - the new bounds of this editable.

setLocation

public void setLocation(DirectedPoint location)
sets the location of this editable.

Parameters:
location - the new location of this editable

setVertices

public void setVertices(CartesianPoint[] vertices)
sets the vertices of this editable

Parameters:
vertices - the new vertices.

getBounds

public Bounds getBounds()
Description copied from interface: LocatableInterface
returns the bounds of the locatable object. The bounds is the not rotated bounds around [0;0;0]

Specified by:
getBounds in interface LocatableInterface
Returns:
BoundingBox include this.getLocation() as center of the box..
See Also:
LocatableInterface.getBounds()

getLocation

public DirectedPoint getLocation()
Description copied from interface: LocatableInterface
returns the location of an object

Specified by:
getLocation in interface LocatableInterface
Returns:
DirectedPoint the location
See Also:
LocatableInterface.getLocation()


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