Revision 17299 trunk/extensions/extRemoteSensing/src/org/gvsig/remotesensing/scatterplot/gui/ScatterPlotPanel.java

View differences:

ScatterPlotPanel.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
*
3
* Copyright (C) 2007 Instituto de Desarrollo Regional and Generalitat Valenciana.
4
*
5
* This program is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU General Public License
7
* as published by the Free Software Foundation; either version 2
8
* of the License, or (at your option) any later version.
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
*
19
* For more information, contact:
20
*
21
*  Generalitat Valenciana
22
*   Conselleria d'Infraestructures i Transport
23
*   Av. Blasco Ib??ez, 50
24
*   46010 VALENCIA
25
*   SPAIN
26
*
27
*      +34 963862235
28
*   gvsig@gva.es
29
*      www.gvsig.gva.es
30
*
31
*    or
32
*
33
*   Instituto de Desarrollo Regional (Universidad de Castilla La-Mancha)
34
*   Campus Universitario s/n
35
*   02071 Alabacete
36
*   Spain
37
*
38
*   +34 967 599 200
39
*/
40

  
1 41
package org.gvsig.remotesensing.scatterplot.gui;
2 42

  
3 43

  
......
2 42
import java.awt.BorderLayout;
43
import java.awt.Dimension;
3 44
import java.awt.event.ActionEvent;
......
7 48

  
8 49
import javax.swing.BorderFactory;
9 50
import javax.swing.DefaultComboBoxModel;
51
import javax.swing.JButton;
52
import javax.swing.JLabel;
10 53
import javax.swing.JPanel;
11 54
import javax.swing.border.EmptyBorder;
12 55
import javax.swing.border.TitledBorder;
......
25 68
import com.iver.utiles.swing.JComboBox;
26 69

  
27 70
/**
28
 * Clase que define la interfaz del gr?fico de dispersion. Recoge las bandas 
29
 * que se van a representar en el gr?fico.
71
 * Clase que define la interfaz que gestiona el grafico de dispersion.
72
 * Permite la seleccion de las bandas por parte del usuario y el acceso 
73
 * al gestor de ROis del grafico.
30 74
 * 
31
 * @author Alejandro Mu?oz Sanchez (alejandro.munoz@uclm.es)
32
 * @author Diego Guerrero Sevilla (diego.guerrero@uclm.es)  
75
 * @author Alejandro Mu?oz Sanchez (alejandro.munoz@uclm.es)  
76
 * @see org.gvsig.remotesensing.scatterplot.gui.ChartScaterPlotPanel
33 77
 * @version 4/12/2007
34 78
 */
35 79

  
36 80
public class ScatterPlotPanel extends DefaultButtonsPanel implements ActionListener {
37

  
38

  
39 81
	
40 82
	private static final long serialVersionUID = 1L;
41 83
	private MapControl mapControl = null;
......
45 87
	private JComboBox comboY= null;
46 88
	private ChartScaterPlotPanel panelGrafico = null;
47 89
	private JPanel selectionBandPanel= null;
90
	private JButton jbuttomGestor = null;
48 91

  
49 92
	
93
	/**
94
	 * 	Constructor del panel 
95
	 **/
50 96
	public ScatterPlotPanel(ScatterPlotDialog scatterDialog) {
51 97
		super();
52 98
		initialize();
53 99
	}
54 100
	
55 101
	
102
	/**
103
	 * 	Acciones de inicializacion 
104
	 **/
56 105
	private void initialize() {
57 106
		setLayout(new BorderLayout(5,5));
58 107
		setBorder(new EmptyBorder(11,15,11,15));
59 108
	}
60 109
	
61 110
	
111
	/**
112
	 * 	Asignacion del layer al que esta asociado el diagrama
113
	 * */
62 114
	public void setFLayer(FLayer layer) {
63 115
		
64 116
		fLayer = layer;	
......
68 120
			BorderLayout bd= new BorderLayout();
69 121
			bd.setVgap(3);
70 122
			this.setLayout(bd);
123
			//  Quitar la contruccion del panel de aqui
71 124
			add(getPanelGrafico(),BorderLayout.CENTER);
72 125
			add(getBandPanel(), BorderLayout.NORTH);
73 126
		}
......
76 129
	
77 130
	
78 131
	
79
	JPanel getBandPanel(){
132
	/**
133
	 * @return Panel con los combos de seleccion de bandas y y botton de 
134
	 * acceso al gestor de ChartROIs
135
	 * */
136
	public JPanel getBandPanel(){
80 137
		
81 138
		if(selectionBandPanel==null){
82 139
			selectionBandPanel = new JPanel();
83 140
			TitledBorder topBorder = BorderFactory.createTitledBorder("Bandas");
84 141
			topBorder.setTitlePosition(TitledBorder.TOP);
85 142
			selectionBandPanel.setBorder(topBorder);
86
			selectionBandPanel.add(getComboX());
87
			selectionBandPanel.add(getComboY());
143
			BorderLayout bd = new BorderLayout();
144
		//	bd.setHgap(3);
145
		//	selectionBandPanel.setLayout(bd);
146
			JPanel panelX= new JPanel();
147
			panelX.add(new JLabel("Banda x:"));
148
			panelX.add(getComboX());
149
			selectionBandPanel.add(panelX);
150
			
151
			JPanel panelY= new JPanel();
152
			panelY.add(new JLabel("Banda y:"));
153
			panelY.add(getComboY());
154
			selectionBandPanel.add(panelY);
155
			
156
			JPanel panelButtom= new JPanel();
157
			panelButtom.setSize(new Dimension(30,50));
158
			panelButtom.add(getJbuttomGestor());
159
			selectionBandPanel.add(panelButtom);
160
			
88 161
		}
89 162
		return selectionBandPanel;
90 163
		
......
111 184
	
112 185

  
113 186
	public void aplicar(){
114
		panelGrafico.getPlot();
187
		//panelGrafico.getPlot();
115 188
	}
116 189

  
117 190
	public void actionButtonPressed(ButtonsPanelEvent e) {
......
191 264
			panelGrafico.repaint();
192 265
		}
193 266
		
267
		if(e.getSource()== getJbuttomGestor()){
268
			com.iver.andami.ui.mdiManager.IWindow activeWindow = PluginServices.getMDIManager().getActiveWindow();
269

  
270
			//si la ventana activa es de tipo Vista 
271
			//if (activeWindow instanceof View) {
272
				ManagerROIChartPanel panel =new ManagerROIChartPanel(panelGrafico);
273
				PluginServices.getMDIManager().addWindow(panel);
274
		//	}
275
		
276
			
277
		}
278
		
194 279
	}
195 280

  
281

  
282
	public JButton getJbuttomGestor() {
283
		
284
		if(jbuttomGestor==null){
285
			jbuttomGestor= new JButton(PluginServices.getText(this,"gestor"));
286
			jbuttomGestor.addActionListener(this);
287
		}
288
		return jbuttomGestor;
289
	}
290

  
196 291
	
197 292
	
198 293
	

Also available in: Unified diff