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 TypeMethodDescriptionvoidClears the modified-flag.clone()protected voidcopyAttributesTo(Annotation annotation) org.jadice.util.base.Mementoprotected voidfireAnnotationChange(Annotation previousState, AnnotationPageSegmentEvent.EventType eventType, Object oldValue, Object newValue) Handle an annotation changeabstract Rectangle2DReturns aRectangle2Dthat completely encloses the annotation.com.levigo.jadice.web.shared.model.annotation.internal.AnnotationChangeHandlerReturns the annotation change handlergetID()Returns annotations id.intReturn a map of user properties.getType()Get the type profile.voidinitialize(Page page) booleanReturn whether this annotation instance propagates annotation eventsbooleanbooleanReturns modify status of the annotation.voidrestoreFrom(AnnotationMemento memento) This method is called back fromAnnotationMementouponMemento.restore()voidsetChangeHandler(com.levigo.jadice.web.shared.model.annotation.internal.AnnotationChangeHandler changeHandler) Changes the annotation change handler.voidsetCreatedBy(String originatorName) voidsetCreationTimestamp(Date creationTimestamp) voidsetDoFireAnnotationEvents(boolean doFireAnnotationEvents) Changes the annotation event propagation mode.voidSet annotation id.voidsetInitializer(AnnotationInitializer initializer) voidsetLastModifiedBy(String userName) abstract voidsetLocation(double x, double y) Set the location (upper-left corner) of the annotation to the given point.voidSets modified-flag.voidsetModifyTimestamp(Date modifyTimestamp) voidsetProfileId(String profileId) abstract voidsetSize(double width, double height) Set the size of the annotation to the given size.voidsetType(AnnotationType annotationType) voidsetTypeName(String typeName) abstract voidtranslate(double dx, double dy) Translates thisAnnotationthe 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, waitMethods 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 tofalseuntil 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 thisAnnotationthe indicated distance, to the right along the x coordinate axis, and downward along the y coordinate axis.- Parameters:
dx- the distance to move thisRectanglealong the x axisdy- the distance to move thisRectanglealong 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. 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.- 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 aRectangle2Dthat 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:
setProfileIdin interfacecom.levigo.jadice.web.shared.model.annotation.internal.JwtAnnotation
-
getProfileId
- Specified by:
getProfileIdin interfacecom.levigo.jadice.web.shared.model.annotation.internal.JwtAnnotation
-
getTypeName
- Specified by:
getTypeNamein interfacecom.levigo.jadice.web.shared.model.annotation.internal.JwtAnnotation
-
setTypeName
- Specified by:
setTypeNamein 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:
trueif this annotation propagates its internal changes as annotation event, otherwisefalsewill be returned
-
setDoFireAnnotationEvents
public void setDoFireAnnotationEvents(boolean doFireAnnotationEvents) Changes the annotation event propagation mode.- Parameters:
doFireAnnotationEvents-trueif this annotation should propagate its internal changes as annotation event, otherwisefalseshould be set.
-
getProperties
Description copied from interface:PropertiesProviderReturn 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:
getPropertiesin 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:
getChangeHandlerin interfacecom.levigo.jadice.web.shared.model.annotation.internal.JwtAnnotation- Returns:
AnnotationChangeHandler
-
getPermissions
- Specified by:
getPermissionsin interfacePermissionsProvider<Annotation>
-
clone
-
createMemento
public org.jadice.util.base.Memento createMemento()- Specified by:
createMementoin interfaceorg.jadice.util.base.MementoOriginator
-
restoreFrom
This method is called back fromAnnotationMementouponMemento.restore()
-