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

Fragment nastavení nástrojů pro aplikaci lokálních bodových operací More...

Inheritance diagram for mhr.app.fragments.toolbox.PointOperationBrushToolSettingsFragment:
mhr.appandroid.views.pathpicker.PathPickerView.PathPickerViewEventListener mhr.appandroid.views.brushpicker.RoundBrushPickerView.RoundBrushPickerViewEventListener

Classes

interface  ToolPicker
 

Public Member Functions

void onItemSelected (AdapterView<?> parent, View view, int position, long id)
 
void onNothingSelected (AdapterView<?> parent)
 
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 UI.
 
void setBrush ()
 Nastaví vybraný štětec v jádru aplikace.
 

Protected Attributes

View root
 
AppMainActivity activity
 
boolean firstCreated = true
 
RoundBrushPickerView brushPicker
 
PathPickerView pathPicker
 
boolean pathLivePreviewOn
 
Button selectPointOperationBrushToolBtn
 
FrameLayout settingsPlaceholder
 
ArrayList< ToolPickertoolPickers = new ArrayList<PointOperationBrushToolSettingsFragment.ToolPicker>()
 
ToolPicker tp
 
Spinner opPicker
 

Detailed Description

Fragment nastavení nástrojů pro aplikaci lokálních bodových operací

Definition at line 51 of file PointOperationBrushToolSettingsFragment.java.

Member Function Documentation

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

Provede inicializaci UI.

Definition at line 90 of file PointOperationBrushToolSettingsFragment.java.

{
root = inflater.inflate(R.layout.fragment_point_operation_brush_tool_settings, container, false);
brushPicker = (RoundBrushPickerView) root.findViewById(R.id.PointOperationBrushRoundBrushPicker);
pathPicker = (PathPickerView) root.findViewById(R.id.PointOperationBrushPathPicker);
settingsPlaceholder = (FrameLayout) root.findViewById(R.id.PointOpBrushToolSpecSettingsPlaceholder);
opPicker = (Spinner) root.findViewById(R.id.PointOpBrushOperationPickerSP);
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(activity, R.array.PointOpBrushNames, android.R.layout.simple_spinner_item);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
opPicker.setAdapter(adapter);
opPicker.setOnItemSelectedListener(this);
toolPickers.add(new ToolPicker() {
LabelledSeekBar sb = null;
@Override
public void setTool(NBitmap brush, double opacity, double flow, double spacing) {
activity.addCommand(new SelectToolCommand(new BrightnessLUTBrush(brush, opacity, flow, spacing, sb.getProgress())));
}
@Override
public void onPickerActivated() {
if (sb == null) {
activity.getLayoutInflater().inflate(R.layout.point_op_brush_settings_brightness, settingsPlaceholder, true);
sb = (LabelledSeekBar) settingsPlaceholder.findViewById(R.id.PointOpBrushBrightnessSettings);
} else {
settingsPlaceholder.addView(sb);
}
}
@Override
public void onPickerDeactivated() {
settingsPlaceholder.removeAllViews();
}
});
toolPickers.add(new ToolPicker() {
LabelledSeekBar sb = null;
@Override
public void setTool(NBitmap brush, double opacity, double flow, double spacing) {
activity.addCommand(new SelectToolCommand(new ContrastLUTBrush(brush, opacity, flow, spacing, sb.getProgress())));
}
@Override
public void onPickerActivated() {
if (sb == null) {
activity.getLayoutInflater().inflate(R.layout.point_op_brush_settings_contrast, settingsPlaceholder, true);
sb = (LabelledSeekBar) settingsPlaceholder.findViewById(R.id.PointOpBrushContrastSettings);
} else {
settingsPlaceholder.addView(sb);
}
}
@Override
public void onPickerDeactivated() {
settingsPlaceholder.removeAllViews();
}
});
toolPickers.add(new ToolPicker() {
LabelledSeekBar sb = null;
@Override
public void setTool(NBitmap brush, double opacity, double flow, double spacing) {
activity.addCommand(new SelectToolCommand(new GammaLUTBrush(brush, opacity, flow, spacing, sb.getProgress())));
}
@Override
public void onPickerActivated() {
if (sb == null) {
activity.getLayoutInflater().inflate(R.layout.point_op_brush_settings_gamma, settingsPlaceholder, true);
sb = (LabelledSeekBar) settingsPlaceholder.findViewById(R.id.PointOpBrushGammaSettings);
} else {
settingsPlaceholder.addView(sb);
}
}
@Override
public void onPickerDeactivated() {
settingsPlaceholder.removeAllViews();
}
});
toolPickers.add(new ToolPicker() {
protected View toolRoot;
protected CurvesView MV;
protected CurvesView RV;
protected CurvesView GV;
protected CurvesView BV;
protected CurvesView AV;
protected Spinner ChSp;
protected CurvesView selected;
protected float[][] defVals = new float[][] {
{0.0f, 1.0f},
{0.0f, 1.0f}
};
@Override
public void setTool(NBitmap brush, double opacity, double flow, double spacing) {
activity.addCommand(new SelectToolCommand(new CurvesLUTBrush(brush, opacity, flow, spacing, MV.getPoints(), RV.getPoints(), GV.getPoints(), BV.getPoints(), AV.getPoints())));
}
@Override
public void onPickerActivated() {
if (toolRoot == null) {
toolRoot = activity.getLayoutInflater().inflate(R.layout.point_op_brush_settings_curves, settingsPlaceholder, true);
ChSp = (Spinner) toolRoot.findViewById(R.id.ChannelSp);
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(activity, R.array.CurvesChannelNames, android.R.layout.simple_spinner_item);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
ChSp.setAdapter(adapter);
ChSp.setOnItemSelectedListener( new OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
selected.setVisibility(View.GONE);
switch (position) {
case 0:
selected = MV;
break;
case 1:
selected = RV;
break;
case 2:
selected = GV;
break;
case 3:
selected = BV;
break;
case 4:
selected = AV;
break;
}
selected.setVisibility(View.VISIBLE);
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
MV = (CurvesView) toolRoot.findViewById(R.id.CurvesMaster);
RV = (CurvesView) toolRoot.findViewById(R.id.CurvesRed);
GV = (CurvesView) toolRoot.findViewById(R.id.CurvesGreen);
BV = (CurvesView) toolRoot.findViewById(R.id.CurvesBlue);
AV = (CurvesView) toolRoot.findViewById(R.id.CurvesAplha);
selected = MV;
toolRoot.findViewById(R.id.CurvesCancelBtn).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
MV.setPoints(defVals);
RV.setPoints(defVals);
GV.setPoints(defVals);
BV.setPoints(defVals);
AV.setPoints(defVals);
}
});
toolRoot.findViewById(R.id.CurvesSelectBtn).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
}
});
} else {
settingsPlaceholder.addView(toolRoot);
}
}
@Override
public void onPickerDeactivated() {
settingsPlaceholder.removeAllViews();
}
});
tp = toolPickers.get(0);
selectPointOperationBrushToolBtn = (Button) root.findViewById(R.id.SelectPointOperationBrushToolBtn);
selectPointOperationBrushToolBtn.setOnClickListener(this);
firstCreated = false;
return root;
}
void mhr.app.fragments.toolbox.PointOperationBrushToolSettingsFragment.onAttach ( Activity  activity)
inline

