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

Třída pro fragment nastavení nástroje štětce. More...

Inheritance diagram for mhr.app.fragments.toolbox.BrushToolSettingsFragment:
mhr.appandroid.views.brushpicker.RoundBrushPickerView.RoundBrushPickerViewEventListener mhr.appandroid.views.pathpicker.PathPickerView.PathPickerViewEventListener mhr.appandroid.views.colorpicker.ColorPickerView.OnColorSelectedListener

Public Member Functions

void onClick (View v)
 
void onColorSelected (ColorPickerView v)
 Voláno, když uživatel potvrdí výběr barvy.
 
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 potřebnou v onCreateView()
 
void setBrush ()
 Pošle jádru příkaz na nastavení aktuálního štětce.
 

Protected Attributes

View root
 
AppMainActivity activity
 
ColorPickerView clrPicker
 
RoundBrushPickerView brushPicker
 
PathPickerView pathPicker
 
boolean pathLivePreviewOn
 
Button selectBrushToolBtn
 
Spinner blendModePicker
 
boolean firstCreated = true
 

Detailed Description

Třída pro fragment nastavení nástroje štětce.

Definition at line 34 of file BrushToolSettingsFragment.java.

Member Function Documentation

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

Provede inicializaci potřebnou v onCreateView()

Parameters
inflater
container
savedInstanceState
Returns

Definition at line 64 of file BrushToolSettingsFragment.java.

{
View v = inflater.inflate(R.layout.fragment_brush_tool_settings, container, false);
root = v;
blendModePicker = (Spinner) root.findViewById(R.id.BrushBlendModeSp);
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(activity, R.array.BlendModeNames, android.R.layout.simple_spinner_item);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
blendModePicker.setAdapter(adapter);
clrPicker = (ColorPickerView) root.findViewById(R.id.BrushColorPicker);
brushPicker = (RoundBrushPickerView) root.findViewById(R.id.BrushRoundBrushPicker);
pathPicker = (PathPickerView) root.findViewById(R.id.BrushPathPicker);
selectBrushToolBtn = (Button) root.findViewById(R.id.SelectBrushToolBtn);
selectBrushToolBtn.setOnClickListener(this);
firstCreated = false;
return root;
}
void mhr.app.fragments.toolbox.BrushToolSettingsFragment.onAttach ( Activity  activity)
inline

Definition at line 188 of file BrushToolSettingsFragment.java.

{
super.onAttach(activity);
/*
* called once the fragment is associated with its activity.
*/
this.activity = (AppMainActivity) activity;
}
void mhr.app.fragments.toolbox.BrushToolSettingsFragment.onClick ( View  v)
inline

Definition at line 106 of file BrushToolSettingsFragment.java.

{
int id = v.getId();
switch (id) {
case R.id.SelectBrushToolBtn:
PathParams pp = pathPicker.getNewPathParams();
activity.addCommand(new SelectToolCommand(new Brush(brushPicker.getNewBrush(), BlendMode.fromValue(blendModePicker.getSelectedItemPosition()), pp.opacity / 100.0,
pp.flow / 100.0, clrPicker.getNativeNewColor(), brushPicker.getSize() * pp.spacing / 100.0)));
break;
}
}
void mhr.app.fragments.toolbox.BrushToolSettingsFragment.onColorSelected ( ColorPickerView  v)
inline

Voláno, když uživatel potvrdí výběr barvy.

Parameters
vPicker, který způsobil událost.

Implements mhr.appandroid.views.colorpicker.ColorPickerView.OnColorSelectedListener.

Definition at line 118 of file BrushToolSettingsFragment.java.

{
PathParams pp = pathPicker.getNewPathParams();
activity.addCommand(new SelectToolCommand(new Brush(brushPicker.getNewBrush(), BlendMode.fromValue(blendModePicker.getSelectedItemPosition()), pp.opacity / 100.0,
pp.flow / 100.0, clrPicker.getNativeNewColor(), brushPicker.getSize() * pp.spacing / 100.0)));
}
View mhr.app.fragments.toolbox.BrushToolSettingsFragment.onCreateView ( LayoutInflater  inflater,
ViewGroup  container,
Bundle  savedInstanceState 
)
inline

Definition at line 208 of file BrushToolSettingsFragment.java.

{
//return super.onCreateView(inflater, container, savedInstanceState);
/*
* 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.BrushToolSettingsFragment.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 165 of file BrushToolSettingsFragment.java.

{
switch (e) {
case EVENT_SELECTED:
break;
case EVENT_LIVE_PREVIEW_STATE_CHANGED:
pathLivePreviewOn = v.isLivePreviewOn();
NBitmap tmp = brushPicker.getNewBrush();
tmp.dispose();
}
break;
default:
break;
}
}
void mhr.app.fragments.toolbox.BrushToolSettingsFragment.onResume ( )
inline

Definition at line 251 of file BrushToolSettingsFragment.java.

{
super.onResume();
/*
* makes the fragment interacting with the user (based on its containing activity being resumed).
*/
NBitmap brush = brushPicker.getNewBrush();
PathParams pp = pathPicker.getNewPathParams();
activity.addCommand(new SelectToolCommand(new Brush(brush, BlendMode.fromValue(blendModePicker.getSelectedItemPosition()), pp.opacity / 100.0, pp.flow / 100.0,
clrPicker.getNativeNewColor(), brushPicker.getSize() * pp.spacing / 100.0)));
activity.setCanvasOnTouchListener(new BrushToolTouchListener(activity));
}
void mhr.app.fragments.toolbox.BrushToolSettingsFragment.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 125 of file BrushToolSettingsFragment.java.

{
switch (e) {
case EVENT_SELECTED:
NBitmap tmp = v.getNewBrush();
tmp.dispose();
}
break;
case EVENT_CANCELED:
NBitmap tmp = v.getNewBrush();
tmp.dispose();
}
break;
case EVENT_CHANGED:
NBitmap tmp = v.getNewBrush();
tmp.dispose();
}
break;
case EVENT_LIVE_PREVIEW_STATE_CHANGED:
break;
default:
break;
}
}
void mhr.app.fragments.toolbox.BrushToolSettingsFragment.setBrush ( )
inlineprotected

Pošle jádru příkaz na nastavení aktuálního štětce.

Definition at line 96 of file BrushToolSettingsFragment.java.

{
PathParams pp = pathPicker.getNewPathParams();
activity.addCommand(new SelectToolCommand(new Brush(brushPicker.getNewBrush(), BlendMode.fromValue(blendModePicker.getSelectedItemPosition()), pp.opacity / 100.0,
pp.flow / 100.0, clrPicker.getNativeNewColor(), brushPicker.getSize() * pp.spacing / 100.0)));
}

Member Data Documentation

AppMainActivity mhr.app.fragments.toolbox.BrushToolSettingsFragment.activity
protected

Definition at line 43 of file BrushToolSettingsFragment.java.

Spinner mhr.app.fragments.toolbox.BrushToolSettingsFragment.blendModePicker
protected

Definition at line 50 of file BrushToolSettingsFragment.java.

RoundBrushPickerView mhr.app.fragments.toolbox.BrushToolSettingsFragment.brushPicker
protected

Definition at line 46 of file BrushToolSettingsFragment.java.

ColorPickerView mhr.app.fragments.toolbox.BrushToolSettingsFragment.clrPicker
protected

Definition at line 45 of file BrushToolSettingsFragment.java.

boolean mhr.app.fragments.toolbox.BrushToolSettingsFragment.firstCreated = true
protected

Definition at line 51 of file BrushToolSettingsFragment.java.

boolean mhr.app.fragments.toolbox.BrushToolSettingsFragment.pathLivePreviewOn
protected

Definition at line 48 of file BrushToolSettingsFragment.java.

PathPickerView mhr.app.fragments.toolbox.BrushToolSettingsFragment.pathPicker
protected

Definition at line 47 of file BrushToolSettingsFragment.java.

View mhr.app.fragments.toolbox.BrushToolSettingsFragment.root
protected

Definition at line 42 of file BrushToolSettingsFragment.java.

Button mhr.app.fragments.toolbox.BrushToolSettingsFragment.selectBrushToolBtn
protected

Definition at line 49 of file BrushToolSettingsFragment.java.


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