Class CalloutAnnotationWrangler
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.CalloutAnnotationWrangler
Wrangler for CalloutAnnotations. It allows to modify the textbox, the callout arrow line and
perform the "automatic move", where the textbox can be dragged without moving the arrow head.
-
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
FieldsModifier and TypeFieldDescriptionprotected AnnotationType
protected Point2D
protected Point2D
protected static final double
protected static final double
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, EMPTY_HANDLE_LIST, MINIMUM_HEIGHT, MINIMUM_WIDTH, minimumHeight, minimumWidth, selectionInspector
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Rectangle
calculateEditorBounds
(PageView pageView, Page page, TextAnnotation selected) Calculates the editor bounds which should be the same size and position as the text annotation.protected TextEditor
createTextEditor
(int editorMinWidth, int editorMinHeight, TextAnnotation selected, double pageHeight) Creates a text editor.protected double
Returns the desired default text box height when creating aCalloutAnnotation
.protected double
Returns the desired default text box width when creating aCalloutAnnotation
.getHandles
(PageView pageView, Page page, TextAnnotation annotation) Creates handles for a specific 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.protected void
updateCreated
(EditEvent e, TextAnnotation createAnno, Point2D createStart, Point2D createEnd) Methods inherited from class com.levigo.jadice.web.client.internal.annotation.wrangler.TextAnnotationWrangler
afterCreate, contribute, getCursorPosition, getEditorBehaviorOnOutsideClick, getEditorHeight, getEditorWidth, getForceAnnotationUpright, getIcon, getIconFont, getMultiplier, getTextSelection, handleEditEvent, isExecuteActionAfterCreation, isShowRotationHandle, openTextEditor, setCursorPosition, setEditorBehaviorOnOutsideClick, setEditorHeight, setEditorWidth, setExecuteActionAfterCreation, setExpandHeight, setForceAnnotationUpright, setShowRotationHandle, setTextSelection
Methods inherited from class com.levigo.jadice.web.client.internal.annotation.wrangler.DefaultWrangler
calcMinWidth, getCreationMode, getCursor, getMinimumHeight, getMinimumWidth, handleCreateEditEvent, isSelectionTouchPoint, setCreationMode, setMinimumHeight, setMinimumWidth
-
Field Details
-
createAnno
-
createStart
-
createEnd
-
DEFAULT_TEXT_BOX_WIDTH
protected static final double DEFAULT_TEXT_BOX_WIDTH- See Also:
-
DEFAULT_TEXT_BOX_HEIGHT
protected static final double DEFAULT_TEXT_BOX_HEIGHT- See Also:
-
-
Constructor Details
-
CalloutAnnotationWrangler
public CalloutAnnotationWrangler()
-
-
Method Details
-
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
-
updateCreated
protected void updateCreated(EditEvent e, TextAnnotation createAnno, Point2D createStart, Point2D createEnd) - Overrides:
updateCreated
in classTextAnnotationWrangler
-
isSelectionPoint
public boolean isSelectionPoint(Annotation annotation, Point2D mousePoint, int tolerance, boolean b, int lineWidthFactor) - Overrides:
isSelectionPoint
in classTextAnnotationWrangler
-
getDefaultTextBoxHeight
protected double getDefaultTextBoxHeight()Returns the desired default text box height when creating aCalloutAnnotation
.By default, this returns the value of
DEFAULT_TEXT_BOX_HEIGHT
- Returns:
- the text box height
-
getDefaultTextBoxWidth
protected double getDefaultTextBoxWidth()Returns the desired default text box width when creating aCalloutAnnotation
.By default, this returns the value of
DEFAULT_TEXT_BOX_WIDTH
- Returns:
- the text box width
-
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
-
createTextEditor
protected TextEditor createTextEditor(int editorMinWidth, int editorMinHeight, TextAnnotation selected, double pageHeight) Description copied from class:TextAnnotationWrangler
Creates a text editor. The editor for normal text annotations does not have a minimum size.- Overrides:
createTextEditor
in classTextAnnotationWrangler
- Parameters:
pageHeight
-- Returns:
- a new text editor instance.
-
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
-