App

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

- File List
- File Members

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