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.RotateHandle, TextAnnotationWrangler.TextSelectionNested classes/interfaces inherited from class com.levigo.jadice.web.client.internal.annotation.wrangler.DefaultWrangler
DefaultWrangler.CreationMode, DefaultWrangler.ForceAnnotationUpright -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AnnotationTypeprotected Point2Dprotected Point2Dprotected static final doubleprotected static final doubleFields inherited from class com.levigo.jadice.web.client.internal.annotation.wrangler.TextAnnotationWrangler
cursorPosition, editorBehaviorOnOutsideClick, editorHeight, editorWidth, executeActionAfterCreation, expandHeight, forceAnnotationUpright, showRotationHandle, textSelectionFields 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 RectanglecalculateEditorBounds(PageView pageView, Page page, TextAnnotation selected) Calculates the editor bounds which should be the same size and position as the text annotation.protected TextEditorcreateTextEditor(int editorMinWidth, int editorMinHeight, TextAnnotation selected, double pageHeight) Creates a text editor.protected doubleReturns the desired default text box height when creating aCalloutAnnotation.protected doubleReturns the desired default text box width when creating aCalloutAnnotation.getHandles(PageView pageView, Page page, TextAnnotation annotation) Creates handles for a specific annotation.booleanisSelectionPoint(Annotation annotation, Point2D mousePoint, int tolerance, boolean b, int lineWidthFactor) booleanThis can be overriden by any subclass to disable the initial resizing when an annotation is added with a single click.protected voidupdateCreated(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, setTextSelectionMethods 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:WranglerCreates handles for a specific annotation.- Overrides:
getHandlesin 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:
updateCreatedin classTextAnnotationWrangler
-
isSelectionPoint
public boolean isSelectionPoint(Annotation annotation, Point2D mousePoint, int tolerance, boolean b, int lineWidthFactor) - Overrides:
isSelectionPointin 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:TextAnnotationWranglerCalculates 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:
calculateEditorBoundsin classTextAnnotationWrangler- Parameters:
pageView- thePageViewcontaining theAnnotationpage- the page containing theAnnotationselected- the selectedAnnotation- Returns:
- the calculated editor bounds
-
createTextEditor
protected TextEditor createTextEditor(int editorMinWidth, int editorMinHeight, TextAnnotation selected, double pageHeight) Description copied from class:TextAnnotationWranglerCreates a text editor. The editor for normal text annotations does not have a minimum size.- Overrides:
createTextEditorin classTextAnnotationWrangler- Parameters:
pageHeight-- Returns:
- a new text editor instance.
-
scaleByEditorWidth
public boolean scaleByEditorWidth()Description copied from class:TextAnnotationWranglerThis can be overriden by any subclass to disable the initial resizing when an annotation is added with a single click.- Overrides:
scaleByEditorWidthin classTextAnnotationWrangler
-