App

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

- File List
- File Members

GaussianSharpenPopUpFragment.java
Go to the documentation of this file.
1 package mhr.app.fragments.toolbox.filters;
2
3 import mhr.app.R;
4 import mhr.app.fragments.toolbox.CancellableToolPopUpFragment;
5 import mhr.appandroid.views.LabelledSeekBar;
6 import mhr.appandroid.views.LabelledSeekBar.LabelledSBChangeListener;
7 import mhr.appcore.commands.toolcommands.CancelableToolUpdateCommand;
8 import mhr.appcore.tools.Tool;
9 import mhr.appcore.tools.actiondata.CancelableToolActionData;
10 import mhr.appcore.tools.actiondata.CancelableToolActionData.Action;
11 import mhr.appcore.tools.actiondata.GaussianBlurFilterCancelableToolActionData;
12 import mhr.appcore.tools.actiondata.GaussianSharpenFilterCancelableToolActionData;
13 import mhr.appcore.tools.actiondata.LaplaceSharpenFilterCancelableToolActionData;
14 import mhr.appcore.tools.cancelable.filter.GaussianBlurFilterCancelableTool;
15 import mhr.appcore.tools.cancelable.filter.GaussianSharpenFilterCancelableTool;
16 import mhr.appcore.tools.cancelable.filter.LaplaceSharpenFilterCancelableTool;
17
21 public class GaussianSharpenPopUpFragment extends CancellableToolPopUpFragment implements LabelledSBChangeListener {
22
23
24 //===== INTERFACES, CLASSES, ENUMS ==========================================================================================================//
25 //----- NON-PUBLIC --------------------------------------------------------------------------------------------------------------------------//
26 //----- PUBLIC ------------------------------------------------------------------------------------------------------------------------------//
27
28 //===== FIELDS ==============================================================================================================================//
29 //----- NON-PUBLIC --------------------------------------------------------------------------------------------------------------------------//
30 protected LabelledSeekBar forceValueLSB = null;
31 protected LabelledSeekBar sigmaValueLSB = null;
32
33 //----- PUBLIC ------------------------------------------------------------------------------------------------------------------------------//
34
35 //===== CONSTRUCTORS, DESTRUCTORS, RELATED METHODS ==========================================================================================//
36 //----- NON-PUBLIC --------------------------------------------------------------------------------------------------------------------------//
37 @Override
38 protected void onInitView() {
39 forceValueLSB = (LabelledSeekBar) root.findViewById(R.id.ForceValueLSB);
40 forceValueLSB.setLabelledSBChangeListener(this);
41
42 sigmaValueLSB = (LabelledSeekBar) root.findViewById(R.id.SigmaValueLSB);
43 sigmaValueLSB.setLabelledSBChangeListener(this);
44
45 }
46 //----- PUBLIC ------------------------------------------------------------------------------------------------------------------------------//
47 public GaussianSharpenPopUpFragment() {
48
49 }
50
51 //===== METHODS =============================================================================================================================//
52 //----- NON-PUBLIC --------------------------------------------------------------------------------------------------------------------------//
53 @Override
54 protected Tool getTool() {
55
56 return new GaussianSharpenFilterCancelableTool();
57 }
58
59 @Override
60 protected CancelableToolActionData getUpdateToolData() {
61 return new GaussianSharpenFilterCancelableToolActionData(Action.UPDATE_PREVIEW, sigmaValueLSB.getProgress(), forceValueLSB.getProgress());
62 }
63
64
65 @Override
66 protected int getLayoutId() {
67 return R.layout.fragment_filter_tool_gaussian_sharpen_settings;
68 }
69
70 @Override
71 protected void onCancel() {
72 forceValueLSB.setProgress(0);
73 sigmaValueLSB.setProgress(0.35f);
74 }
75 //----- PUBLIC ------------------------------------------------------------------------------------------------------------------------------//
76
77 //===== CALLBACKS ===========================================================================================================================//
78
79 @Override
80 public void onValueChanged(LabelledSeekBar sb, float value, boolean fromUser) {
81 if (livePreviewOn) {
82 activity.addCommand(new CancelableToolUpdateCommand(getUpdateToolData()));
83 }
84 }
85 @Override
86 public void onValueChangeStart(LabelledSeekBar sb) {
87 }
88 @Override
89 public void onValueChangeStop(LabelledSeekBar sb) {
90 }
91
92
93
94 }