LibreOffice Module android (master) 1
|
This class is responsible to draw the selection handles, track the handle position and perform a hit test to determine if the selection handle was touched. More...
Classes | |
enum | HandlePosition |
All possible handle positions. More... | |
Public Member Functions | |
GraphicSelectionHandle (HandlePosition position) | |
Construct the handle - set the handle position on the selection. More... | |
HandlePosition | getHandlePosition () |
The position of the handle. More... | |
void | onDraw (Canvas canvas) |
Draws the handle to the canvas. More... | |
void | reposition (float x, float y) |
Viewport has changed, reposition the handle to the input coordinates. More... | |
boolean | onHitTest (float x, float y) |
Hit test for the handle. More... | |
void | select () |
Mark the handle as selected. More... | |
void | reset () |
Reset the selection for the handle. More... | |
Public Member Functions inherited from org.libreoffice.canvas.CommonCanvasElement | |
boolean | isVisible () |
Is element visible? More... | |
void | setVisible (boolean visible) |
Set element visibility. More... | |
void | draw (Canvas canvas) |
Trigger drawing the element on the canvas. More... | |
boolean | contains (float x, float y) |
Hit test. More... | |
void | draw (Canvas canvas) |
Called when the element needs to be draw no the canvas. More... | |
boolean | contains (float x, float y) |
Hit test - returns true if the object has been hit. More... | |
boolean | isVisible () |
Return if element is visible. More... | |
void | setVisible (boolean visible) |
Set element visibility. More... | |
Public Attributes | |
PointF | mPosition = new PointF() |
Private Member Functions | |
void | drawFilledCircle (Canvas canvas, float x, float y, float radius, Paint strokePaint, Paint fillPaint) |
Draw a filled and stroked circle to the canvas. More... | |
Private Attributes | |
final float | HIT_AREA_INFLATE_FACTOR = 1.75f |
The factor used to inflate the hit area. More... | |
final HandlePosition | mHandlePosition |
float | mRadius = 20.0f |
Paint | mStrokePaint = new Paint() |
Paint | mFillPaint = new Paint() |
Paint | mSelectedFillPaint = new Paint() |
RectF | mHitRect = new RectF() |
boolean | mSelected = false |
This class is responsible to draw the selection handles, track the handle position and perform a hit test to determine if the selection handle was touched.
Definition at line 22 of file GraphicSelectionHandle.java.
|
inline |
Construct the handle - set the handle position on the selection.
position | - the handle position on the selection |
Definition at line 41 of file GraphicSelectionHandle.java.
References Color, org.libreoffice.canvas.GraphicSelectionHandle.mFillPaint, org.libreoffice.canvas.GraphicSelectionHandle.mHandlePosition, org.libreoffice.canvas.GraphicSelectionHandle.mSelectedFillPaint, org.libreoffice.canvas.GraphicSelectionHandle.mStrokePaint, Paint, and position().
|
inlineprivate |
Draw a filled and stroked circle to the canvas.
Definition at line 85 of file GraphicSelectionHandle.java.
Referenced by org.libreoffice.canvas.GraphicSelectionHandle.onDraw().
|
inline |
The position of the handle.
Definition at line 64 of file GraphicSelectionHandle.java.
References org.libreoffice.canvas.GraphicSelectionHandle.mHandlePosition.
Referenced by org.libreoffice.canvas.GraphicSelection.adaptDrawRectangle().
|
inline |
Draws the handle to the canvas.
Definition at line 74 of file GraphicSelectionHandle.java.
References org.libreoffice.canvas.GraphicSelectionHandle.drawFilledCircle(), org.libreoffice.canvas.GraphicSelectionHandle.mFillPaint, org.libreoffice.canvas.GraphicSelectionHandle.mPosition, org.libreoffice.canvas.GraphicSelectionHandle.mRadius, org.libreoffice.canvas.GraphicSelectionHandle.mSelected, org.libreoffice.canvas.GraphicSelectionHandle.mSelectedFillPaint, and org.libreoffice.canvas.GraphicSelectionHandle.mStrokePaint.
|
inline |
Hit test for the handle.
Definition at line 112 of file GraphicSelectionHandle.java.
References org.libreoffice.canvas.GraphicSelectionHandle.mHitRect, x, and y.
|
inline |
Viewport has changed, reposition the handle to the input coordinates.
Definition at line 93 of file GraphicSelectionHandle.java.
References org.libreoffice.canvas.GraphicSelectionHandle.HIT_AREA_INFLATE_FACTOR, org.libreoffice.canvas.GraphicSelectionHandle.mHitRect, org.libreoffice.canvas.GraphicSelectionHandle.mPosition, org.libreoffice.canvas.GraphicSelectionHandle.mRadius, x, and y.
Referenced by org.libreoffice.canvas.GraphicSelection.reposition().
|
inline |
Reset the selection for the handle.
Definition at line 126 of file GraphicSelectionHandle.java.
References org.libreoffice.canvas.GraphicSelectionHandle.mSelected.
Referenced by org.libreoffice.canvas.GraphicSelection.dragEnd(), and org.libreoffice.canvas.GraphicSelection.reset().
|
inline |
Mark the handle as selected.
Definition at line 119 of file GraphicSelectionHandle.java.
References org.libreoffice.canvas.GraphicSelectionHandle.mSelected.
Referenced by org.libreoffice.canvas.GraphicSelection.dragStart().
|
private |
The factor used to inflate the hit area.
Definition at line 26 of file GraphicSelectionHandle.java.
Referenced by org.libreoffice.canvas.GraphicSelectionHandle.reposition().
|
private |
Definition at line 32 of file GraphicSelectionHandle.java.
Referenced by org.libreoffice.canvas.GraphicSelectionHandle.GraphicSelectionHandle(), and org.libreoffice.canvas.GraphicSelectionHandle.onDraw().
|
private |
Definition at line 28 of file GraphicSelectionHandle.java.
Referenced by org.libreoffice.canvas.GraphicSelectionHandle.getHandlePosition(), and org.libreoffice.canvas.GraphicSelectionHandle.GraphicSelectionHandle().
|
private |
Definition at line 34 of file GraphicSelectionHandle.java.
Referenced by org.libreoffice.canvas.GraphicSelectionHandle.onHitTest(), and org.libreoffice.canvas.GraphicSelectionHandle.reposition().
PointF org.libreoffice.canvas.GraphicSelectionHandle.mPosition = new PointF() |
Definition at line 29 of file GraphicSelectionHandle.java.
Referenced by org.libreoffice.canvas.GraphicSelection.dragEnd(), org.libreoffice.canvas.GraphicSelectionHandle.onDraw(), and org.libreoffice.canvas.GraphicSelectionHandle.reposition().
|
private |
Definition at line 30 of file GraphicSelectionHandle.java.
Referenced by org.libreoffice.canvas.GraphicSelectionHandle.onDraw(), and org.libreoffice.canvas.GraphicSelectionHandle.reposition().
|
private |
Definition at line 35 of file GraphicSelectionHandle.java.
Referenced by org.libreoffice.canvas.GraphicSelectionHandle.onDraw(), org.libreoffice.canvas.GraphicSelectionHandle.reset(), and org.libreoffice.canvas.GraphicSelectionHandle.select().
|
private |
Definition at line 33 of file GraphicSelectionHandle.java.
Referenced by org.libreoffice.canvas.GraphicSelectionHandle.GraphicSelectionHandle(), and org.libreoffice.canvas.GraphicSelectionHandle.onDraw().
|
private |
Definition at line 31 of file GraphicSelectionHandle.java.
Referenced by org.libreoffice.canvas.GraphicSelectionHandle.GraphicSelectionHandle(), and org.libreoffice.canvas.GraphicSelectionHandle.onDraw().