Class StampAnnotationWrangler
java.lang.Object
com.levigo.jadice.annotation.AnnotationWrangler
com.levigo.jadice.web.client.internal.annotation.Wrangler<TextAnnotation>
com.levigo.jadice.web.client.internal.annotation.wrangler.DefaultWrangler<TextAnnotation>
com.levigo.jadice.web.client.internal.annotation.wrangler.TextAnnotationWrangler
com.levigo.jadice.web.client.internal.annotation.wrangler.StampAnnotationWrangler
Manages the creation of stamp annotations.
This class is referenced in annotation profiles by its full classname. It supports parameterization via annotation profiles.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.levigo.jadice.web.client.internal.annotation.wrangler.TextAnnotationWrangler
TextAnnotationWrangler.CursorPosition, TextAnnotationWrangler.EditorBehaviorOnOutsideClick, TextAnnotationWrangler.ExpandHeight, TextAnnotationWrangler.ForceAnnotationUpright, TextAnnotationWrangler.RotateHandle, TextAnnotationWrangler.TextSelection
Nested classes/interfaces inherited from class com.levigo.jadice.web.client.internal.annotation.wrangler.DefaultWrangler
DefaultWrangler.CreationMode
-
Field Summary
Fields inherited from class com.levigo.jadice.web.client.internal.annotation.wrangler.TextAnnotationWrangler
cursorPosition, editorBehaviorOnOutsideClick, editorHeight, editorWidth, executeActionAfterCreation, expandHeight, forceAnnotationUpright, showRotationHandle, textSelection
Fields inherited from class com.levigo.jadice.web.client.internal.annotation.wrangler.DefaultWrangler
boundsType, createEnd, createStart, EMPTY_HANDLE_LIST, MINIMUM_HEIGHT, MINIMUM_WIDTH, minimumHeight, minimumWidth, selectionInspector
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static Point2D
calcPos
(StampAnnotation annotation, Point2D positionDocp) protected Rectangle
calculateEditorBounds
(PageView pageView, Page page, TextAnnotation selected) Calculates the editor bounds which should be the same size and position as the text annotation.getHandles
(PageView pageView, Page page, TextAnnotation annotation) Creates handles for a specific annotation.boolean
handleCreateEditEvent
(EditEvent e, TextAnnotation annotation) Invoked during the creation of an annotation.boolean
isSelectionPoint
(Annotation annotation, Point2D mousePoint, int tolerance, boolean b, int lineWidthFactor) boolean
This can be overriden by any subclass to disable the initial resizing when an annotation is added with a single click.Methods inherited from class com.levigo.jadice.web.client.internal.annotation.wrangler.TextAnnotationWrangler
afterCreate, contribute, createTextEditor, getCursorPosition, getEditorBehaviorOnOutsideClick, getEditorHeight, getEditorWidth, getForceAnnotationUpright, getIcon, getIconFont, getMultiplier, getTextSelection, handleEditEvent, isExecuteActionAfterCreation, isShowRotationHandle, openTextEditor, setCursorPosition, setEditorBehaviorOnOutsideClick, setEditorHeight, setEditorWidth, setExecuteActionAfterCreation, setExpandHeight, setForceAnnotationUpright, setShowRotationHandle, setTextSelection, updateCreated
Methods inherited from class com.levigo.jadice.web.client.internal.annotation.wrangler.DefaultWrangler
calcMinWidth, getCreationMode, getCursor, getMinimumHeight, getMinimumWidth, isSelectionTouchPoint, setCreationMode, setMinimumHeight, setMinimumWidth
-
Constructor Details
-
StampAnnotationWrangler
public StampAnnotationWrangler()
-
-
Method Details
-
calcPos
-
getHandles
Description copied from class:Wrangler
Creates handles for a specific annotation.- Overrides:
getHandles
in classTextAnnotationWrangler
- Parameters:
pageView
- PageView the annotation is shown on (for example for repaint calls)page
- The page that contains the annotationannotation
- The annotation the wrangler should create handles for- Returns:
- Handles that can be used to edit the annotation
-
handleCreateEditEvent
Description copied from class:Wrangler
Invoked during the creation of an annotation.Can be invoked multiple times. For example during the creation of a polygon based annotation each mouse down event could indicate a new corner of the polygon at the current mouse position.
- Overrides:
handleCreateEditEvent
in classDefaultWrangler<TextAnnotation>
- Parameters:
e
- an edit event representing a mouse actionannotation
- the new annotation- Returns:
- true, when the event finishes the annotation creation
-
isSelectionPoint
public boolean isSelectionPoint(Annotation annotation, Point2D mousePoint, int tolerance, boolean b, int lineWidthFactor) - Overrides:
isSelectionPoint
in classTextAnnotationWrangler
-
calculateEditorBounds
Description copied from class:TextAnnotationWrangler
Calculates the editor bounds which should be the same size and position as the text annotation. After that the position will be slightly adapted according to the line width of the annotation.- Overrides:
calculateEditorBounds
in classTextAnnotationWrangler
- Parameters:
pageView
- thePageView
containing theAnnotation
page
- the page containing theAnnotation
selected
- the selectedAnnotation
- Returns:
- the calculated editor bounds
-
scaleByEditorWidth
public boolean scaleByEditorWidth()Description copied from class:TextAnnotationWrangler
This can be overriden by any subclass to disable the initial resizing when an annotation is added with a single click.- Overrides:
scaleByEditorWidth
in classTextAnnotationWrangler
-