lt.monarch.chart.chart3D.engine
Class Shape3D<ChartProjector extends Projector>

java.lang.Object
  extended by lt.monarch.chart.chart3D.engine.Shape3D<ChartProjector>
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
Bar3D, Cone3D, Pole3D, Sphere3D

public abstract class Shape3D<ChartProjector extends Projector>
extends java.lang.Object
implements java.io.Serializable

Shape interface for drawing shapes in bar series.

See Also:
Serialized Form

Nested Class Summary
Modifier and Type Class and Description
protected  class Shape3D.Line
          Class for storing line coordinates
protected  class Shape3D.Polygon
          Class for storing polygon coordinates
protected static interface Shape3D.ProjectableShape<ChartProjector extends Projector>
           
 
Field Summary
Modifier and Type Field and Description
protected  Rectangle3D bounds
          Bounds of the shape
protected  java.util.ArrayList<Shape3D.ProjectableShape<Projector3D>> shapeList
          List of shapes to draw
 
Constructor Summary
Constructor and Description
Shape3D()
           
 
Method Summary
Modifier and Type Method and Description
 void dispose()
          Clears the shape object
 java.util.List<java.awt.Shape> draw(int index, AbstractGraphics g, ChartProjector projector, PlaneMapper mapper, AbstractPaintTags tag, Style style, PaintMode paintMode)
          Draws the shape into the graphic context
protected  void finalize()
           
 Rectangle3D getBounds()
          Gets bounds of the shape
 int getSelectionId()
          Gets associated chart obejct id
protected abstract  void initShape()
          Initializes the shape and adds its points to the array
protected  Point3D projectPoint(Point3D point, Projector3D projector)
          Projects point to the real coordinates
 void setBounds(double x1, double y1, double z1, double x2, double y2, double z2)
          Sets bounds of the shape
 void setDrawTransformation(Transformation3D transformation, double anchorX, double anchorY, double anchorZ)
          Sets a drawing transformation.
 void setSelectionID(int id)
          Sets associated chart object id
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

shapeList

protected java.util.ArrayList<Shape3D.ProjectableShape<Projector3D>> shapeList
List of shapes to draw


bounds

protected Rectangle3D bounds
Bounds of the shape

Constructor Detail

Shape3D

public Shape3D()
Method Detail

setBounds

public void setBounds(double x1,
                      double y1,
                      double z1,
                      double x2,
                      double y2,
                      double z2)
Sets bounds of the shape

Parameters:
x1 - x coordinate
y1 - y coordinate
z1 - z coordinate
x2 - opposite corner x coordinate
y2 - opposite corner y coordinate
z2 - opposite corner z coordinate

draw

public java.util.List<java.awt.Shape> draw(int index,
                                           AbstractGraphics g,
                                           ChartProjector projector,
                                           PlaneMapper mapper,
                                           AbstractPaintTags tag,
                                           Style style,
                                           PaintMode paintMode)
Draws the shape into the graphic context

Parameters:
index - index of the bar in the series
g - graphic context
projector - projector
mapper - mapper
style - bar style
paintMode - painting mode

getBounds

public Rectangle3D getBounds()
Gets bounds of the shape

Returns:
shape bounds

projectPoint

protected Point3D projectPoint(Point3D point,
                               Projector3D projector)
Projects point to the real coordinates

Parameters:
point - point to project
projector - projector
Returns:
projected point

setDrawTransformation

public void setDrawTransformation(Transformation3D transformation,
                                  double anchorX,
                                  double anchorY,
                                  double anchorZ)
Sets a drawing transformation.

Parameters:
transformation - transformation object
anchorX - the x coordinate of transformation pivot
anchorY - the y coordinate of transformation pivot
anchorZ - the z coordinate of transformation pivot

initShape

protected abstract void initShape()
Initializes the shape and adds its points to the array


dispose

public void dispose()
Clears the shape object


finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

setSelectionID

public void setSelectionID(int id)
Sets associated chart object id

Parameters:
if - chart object id

getSelectionId

public int getSelectionId()
Gets associated chart obejct id

Returns:
chart object id