svn-gvsig-desktop / trunk / extensions / extRemoteSensing / src / org / gvsig / remotesensing / decisiontrees / gui / DecisionTreeDialog.java @ 17088
History | View | Annotate | Download (3.8 KB)
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2006 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 Iba?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 |
package org.gvsig.remotesensing.decisiontrees.gui; |
41 |
|
42 |
import java.awt.BorderLayout; |
43 |
|
44 |
import javax.swing.JPanel; |
45 |
|
46 |
import org.gvsig.gui.beans.buttonspanel.ButtonsPanel; |
47 |
import org.gvsig.gui.beans.buttonspanel.ButtonsPanelEvent; |
48 |
import org.gvsig.gui.beans.buttonspanel.ButtonsPanelListener; |
49 |
|
50 |
import com.iver.andami.PluginServices; |
51 |
import com.iver.andami.ui.mdiManager.IWindow; |
52 |
import com.iver.andami.ui.mdiManager.IWindowListener; |
53 |
import com.iver.andami.ui.mdiManager.WindowInfo; |
54 |
|
55 |
/**
|
56 |
* Di?logo para la herramienta de ?rboles de decisi?n.
|
57 |
*
|
58 |
* @author Diego Guerrero Sevilla (diego.guerrero@uclm.es)
|
59 |
*
|
60 |
*/
|
61 |
public class DecisionTreeDialog extends JPanel implements ButtonsPanelListener, |
62 |
IWindow, IWindowListener { |
63 |
|
64 |
/**
|
65 |
*
|
66 |
*/
|
67 |
private static final long serialVersionUID = -8876811061688760990L; |
68 |
|
69 |
private DecisionTreePanel decisionTreePanel;
|
70 |
|
71 |
|
72 |
/**
|
73 |
* Constructor
|
74 |
* @param width Ancho del panel
|
75 |
* @param height Alto del panel
|
76 |
*/
|
77 |
public DecisionTreeDialog(int width, int height) { |
78 |
this.setSize(width, height);
|
79 |
this.setLayout(new BorderLayout()); |
80 |
this.add(getDecisionTreePanel(), BorderLayout.CENTER); |
81 |
} |
82 |
|
83 |
public void actionButtonPressed(ButtonsPanelEvent e) { |
84 |
// Al pulsar Aceptar o Aplicar se ejecuta el aceptar del panel
|
85 |
if (e.getButton() == ButtonsPanel.BUTTON_APPLY || e.getButton() == ButtonsPanel.BUTTON_ACCEPT) {
|
86 |
|
87 |
} |
88 |
|
89 |
// Al pulsar Cancelar la ventana se cierra y se refresca la vista
|
90 |
if (e.getButton() == ButtonsPanel.BUTTON_CANCEL) {
|
91 |
close(); |
92 |
} |
93 |
|
94 |
// Al pulsar Aceptar simplemente la ventana se cierra
|
95 |
if (e.getButton() == ButtonsPanel.BUTTON_ACCEPT) {
|
96 |
close(); |
97 |
} |
98 |
|
99 |
} |
100 |
|
101 |
public WindowInfo getWindowInfo() {
|
102 |
WindowInfo m_viewinfo = new WindowInfo(WindowInfo.MODELESSDIALOG | WindowInfo.RESIZABLE | WindowInfo.MAXIMIZABLE);
|
103 |
m_viewinfo.setTitle(PluginServices.getText(this, "arboles_decision")+" - "+m_viewinfo.getAdditionalInfo()); |
104 |
m_viewinfo.setHeight(this.getHeight());
|
105 |
m_viewinfo.setWidth(this.getWidth());
|
106 |
return m_viewinfo;
|
107 |
} |
108 |
|
109 |
public void windowActivated() { |
110 |
// TODO Auto-generated method stub
|
111 |
|
112 |
} |
113 |
|
114 |
public void windowClosed() { |
115 |
// TODO Auto-generated method stub
|
116 |
|
117 |
} |
118 |
|
119 |
/**
|
120 |
* Acciones a ejecutar cuando se cancela
|
121 |
*/
|
122 |
public void close() { |
123 |
try {
|
124 |
PluginServices.getMDIManager().closeWindow(this);
|
125 |
} catch (ArrayIndexOutOfBoundsException e) { |
126 |
//Si la ventana no se puede eliminar no hacemos nada
|
127 |
} |
128 |
} |
129 |
|
130 |
public DecisionTreePanel getDecisionTreePanel() {
|
131 |
if (decisionTreePanel ==null) |
132 |
decisionTreePanel = new DecisionTreePanel(this); |
133 |
return decisionTreePanel;
|
134 |
} |
135 |
} |