Package com.levigo.jadice.annotation
Class TextHighlightAnnotation
java.lang.Object
com.levigo.jadice.annotation.Annotation
com.levigo.jadice.annotation.ShapeBasedAnnotation
com.levigo.jadice.annotation.TextHighlightAnnotation
- All Implemented Interfaces:
PermissionsProvider<Annotation>,PropertiesProvider,com.levigo.jadice.web.shared.model.annotation.internal.JwtAnnotation,Serializable,org.jadice.util.base.MementoOriginator
Annotation implementation to highlight / underscore / strike through text content.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected booleanprotected booleanFields inherited from class com.levigo.jadice.annotation.ShapeBasedAnnotation
allowResize, fillColor, filled, iconified, linePainted, lineWidth, strokeColor, strokeResolutionFields inherited from class com.levigo.jadice.annotation.Annotation
createdAt, createdBy, doFireAnnotationEvents, id, initializer, isModified, lastModifiedAt, lastModifiedBy -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAddPath2Dobject representing a rectangle (defined with 4 points) covering text content.copy()protected voidcopyAttributesTo(Annotation annotation) getAreas()Returns an integerRectanglethat completely encloses the annotation.getShape()Shape for render structurebooleanbooleanbooleanvoidvoidsetHighlighted(boolean highlighted) Enable / disable highlight effect.voidsetLocation(double x, double y) Set the location (upper-left corner) of the annotation to the given point.voidsetSize(double width, double height) Not supported, annotation is not intended to be resizable.voidsetStrikethrough(boolean strikethrough) Enable / disable strike through effect.voidsetUnderscored(boolean underscored) Enable / disable underscore effect.voidtranslate(double dx, double dy) Not supported, annotation is not intended to be movable via GUI actions.voidupdate()Methods inherited from class com.levigo.jadice.annotation.ShapeBasedAnnotation
getFillColor, getLineWidth, getStrokeColor, getStrokeResolution, isAllowResize, isFilled, isIconified, isLinePainted, prepareSerialisation, setAllowResize, setFillColor, setFilled, setIconified, setLinePainted, setLineWidth, setStrokeColor, setStrokeResolutionMethods 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, setType, setTypeName
-
Field Details
-
areas
-
underscored
protected boolean underscored -
strikethrough
protected boolean strikethrough -
highlighted
protected boolean highlighted
-
-
Constructor Details
-
TextHighlightAnnotation
public TextHighlightAnnotation()
-
-
Method Details
-
addArea
AddPath2Dobject representing a rectangle (defined with 4 points) covering text content.Supported path operations (see
PathIterator):- "move-to" "line-to" "line-to" "line-to"
- "move-to" "line-to" "line-to" "line-to" "close"
- "move-to" "line-to" "line-to" "line-to" "line-to" (last line-to must close path)
- "move-to" "line-to" "line-to" "line-to" "line-to" "close" (last line-to must close path)
- Parameters:
path-Path2Dobject to add to area.- Throws:
IllegalArgumentException- Thrown by unsupported path definitions.
-
getAreas
-
setAreas
SetListcontainingPath2Darea definitions. Area objects will be verified, seeaddArea(Path2D)method description. -
getShape
Description copied from class:ShapeBasedAnnotationShape for render structure- Specified by:
getShapein classShapeBasedAnnotation- Returns:
- Shape
-
getBounds
Description copied from class:ShapeBasedAnnotationReturns an integerRectanglethat completely encloses the annotation.- Specified by:
getBoundsin classShapeBasedAnnotation- Returns:
- Rectangle annotation bounding box
-
translate
public void translate(double dx, double dy) Not supported, annotation is not intended to be movable via GUI actions. It is possible to move the annotation viasetLocation(double, double)method.- Specified by:
translatein classAnnotation- Parameters:
dx- the distance to move thisRectanglealong the x axisdy- the distance to move thisRectanglealong the y axis
-
setSize
public void setSize(double width, double height) Not supported, annotation is not intended to be resizable.- Specified by:
setSizein classAnnotation- Parameters:
width-height-
-
setLocation
public void setLocation(double x, double y) Description copied from class:ShapeBasedAnnotationSet 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.- Overrides:
setLocationin classShapeBasedAnnotation- Parameters:
x- X-positiony- Y-position
-
copy
-
copyAttributesTo
- Overrides:
copyAttributesToin classShapeBasedAnnotation
-
isUnderscored
public boolean isUnderscored() -
setUnderscored
public void setUnderscored(boolean underscored) Enable / disable underscore effect.- Parameters:
underscored-
-
isStrikethrough
public boolean isStrikethrough() -
setStrikethrough
public void setStrikethrough(boolean strikethrough) Enable / disable strike through effect.- Parameters:
strikethrough-
-
isHighlighted
public boolean isHighlighted() -
setHighlighted
public void setHighlighted(boolean highlighted) Enable / disable highlight effect.- Parameters:
highlighted-
-
update
public void update()- Specified by:
updatein classShapeBasedAnnotation
-