Package com.levigo.jadice.annotation
Class RectangleAnnotation
java.lang.Object
com.levigo.jadice.annotation.Annotation
com.levigo.jadice.annotation.ShapeBasedAnnotation
com.levigo.jadice.annotation.RectangleAnnotation
- All Implemented Interfaces:
PermissionsProvider<Annotation>
,PropertiesProvider
,com.levigo.jadice.web.shared.model.annotation.internal.JwtAnnotation
,Serializable
,org.jadice.util.base.MementoOriginator
- Direct Known Subclasses:
ChecklistAnnotation
,EllipseAnnotation
,JWTImageAnnotation
,TextAnnotation
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.
- See Also:
-
Field Summary
FieldsFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()
protected void
copyAttributesTo
(Annotation annotation) Returns an integerRectangle
that completely encloses the annotation.getShape()
Shape for render structurevoid
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 thisAnnotation
the indicated distance, to the right along the x coordinate axis, and downward along the y coordinate axis.void
update()
Methods inherited from class com.levigo.jadice.annotation.ShapeBasedAnnotation
getFillColor, getLineWidth, getStrokeColor, getStrokeResolution, isAllowResize, isFilled, isIconified, isLinePainted, prepareSerialisation, setAllowResize, setFillColor, setFilled, setIconified, setLinePainted, setLineWidth, setStrokeColor, setStrokeResolution
Methods inherited from class com.levigo.jadice.annotation.Annotation
clearModified, clone, createMemento, fireAnnotationChange, getChangeHandler, getCreatedAt, getCreatedBy, getID, getInitializer, getLastModifiedAt, getLastModifiedBy, getModCount, getPermissions, getProfileId, getProperties, getType, getTypeName, initialize, isDoFireAnnotationEvents, isInitialized, isModified, restoreFrom, setChangeHandler, setCreatedBy, setCreationTimestamp, setDoFireAnnotationEvents, setID, setInitializer, setLastModifiedBy, setModified, setModifyTimestamp, setProfileId, setType, setTypeName
-
Field Details
-
shape
-
rect
-
-
Constructor Details
-
RectangleAnnotation
public RectangleAnnotation()
-
-
Method Details
-
update
public void update()- Specified by:
update
in classShapeBasedAnnotation
-
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. AnIllegalArgumentException
is 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 classAnnotation
- Parameters:
width
-height
-
-
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 classShapeBasedAnnotation
- Parameters:
x
- X-positiony
- Y-position
-
copy
-
copyAttributesTo
- Overrides:
copyAttributesTo
in classShapeBasedAnnotation
-
translate
public void translate(double dx, double dy) Description copied from class:Annotation
Translates thisAnnotation
the indicated distance, to the right along the x coordinate axis, and downward along the y coordinate axis.- Specified by:
translate
in classAnnotation
- Parameters:
dx
- the distance to move thisRectangle
along the x axisdy
- the distance to move thisRectangle
along the y axis
-
getShape
Description copied from class:ShapeBasedAnnotation
Shape for render structure- Specified by:
getShape
in classShapeBasedAnnotation
- Returns:
- Shape
-
getBounds
Description copied from class:ShapeBasedAnnotation
Returns an integerRectangle
that completely encloses the annotation.- Specified by:
getBounds
in classShapeBasedAnnotation
- Returns:
- Rectangle annotation bounding box
-
setRectangle
Set new rectangle object. NoAnnotationPageSegmentEvent
will be triggered.- Parameters:
rectangle
- object
-
getRectangle
-