Definition at line 408 of file PointOperationBrushToolSettingsFragment.java.

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

Definition at line 335 of file PointOperationBrushToolSettingsFragment.java.

{
int id = v.getId();
switch (id) {
case R.id.SelectPointOperationBrushToolBtn:
}
}
View mhr.app.fragments.toolbox.PointOperationBrushToolSettingsFragment.onCreateView ( LayoutInflater  inflater,
ViewGroup  container,
Bundle  savedInstanceState 
)
inline

Definition at line 428 of file PointOperationBrushToolSettingsFragment.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.PointOperationBrushToolSettingsFragment.onItemSelected ( AdapterView<?>  parent,
View  view,
int  position,
long  id 
)
inline

Definition at line 321 of file PointOperationBrushToolSettingsFragment.java.

{
if (tp != null) {
}
tp = toolPickers.get(position);
}
void mhr.app.fragments.toolbox.PointOperationBrushToolSettingsFragment.onNothingSelected ( AdapterView<?>  parent)
inline

Definition at line 330 of file PointOperationBrushToolSettingsFragment.java.

{
}
void mhr.app.fragments.toolbox.PointOperationBrushToolSettingsFragment.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 385 of file PointOperationBrushToolSettingsFragment.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.PointOperationBrushToolSettingsFragment.onResume ( )
inline

Definition at line 470 of file PointOperationBrushToolSettingsFragment.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.PointOperationBrushToolSettingsFragment.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 344 of file PointOperationBrushToolSettingsFragment.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.PointOperationBrushToolSettingsFragment.setBrush ( )
inlineprotected

Nastaví vybraný štětec v jádru aplikace.

Definition at line 306 of file PointOperationBrushToolSettingsFragment.java.

{
tp = toolPickers.get(opPicker.getSelectedItemPosition());
if (tp != null) {
PathParams pp = pathPicker.getNewPathParams();
tp.setTool(brushPicker.getNewBrush(), pp.opacity / 100.0, pp.flow / 100.0, brushPicker.getSize() * pp.spacing / 100.0);
}
// activity.addCommand(new SelectToolCommand(new BrightnessLUTBrush(brushPicker.getNewBrush(), pp.opacity / 100.0, pp.flow / 100.0, brushPicker.getSize() * pp.spacing / 100.0, (biasSeekBar.getProgress() - 100) / 100.0)));
}

Member Data Documentation

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

Definition at line 69 of file PointOperationBrushToolSettingsFragment.java.

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

Definition at line 72 of file PointOperationBrushToolSettingsFragment.java.

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

Definition at line 70 of file PointOperationBrushToolSettingsFragment.java.

Spinner mhr.app.fragments.toolbox.PointOperationBrushToolSettingsFragment.opPicker
protected

Definition at line 81 of file PointOperationBrushToolSettingsFragment.java.

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

Definition at line 74 of file PointOperationBrushToolSettingsFragment.java.

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

Definition at line 73 of file PointOperationBrushToolSettingsFragment.java.

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

Definition at line 68 of file PointOperationBrushToolSettingsFragment.java.

Button mhr.app.fragments.toolbox.PointOperationBrushToolSettingsFragment.selectPointOperationBrushToolBtn
protected

Definition at line 75 of file PointOperationBrushToolSettingsFragment.java.

FrameLayout mhr.app.fragments.toolbox.PointOperationBrushToolSettingsFragment.settingsPlaceholder
protected

Definition at line 77 of file PointOperationBrushToolSettingsFragment.java.

ArrayList<ToolPicker> mhr.app.fragments.toolbox.PointOperationBrushToolSettingsFragment.toolPickers = new ArrayList<PointOperationBrushToolSettingsFragment.ToolPicker>()
protected

Definition at line 78 of file PointOperationBrushToolSettingsFragment.java.

ToolPicker mhr.app.fragments.toolbox.PointOperationBrushToolSettingsFragment.tp
protected

Definition at line 79 of file PointOperationBrushToolSettingsFragment.java.


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