com.levigo.jadice.annotation
Class StampAnnotation

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
                  extended by com.levigo.jadice.annotation.StampAnnotation
All Implemented Interfaces:
PermissionsProvider<Annotation>, PropertiesProvider, MementoOriginator, Cloneable

public class StampAnnotation
extends TextAnnotation

An annotation looking like a stamp.

An stamp annotation could be used to set an entrance day stamp on a interesting part of the displayed document page. For this purpose it can be rotated, changed its appearance color and text style.


Field Summary
 
Fields inherited from class com.levigo.jadice.annotation.TextAnnotation
bold, defaultText, editable, fontFace, fontSize, italic, scaleText, strikethrough, text, textColor, 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
StampAnnotation()
           
 
Method Summary
 StampAnnotation clone()
           
protected  void copyAttributesTo(Annotation annotation)
          Copy annotation type related attributes to new annotation.
 Rectangle2D getBounds()
          Returns the bounds of this annotation
 int getGap()
          Returns the insets width of stamp border and displayed text
 int getLineCount(String text)
           
 PathIterator getPathIterator()
           
 int getRotation()
          Gets the rotation angle.
 RectangularShape getShape()
          Shape for render structure
 boolean isAllowMultipleTextlines()
           
 boolean isAllowRotation()
          Returns current rotation handle flag.
 boolean isIgnoreLineWidth()
           
 boolean isUseCenterAsOrigin()
           
 void setAllowMultipleTextlines(boolean allowMultipleTextlines)
           
 void setAllowRotation(boolean allowRotation)
          Set flag to enable/disable the rotation handle.
 void setBold(boolean fontStyleBold)
           
 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 setGap(int gap)
          Returns the insets gap width of stamp border and displayed text
 void setIgnoreLineWidth(boolean ignoreLineWidth)
          Flag to ignore line width for annotation size update.
 void setItalic(boolean fontStyleItalic)
           
 void setLineWidth(float newValue)
          Sets the border line width of this annotation.
 void setLocation(double x, double y)
          Set the location (upper-left corner) of the annotation to the given point.
 void setRotation(int rotation)
          Sets the rotation.
 void setSize(double width, double height)
          Set the size of the annotation to the given size.
 void setText(String text)
          Sets the display text of this annotation.
 void setUseCenterAsOrigin(boolean useCenterAsOrigin)
           
 void translate(double dx, double dy)
          Translates this Annotation the indicated distance, to the right along the x coordinate axis, and downward along the y coordinate axis.
 
Methods inherited from class com.levigo.jadice.annotation.TextAnnotation
getDefaultText, getFont, getFontFace, getFontSize, getMaxCharacters, getText, getTextColor, isBold, isEditable, isItalic, isScaleText, isStrikethrough, isUnderscored, setDefaultText, setEditable, setMaxCharacters, setScaleText, setStrikethrough, setTextColor, setUnderscored
 
Methods inherited from class com.levigo.jadice.annotation.RectangleAnnotation
getRectangle, setRectangle
 
Methods inherited from class com.levigo.jadice.annotation.ShapeBasedAnnotation
createColorWithAlpha, getFillColor, getLineWidth, getStrokeColor, getStrokeResolution, isAllowResize, isFilled, isIconified, isLinePainted, setAllowResize, setFillColor, setFilled, setIconified, setLinePainted, 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
 

Constructor Detail

StampAnnotation

public StampAnnotation()
Method Detail

isUseCenterAsOrigin

public boolean isUseCenterAsOrigin()

setUseCenterAsOrigin

public void setUseCenterAsOrigin(boolean useCenterAsOrigin)

setText

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

Overrides:
setText in class TextAnnotation
See Also:
TextAnnotation.setText(java.lang.String)

getGap

public int getGap()
Returns the insets width of stamp border and displayed text

Returns:
int gap between border and text

getRotation

public int getRotation()
Gets the rotation angle.

