lt.monarch.chart.util
Class DirectProjector

java.lang.Object
  extended by lt.monarch.chart.util.DirectProjector
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Projector

public class DirectProjector
extends java.lang.Object
implements Projector, java.io.Serializable

Simple projector, which just converts Point2D objects to java.awt.Point objects

See Also:
Serialized Form

Field Summary
Modifier and Type Field and Description
static DirectProjector instance
           
 
Method Summary
Modifier and Type Method and Description
 java.lang.Object clone()
          Clones this projector
 Rectangle2D getProjectionArea()
          Returns a 2D projection space
 Rectangle2D getProjectionAreaReference()
          Returns a 2D projection space reference
 void prepare()
          Prepares the projector.
 GeneralPoint project(GeneralPoint point)
          Projects a n-dimensional point into a 2D Point.
 GeneralPoint project(GeneralPoint point, GeneralPoint p)
          Projects a n-dimensional point into a 2D Point.
 Polygon2D project(Rectangle2D r)
          Projects a rectangle into polygon.
 void setProjectionArea(Rectangle2D r)
          Sets a 2D projection space
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

public static final DirectProjector instance
Method Detail

setProjectionArea

public void setProjectionArea(Rectangle2D r)
Description copied from interface: Projector
Sets a 2D projection space

Specified by:
setProjectionArea in interface Projector
Parameters:
r - projection space

getProjectionAreaReference

public Rectangle2D getProjectionAreaReference()
Description copied from interface: Projector
Returns a 2D projection space reference

Specified by:
getProjectionAreaReference in interface Projector
Returns:
projection space

getProjectionArea

public Rectangle2D getProjectionArea()
Description copied from interface: Projector
Returns a 2D projection space

Specified by:
getProjectionArea in interface Projector
Returns:
projection space

prepare

public void prepare()
Description copied from interface: Projector
Prepares the projector. Allows the projector to do some tedious calculations in advance.

Specified by:
prepare in interface Projector

project

public GeneralPoint project(GeneralPoint point)
Description copied from interface: Projector
Projects a n-dimensional point into a 2D Point.

Specified by:
project in interface Projector
Parameters:
point - n-dimensional point
Returns:
creates and returns a 2D Point

project

public GeneralPoint project(GeneralPoint point,
                            GeneralPoint p)
Description copied from interface: Projector
Projects a n-dimensional point into a 2D Point. A 2D point is template is used to avoid unnecessary object creation

Specified by:
project in interface Projector
Parameters:
point - n-dimensional point
p - point object, to be changed
Returns:
template value

project

public Polygon2D project(Rectangle2D r)
Description copied from interface: Projector
Projects a rectangle into polygon.

Specified by:
project in interface Projector
Parameters:
r - 2D rectangle
Returns:
projected polygon

clone

public java.lang.Object clone()
Description copied from interface: Projector
Clones this projector

Specified by:
clone in interface Projector
Overrides:
clone in class java.lang.Object
Returns:
cloned projector