Revision 2669
branches/CqCMSDvp/libraries/libCq CMS for java.old/src/org/cresques/ui/CQLayerManager.java | ||
---|---|---|
1 | 1 |
/* |
2 | 2 |
* Cresques Mapping Suite. Graphic Library for constructing mapping applications. |
3 |
* |
|
4 |
* Copyright (C) 2004-5. |
|
5 | 3 |
* |
4 |
* Copyright (C) 2004-5. |
|
5 |
* |
|
6 | 6 |
* This program is free software; you can redistribute it and/or |
7 | 7 |
* modify it under the terms of the GNU General Public License |
8 | 8 |
* as published by the Free Software Foundation; either version 2 |
... | ... | |
18 | 18 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
19 | 19 |
* |
20 | 20 |
* For more information, contact: |
21 |
*
|
|
21 |
* |
|
22 | 22 |
* cresques@gmail.com |
23 | 23 |
*/ |
24 | 24 |
package org.cresques.ui; |
25 | 25 |
|
26 | 26 |
import org.cresques.cts.IProjection; |
27 |
|
|
27 | 28 |
import org.cresques.px.PxLayer; |
28 | 29 |
|
30 |
|
|
29 | 31 |
/** |
30 | 32 |
* @author Luis W. Sevilla (sevilla_lui@gva.es) |
31 | 33 |
*/ |
32 | 34 |
public interface CQLayerManager { |
33 |
public PxLayer createLayer(IProjection proj);
|
|
34 |
|
|
35 |
public PxLayer createLayer(String name, IProjection proj);
|
|
36 |
|
|
37 |
public PxLayer createLayer(PxLayer layer);
|
|
38 |
|
|
39 |
public PxLayer getCurrentLayer();
|
|
35 |
public PxLayer createLayer(IProjection proj);
|
|
36 |
|
|
37 |
public PxLayer createLayer(String name, IProjection proj);
|
|
38 |
|
|
39 |
public PxLayer createLayer(PxLayer layer);
|
|
40 |
|
|
41 |
public PxLayer getCurrentLayer();
|
|
40 | 42 |
} |
branches/CqCMSDvp/libraries/libCq CMS for java.old/src/org/cresques/ui/DefaultTabPanel.java | ||
---|---|---|
1 | 1 |
/* |
2 | 2 |
* Cresques Mapping Suite. Graphic Library for constructing mapping applications. |
3 |
* |
|
4 |
* Copyright (C) 2004-5. |
|
5 | 3 |
* |
4 |
* Copyright (C) 2004-5. |
|
5 |
* |
|
6 | 6 |
* This program is free software; you can redistribute it and/or |
7 | 7 |
* modify it under the terms of the GNU General Public License |
8 | 8 |
* as published by the Free Software Foundation; either version 2 |
... | ... | |
18 | 18 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
19 | 19 |
* |
20 | 20 |
* For more information, contact: |
21 |
*
|
|
21 |
* |
|
22 | 22 |
* cresques@gmail.com |
23 | 23 |
*/ |
24 | 24 |
package org.cresques.ui; |
... | ... | |
28 | 28 |
import javax.swing.JPanel; |
29 | 29 |
import javax.swing.JTabbedPane; |
30 | 30 |
|
31 |
|
|
31 | 32 |
/** |
32 | 33 |
* @author Nacho Brodin (brodin_ign@gva.es) |
33 |
*
|
|
34 |
* |
|
34 | 35 |
* Panel del que heredaran los paneles que contengan tabs |
35 | 36 |
*/ |
36 | 37 |
public class DefaultTabPanel extends DefaultDialogPanel { |
37 |
final private static long serialVersionUID = -3370601314380922368L; |
|
38 |
protected JTabbedPane tabbedPane = null; |
|
39 |
|
|
40 |
|
|
41 |
/** |
|
42 |
* Contructor |
|
43 |
*/ |
|
44 |
public DefaultTabPanel() { |
|
45 |
|
|
46 |
super(); |
|
47 |
this.setBounds(0,0,355,230); |
|
48 |
this.getContentPanel(); |
|
49 |
this.getTabPane(); |
|
50 |
contentPane.add( tabbedPane, BorderLayout.CENTER ); |
|
51 |
|
|
52 |
} |
|
53 |
|
|
54 |
/** |
|
55 |
* Obtiene el Componente JTabbedPane |
|
56 |
* @return Componente JTabbedPane |
|
57 |
*/ |
|
58 |
private JTabbedPane getTabPane(){ |
|
59 |
|
|
60 |
if(tabbedPane==null){ |
|
61 |
tabbedPane = new JTabbedPane(); |
|
62 |
} |
|
63 |
return tabbedPane; |
|
64 |
|
|
65 |
} |
|
66 |
/** |
|
67 |
* A?ade un tab al JTabbedPane |
|
68 |
* @param title T?tulo del tab |
|
69 |
* @param panel Panel del nuevo tab |
|
70 |
*/ |
|
71 |
protected void addTab(String title, JPanel panel){ |
|
72 |
|
|
73 |
tabbedPane.add(title, panel); |
|
74 |
} |
|
75 |
|
|
76 |
/** |
|
77 |
* Obtiene el JTabbedPane |
|
78 |
* @return JTabbedPane |
|
79 |
*/ |
|
80 |
public JTabbedPane getTab() { |
|
81 |
|
|
82 |
return tabbedPane; |
|
83 |
|
|
84 |
} |
|
85 |
|
|
86 |
} |
|
38 |
final private static long serialVersionUID = -3370601314380922368L; |
|
39 |
protected JTabbedPane tabbedPane = null; |
|
87 | 40 |
|
41 |
/** |
|
42 |
* Contructor |
|
43 |
*/ |
|
44 |
public DefaultTabPanel() { |
|
45 |
super(); |
|
46 |
this.setBounds(0, 0, 355, 230); |
|
47 |
this.getContentPanel(); |
|
48 |
this.getTabPane(); |
|
49 |
contentPane.add(tabbedPane, BorderLayout.CENTER); |
|
50 |
} |
|
51 |
|
|
52 |
/** |
|
53 |
* Obtiene el Componente JTabbedPane |
|
54 |
* @return Componente JTabbedPane |
|
55 |
*/ |
|
56 |
private JTabbedPane getTabPane() { |
|
57 |
if (tabbedPane == null) { |
|
58 |
tabbedPane = new JTabbedPane(); |
|
59 |
} |
|
60 |
|
|
61 |
return tabbedPane; |
|
62 |
} |
|
63 |
|
|
64 |
/** |
|
65 |
* A?ade un tab al JTabbedPane |
|
66 |
* @param title T?tulo del tab |
|
67 |
* @param panel Panel del nuevo tab |
|
68 |
*/ |
|
69 |
protected void addTab(String title, JPanel panel) { |
|
70 |
tabbedPane.add(title, panel); |
|
71 |
} |
|
72 |
|
|
73 |
/** |
|
74 |
* Obtiene el JTabbedPane |
|
75 |
* @return JTabbedPane |
|
76 |
*/ |
|
77 |
public JTabbedPane getTab() { |
|
78 |
return tabbedPane; |
|
79 |
} |
|
80 |
} |
branches/CqCMSDvp/libraries/libCq CMS for java.old/src/org/cresques/ui/LoadableComboBox.java | ||
---|---|---|
1 | 1 |
/* |
2 | 2 |
* Cresques Mapping Suite. Graphic Library for constructing mapping applications. |
3 |
* |
|
4 |
* Copyright (C) 2004-5. |
|
5 | 3 |
* |
4 |
* Copyright (C) 2004-5. |
|
5 |
* |
|
6 | 6 |
* This program is free software; you can redistribute it and/or |
7 | 7 |
* modify it under the terms of the GNU General Public License |
8 | 8 |
* as published by the Free Software Foundation; either version 2 |
... | ... | |
18 | 18 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
19 | 19 |
* |
20 | 20 |
* For more information, contact: |
21 |
*
|
|
21 |
* |
|
22 | 22 |
* cresques@gmail.com |
23 | 23 |
*/ |
24 | 24 |
package org.cresques.ui; |
25 | 25 |
|
26 | 26 |
import javax.swing.JComboBox; |
27 | 27 |
|
28 |
|
|
28 | 29 |
/** |
29 | 30 |
* @author "Luis W. Sevilla" <sevilla_lui@gva.es> |
30 | 31 |
*/ |
31 | 32 |
public class LoadableComboBox extends JComboBox { |
32 |
final private static long serialVersionUID = -3370601314380922368L; |
|
33 |
public LoadableComboBox() { |
|
34 |
super(); |
|
35 |
initialize(); |
|
36 |
// addItemListener(this); |
|
37 |
// setSize(new java.awt.Dimension(185, 23)); |
|
38 |
} |
|
39 |
|
|
40 |
/** |
|
41 |
* This method initializes this |
|
42 |
* |
|
43 |
* @return void |
|
44 |
*/ |
|
45 |
private void initialize() { |
|
46 |
this.setPreferredSize(new java.awt.Dimension(185,23)); |
|
47 |
|
|
48 |
} |
|
49 |
public void loadData(String data[]) { |
|
50 |
if (data == null) return; |
|
51 |
for (int i=0; i<data.length; i++) |
|
52 |
addItem(data[i]); |
|
53 |
} |
|
33 |
final private static long serialVersionUID = -3370601314380922368L; |
|
54 | 34 |
|
55 |
/* public void itemStateChanged(ItemEvent e) { |
|
56 |
if (e.getStateChange() == ItemEvent.SELECTED) { |
|
57 |
//label.setVisible(true); |
|
58 |
} else { |
|
59 |
//label.setVisible(false); |
|
60 |
} |
|
61 |
}*/ |
|
35 |
public LoadableComboBox() { |
|
36 |
super(); |
|
37 |
initialize(); |
|
38 |
|
|
39 |
// addItemListener(this); |
|
40 |
// setSize(new java.awt.Dimension(185, 23)); |
|
41 |
} |
|
42 |
|
|
43 |
/** |
|
44 |
* This method initializes this |
|
45 |
* |
|
46 |
* @return void |
|
47 |
*/ |
|
48 |
private void initialize() { |
|
49 |
this.setPreferredSize(new java.awt.Dimension(185, 23)); |
|
50 |
} |
|
51 |
|
|
52 |
public void loadData(String[] data) { |
|
53 |
if (data == null) { |
|
54 |
return; |
|
55 |
} |
|
56 |
|
|
57 |
for (int i = 0; i < data.length; i++) |
|
58 |
addItem(data[i]); |
|
59 |
} |
|
60 |
|
|
61 |
/* public void itemStateChanged(ItemEvent e) { |
|
62 |
if (e.getStateChange() == ItemEvent.SELECTED) { |
|
63 |
//label.setVisible(true); |
|
64 |
} else { |
|
65 |
//label.setVisible(false); |
|
66 |
} |
|
67 |
}*/ |
|
62 | 68 |
} |
63 |
|
branches/CqCMSDvp/libraries/libCq CMS for java.old/src/org/cresques/ui/CQMapCanvas.java | ||
---|---|---|
1 | 1 |
/* |
2 | 2 |
* Cresques Mapping Suite. Graphic Library for constructing mapping applications. |
3 |
* |
|
4 |
* Copyright (C) 2004-5. |
|
5 | 3 |
* |
4 |
* Copyright (C) 2004-5. |
|
5 |
* |
|
6 | 6 |
* This program is free software; you can redistribute it and/or |
7 | 7 |
* modify it under the terms of the GNU General Public License |
8 | 8 |
* as published by the Free Software Foundation; either version 2 |
... | ... | |
18 | 18 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
19 | 19 |
* |
20 | 20 |
* For more information, contact: |
21 |
*
|
|
21 |
* |
|
22 | 22 |
* cresques@gmail.com |
23 | 23 |
*/ |
24 | 24 |
package org.cresques.ui; |
25 | 25 |
|
26 | 26 |
import org.cresques.geo.ViewPortData; |
27 |
|
|
27 | 28 |
import org.cresques.px.Drawable; |
28 | 29 |
|
30 |
|
|
29 | 31 |
/** |
30 | 32 |
* @author "Luis W. Sevilla" <sevilla_lui@gva.es> |
31 | 33 |
*/ |
32 | 34 |
public interface CQMapCanvas { |
33 |
public CQApp getApp(); |
|
34 |
|
|
35 |
public ViewPortData getVPData(); |
|
36 |
|
|
37 |
public void viewPortChanged(); |
|
38 |
|
|
39 |
public void repaint(); |
|
40 |
|
|
41 |
public void paint(Drawable obj); |
|
42 |
|
|
35 |
public CQApp getApp(); |
|
36 |
|
|
37 |
public ViewPortData getVPData(); |
|
38 |
|
|
39 |
public void viewPortChanged(); |
|
40 |
|
|
41 |
public void repaint(); |
|
42 |
|
|
43 |
public void paint(Drawable obj); |
|
43 | 44 |
} |
branches/CqCMSDvp/libraries/libCq CMS for java.old/src/org/cresques/ui/raster/SaveRasterDialogPanel.java | ||
---|---|---|
1 | 1 |
/* |
2 | 2 |
* Cresques Mapping Suite. Graphic Library for constructing mapping applications. |
3 |
* |
|
4 |
* Copyright (C) 2004-5. |
|
5 | 3 |
* |
4 |
* Copyright (C) 2004-5. |
|
5 |
* |
|
6 | 6 |
* This program is free software; you can redistribute it and/or |
7 | 7 |
* modify it under the terms of the GNU General Public License |
8 | 8 |
* as published by the Free Software Foundation; either version 2 |
... | ... | |
18 | 18 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
19 | 19 |
* |
20 | 20 |
* For more information, contact: |
21 |
*
|
|
21 |
* |
|
22 | 22 |
* cresques@gmail.com |
23 | 23 |
*/ |
24 | 24 |
package org.cresques.ui.raster; |
25 | 25 |
|
26 |
import org.cresques.ui.DefaultDialogPanel; |
|
27 |
|
|
26 | 28 |
import javax.swing.JPanel; |
27 | 29 |
|
28 |
import org.cresques.ui.DefaultDialogPanel; |
|
29 | 30 |
|
30 | 31 |
/** |
31 | 32 |
* Panel que contiene los botones de Aceptar, Cancelar y Aplicar heredando de |
32 |
* DefaultDialogPanel. Dentro de este estar? el panel con los controles de
|
|
33 |
* DefaultDialogPanel. Dentro de este estar? el panel con los controles de |
|
33 | 34 |
* salvar a raster. |
34 | 35 |
* @author Nacho Brodin <brodin_ign@gva.es> |
35 | 36 |
*/ |
36 | 37 |
public class SaveRasterDialogPanel extends DefaultDialogPanel { |
37 |
final private static long serialVersionUID = -3370601314380922368L; |
|
38 |
public SaveRasterDialogPanel() { |
|
39 |
super(); |
|
40 |
initialize(); |
|
41 |
} |
|
42 |
|
|
43 |
/** |
|
44 |
* Inicializaci?n del panel. |
|
45 |
* @return void |
|
46 |
*/ |
|
47 |
protected void initialize() { |
|
48 |
this.setBounds(0,0,355,230); |
|
49 |
|
|
38 |
final private static long serialVersionUID = -3370601314380922368L; |
|
39 |
|
|
40 |
public SaveRasterDialogPanel() { |
|
41 |
super(); |
|
42 |
initialize(); |
|
43 |
} |
|
44 |
|
|
45 |
/** |
|
46 |
* Inicializaci?n del panel. |
|
47 |
* @return void |
|
48 |
*/ |
|
49 |
protected void initialize() { |
|
50 |
this.setBounds(0, 0, 355, 230); |
|
51 |
|
|
50 | 52 |
//Ocultamos el bot?n de aplicar |
51 |
|
|
52 | 53 |
this.getApplyButton().setVisible(false); |
53 |
} |
|
54 |
|
|
55 |
/** |
|
56 |
* Obtiene el panel con los controles de Salvar a Raster. |
|
57 |
* @return |
|
58 |
*/ |
|
59 |
public JPanel getContentPanel() { |
|
60 |
if (contentPane == null) { |
|
61 |
contentPane = new SaveSetupPanel(); |
|
62 |
contentPane.setBounds(14, 12, 345, 174); |
|
63 |
((SaveSetupPanel)contentPane).setDialogPanel(this); |
|
64 |
} |
|
65 |
return contentPane; |
|
66 |
} |
|
54 |
} |
|
67 | 55 |
|
56 |
/** |
|
57 |
* Obtiene el panel con los controles de Salvar a Raster. |
|
58 |
* @return |
|
59 |
*/ |
|
60 |
public JPanel getContentPanel() { |
|
61 |
if (contentPane == null) { |
|
62 |
contentPane = new SaveSetupPanel(); |
|
63 |
contentPane.setBounds(14, 12, 345, 174); |
|
64 |
((SaveSetupPanel) contentPane).setDialogPanel(this); |
|
65 |
} |
|
66 |
|
|
67 |
return contentPane; |
|
68 |
} |
|
68 | 69 |
} |
69 |
|
branches/CqCMSDvp/libraries/libCq CMS for java.old/src/org/cresques/ui/raster/SavePropsSetupPanel.java | ||
---|---|---|
1 | 1 |
/* |
2 | 2 |
* Cresques Mapping Suite. Graphic Library for constructing mapping applications. |
3 |
* |
|
4 |
* Copyright (C) 2004-5. |
|
5 | 3 |
* |
4 |
* Copyright (C) 2004-5. |
|
5 |
* |
|
6 | 6 |
* This program is free software; you can redistribute it and/or |
7 | 7 |
* modify it under the terms of the GNU General Public License |
8 | 8 |
* as published by the Free Software Foundation; either version 2 |
... | ... | |
18 | 18 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
19 | 19 |
* |
20 | 20 |
* For more information, contact: |
21 |
*
|
|
21 |
* |
|
22 | 22 |
* cresques@gmail.com |
23 | 23 |
*/ |
24 | 24 |
package org.cresques.ui.raster; |
25 | 25 |
|
26 |
import org.cresques.io.CXMLParser; |
|
27 |
import org.cresques.io.GeoRasterWriter; |
|
26 | 28 |
|
27 | 29 |
import java.awt.Dimension; |
28 | 30 |
import java.awt.event.ActionEvent; |
... | ... | |
38 | 40 |
import javax.swing.event.ChangeEvent; |
39 | 41 |
import javax.swing.event.ChangeListener; |
40 | 42 |
|
41 |
import org.cresques.io.CXMLParser; |
|
42 |
import org.cresques.io.GeoRasterWriter; |
|
43 | 43 |
|
44 |
|
|
45 | 44 |
/** |
46 |
* Panel que maneja los eventos de las propiedades de escritura del panel de un
|
|
47 |
* tipo de raster concreto. Estan propiedades son obtenidas desde un texto en XML
|
|
48 |
* que es generado por el driver. Este XML se pasa desde aqu? al panel que
|
|
49 |
* contendr? los elementos para su generaci?n din?mica. Dependiendo del tipo de
|
|
45 |
* Panel que maneja los eventos de las propiedades de escritura del panel de un |
|
46 |
* tipo de raster concreto. Estan propiedades son obtenidas desde un texto en XML |
|
47 |
* que es generado por el driver. Este XML se pasa desde aqu? al panel que |
|
48 |
* contendr? los elementos para su generaci?n din?mica. Dependiendo del tipo de |
|
50 | 49 |
* driver el panel generado (DataInputProps) ser? diferente. |
51 | 50 |
* @author Nacho Brodin <brodin_ign@gva.es> |
52 | 51 |
*/ |
53 |
public class SavePropsSetupPanel extends JPanel implements ActionListener, ChangeListener, MouseListener, FocusListener, KeyListener{ |
|
54 |
final private static long serialVersionUID = -3370601314380922368L; |
|
55 |
private DataInputProps saveRaster = null; |
|
56 |
private SaveRasterPropsDialogPanel dialogPanel = null; |
|
57 |
private String fName = null; |
|
58 |
private GeoRasterWriter writer = null; |
|
59 |
private String formato = null; |
|
60 |
private String[] properties = null; |
|
52 |
public class SavePropsSetupPanel extends JPanel implements ActionListener, |
|
53 |
ChangeListener, |
|
54 |
MouseListener, |
|
55 |
FocusListener, |
|
56 |
KeyListener { |
|
57 |
final private static long serialVersionUID = -3370601314380922368L; |
|
58 |
private DataInputProps saveRaster = null; |
|
59 |
private SaveRasterPropsDialogPanel dialogPanel = null; |
|
60 |
private String fName = null; |
|
61 |
private GeoRasterWriter writer = null; |
|
62 |
private String formato = null; |
|
63 |
private String[] properties = null; |
|
61 | 64 |
|
62 |
/** |
|
63 |
* Constructor |
|
64 |
* |
|
65 |
*/ |
|
66 |
public SavePropsSetupPanel() { |
|
67 |
super(); |
|
68 |
} |
|
69 |
|
|
70 |
/** |
|
71 |
* Asigna el formato del fichero del que se quieren ver las propiedades |
|
72 |
* @param formato |
|
73 |
*/ |
|
74 |
public void setFormat(String formato){ |
|
75 |
this.formato = formato; |
|
76 |
initialize(); |
|
77 |
} |
|
78 |
|
|
79 |
/** |
|
80 |
* Asigna el GeoRasterFile que corresonde al driver |
|
81 |
* @param writer |
|
82 |
*/ |
|
83 |
public void setWriter(GeoRasterWriter writer){ |
|
84 |
this.writer = writer; |
|
85 |
initialize(); |
|
86 |
} |
|
87 |
|
|
88 |
/** |
|
89 |
* Inicializaci?n de la ventana |
|
90 |
* |
|
91 |
* @return void |
|
92 |
*/ |
|
93 |
void initialize() { |
|
94 |
int widthPanel=350; |
|
95 |
int heightPanel=210; |
|
96 |
|
|
97 |
//Obtenemos el ancho y alto del panel interior del XML |
|
98 |
String xml = writer.getXMLPropertiesDialog(); |
|
99 |
if(xml!=null){ |
|
100 |
CXMLParser parser = new CXMLParser(xml); |
|
101 |
parser.getValue("window", true); |
|
102 |
String w = parser.getAttr("panel","sizex"); |
|
103 |
String h = parser.getAttr("panel","sizey"); |
|
104 |
if(w!=null && !w.equals("")) |
|
105 |
widthPanel = Integer.parseInt(w); |
|
106 |
if(h!=null && !h.equals("")) |
|
107 |
heightPanel = Integer.parseInt(h); |
|
108 |
} |
|
65 |
/** |
|
66 |
* Constructor |
|
67 |
* |
|
68 |
*/ |
|
69 |
public SavePropsSetupPanel() { |
|
70 |
super(); |
|
71 |
} |
|
72 |
|
|
73 |
/** |
|
74 |
* Asigna el formato del fichero del que se quieren ver las propiedades |
|
75 |
* @param formato |
|
76 |
*/ |
|
77 |
public void setFormat(String formato) { |
|
78 |
this.formato = formato; |
|
79 |
initialize(); |
|
80 |
} |
|
81 |
|
|
82 |
/** |
|
83 |
* Asigna el GeoRasterFile que corresonde al driver |
|
84 |
* @param writer |
|
85 |
*/ |
|
86 |
public void setWriter(GeoRasterWriter writer) { |
|
87 |
this.writer = writer; |
|
88 |
initialize(); |
|
89 |
} |
|
90 |
|
|
91 |
/** |
|
92 |
* Inicializaci?n de la ventana |
|
93 |
* |
|
94 |
* @return void |
|
95 |
*/ |
|
96 |
void initialize() { |
|
97 |
int widthPanel = 350; |
|
98 |
int heightPanel = 210; |
|
99 |
|
|
100 |
//Obtenemos el ancho y alto del panel interior del XML |
|
101 |
String xml = writer.getXMLPropertiesDialog(); |
|
102 |
|
|
103 |
if (xml != null) { |
|
104 |
CXMLParser parser = new CXMLParser(xml); |
|
105 |
parser.getValue("window", true); |
|
106 |
|
|
107 |
String w = parser.getAttr("panel", "sizex"); |
|
108 |
String h = parser.getAttr("panel", "sizey"); |
|
109 |
|
|
110 |
if ((w != null) && !w.equals("")) { |
|
111 |
widthPanel = Integer.parseInt(w); |
|
112 |
} |
|
113 |
|
|
114 |
if ((h != null) && !h.equals("")) { |
|
115 |
heightPanel = Integer.parseInt(h); |
|
116 |
} |
|
117 |
} |
|
118 |
|
|
109 | 119 |
this.setPreferredSize(new Dimension(widthPanel, heightPanel)); //AnchoxAlto panel interior |
110 | 120 |
this.setBounds(0, 0, 300, 250); |
111 | 121 |
this.setLayout(null); |
112 | 122 |
this.add(getSaveParameters(), null); |
113 |
|
|
123 |
|
|
114 | 124 |
//A?adimos gesti?n de eventos |
115 |
|
|
116 |
if(saveRaster.getCombos() != null){ |
|
117 |
for(int i=0;i<saveRaster.getCombos().length;i++) |
|
118 |
saveRaster.getCombos()[i].addActionListener(this); |
|
125 |
if (saveRaster.getCombos() != null) { |
|
126 |
for (int i = 0; i < saveRaster.getCombos().length; i++) |
|
127 |
saveRaster.getCombos()[i].addActionListener(this); |
|
119 | 128 |
} |
120 |
|
|
121 |
if(saveRaster.getSliders() != null){
|
|
122 |
for(int i=0;i<saveRaster.getSliders().length;i++)
|
|
123 |
saveRaster.getSliders()[i].getSlider().addChangeListener(this);
|
|
129 |
|
|
130 |
if (saveRaster.getSliders() != null) {
|
|
131 |
for (int i = 0; i < saveRaster.getSliders().length; i++)
|
|
132 |
saveRaster.getSliders()[i].getSlider().addChangeListener(this);
|
|
124 | 133 |
} |
125 |
|
|
126 |
if(saveRaster.getChecks() != null){
|
|
127 |
for(int i=0;i<saveRaster.getChecks().length;i++)
|
|
128 |
saveRaster.getChecks()[i].addActionListener(this);
|
|
134 |
|
|
135 |
if (saveRaster.getChecks() != null) {
|
|
136 |
for (int i = 0; i < saveRaster.getChecks().length; i++)
|
|
137 |
saveRaster.getChecks()[i].addActionListener(this);
|
|
129 | 138 |
} |
130 |
|
|
131 |
} |
|
139 |
} |
|
132 | 140 |
|
133 |
/** |
|
134 |
* Asigna un valor al panel padre |
|
135 |
* @param dialogPanel |
|
136 |
*/ |
|
137 |
|
|
138 |
public void setDialogPanel(SaveRasterPropsDialogPanel dialogPanel){ |
|
139 |
this.dialogPanel = dialogPanel; |
|
140 |
} |
|
141 |
|
|
142 |
/** |
|
143 |
* Obtiene el Panel de Controles interior |
|
144 |
* @return |
|
145 |
*/ |
|
146 |
|
|
147 |
public DataInputProps getSaveParameters() { |
|
148 |
if (saveRaster == null) { |
|
149 |
saveRaster = new DataInputProps(writer); |
|
150 |
} |
|
151 |
return saveRaster; |
|
152 |
} |
|
153 |
|
|
154 |
|
|
155 |
|
|
156 |
/** |
|
157 |
* Controla cuando se cumplen todos los requisitos en el formulario para |
|
158 |
* poder activar el bot?n de aceptar. |
|
159 |
* |
|
160 |
*/ |
|
161 |
private void enableButtons(){ |
|
162 |
|
|
163 |
if(dialogPanel!=null){ |
|
164 |
dialogPanel.getAcceptButton().setEnabled(true); |
|
165 |
} |
|
166 |
|
|
167 |
} |
|
168 |
|
|
169 |
/** |
|
170 |
* Devuelve un vector de Strings en el que cada elemento es un par propiedad=valor |
|
171 |
* con las propiedades del driver seleccionado |
|
172 |
* @return Vector de propiedades |
|
173 |
*/ |
|
174 |
public String[] getProperties(){ |
|
175 |
return properties; |
|
176 |
} |
|
177 |
|
|
178 |
/** |
|
179 |
* Obtiene el nuevo vector de propiedades |
|
180 |
*/ |
|
181 |
public void stateChanged(ChangeEvent e){ |
|
182 |
properties = saveRaster.getElements(); |
|
183 |
} |
|
184 |
|
|
185 |
/** |
|
186 |
* Obtiene el nuevo vector de propiedades |
|
187 |
*/ |
|
188 |
public void actionPerformed(ActionEvent e){ |
|
189 |
properties = saveRaster.getElements(); |
|
190 |
} |
|
191 |
|
|
192 |
/** |
|
193 |
* Devuelve el nombre del fichero seleccionado |
|
194 |
* @return Nombre del fichero seleccionado |
|
195 |
*/ |
|
196 |
public String getFileName(){ |
|
197 |
return fName; |
|
198 |
} |
|
199 |
|
|
200 |
/** |
|
201 |
* Controla la activaci?n y desactivaci?n de los botones |
|
202 |
*/ |
|
203 |
public void mouseClicked(MouseEvent e){ |
|
204 |
enableButtons(); |
|
205 |
} |
|
206 |
|
|
207 |
/** |
|
208 |
* Controla la activaci?n y desactivaci?n de los botones |
|
209 |
*/ |
|
210 |
public void focusLost(FocusEvent e){ |
|
211 |
enableButtons(); |
|
212 |
} |
|
213 |
|
|
214 |
/** |
|
215 |
* Controla la activaci?n y desactivaci?n de los botones |
|
216 |
*/ |
|
217 |
public void keyTyped(KeyEvent e){ |
|
218 |
enableButtons(); |
|
219 |
} |
|
220 |
|
|
221 |
/** |
|
222 |
* Controla la activaci?n y desactivaci?n de los botones |
|
223 |
*/ |
|
224 |
public void keyPressed(KeyEvent e){ |
|
225 |
enableButtons(); |
|
226 |
} |
|
227 |
|
|
228 |
/** |
|
229 |
* Controla la activaci?n y desactivaci?n de los botones |
|
230 |
*/ |
|
231 |
public void keyReleased(KeyEvent e){ |
|
232 |
enableButtons(); |
|
233 |
} |
|
234 |
|
|
235 |
/** |
|
236 |
* Unused. Only for compilant purposes |
|
237 |
*/ |
|
238 |
public void mouseExited(MouseEvent e){} |
|
239 |
|
|
240 |
/** |
|
241 |
* Unused. Only for compilant purposes |
|
242 |
*/ |
|
243 |
public void mouseReleased(MouseEvent e){} |
|
244 |
|
|
245 |
/** |
|
246 |
* Unused. Only for compilant purposes |
|
247 |
*/ |
|
248 |
public void mouseEntered(MouseEvent e){} |
|
249 |
|
|
250 |
/** |
|
251 |
* Unused. Only for compilant purposes |
|
252 |
*/ |
|
253 |
public void mousePressed(MouseEvent e){} |
|
254 |
|
|
255 |
/** |
|
256 |
* Unused. Only for compilant purposes |
|
257 |
*/ |
|
258 |
public void focusGained(FocusEvent e){} |
|
259 |
} |
|
141 |
/** |
|
142 |
* Asigna un valor al panel padre |
|
143 |
* @param dialogPanel |
|
144 |
*/ |
|
145 |
public void setDialogPanel(SaveRasterPropsDialogPanel dialogPanel) { |
|
146 |
this.dialogPanel = dialogPanel; |
|
147 |
} |
|
260 | 148 |
|
149 |
/** |
|
150 |
* Obtiene el Panel de Controles interior |
|
151 |
* @return |
|
152 |
*/ |
|
153 |
public DataInputProps getSaveParameters() { |
|
154 |
if (saveRaster == null) { |
|
155 |
saveRaster = new DataInputProps(writer); |
|
156 |
} |
|
261 | 157 |
|
158 |
return saveRaster; |
|
159 |
} |
|
160 |
|
|
161 |
/** |
|
162 |
* Controla cuando se cumplen todos los requisitos en el formulario para |
|
163 |
* poder activar el bot?n de aceptar. |
|
164 |
* |
|
165 |
*/ |
|
166 |
private void enableButtons() { |
|
167 |
if (dialogPanel != null) { |
|
168 |
dialogPanel.getAcceptButton().setEnabled(true); |
|
169 |
} |
|
170 |
} |
|
171 |
|
|
172 |
/** |
|
173 |
* Devuelve un vector de Strings en el que cada elemento es un par propiedad=valor |
|
174 |
* con las propiedades del driver seleccionado |
|
175 |
* @return Vector de propiedades |
|
176 |
*/ |
|
177 |
public String[] getProperties() { |
|
178 |
return properties; |
|
179 |
} |
|
180 |
|
|
181 |
/** |
|
182 |
* Obtiene el nuevo vector de propiedades |
|
183 |
*/ |
|
184 |
public void stateChanged(ChangeEvent e) { |
|
185 |
properties = saveRaster.getElements(); |
|
186 |
} |
|
187 |
|
|
188 |
/** |
|
189 |
* Obtiene el nuevo vector de propiedades |
|
190 |
*/ |
|
191 |
public void actionPerformed(ActionEvent e) { |
|
192 |
properties = saveRaster.getElements(); |
|
193 |
} |
|
194 |
|
|
195 |
/** |
|
196 |
* Devuelve el nombre del fichero seleccionado |
|
197 |
* @return Nombre del fichero seleccionado |
|
198 |
*/ |
|
199 |
public String getFileName() { |
|
200 |
return fName; |
|
201 |
} |
|
202 |
|
|
203 |
/** |
|
204 |
* Controla la activaci?n y desactivaci?n de los botones |
|
205 |
*/ |
|
206 |
public void mouseClicked(MouseEvent e) { |
|
207 |
enableButtons(); |
|
208 |
} |
|
209 |
|
|
210 |
/** |
|
211 |
* Controla la activaci?n y desactivaci?n de los botones |
|
212 |
*/ |
|
213 |
public void focusLost(FocusEvent e) { |
|
214 |
enableButtons(); |
|
215 |
} |
|
216 |
|
|
217 |
/** |
|
218 |
* Controla la activaci?n y desactivaci?n de los botones |
|
219 |
*/ |
|
220 |
public void keyTyped(KeyEvent e) { |
|
221 |
enableButtons(); |
|
222 |
} |
|
223 |
|
|
224 |
/** |
|
225 |
* Controla la activaci?n y desactivaci?n de los botones |
|
226 |
*/ |
|
227 |
public void keyPressed(KeyEvent e) { |
|
228 |
enableButtons(); |
|
229 |
} |
|
230 |
|
|
231 |
/** |
|
232 |
* Controla la activaci?n y desactivaci?n de los botones |
|
233 |
*/ |
|
234 |
public void keyReleased(KeyEvent e) { |
|
235 |
enableButtons(); |
|
236 |
} |
|
237 |
|
|
238 |
/** |
|
239 |
* Unused. Only for compilant purposes |
|
240 |
*/ |
|
241 |
public void mouseExited(MouseEvent e) { |
|
242 |
} |
|
243 |
|
|
244 |
/** |
|
245 |
* Unused. Only for compilant purposes |
|
246 |
*/ |
|
247 |
public void mouseReleased(MouseEvent e) { |
|
248 |
} |
|
249 |
|
|
250 |
/** |
|
251 |
* Unused. Only for compilant purposes |
|
252 |
*/ |
|
253 |
public void mouseEntered(MouseEvent e) { |
|
254 |
} |
|
255 |
|
|
256 |
/** |
|
257 |
* Unused. Only for compilant purposes |
|
258 |
*/ |
|
259 |
public void mousePressed(MouseEvent e) { |
|
260 |
} |
|
261 |
|
|
262 |
/** |
|
263 |
* Unused. Only for compilant purposes |
|
264 |
*/ |
|
265 |
public void focusGained(FocusEvent e) { |
|
266 |
} |
|
267 |
} |
branches/CqCMSDvp/libraries/libCq CMS for java.old/src/org/cresques/ui/raster/ProgressSaveRasterPanel.java | ||
---|---|---|
1 | 1 |
/* |
2 | 2 |
* Cresques Mapping Suite. Graphic Library for constructing mapping applications. |
3 |
* |
|
4 |
* Copyright (C) 2004-5. |
|
5 | 3 |
* |
4 |
* Copyright (C) 2004-5. |
|
5 |
* |
|
6 | 6 |
* This program is free software; you can redistribute it and/or |
7 | 7 |
* modify it under the terms of the GNU General Public License |
8 | 8 |
* as published by the Free Software Foundation; either version 2 |
... | ... | |
18 | 18 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
19 | 19 |
* |
20 | 20 |
* For more information, contact: |
21 |
*
|
|
21 |
* |
|
22 | 22 |
* cresques@gmail.com |
23 | 23 |
*/ |
24 | 24 |
package org.cresques.ui.raster; |
... | ... | |
29 | 29 |
import javax.swing.JPanel; |
30 | 30 |
import javax.swing.JProgressBar; |
31 | 31 |
|
32 |
|
|
32 | 33 |
/** |
33 | 34 |
* Panel que contiene la barra de progreso para salvar a raster |
34 | 35 |
* @author Nacho Brodin <brodin_ign@gva.es> |
35 | 36 |
*/ |
36 |
public class ProgressSaveRasterPanel extends JPanel{ |
|
37 |
|
|
38 |
final private static long serialVersionUID = -3370601314380922368L; |
|
39 |
private JPanel jPanel = null; |
|
40 |
private JProgressBar jProgressBar = null; |
|
41 |
/** |
|
42 |
* Label p?blico accesible para su traducci?n |
|
43 |
*/ |
|
44 |
public JLabel wait = null; |
|
45 |
private JPanel jPanel2 = null; |
|
46 |
private JPanel jPanel1 = null; |
|
47 |
|
|
48 |
/** |
|
49 |
* This method initializes |
|
50 |
* |
|
51 |
*/ |
|
52 |
public ProgressSaveRasterPanel() { |
|
53 |
super(); |
|
54 |
initialize(); |
|
55 |
} |
|
56 |
/** |
|
57 |
* This method initializes this |
|
58 |
* |
|
59 |
* @return void |
|
60 |
*/ |
|
61 |
private void initialize() { |
|
37 |
public class ProgressSaveRasterPanel extends JPanel { |
|
38 |
final private static long serialVersionUID = -3370601314380922368L; |
|
39 |
private JPanel jPanel = null; |
|
40 |
private JProgressBar jProgressBar = null; |
|
41 |
|
|
42 |
/** |
|
43 |
* Label p?blico accesible para su traducci?n |
|
44 |
*/ |
|
45 |
public JLabel wait = null; |
|
46 |
private JPanel jPanel2 = null; |
|
47 |
private JPanel jPanel1 = null; |
|
48 |
|
|
49 |
/** |
|
50 |
* This method initializes |
|
51 |
* |
|
52 |
*/ |
|
53 |
public ProgressSaveRasterPanel() { |
|
54 |
super(); |
|
55 |
initialize(); |
|
56 |
} |
|
57 |
|
|
58 |
/** |
|
59 |
* This method initializes this |
|
60 |
* |
|
61 |
* @return void |
|
62 |
*/ |
|
63 |
private void initialize() { |
|
62 | 64 |
this.setSize(369, 106); |
63 | 65 |
this.add(getJPanel(), null); |
64 |
|
|
65 |
} |
|
66 |
/** |
|
67 |
* This method initializes jPanel |
|
68 |
* |
|
69 |
* @return javax.swing.JPanel |
|
70 |
*/ |
|
71 |
private JPanel getJPanel() { |
|
72 |
if (jPanel == null) { |
|
73 |
wait = new JLabel(); |
|
74 |
jPanel = new JPanel(); |
|
75 |
jPanel.setLayout(new BorderLayout()); |
|
76 |
jPanel.setPreferredSize(new java.awt.Dimension(354,70)); |
|
77 |
wait.setText("Por favor, espere ..."); |
|
78 |
jPanel.add(wait, java.awt.BorderLayout.NORTH); |
|
79 |
jPanel.add(getJPanel2(), java.awt.BorderLayout.SOUTH); |
|
80 |
jPanel.add(getJPanel1(), java.awt.BorderLayout.CENTER); |
|
81 |
} |
|
82 |
return jPanel; |
|
83 |
} |
|
84 |
/** |
|
85 |
* This method initializes jProgressBar |
|
86 |
* |
|
87 |
* @return javax.swing.JProgressBar |
|
88 |
*/ |
|
89 |
public JProgressBar getJProgressBar() { |
|
90 |
if (jProgressBar == null) { |
|
91 |
jProgressBar = new JProgressBar(); |
|
92 |
jProgressBar.setVisible(true); |
|
93 |
jProgressBar.show(); |
|
94 |
jProgressBar.setValue(0); |
|
95 |
jProgressBar.setPreferredSize(new java.awt.Dimension(350,25)); |
|
96 |
} |
|
97 |
return jProgressBar; |
|
98 |
} |
|
99 |
/** |
|
100 |
* This method initializes jPanel2 |
|
101 |
* |
|
102 |
* @return javax.swing.JPanel |
|
103 |
*/ |
|
104 |
private JPanel getJPanel2() { |
|
105 |
if (jPanel2 == null) { |
|
106 |
jPanel2 = new JPanel(); |
|
107 |
jPanel2.add(getJProgressBar(), null); |
|
108 |
} |
|
109 |
return jPanel2; |
|
110 |
} |
|
111 |
/** |
|
112 |
* This method initializes jPanel1 |
|
113 |
* |
|
114 |
* @return javax.swing.JPanel |
|
115 |
*/ |
|
116 |
private JPanel getJPanel1() { |
|
117 |
if (jPanel1 == null) { |
|
118 |
jPanel1 = new JPanel(); |
|
119 |
} |
|
120 |
return jPanel1; |
|
121 |
} |
|
122 |
} // @jve:decl-index=0:visual-constraint="10,10" |
|
66 |
} |
|
67 |
|
|
68 |
/** |
|
69 |
* This method initializes jPanel |
|
70 |
* |
|
71 |
* @return javax.swing.JPanel |
|
72 |
*/ |
|
73 |
private JPanel getJPanel() { |
|
74 |
if (jPanel == null) { |
|
75 |
wait = new JLabel(); |
|
76 |
jPanel = new JPanel(); |
|
77 |
jPanel.setLayout(new BorderLayout()); |
|
78 |
jPanel.setPreferredSize(new java.awt.Dimension(354, 70)); |
|
79 |
wait.setText("Por favor, espere ..."); |
|
80 |
jPanel.add(wait, java.awt.BorderLayout.NORTH); |
|
81 |
jPanel.add(getJPanel2(), java.awt.BorderLayout.SOUTH); |
|
82 |
jPanel.add(getJPanel1(), java.awt.BorderLayout.CENTER); |
|
83 |
} |
|
84 |
|
|
85 |
return jPanel; |
|
86 |
} |
|
87 |
|
|
88 |
/** |
|
89 |
* This method initializes jProgressBar |
|
90 |
* |
|
91 |
* @return javax.swing.JProgressBar |
|
92 |
*/ |
|
93 |
public JProgressBar getJProgressBar() { |
|
94 |
if (jProgressBar == null) { |
|
95 |
jProgressBar = new JProgressBar(); |
|
96 |
jProgressBar.setVisible(true); |
|
97 |
jProgressBar.show(); |
|
98 |
jProgressBar.setValue(0); |
|
99 |
jProgressBar.setPreferredSize(new java.awt.Dimension(350, 25)); |
|
100 |
} |
|
101 |
|
|
102 |
return jProgressBar; |
|
103 |
} |
|
104 |
|
|
105 |
/** |
|
106 |
* This method initializes jPanel2 |
|
107 |
* |
|
108 |
* @return javax.swing.JPanel |
|
109 |
*/ |
|
110 |
private JPanel getJPanel2() { |
|
111 |
if (jPanel2 == null) { |
|
112 |
jPanel2 = new JPanel(); |
|
113 |
jPanel2.add(getJProgressBar(), null); |
|
114 |
} |
|
115 |
|
|
116 |
return jPanel2; |
|
117 |
} |
|
118 |
|
|
119 |
/** |
|
120 |
* This method initializes jPanel1 |
|
121 |
* |
|
122 |
* @return javax.swing.JPanel |
|
123 |
*/ |
|
124 |
private JPanel getJPanel1() { |
|
125 |
if (jPanel1 == null) { |
|
126 |
jPanel1 = new JPanel(); |
|
127 |
} |
|
128 |
|
|
129 |
return jPanel1; |
|
130 |
} |
|
131 |
} // @jve:decl-index=0:visual-constraint="10,10" |
branches/CqCMSDvp/libraries/libCq CMS for java.old/src/org/cresques/ui/raster/RasterPropsDialogPanel.java | ||
---|---|---|
1 | 1 |
/* |
2 | 2 |
* Cresques Mapping Suite. Graphic Library for constructing mapping applications. |
3 |
* |
|
4 |
* Copyright (C) 2004-5. |
|
5 | 3 |
* |
4 |
* Copyright (C) 2004-5. |
|
5 |
* |
|
6 | 6 |
* This program is free software; you can redistribute it and/or |
7 | 7 |
* modify it under the terms of the GNU General Public License |
8 | 8 |
* as published by the Free Software Foundation; either version 2 |
... | ... | |
18 | 18 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
19 | 19 |
* |
20 | 20 |
* For more information, contact: |
21 |
*
|
|
21 |
* |
|
22 | 22 |
* cresques@gmail.com |
23 | 23 |
*/ |
24 | 24 |
package org.cresques.ui.raster; |
25 | 25 |
|
26 |
import javax.swing.JPanel;
|
|
26 |
import org.cresques.io.GeoRasterFile;
|
|
27 | 27 |
|
28 |
import org.cresques.io.GeoRasterFile; |
|
29 | 28 |
import org.cresques.ui.DefaultDialogPanel; |
30 | 29 |
|
30 |
import javax.swing.JPanel; |
|
31 |
|
|
32 |
|
|
31 | 33 |
/** |
32 | 34 |
* Dialogo para configurar las propiedades del raster. |
33 | 35 |
* @author "Luis W. Sevilla" <sevilla_lui@gva.es> |
34 | 36 |
*/ |
35 | 37 |
public class RasterPropsDialogPanel extends DefaultDialogPanel { |
36 |
final private static long serialVersionUID = -3370601314380922368L; |
|
37 |
/** |
|
38 |
* Constructor |
|
39 |
*/ |
|
40 |
public RasterPropsDialogPanel() { |
|
41 |
super(); |
|
42 |
initialize(); |
|
43 |
} |
|
38 |
final private static long serialVersionUID = -3370601314380922368L; |
|
44 | 39 |
|
45 |
/** |
|
46 |
* This method initializes this |
|
47 |
* |
|
48 |
* @return void |
|
49 |
*/ |
|
50 |
private void initialize() { |
|
51 |
this.setBounds(0,0,355,230); |
|
52 |
} |
|
53 |
|
|
54 |
/** |
|
55 |
* Obtiene el panel BandSetupPanel con los controles |
|
56 |
* @return BandSetupPanel |
|
57 |
*/ |
|
58 |
protected BandSetupPanel getBandSetupPanel() { |
|
59 |
return (BandSetupPanel) getContentPanel(); |
|
60 |
} |
|
61 |
|
|
62 |
/** |
|
63 |
* Obtiene el contentPane |
|
64 |
*/ |
|
65 |
protected JPanel getContentPanel() { |
|
66 |
if (contentPane == null) { |
|
67 |
contentPane = new BandSetupPanel(); |
|
68 |
contentPane.setBounds(14, 12, 345, 174); |
|
69 |
} |
|
70 |
return contentPane; |
|
71 |
} |
|
72 |
|
|
73 |
/** |
|
74 |
* A?ade una lista de GeoRasterFile al panel de bandas |
|
75 |
* @param files Array de GeoRasterFile |
|
76 |
*/ |
|
77 |
public void addFiles(GeoRasterFile[] files) { |
|
78 |
getBandSetupPanel().addFiles(files); |
|
79 |
getBandSetupPanel().repaint(); |
|
80 |
this.repaint(); |
|
81 |
} |
|
82 |
|
|
83 |
/** |
|
84 |
* @param nBand |
|
85 |
* @param flag |
|
86 |
*/ |
|
87 |
public void assignBand(int nBand, int flag) { |
|
88 |
getBandSetupPanel().assignBand(nBand, flag); |
|
89 |
} |
|
90 |
|
|
91 |
public int getAssignedBand(int flag) { |
|
92 |
return getBandSetupPanel().getAssignedBand(flag); |
|
93 |
} |
|
40 |
/** |
|
41 |
* Constructor |
|
42 |
*/ |
|
43 |
public RasterPropsDialogPanel() { |
|
44 |
super(); |
|
45 |
initialize(); |
|
46 |
} |
|
47 |
|
|
48 |
/** |
|
49 |
* This method initializes this |
|
50 |
* |
|
51 |
* @return void |
|
52 |
*/ |
|
53 |
private void initialize() { |
|
54 |
this.setBounds(0, 0, 355, 230); |
|
55 |
} |
|
56 |
|
|
57 |
/** |
|
58 |
* Obtiene el panel BandSetupPanel con los controles |
|
59 |
* @return BandSetupPanel |
|
60 |
*/ |
|
61 |
protected BandSetupPanel getBandSetupPanel() { |
|
62 |
return (BandSetupPanel) getContentPanel(); |
|
63 |
} |
|
64 |
|
|
65 |
/** |
|
66 |
* Obtiene el contentPane |
|
67 |
*/ |
|
68 |
protected JPanel getContentPanel() { |
|
69 |
if (contentPane == null) { |
|
70 |
contentPane = new BandSetupPanel(); |
|
71 |
contentPane.setBounds(14, 12, 345, 174); |
|
72 |
} |
|
73 |
|
|
74 |
return contentPane; |
|
75 |
} |
|
76 |
|
|
77 |
/** |
|
78 |
* A?ade una lista de GeoRasterFile al panel de bandas |
|
79 |
* @param files Array de GeoRasterFile |
|
80 |
*/ |
|
81 |
public void addFiles(GeoRasterFile[] files) { |
|
82 |
getBandSetupPanel().addFiles(files); |
|
83 |
getBandSetupPanel().repaint(); |
|
84 |
this.repaint(); |
|
85 |
} |
|
86 |
|
|
87 |
/** |
|
88 |
* @param nBand |
|
89 |
* @param flag |
|
90 |
*/ |
|
91 |
public void assignBand(int nBand, int flag) { |
|
92 |
getBandSetupPanel().assignBand(nBand, flag); |
|
93 |
} |
|
94 |
|
|
95 |
public int getAssignedBand(int flag) { |
|
96 |
return getBandSetupPanel().getAssignedBand(flag); |
|
97 |
} |
|
94 | 98 |
} |
95 |
|
branches/CqCMSDvp/libraries/libCq CMS for java.old/src/org/cresques/ui/raster/EnhancedPanel.java | ||
---|---|---|
1 | 1 |
/* |
2 | 2 |
* Cresques Mapping Suite. Graphic Library for constructing mapping applications. |
3 |
* |
|
4 |
* Copyright (C) 2004-5. |
|
5 | 3 |
* |
4 |
* Copyright (C) 2004-5. |
|
5 |
* |
|
6 | 6 |
* This program is free software; you can redistribute it and/or |
7 | 7 |
* modify it under the terms of the GNU General Public License |
8 | 8 |
* as published by the Free Software Foundation; either version 2 |
... | ... | |
18 | 18 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
19 | 19 |
* |
20 | 20 |
* For more information, contact: |
21 |
*
|
|
21 |
* |
|
22 | 22 |
* cresques@gmail.com |
23 | 23 |
*/ |
24 | 24 |
package org.cresques.ui.raster; |
... | ... | |
37 | 37 |
import javax.swing.JRadioButton; |
38 | 38 |
import javax.swing.JSlider; |
39 | 39 |
import javax.swing.JTextField; |
40 |
|
|
41 |
|
|
40 | 42 |
/** |
41 |
* Panel que contiene los elementos para el dialogo del filtro de realce
|
|
43 |
* Panel que contiene los elementos para el dialogo del filtro de realce |
|
42 | 44 |
* @author Nacho Brodin <brodin_ign@gva.es> |
43 | 45 |
*/ |
44 |
public class EnhancedPanel extends JPanel{ |
|
45 |
|
|
46 |
final private static long serialVersionUID = -3370601314380922368L; |
|
47 |
public String nom = "Realce"; |
|
48 |
FilterRasterDialogPanel parent = null; |
|
49 |
|
|
50 |
private JPanel jPanel = null; |
|
51 |
private JPanel jPanel1 = null; |
|
52 |
private JPanel jPanel2 = null; |
|
53 |
private JPanel jPanel3 = null; |
|
54 |
private JRadioButton jRadioButton = null; |
|
55 |
private JRadioButton jRadioButton1 = null; |
|
56 |
private JCheckBox jCheckBox = null; |
|
57 |
public JLabel jLabel = null; |
|
58 |
public JLabel jLabel2 = null; |
|
59 |
public JPanel jPanel4 = null; |
|
60 |
private ButtonGroup grupo= new ButtonGroup(); |
|
61 |
private Image iconoLineal = null; |
|
62 |
private Image iconoSinRealce = null; |
|
63 |
|
|
64 |
private JPanel jPanel5 = null; |
|
65 |
private JSlider jSlider = null; |
|
66 |
private JTextField jTextField = null; |
|
67 |
|
|
68 |
|
|
69 |
private JPanel jPanel6 = null; |
|
70 |
private JCheckBox jCheckBox1 = null; |
|
71 |
public JLabel jLabel4 = null; |
|
72 |
public JPanel jPanel7 = null; |
|
73 |
public JLabel jLabel1 = null; |
|
74 |
public JPanel jPanel8 = null; |
|
75 |
public JPanel jPanel9 = null; |
|
76 |
public JLabel jLabel5 = null; |
|
77 |
|
|
78 |
/** |
|
79 |
* Constructor. |
|
80 |
* @param parent |
|
81 |
*/ |
|
82 |
public EnhancedPanel(FilterRasterDialogPanel parent){ |
|
83 |
this.parent = parent; |
|
84 |
initialize(); |
|
85 |
} |
|
46 |
public class EnhancedPanel extends JPanel { |
|
47 |
final private static long serialVersionUID = -3370601314380922368L; |
|
48 |
public String nom = "Realce"; |
|
49 |
FilterRasterDialogPanel parent = null; |
|
50 |
private JPanel jPanel = null; |
|
51 |
private JPanel jPanel1 = null; |
|
52 |
private JPanel jPanel2 = null; |
|
53 |
private JPanel jPanel3 = null; |
|
54 |
private JRadioButton jRadioButton = null; |
|
55 |
private JRadioButton jRadioButton1 = null; |
|
56 |
private JCheckBox jCheckBox = null; |
|
57 |
public JLabel jLabel = null; |
|
58 |
public JLabel jLabel2 = null; |
|
59 |
public JPanel jPanel4 = null; |
|
60 |
private ButtonGroup grupo = new ButtonGroup(); |
|
61 |
private Image iconoLineal = null; |
|
62 |
private Image iconoSinRealce = null; |
|
63 |
private JPanel jPanel5 = null; |
|
64 |
private JSlider jSlider = null; |
|
65 |
private JTextField jTextField = null; |
|
66 |
private JPanel jPanel6 = null; |
|
67 |
private JCheckBox jCheckBox1 = null; |
|
68 |
public JLabel jLabel4 = null; |
|
69 |
public JPanel jPanel7 = null; |
|
70 |
public JLabel jLabel1 = null; |
|
71 |
public JPanel jPanel8 = null; |
|
72 |
public JPanel jPanel9 = null; |
|
73 |
public JLabel jLabel5 = null; |
|
86 | 74 |
|
87 |
/** |
|
88 |
* This method initializes this |
|
89 |
* |
|
90 |
* @return void |
|
91 |
*/ |
|
92 |
private void initialize() { |
|
75 |
/** |
|
76 |
* Constructor. |
|
77 |
* @param parent |
|
78 |
*/ |
|
79 |
public EnhancedPanel(FilterRasterDialogPanel parent) { |
|
80 |
this.parent = parent; |
|
81 |
initialize(); |
|
82 |
} |
|
83 |
|
|
84 |
/** |
|
85 |
* This method initializes this |
|
86 |
* |
|
87 |
* @return void |
|
88 |
*/ |
|
89 |
private void initialize() { |
|
93 | 90 |
this.setLayout(new BorderLayout()); |
94 | 91 |
this.setSize(445, 239); |
95 |
this.setPreferredSize(new java.awt.Dimension(445,239)); |
|
92 |
this.setPreferredSize(new java.awt.Dimension(445, 239));
|
|
96 | 93 |
this.add(getJPanel(), java.awt.BorderLayout.CENTER); |
97 |
|
|
98 |
initControls(); |
|
99 |
} |
|
100 |
|
|
101 |
/** |
|
102 |
* Inicializa controles a sus valores por defecto |
|
103 |
*/ |
|
104 |
public void initControls(){ |
|
105 |
jRadioButton1.setSelected(true); |
|
106 |
this.getTailText().setText("0.0"); |
|
107 |
this.getTailSlider().setValue(0); |
|
108 |
this.setActiveTailControl(false); |
|
109 |
this.getTailCheck().setEnabled(false); |
|
110 |
this.getRemoveCheck().setEnabled(false); |
|
111 |
} |
|
112 |
|
|
113 |
|
|
114 |
/** |
|
115 |
* This method initializes jPanel |
|
116 |
* |
|
117 |
* @return javax.swing.JPanel |
|
118 |
*/ |
|
119 |
private JPanel getJPanel() { |
|
120 |
if (jPanel == null) { |
|
121 |
FlowLayout flowLayout2 = new FlowLayout(); |
|
122 |
GridBagConstraints gridBagConstraints4 = new GridBagConstraints(); |
|
123 |
jPanel = new JPanel(); |
|
124 |
jPanel.setLayout(flowLayout2); |
|
125 |
gridBagConstraints4.gridx = 0; |
|
126 |
gridBagConstraints4.gridy = 0; |
|
127 |
jPanel.setPreferredSize(new java.awt.Dimension(445,239)); |
|
128 |
flowLayout2.setAlignment(java.awt.FlowLayout.CENTER); |
|
129 |
jPanel.add(getJPanel4(), null); |
|
130 |
jPanel.add(getJPanel8(), null); |
|
131 |
} |
|
132 |
return jPanel; |
|
133 |
} |
|
134 |
/** |
|
135 |
* This method initializes jPanel1 |
|
136 |
* |
|
137 |
* @return javax.swing.JPanel |
|
138 |
*/ |
|
139 |
private JPanel getJPanel1() { |
|
140 |
if (jPanel1 == null) { |
|
141 |
jLabel = new JLabel("Lineal directo",new ImageIcon("images/lineal.gif"), JLabel.CENTER); |
|
142 |
jPanel1 = new JPanel(); |
|
143 |
jPanel1.setLayout(new BorderLayout()); |
|
144 |
jPanel1.add(getLinealDirectoRadioButton(), java.awt.BorderLayout.WEST); |
|
145 |
jPanel1.add(jLabel, java.awt.BorderLayout.EAST); |
|
146 |
} |
|
147 |
return jPanel1; |
|
148 |
} |
|
149 |
/** |
|
150 |
* This method initializes jPanel2 |
|
151 |
* |
|
152 |
* @return javax.swing.JPanel |
|
153 |
*/ |
|
154 |
private JPanel getJPanel2() { |
|
155 |
if (jPanel2 == null) { |
|
156 |
jPanel2 = new JPanel(); |
|
157 |
jPanel2.setLayout(new BorderLayout()); |
|
158 |
jPanel2.setBorder(javax.swing.BorderFactory.createLineBorder(java.awt.Color.gray,1)); |
|
159 |
jPanel2.setPreferredSize(new java.awt.Dimension(220,95)); |
|
160 |
jPanel2.add(getJPanel5(), java.awt.BorderLayout.CENTER); |
|
161 |
jPanel2.add(getJPanel6(), java.awt.BorderLayout.SOUTH); |
|
162 |
jPanel2.add(getJPanel7(), java.awt.BorderLayout.NORTH); |
|
163 |
} |
|
164 |
return jPanel2; |
|
165 |
} |
|
166 |
/** |
|
167 |
* This method initializes jPanel3 |
|
168 |
* |
|
169 |
* @return javax.swing.JPanel |
|
170 |
*/ |
|
171 |
private JPanel getJPanel3() { |
|
172 |
if (jPanel3 == null) { |
|
173 |
jLabel2 = new JLabel("Sin Realce",new ImageIcon("images/sinrealce.gif"), JLabel.CENTER); |
|
174 |
jPanel3 = new JPanel(); |
|
175 |
jPanel3.setLayout(new BorderLayout()); |
|
176 |
jPanel3.add(getSinRealceRadioButton(), java.awt.BorderLayout.WEST); |
|
177 |
jPanel3.add(jLabel2, java.awt.BorderLayout.EAST); |
|
178 |
} |
|
179 |
return jPanel3; |
|
180 |
} |
|
181 |
/** |
|
182 |
* This method initializes jRadioButton |
|
183 |
* |
|
184 |
* @return javax.swing.JRadioButton |
|
185 |
*/ |
|
186 |
public JRadioButton getLinealDirectoRadioButton() { |
|
187 |
if (jRadioButton == null) { |
|
188 |
jRadioButton = new JRadioButton(); |
|
189 |
grupo.add(jRadioButton); |
|
190 |
} |
|
191 |
return jRadioButton; |
|
192 |
} |
|
193 |
/** |
|
194 |
* This method initializes jRadioButton1 |
|
195 |
* |
|
196 |
* @return javax.swing.JRadioButton |
|
197 |
*/ |
|
198 |
public JRadioButton getSinRealceRadioButton() { |
|
199 |
if (jRadioButton1 == null) { |
|
200 |
jRadioButton1 = new JRadioButton(); |
Also available in: Unified diff