Revision 262 org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/org.gvsig.geoprocess.algorithm/org.gvsig.geoprocess.algorithm.merge/src/main/java/org/gvsig/geoprocess/algorithm/merge/MergeParametersPanel.java
MergeParametersPanel.java | ||
---|---|---|
23 | 23 |
*/ |
24 | 24 |
package org.gvsig.geoprocess.algorithm.merge; |
25 | 25 |
|
26 |
import java.awt.BorderLayout; |
|
26 | 27 |
import java.awt.Dimension; |
27 | 28 |
import java.awt.GridBagConstraints; |
28 | 29 |
import java.awt.GridBagLayout; |
... | ... | |
36 | 37 |
import javax.swing.JLabel; |
37 | 38 |
import javax.swing.JPanel; |
38 | 39 |
|
40 |
import org.gvsig.geoprocess.lib.api.GeoProcessLocator; |
|
41 |
import org.gvsig.geoprocess.sextante.gui.algorithm.AlgorithmOutputPanel; |
|
42 |
import org.gvsig.gui.beans.table.TableContainer; |
|
43 |
import org.gvsig.gui.beans.table.exceptions.NotInitializeException; |
|
44 |
|
|
39 | 45 |
import es.unex.sextante.core.GeoAlgorithm; |
40 | 46 |
import es.unex.sextante.core.ObjectAndDescription; |
41 | 47 |
import es.unex.sextante.core.OutputObjectsSet; |
42 | 48 |
import es.unex.sextante.core.ParametersSet; |
43 | 49 |
import es.unex.sextante.core.Sextante; |
44 | 50 |
import es.unex.sextante.dataObjects.IVectorLayer; |
51 |
import es.unex.sextante.gridCalculus.gridCalculator.GridCalculatorAlgorithm; |
|
45 | 52 |
import es.unex.sextante.gui.algorithm.GeoAlgorithmParametersPanel; |
53 |
import es.unex.sextante.gui.algorithm.OutputChannelSelectionPanel; |
|
46 | 54 |
import es.unex.sextante.gui.core.SextanteGUI; |
47 | 55 |
import es.unex.sextante.outputs.Output; |
48 | 56 |
|
49 |
import org.gvsig.geoprocess.core.CompositeSourceOutputChannel; |
|
50 |
import org.gvsig.geoprocess.lib.api.GeoProcessLocator; |
|
51 |
import org.gvsig.geoprocess.sextante.gui.algorithm.AlgorithmOutputPanel; |
|
52 |
import org.gvsig.gui.beans.table.TableContainer; |
|
53 |
import org.gvsig.gui.beans.table.exceptions.NotInitializeException; |
|
54 |
|
|
55 | 57 |
/** |
56 | 58 |
* Panel for merge algorithm |
57 | 59 |
* @author <a href="mailto:nachobrodin@gmail.com">Nacho Brodin</a> |
... | ... | |
68 | 70 |
private TableContainer table = null; |
69 | 71 |
private ObjectAndDescription[] layerList = null; |
70 | 72 |
private AlgorithmOutputPanel algorithmOutputPanel = null; |
73 |
private OutputChannelSelectionPanel outputChannelSelectionPanel; |
|
74 |
private JPanel outputPanel; |
|
71 | 75 |
|
72 | 76 |
public MergeParametersPanel() { |
73 | 77 |
super(); |
... | ... | |
104 | 108 |
this.add(getFieldsComboPanel(GeoProcessLocator.getGeoProcessManager().getTranslation("Field"), getFieldsCombo()), gbc); |
105 | 109 |
|
106 | 110 |
gbc.gridy = 3; |
107 |
this.add(getAlgorithmOutputPanel(), gbc);
|
|
111 |
this.add(getOutputChannelSelectionPanel(), gbc);
|
|
108 | 112 |
|
109 | 113 |
initTable(); |
110 | 114 |
} |
111 | 115 |
|
112 | 116 |
/** |
113 |
* Gets the output panel |
|
117 |
* Gets the output panel (SEXTANTE)
|
|
114 | 118 |
* @return |
115 | 119 |
*/ |
120 |
private JPanel getOutputChannelSelectionPanel() { |
|
121 |
if(outputPanel == null) { |
|
122 |
try { |
|
123 |
outputPanel = new JPanel(); |
|
124 |
outputPanel.setLayout(new BorderLayout()); |
|
125 |
final OutputObjectsSet ooSet = m_Algorithm.getOutputObjects(); |
|
126 |
final Output out = ooSet.getOutput(GridCalculatorAlgorithm.RESULT); |
|
127 |
outputChannelSelectionPanel = new OutputChannelSelectionPanel(out, m_Algorithm.getParameters()); |
|
128 |
outputPanel.add(new JLabel(" Dissolve [Vectorial] "), BorderLayout.WEST); |
|
129 |
outputPanel.add(outputChannelSelectionPanel, BorderLayout.CENTER); |
|
130 |
} catch (final Exception e) { |
|
131 |
Sextante.addErrorToLog(e); |
|
132 |
} |
|
133 |
} |
|
134 |
return outputPanel; |
|
135 |
} |
|
136 |
|
|
137 |
/** |
|
138 |
* Gets the output panel (DAL) |
|
139 |
* @return |
|
140 |
*/ |
|
141 |
@SuppressWarnings("unused") |
|
116 | 142 |
private AlgorithmOutputPanel getAlgorithmOutputPanel() { |
117 | 143 |
if(algorithmOutputPanel == null) |
118 | 144 |
algorithmOutputPanel = new AlgorithmOutputPanel(); |
... | ... | |
247 | 273 |
|
248 | 274 |
OutputObjectsSet ooSet = m_Algorithm.getOutputObjects(); |
249 | 275 |
Output out = ooSet.getOutput(MergeAlgorithm.RESULT); |
250 |
out.setOutputChannel(new CompositeSourceOutputChannel(getAlgorithmOutputPanel().getOutputParameters())); |
|
276 |
|
|
277 |
//Reponer estas l?neas para cambiar el panel de salida y comentar la siguiente |
|
278 |
//AlgorithmOutputPanel fsp = getAlgorithmOutputPanel(); |
|
279 |
//out.setOutputChannel(new CompositeSourceOutputChannel(fsp.getOutputParameters())); |
|
280 |
out.setOutputChannel(outputChannelSelectionPanel.getOutputChannel()); |
|
251 | 281 |
} catch (Exception e) { |
252 | 282 |
Sextante.addErrorToLog(e); |
253 | 283 |
} |
Also available in: Unified diff