T
- The type of annotation to placeprotected abstract static class AnnotationBase.CartesianAnnotationPlacementStrategyBase<T extends AnnotationBase> extends AnnotationPlacementStrategyBase<T>
AnnotationBase
instanceModifier and Type | Field and Description |
---|---|
protected android.graphics.Path |
selectionPath |
annotation
Modifier | Constructor and Description |
---|---|
protected |
CartesianAnnotationPlacementStrategyBase(T annotation,
boolean clipAdornerToAnnotationSurface)
Creates a new instance of
AnnotationBase.CartesianAnnotationPlacementStrategyBase class |
Modifier and Type | Method and Description |
---|---|
protected IAnnotationAdornerAction |
createAdornerActionForAnnotationHit()
Creates
IAnnotationAdornerAction which is used in case of hit on annotation |
protected IAnnotationAdornerAction |
createAdornerActionForResizingGripWithIndex(int resizingGripIndex,
int resizingGripXOffset,
int resizingGripYOffset)
Creates
IAnnotationAdornerAction which is used in case of hit on annotation's resizing grip |
void |
drawAdorner(android.graphics.Canvas adornerCanvas)
Draws adorner on specified
Canvas |
protected void |
drawAdornerInternal(android.graphics.Canvas adornerCanvas,
AnnotationCoordinates annotationCoordinates)
Draws adorner for annotation on specified
Canvas |
protected void |
drawResizingGrips(android.graphics.Canvas canvas,
AnnotationCoordinates annotationCoordinates)
Draws resizing grips for parent annotation
|
protected void |
drawSelectionOverlayInternal(android.graphics.Canvas adornerCanvas,
AnnotationCoordinates annotationCoordinates)
Draws selection overlay for parent
AnnotationBase |
protected int |
getResizingGripHitIndex(float hitPointX,
float hitPointY,
AnnotationCoordinates annotationCoordinates)
Gets the index of
IResizingGrip for parent annotation at specified point on screen |
protected void |
internalMoveAnnotationTo(AnnotationCoordinates coordinates,
float horizontalOffset,
float verticalOffset,
IAnnotationSurface annotationSurface)
Moves parent annotation in X, Y direction with specified offset in pixels
|
protected boolean |
isCoordinateValid(float coord,
int canvasMeasurement)
Checks if specified coordinate if valid
|
boolean |
isInBounds(AnnotationCoordinates coordinates,
IAnnotationSurface annotationsSurface)
Checks whether coordinates are within canvas bounds
|
void |
moveAnnotationTo(AnnotationCoordinates coordinates,
float horizontalOffset,
float verticalOffset,
IAnnotationSurface annotationSurface)
Moves the annotation to a specific horizontal and vertical offset
|
void |
moveBasePointTo(float xCoord,
float yCoord,
int index)
Sets base point for annotation
|
IAnnotationAdornerAction |
selectAdornerActionForPoint(float x,
float y,
IAdornerLayer relativeTo)
Selects the
IAnnotationAdornerAction for specified point on IAdornerLayer |
protected void |
updateSelectionOverlay(android.graphics.Path selectionPath,
AnnotationCoordinates annotationCoordinates)
Updates the shape of selection overlay for parent
AnnotationBase |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
placeAnnotation
protected CartesianAnnotationPlacementStrategyBase(T annotation, boolean clipAdornerToAnnotationSurface)
AnnotationBase.CartesianAnnotationPlacementStrategyBase
classannotation
- The annotation to placeclipAdornerToAnnotationSurface
- If true adorner for annotation should be clipped to its parent IAnnotationSurface
public boolean isInBounds(AnnotationCoordinates coordinates, IAnnotationSurface annotationsSurface)
coordinates
- The annotation coordinatesannotationsSurface
- The parent annotation surfacepublic void moveBasePointTo(float xCoord, float yCoord, int index)
xCoord
- The x coordinate of base point in pixelsyCoord
- The y coordinate of base point in pixelsindex
- The index of base point to movepublic void moveAnnotationTo(AnnotationCoordinates coordinates, float horizontalOffset, float verticalOffset, IAnnotationSurface annotationSurface)
coordinates
- The annotation coordinateshorizontalOffset
- The horizontal offset in pixelsverticalOffset
- The vertical offset in pixelsannotationSurface
- The parent annotation surfaceprotected void internalMoveAnnotationTo(AnnotationCoordinates coordinates, float horizontalOffset, float verticalOffset, IAnnotationSurface annotationSurface)
coordinates
- The AnnotationCoordinates
instance associated with parent annotationhorizontalOffset
- The horizontal offset in pixelsverticalOffset
- The vertical offset in pixelsannotationSurface
- The parent IAnnotationSurface
protected final boolean isCoordinateValid(float coord, int canvasMeasurement)
coord
- The coordinate to checkcanvasMeasurement
- The size of parent IAnnotationSurface
public IAnnotationAdornerAction selectAdornerActionForPoint(float x, float y, IAdornerLayer relativeTo)
IAnnotationAdornerAction
for specified point on IAdornerLayer
x
- The x coordinate of point on the adorner layery
- The y coordinate of point on the adorner layerrelativeTo
- The adorner layerIAnnotationAdornerAction
if it is required for specified point, otherwise nullprotected int getResizingGripHitIndex(float hitPointX, float hitPointY, AnnotationCoordinates annotationCoordinates)
IResizingGrip
for parent annotation at specified point on screenhitPointX
- The x coordinate of hit test point in pixelshitPointY
- The y coordinate of hit test point in pixelsannotationCoordinates
- The AnnotationCoordinates
instance associated with parent annotationIResizingGrip
which lies below hit test point, otherwise returns -1 which indicates that there is not IResizingGrip
at specified hit test pointprotected IAnnotationAdornerAction createAdornerActionForResizingGripWithIndex(int resizingGripIndex, int resizingGripXOffset, int resizingGripYOffset)
IAnnotationAdornerAction
which is used in case of hit on annotation's resizing gripresizingGripIndex
- The index of resizing grip which was hitresizingGripXOffset
- The initial x offset for resizing gripresizingGripYOffset
- The initial y offset for resizing gripIAnnotationAdornerAction
instance to handle resizing grip hit with specified indexprotected IAnnotationAdornerAction createAdornerActionForAnnotationHit()
IAnnotationAdornerAction
which is used in case of hit on annotationIAnnotationAdornerAction
instance to handle annotation hitpublic final void drawAdorner(android.graphics.Canvas adornerCanvas)
Canvas
adornerCanvas
- The target Canvas
to draw adorner onprotected void drawAdornerInternal(android.graphics.Canvas adornerCanvas, AnnotationCoordinates annotationCoordinates)
Canvas
adornerCanvas
- The target Canvas
to draw adorner onannotationCoordinates
- The annotation coordinates of annotationprotected final void drawSelectionOverlayInternal(android.graphics.Canvas adornerCanvas, AnnotationCoordinates annotationCoordinates)
AnnotationBase
adornerCanvas
- The canvas to draw onannotationCoordinates
- The annotation coordinatesprotected void updateSelectionOverlay(android.graphics.Path selectionPath, AnnotationCoordinates annotationCoordinates)
AnnotationBase
selectionPath
- The Path
instance to updateannotationCoordinates
- The annotation coordinatesprotected void drawResizingGrips(android.graphics.Canvas canvas, AnnotationCoordinates annotationCoordinates)
canvas
- The Canvas
to draw resizing grips onannotationCoordinates
- The AnnotationCoordinates
instance associated with parent annotation