root / trunk / extensions / extRemoteSensing / src / org / gvsig / remotesensing / gridmath / gui / GridMathDialog.java @ 24986
History | View | Annotate | Download (3.63 KB)
1 | 17254 | gsdiego | /* 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 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 | |||
41 | package org.gvsig.remotesensing.gridmath.gui; |
||
42 | |||
43 | import java.awt.BorderLayout; |
||
44 | import java.awt.Dimension; |
||
45 | |||
46 | import javax.swing.JPanel; |
||
47 | |||
48 | import org.gvsig.gui.beans.buttonspanel.ButtonsPanel; |
||
49 | import org.gvsig.gui.beans.buttonspanel.ButtonsPanelEvent; |
||
50 | import org.gvsig.gui.beans.buttonspanel.ButtonsPanelListener; |
||
51 | |||
52 | import com.iver.andami.PluginServices; |
||
53 | import com.iver.andami.ui.mdiManager.IWindow; |
||
54 | import com.iver.andami.ui.mdiManager.WindowInfo; |
||
55 | import com.iver.cit.gvsig.project.documents.view.gui.View; |
||
56 | |||
57 | /**
|
||
58 | * Di?logo para la calculadora de bandas.
|
||
59 | *
|
||
60 | * @author Alejandro Mu?oz Sanchez (alejandro.munoz@uclm.es)
|
||
61 | * @author Diego Guerrero Sevilla (diego.guerrero@uclm.es)
|
||
62 | * @version 19/10/2007
|
||
63 | */
|
||
64 | |||
65 | public class GridMathDialog extends JPanel implements IWindow, ButtonsPanelListener{ |
||
66 | |||
67 | private static final long serialVersionUID = -8676017674682458513L; |
||
68 | |||
69 | private View view = null; |
||
70 | private GridMathPanel gridMathPanel = null; |
||
71 | private int width=630; |
||
72 | private int height=300; |
||
73 | |||
74 | /**
|
||
75 | * @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo()
|
||
76 | */
|
||
77 | public WindowInfo getWindowInfo() {
|
||
78 | WindowInfo m_viewinfo = new WindowInfo(WindowInfo.MODELESSDIALOG);
|
||
79 | m_viewinfo.setWidth(width); |
||
80 | m_viewinfo.setHeight(height); |
||
81 | m_viewinfo.setTitle(PluginServices.getText(this,"band_math")); |
||
82 | m_viewinfo.setX(300);
|
||
83 | return m_viewinfo;
|
||
84 | } |
||
85 | |||
86 | /*
|
||
87 | * (non-Javadoc)
|
||
88 | * @see org.gvsig.gui.beans.buttonspanel.ButtonsPanelListener#actionButtonPressed(org.gvsig.gui.beans.buttonspanel.ButtonsPanelEvent)
|
||
89 | */
|
||
90 | public void actionButtonPressed(ButtonsPanelEvent e) { |
||
91 | if (e.getButton() == ButtonsPanel.BUTTON_CLOSE) {
|
||
92 | try {
|
||
93 | PluginServices.getMDIManager().closeWindow(this);
|
||
94 | } catch (ArrayIndexOutOfBoundsException ex) { |
||
95 | // Si la ventana no se puede eliminar no hacemos nada
|
||
96 | } |
||
97 | } |
||
98 | } |
||
99 | |||
100 | /**
|
||
101 | * Constructor
|
||
102 | * @param view vista actual
|
||
103 | */
|
||
104 | public GridMathDialog(View view) { |
||
105 | this.view = view;
|
||
106 | this.setPreferredSize(new Dimension(width, height)); |
||
107 | this.setSize(width, height);
|
||
108 | this.setLayout(new BorderLayout(3, 3)); |
||
109 | this.add(getGridMathPanel(), java.awt.BorderLayout.CENTER);
|
||
110 | } |
||
111 | |||
112 | |||
113 | /**
|
||
114 | * @return CalculatorPanel del dialogo
|
||
115 | */
|
||
116 | public GridMathPanel getGridMathPanel() {
|
||
117 | if (gridMathPanel==null){ |
||
118 | gridMathPanel = new GridMathPanel(this,view); |
||
119 | gridMathPanel.addButtonPressedListener(this);
|
||
120 | } |
||
121 | return gridMathPanel;
|
||
122 | } |
||
123 | 24986 | jcampos | |
124 | public Object getWindowProfile() { |
||
125 | return WindowInfo.PROPERTIES_PROFILE;
|
||
126 | } |
||
127 | 17254 | gsdiego | } |