ChartCat 1.2

li.netcat.chart.util.elem
Class TextElement

java.lang.Object
  extended byli.netcat.chart.util.elem.Element
      extended byli.netcat.chart.util.elem.TextElement

public class TextElement
extends Element

Immutable, basic text element of a chart. It contains the text, the look of the text, the angle and the coordinates of the paint position.

Author:
Arthur Marxer

Field Summary
static int BASELINE
          Equal to ChartConstants.BASELINE
static int BOTTOM
          Equal to ChartConstants.BOTTOM
static int CENTER
          Equal to ChartConstants.CENTER
static int LEFT
          Equal to ChartConstants.LEFT
static int RIGHT
          Equal to ChartConstants.RIGHT
static int TOP
          Equal to ChartConstants.TOP
 
Constructor Summary
TextElement(DeviceString text, TextLook textLook, float x, float y, int hAlign, int vAlign, double angle, java.lang.Object perspective)
          Constructs a new text element and initializes its fields to the given values.
TextElement(DeviceString text, TextLook textLook, float x, float y, int hAlign, int vAlign, double angle, java.lang.Object perspective, LogicalPoint point)
          Constructs a new text element and initializes its fields to the given values.
 
Method Summary
 boolean contains(java.awt.Point p)
          Returns true if this element contains the given point.
 double getAngle()
          Returns the angle of the text in radians. 0 refers to horizontal text.
 float getBaseX()
          Returns the x-coordinate of the baseline point.
 float getBaseY()
          Returns the y-coordinate of the baseline point.
 java.awt.geom.Rectangle2D.Float getBounds(java.awt.geom.Rectangle2D.Float out)
          Returns the bounds of this element in float precision.
 DeviceString getText()
          Returns the text of this element.
 TextLook getTextLook()
          Returns the look of the text.
 
Methods inherited from class li.netcat.chart.util.elem.Element
getLogicalPoint, getPerspective
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TOP

public static final int TOP
Equal to ChartConstants.TOP

See Also:
Constant Field Values

LEFT

public static final int LEFT
Equal to ChartConstants.LEFT

See Also:
Constant Field Values

BOTTOM

public static final int BOTTOM
Equal to ChartConstants.BOTTOM

See Also:
Constant Field Values

RIGHT

public static final int RIGHT
Equal to ChartConstants.RIGHT

See Also:
Constant Field Values

CENTER

public static final int CENTER
Equal to ChartConstants.CENTER

See Also:
Constant Field Values

BASELINE

public static final int BASELINE
Equal to ChartConstants.BASELINE

See Also:
Constant Field Values
Constructor Detail

TextElement

public TextElement(DeviceString text,
                   TextLook textLook,
                   float x,
                   float y,
                   int hAlign,
                   int vAlign,
                   double angle,
                   java.lang.Object perspective)
Constructs a new text element and initializes its fields to the given values.

Parameters:
text - The text to be added, not null.
textLook - The look of the text, not null.
x - The x-coordinate of the anchor point.
y - The y-coordinate of the anchor point.
hAlign - The horizontal alignment, specify one of LEFT, CENTER or RIGHT.
vAlign - The vertical alignment, specify one of TOP, CENTER, BASELINE or BOTTOM..
angle - The angle of the text in radians. 0 refers to horizontal text.
perspective - The perspective position of this element.
See Also:
PerspectivePart

TextElement

public TextElement(DeviceString text,
                   TextLook textLook,
                   float x,
                   float y,
                   int hAlign,
                   int vAlign,
                   double angle,
                   java.lang.Object perspective,
                   LogicalPoint point)
Constructs a new text element and initializes its fields to the given values.

Parameters:
text - The text to be added, not null.
textLook - The look of the text, not null.
x - The x-coordinate of the anchor point.
y - The y-coordinate of the anchor point.
hAlign - The horizontal alignment, specify one of LEFT, CENTER or RIGHT.
vAlign - The vertical alignment, specify one of TOP, CENTER, BASELINE or BOTTOM..
angle - The angle of the text in radians. 0 refers to horizontal text.
perspective - The perspective position of this element.
point - The logical point to which this element points to.
See Also:
PerspectivePart
Method Detail

getText

public DeviceString getText()
Returns the text of this element.

Returns:
The text of this element, never null.

getTextLook

public TextLook getTextLook()
Returns the look of the text.

Returns:
The look of the text, never null.

getAngle

public double getAngle()
Returns the angle of the text in radians. 0 refers to horizontal text.


getBaseX

public float getBaseX()
Returns the x-coordinate of the baseline point.

Returns:
The x-coordinate of the baseline point.

getBaseY

public float getBaseY()
Returns the y-coordinate of the baseline point.

Returns:
The y-coordinate of the baseline point.

getBounds

public java.awt.geom.Rectangle2D.Float getBounds(java.awt.geom.Rectangle2D.Float out)
Description copied from class: Element
Returns the bounds of this element in float precision.

Specified by:
getBounds in class Element
Parameters:
out - The return value, not null.
Returns:
The bounds of this element in float precision.

contains

public boolean contains(java.awt.Point p)
Description copied from class: Element
Returns true if this element contains the given point.

Specified by:
contains in class Element

ChartCat 1.2

Copyright 2003 - 2005 NetCat Inc.. All rights reserved. Feedback

Chart,Charting,Charts,Java,Java Chart,Java Charting,Java Charts,Chart Java,Charts Java,3D,3D Chart,3Dchart,Graph,Graphs,Chart Graph,Java Graph,Diagram,Diagrams,Java Diagram,Java Diagrams,Curve,Curves,Bar Chart,Pie Chart,Line Chart,Area Chart,Bar Graph,Pie Graph,Line Graph,Java Diagram,Chart Diagram,Package,Library,Chart Library,Chart Engine,Chart Package,Graph Package,Paint,Support,Graphic,Graphics,Print, Chart,Charting,Charts,Java,Java Chart,Java Charting,Java Charts,Chart Java,Charts Java,3D,3D Chart,3Dchart,Graph,Graphs,Chart Graph,Java Graph,Diagram,Diagrams,Java Diagram,Java Diagrams,Curve,Curves,Bar Chart,Pie Chart,Line Chart,Area Chart,Bar Graph,Pie Graph,Line Graph,Java Diagram,Chart Diagram,Package,Library,Chart Library,Chart Engine,Chart Package,Graph Package,Paint,Support,Graphic,Graphics,Print, Chart,Charting,Charts,Java,Java Chart,Java Charting,Java Charts,Chart Java,Charts Java,3D,3D Chart,3Dchart,Graph,Graphs,Chart Graph,Java Graph,Diagram,Diagrams,Java Diagram,Java Diagrams,Curve,Curves,Bar Chart,Pie Chart,Line Chart,Area Chart,Bar Graph,Pie Graph,Line Graph,Java Diagram,Chart Diagram,Package,Library,Chart Library,Chart Engine,Chart Package,Graph Package,Paint,Support,Graphic,Graphics,Print