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 boolean
Flag, indicating whether resizing is allowedprotected Color
protected boolean
protected boolean
protected boolean
protected float
protected Color
protected Resolution
Fields inherited from class com.levigo.jadice.annotation.Annotation
createdAt, createdBy, doFireAnnotationEvents, id, initializer, isModified, lastModifiedAt, lastModifiedBy
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
copyAttributesTo
(Annotation annotation) abstract Rectangle2D
Returns an integerRectangle
that completely encloses the annotation.Returns the current fill colorfloat
Gets the border line width of this annotation.abstract Shape
getShape()
Shape for render structureReturns the current stroke colorboolean
Returns a flag if annotation could be resizedboolean
isFilled()
Returns a flag indicating if annotation is rendered with a background color.boolean
boolean
Returns a flag if annotation border is rendered.void
void
setAllowResize
(boolean allowResize) Sets a flag if annotation is resizeablevoid
setFillColor
(Color fillColor) Sets the fill color (used for filled areas)void
setFilled
(boolean filled) Sets a flag indicating if annotation is rendered with a background color.void
setIconified
(boolean iconified) void
setLinePainted
(boolean linePainted) Sets a flag if annotation border is rendered.void
setLineWidth
(float newValue) Sets the border line width of this annotation.void
setLocation
(double x, double y) Set the location (upper-left corner) of the annotation to the given point.void
setStrokeColor
(Color strokeColor) Sets the stroke color (used for lines, borders)void
setStrokeResolution
(Resolution strokeResolution) abstract void
update()
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, translate
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
-
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:
setLocation
in classAnnotation
- Parameters:
x
- X-positiony
- Y-position
-
copyAttributesTo
- Overrides:
copyAttributesTo
in 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 integerRectangle
that completely encloses the annotation.- Specified by:
getBounds
in 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()
-