Package com.levigo.jadice.annotation
Class ShapeBasedAnnotation
java.lang.Object
com.levigo.jadice.annotation.Annotation
com.levigo.jadice.annotation.ShapeBasedAnnotation
- All Implemented Interfaces:
PermissionsProvider<Annotation>,PropertiesProvider,com.levigo.jadice.web.shared.model.annotation.internal.JwtAnnotation,Serializable,org.jadice.util.base.MementoOriginator
- Direct Known Subclasses:
LineAnnotation,PathAnnotation,RectangleAnnotation,TextHighlightAnnotation
An abstract base class for visual shape based annotations.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanFlag, indicating whether resizing is allowedprotected Colorprotected booleanprotected booleanprotected booleanprotected floatprotected Colorprotected ResolutionFields inherited from class com.levigo.jadice.annotation.Annotation
createdAt, createdBy, doFireAnnotationEvents, id, initializer, isModified, lastModifiedAt, lastModifiedBy -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcopyAttributesTo(Annotation annotation) abstract Rectangle2DReturns an integerRectanglethat completely encloses the annotation.Returns the current fill colorfloatGets the border line width of this annotation.abstract ShapegetShape()Shape for render structureReturns the current stroke colorbooleanReturns a flag if annotation could be resizedbooleanisFilled()Returns a flag indicating if annotation is rendered with a background color.booleanbooleanReturns a flag if annotation border is rendered.voidvoidsetAllowResize(boolean allowResize) Sets a flag if annotation is resizeablevoidsetFillColor(Color fillColor) Sets the fill color (used for filled areas)voidsetFilled(boolean filled) Sets a flag indicating if annotation is rendered with a background color.voidsetIconified(boolean iconified) voidsetLinePainted(boolean linePainted) Sets a flag if annotation border is rendered.voidsetLineWidth(float newValue) Sets the border line width of this annotation.voidsetLocation(double x, double y) Set the location (upper-left corner) of the annotation to the given point.voidsetStrokeColor(Color strokeColor) Sets the stroke color (used for lines, borders)voidsetStrokeResolution(Resolution strokeResolution) abstract voidupdate()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, setSize, setType, setTypeName, translateMethods 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
-
lineWidth
protected float lineWidth -
linePainted
protected boolean linePainted -
filled
protected boolean filled -
allowResize
protected boolean allowResizeFlag, indicating whether resizing is allowed -
fillColor
-
strokeColor
-
iconified
protected boolean iconified -
strokeResolution
-
-
Constructor Details
-
ShapeBasedAnnotation
public ShapeBasedAnnotation()
-
-
Method Details
-
getLineWidth
public float getLineWidth()Gets the border line width of this annotation.Notice, if this annotation has disabled the line painted attribute
- Returns:
- the annotation border line width
- See Also:
-
setLineWidth
public void setLineWidth(float newValue) Sets the border line width of this annotation.Notice, if this annotation has disabled the line painted attribute
- Parameters:
newValue- the new line width- See Also:
-
isFilled
public boolean isFilled()Returns a flag indicating if annotation is rendered with a background color.- Returns:
- boolean
-
setFilled
public void setFilled(boolean filled) Sets a flag indicating if annotation is rendered with a background color.- Parameters:
filled- The filled to set
-
isLinePainted
public boolean isLinePainted()Returns a flag if annotation border is rendered.- Returns:
- boolean
-
setLinePainted
public void setLinePainted(boolean linePainted) Sets a flag if annotation border is rendered.- Parameters:
linePainted-
-
setLocation
public 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.- Specified by:
setLocationin classAnnotation- Parameters:
x- X-positiony- Y-position
-
copyAttributesTo
- Overrides:
copyAttributesToin classAnnotation
-
getShape
Shape for render structure- Returns:
- Shape
-
isAllowResize
public boolean isAllowResize()Returns a flag if annotation could be resized- Returns:
- boolean
-
setAllowResize
public void setAllowResize(boolean allowResize) Sets a flag if annotation is resizeable- Parameters:
allowResize-
-
getFillColor
Returns the current fill color- Returns:
- Current fill color
-
setFillColor
Sets the fill color (used for filled areas)- Parameters:
fillColor- New fill color
-
setStrokeColor
Sets the stroke color (used for lines, borders)- Parameters:
strokeColor- New stroke color
-
getStrokeColor
Returns the current stroke color- Returns:
- Current stroke color
-
getBounds
Returns an integerRectanglethat completely encloses the annotation.- Specified by:
getBoundsin classAnnotation- Returns:
- Rectangle annotation bounding box
-
getStrokeResolution
-
setStrokeResolution
-
isIconified
public boolean isIconified() -
setIconified
public void setIconified(boolean iconified) -
prepareSerialisation
public void prepareSerialisation() -
update
public abstract void update()
-