Revision 1319
org.gvsig.raster.tools/trunk/org.gvsig.raster.tools/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/maskthreshold/OperationMaskThresholdImpl.java | ||
---|---|---|
121 | 121 |
public ComboTextImpl getComboText() { |
122 | 122 |
if(comboText == null) { |
123 | 123 |
comboText = new ComboTextImpl(null, false, false); |
124 |
comboText.getTextField().setEnabled(false);
|
|
124 |
comboText.getTextField().setEnabled(true);
|
|
125 | 125 |
} |
126 | 126 |
return comboText; |
127 | 127 |
} |
org.gvsig.raster.tools/trunk/org.gvsig.raster.tools/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/maskthreshold/OutputMaskThresholdImpl.java | ||
---|---|---|
23 | 23 |
|
24 | 24 |
import java.awt.GridBagConstraints; |
25 | 25 |
import java.awt.GridBagLayout; |
26 |
import java.awt.event.ActionEvent; |
|
27 |
import java.awt.event.ActionListener; |
|
26 | 28 |
|
27 | 29 |
import javax.swing.BorderFactory; |
28 | 30 |
import javax.swing.JPanel; |
... | ... | |
35 | 37 |
/** |
36 | 38 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
37 | 39 |
*/ |
38 |
public class OutputMaskThresholdImpl extends JPanel { |
|
40 |
public class OutputMaskThresholdImpl extends JPanel implements ActionListener {
|
|
39 | 41 |
private static final long serialVersionUID = 1L; |
40 | 42 |
private ComboTextImpl satisfyCombo = null; |
41 | 43 |
private InputLayerImpl layerSelection = null; |
... | ... | |
73 | 75 |
satisfyCombo = new ComboTextImpl( |
74 | 76 |
new String[]{Messages.getText("method_output"), ""}, false, true); |
75 | 77 |
satisfyCombo.getTextField().setEnabled(false); |
78 |
satisfyCombo.getCombo().addActionListener(this); |
|
76 | 79 |
} |
77 | 80 |
return satisfyCombo; |
78 | 81 |
} |
... | ... | |
89 | 92 |
getLayerSelection().addPanelChangeEvent(listener); |
90 | 93 |
getMethodOutput().addPanelChangeEvent(listener); |
91 | 94 |
} |
95 |
|
|
96 |
public void actionPerformed(ActionEvent e) { |
|
97 |
if(e.getSource() == getMethodOutput().getCombo()) { |
|
98 |
if(getMethodOutput().getCombo().getSelectedIndex() == 1) { |
|
99 |
getMethodOutput().getTextField().setEnabled(true); |
|
100 |
} else { |
|
101 |
getMethodOutput().getTextField().setEnabled(false); |
|
102 |
} |
|
103 |
} |
|
104 |
} |
|
92 | 105 |
} |
org.gvsig.raster.tools/trunk/org.gvsig.raster.tools/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/maskthreshold/MaskThresholdDataImpl.java | ||
---|---|---|
43 | 43 |
return obj; |
44 | 44 |
} |
45 | 45 |
|
46 |
public Object getOperationLayer() { |
|
47 |
Object obj = panel.getOperationMaskThresholdPanel().getLayerSelection() |
|
48 |
.getInputLayerCombo().getSelectedItem(); |
|
49 |
if(obj == null) |
|
50 |
return panel.getOperationMaskThresholdPanel().getLayerSelection() |
|
51 |
.getInputLayerCombo().getItemAt(0); |
|
52 |
else |
|
53 |
return obj; |
|
54 |
} |
|
55 |
|
|
56 |
public Object getOutputInputLayer() { |
|
57 |
Object obj = panel.getOutputMaskThresholdPanel().getLayerSelection() |
|
58 |
.getInputLayerCombo().getSelectedItem(); |
|
59 |
if(obj == null) |
|
60 |
return panel.getOutputMaskThresholdPanel().getLayerSelection() |
|
61 |
.getInputLayerCombo().getItemAt(0); |
|
62 |
else |
|
63 |
return obj; |
|
64 |
} |
|
65 |
|
|
46 | 66 |
public int getBandInputLayer() { |
47 | 67 |
return panel.getLayerSelection().getBandsSelectorCombo() |
48 | 68 |
.getSelectedIndex() - 1; |
... | ... | |
67 | 87 |
} |
68 | 88 |
} |
69 | 89 |
|
70 |
public Object getOperationLayer() { |
|
71 |
Object obj = panel.getOperationMaskThresholdPanel().getLayerSelection() |
|
72 |
.getInputLayerCombo().getSelectedItem(); |
|
73 |
if(obj == null) |
|
74 |
return panel.getOperationMaskThresholdPanel().getLayerSelection() |
|
75 |
.getInputLayerCombo().getItemAt(0); |
|
76 |
else |
|
77 |
return obj; |
|
78 |
} |
|
79 |
|
|
80 | 90 |
public int getBandOperationLayer() { |
81 | 91 |
return panel.getOperationMaskThresholdPanel().getLayerSelection() |
82 | 92 |
.getBandsSelectorCombo().getSelectedIndex() - 1; |
83 | 93 |
} |
84 | 94 |
|
85 |
public Object getOutputInputLayer() { |
|
86 |
Object obj = panel.getOutputMaskThresholdPanel().getLayerSelection() |
|
87 |
.getInputLayerCombo().getSelectedItem(); |
|
88 |
if(obj == null) |
|
89 |
return panel.getOutputMaskThresholdPanel().getLayerSelection() |
|
90 |
.getInputLayerCombo().getItemAt(0); |
|
91 |
else |
|
92 |
return obj; |
|
93 |
} |
|
94 |
|
|
95 | 95 |
public int getBandOutputLayer() { |
96 | 96 |
return panel.getOutputMaskThresholdPanel().getLayerSelection() |
97 | 97 |
.getBandsSelectorCombo().getSelectedIndex() - 1; |
org.gvsig.raster.tools/trunk/org.gvsig.raster.tools/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.maskthreshold/src/main/java/org/gvsig/raster/tools/algorithm/maskthreshold/MaskthresholdProcess.java | ||
---|---|---|
22 | 22 |
package org.gvsig.raster.tools.algorithm.maskthreshold; |
23 | 23 |
|
24 | 24 |
import java.awt.geom.Rectangle2D; |
25 |
import java.io.File; |
|
25 | 26 |
import java.util.HashMap; |
26 | 27 |
|
27 | 28 |
import javax.swing.SwingUtilities; |
... | ... | |
217 | 218 |
threshold = (Double)getDoubleParam(THRESHOLD); //Default 0 |
218 | 219 |
fixedValue = (Double)getDoubleParam(FIXED_VALUE); //Default 0 |
219 | 220 |
|
220 |
filename = getStringParam(PATH); |
|
221 |
if(getStringParam(FILENAME) != null) |
|
222 |
filename = getStringParam(PATH) + File.separator + getStringParam(FILENAME); |
|
221 | 223 |
} |
222 | 224 |
|
223 | 225 |
/** |
... | ... | |
284 | 286 |
} catch (MaskthresholdException e) { |
285 | 287 |
if (incrementableTask != null) |
286 | 288 |
incrementableTask.processFinalize(); |
287 |
messageBoxError("error_reprojecting", this, e);
|
|
289 |
messageBoxError("error_processing_maskthreshold", null, e);
|
|
288 | 290 |
} finally { |
289 | 291 |
if (incrementableTask != null) { |
290 | 292 |
incrementableTask.processFinalize(); |
Also available in: Unified diff