root / trunk / extensions / extRemoteSensing / src / org / gvsig / remotesensing / decisiontrees / gui / ClassEditorDialog.java @ 24986
History | View | Annotate | Download (2.06 KB)
1 |
package org.gvsig.remotesensing.decisiontrees.gui; |
---|---|
2 |
|
3 |
import java.awt.BorderLayout; |
4 |
|
5 |
import javax.swing.JPanel; |
6 |
|
7 |
import org.gvsig.gui.beans.buttonspanel.ButtonsPanel; |
8 |
import org.gvsig.gui.beans.buttonspanel.ButtonsPanelEvent; |
9 |
import org.gvsig.gui.beans.buttonspanel.ButtonsPanelListener; |
10 |
|
11 |
import com.iver.andami.PluginServices; |
12 |
import com.iver.andami.ui.mdiManager.IWindow; |
13 |
import com.iver.andami.ui.mdiManager.IWindowListener; |
14 |
import com.iver.andami.ui.mdiManager.WindowInfo; |
15 |
|
16 |
public class ClassEditorDialog extends JPanel implements ButtonsPanelListener, IWindow, IWindowListener { |
17 |
|
18 |
private static final long serialVersionUID = -2297193201725695467L; |
19 |
|
20 |
private ClassEditorPanel classEditorPanel = null; |
21 |
private DecisionTreePanel decisionTreePanel = null; |
22 |
|
23 |
public ClassEditorDialog(int width, int height, DecisionTreePanel decisionTreePanel) { |
24 |
this.setSize(width, height);
|
25 |
this.setLayout(new BorderLayout()); |
26 |
this.decisionTreePanel = decisionTreePanel;
|
27 |
this.add(getClassEditorPanel(), BorderLayout.CENTER); |
28 |
} |
29 |
|
30 |
public void actionButtonPressed(ButtonsPanelEvent e) { |
31 |
if (e.getButton() == ButtonsPanel.BUTTON_CLOSE) {
|
32 |
close(); |
33 |
} |
34 |
} |
35 |
|
36 |
public WindowInfo getWindowInfo() {
|
37 |
WindowInfo m_viewinfo = new WindowInfo(WindowInfo.MODALDIALOG);
|
38 |
m_viewinfo.setTitle(PluginServices.getText(this, "editor_clase")); |
39 |
m_viewinfo.setHeight(this.getHeight());
|
40 |
m_viewinfo.setWidth(this.getWidth());
|
41 |
return m_viewinfo;
|
42 |
} |
43 |
|
44 |
/**
|
45 |
* Acciones a ejecutar cuando se cancela
|
46 |
*/
|
47 |
public void close() { |
48 |
try {
|
49 |
PluginServices.getMDIManager().closeWindow(this);
|
50 |
} catch (ArrayIndexOutOfBoundsException e) { |
51 |
//Si la ventana no se puede eliminar no hacemos nada
|
52 |
} |
53 |
} |
54 |
|
55 |
public void windowActivated() { |
56 |
|
57 |
} |
58 |
|
59 |
public void windowClosed() { |
60 |
|
61 |
} |
62 |
|
63 |
public ClassEditorPanel getClassEditorPanel() {
|
64 |
if (classEditorPanel == null){ |
65 |
classEditorPanel = new ClassEditorPanel(this, getDecisionTreePanel()); |
66 |
} |
67 |
return classEditorPanel;
|
68 |
} |
69 |
|
70 |
public DecisionTreePanel getDecisionTreePanel() {
|
71 |
return decisionTreePanel;
|
72 |
} |
73 |
|
74 |
public Object getWindowProfile() { |
75 |
return WindowInfo.DIALOG_PROFILE;
|
76 |
} |
77 |
} |