com.levigo.jadice.annotation
Class TextAnnotation

java.lang.Object
  extended by com.levigo.jadice.annotation.Annotation
      extended by com.levigo.jadice.annotation.ShapeBasedAnnotation
          extended by com.levigo.jadice.annotation.RectangleAnnotation
              extended by com.levigo.jadice.annotation.TextAnnotation
All Implemented Interfaces:
PermissionsProvider<Annotation>, PropertiesProvider, MementoOriginator, Cloneable
Direct Known Subclasses:
HistoryAnnotation, StampAnnotation

public class TextAnnotation
extends RectangleAnnotation

An annotation looking like a piece of text.

An text annotation could be used to add additional information to the displayed document page. For this purpose it can be rotated, changed its appearance color and text style.


Field Summary
protected  boolean bold
           
protected  String defaultText
           
protected  boolean editable
           
protected  String fontFace
           
protected  float fontSize
           
protected  boolean italic
           
protected  boolean scaleText
           
protected  boolean strikethrough
           
protected  String text
           
protected  Color textColor
           
protected  boolean underscored
           
 
Fields inherited from class com.levigo.jadice.annotation.RectangleAnnotation
shape
 
Fields inherited from class com.levigo.jadice.annotation.ShapeBasedAnnotation
allowResize, fillColor, filled, iconified, linePainted, lineWidth, strokeColor, strokeResolution
 
Fields inherited from class com.levigo.jadice.annotation.Annotation
createdAt, createdBy, doFireAnnotationEvents, id, initializer, isModified, lastModifiedAt, lastModifiedBy
 
Constructor Summary
TextAnnotation()
           
 
Method Summary
 TextAnnotation clone()
           
protected  void copyAttributesTo(Annotation annotation)
          Copy annotation type related attributes to new annotation.
 String getDefaultText()
          Returns the current default text.
 Font getFont()
          Deprecated. Will be removed in DOCP Version 5.5, to create your own Font object, use getFontFace(), getFontSize(), isBold(), isItalic() methods to get the required attributes.
 String getFontFace()
          Returns the logical name of the diplay font
 float getFontSize()
          Returns the font size of the displayed text.
 int getMaxCharacters()
           
 String getText()
          Returns the actual displayed text of this annotation.
 Color getTextColor()
           
 boolean isBold()
           
 boolean isEditable()
           
 boolean isItalic()
           
 boolean isScaleText()
           
 boolean isStrikethrough()
           
 boolean isUnderscored()
           
 void setBold(boolean fontStyleBold)
           
 void setDefaultText(String defaultText)
          Sets a default text.
 void setEditable(boolean editable)
          Sets the ability to edit the annotation.
 void setFontFace(String fontFace)
          Sets the logical name of the font to display.
 void setFontSize(float fontSize)
          Sets the font size of the displayed text.
 void setItalic(boolean fontStyleItalic)
           
 void setMaxCharacters(int maxCharacters)
           
 void setScaleText(boolean scaleText)
           
 void setStrikethrough(boolean strikethrough)
           
 void setText(String text)
          Sets the display text of this annotation.
 void setTextColor(Color textColor)
           
 void setUnderscored(boolean underscored)
           
 
Methods inherited from class com.levigo.jadice.annotation.RectangleAnnotation
getBounds, getRectangle, getShape, setLocation, setRectangle, setSize, translate
 
Methods inherited from class com.levigo.jadice.annotation.ShapeBasedAnnotation
createColorWithAlpha, getFillColor, getLineWidth, getStrokeColor, getStrokeResolution, isAllowResize, isFilled, isIconified, isLinePainted, setAllowResize, setFillColor, setFilled, setIconified, setLinePainted, setLineWidth, setStrokeColor, setStrokeResolution
 
Methods inherited from class com.levigo.jadice.annotation.Annotation
clearModified, createMemento, fireAnnotationChange, getChangeHandler, getCreatedAt, getCreatedBy, getID, getInitializer, getLastModifiedAt, getLastModifiedBy, getModCount, getPermissions, getProperties, getType, initialize, isDoFireAnnotationEvents, isInitialized, isModified, restoreFrom, setChangeHandler, setCreatedBy, setCreationTimestamp, setDoFireAnnotationEvents, setID, setInitializer, setLastModifiedBy, setModified, setModifyTimestamp, setType
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

text

protected String text

fontFace

protected String fontFace

fontSize

protected float fontSize

italic

protected boolean italic

bold

protected boolean bold

underscored

protected boolean underscored

strikethrough

protected boolean strikethrough

textColor

protected Color textColor

defaultText

protected String defaultText

scaleText

protected boolean scaleText

editable

protected boolean editable
Constructor Detail

TextAnnotation

public TextAnnotation()
Method Detail

getText

public String getText()
Returns the actual displayed text of this annotation.

Returns:
annotations text

setText

public void setText(String text)
Sets the display text of this annotation. If the given text is null or empty a default text will be set.

Parameters:
text -

getFontSize

public float getFontSize()
Returns the font size of the displayed text.

Returns:
int font size

setFontSize

public void setFontSize(float fontSize)
Sets the font size of the displayed text.

Parameters:
fontSize - The fontSize to set

getFontFace

public String getFontFace()
Returns the logical name of the diplay font

Returns:
String

setFontFace

public void setFontFace(String fontFace)
Sets the logical name of the font to display.

Parameters:
fontFace - The fontFace to set

clone

public TextAnnotation clone()
Overrides:
clone in class RectangleAnnotation
See Also:
Object.clone()

copyAttributesTo

protected void copyAttributesTo(Annotation annotation)
Description copied from class: Annotation
Copy annotation type related attributes to new annotation.

Overrides:
copyAttributesTo in class RectangleAnnotation
Parameters:
annotation - Annotation to set attributes

getFont

public Font getFont()
Deprecated. Will be removed in DOCP Version 5.5, to create your own Font object, use getFontFace(), getFontSize(), isBold(), isItalic() methods to get the required attributes.

Returns:
Font instance

getTextColor

public Color getTextColor()

setTextColor

public void setTextColor(Color textColor)

isItalic

public boolean isItalic()

setItalic

public void setItalic(boolean fontStyleItalic)

isBold

public boolean isBold()

setBold

public void setBold(boolean fontStyleBold)

isUnderscored

public boolean isUnderscored()

setUnderscored

public void setUnderscored(boolean underscored)

isStrikethrough

public boolean isStrikethrough()

setStrikethrough

public void setStrikethrough(boolean strikethrough)

setMaxCharacters

public void setMaxCharacters(int maxCharacters)
Parameters:
maxCharacters - the maxCharacters to set

getMaxCharacters

public int getMaxCharacters()
Returns:
the maxCharacters

isScaleText

public boolean isScaleText()

setScaleText

public void setScaleText(boolean scaleText)

isEditable

public boolean isEditable()

setEditable

public void setEditable(boolean editable)
Sets the ability to edit the annotation.

Parameters:
editable -

setDefaultText

public void setDefaultText(String defaultText)
Sets a default text. This text will be used if an empty string or a null value will be set via setText(String).

Parameters:
defaultText - Default text

getDefaultText

public String getDefaultText()
Returns the current default text.

Returns:
Current default text.


Copyright © 1995-2020 levigo holding gmbh. All Rights Reserved.