DynamicPDF by ceTe Software

com.cete.dynamicpdf.pageelements
Class Label

java.lang.Object
  |
  +--com.cete.dynamicpdf.PageElement
        |
        +--com.cete.dynamicpdf.pageelements.RotatingPageElement
              |
              +--com.cete.dynamicpdf.pageelements.Label
All Implemented Interfaces:
IArea, ICoordinate

public class Label
extends RotatingPageElement
implements IArea, ICoordinate

This class can be used to place labels of text on a page.

View Example


Constructor Summary
Label(java.lang.String text, float x, float y, float width, float height)
          Creates a new instance of Label.
Label(java.lang.String text, float x, float y, float width, float height, Font font)
          Creates a new instance of Label.
Label(java.lang.String text, float x, float y, float width, float height, Font font, float fontSize)
          Creates a new instance of Label.
Label(java.lang.String text, float x, float y, float width, float height, Font font, float fontSize, Color textColor)
          Creates a new instance of Label.
Label(java.lang.String text, float x, float y, float width, float height, Font font, float fontSize, TextAlign align)
          Creates a new instance of Label.
Label(java.lang.String text, float x, float y, float width, float height, Font font, float fontSize, TextAlign align, Color textColor)
          Creates a new instance of Label.
 
Method Summary
protected  void drawRotated(PageWriter writer)
          Draws the label to the given PageWriter object.
 TextAlign getAlign()
          Gets the Align enumeration that specifies the text alignment of the label.
 Font getFont()
          Gets the Font object to use for the text of the label.
 float getFontSize()
          Gets the font size for the text of the label.
 float getHeight()
          Gets the height of the label.
 boolean getRightToLeft()
          Gets a value indicating if text should be displayed right to left.
 java.lang.String getText()
          Gets the text of the label.
 Color getTextColor()
          Gets the Color object to use for the text of the label.
 boolean getUnderline()
          Gets a value indicating if the label is underlined.
 VAlign getVAlign()
          Gets the VAlign enumeration that specifies the vertical text alignment of the label.
 float getWidth()
          Gets the width of the label.
 void setAlign(TextAlign value)
          Sets the Align enumeration that specifies the text alignment of the label.
 void setFont(Font value)
          Sets the Font object to use for the text of the label.
 void setFontSize(float value)
          Sets the font size for the text of the label.
 void setHeight(float value)
          Sets the height of the label.
 void setRightToLeft(boolean value)
          Sets a value indicating if text should be displayed right to left.
 void setText(java.lang.String value)
          Sets the text of the label.
 void setTextColor(Color value)
          Sets the Color object to use for the text of the label.
 void setUnderline(boolean value)
          Sets a value indicating if the label is underlined.
 void setVAlign(VAlign value)
          Sets the VAlign enumeration that specifies the vertical text alignment of the label.
 void setWidth(float value)
          Sets the width of the label.
 
Methods inherited from class com.cete.dynamicpdf.pageelements.RotatingPageElement
draw, getAngle, getX, getY, setAngle, setX, setY
 
Methods inherited from class com.cete.dynamicpdf.PageElement
getRequiredLicenseLevel, getStrID, setRequiredLicenseLevel, setStrID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.cete.dynamicpdf.pageelements.ICoordinate
getX, getY, setX, setY
 

Constructor Detail

Label

public Label(java.lang.String text,
             float x,
             float y,
             float width,
             float height)
Creates a new instance of Label.

Parameters:
text - Text to display in the label.
x - X coordinate of the label.
y - Y coordinate of the label.
width - Width of the label.
height - Height of the label.

Label

public Label(java.lang.String text,
             float x,
             float y,
             float width,
             float height,
             Font font)
Creates a new instance of Label.

Parameters:
text - Text to display in the label.
x - X coordinate of the label.
y - Y coordinate of the label.
width - Width of the label.
height - Height of the label.
font - Font for the text of the label.

Label

public Label(java.lang.String text,
             float x,
             float y,
             float width,
             float height,
             Font font,
             float fontSize)
Creates a new instance of Label.

Parameters:
text - Text to display in the label.
x - X coordinate of the label.
y - Y coordinate of the label.
width - Width of the label.
height - Height of the label.
font - Font for the text of the label.
fontSize - Font size of the text of the label.

