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, strokeResolutionFields 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 voidcopyAttributesTo(Annotation annotation) Returns an integerRectanglethat completely encloses the annotation.getShape()Shape for render structurevoidsetLocation(double x, double y) Set the location (upper-left corner) of the annotation to the given point.voidsetRectangle(Rectangle2D rectangle) Set new rectangle object.voidsetSize(double width, double height) Set the size of the annotation to the given size.voidtranslate(double dx, double dy) Translates thisAnnotationthe indicated distance, to the right along the x coordinate axis, and downward along the y coordinate axis.voidupdate()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, setStrokeResolutionMethods 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:
updatein classShapeBasedAnnotation
-
setSize
public void setSize(double width, double height) Description copied from class:AnnotationSet 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. AnIllegalArgumentExceptionis 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:
setSizein classAnnotation- Parameters:
width-height-
-
setLocation
public void setLocation(double x, double y) Description copied from class:ShapeBasedAnnotationSet 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:
setLocationin classShapeBasedAnnotation- Parameters:
x- X-positiony- Y-position
-
copy
-
copyAttributesTo
- Overrides:
copyAttributesToin classShapeBasedAnnotation
-
translate
public void translate(double dx, double dy) Description copied from class:AnnotationTranslates thisAnnotationthe indicated distance, to the right along the x coordinate axis, and downward along the y coordinate axis.- Specified by:
translatein classAnnotation- Parameters:
dx- the distance to move thisRectanglealong the x axisdy- the distance to move thisRectanglealong the y axis
-
getShape
Description copied from class:ShapeBasedAnnotationShape for render structure- Specified by:
getShapein classShapeBasedAnnotation- Returns:
- Shape
-
getBounds
Description copied from class:ShapeBasedAnnotationReturns an integerRectanglethat completely encloses the annotation.- Specified by:
getBoundsin classShapeBasedAnnotation- Returns:
- Rectangle annotation bounding box
-
setRectangle
Set new rectangle object. NoAnnotationPageSegmentEventwill be triggered.- Parameters:
rectangle- object
-
getRectangle
-