App

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

- File List
- File Members

LaplacianOfGaussianSharpenLayerSettingsFragment.java
Go to the documentation of this file.
1 package mhr.app.fragments.layers.filter;
2
3 import java.text.DecimalFormat;
4
5 import mhr.app.R;
6 import mhr.app.fragments.layers.LayerSettingsFragment;
7
8 import mhr.appandroid.views.LabelledSeekBar;
9 import mhr.appcore.image.layers.LayerSpecificPresentation;
10 import mhr.appcore.image.layers.filter.DifferenceOfGaussianSharpenFilterLayerSpecificPresentation;
11 import mhr.appcore.image.layers.filter.GaussianBlurFilterLayerSpecificPresentation;
12 import mhr.appcore.image.layers.filter.LaplacianOfGaussianSharpenFilterLayerSpecificPresentation;
13
14 import android.os.Bundle;
15 import android.view.LayoutInflater;
16 import android.view.View;
17 import android.view.View.OnClickListener;
18 import android.view.ViewGroup;
19 import android.widget.CheckBox;
20 import android.widget.SeekBar;
21 import android.widget.SeekBar.OnSeekBarChangeListener;
22 import android.widget.TextView;
23
24
28 public class LaplacianOfGaussianSharpenLayerSettingsFragment extends LayerSettingsFragment implements OnClickListener {
29
30
31 //===== INTERFACES, CLASSES, ENUMS ==========================================================================================================//
32 //----- NON-PUBLIC --------------------------------------------------------------------------------------------------------------------------//
33 //----- PUBLIC ------------------------------------------------------------------------------------------------------------------------------//
34
35 //===== FIELDS ==============================================================================================================================//
36 //----- NON-PUBLIC --------------------------------------------------------------------------------------------------------------------------//
37 protected LabelledSeekBar sigmaLSB;
38 protected LabelledSeekBar forceLSB;
39 protected CheckBox equalizeAreaChB;
40
41
42 //----- PUBLIC ------------------------------------------------------------------------------------------------------------------------------//
43
44 //===== CONSTRUCTORS, DESTRUCTORS, RELATED METHODS ==========================================================================================//
45 //----- NON-PUBLIC --------------------------------------------------------------------------------------------------------------------------//
46 @Override
47 protected View initView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
48 root = inflater.inflate(R.layout.fragment_laplacian_of_gaussian_sharpen_layer_settings, container, false);
49 sigmaLSB = (LabelledSeekBar) root.findViewById(R.id.SigmaValueLSB);
50 forceLSB = (LabelledSeekBar) root.findViewById(R.id.ForceValueLSB);
51 equalizeAreaChB = (CheckBox) root.findViewById(R.id.EqualizeAreaChB);
52 return root;
53 }
54 //----- PUBLIC ------------------------------------------------------------------------------------------------------------------------------//
55
56 //===== METHODS =============================================================================================================================//
57 //----- NON-PUBLIC --------------------------------------------------------------------------------------------------------------------------//
58 @Override
59 protected void updateFromPresentation(LayerSpecificPresentation pres) {
60 LaplacianOfGaussianSharpenFilterLayerSpecificPresentation p = (LaplacianOfGaussianSharpenFilterLayerSpecificPresentation) pres;
61 sigmaLSB.setProgress((float)p.sigma);
62 forceLSB.setProgress((float)p.force);
63 equalizeAreaChB.setChecked(p.area);
64 }
65
66 @Override
67 protected void updatePresentation(LayerSpecificPresentation pres) {
68 LaplacianOfGaussianSharpenFilterLayerSpecificPresentation p = (LaplacianOfGaussianSharpenFilterLayerSpecificPresentation) pres;
69 p.sigma = sigmaLSB.getProgress();
70 p.force = forceLSB.getProgress();
71 p.area = equalizeAreaChB.isChecked();
72 }
73
74 //----- PUBLIC ------------------------------------------------------------------------------------------------------------------------------//
75
76 //===== CALLBACKS ===========================================================================================================================//
77 @Override
78 public void onClick(View v) {
79 switch (v.getId()) {
80 default:
81 super.onClick(v);
82 break;
83 }
84 }
85
86 //----- LIFE CYCLE --------------------------------------------------------------------------------------------------------------------------//
87
88 // @Override
89 // public void onAttach(Activity activity) {
90 // super.onAttach(activity);
91 // /*
92 // * called once the fragment is associated with its activity.
93 // */
94 // }
95
96 // @Override
97 // public void onCreate(Bundle savedInstanceState) {
98 // super.onCreate(savedInstanceState);
99 // /*
100 // * called to do initial creation of the fragment.
101 // *
102 // * The system calls this when creating the fragment. Within your implementation, you should initialize essential components of the fragment that you want
103 // * to retain when the fragment is paused or stopped, then resumed.
104 // */
105 // }
106
107 // @Override
108 // public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
109 // return super.onCreateView(inflater, container, savedInstanceState);
110 // /*
111 // * creates and returns the view hierarchy associated with the fragment.
112 // *
113 // * 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
114 // * 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.
115 // *
116 // * Zde začíná životní cyklus při návratu z backstacku
117 // */
118 // }
119
120 // @Override
121 // public void onActivityCreated(Bundle savedInstanceState) {
122 // super.onActivityCreated(savedInstanceState);
123 // /*
124 // * tells the fragment that its activity has completed its own Activity.onCreate().
125 // */
126 // }
127
128 // @Override // Vyžaduje API 17
129 // public void onViewStateRestored(Bundle savedInstanceState) {
130 // super.onViewStateRestored(savedInstanceState);
131 // /*
132 // * tells the fragment that all of the saved state of its view hierarchy has been restored.
133 // */
134 // }
135
136 // @Override
137 // public void onStart() {
138 // super.onStart();
139 // /*
140 // * makes the fragment visible to the user (based on its containing activity being started).
141 // */
142 // }
143 //
144 // @Override
145 // public void onResume() {
146 // super.onResume();
147 // /*
148 // * makes the fragment interacting with the user (based on its containing activity being resumed).
149 // */
150 // }
151
152 // @Override
153 // public void onPause() {
154 // super.onPause();
155 // /*
156 // * fragment is no longer interacting with the user either because its activity is being paused or a fragment operation is modifying it in the activity.
157 // *
158 // * The system calls this method as the first indication that the user is leaving the fragment (though it does not always mean the fragment is being destroyed).
159 // * This is usually where you should commit any changes that should be persisted beyond the current user session (because the user might not come back).
160 // */
161 // }
162
163 // @Override
164 // public void onStop() {
165 // super.onStop();
166 // /*
167 // * fragment is no longer visible to the user either because its activity is being stopped or a fragment operation is modifying it in the activity.
168 // */
169 // }
170
171 // @Override
172 // public void onDestroyView() {
173 // super.onDestroyView();
174 // /*
175 // * allows the fragment to clean up resources associated with its View.
176 // *
177 // * Zde končí životní cyklus při umístění do backstacku
178 // */
179 // }
180
181 // @Override
182 // public void onDestroy() {
183 // super.onDestroy();
184 // /*
185 // * called to do final cleanup of the fragment's state.
186 // */
187 // }
188
189 // @Override
190 // public void onDetach() {
191 // super.onDetach();
192 // /*
193 // * called immediately prior to the fragment no longer being associated with its activity.
194 // */
195 // }
196 }