Revision 333 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

View differences:

MergeParametersPanel.java
23 23
 */
24 24
package org.gvsig.geoprocess.algorithm.merge;
25 25

  
26
import java.awt.BorderLayout;
27 26
import java.awt.Dimension;
28 27
import java.awt.GridBagConstraints;
29 28
import java.awt.GridBagLayout;
......
48 47
import es.unex.sextante.core.ParametersSet;
49 48
import es.unex.sextante.core.Sextante;
50 49
import es.unex.sextante.dataObjects.IVectorLayer;
51
import es.unex.sextante.gridCalculus.gridCalculator.GridCalculatorAlgorithm;
52 50
import es.unex.sextante.gui.algorithm.GeoAlgorithmParametersPanel;
53 51
import es.unex.sextante.gui.algorithm.OutputChannelSelectionPanel;
54 52
import es.unex.sextante.gui.core.SextanteGUI;
......
70 68
	private TableContainer                   table              = null;
71 69
	private ObjectAndDescription[]           layerList          = null;
72 70
	private AlgorithmOutputPanel             algorithmOutputPanel  = null;
73
	private OutputChannelSelectionPanel      outputChannelSelectionPanel;
71
	private OutputChannelSelectionPanel      outputChannelSelectionPanelPol;
72
	private OutputChannelSelectionPanel      outputChannelSelectionPanelLine;
73
	private OutputChannelSelectionPanel      outputChannelSelectionPanelPoint;
74 74
	private JPanel                           outputPanel;
75 75
	
76 76
	public MergeParametersPanel() {
......
121 121
		if(outputPanel == null) {
122 122
			try {
123 123
				outputPanel = new JPanel();
124
				outputPanel.setLayout(new BorderLayout());
124
				outputPanel.setLayout(new GridBagLayout());
125 125
				final OutputObjectsSet ooSet = m_Algorithm.getOutputObjects();
126
				final Output out = ooSet.getOutput(GridCalculatorAlgorithm.RESULT);
127
				outputChannelSelectionPanel = new OutputChannelSelectionPanel(out, m_Algorithm.getParameters());
126
				final Output out_pol = ooSet.getOutput(MergeAlgorithm.RESULT_POL);
127
				final Output out_line = ooSet.getOutput(MergeAlgorithm.RESULT_LINE);
128
				final Output out_point = ooSet.getOutput(MergeAlgorithm.RESULT_POINT);
129
				
130
				outputChannelSelectionPanelPol = new OutputChannelSelectionPanel(out_pol, m_Algorithm.getParameters());
131
				outputChannelSelectionPanelLine = new OutputChannelSelectionPanel(out_line, m_Algorithm.getParameters());
132
				outputChannelSelectionPanelPoint = new OutputChannelSelectionPanel(out_point, m_Algorithm.getParameters());
133
				
128 134
				String label = GeoProcessLocator.getGeoProcessManager().getTranslation("Merge");
129
				outputPanel.add(new JLabel(" " + label + " [Vectorial]               "), BorderLayout.WEST);
130
				outputPanel.add(outputChannelSelectionPanel, BorderLayout.CENTER);
135
				
136
				GridBagConstraints gbc = new GridBagConstraints();
137
				gbc.fill = GridBagConstraints.HORIZONTAL;
138
				gbc.insets = new Insets(0, 0, 4, 0);
139
				gbc.weightx = 1;
140
				gbc.gridx = 0;
141
				gbc.gridy = 0;
142
				outputPanel.add(new JLabel(" " + label + " [Polygon]               "), gbc);
143
				
144
				gbc.gridx = 0;
145
				gbc.gridy = 1;
146
				outputPanel.add(new JLabel(" " + label + " [Line]               "), gbc);
147
				
148
				gbc.gridx = 0;
149
				gbc.gridy = 2;
150
				outputPanel.add(new JLabel(" " + label + " [Point]               "), gbc);
151
				
152
				gbc.fill = GridBagConstraints.HORIZONTAL;
153
				gbc.weightx = 1;
154
				gbc.gridx = 1;
155
				gbc.gridy = 0;
156
				outputPanel.add(outputChannelSelectionPanelPol, gbc);
157
				
158
				gbc.gridx = 1;
159
				gbc.gridy = 1;
160
				outputPanel.add(outputChannelSelectionPanelLine, gbc);
161
				
162
				gbc.gridx = 1;
163
				gbc.gridy = 2;
164
				outputPanel.add(outputChannelSelectionPanelPoint, gbc);
131 165
			} catch (final Exception e) {
132 166
				Sextante.addErrorToLog(e);
133 167
			}
......
273 307
			params.getParameter(MergeAlgorithm.LAYERS).setParameterValue(getSelectedLayerList());
274 308
			
275 309
			OutputObjectsSet ooSet = m_Algorithm.getOutputObjects();
276
			Output out = ooSet.getOutput(MergeAlgorithm.RESULT);
310
			Output outPol = ooSet.getOutput(MergeAlgorithm.RESULT_POL);
311
			Output outLine = ooSet.getOutput(MergeAlgorithm.RESULT_LINE);
312
			Output outPoint = ooSet.getOutput(MergeAlgorithm.RESULT_POINT);
277 313
			
278 314
			//Reponer estas l?neas para cambiar el panel de salida y comentar la siguiente
279 315
			//AlgorithmOutputPanel fsp = getAlgorithmOutputPanel();
280 316
			//out.setOutputChannel(new CompositeSourceOutputChannel(fsp.getOutputParameters()));
281
	         out.setOutputChannel(outputChannelSelectionPanel.getOutputChannel());
317
			outPol.setOutputChannel(outputChannelSelectionPanelPol.getOutputChannel());
318
			outLine.setOutputChannel(outputChannelSelectionPanelLine.getOutputChannel());
319
			outPoint.setOutputChannel(outputChannelSelectionPanelPoint.getOutputChannel());
282 320
		} catch (Exception e) {
283 321
			Sextante.addErrorToLog(e);
284 322
		}

Also available in: Unified diff