com.levigo.jadice.annotation
Class ArrowAnnotation

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

public class ArrowAnnotation
extends LineAnnotation

An annotation looking like an arrow.

An arrow annotation could be used to point to something interesting part of the displayed document page. For this purpose it can be rotated and change its appearance color.


Field Summary
 
Fields inherited from class com.levigo.jadice.annotation.LineAnnotation
p1, p2, shape
 
Fields inherited from class com.levigo.jadice.annotation.ShapeBasedAnnotation
allowResize, fillColor, filled, iconified, linePainted, lineWidth, strokeColor, strokeResolution
 
Fields inherited from class com.levigo.jadice.annotation.Annotation
createdAt, createdBy, doFireAnnotationEvents, id, initializer, isModified, lastModifiedAt, lastModifiedBy
 
Constructor Summary
ArrowAnnotation()
           
 
Method Summary
 ArrowAnnotation clone()
           
protected  void copyAttributesTo(Annotation annotation)
          Copy annotation type related attributes to new annotation.
 Rectangle2D getBounds()
          Returns an integer Rectanglethat completely encloses the annotation.
 int getHeadAngle()
          Returns the head Angle in degrees.
 Point2D[] getHeadEdges()
           
 int getHeadLength()
          Returns the head length.
 Point2D[] getPoints()
          Get the points of the arrow in a point array: bottom tip edge of head arm 1 edge of head arm 2
 boolean isHeadLengthInPercent()
          Returns current head length flag.
 void setBottom(Point2D bottom)
           
 void setHeadAngle(int headAngle)
          Sets the head angle in degrees.
 void setHeadLength(int headLength)
          Sets the head length which is defined by the isHeadLengthInPercent() value.
 void setHeadLengthInPercent(boolean headLengthInPercent)
          Sets the mode for the setHeadAngle(int) value:
true - head length in percent of the total length.
 void setTip(Point2D tip)
           
protected  void updateShape(LineAnnotation previousState)
          Update the polygon representing the arrow.
 
Methods inherited from class com.levigo.jadice.annotation.LineAnnotation
getP1, getP2, getShape, setLocation, setP1, setP1, setP2, setP2, setSize, translate
 
Methods inherited from class com.levigo.jadice.annotation.ShapeBasedAnnotation
createColorWithAlpha, getFillColor, getLineWidth, getStrokeColor, getStrokeResolution, isAllowResize, isFilled, isIconified, isLinePainted, setAllowResize, setFillColor, setFilled, setIconified, setLinePainted, setLineWidth, setStrokeColor, setStrokeResolution
 
Methods inherited from class com.levigo.jadice.annotation.Annotation
clearModified, 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, setType
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrowAnnotation

public ArrowAnnotation()
Method Detail

setTip

public void setTip(Point2D tip)

setBottom

public void setBottom(Point2D bottom)

getHeadEdges

public Point2D[] getHeadEdges()

updateShape

protected void updateShape(LineAnnotation previousState)
Update the polygon representing the arrow.

Overrides:
updateShape in class LineAnnotation

getHeadAngle

public int getHeadAngle()
Returns the head Angle in degrees.

Returns:
Head angle

getHeadLength

public int getHeadLength()
Returns the head length.

Returns:
Head length

setHeadAngle

public void setHeadAngle(int headAngle)
Sets the head angle in degrees.

Parameters:
headAngle - The headAngle to set

setHeadLength

public void setHeadLength(int headLength)
Sets the head length which is defined by the isHeadLengthInPercent() value.

Parameters:
headLength - The headLength to set

getPoints

public Point2D[] getPoints()
Get the points of the arrow in a point array:

Overrides:
getPoints in class LineAnnotation
Returns:
Point2D[]

getBounds

public Rectangle2D getBounds()
Description copied from class: ShapeBasedAnnotation
Returns an integer Rectanglethat completely encloses the annotation.

Overrides:
getBounds in class LineAnnotation
Returns:
Rectangle annotation bounding box

clone

public ArrowAnnotation clone()
Overrides:
clone in class LineAnnotation
See Also:
Annotation.clone()

copyAttributesTo

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

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

isHeadLengthInPercent

public boolean isHeadLengthInPercent()
Returns current head length flag.

Returns:
Head length flag

setHeadLengthInPercent

public void setHeadLengthInPercent(boolean headLengthInPercent)
Sets the mode for the setHeadAngle(int) value:
true - head length in percent of the total length.
false - head length in pixel.
Default value is true.

Parameters:
headLengthInPercent -


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