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:
com.google.gwt.user.client.rpc.IsSerializable
,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 boolean
protected boolean
protected boolean
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
AddPath2D
object representing a rectangle (defined with 4 points) covering text content.copy()
protected void
copyAttributesTo
(Annotation annotation) getAreas()
Returns an integerRectangle
that completely encloses the annotation.getShape()
Shape for render structureboolean
boolean
boolean
void
void
setHighlighted
(boolean highlighted) Enable / disable highlight effect.void
setLocation
(double x, double y) Set the location (upper-left corner) of the annotation to the given point.void
setSize
(double width, double height) Not supported, annotation is not intended to be resizable.void
setStrikethrough
(boolean strikethrough) Enable / disable strike through effect.void
setUnderscored
(boolean underscored) Enable / disable underscore effect.void
translate
(double dx, double dy) Not supported, annotation is not intended to be movable via GUI actions.void
update()
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, setStrokeResolution
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, 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
AddPath2D
object 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
-Path2D
object to add to area.- Throws:
IllegalArgumentException
- Thrown by unsupported path definitions.
-
getAreas
-
setAreas
SetList
containingPath2D
area definitions. Area objects will be verified, seeaddArea(Path2D)
method description. -
getShape
Description copied from class:ShapeBasedAnnotation
Shape for render structure- Specified by:
getShape
in classShapeBasedAnnotation
- Returns:
- Shape
-
getBounds
Description copied from class:ShapeBasedAnnotation
Returns an integerRectangle
that completely encloses the annotation.- Specified by:
getBounds
in 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:
translate
in classAnnotation
- Parameters:
dx
- the distance to move thisRectangle
along the x axisdy
- the distance to move thisRectangle
along the y axis
-
setSize
public void setSize(double width, double height) Not supported, annotation is not intended to be resizable.- Specified by:
setSize
in classAnnotation
-
setLocation
public void setLocation(double x, double y) Description copied from class:ShapeBasedAnnotation
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.- Overrides:
setLocation
in classShapeBasedAnnotation
- Parameters:
x
- X-positiony
- Y-position
-
copy
-
copyAttributesTo
- Overrides:
copyAttributesTo
in 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:
update
in classShapeBasedAnnotation
-