LibreOffice Module android (master) 1
|
This class is responsible to draw and reposition the selection rectangle. More...
Classes | |
enum | DragType |
Type of the selection dragging. More... | |
Public Member Functions | |
GraphicSelection (LibreOfficeMainActivity context) | |
Construct the graphic selection. More... | |
void | reposition (RectF scaledRectangle) |
Viewport has changed, reposition the selection to the new rectangle. More... | |
boolean | onHitTest (float x, float y) |
Hit test for the selection. More... | |
void | onDraw (Canvas canvas) |
Draw the selection on the canvas. More... | |
void | dragStart (PointF position) |
Dragging on the screen has started. More... | |
void | dragging (PointF position) |
Dragging is in process. More... | |
void | dragEnd (PointF position) |
Dragging has ended. More... | |
void | setVisible (boolean visible) |
Set the visibility of the graphic selection. More... | |
void | reset () |
Reset the selection. 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 | |
RectF | mRectangle = new RectF() |
RectF | mScaledRectangle = new RectF() |
Private Member Functions | |
void | adaptDrawRectangle (float x, float y) |
Adapt the selection depending on which handle was dragged. More... | |
void | sendGraphicSelectionStart (PointF screenPosition) |
Send graphic selection start event to LOKitTread. More... | |
void | sendGraphicSelectionEnd (PointF screenPosition) |
Send graphic selection end event to LOKitTread. More... | |
void | sendGraphicSelection (String type, PointF screenPosition) |
Send graphic selection event to LOKitTread. More... | |
void | onSinglePress (PointF screenPosition) |
When a single press (no dragging happened) was performed. More... | |
Private Attributes | |
final Paint | mPaintStroke |
final Paint | mPaintFill |
RectF | mDrawRectangle = new RectF() |
DragType | mType = DragType.NONE |
PointF | mStartDragPosition |
GraphicSelectionHandle | mHandles [] = new GraphicSelectionHandle[8] |
GraphicSelectionHandle | mDragHandle = null |
boolean | mTriggerSinglePress = false |
LibreOfficeMainActivity | mContext |
This class is responsible to draw and reposition the selection rectangle.
Definition at line 27 of file GraphicSelection.java.
|
inline |
Construct the graphic selection.
Definition at line 44 of file GraphicSelection.java.
References org.libreoffice.canvas.GraphicSelectionHandle.HandlePosition.BOTTOM, org.libreoffice.canvas.GraphicSelectionHandle.HandlePosition.BOTTOM_LEFT, org.libreoffice.canvas.GraphicSelectionHandle.HandlePosition.BOTTOM_RIGHT, Color, org.libreoffice.canvas.GraphicSelectionHandle.HandlePosition.LEFT, org.libreoffice.canvas.GraphicSelection.mContext, org.libreoffice.canvas.GraphicSelection.mHandles, org.libreoffice.canvas.GraphicSelection.mPaintFill, org.libreoffice.canvas.GraphicSelection.mPaintStroke, Paint, org.libreoffice.canvas.GraphicSelectionHandle.HandlePosition.RIGHT, org.libreoffice.canvas.GraphicSelectionHandle.HandlePosition.TOP, org.libreoffice.canvas.GraphicSelectionHandle.HandlePosition.TOP_LEFT, and org.libreoffice.canvas.GraphicSelectionHandle.HandlePosition.TOP_RIGHT.
|
inlineprivate |
Adapt the selection depending on which handle was dragged.
Definition at line 192 of file GraphicSelection.java.
References BOTTOM, BOTTOM_LEFT, BOTTOM_RIGHT, org.libreoffice.canvas.GraphicSelectionHandle.getHandlePosition(), LEFT, org.libreoffice.canvas.GraphicSelection.mDragHandle, org.libreoffice.canvas.GraphicSelection.mDrawRectangle, org.libreoffice.canvas.GraphicSelection.mScaledRectangle, RIGHT, TOP, TOP_LEFT, TOP_RIGHT, x, and y.
Referenced by org.libreoffice.canvas.GraphicSelection.dragging().
|
inline |
Dragging has ended.
position | - last position of the drag |
Definition at line 163 of file GraphicSelection.java.
References org.libreoffice.canvas.GraphicSelection.mDragHandle, org.libreoffice.canvas.GraphicSelection.mDrawRectangle, org.libreoffice.canvas.GraphicSelectionHandle.mPosition, org.libreoffice.canvas.GraphicSelection.mScaledRectangle, org.libreoffice.canvas.GraphicSelection.mStartDragPosition, org.libreoffice.canvas.GraphicSelection.mTriggerSinglePress, org.libreoffice.canvas.GraphicSelection.mType, org.libreoffice.canvas.GraphicSelection.DragType.NONE, org.libreoffice.canvas.GraphicSelection.onSinglePress(), point(), position(), org.libreoffice.canvas.GraphicSelectionHandle.reset(), and org.libreoffice.canvas.GraphicSelection.sendGraphicSelectionEnd().
Referenced by org.libreoffice.overlay.DocumentOverlayView.onTouch().
|
inline |
Dragging is in process.
position | - position of the drag |
Definition at line 146 of file GraphicSelection.java.
References org.libreoffice.canvas.GraphicSelection.adaptDrawRectangle(), org.libreoffice.canvas.GraphicSelection.DragType.EXTEND, org.libreoffice.canvas.GraphicSelection.mDrawRectangle, org.libreoffice.canvas.GraphicSelection.DragType.MOVE, org.libreoffice.canvas.GraphicSelection.mScaledRectangle, org.libreoffice.canvas.GraphicSelection.mStartDragPosition, org.libreoffice.canvas.GraphicSelection.mTriggerSinglePress, org.libreoffice.canvas.GraphicSelection.mType, and position().
Referenced by org.libreoffice.overlay.DocumentOverlayView.onTouch().
|
inline |
Dragging on the screen has started.
position | - position where the dragging started |
Definition at line 123 of file GraphicSelection.java.
References org.libreoffice.canvas.GraphicSelection.DragType.EXTEND, org.libreoffice.canvas.GraphicSelection.mDragHandle, org.libreoffice.canvas.GraphicSelection.mHandles, org.libreoffice.canvas.GraphicSelection.DragType.MOVE, org.libreoffice.canvas.GraphicSelection.mStartDragPosition, org.libreoffice.canvas.GraphicSelection.mTriggerSinglePress, org.libreoffice.canvas.GraphicSelection.mType, org.libreoffice.canvas.GraphicSelection.DragType.NONE, position(), org.libreoffice.canvas.GraphicSelectionHandle.select(), and org.libreoffice.canvas.GraphicSelection.sendGraphicSelectionStart().
Referenced by org.libreoffice.overlay.DocumentOverlayView.onTouch().
|
inline |
Draw the selection on the canvas.
Definition at line 109 of file GraphicSelection.java.
References org.libreoffice.canvas.GraphicSelection.mDrawRectangle, org.libreoffice.canvas.GraphicSelection.mHandles, org.libreoffice.canvas.GraphicSelection.mPaintFill, org.libreoffice.canvas.GraphicSelection.mPaintStroke, org.libreoffice.canvas.GraphicSelection.mType, and org.libreoffice.canvas.GraphicSelection.DragType.NONE.
|
inline |
Hit test for the selection.
Definition at line 94 of file GraphicSelection.java.
References org.libreoffice.canvas.GraphicSelection.mHandles, org.libreoffice.canvas.GraphicSelection.mScaledRectangle, x, and y.
|
inlineprivate |
When a single press (no dragging happened) was performed.
Definition at line 261 of file GraphicSelection.java.
References org.libreoffice.canvas.GraphicSelection.sendGraphicSelection().
Referenced by org.libreoffice.canvas.GraphicSelection.dragEnd().
|
inline |
Viewport has changed, reposition the selection to the new rectangle.
scaledRectangle | - rectangle of selection position on the document |
Definition at line 74 of file GraphicSelection.java.
References org.libreoffice.canvas.GraphicSelection.mDrawRectangle, org.libreoffice.canvas.GraphicSelection.mHandles, org.libreoffice.canvas.GraphicSelection.mScaledRectangle, and org.libreoffice.canvas.GraphicSelectionHandle.reposition().
Referenced by org.libreoffice.overlay.DocumentOverlayView.repositionWithViewport().
|
inline |
Reset the selection.
Definition at line 279 of file GraphicSelection.java.
References org.libreoffice.canvas.GraphicSelection.mDragHandle, org.libreoffice.canvas.GraphicSelection.mHandles, and org.libreoffice.canvas.GraphicSelectionHandle.reset().
Referenced by org.libreoffice.overlay.DocumentOverlayView.showGraphicSelection().
|
inlineprivate |
Send graphic selection event to LOKitTread.
type | - type of the graphic selection |
screenPosition | - screen position of the selection |
Definition at line 247 of file GraphicSelection.java.
References org.mozilla.gecko.gfx.GeckoLayerClient.convertViewPointToLayerPoint(), org.libreoffice.LibreOfficeMainActivity.getLayerClient(), org.mozilla.gecko.gfx.LayerView.getLayerClient(), org.mozilla.gecko.gfx.GeckoLayerClient.getView(), org.libreoffice.canvas.GraphicSelection.mContext, org.libreoffice.LOKitShell.sendTouchEvent(), and type.
Referenced by org.libreoffice.canvas.GraphicSelection.onSinglePress(), org.libreoffice.canvas.GraphicSelection.sendGraphicSelectionEnd(), and org.libreoffice.canvas.GraphicSelection.sendGraphicSelectionStart().
|
inlineprivate |
Send graphic selection end event to LOKitTread.
screenPosition | - screen position of the selection |
Definition at line 238 of file GraphicSelection.java.
References org.libreoffice.canvas.GraphicSelection.sendGraphicSelection().
Referenced by org.libreoffice.canvas.GraphicSelection.dragEnd().
|
inlineprivate |
Send graphic selection start event to LOKitTread.
screenPosition | - screen position of the selection |
Definition at line 230 of file GraphicSelection.java.
References org.libreoffice.canvas.GraphicSelection.sendGraphicSelection().
Referenced by org.libreoffice.canvas.GraphicSelection.dragStart().
|
inline |
Set the visibility of the graphic selection.
Reimplemented from org.libreoffice.canvas.CommonCanvasElement.
Definition at line 269 of file GraphicSelection.java.
References org.libreoffice.canvas.GraphicSelection.mHandles, and visible.
Referenced by org.libreoffice.overlay.DocumentOverlayView.hideGraphicSelection(), org.libreoffice.overlay.DocumentOverlayView.initialize(), and org.libreoffice.overlay.DocumentOverlayView.showGraphicSelection().
|
private |
Definition at line 39 of file GraphicSelection.java.
Referenced by org.libreoffice.canvas.GraphicSelection.GraphicSelection(), and org.libreoffice.canvas.GraphicSelection.sendGraphicSelection().
|
private |
|
private |
Definition at line 32 of file GraphicSelection.java.
Referenced by org.libreoffice.canvas.GraphicSelection.adaptDrawRectangle(), org.libreoffice.canvas.GraphicSelection.dragEnd(), org.libreoffice.canvas.GraphicSelection.dragging(), org.libreoffice.canvas.GraphicSelection.onDraw(), and org.libreoffice.canvas.GraphicSelection.reposition().
|
private |
Definition at line 36 of file GraphicSelection.java.
Referenced by org.libreoffice.canvas.GraphicSelection.dragStart(), org.libreoffice.canvas.GraphicSelection.GraphicSelection(), org.libreoffice.canvas.GraphicSelection.onDraw(), org.libreoffice.canvas.GraphicSelection.onHitTest(), org.libreoffice.canvas.GraphicSelection.reposition(), org.libreoffice.canvas.GraphicSelection.reset(), and org.libreoffice.canvas.GraphicSelection.setVisible().
|
private |
Definition at line 29 of file GraphicSelection.java.
Referenced by org.libreoffice.canvas.GraphicSelection.GraphicSelection(), and org.libreoffice.canvas.GraphicSelection.onDraw().
|
private |
Definition at line 28 of file GraphicSelection.java.
Referenced by org.libreoffice.canvas.GraphicSelection.GraphicSelection(), and org.libreoffice.canvas.GraphicSelection.onDraw().
RectF org.libreoffice.canvas.GraphicSelection.mRectangle = new RectF() |
Definition at line 30 of file GraphicSelection.java.
Referenced by org.libreoffice.overlay.DocumentOverlayView.changeGraphicSelection(), and org.libreoffice.overlay.DocumentOverlayView.repositionWithViewport().
RectF org.libreoffice.canvas.GraphicSelection.mScaledRectangle = new RectF() |
Definition at line 31 of file GraphicSelection.java.
Referenced by org.libreoffice.canvas.GraphicSelection.adaptDrawRectangle(), org.libreoffice.canvas.GraphicSelection.dragEnd(), org.libreoffice.canvas.GraphicSelection.dragging(), org.libreoffice.canvas.GraphicSelection.onHitTest(), and org.libreoffice.canvas.GraphicSelection.reposition().
|
private |
Definition at line 34 of file GraphicSelection.java.
Referenced by org.libreoffice.canvas.GraphicSelection.dragEnd(), org.libreoffice.canvas.GraphicSelection.dragging(), and org.libreoffice.canvas.GraphicSelection.dragStart().
|
private |
Definition at line 38 of file GraphicSelection.java.
Referenced by org.libreoffice.canvas.GraphicSelection.dragEnd(), org.libreoffice.canvas.GraphicSelection.dragging(), and org.libreoffice.canvas.GraphicSelection.dragStart().
|
private |