Class AnnotationBase.CartesianAnnotationPlacementStrategyBase<T>
Defines a base placement strategy for AnnotationBase instance
Inheritance
Inherited Members
Namespace:
Assembly: .dll
Syntax
protected abstract static class AnnotationBase.CartesianAnnotationPlacementStrategyBase<T> extends AnnotationPlacementStrategyBase<T>
Type Parameters
| Name | Description |
|---|---|
| T |
Constructors
CartesianAnnotationPlacementStrategyBase(T annotation, boolean clipAdornerToAnnotationSurface)
Creates a new instance of CartesianAnnotationPlacementStrategyBase class
Declaration
protected CartesianAnnotationPlacementStrategyBase(T annotation, boolean clipAdornerToAnnotationSurface)
Parameters
| Type | Name | Description |
|---|---|---|
| T | annotation | The annotation to place |
| boolean | clipAdornerToAnnotationSurface | If true adorner for annotation should be clipped to its parent IAnnotationSurface |
Fields
selectionPath
Declaration
protected final Path selectionPath
Field Value
| Type | Description |
|---|---|
| android.graphics.Path |
Methods
createAdornerActionForAnnotationHit()
Creates IAnnotationAdornerAction which is used in case of hit on annotation
Declaration
protected IAnnotationAdornerAction createAdornerActionForAnnotationHit()
Returns
| Type | Description |
|---|---|
| IAnnotationAdornerAction | The IAnnotationAdornerAction instance to handle annotation hit |
createAdornerActionForResizingGripWithIndex(int resizingGripIndex, int resizingGripXOffset, int resizingGripYOffset)
Creates IAnnotationAdornerAction which is used in case of hit on annotation's resizing grip
Declaration
protected IAnnotationAdornerAction createAdornerActionForResizingGripWithIndex(int resizingGripIndex, int resizingGripXOffset, int resizingGripYOffset)
Parameters
| Type | Name | Description |
|---|---|---|
| int | resizingGripIndex | The index of resizing grip which was hit |
| int | resizingGripXOffset | The initial x offset for resizing grip |
| int | resizingGripYOffset | The initial y offset for resizing grip |
Returns
| Type | Description |
|---|---|
| IAnnotationAdornerAction | The IAnnotationAdornerAction instance to handle resizing grip hit with specified index |
drawAdorner(Canvas adornerCanvas)
Declaration
public final void drawAdorner(Canvas adornerCanvas)
Parameters
| Type | Name | Description |
|---|---|---|
| android.graphics.Canvas | adornerCanvas |
drawAdornerInternal(Canvas adornerCanvas, AnnotationCoordinates annotationCoordinates)
Draws adorner for annotation on specified Canvas
Declaration
protected void drawAdornerInternal(Canvas adornerCanvas, AnnotationCoordinates annotationCoordinates)
Parameters
| Type | Name | Description |
|---|---|---|
| android.graphics.Canvas | adornerCanvas | The target Canvas to draw adorner on |
| AnnotationCoordinates | annotationCoordinates | The annotation coordinates of annotation |
drawResizingGrips(Canvas canvas, AnnotationCoordinates annotationCoordinates)
Draws resizing grips for parent annotation
Declaration
protected void drawResizingGrips(Canvas canvas, AnnotationCoordinates annotationCoordinates)
Parameters
| Type | Name | Description |
|---|---|---|
| android.graphics.Canvas | canvas | The Canvas to draw resizing grips on |
| AnnotationCoordinates | annotationCoordinates | The AnnotationCoordinates instance associated with parent annotation |
drawSelectionOverlayInternal(Canvas adornerCanvas, AnnotationCoordinates annotationCoordinates)
Draws selection overlay for parent AnnotationBase
Declaration
protected final void drawSelectionOverlayInternal(Canvas adornerCanvas, AnnotationCoordinates annotationCoordinates)
Parameters
| Type | Name | Description |
|---|---|---|
| android.graphics.Canvas | adornerCanvas | The canvas to draw on |
| AnnotationCoordinates | annotationCoordinates | The annotation coordinates |
getResizingGripHitIndex(float hitPointX, float hitPointY, AnnotationCoordinates annotationCoordinates)
Gets the index of IResizingGrip for parent annotation at specified point on screen
Declaration
protected int getResizingGripHitIndex(float hitPointX, float hitPointY, AnnotationCoordinates annotationCoordinates)
Parameters
| Type | Name | Description |
|---|---|---|
| float | hitPointX | The x coordinate of hit test point in pixels |
| float | hitPointY | The y coordinate of hit test point in pixels |
| AnnotationCoordinates | annotationCoordinates | The AnnotationCoordinates instance associated with parent annotation |
Returns
| Type | Description |
|---|---|
| int | The index of IResizingGrip which lies below hit test point, otherwise returns -1 which indicates that there is not IResizingGrip at specified hit test point |
internalMoveAnnotationTo(AnnotationCoordinates coordinates, float horizontalOffset, float verticalOffset, IAnnotationSurface annotationSurface)
Moves parent annotation in X, Y direction with specified offset in pixels
Declaration
protected void internalMoveAnnotationTo(AnnotationCoordinates coordinates, float horizontalOffset, float verticalOffset, IAnnotationSurface annotationSurface)
Parameters
| Type | Name | Description |
|---|---|---|
| AnnotationCoordinates | coordinates | The AnnotationCoordinates instance associated with parent annotation |
| float | horizontalOffset | The horizontal offset in pixels |
| float | verticalOffset | The vertical offset in pixels |
| IAnnotationSurface | annotationSurface | The parent IAnnotationSurface |
isCoordinateValid(float coord, int canvasMeasurement)
Checks if specified coordinate if valid
Declaration
protected final boolean isCoordinateValid(float coord, int canvasMeasurement)
Parameters
| Type | Name | Description |
|---|---|---|
| float | coord | The coordinate to check |
| int | canvasMeasurement | The size of parent IAnnotationSurface |
Returns
| Type | Description |
|---|---|
| boolean | True if coordinate is valid |
isInBounds(AnnotationCoordinates coordinates, IAnnotationSurface annotationsSurface)
Declaration
public boolean isInBounds(AnnotationCoordinates coordinates, IAnnotationSurface annotationsSurface)
Parameters
| Type | Name | Description |
|---|---|---|
| AnnotationCoordinates | coordinates | |
| IAnnotationSurface | annotationsSurface |
Returns
| Type | Description |
|---|---|
| boolean |
moveAnnotationTo(AnnotationCoordinates coordinates, float horizontalOffset, float verticalOffset, IAnnotationSurface annotationSurface)
Declaration
public void moveAnnotationTo(AnnotationCoordinates coordinates, float horizontalOffset, float verticalOffset, IAnnotationSurface annotationSurface)
Parameters
| Type | Name | Description |
|---|---|---|
| AnnotationCoordinates | coordinates | |
| float | horizontalOffset | |
| float | verticalOffset | |
| IAnnotationSurface | annotationSurface |
moveBasePointTo(float xCoord, float yCoord, int index)
Declaration
public void moveBasePointTo(float xCoord, float yCoord, int index)
Parameters
| Type | Name | Description |
|---|---|---|
| float | xCoord | |
| float | yCoord | |
| int | index |
selectAdornerActionForPoint(float x, float y, IAdornerLayer relativeTo)
Declaration
public IAnnotationAdornerAction selectAdornerActionForPoint(float x, float y, IAdornerLayer relativeTo)
Parameters
| Type | Name | Description |
|---|---|---|
| float | x | |
| float | y | |
| IAdornerLayer | relativeTo |
Returns
| Type | Description |
|---|---|
| IAnnotationAdornerAction |
updateSelectionOverlay(Path selectionPath, AnnotationCoordinates annotationCoordinates)
Updates the shape of selection overlay for parent AnnotationBase
Declaration
protected void updateSelectionOverlay(Path selectionPath, AnnotationCoordinates annotationCoordinates)
Parameters
| Type | Name | Description |
|---|---|---|
| android.graphics.Path | selectionPath | The Path instance to update |
| AnnotationCoordinates | annotationCoordinates | The annotation coordinates |