Package com.levigo.jadice.annotation
Class Annotation
java.lang.Object
com.levigo.jadice.annotation.Annotation
- All Implemented Interfaces:
PermissionsProvider<Annotation>
,PropertiesProvider
,com.levigo.jadice.web.shared.model.annotation.internal.JwtAnnotation
,Serializable
,org.jadice.util.base.MementoOriginator
- Direct Known Subclasses:
ShapeBasedAnnotation
public abstract class Annotation
extends Object
implements Serializable, PermissionsProvider<Annotation>, com.levigo.jadice.web.shared.model.annotation.internal.JwtAnnotation, PropertiesProvider, org.jadice.util.base.MementoOriginator
An abstract base class for all annotations.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Clears the modified-flag.clone()
protected void
copyAttributesTo
(Annotation annotation) org.jadice.util.base.Memento
protected void
fireAnnotationChange
(Annotation previousState, AnnotationPageSegmentEvent.EventType eventType, Object oldValue, Object newValue) Handle an annotation changeabstract Rectangle2D
Returns aRectangle2D
that completely encloses the annotation.com.levigo.jadice.web.shared.model.annotation.internal.AnnotationChangeHandler
Returns the annotation change handlergetID()
Returns annotations id.int
Return a map of user properties.getType()
Get the type profile.void
initialize
(Page page) boolean
Return whether this annotation instance propagates annotation eventsboolean
boolean
Returns modify status of the annotation.void
restoreFrom
(AnnotationMemento memento) This method is called back fromAnnotationMemento
uponMemento.restore()
void
setChangeHandler
(com.levigo.jadice.web.shared.model.annotation.internal.AnnotationChangeHandler changeHandler) Changes the annotation change handler.void
setCreatedBy
(String originatorName) void
setCreationTimestamp
(Date creationTimestamp) void
setDoFireAnnotationEvents
(boolean doFireAnnotationEvents) Changes the annotation event propagation mode.void
Set annotation id.void
setInitializer
(AnnotationInitializer initializer) void
setLastModifiedBy
(String userName) abstract void
setLocation
(double x, double y) Set the location (upper-left corner) of the annotation to the given point.void
Sets modified-flag.void
setModifyTimestamp
(Date modifyTimestamp) void
setProfileId
(String profileId) abstract void
setSize
(double width, double height) Set the size of the annotation to the given size.void
setType
(AnnotationType annotationType) void
setTypeName
(String typeName) abstract 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.Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.levigo.jadice.web.shared.model.annotation.internal.JwtAnnotation
copy
-
Field Details
-
createdBy
-
lastModifiedBy
-
createdAt
-
lastModifiedAt
-
initializer
-
isModified
protected boolean isModified -
id
anno id -
doFireAnnotationEvents
protected boolean doFireAnnotationEventsFlag whether annotation events should be fired. As default this flag is set tofalse
until this annotation instance is initialized and the creation process is finished.
-
-
Constructor Details
-
Annotation
public Annotation()
-
-
Method Details
-
translate
public abstract 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.- Parameters:
dx
- the distance to move thisRectangle
along the x axisdy
- the distance to move thisRectangle
along the y axis
-
setSize
public abstract void setSize(double width, double height) 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.- Parameters:
width
-height
-
-
setLocation
public abstract void setLocation(double x, double y) 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.- Parameters:
x
- X-positiony
- Y-position
-
getBounds
Returns aRectangle2D
that completely encloses the annotation.- Returns:
- Rectangle2D annotation bounding box
-
setID
Set annotation id.- Parameters:
id
- Id to set.
-
getID
Returns annotations id.- Returns:
- Annotation id
-
setProfileId
- Specified by:
setProfileId
in interfacecom.levigo.jadice.web.shared.model.annotation.internal.JwtAnnotation
-
getProfileId
- Specified by:
getProfileId
in interfacecom.levigo.jadice.web.shared.model.annotation.internal.JwtAnnotation
-
getTypeName
- Specified by:
getTypeName
in interfacecom.levigo.jadice.web.shared.model.annotation.internal.JwtAnnotation
-
setTypeName
- Specified by:
setTypeName
in interfacecom.levigo.jadice.web.shared.model.annotation.internal.JwtAnnotation
-
setModified
public void setModified()Sets modified-flag. -
clearModified
public void clearModified()Clears the modified-flag. -
isModified
public boolean isModified()Returns modify status of the annotation.- Returns:
- Modify status.
-
copyAttributesTo
-
isDoFireAnnotationEvents
public boolean isDoFireAnnotationEvents()Return whether this annotation instance propagates annotation events- Returns:
true
if this annotation propagates its internal changes as annotation event, otherwisefalse
will be returned
-
setDoFireAnnotationEvents
public void setDoFireAnnotationEvents(boolean doFireAnnotationEvents) Changes the annotation event propagation mode.- Parameters:
doFireAnnotationEvents
-true
if this annotation should propagate its internal changes as annotation event, otherwisefalse
should be set.
-
getProperties
Description copied from interface:PropertiesProvider
Return a map of user properties. What to store and which keys to use is largely up to the user of classes implementing this interface, since those classes will generally be oblivious to the map's contents. There are no guarantees regarding the thread-safety of the returned map, unless otherwise specified by implementors.- Specified by:
getProperties
in interfacePropertiesProvider
- Returns:
- the map of user properties
-
setInitializer
-
getInitializer
-
isInitialized
public boolean isInitialized() -
initialize
-
getCreatedBy
-
setCreatedBy
-
getLastModifiedBy
-
setLastModifiedBy
-
getCreatedAt
-
setCreationTimestamp
-
getLastModifiedAt
-
setModifyTimestamp
-
getModCount
public int getModCount() -
setType
-
getType
Get the type profile.- Returns:
- the typeProfile
-
getChangeHandler
public com.levigo.jadice.web.shared.model.annotation.internal.AnnotationChangeHandler getChangeHandler()Returns the annotation change handler- Specified by:
getChangeHandler
in interfacecom.levigo.jadice.web.shared.model.annotation.internal.JwtAnnotation
- Returns:
AnnotationChangeHandler
-
getPermissions
- Specified by:
getPermissions
in interfacePermissionsProvider<Annotation>
-
clone
-
createMemento
public org.jadice.util.base.Memento createMemento()- Specified by:
createMemento
in interfaceorg.jadice.util.base.MementoOriginator
-
restoreFrom
This method is called back fromAnnotationMemento
uponMemento.restore()
-