LibreOffice Module android (master) 1
Classes | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
org.libreoffice.canvas.GraphicSelection Class Reference

This class is responsible to draw and reposition the selection rectangle. More...

Inheritance diagram for org.libreoffice.canvas.GraphicSelection:
[legend]
Collaboration diagram for org.libreoffice.canvas.GraphicSelection:
[legend]

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
 

Detailed Description

This class is responsible to draw and reposition the selection rectangle.

Definition at line 27 of file GraphicSelection.java.

Constructor & Destructor Documentation

◆ GraphicSelection()

org.libreoffice.canvas.GraphicSelection.GraphicSelection ( LibreOfficeMainActivity  context)
inline

Member Function Documentation

◆ adaptDrawRectangle()

void org.libreoffice.canvas.GraphicSelection.adaptDrawRectangle ( float  x,
float  y 
)
inlineprivate

◆ dragEnd()

void org.libreoffice.canvas.GraphicSelection.dragEnd ( PointF  position)
inline

◆ dragging()

void org.libreoffice.canvas.GraphicSelection.dragging ( PointF  position)
inline

◆ dragStart()

void org.libreoffice.canvas.GraphicSelection.dragStart ( PointF  position)
inline

◆ onDraw()

void org.libreoffice.canvas.GraphicSelection.onDraw ( Canvas  canvas)
inline

◆ onHitTest()

boolean org.libreoffice.canvas.GraphicSelection.onHitTest ( float  x,
float  y 
)
inline

Hit test for the selection.

See also
org.libreoffice.canvas.CanvasElement::draw(android.graphics.Canvas)

Definition at line 94 of file GraphicSelection.java.

References org.libreoffice.canvas.GraphicSelection.mHandles, org.libreoffice.canvas.GraphicSelection.mScaledRectangle, x, and y.

◆ onSinglePress()

void org.libreoffice.canvas.GraphicSelection.onSinglePress ( PointF  screenPosition)
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().

◆ reposition()

void org.libreoffice.canvas.GraphicSelection.reposition ( RectF  scaledRectangle)
inline

Viewport has changed, reposition the selection to the new rectangle.

Parameters
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().

◆ reset()

void org.libreoffice.canvas.GraphicSelection.reset ( )
inline

◆ sendGraphicSelection()

void org.libreoffice.canvas.GraphicSelection.sendGraphicSelection ( String  type,
PointF  screenPosition 
)
inlineprivate

◆ sendGraphicSelectionEnd()

void org.libreoffice.canvas.GraphicSelection.sendGraphicSelectionEnd ( PointF  screenPosition)
inlineprivate

Send graphic selection end event to LOKitTread.

Parameters
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().

◆ sendGraphicSelectionStart()

void org.libreoffice.canvas.GraphicSelection.sendGraphicSelectionStart ( PointF  screenPosition)
inlineprivate

Send graphic selection start event to LOKitTread.

Parameters
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().

◆ setVisible()

void org.libreoffice.canvas.GraphicSelection.setVisible ( boolean  visible)
inline

Member Data Documentation

◆ mContext

LibreOfficeMainActivity org.libreoffice.canvas.GraphicSelection.mContext
private

◆ mDragHandle

GraphicSelectionHandle org.libreoffice.canvas.GraphicSelection.mDragHandle = null
private

◆ mDrawRectangle

RectF org.libreoffice.canvas.GraphicSelection.mDrawRectangle = new RectF()
private

◆ mHandles

GraphicSelectionHandle org.libreoffice.canvas.GraphicSelection.mHandles[] = new GraphicSelectionHandle[8]
private

◆ mPaintFill

final Paint org.libreoffice.canvas.GraphicSelection.mPaintFill
private

◆ mPaintStroke

final Paint org.libreoffice.canvas.GraphicSelection.mPaintStroke
private

◆ mRectangle

RectF org.libreoffice.canvas.GraphicSelection.mRectangle = new RectF()

◆ mScaledRectangle

RectF org.libreoffice.canvas.GraphicSelection.mScaledRectangle = new RectF()

◆ mStartDragPosition

PointF org.libreoffice.canvas.GraphicSelection.mStartDragPosition
private

◆ mTriggerSinglePress

boolean org.libreoffice.canvas.GraphicSelection.mTriggerSinglePress = false
private

◆ mType

DragType org.libreoffice.canvas.GraphicSelection.mType = DragType.NONE
private

The documentation for this class was generated from the following file: