App

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
mhr.app.fragments.toolbox.AlphaBrushToolSettingsFragment Class Reference

Fragment pro nastavení nástroje AlphaBrush. More...

Inheritance diagram for mhr.app.fragments.toolbox.AlphaBrushToolSettingsFragment:

## Public Member Functions
void | onClick (View v)
void | onRoundBrushPickerEvent (RoundBrushPickerEvent e, RoundBrushPickerView v)
| Voláno v okamžiku, kdy dojde k události na pickeru.
void | onPathPickerEvent (PathPickerEvent e, PathPickerView v)
| Voláno v okamžiku, kdy dojde k události na pickeru.
void | onAttach (Activity activity)
View | onCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
void | onResume ()

## Protected Member Functions
View | initView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
| Provede inicializaci view.
void | setBrush ()
| Pošle jádru příkaz pro nastavení štětce na zvolený.

## Protected Attributes
View | root
AppMainActivity | activity
boolean | firstCreated = true
RoundBrushPickerView | brushPicker
PathPickerView | pathPicker
boolean | pathLivePreviewOn
Button | selectAlphaBrushToolBtn
Spinner | modePicker

## Detailed Description

Fragment pro nastavení nástroje AlphaBrush.

Definition at line 31 of file AlphaBrushToolSettingsFragment.java.

## Member Function Documentation

View mhr.app.fragments.toolbox.AlphaBrushToolSettingsFragment.initView | ( | LayoutInflater | inflater,
|  | ViewGroup | container,
|  | Bundle | savedInstanceState
| ) |  |
| inlineprotected

Provede inicializaci view.

Parameters

  inflater |
  container |
  savedInstanceState |

Returns

Definition at line 60 of file AlphaBrushToolSettingsFragment.java.

{
root = inflater.inflate(R.layout.fragment_alpha_brush_tool_settings, container, false);
modePicker = (Spinner) root.findViewById(R.id.AlphaBrushModeSp);
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(activity, R.array.AlphaModeNames, android.R.layout.simple_spinner_item);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
modePicker.setAdapter(adapter);
brushPicker = (RoundBrushPickerView) root.findViewById(R.id.AlphaBrushRoundBrushPicker);
brushPicker.setRoundBrushPickerListener(this);
pathPicker = (PathPickerView) root.findViewById(R.id.AlphaBrushPathPicker);
pathPicker.setPathPickerListener(this);
pathLivePreviewOn = pathPicker.isLivePreviewOn();
selectAlphaBrushToolBtn = (Button) root.findViewById(R.id.SelectAlphaBrushToolBtn);
selectAlphaBrushToolBtn.setOnClickListener(this);
firstCreated = false;
return root;
}

void mhr.app.fragments.toolbox.AlphaBrushToolSettingsFragment.onAttach | ( | Activity | activity | ) |
| inline

Definition at line 181 of file AlphaBrushToolSettingsFragment.java.

{
super.onAttach(activity);
/*
* called once the fragment is associated with its activity.
*/
this.activity = (AppMainActivity) activity;
}

void mhr.app.fragments.toolbox.AlphaBrushToolSettingsFragment.onClick | ( | View | v | ) |
| inline

Definition at line 108 of file AlphaBrushToolSettingsFragment.java.

{
int id = v.getId();
switch (id) {
case R.id.SelectAlphaBrushToolBtn:
setBrush();
}
}

View mhr.app.fragments.toolbox.AlphaBrushToolSettingsFragment.onCreateView | ( | LayoutInflater | inflater,
|  | ViewGroup | container,
|  | Bundle | savedInstanceState
| ) |  |
| inline

Definition at line 201 of file AlphaBrushToolSettingsFragment.java.

{
/*
* creates and returns the view hierarchy associated with the fragment.
*
* The system calls this when it's time for the fragment to draw its user interface for the first time. To draw a UI for your fragment, you must return a
* View from this method that is the root of your fragment's layout. You can return null if the fragment does not provide a UI.
*
* Zde začíná životní cyklus při návratu z backstacku
*/
if (firstCreated) {
firstCreated = false;
return initView(inflater, container, savedInstanceState);
} else {
return root;
}
}

void mhr.app.fragments.toolbox.AlphaBrushToolSettingsFragment.onPathPickerEvent | ( | PathPickerEvent | e,
|  | PathPickerView | v
| ) |  |
| inline

Voláno v okamžiku, kdy dojde k události na pickeru.

Parameters

  e |
  v |

Implements mhr.appandroid.views.pathpicker.PathPickerView.PathPickerViewEventListener.

Definition at line 158 of file AlphaBrushToolSettingsFragment.java.

{
switch (e) {
case EVENT_SELECTED:
setBrush();
break;
case EVENT_LIVE_PREVIEW_STATE_CHANGED:
pathLivePreviewOn = v.isLivePreviewOn();
if (pathLivePreviewOn) {
NBitmap tmp = brushPicker.getNewBrush();
pathPicker.setBrush(tmp);
tmp.dispose();
}
break;
default:
break;
}
}

void mhr.app.fragments.toolbox.AlphaBrushToolSettingsFragment.onResume | ( |  | ) |
| inline

Definition at line 243 of file AlphaBrushToolSettingsFragment.java.

{
super.onResume();
/*
* makes the fragment interacting with the user (based on its containing activity being resumed).
*/
NBitmap brush = brushPicker.getNewBrush();
pathPicker.setBrush(brush);
brush.dispose();
setBrush();
// PathParams pp = pathPicker.getNewPathParams();
// activity.app.addCommand(new SelectToolCommand(new AlphaBrush(brushPicker.getNewBrush(), BrushMode.MODE_ADD, pp.opacity / 100.0, pp.flow / 100.0, brushPicker.getSize()
// * pp.spacing / 100.0)));
activity.setCanvasOnTouchListener(new BrushToolTouchListener(activity));
}

void mhr.app.fragments.toolbox.AlphaBrushToolSettingsFragment.onRoundBrushPickerEvent | ( | RoundBrushPickerEvent | e,
|  | RoundBrushPickerView | v
| ) |  |
| inline

Voláno v okamžiku, kdy dojde k události na pickeru.

Parameters

  e |
  v |

Implements mhr.appandroid.views.brushpicker.RoundBrushPickerView.RoundBrushPickerViewEventListener.

Definition at line 117 of file AlphaBrushToolSettingsFragment.java.

{
switch (e) {
case EVENT_SELECTED:
if (!pathLivePreviewOn) {
NBitmap tmp = v.getNewBrush();
pathPicker.setBrush(tmp);
tmp.dispose();
}
setBrush();
break;
case EVENT_CANCELED:
if (!pathLivePreviewOn) {
NBitmap tmp = v.getNewBrush();
pathPicker.setBrush(tmp);
tmp.dispose();
}
break;
case EVENT_CHANGED:
if (pathLivePreviewOn) {
NBitmap tmp = v.getNewBrush();
pathPicker.setBrush(tmp);
tmp.dispose();
}
break;
case EVENT_LIVE_PREVIEW_STATE_CHANGED:
break;
default:
break;
}
}

void mhr.app.fragments.toolbox.AlphaBrushToolSettingsFragment.setBrush | ( |  | ) |
| inlineprotected

Pošle jádru příkaz pro nastavení štětce na zvolený.

Definition at line 89 of file AlphaBrushToolSettingsFragment.java.

{
BrushMode mode = null;
switch (modePicker.getSelectedItemPosition()) {
case 0:
mode = BrushMode.MODE_ADD;
break;
case 1:
mode = BrushMode.MODE_REMOVE;
break;
}
PathParams pp = pathPicker.getNewPathParams();
activity.addCommand(new SelectToolCommand(new AlphaBrush(brushPicker.getNewBrush(), mode, pp.opacity / 100.0, pp.flow / 100.0, brushPicker.getSize() * pp.spacing
/ 100.0)));
}

## Member Data Documentation

AppMainActivity mhr.app.fragments.toolbox.AlphaBrushToolSettingsFragment.activity
| protected

Definition at line 40 of file AlphaBrushToolSettingsFragment.java.

RoundBrushPickerView mhr.app.fragments.toolbox.AlphaBrushToolSettingsFragment.brushPicker
| protected

Definition at line 43 of file AlphaBrushToolSettingsFragment.java.

boolean mhr.app.fragments.toolbox.AlphaBrushToolSettingsFragment.firstCreated = true
| protected

Definition at line 41 of file AlphaBrushToolSettingsFragment.java.

Spinner mhr.app.fragments.toolbox.AlphaBrushToolSettingsFragment.modePicker
| protected

Definition at line 47 of file AlphaBrushToolSettingsFragment.java.

boolean mhr.app.fragments.toolbox.AlphaBrushToolSettingsFragment.pathLivePreviewOn
| protected

Definition at line 45 of file AlphaBrushToolSettingsFragment.java.

PathPickerView mhr.app.fragments.toolbox.AlphaBrushToolSettingsFragment.pathPicker
| protected

Definition at line 44 of file AlphaBrushToolSettingsFragment.java.

View mhr.app.fragments.toolbox.AlphaBrushToolSettingsFragment.root
| protected

Definition at line 39 of file AlphaBrushToolSettingsFragment.java.

Button mhr.app.fragments.toolbox.AlphaBrushToolSettingsFragment.selectAlphaBrushToolBtn
| protected

Definition at line 46 of file AlphaBrushToolSettingsFragment.java.

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

- /home/xxx/eclipse_workspaces/app/app/src/mhr/app/fragments/toolbox/AlphaBrushToolSettingsFragment.java