Class LineAnnotationWrangler
java.lang.Object
com.levigo.jadice.annotation.AnnotationWrangler
com.levigo.jadice.web.client.internal.annotation.Wrangler<LineAnnotation>
com.levigo.jadice.web.client.internal.annotation.wrangler.DefaultWrangler<LineAnnotation>
com.levigo.jadice.web.client.internal.annotation.wrangler.LineAnnotationWrangler
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected class
Gesture for resizing the line.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.DefaultWrangler
boundsType, createAnno, createEnd, createStart, EMPTY_HANDLE_LIST, MINIMUM_HEIGHT, MINIMUM_WIDTH, minimumHeight, minimumWidth, selectionInspector
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
ensureMinimumLength
(Point2D start, Point2D end, double minLength, Grid.SnapTo snapTo, Page page, Grid grid) Makes sure the line length does not fall below the minimum length by maintaining a minimum distance between the edited point and its opposite.protected void
ensureMinimumLength
(Point2D start, Point2D end, Grid.SnapTo snapTo, Page page, Grid grid) getHandles
(PageView pageView, Page page, LineAnnotation annotation) Creates handles for a specific annotation.double
Returns the minimum line length in millimeters.void
setMinimumLineLength
(double minimumLineLength) Sets the minimum line length of an annotation in millimeters.protected void
updateCreated
(EditEvent e, LineAnnotation createAnno, Point2D createStart, Point2D createEnd) Methods inherited from class com.levigo.jadice.web.client.internal.annotation.wrangler.DefaultWrangler
afterCreate, calcMinWidth, contribute, getCreationMode, getCursor, getMinimumHeight, getMinimumWidth, handleCreateEditEvent, handleEditEvent, isSelectionPoint, isSelectionTouchPoint, setCreationMode, setMinimumHeight, setMinimumWidth
-
Constructor Details
-
LineAnnotationWrangler
public LineAnnotationWrangler()
-
-
Method Details
-
getHandles
Description copied from class:Wrangler
Creates handles for a specific annotation.- Overrides:
getHandles
in classDefaultWrangler<LineAnnotation>
- 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, LineAnnotation createAnno, Point2D createStart, Point2D createEnd) - Overrides:
updateCreated
in classDefaultWrangler<LineAnnotation>
-
ensureMinimumLength
protected void ensureMinimumLength(Point2D start, Point2D end, Grid.SnapTo snapTo, Page page, Grid grid) -
ensureMinimumLength
protected void ensureMinimumLength(Point2D start, Point2D end, double minLength, Grid.SnapTo snapTo, Page page, Grid grid) Makes sure the line length does not fall below the minimum length by maintaining a minimum distance between the edited point and its opposite.- Parameters:
start
- the edited point. This is the point which is re-located if neededend
- the other end of the lineminLength
- defines the maximum length of the linesnapTo
- theGrid.SnapTo
used to align the line points to the gridpage
- the current pagegrid
- the grid attached to the document
-
setMinimumLineLength
public void setMinimumLineLength(double minimumLineLength) Sets the minimum line length of an annotation in millimeters. Used to inject the value defined in an underlying annotation profile.- Parameters:
minimumLineLength
- the minimum line length
-
getMinimumLineLength
public double getMinimumLineLength()Returns the minimum line length in millimeters.- Returns:
- the minimum line length
-