com.arctorus.documents
Class TextFormat

java.lang.Object
  extended by com.arctorus.documents.TextFormat

public final class TextFormat
extends java.lang.Object

Contains text format properties.

New created TextFormat has properties:

  • size - 14pt
  • color - black
  • baseline - none
  • bold - false
  • italic - false
  • underline - false


    Constructor Summary
    TextFormat(java.lang.String fontName)
              Create new text format with specified font and default size.
    TextFormat(java.lang.String fontName, short size)
              Create new text format with specified font and size.
     
    Method Summary
     boolean equals(java.lang.Object obj)
              Indicates whether some other object is "equal to" this one.
     BaselineType getBaseline()
              Get baseline of a text.
     java.awt.Color getColor()
              Get color of a text.
     java.lang.String getFontName()
              Get font name of a text.
     short getSize()
              Get font size of a text.
     int hashCode()
              Returns a hash code value for the object.
     boolean isBold()
              Get whether the font is bold.
     boolean isItalic()
              Get whether the font is italic.
     boolean isUnderline()
              Get whether the font is underlined.
     void setBaseline(BaselineType baseline)
              Set baseline of a text.
     void setBold(boolean bold)
              Set whether the font is bold.
     void setColor(java.awt.Color color)
              Set color of a text.
     void setFontName(java.lang.String fontName)
              Set font name of a text.
     void setItalic(boolean italic)
              Set whether the font is italic.
     void setSize(short size)
              Set font size of a text.
     void setUnderline(boolean underline)
              Set whether the font is underlined.
     
    Methods inherited from class java.lang.Object
    getClass, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    TextFormat

    public TextFormat(java.lang.String fontName,
                      short size)
    Create new text format with specified font and size.

    Parameters:
    fontName - font name.
    size - text size.

    TextFormat

    public TextFormat(java.lang.String fontName)
    Create new text format with specified font and default size.

    Parameters:
    fontName - font name.
    Method Detail

    getColor

    public java.awt.Color getColor()
    Get color of a text.


    setColor

    public void setColor(java.awt.Color color)
    Set color of a text.

    Parameters:
    color - new color.

    getBaseline

    public BaselineType getBaseline()
    Get baseline of a text.


    setBaseline

    public void setBaseline(BaselineType baseline)
    Set baseline of a text.

    Parameters:
    baseline - new baseline.

    getFontName

    public java.lang.String getFontName()
    Get font name of a text.


    setFontName

    public void setFontName(java.lang.String fontName)
    Set font name of a text.

    Parameters:
    fontName - new font name.

    getSize

    public short getSize()
    Get font size of a text.


    setSize

    public void setSize(short size)
    Set font size of a text.

    Parameters:
    size - new font size.

    isBold

    public boolean isBold()
    Get whether the font is bold.


    setBold

    public void setBold(boolean bold)
    Set whether the font is bold.

    Parameters:
    bold - true to make bold font.

    isItalic

    public boolean isItalic()
    Get whether the font is italic.


    setItalic

    public void setItalic(boolean italic)
    Set whether the font is italic.

    Parameters:
    italic - true to make italic font.

    isUnderline

    public boolean isUnderline()
    Get whether the font is underlined.


    setUnderline

    public void setUnderline(boolean underline)
    Set whether the font is underlined.

    Parameters:
    underline - true to make underlined font.

    hashCode

    public int hashCode()
    Returns a hash code value for the object.

    Overrides:
    hashCode in class java.lang.Object

    equals

    public boolean equals(java.lang.Object obj)
    Indicates whether some other object is "equal to" this one.

    Overrides:
    equals in class java.lang.Object