Returns:
int

setGap

public void setGap(int gap)
Returns the insets gap width of stamp border and displayed text

Parameters:
gap - gap between border and text

setRotation

public void setRotation(int rotation)
Sets the rotation.

Parameters:
rotation - The rotation to set

getLineCount

public int getLineCount(String text)

setFontSize

public void setFontSize(float fontSize)
Description copied from class: TextAnnotation
Sets the font size of the displayed text.

Overrides:
setFontSize in class TextAnnotation
Parameters:
fontSize - The fontSize to set

getPathIterator

public PathIterator getPathIterator()

getBounds

public Rectangle2D getBounds()
Returns the bounds of this annotation

Overrides:
getBounds in class RectangleAnnotation
Returns:
rectangle the bounds of the annotations rectangle

setSize

public void setSize(double width,
                    double height)
Description copied from class: Annotation
Set the size of the annotation to the given size. Depending on the type of annotation, this may not be possible. E.g. stamp annotations handle the sizing on their own, so they will refuse to resize themselves. An IllegalArgumentExceptionis thrown in this case. Caveat: it is currently necessary, to force a repaint on the viewer in order to make the results of the modification visible. Moreover there are no modification events fired on the page and document. This will change in the future.

Overrides:
setSize in class RectangleAnnotation

translate

public void translate(double dx,
                      double dy)
Description copied from class: Annotation
Translates this Annotation the indicated distance, to the right along the x coordinate axis, and downward along the y coordinate axis.

Overrides:
translate in class RectangleAnnotation
Parameters:
dx - the distance to move this Rectangle along the x axis
dy - the distance to move this Rectangle along the y axis

setLocation

public void setLocation(double x,
                        double y)
Description copied from class: ShapeBasedAnnotation
Set the location (upper-left corner) of the annotation to the given point. Caveat: it is currently necessary, to force a repaint on the viewer in order to make the results of the modification visible. Moreover there are no modification events fired on the page and document. This will change in the future.

Overrides:
setLocation in class RectangleAnnotation
Parameters:
x - X-position
y - Y-position

clone

public StampAnnotation clone()
Overrides:
clone in class TextAnnotation
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 TextAnnotation
Parameters:
annotation - Annotation to set attributes

isAllowMultipleTextlines

public boolean isAllowMultipleTextlines()

setAllowMultipleTextlines

public void setAllowMultipleTextlines(boolean allowMultipleTextlines)

getShape

public RectangularShape getShape()
Description copied from class: ShapeBasedAnnotation
Shape for render structure

Overrides:
getShape in class RectangleAnnotation
Returns:
Shape

setFontFace

public void setFontFace(String fontFace)
Description copied from class: TextAnnotation
Sets the logical name of the font to display.

Overrides:
setFontFace in class TextAnnotation
Parameters:
fontFace - The fontFace to set

setItalic

public void setItalic(boolean fontStyleItalic)
Overrides:
setItalic in class TextAnnotation

setBold

public void setBold(boolean fontStyleBold)
Overrides:
setBold in class TextAnnotation

isAllowRotation

public boolean isAllowRotation()
Returns current rotation handle flag.

Returns:
Current flag

setAllowRotation

public void setAllowRotation(boolean allowRotation)
Set flag to enable/disable the rotation handle.

Parameters:
allowRotation -

setLineWidth

public void setLineWidth(float newValue)
Description copied from class: ShapeBasedAnnotation
Sets the border line width of this annotation.

Notice, if this annotation has disabled the line painted attribute

Overrides:
setLineWidth in class ShapeBasedAnnotation
Parameters:
newValue - the new line width
See Also:
and, the border line will not be rendered.

isIgnoreLineWidth

public boolean isIgnoreLineWidth()

setIgnoreLineWidth

public void setIgnoreLineWidth(boolean ignoreLineWidth)
Flag to ignore line width for annotation size update.

Parameters:
ignoreLineWidth -


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