com.levigo.jadice.annotation
Class RectangleAnnotation

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

public class RectangleAnnotation
extends ShapeBasedAnnotation

An annotation looking like an rectangle.

An rectangle annotation could be used to surround something interesting part of the displayed document page. For this purpose it can be resized and change its appearance color.


Field Summary
protected  RectangularShape 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
RectangleAnnotation()
           
 
Method Summary
 RectangleAnnotation clone()
           
protected  void copyAttributesTo(Annotation annotation)
          Copy annotation type related attributes to new annotation.
 Rectangle2D getBounds()
          Returns an integer Rectanglethat completely encloses the annotation.
 Rectangle2D getRectangle()
           
 RectangularShape getShape()
          Shape for render structure
 void setLocation(double x, double y)
          Set the location (upper-left corner) of the annotation to the given point.
 void setRectangle(Rectangle2D rectangle)
          Set new rectangle object.
 void setSize(double width, double height)
          Set the size of the annotation to the given size.
 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.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

shape

protected RectangularShape shape
Constructor Detail

RectangleAnnotation

public RectangleAnnotation()
Method Detail

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.

Specified by:
setSize in class Annotation

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 ShapeBasedAnnotation
Parameters:
x - X-position
y - Y-position

clone

public RectangleAnnotation clone()
Specified by:
clone in class Annotation
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 ShapeBasedAnnotation
Parameters:
annotation - Annotation to set attributes

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.

Specified by:
translate in class Annotation
Parameters:
dx - the distance to move this Rectangle along the x axis
dy - the distance to move this Rectangle along the y axis

getShape

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

Specified by:
getShape in class ShapeBasedAnnotation
Returns:
Shape

getBounds

public Rectangle2D getBounds()
Description copied from class: ShapeBasedAnnotation
Returns an integer Rectanglethat completely encloses the annotation.

Specified by:
getBounds in class ShapeBasedAnnotation
Returns:
Rectangle annotation bounding box

setRectangle

public void setRectangle(Rectangle2D rectangle)
Set new rectangle object. No AnnotationPageSegmentEvent will be triggered.

Parameters:
Rectangle - object

getRectangle

public Rectangle2D getRectangle()


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