lt.monarch.math.geom
Class Text3D

java.lang.Object
  extended by lt.monarch.math.geom.Text3D
All Implemented Interfaces:
java.awt.Shape, java.io.Serializable, Primitive, Primitive2D, Primitive3D

public class Text3D
extends java.lang.Object
implements Primitive3D, Primitive2D

Represents a text 3d object.

See Also:
Serialized Form

Field Summary
Modifier and Type Field and Description
 Point3D position
          Position for text.
 java.lang.String text
          The actual text.
 
Constructor Summary
Constructor and Description
Text3D(java.lang.String text, Point3D position)
          Text3D constructor which takes text and it position in 3D space.
 
Method Summary
Modifier and Type Method and Description
 Polygon2D compute2DPolygon(java.awt.Graphics2D g2d, double moveX, double moveY)
          Computes a Polygon2D of the specified text 3d object (with movement).
 boolean contains(double x, double y)
           
 boolean contains(double x, double y, double w, double h)
           
 boolean contains(java.awt.geom.Point2D p)
           
 boolean contains(java.awt.geom.Rectangle2D r)
           
 void dispose()
          Disposes object
protected  void finalize()
           
 java.util.List<Point2D> get2DPoints()
          Get a list of 2D points
 java.util.List<Point3D> get3DPoints()
          Gets a list of 3D points
 Point2D getAnchorPoint()
          Gets rotation anchor point
 java.awt.Rectangle getBounds()
           
 java.awt.geom.Rectangle2D getBounds2D()
           
 java.awt.Color getColor()
          Retrieves a color value of the text.
 java.awt.Font getFont()
          Retrieves text font information.
 java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform at)
           
 java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform at, double flatness)
           
 double getRotation()
          Gets rotation angle
 int getSelectionId()
          Gets associated chart obejct id
 boolean intersects(double x, double y, double w, double h)
           
 boolean intersects(java.awt.geom.Rectangle2D r)
           
 void setAnchorPoint(Point2D anchorPoint)
          Sets rotation anchor point
 void setColor(java.awt.Color color)
          Sets a color value.
 void setFont(java.awt.Font font)
          Sets a text font.
 void setRotation(double rotation)
          Sets the rotation angle
 void setSelectionID(int id)
          Sets associated chart object id
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

text

public java.lang.String text
The actual text.


position

public Point3D position
Position for text.

Constructor Detail

Text3D

public Text3D(java.lang.String text,
              Point3D position)
Text3D constructor which takes text and it position in 3D space.

Parameters:
text - - text
position - - position
Method Detail

get3DPoints

public java.util.List<Point3D> get3DPoints()
Description copied from interface: Primitive3D
Gets a list of 3D points

Specified by:
get3DPoints in interface Primitive3D
Returns:
list of 3D points

setColor

public void setColor(java.awt.Color color)
Sets a color value.

Parameters:
color - - color

getColor

public java.awt.Color getColor()
Retrieves a color value of the text.

Returns:
- color

setFont

public void setFont(java.awt.Font font)
Sets a text font.

Parameters:
font - - text font

getFont

public java.awt.Font getFont()
Retrieves text font information.

Returns:
- text font

get2DPoints

public java.util.List<Point2D> get2DPoints()
Description copied from interface: Primitive2D
Get a list of 2D points

Specified by:
get2DPoints in interface Primitive2D
Returns:
list of 2D points

dispose

public void dispose()
Description copied from interface: Primitive
Disposes object

Specified by:
dispose in interface Primitive
Specified by:
dispose in interface Primitive2D

finalize

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

getBounds2D

public java.awt.geom.Rectangle2D getBounds2D()
Specified by:
getBounds2D in interface java.awt.Shape
Specified by:
getBounds2D in interface Primitive

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getRotation

public double getRotation()
Gets rotation angle

Returns:
the rotation angle

setRotation

public void setRotation(double rotation)
Sets the rotation angle

Parameters:
rotation - the rotation angle to set

getAnchorPoint

public Point2D getAnchorPoint()
Gets rotation anchor point

Returns:
rotation anchor point

setAnchorPoint

public void setAnchorPoint(Point2D anchorPoint)
Sets rotation anchor point

Parameters:
anchorPoint - the anchorPoint to set

contains

public boolean contains(java.awt.geom.Point2D p)
Specified by:
contains in interface java.awt.Shape

contains

public boolean contains(java.awt.geom.Rectangle2D r)
Specified by:
contains in interface java.awt.Shape

contains

public boolean contains(double x,
                        double y)
Specified by:
contains in interface java.awt.Shape

contains

public boolean contains(double x,
                        double y,
                        double w,
                        double h)
Specified by:
contains in interface java.awt.Shape

getBounds

public java.awt.Rectangle getBounds()
Specified by:
getBounds in interface java.awt.Shape

getPathIterator

public java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform at)
Specified by:
getPathIterator in interface java.awt.Shape

getPathIterator

public java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform at,
                                                  double flatness)
Specified by:
getPathIterator in interface java.awt.Shape

intersects

public boolean intersects(java.awt.geom.Rectangle2D r)
Specified by:
intersects in interface java.awt.Shape

intersects

public boolean intersects(double x,
                          double y,
                          double w,
                          double h)
Specified by:
intersects in interface java.awt.Shape

compute2DPolygon

public Polygon2D compute2DPolygon(java.awt.Graphics2D g2d,
                                  double moveX,
                                  double moveY)
Computes a Polygon2D of the specified text 3d object (with movement).

Parameters:
g2d - a graphics context for retrieving text bounds

setSelectionID

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

Specified by:
setSelectionID in interface Primitive3D
Parameters:
if - chart object id

getSelectionId

public int getSelectionId()
Gets associated chart obejct id

Specified by:
getSelectionId in interface Primitive3D
Returns:
chart object id