Revision 263 org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/org.gvsig.geoprocess.algorithm/org.gvsig.geoprocess.algorithm.reproject/src/main/java/org/gvsig/geoprocess/algorithm/reproject/ReprojectParametersPanel.java

View differences:

ReprojectParametersPanel.java
23 23
 */
24 24
package org.gvsig.geoprocess.algorithm.reproject;
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;
......
37 38
import javax.swing.JLabel;
38 39
import javax.swing.JPanel;
39 40

  
41
import org.cresques.cts.IProjection;
42
import org.gvsig.app.gui.panels.CRSSelectPanel;
43
import org.gvsig.fmap.crs.CRSFactory;
44
import org.gvsig.geoprocess.lib.api.GeoProcessLocator;
45
import org.gvsig.geoprocess.sextante.gui.algorithm.AlgorithmOutputPanel;
46

  
40 47
import es.unex.sextante.core.GeoAlgorithm;
41 48
import es.unex.sextante.core.ObjectAndDescription;
42 49
import es.unex.sextante.core.OutputObjectsSet;
43 50
import es.unex.sextante.core.ParametersSet;
44 51
import es.unex.sextante.core.Sextante;
45 52
import es.unex.sextante.dataObjects.IVectorLayer;
53
import es.unex.sextante.gridCalculus.gridCalculator.GridCalculatorAlgorithm;
46 54
import es.unex.sextante.gui.algorithm.GeoAlgorithmParametersPanel;
55
import es.unex.sextante.gui.algorithm.OutputChannelSelectionPanel;
47 56
import es.unex.sextante.gui.core.SextanteGUI;
48 57
import es.unex.sextante.outputs.Output;
49 58

  
50
import org.cresques.cts.IProjection;
51

  
52
import org.gvsig.app.gui.panels.CRSSelectPanel;
53
import org.gvsig.fmap.crs.CRSFactory;
54
import org.gvsig.geoprocess.core.CompositeSourceOutputChannel;
55
import org.gvsig.geoprocess.sextante.gui.algorithm.AlgorithmOutputPanel;
56

  
57 59
/**
58 60
 * Panel for reproject algorithm
59 61
 * @author <a href="mailto:nachobrodin@gmail.com">Nacho Brodin</a>
......
68 70
	private CRSSelectPanel                   projectionSrcSelector  = null;
69 71
	private IProjection                      targetLayerProjection  = null;
70 72
	private AlgorithmOutputPanel             algorithmOutputPanel   = null;
73
	private OutputChannelSelectionPanel      outputChannelSelectionPanel;
74
	private JPanel                           outputPanel;
75
	
71 76
	public ReprojectParametersPanel() {
72 77
		super();
73 78
	}
......
88 93
		gbc.gridx = 0;
89 94
		gbc.gridy = 0;
90 95
		gbc.insets = new Insets(15, 5, 15, 0);
91
		this.add(getComboPanel(Sextante.getText("Input_layer"), getLayersCombo()), gbc);
96
		this.add(getComboPanel(GeoProcessLocator.getGeoProcessManager().getTranslation("Input_layer"), getLayersCombo()), gbc);
92 97
		
93 98
		gbc.gridy = 1;
94 99
		gbc.insets = new Insets(0, 5, 15, 0);
......
109 114
		gbc.gridy = 5;
110 115
		gbc.fill = GridBagConstraints.HORIZONTAL;
111 116
		gbc.weighty = 0.0;
112
		this.add(getAlgorithmOutputPanel(), gbc);
117
		this.add(getOutputChannelSelectionPanel(), gbc);
113 118
	}
114 119
	
115 120
	/**
116
	 * Gets the output panel
121
	 * Gets the output panel (SEXTANTE)
117 122
	 * @return
118 123
	 */
124
	private JPanel getOutputChannelSelectionPanel() {
125
		if(outputPanel == null) {
126
			try {
127
				outputPanel = new JPanel();
128
				outputPanel.setLayout(new BorderLayout());
129
				final OutputObjectsSet ooSet = m_Algorithm.getOutputObjects();
130
				final Output out = ooSet.getOutput(GridCalculatorAlgorithm.RESULT);
131
				outputChannelSelectionPanel = new OutputChannelSelectionPanel(out, m_Algorithm.getParameters());
132
				outputPanel.add(new JLabel(" Dissolve [Vectorial]               "), BorderLayout.WEST);
133
				outputPanel.add(outputChannelSelectionPanel, BorderLayout.CENTER);
134
			} catch (final Exception e) {
135
				Sextante.addErrorToLog(e);
136
			}
137
		}
138
		return outputPanel;
139
	}
140
	
141
	/**
142
	 * Gets the output panel (DAL)
143
	 * @return
144
	 */
119 145
	private AlgorithmOutputPanel getAlgorithmOutputPanel() {
120 146
		if(algorithmOutputPanel == null)
121 147
		    algorithmOutputPanel = new AlgorithmOutputPanel();
......
139 165
		gbc.gridx = 0;
140 166
		gbc.insets = new Insets(0, 2, 0, 50);
141 167
		JLabel label = new JLabel(text);
142
		label.setPreferredSize(new Dimension(80, 18));
168
		label.setPreferredSize(new Dimension(180, 18));
143 169
		panel.add(label, gbc);
144 170

  
145 171
		gbc.fill = GridBagConstraints.HORIZONTAL;
......
173 199
	 */
174 200
	public JCheckBox getSelectionCheck() {
175 201
		if(selectionOnly == null) {
176
			selectionOnly = new JCheckBox(Sextante.getText("Selected_geometries"));
202
			selectionOnly = new JCheckBox(GeoProcessLocator.getGeoProcessManager().getTranslation("Selected_geometries"));
177 203
		}
178 204
		return selectionOnly;
179 205
	}
......
186 212
		if (projectionSrcSelector == null) {
187 213
			targetLayerProjection = CRSFactory.getCRS("EPSG:23030");
188 214
			projectionSrcSelector = CRSSelectPanel.getPanel(targetLayerProjection);
189
			projectionSrcSelector.getJLabel().setText(Sextante.getText("Proyeccion_Destino"));
215
			projectionSrcSelector.getJLabel().setText(GeoProcessLocator.getGeoProcessManager().getTranslation("Proyeccion_Destino"));
190 216
			projectionSrcSelector.setPreferredSize(new java.awt.Dimension(330,35));
191 217
			projectionSrcSelector.addActionListener(new java.awt.event.ActionListener() {
192 218
				public void actionPerformed(java.awt.event.ActionEvent e) {
......
242 268
			
243 269
			OutputObjectsSet ooSet = m_Algorithm.getOutputObjects();
244 270
			Output out = ooSet.getOutput(ReprojectAlgorithm.RESULT);
245
			out.setOutputChannel(new CompositeSourceOutputChannel(getAlgorithmOutputPanel().getOutputParameters()));
271
			
272
			//Reponer estas l?neas para cambiar el panel de salida y comentar la siguiente
273
			//out.setOutputChannel(new CompositeSourceOutputChannel(getAlgorithmOutputPanel().getOutputParameters()));
274
	         out.setOutputChannel(outputChannelSelectionPanel.getOutputChannel());
246 275
		} catch (Exception e) {
247 276
			Sextante.addErrorToLog(e);
248 277
		}

Also available in: Unified diff