App
Public Member Functions | List of all members
mhr.app.touchlisteners.BrushToolTouchListener Class Reference

Posluchač událostí plátna, který posílá příkazy pro bruhs-like tool. More...

Inheritance diagram for mhr.app.touchlisteners.BrushToolTouchListener:

Public Member Functions

 BrushToolTouchListener (AppMainActivity activity)
 
boolean onTouch (View v, MotionEvent e)
 

Detailed Description

Posluchač událostí plátna, který posílá příkazy pro bruhs-like tool.

Definition at line 15 of file BrushToolTouchListener.java.

Constructor & Destructor Documentation

mhr.app.touchlisteners.BrushToolTouchListener.BrushToolTouchListener ( AppMainActivity  activity)
inline

Definition at line 19 of file BrushToolTouchListener.java.

{
this.activity = activity;
}

Member Function Documentation

boolean mhr.app.touchlisteners.BrushToolTouchListener.onTouch ( View  v,
MotionEvent  e 
)
inline

Definition at line 24 of file BrushToolTouchListener.java.

{
int action = e.getAction();
int x = activity.getBitmapDisplayer().translateCoordX(e.getX());
int y = activity.getBitmapDisplayer().translateCoordY(e.getY());
AppCommand command = null;
switch (action) {
case MotionEvent.ACTION_DOWN:
command = new DrawBgnCommand(x, y);
break;
case MotionEvent.ACTION_MOVE:
command = new DrawToCommand(x, y);
break;
case MotionEvent.ACTION_UP:
command = new DrawEndCommand(x, y);
break;
}
activity.addCommand(command);
return true;
}

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