org.omegahat.Graphics.Primitives
Class TextPrimitive

java.lang.Object
  |
  +--org.omegahat.Graphics.Primitives.GraphicalObject
        |
        +--org.omegahat.Graphics.Primitives.RGO
              |
              +--org.omegahat.Graphics.Primitives.TextPrimitive
All Implemented Interfaces:
GraphicalComponentInt
Direct Known Subclasses:
StringIcon

public class TextPrimitive
extends RGO

String as a rectangular graphical object.

The width and height fields of the rectangular graphical object are not used, but additional properties of font size and angle can be provided.


Field Summary
protected  double angle
          The angle of rotation (default 0.);
protected  java.lang.String text
          The text to be displayed.
 
Fields inherited from class org.omegahat.Graphics.Primitives.RGO
region
 
Fields inherited from class org.omegahat.Graphics.Primitives.GraphicalObject
ACTIVE, fontSize, lastDevice, lastHeightCM, lastRegion, lastWidthCM, parents, status, VISIBLE
 
Constructor Summary
TextPrimitive()
           
TextPrimitive(java.lang.String s, double x, double y, int Unit)
           
TextPrimitive(java.lang.String s, double x, double y, int Unit, int fontSize, double angle)
           
TextPrimitive(java.lang.String s, UDouble x, UDouble y)
           
TextPrimitive(java.lang.String s, UDouble x, UDouble y, int fontSize, double angle)
           
 
Method Summary
 Region draw(RectRegion rr, ScaleInt sx, ScaleInt sy, int origin, double widthCM, double heightCM, int fontSize, OutputDevice od, GraphicalContainerInt parentId)
          draw the object in the rectangular region rr, using scales sx and sy.
 double getAngle()
          Accessor for angle field
 java.lang.String getText()
          Accessor for text field
 double setAngle(double value)
          Accessor for setting angle field
 java.lang.String setText(java.lang.String value)
          Accessor for setting text field
 java.lang.String toString()
           
 
Methods inherited from class org.omegahat.Graphics.Primitives.RGO
center, centre, createRegionDescription, createRegionDescription, getRegion, height, height, setHJust, setRegion, setVJust, width, width, x, x, y, y
 
Methods inherited from class org.omegahat.Graphics.Primitives.GraphicalObject
cacheSize, getFontSize, getFontSize, getParameters, getParents, getStatus, isActive, isVisible, lastHeightCM, lastRegion, lastWidthCM, parent, parent, parents, setActive, setParameters, setParents, setVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

angle

protected double angle
The angle of rotation (default 0.);

text

protected java.lang.String text
The text to be displayed.
Constructor Detail

TextPrimitive

public TextPrimitive()

TextPrimitive

public TextPrimitive(java.lang.String s,
                     double x,
                     double y,
                     int Unit)

TextPrimitive

public TextPrimitive(java.lang.String s,
                     double x,
                     double y,
                     int Unit,
                     int fontSize,
                     double angle)

TextPrimitive

public TextPrimitive(java.lang.String s,
                     UDouble x,
                     UDouble y)

TextPrimitive

public TextPrimitive(java.lang.String s,
                     UDouble x,
                     UDouble y,
                     int fontSize,
                     double angle)
Method Detail

getAngle

public double getAngle()
Accessor for angle field

setAngle

public double setAngle(double value)
Accessor for setting angle field

getText

public java.lang.String getText()
Accessor for text field

setText

public java.lang.String setText(java.lang.String value)
Accessor for setting text field

draw

public Region draw(RectRegion rr,
                   ScaleInt sx,
                   ScaleInt sy,
                   int origin,
                   double widthCM,
                   double heightCM,
                   int fontSize,
                   OutputDevice od,
                   GraphicalContainerInt parentId)
Description copied from class: GraphicalObject
draw the object in the rectangular region rr, using scales sx and sy.
Overrides:
draw in class GraphicalObject
Following copied from interface: org.omegahat.Graphics.Primitives.GraphicalComponentInt
Parameters:
rr - the parents RectRegion in normalized device coordinates (NDC).
sx - the parent's horizontal scale for transforming between arbitrary units.
sy - the parent's vertical scale for transforming between arbitrary units.
origin - the parent's origin position.

toString

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