Package com.levigo.jadice.annotation
Class PathAnnotation
java.lang.Object
com.levigo.jadice.annotation.Annotation
com.levigo.jadice.annotation.ShapeBasedAnnotation
com.levigo.jadice.annotation.PathAnnotation
- All Implemented Interfaces:
PermissionsProvider<Annotation>
,PropertiesProvider
,com.levigo.jadice.web.shared.model.annotation.internal.JwtAnnotation
,Serializable
,org.jadice.util.base.MementoOriginator
An annotation mostly drawn using the mouse pointer.
- 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 TypeMethodDescriptionvoid
Add given point to the current path.void
close()
copy()
protected void
copyAttributesTo
(Annotation annotation) Returns an integerRectangle
that completely encloses the annotation.getPath()
getShape()
Shape for render structureboolean
Returns a flag if annotation border is rendered.void
void
setLocation
(double x, double y) Set the location (upper-left corner) of the annotation to the given point.void
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
unclose()
void
update()
Methods inherited from class com.levigo.jadice.annotation.ShapeBasedAnnotation
getFillColor, getLineWidth, getStrokeColor, getStrokeResolution, isAllowResize, isFilled, isIconified, 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
-
path
-
-
Constructor Details
-
PathAnnotation
public PathAnnotation()
-
-
Method Details
-
prepareSerialisation
public void prepareSerialisation()- Overrides:
prepareSerialisation
in classShapeBasedAnnotation
-
isLinePainted
public boolean isLinePainted()Description copied from class:ShapeBasedAnnotation
Returns a flag if annotation border is rendered.- Overrides:
isLinePainted
in classShapeBasedAnnotation
- Returns:
- boolean
-
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
-
-
copy
-
copyAttributesTo
- Overrides:
copyAttributesTo
in classShapeBasedAnnotation
-
getPathIterator
-
addPoint
Add given point to the current path.- Parameters:
p
- Point to add
-
getBounds
Description copied from class:ShapeBasedAnnotation
Returns an integerRectangle
that completely encloses the annotation.- Specified by:
getBounds
in classShapeBasedAnnotation
- Returns:
- Rectangle annotation bounding box
-
getShape
Description copied from class:ShapeBasedAnnotation
Shape for render structure- Specified by:
getShape
in classShapeBasedAnnotation
- Returns:
- Shape
-
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
-
setPath
-
getPath
-
close
public void close() -
unclose
public void unclose() -
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
-