public abstract class Annotation extends Object implements PropertiesProvider, Cloneable, PermissionsProvider<Annotation>, MementoOriginator
Modifier and Type | Field and Description |
---|---|
protected Date |
createdAt |
protected String |
createdBy |
protected boolean |
doFireAnnotationEvents
Flag whether annotation events should be fired.
|
protected String |
id
anno id
|
protected AnnotationInitializer |
initializer |
protected boolean |
isModified |
protected Date |
lastModifiedAt |
protected String |
lastModifiedBy |
Modifier | Constructor and Description |
---|---|
protected |
Annotation() |
Modifier and Type | Method and Description |
---|---|
void |
clearModified()
Clears the modified-flag.
|
abstract Annotation |
clone() |
protected void |
copyAttributesTo(Annotation annotation)
Copy annotation type related attributes to new annotation.
|
Memento |
createMemento() |
protected void |
fireAnnotationChange(Annotation previousState,
AnnotationPageSegmentEvent.EventType eventType,
Object oldValue,
Object newValue)
Handle an annotation change
|
abstract Rectangle2D |
getBounds()
Returns a
Rectangle2D that completely encloses the annotation. |
com.levigo.jadice.annotation.internal.AnnotationChangeHandler |
getChangeHandler()
Returns the annotation change handler
|
Date |
getCreatedAt() |
String |
getCreatedBy() |
String |
getID()
Returns annotations id.
|
AnnotationInitializer |
getInitializer() |
Date |
getLastModifiedAt() |
String |
getLastModifiedBy() |
int |
getModCount() |
Permissions<Annotation> |
getPermissions()
Provides an instance of
Permissions . |
Map<String,Object> |
getProperties()
Return a map of user properties.
|
AnnotationType |
getType()
Get the type profile.
|
void |
initialize(Page page) |
boolean |
isDoFireAnnotationEvents()
Return whether this annotation instance propagates annotation events
|
boolean |
isInitialized() |
boolean |
isLoadedAnnotation()
Checks for presence of
AnnotationPropertyConstants.ANNOTATION_INITIAL property created
in annotation FormatReader implementations. |
boolean |
isModified()
Returns modify status of the annotation.
|
void |
restoreFrom(AnnotationMemento memento)
This method is called back from
AnnotationMemento upon Memento.restore() |
void |
setChangeHandler(com.levigo.jadice.annotation.internal.AnnotationChangeHandler changeHandler)
Changes the annotation change handler.
|
void |
setCreatedBy(String originatorName) |
void |
setCreationTimestamp(Date creationTimestamp)
Sets creation time stamp.
|
void |
setDoFireAnnotationEvents(boolean doFireAnnotationEvents)
Changes the annotation event propagation mode.
|
void |
setID(String id)
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 |
setModified()
Sets modified flag.
|
void |
setModifyTimestamp(Date modifyTimestamp)
Sets modify time stamp.
|
abstract void |
setSize(double width,
double height)
Set the size of the annotation to the given size.
|
void |
setType(AnnotationType typeProfile)
Set the type profile.
|
abstract void |
translate(double dx,
double dy)
Translates this
Annotation the indicated distance, to the right along the x
coordinate axis, and downward along the y coordinate axis. |
protected String createdBy
protected String lastModifiedBy
protected Date createdAt
protected Date lastModifiedAt
protected AnnotationInitializer initializer
protected boolean isModified
protected String id
protected boolean doFireAnnotationEvents
false
until this annotation instance is initialized and the creation process is
finished.public abstract void translate(double dx, double dy)
Annotation
the indicated distance, to the right along the x
coordinate axis, and downward along the y coordinate axis.dx
- the distance to move this Rectangle
along the x axisdy
- the distance to move this Rectangle
along the y axispublic abstract void setSize(double width, double height)
IllegalArgumentException
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.public abstract void setLocation(double x, double y)
x
- X-positiony
- Y-positionpublic abstract Rectangle2D getBounds()
Rectangle2D
that completely encloses the annotation.protected void fireAnnotationChange(Annotation previousState, AnnotationPageSegmentEvent.EventType eventType, Object oldValue, Object newValue)
public void setID(String id)
id
- Id to set.public String getID()
public void setModified()
null
. Modify
date will be updated.public void clearModified()
public boolean isModified()
public abstract Annotation clone()
clone
in class Object
Object.clone()
protected void copyAttributesTo(Annotation annotation)
annotation
- Annotation to set attributespublic boolean isDoFireAnnotationEvents()
true
if this annotation propagates its internal changes as annotation
event, otherwise false
will be returnedpublic void setDoFireAnnotationEvents(boolean doFireAnnotationEvents)
doFireAnnotationEvents
- true
if this annotation should propagate its
internal changes as annotation event, otherwise false
should be set.public Map<String,Object> getProperties()
PropertiesProvider
getProperties
in interface PropertiesProvider
public void setInitializer(AnnotationInitializer initializer)
public AnnotationInitializer getInitializer()
public boolean isInitialized()
public void initialize(Page page)
public String getCreatedBy()
public void setCreatedBy(String originatorName)
public String getLastModifiedBy()
public void setLastModifiedBy(String userName)
public Date getCreatedAt()
public void setCreationTimestamp(Date creationTimestamp)
creationTimestamp
- Creation time stamppublic Date getLastModifiedAt()
public void setModifyTimestamp(Date modifyTimestamp)
modifyTimestamp
- Modified time stamppublic int getModCount()
public void setType(AnnotationType typeProfile)
typeProfile
- the typeProfile to setpublic AnnotationType getType()
public void setChangeHandler(com.levigo.jadice.annotation.internal.AnnotationChangeHandler changeHandler)
public com.levigo.jadice.annotation.internal.AnnotationChangeHandler getChangeHandler()
AnnotationChangeHandler
public Permissions<Annotation> getPermissions()
PermissionsProvider
Permissions
. Must never return null
.getPermissions
in interface PermissionsProvider<Annotation>
Permissions
object.public Memento createMemento()
createMemento
in interface MementoOriginator
public void restoreFrom(AnnotationMemento memento)
AnnotationMemento
upon Memento.restore()
public boolean isLoadedAnnotation()
AnnotationPropertyConstants.ANNOTATION_INITIAL
property created
in annotation FormatReader
implementations. If property is present and set to
true
, annotation is marked as loaded.true
for loaded annotation.Copyright © 2024 levigo holding gmbh. All rights reserved.