org.jscience.chemistry.gui.extended.jviewer
Interface IRenderer

All Known Implementing Classes:
Renderer

public interface IRenderer

This class defines an interface which allows the JViewer to render and manipulate any graphics object which implements this interface.

Note: Only the reference to the Tripos Java molecule's Matrix3D class keeps jviewer from being a true "object" renderer. A future effort should be to move Matrix3D from molecule to JViewer.


Method Summary
 java.lang.Object copy()
          Return a copy of the current object.
 void draw(java.awt.Graphics g)
          Draw the object.
 java.lang.Object findObject(float tx, float ty)
          Find an object given location
 java.util.Vector findObjects(java.awt.Polygon polygon)
          Find a list of objects within a given polygon
 float[] getBBox()
          Return the bounding box of the object being rendered.
 void matMult(Matrix3D rhs)
          Multiply the object's transformation matrix by the matrix specified.
 void matScale(float xf, float yf, float zf)
          Apply the specified scale to the object's transformation matrix.
 void matTransform()
          Apply the object's transformation matrix to its points.
 void matTranslate(float xt, float yt, float zt)
          Apply the specified translation to the object's transformation matrix.
 void matUnit()
          Reset the object's transformation matrix to the identity matrix.
 

Method Detail

getBBox

float[] getBBox()
Return the bounding box of the object being rendered.

Returns:
Array of 6 floats in order of xmin, xmax, ymin, ymax, zmin, zmax. If the object has no bounding box (for example the object is a molecule with no atoms), null is returned.

matUnit

void matUnit()
Reset the object's transformation matrix to the identity matrix.


matTranslate

void matTranslate(float xt,
                  float yt,
                  float zt)
Apply the specified translation to the object's transformation matrix.

Parameters:
xt - x component of translation
yt - y component of translation
zt - z component of translation

matScale

void matScale(float xf,
              float yf,
              float zf)
Apply the specified scale to the object's transformation matrix.

Parameters:
xf - x scale factor
yf - y scale factor
zf - z scale factor

matMult

void matMult(Matrix3D rhs)
Multiply the object's transformation matrix by the matrix specified.

Parameters:
rhs - matrix to be multiplied to object's matrix: M = M rhs

matTransform

void matTransform()
Apply the object's transformation matrix to its points.


draw

void draw(java.awt.Graphics g)
Draw the object.

Parameters:
g - the graphics context.

findObject

java.lang.Object findObject(float tx,
                            float ty)
Find an object given location

Parameters:
tx - the transformed x coordinate of desired target
ty - the transformed y coordinate of desired target
Returns:
DOCUMENT ME!

findObjects

java.util.Vector findObjects(java.awt.Polygon polygon)
Find a list of objects within a given polygon

Parameters:
polygon - the polygon within which objects are searched
Returns:
DOCUMENT ME!

copy

java.lang.Object copy()
Return a copy of the current object.

Returns:
a copy of the current object