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

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...

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

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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ GraphicSelectionHandle()

org.libreoffice.canvas.GraphicSelectionHandle.GraphicSelectionHandle ( HandlePosition  position)
inline

Member Function Documentation

◆ drawFilledCircle()

void org.libreoffice.canvas.GraphicSelectionHandle.drawFilledCircle ( Canvas  canvas,
float  x,
float  y,
float  radius,
Paint  strokePaint,
Paint  fillPaint 
)
inlineprivate

Draw a filled and stroked circle to the canvas.

Definition at line 85 of file GraphicSelectionHandle.java.

References x, and y.

Referenced by org.libreoffice.canvas.GraphicSelectionHandle.onDraw().

◆ getHandlePosition()

HandlePosition org.libreoffice.canvas.GraphicSelectionHandle.getHandlePosition ( )
inline

◆ onDraw()

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

◆ onHitTest()

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

Hit test for the handle.

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

Definition at line 112 of file GraphicSelectionHandle.java.

References org.libreoffice.canvas.GraphicSelectionHandle.mHitRect, x, and y.

◆ reposition()

void org.libreoffice.canvas.GraphicSelectionHandle.reposition ( float  x,
float  y 
)
inline

◆ reset()

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

◆ select()

void org.libreoffice.canvas.GraphicSelectionHandle.select ( )
inline

Member Data Documentation

◆ HIT_AREA_INFLATE_FACTOR

final float org.libreoffice.canvas.GraphicSelectionHandle.HIT_AREA_INFLATE_FACTOR = 1.75f
private

The factor used to inflate the hit area.

Definition at line 26 of file GraphicSelectionHandle.java.

Referenced by org.libreoffice.canvas.GraphicSelectionHandle.reposition().

◆ mFillPaint

Paint org.libreoffice.canvas.GraphicSelectionHandle.mFillPaint = new Paint()
private

◆ mHandlePosition

final HandlePosition org.libreoffice.canvas.GraphicSelectionHandle.mHandlePosition
private

◆ mHitRect

RectF org.libreoffice.canvas.GraphicSelectionHandle.mHitRect = new RectF()
private

◆ mPosition

PointF org.libreoffice.canvas.GraphicSelectionHandle.mPosition = new PointF()

◆ mRadius

float org.libreoffice.canvas.GraphicSelectionHandle.mRadius = 20.0f
private

◆ mSelected

boolean org.libreoffice.canvas.GraphicSelectionHandle.mSelected = false
private

◆ mSelectedFillPaint

Paint org.libreoffice.canvas.GraphicSelectionHandle.mSelectedFillPaint = new Paint()
private

◆ mStrokePaint

Paint org.libreoffice.canvas.GraphicSelectionHandle.mStrokePaint = new Paint()
private

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