Label

public Label(java.lang.String text,
             float x,
             float y,
             float width,
             float height,
             Font font,
             float fontSize,
             TextAlign align)
Creates a new instance of Label.

Parameters:
text - Text to display in the label.
x - X coordinate of the label.
y - Y coordinate of the label.
width - Width of the label.
height - Height of the label.
font - Font for the text of the label.
fontSize - Font size of the text of the label.
align - Alignment of the text of the label.

Label

public Label(java.lang.String text,
             float x,
             float y,
             float width,
             float height,
             Font font,
             float fontSize,
             Color textColor)
Creates a new instance of Label.

Parameters:
text - Text to display in the label.
x - X coordinate of the label.
y - Y coordinate of the label.
width - Width of the label.
height - Height of the label.
font - Font for the text of the label.
fontSize - Font size of the text of the label.
textColor - Color of the text of the label.

Label

public Label(java.lang.String text,
             float x,
             float y,
             float width,
             float height,
             Font font,
             float fontSize,
             TextAlign align,
             Color textColor)
Creates a new instance of Label.

Parameters:
text - Text to display in the label.
x - X coordinate of the label.
y - Y coordinate of the label.
width - Width of the label.
height - Height of the label.
font - Font for the text of the label.
fontSize - Font size of the text of the label.
align - Alignment of the text of the label.
textColor - Color of the text of the label.
Method Detail

getAlign

public TextAlign getAlign()
Gets the Align enumeration that specifies the text alignment of the label.

See Also:
Align

setAlign

public void setAlign(TextAlign value)
Sets the Align enumeration that specifies the text alignment of the label.

See Also:
Align

getVAlign

public VAlign getVAlign()
Gets the VAlign enumeration that specifies the vertical text alignment of the label.

See Also:
VAlign

setVAlign

public void setVAlign(VAlign value)
Sets the VAlign enumeration that specifies the vertical text alignment of the label.

See Also:
VAlign

getUnderline

public boolean getUnderline()
Gets a value indicating if the label is underlined.


setUnderline

public void setUnderline(boolean value)
Sets a value indicating if the label is underlined.


getRightToLeft

public boolean getRightToLeft()
Gets a value indicating if text should be displayed right to left.


setRightToLeft

public void setRightToLeft(boolean value)
Sets a value indicating if text should be displayed right to left.


getText

public java.lang.String getText()
Gets the text of the label.


setText

public void setText(java.lang.String value)
Sets the text of the label.


getTextColor

public Color getTextColor()
Gets the Color object to use for the text of the label.

See Also:
Color

setTextColor

public void setTextColor(Color value)
Sets the Color object to use for the text of the label.

See Also:
Color

getFont

public Font getFont()
Gets the Font object to use for the text of the label.

See Also:
Font

setFont

public void setFont(Font value)
Sets the Font object to use for the text of the label.

See Also:
Font

getFontSize

public float getFontSize()
Gets the font size for the text of the label.


setFontSize

public void setFontSize(float value)
Sets the font size for the text of the label.


getWidth

public float getWidth()
Gets the width of the label.

Specified by:
getWidth in interface IArea
Returns:
the float width of the area.

setWidth

public void setWidth(float value)
Sets the width of the label.

Specified by:
setWidth in interface IArea
Parameters:
value - the float width of the area.

getHeight

public float getHeight()
Gets the height of the label.

Specified by:
getHeight in interface IArea
Overrides:
getHeight in class RotatingPageElement
Returns:
the float height of the area.

setHeight

public void setHeight(float value)
Sets the height of the label.

Specified by:
setHeight in interface IArea
Overrides:
setHeight in class RotatingPageElement
Parameters:
value - the float height of the area.

drawRotated

protected void drawRotated(PageWriter writer)
Draws the label to the given PageWriter object.

Specified by:
drawRotated in class RotatingPageElement
Parameters:
writer - PageWriter object to receive the label's output.
See Also:
PageWriter

DynamicPDF by ceTe Software

API Reference for DynamicPDF™ for Java generated on December 20, 2005
© Copyright 2005, ceTe Software