smithers.java3d
Class Drawable3D

java.lang.Object
  extended by smithers.java3d.Drawable3D
Direct Known Subclasses:
Panel3D.DrawablePolygon

public abstract class Drawable3D
extends java.lang.Object

Represents a drawable 3D object. Objects of classes extending this can be added to a Panel3D and will be drawn upon it.


Field Summary
protected  Polygon3D poly
          The 3-d polygon which this object fills up.
 
Constructor Summary
Drawable3D()
          Sole constructor.
 
Method Summary
 void addMouesWheelListener(java.awt.event.MouseWheelListener l)
          Registers the specified listener to receive mouse wheel events from this component.
 void addMouseListener(java.awt.event.MouseListener l)
          Registers the specified listener to receive mouse events from this component.
 void addMouseMotionListener(java.awt.event.MouseMotionListener l)
          Registers the specified listener to receive mouse motion events from this component.
abstract  java.awt.Shape drawOn(java.awt.Graphics2D g, Transformation trans)
          Draws this object.
 Polygon3D getShape()
          Returns the 3-d polygon which this object fills up.
 void removeMouesWheelListener(java.awt.event.MouseWheelListener l)
          Removes the specified listener from receiving mouse wheel events from this component.
 void removeMouseListener(java.awt.event.MouseListener l)
          Removes the specified listener from receiving mouse events from this component.
 void removeMouseMotionListener(java.awt.event.MouseMotionListener l)
          Removes the specified listener from receiving mouse motion events from this component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

poly

protected Polygon3D poly
The 3-d polygon which this object fills up.

Constructor Detail

Drawable3D

public Drawable3D()
Sole constructor.

Method Detail

getShape

public Polygon3D getShape()
Returns the 3-d polygon which this object fills up.

Returns:
the object's polygon

drawOn

public abstract java.awt.Shape drawOn(java.awt.Graphics2D g,
                                      Transformation trans)
Draws this object. This method should draw the object, as transformed by trans, on g. The method should return a Shape, indicating the region which it covered. This is to enable the container to deliver mouse events.

Parameters:
g - the graphics object on which to draw
trans - the transformation to use
Returns:
the region of space which was filled

addMouseListener

public void addMouseListener(java.awt.event.MouseListener l)
Registers the specified listener to receive mouse events from this component.

Parameters:
l - the listener

removeMouseListener

public void removeMouseListener(java.awt.event.MouseListener l)
Removes the specified listener from receiving mouse events from this component.

Parameters:
l - the listener

addMouseMotionListener

public void addMouseMotionListener(java.awt.event.MouseMotionListener l)
Registers the specified listener to receive mouse motion events from this component.

Parameters:
l - the listener

removeMouseMotionListener

public void removeMouseMotionListener(java.awt.event.MouseMotionListener l)
Removes the specified listener from receiving mouse motion events from this component.

Parameters:
l - the listener

addMouesWheelListener

public void addMouesWheelListener(java.awt.event.MouseWheelListener l)
Registers the specified listener to receive mouse wheel events from this component.

Parameters:
l - the listener

removeMouesWheelListener

public void removeMouesWheelListener(java.awt.event.MouseWheelListener l)
Removes the specified listener from receiving mouse wheel events from this component.

Parameters:
l - the listener