|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.levigo.jadice.annotation.Annotation com.levigo.jadice.annotation.ShapeBasedAnnotation com.levigo.jadice.annotation.LineAnnotation
public class LineAnnotation
An annotation looking like a line.
An line annotation could be used to underline or strike through something interesting of the displayed document page.
Field Summary | |
---|---|
protected Point2D |
p1
|
protected Point2D |
p2
|
protected Polygon |
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 | |
---|---|
LineAnnotation()
|
Method Summary | |
---|---|
LineAnnotation |
clone()
|
protected void |
copyAttributesTo(Annotation annotation)
Copy annotation type related attributes to new annotation. |
Rectangle2D |
getBounds()
Returns an integer Rectangle that completely encloses the annotation. |
Point2D |
getP1()
|
Point2D |
getP2()
|
Point2D[] |
getPoints()
|
Polygon |
getShape()
Shape for render structure |
void |
setLocation(double x,
double y)
Set the location (upper-left corner) of the annotation to the given point. |
void |
setP1(double x,
double y)
|
void |
setP1(Point2D p)
|
void |
setP2(double x,
double y)
|
void |
setP2(Point2D p)
|
void |
setSize(double width,
double height)
Set the size of the annotation to the given size. |
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 void |
updateShape(LineAnnotation previousState)
|
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 |
Field Detail |
---|
protected Polygon shape
protected final Point2D p1
protected final Point2D p2
Constructor Detail |
---|
public LineAnnotation()
Method Detail |
---|
protected void updateShape(LineAnnotation previousState)
public Point2D[] getPoints()
public void setSize(double width, double height)
Annotation
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.
setSize
in class Annotation
public void setLocation(double x, double y)
ShapeBasedAnnotation
setLocation
in class ShapeBasedAnnotation
x
- X-positiony
- Y-positionpublic LineAnnotation clone()
clone
in class Annotation
Annotation.clone()
protected void copyAttributesTo(Annotation annotation)
Annotation
copyAttributesTo
in class ShapeBasedAnnotation
annotation
- Annotation to set attributespublic void setP1(Point2D p)
public void setP1(double x, double y)
public void setP2(Point2D p)
public void setP2(double x, double y)
public Point2D getP1()
public Point2D getP2()
public void translate(double dx, double dy)
Annotation
Annotation
the indicated distance, to the right along the x
coordinate axis, and downward along the y coordinate axis.
translate
in class Annotation
dx
- the distance to move this Rectangle
along the x axisdy
- the distance to move this Rectangle
along the y axispublic Polygon getShape()
ShapeBasedAnnotation
getShape
in class ShapeBasedAnnotation
public Rectangle2D getBounds()
ShapeBasedAnnotation
Rectangle
that completely encloses the annotation.
getBounds
in class ShapeBasedAnnotation
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |