com.levigo.jadice.annotation
Class ShapeBasedAnnotation

java.lang.Object
  extended by com.levigo.jadice.annotation.Annotation
      extended by com.levigo.jadice.annotation.ShapeBasedAnnotation
All Implemented Interfaces:
PermissionsProvider<Annotation>, PropertiesProvider, MementoOriginator, Cloneable
Direct Known Subclasses:
LineAnnotation, PathAnnotation, RectangleAnnotation

public abstract class ShapeBasedAnnotation
extends Annotation

An abstract base class for visual shape based annotations.


Field Summary
protected  boolean allowResize
          Flag, indicating whether resizing is allowed
protected  Color fillColor
           
protected  boolean filled
           
protected  boolean iconified
           
protected  boolean linePainted
           
protected  float lineWidth
           
protected  Color strokeColor
           
protected  Resolution strokeResolution
           
 
Fields inherited from class com.levigo.jadice.annotation.Annotation
createdAt, createdBy, doFireAnnotationEvents, id, initializer, isModified, lastModifiedAt, lastModifiedBy
 
Constructor Summary
ShapeBasedAnnotation()
           
 
Method Summary
protected  void copyAttributesTo(Annotation annotation)
          Copy annotation type related attributes to new annotation.
protected static Color createColorWithAlpha(Color color, float alpha)
           
abstract  Rectangle2D getBounds()
          Returns an integer Rectanglethat completely encloses the annotation.
 Color getFillColor()
          Returns the current fill color
 float getLineWidth()
          Gets the border line width of this annotation.
abstract  Shape getShape()
          Shape for render structure
 Color getStrokeColor()
          Returns the current stroke color
 Resolution getStrokeResolution()
           
 boolean isAllowResize()
          Returns a flag if annotation could be resized
 boolean isFilled()
          Returns a flag indicating if annotation is rendered with a background color.
 boolean isIconified()
           
 boolean isLinePainted()
          Returns a flag if annotation border is rendered.
 void setAllowResize(boolean allowResize)
          Sets a flag if annotation is resizeable
 void 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)
           
 
Methods inherited from class com.levigo.jadice.annotation.Annotation
clearModified, clone, createMemento, fireAnnotationChange, getChangeHandler, getCreatedAt, getCreatedBy, getID, getInitializer, getLastModifiedAt, getLastModifiedBy, getModCount, getPermissions, getProperties, getType, initialize, isDoFireAnnotationEvents, isInitialized, isModified, restoreFrom, setChangeHandler, setCreatedBy, setCreationTimestamp, setDoFireAnnotationEvents, setID, setInitializer, setLastModifiedBy, setModified, setModifyTimestamp, setSize, setType, translate
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lineWidth

protected float lineWidth

linePainted

protected boolean linePainted

filled

protected boolean filled

allowResize

protected boolean allowResize
Flag, indicating whether resizing is allowed


fillColor

protected Color fillColor

strokeColor

protected Color strokeColor

iconified

protected boolean iconified

strokeResolution

protected Resolution strokeResolution
Constructor Detail

ShapeBasedAnnotation

public ShapeBasedAnnotation()
Method Detail

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:
and, the border line will not be rendered.

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:
and, the border line will not be rendered.

createColorWithAlpha

protected static Color createColorWithAlpha(Color color,
                                            float alpha)

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 class Annotation
Parameters:
x - X-position
y - Y-position

copyAttributesTo

protected void copyAttributesTo(Annotation annotation)
Description copied from class: Annotation
Copy annotation type related attributes to new annotation.

Overrides:
copyAttributesTo in class Annotation
Parameters:
annotation - Annotation to set attributes

getShape

public abstract Shape 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

public Color getFillColor()
Returns the current fill color

Returns:
Current fill color

setFillColor

public void setFillColor(Color fillColor)
Sets the fill color (used for filled areas)

Parameters:
fillColor - New fill color

setStrokeColor

public void setStrokeColor(Color strokeColor)
Sets the stroke color (used for lines, borders)

Parameters:
strokeColor - New stroke color

getStrokeColor

public Color getStrokeColor()
Returns the current stroke color

Returns:
Current stroke color

getBounds

public abstract Rectangle2D getBounds()
Returns an integer Rectanglethat completely encloses the annotation.

Specified by:
getBounds in class Annotation
Returns:
Rectangle annotation bounding box

getStrokeResolution

public Resolution getStrokeResolution()

setStrokeResolution

public void setStrokeResolution(Resolution strokeResolution)

isIconified

public boolean isIconified()

setIconified

public void setIconified(boolean iconified)


Copyright © 1995-2020 levigo holding gmbh. All Rights Reserved.