Revision 22364
trunk/extensions/extRasterTools-SE/src/org/gvsig/raster/util/PanelBase.java | ||
---|---|---|
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
2 |
* |
|
3 |
* Copyright (C) 2005 IVER T.I. 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 |
package org.gvsig.raster.util; |
|
20 |
|
|
21 |
import javax.swing.JPanel; |
|
22 |
|
|
23 |
import com.iver.andami.PluginServices; |
|
24 |
|
|
25 |
public abstract class PanelBase { |
|
26 |
private JPanel jPanel = null; |
|
27 |
|
|
28 |
public JPanel getPanel() { |
|
29 |
if (jPanel == null) { |
|
30 |
jPanel = new JPanel(); |
|
31 |
} |
|
32 |
return jPanel; |
|
33 |
} |
|
34 |
|
|
35 |
public String getText(Object parent, String text) { |
|
36 |
return PluginServices.getText(parent, text); |
|
37 |
} |
|
38 |
} |
trunk/extensions/extRasterTools-SE/src/org/gvsig/raster/util/BasePanel.java | ||
---|---|---|
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
2 |
* |
|
3 |
* Copyright (C) 2005 IVER T.I. 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 |
package org.gvsig.raster.util; |
|
20 |
|
|
21 |
import javax.swing.JPanel; |
|
22 |
|
|
23 |
/** |
|
24 |
* Clase base para los paneles gr?ficos. Un panel hereda de BasePanel y anadir? |
|
25 |
* sus elementos con getPanel().add(...). Cuando se quiere obtener el panel asociado |
|
26 |
* se har? tambi?n con el m?todo getPanel(). |
|
27 |
* |
|
28 |
* 17/07/2008 |
|
29 |
* @author Nacho Brodin nachobrodin@gmail.com |
|
30 |
*/ |
|
31 |
public abstract class BasePanel extends JPanel { |
|
32 |
private boolean enableValueChangedEvent = true; |
|
33 |
|
|
34 |
/** |
|
35 |
* Obtiene la traducci?n de la cadena de texto |
|
36 |
* @param parent Ventana padre |
|
37 |
* @param text Cadena a traducir |
|
38 |
* @return Cadena de texto traducida |
|
39 |
*/ |
|
40 |
public String getText(Object parent, String text) { |
|
41 |
return RasterToolsUtil.getText(parent, text); |
|
42 |
} |
|
43 |
|
|
44 |
/** |
|
45 |
* Asigna el valor para la activaci?n y desactivaci?n del evento de cambio de valor en |
|
46 |
* las cajas de texto. |
|
47 |
* @param enableValueChangedEvent |
|
48 |
*/ |
|
49 |
public void setEnableValueChangedEvent(boolean enableValueChangedEvent) { |
|
50 |
this.enableValueChangedEvent = enableValueChangedEvent; |
|
51 |
} |
|
52 |
|
|
53 |
/** |
|
54 |
* Obtiene el valor para la activaci?n y desactivaci?n del evento de cambio de valor en |
|
55 |
* las cajas de texto. |
|
56 |
* @param enableValueChangedEvent |
|
57 |
*/ |
|
58 |
public boolean getEnableValueChangedEvent() { |
|
59 |
return this.enableValueChangedEvent; |
|
60 |
} |
|
61 |
|
|
62 |
/** |
|
63 |
* Traducci?n centralizada de los componentes de una panel |
|
64 |
*/ |
|
65 |
protected abstract void translate(); |
|
66 |
|
|
67 |
/** |
|
68 |
* Acciones de inicializaci?n |
|
69 |
*/ |
|
70 |
protected abstract void init(); |
|
71 |
} |
trunk/extensions/extRasterTools-SE/src/org/gvsig/raster/gui/preferences/RasterPreferences.java | ||
---|---|---|
86 | 86 |
gridBagConstraints.gridx = 0; |
87 | 87 |
gridBagConstraints.gridy = 0; |
88 | 88 |
gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; |
89 |
panel.add(getPreferenceGeneral().getPanel(), gridBagConstraints);
|
|
89 |
panel.add(getPreferenceGeneral(), gridBagConstraints); |
|
90 | 90 |
|
91 | 91 |
gridBagConstraints = new GridBagConstraints(); |
92 | 92 |
gridBagConstraints.gridx = 0; |
93 | 93 |
gridBagConstraints.gridy = 1; |
94 | 94 |
gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; |
95 |
panel.add(getPreferenceLoadLayer().getPanel(), gridBagConstraints);
|
|
95 |
panel.add(getPreferenceLoadLayer(), gridBagConstraints); |
|
96 | 96 |
|
97 | 97 |
gridBagConstraints = new GridBagConstraints(); |
98 | 98 |
gridBagConstraints.gridx = 0; |
99 | 99 |
gridBagConstraints.gridy = 2; |
100 | 100 |
gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; |
101 |
panel.add(getPreferenceNoData().getPanel(), gridBagConstraints);
|
|
101 |
panel.add(getPreferenceNoData(), gridBagConstraints); |
|
102 | 102 |
|
103 | 103 |
gridBagConstraints = new GridBagConstraints(); |
104 | 104 |
gridBagConstraints.gridx = 0; |
105 | 105 |
gridBagConstraints.gridy = 3; |
106 | 106 |
gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; |
107 |
panel.add(getPreferenceTemporal().getPanel(), gridBagConstraints);
|
|
107 |
panel.add(getPreferenceTemporal(), gridBagConstraints); |
|
108 | 108 |
|
109 | 109 |
gridBagConstraints = new GridBagConstraints(); |
110 | 110 |
gridBagConstraints.gridx = 0; |
111 | 111 |
gridBagConstraints.gridy = 4; |
112 | 112 |
gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; |
113 |
panel.add(getPreferenceOverviews().getPanel(), gridBagConstraints);
|
|
113 |
panel.add(getPreferenceOverviews(), gridBagConstraints); |
|
114 | 114 |
|
115 | 115 |
gridBagConstraints = new GridBagConstraints(); |
116 | 116 |
gridBagConstraints.gridx = 0; |
117 | 117 |
gridBagConstraints.gridy = 5; |
118 | 118 |
gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; |
119 |
panel.add(getPreferenceCache().getPanel(), gridBagConstraints);
|
|
119 |
panel.add(getPreferenceCache(), gridBagConstraints); |
|
120 | 120 |
|
121 | 121 |
gridBagConstraints = new GridBagConstraints(); |
122 | 122 |
gridBagConstraints.gridx = 0; |
trunk/extensions/extRasterTools-SE/src/org/gvsig/raster/gui/preferences/panels/PreferenceCache.java | ||
---|---|---|
36 | 36 |
|
37 | 37 |
import org.gvsig.raster.Configuration; |
38 | 38 |
import org.gvsig.raster.RasterLibrary; |
39 |
import org.gvsig.raster.util.PanelBase;
|
|
39 |
import org.gvsig.raster.util.BasePanel;
|
|
40 | 40 |
/** |
41 | 41 |
* PreferenceCache es la clase que se encarga de configurar en RasterPreferences |
42 | 42 |
* las opciones de cacheamiento de capas en Raster. |
... | ... | |
44 | 44 |
* @version 14/12/2007 |
45 | 45 |
* @author BorSanZa - Borja S?nchez Zamorano (borja.sanchez@iver.es) |
46 | 46 |
*/ |
47 |
public class PreferenceCache extends PanelBase { |
|
47 |
public class PreferenceCache extends BasePanel { |
|
48 |
protected static final long serialVersionUID = 1L; |
|
48 | 49 |
private JLabel labelWarning = null; |
49 | 50 |
private JLabel labelBlockHeight = null; |
50 | 51 |
private JComboBox comboBoxBlockHeight = null; |
... | ... | |
54 | 55 |
private JFormattedTextField textFieldPagsPerGroup = null; |
55 | 56 |
private JLabel labelPageSize = null; |
56 | 57 |
private JFormattedTextField textFieldPageSize = null; |
57 |
|
|
58 |
|
|
59 |
/** |
|
60 |
*Inicializa componentes gr?ficos y traduce |
|
61 |
*/ |
|
58 | 62 |
public PreferenceCache() { |
59 |
initialize();
|
|
63 |
init(); |
|
60 | 64 |
translate(); |
61 | 65 |
} |
62 |
|
|
66 |
|
|
63 | 67 |
/** |
64 | 68 |
* Define todas las traducciones de PreferenceCache |
65 | 69 |
*/ |
66 |
private void translate() {
|
|
67 |
getPanel().setBorder(BorderFactory.createTitledBorder(getText(this, "cache")));
|
|
70 |
protected void translate() {
|
|
71 |
setBorder(BorderFactory.createTitledBorder(getText(this, "cache"))); |
|
68 | 72 |
getLabelWarning().setText(getText(this, "preference_cache_warning")); |
69 | 73 |
getLabelCacheSize().setText(getText(this, "tamanyo") + ":"); |
70 | 74 |
getLabelPagsPerGroup().setText(getText(this, "paginas_grupo") + ":"); |
... | ... | |
72 | 76 |
getLabelBlockHeight().setText(getText(this, "bloques_procesos") + ":"); |
73 | 77 |
} |
74 | 78 |
|
75 |
private void initialize() {
|
|
79 |
protected void init() {
|
|
76 | 80 |
GridBagConstraints gridBagConstraints; |
77 | 81 |
|
78 |
getPanel().setLayout(new GridBagLayout());
|
|
82 |
setLayout(new GridBagLayout()); |
|
79 | 83 |
|
80 | 84 |
gridBagConstraints = new GridBagConstraints(); |
81 | 85 |
gridBagConstraints.gridwidth = 2; |
82 | 86 |
gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; |
83 | 87 |
gridBagConstraints.weightx = 1.0; |
84 | 88 |
gridBagConstraints.insets = new Insets(5, 5, 2, 5); |
85 |
getPanel().add(getLabelWarning(), gridBagConstraints);
|
|
89 |
add(getLabelWarning(), gridBagConstraints); |
|
86 | 90 |
|
87 | 91 |
gridBagConstraints = new GridBagConstraints(); |
88 | 92 |
gridBagConstraints.gridx = 0; |
89 | 93 |
gridBagConstraints.gridy = 1; |
90 | 94 |
gridBagConstraints.anchor = GridBagConstraints.EAST; |
91 | 95 |
gridBagConstraints.insets = new Insets(2, 5, 2, 2); |
92 |
getPanel().add(getLabelCacheSize(), gridBagConstraints);
|
|
96 |
add(getLabelCacheSize(), gridBagConstraints); |
|
93 | 97 |
|
94 | 98 |
gridBagConstraints = new GridBagConstraints(); |
95 | 99 |
gridBagConstraints.gridx = 0; |
96 | 100 |
gridBagConstraints.gridy = 2; |
97 | 101 |
gridBagConstraints.anchor = GridBagConstraints.EAST; |
98 | 102 |
gridBagConstraints.insets = new Insets(2, 5, 2, 2); |
99 |
getPanel().add(getLabelPagsPerGroup(), gridBagConstraints);
|
|
103 |
add(getLabelPagsPerGroup(), gridBagConstraints); |
|
100 | 104 |
|
101 | 105 |
gridBagConstraints = new GridBagConstraints(); |
102 | 106 |
gridBagConstraints.gridx = 0; |
103 | 107 |
gridBagConstraints.gridy = 3; |
104 | 108 |
gridBagConstraints.anchor = GridBagConstraints.EAST; |
105 | 109 |
gridBagConstraints.insets = new Insets(2, 5, 2, 2); |
106 |
getPanel().add(getLabelPageSize(), gridBagConstraints);
|
|
110 |
add(getLabelPageSize(), gridBagConstraints); |
|
107 | 111 |
|
108 | 112 |
gridBagConstraints = new GridBagConstraints(); |
109 | 113 |
gridBagConstraints.gridx = 0; |
110 | 114 |
gridBagConstraints.gridy = 4; |
111 | 115 |
gridBagConstraints.anchor = GridBagConstraints.EAST; |
112 | 116 |
gridBagConstraints.insets = new Insets(2, 5, 5, 2); |
113 |
getPanel().add(getLabelBlockHeight(), gridBagConstraints);
|
|
117 |
add(getLabelBlockHeight(), gridBagConstraints); |
|
114 | 118 |
|
115 | 119 |
gridBagConstraints = new GridBagConstraints(); |
116 | 120 |
gridBagConstraints.gridx = 1; |
... | ... | |
118 | 122 |
gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; |
119 | 123 |
gridBagConstraints.anchor = GridBagConstraints.WEST; |
120 | 124 |
gridBagConstraints.insets = new Insets(2, 2, 2, 5); |
121 |
getPanel().add(getTextFieldCacheSize(), gridBagConstraints);
|
|
125 |
add(getTextFieldCacheSize(), gridBagConstraints); |
|
122 | 126 |
|
123 | 127 |
gridBagConstraints = new GridBagConstraints(); |
124 | 128 |
gridBagConstraints.gridx = 1; |
... | ... | |
126 | 130 |
gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; |
127 | 131 |
gridBagConstraints.anchor = GridBagConstraints.WEST; |
128 | 132 |
gridBagConstraints.insets = new Insets(2, 2, 5, 5); |
129 |
getPanel().add(getComboBoxBlockHeight(), gridBagConstraints);
|
|
133 |
add(getComboBoxBlockHeight(), gridBagConstraints); |
|
130 | 134 |
|
131 | 135 |
gridBagConstraints = new GridBagConstraints(); |
132 | 136 |
gridBagConstraints.gridx = 1; |
... | ... | |
134 | 138 |
gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; |
135 | 139 |
gridBagConstraints.anchor = GridBagConstraints.WEST; |
136 | 140 |
gridBagConstraints.insets = new Insets(2, 2, 2, 5); |
137 |
getPanel().add(getTextFieldPageSize(), gridBagConstraints);
|
|
141 |
add(getTextFieldPageSize(), gridBagConstraints); |
|
138 | 142 |
|
139 | 143 |
gridBagConstraints = new GridBagConstraints(); |
140 | 144 |
gridBagConstraints.gridx = 1; |
... | ... | |
142 | 146 |
gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; |
143 | 147 |
gridBagConstraints.anchor = GridBagConstraints.WEST; |
144 | 148 |
gridBagConstraints.insets = new Insets(2, 2, 2, 5); |
145 |
getPanel().add(getTextFieldPagsPerGroup(), gridBagConstraints);
|
|
149 |
add(getTextFieldPagsPerGroup(), gridBagConstraints); |
|
146 | 150 |
} |
147 | 151 |
|
148 | 152 |
private JLabel getLabelWarning() { |
trunk/extensions/extRasterTools-SE/src/org/gvsig/raster/gui/preferences/panels/PreferenceTemporal.java | ||
---|---|---|
34 | 34 |
import org.gvsig.gui.beans.swing.JFileChooser; |
35 | 35 |
import org.gvsig.raster.Configuration; |
36 | 36 |
import org.gvsig.raster.RasterLibrary; |
37 |
import org.gvsig.raster.util.PanelBase;
|
|
37 |
import org.gvsig.raster.util.BasePanel;
|
|
38 | 38 |
|
39 | 39 |
import com.iver.andami.PluginServices; |
40 | 40 |
/** |
... | ... | |
44 | 44 |
* @version 12/12/2007 |
45 | 45 |
* @author BorSanZa - Borja S?nchez Zamorano (borja.sanchez@iver.es) |
46 | 46 |
*/ |
47 |
public class PreferenceTemporal extends PanelBase implements ActionListener { |
|
48 |
private JLabel labelTemporales = null; |
|
49 |
private JButton buttonOpen = null; |
|
50 |
private JTextField textFieldDirectory = null; |
|
47 |
public class PreferenceTemporal extends BasePanel implements ActionListener { |
|
48 |
private static final long serialVersionUID = 1L; |
|
49 |
private JLabel labelTemporales = null; |
|
50 |
private JButton buttonOpen = null; |
|
51 |
private JTextField textFieldDirectory = null; |
|
51 | 52 |
|
53 |
/** |
|
54 |
*Inicializa componentes gr?ficos y traduce |
|
55 |
*/ |
|
52 | 56 |
public PreferenceTemporal() { |
53 |
initialize();
|
|
57 |
init(); |
|
54 | 58 |
translate(); |
55 | 59 |
} |
56 |
|
|
57 |
/** |
|
58 |
* Define todas las cadenas de texto traducidas de esta clase |
|
60 |
|
|
61 |
/* |
|
62 |
* (non-Javadoc) |
|
63 |
* @see org.gvsig.raster.util.BasePanel#translate() |
|
59 | 64 |
*/ |
60 |
private void translate() {
|
|
61 |
getPanel().setBorder(BorderFactory.createTitledBorder(getText(this, "rutas")));
|
|
65 |
protected void translate() {
|
|
66 |
setBorder(BorderFactory.createTitledBorder(getText(this, "rutas"))); |
|
62 | 67 |
getLabelTemporales().setText(getText(this, "temporales") + ":"); |
63 | 68 |
getButtonOpen().setText(getText(this, "seleccionar_directorio")); |
64 | 69 |
} |
65 | 70 |
|
66 |
private void initialize() { |
|
71 |
/* |
|
72 |
* (non-Javadoc) |
|
73 |
* @see org.gvsig.raster.util.BasePanel#init() |
|
74 |
*/ |
|
75 |
protected void init() { |
|
67 | 76 |
GridBagConstraints gridBagConstraints; |
68 | 77 |
|
69 |
getPanel().setLayout(new GridBagLayout());
|
|
78 |
setLayout(new GridBagLayout()); |
|
70 | 79 |
|
71 | 80 |
gridBagConstraints = new GridBagConstraints(); |
72 | 81 |
gridBagConstraints.insets = new Insets(5, 5, 5, 2); |
73 |
getPanel().add(getLabelTemporales(), gridBagConstraints);
|
|
82 |
add(getLabelTemporales(), gridBagConstraints); |
|
74 | 83 |
|
75 | 84 |
gridBagConstraints = new GridBagConstraints(); |
76 | 85 |
gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; |
77 | 86 |
gridBagConstraints.weightx = 1.0; |
78 | 87 |
gridBagConstraints.insets = new Insets(5, 2, 5, 2); |
79 |
getPanel().add(getTextFieldDirectory(), gridBagConstraints);
|
|
88 |
add(getTextFieldDirectory(), gridBagConstraints); |
|
80 | 89 |
|
81 | 90 |
gridBagConstraints = new GridBagConstraints(); |
82 | 91 |
gridBagConstraints.insets = new Insets(5, 2, 5, 5); |
83 |
getPanel().add(getButtonOpen(), gridBagConstraints);
|
|
92 |
add(getButtonOpen(), gridBagConstraints); |
|
84 | 93 |
} |
85 | 94 |
|
86 | 95 |
private JLabel getLabelTemporales() { |
... | ... | |
143 | 152 |
chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); |
144 | 153 |
chooser.setDialogTitle(PluginServices.getText(this, "seleccionar_directorio")); |
145 | 154 |
|
146 |
if (chooser.showOpenDialog(getPanel()) == JFileChooser.APPROVE_OPTION)
|
|
155 |
if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION)
|
|
147 | 156 |
getTextFieldDirectory().setText(chooser.getSelectedFile().getAbsolutePath()); |
148 | 157 |
|
149 | 158 |
JFileChooser.setLastPath(this.getClass().getName(), new File(getTextFieldDirectory().getText())); |
trunk/extensions/extRasterTools-SE/src/org/gvsig/raster/gui/preferences/panels/PreferenceNoData.java | ||
---|---|---|
32 | 32 |
|
33 | 33 |
import org.gvsig.raster.Configuration; |
34 | 34 |
import org.gvsig.raster.RasterLibrary; |
35 |
import org.gvsig.raster.util.PanelBase;
|
|
35 |
import org.gvsig.raster.util.BasePanel;
|
|
36 | 36 |
/** |
37 | 37 |
* Panel para la gesti?n del valor NoData en el panel de preferencias de gvSIG. |
38 | 38 |
* |
39 | 39 |
* @version 10/12/2007 |
40 | 40 |
* @author BorSanZa - Borja S?nchez Zamorano (borja.sanchez@iver.es) |
41 | 41 |
*/ |
42 |
public class PreferenceNoData extends PanelBase {
|
|
43 |
private static final long serialVersionUID = -8964531984609056094L; |
|
42 |
public class PreferenceNoData extends BasePanel {
|
|
43 |
private static final long serialVersionUID = -8964531984609056094L;
|
|
44 | 44 |
private JCheckBox jCheckBoxNoDataEnabled = null; |
45 | 45 |
private JLabel jLabelGeneralValue = null; |
46 | 46 |
private JFormattedTextField textFieldGeneralValue = null; |
47 | 47 |
|
48 |
/** |
|
49 |
*Inicializa componentes gr?ficos y traduce |
|
50 |
*/ |
|
48 | 51 |
public PreferenceNoData() { |
49 |
initialize();
|
|
52 |
init(); |
|
50 | 53 |
translate(); |
51 | 54 |
} |
52 |
|
|
53 |
private void translate() { |
|
54 |
getPanel().setBorder(BorderFactory.createTitledBorder(getText(this, "nodata"))); |
|
55 |
|
|
56 |
/* |
|
57 |
* (non-Javadoc) |
|
58 |
* @see org.gvsig.raster.util.BasePanel#translate() |
|
59 |
*/ |
|
60 |
protected void translate() { |
|
61 |
setBorder(BorderFactory.createTitledBorder(getText(this, "nodata"))); |
|
55 | 62 |
getCheckBoxNoDataEnabled().setText(getText(this, "tratar_nodata_transparente")); |
56 | 63 |
getCheckBoxNoDataEnabled().setToolTipText(getCheckBoxNoDataEnabled().getText()); |
57 | 64 |
getLabelGeneralValue().setText(getText(this, "valor_general") + ":"); |
58 | 65 |
} |
59 | 66 |
|
60 |
private void initialize() { |
|
61 |
getPanel().setLayout(new GridBagLayout()); |
|
67 |
/* |
|
68 |
* (non-Javadoc) |
|
69 |
* @see org.gvsig.raster.util.BasePanel#init() |
|
70 |
*/ |
|
71 |
protected void init() { |
|
72 |
setLayout(new GridBagLayout()); |
|
62 | 73 |
|
63 | 74 |
int posy = 0; |
64 | 75 |
GridBagConstraints gridBagConstraints; |
... | ... | |
67 | 78 |
gridBagConstraints.gridwidth = 2; |
68 | 79 |
gridBagConstraints.anchor = GridBagConstraints.WEST; |
69 | 80 |
gridBagConstraints.insets = new Insets(5, 5, 2, 5); |
70 |
getPanel().add(getCheckBoxNoDataEnabled(), gridBagConstraints);
|
|
81 |
add(getCheckBoxNoDataEnabled(), gridBagConstraints); |
|
71 | 82 |
|
72 | 83 |
posy++; |
73 | 84 |
gridBagConstraints = new GridBagConstraints(); |
... | ... | |
75 | 86 |
gridBagConstraints.gridy = posy; |
76 | 87 |
gridBagConstraints.anchor = GridBagConstraints.EAST; |
77 | 88 |
gridBagConstraints.insets = new Insets(2, 5, 2, 2); |
78 |
getPanel().add(getLabelGeneralValue(), gridBagConstraints);
|
|
89 |
add(getLabelGeneralValue(), gridBagConstraints); |
|
79 | 90 |
|
80 | 91 |
gridBagConstraints = new GridBagConstraints(); |
81 | 92 |
gridBagConstraints.gridx = 1; |
... | ... | |
84 | 95 |
gridBagConstraints.anchor = GridBagConstraints.WEST; |
85 | 96 |
gridBagConstraints.weightx = 1.0; |
86 | 97 |
gridBagConstraints.insets = new Insets(2, 2, 2, 5); |
87 |
getPanel().add(getTextFieldGeneralValue(), gridBagConstraints);
|
|
98 |
add(getTextFieldGeneralValue(), gridBagConstraints); |
|
88 | 99 |
} |
89 | 100 |
|
90 | 101 |
private JFormattedTextField getTextFieldGeneralValue() { |
trunk/extensions/extRasterTools-SE/src/org/gvsig/raster/gui/preferences/panels/PreferenceOverviews.java | ||
---|---|---|
29 | 29 |
|
30 | 30 |
import org.gvsig.addo.Jaddo; |
31 | 31 |
import org.gvsig.raster.Configuration; |
32 |
import org.gvsig.raster.util.PanelBase;
|
|
32 |
import org.gvsig.raster.util.BasePanel;
|
|
33 | 33 |
/** |
34 | 34 |
* PreferenceOverviews es una clase para la configuracion de las overviews de |
35 | 35 |
* Raster en gvSIG |
... | ... | |
37 | 37 |
* @version 14/12/2007 |
38 | 38 |
* @author BorSanZa - Borja S?nchez Zamorano (borja.sanchez@iver.es) |
39 | 39 |
*/ |
40 |
public class PreferenceOverviews extends PanelBase { |
|
41 |
// private JCheckBox jCheckBoxAsk = null; |
|
42 |
private JComboBox comboBoxRate = null; |
|
43 |
private JComboBox comboBoxNumber = null; |
|
44 |
private JComboBox comboBoxAlgorithm = null; |
|
45 |
private JLabel labelNumber = null; |
|
46 |
private JLabel labelRate = null; |
|
47 |
private JLabel labelAlgorithm = null; |
|
40 |
public class PreferenceOverviews extends BasePanel { |
|
41 |
private static final long serialVersionUID = 1L; |
|
42 |
// private JCheckBox jCheckBoxAsk = null; |
|
43 |
private JComboBox comboBoxRate = null; |
|
44 |
private JComboBox comboBoxNumber = null; |
|
45 |
private JComboBox comboBoxAlgorithm = null; |
|
46 |
private JLabel labelNumber = null; |
|
47 |
private JLabel labelRate = null; |
|
48 |
private JLabel labelAlgorithm = null; |
|
48 | 49 |
|
50 |
/** |
|
51 |
*Inicializa componentes gr?ficos y traduce |
|
52 |
*/ |
|
49 | 53 |
public PreferenceOverviews() { |
50 |
initialize();
|
|
54 |
init(); |
|
51 | 55 |
translate(); |
52 | 56 |
} |
53 |
|
|
54 |
/** |
|
55 |
* Traduce todos los textos de esta clase |
|
57 |
|
|
58 |
/* |
|
59 |
* (non-Javadoc) |
|
60 |
* @see org.gvsig.raster.util.BasePanel#translate() |
|
56 | 61 |
*/ |
57 |
private void translate() {
|
|
58 |
getPanel().setBorder(BorderFactory.createTitledBorder(getText(this, "overviews")));
|
|
62 |
protected void translate() {
|
|
63 |
setBorder(BorderFactory.createTitledBorder(getText(this, "overviews"))); |
|
59 | 64 |
getLabelNumber().setText(getText(this, "num_overviews") + ":"); |
60 | 65 |
getLabelRate().setText(getText(this, "proporcion_overviews") + ":"); |
61 | 66 |
getLabelAlgorithm().setText(getText(this, "algorithm") + ":"); |
62 | 67 |
// getCheckBoxAsk().setText(getText(this, "generacion_overviews")); |
63 | 68 |
// getCheckBoxAsk().setToolTipText(getCheckBoxAsk().getText()); |
64 |
getComboAlgorithm().setModel(new DefaultComboBoxModel(new String[] { getText(this, "vecino_cercano"), getText(this, "media"), getText(this, "media_phase") })); |
|
69 |
|
|
65 | 70 |
} |
66 | 71 |
|
67 |
private void initialize() { |
|
72 |
/* |
|
73 |
* (non-Javadoc) |
|
74 |
* @see org.gvsig.raster.util.BasePanel#init() |
|
75 |
*/ |
|
76 |
protected void init() { |
|
68 | 77 |
GridBagConstraints gridBagConstraints; |
69 | 78 |
|
70 |
getPanel().setLayout(new GridBagLayout());
|
|
79 |
setLayout(new GridBagLayout()); |
|
71 | 80 |
|
72 | 81 |
int posy = 0; |
73 | 82 |
|
... | ... | |
78 | 87 |
// gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; |
79 | 88 |
// gridBagConstraints.weightx = 1.0; |
80 | 89 |
// gridBagConstraints.insets = new Insets(5, 5, 2, 5); |
81 |
// getPanel().add(getCheckBoxAsk(), gridBagConstraints);
|
|
90 |
// add(getCheckBoxAsk(), gridBagConstraints); |
|
82 | 91 |
|
83 | 92 |
// posy++; |
84 | 93 |
gridBagConstraints = new GridBagConstraints(); |
... | ... | |
86 | 95 |
gridBagConstraints.gridy = posy; |
87 | 96 |
gridBagConstraints.anchor = GridBagConstraints.EAST; |
88 | 97 |
gridBagConstraints.insets = new Insets(2, 5, 2, 2); |
89 |
getPanel().add(getLabelNumber(), gridBagConstraints);
|
|
98 |
add(getLabelNumber(), gridBagConstraints); |
|
90 | 99 |
|
91 | 100 |
gridBagConstraints = new GridBagConstraints(); |
92 | 101 |
gridBagConstraints.gridx = 1; |
... | ... | |
95 | 104 |
gridBagConstraints.anchor = GridBagConstraints.WEST; |
96 | 105 |
gridBagConstraints.weightx = 1.0; |
97 | 106 |
gridBagConstraints.insets = new Insets(2, 2, 2, 5); |
98 |
getPanel().add(getComboNumber(), gridBagConstraints);
|
|
107 |
add(getComboNumber(), gridBagConstraints); |
|
99 | 108 |
|
100 | 109 |
posy++; |
101 | 110 |
gridBagConstraints = new GridBagConstraints(); |
... | ... | |
103 | 112 |
gridBagConstraints.gridy = posy; |
104 | 113 |
gridBagConstraints.anchor = GridBagConstraints.EAST; |
105 | 114 |
gridBagConstraints.insets = new Insets(2, 5, 2, 2); |
106 |
getPanel().add(getLabelRate(), gridBagConstraints);
|
|
115 |
add(getLabelRate(), gridBagConstraints); |
|
107 | 116 |
|
108 | 117 |
gridBagConstraints = new GridBagConstraints(); |
109 | 118 |
gridBagConstraints.gridx = 1; |
... | ... | |
111 | 120 |
gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; |
112 | 121 |
gridBagConstraints.anchor = GridBagConstraints.WEST; |
113 | 122 |
gridBagConstraints.insets = new Insets(2, 2, 2, 5); |
114 |
getPanel().add(getComboRate(), gridBagConstraints);
|
|
123 |
add(getComboRate(), gridBagConstraints); |
|
115 | 124 |
|
116 | 125 |
posy++; |
117 | 126 |
gridBagConstraints = new GridBagConstraints(); |
... | ... | |
119 | 128 |
gridBagConstraints.gridy = posy; |
120 | 129 |
gridBagConstraints.anchor = GridBagConstraints.EAST; |
121 | 130 |
gridBagConstraints.insets = new Insets(2, 5, 5, 2); |
122 |
getPanel().add(getLabelAlgorithm(), gridBagConstraints);
|
|
131 |
add(getLabelAlgorithm(), gridBagConstraints); |
|
123 | 132 |
|
124 | 133 |
gridBagConstraints = new GridBagConstraints(); |
125 | 134 |
gridBagConstraints.gridx = 1; |
... | ... | |
127 | 136 |
gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; |
128 | 137 |
gridBagConstraints.anchor = GridBagConstraints.WEST; |
129 | 138 |
gridBagConstraints.insets = new Insets(2, 2, 5, 5); |
130 |
getPanel().add(getComboAlgorithm(), gridBagConstraints);
|
|
139 |
add(getComboAlgorithm(), gridBagConstraints); |
|
131 | 140 |
} |
132 | 141 |
|
133 | 142 |
private JLabel getLabelAlgorithm() { |
... | ... | |
174 | 183 |
} |
175 | 184 |
|
176 | 185 |
private JComboBox getComboAlgorithm() { |
177 |
if (comboBoxAlgorithm == null) |
|
186 |
if (comboBoxAlgorithm == null) {
|
|
178 | 187 |
comboBoxAlgorithm = new JComboBox(); |
188 |
comboBoxAlgorithm.setModel(new DefaultComboBoxModel(new String[] { getText(this, "vecino_cercano"), getText(this, "media"), getText(this, "media_phase") })); |
|
189 |
} |
|
179 | 190 |
return comboBoxAlgorithm; |
180 | 191 |
} |
181 | 192 |
|
... | ... | |
260 | 271 |
} |
261 | 272 |
Configuration.setValue("overviews_resampling_algorithm", Integer.valueOf(type)); |
262 | 273 |
} |
274 |
|
|
263 | 275 |
} |
trunk/extensions/extRasterTools-SE/src/org/gvsig/raster/gui/preferences/panels/PreferenceLoadLayer.java | ||
---|---|---|
40 | 40 |
import org.gvsig.raster.datastruct.persistence.ColorTableLibraryPersistence; |
41 | 41 |
import org.gvsig.raster.gui.preferences.combocolortable.PaintItem; |
42 | 42 |
import org.gvsig.raster.gui.preferences.combocolortable.PreferenceColorTableIconPainter; |
43 |
import org.gvsig.raster.util.PanelBase;
|
|
43 |
import org.gvsig.raster.util.BasePanel;
|
|
44 | 44 |
/** |
45 | 45 |
* PreferenceLoadLayer es una clase para la configuracion de las preferencias |
46 | 46 |
* de una capa raster. |
... | ... | |
48 | 48 |
* @version 14/12/2007 |
49 | 49 |
* @author BorSanZa - Borja S?nchez Zamorano (borja.sanchez@iver.es) |
50 | 50 |
*/ |
51 |
public class PreferenceLoadLayer extends PanelBase implements ActionListener { |
|
52 |
private JComboBox comboBoxColorTable = null; |
|
53 |
private JRadioButton radioButtonRealce = null; |
|
54 |
private JRadioButton radioButtonColorTable = null; |
|
55 |
private JLabel labelLoadLayer = null; |
|
56 |
private ButtonGroup buttonGroup = new ButtonGroup(); |
|
51 |
public class PreferenceLoadLayer extends BasePanel implements ActionListener { |
|
52 |
private static final long serialVersionUID = 1L; |
|
53 |
private JComboBox comboBoxColorTable = null; |
|
54 |
private JRadioButton radioButtonRealce = null; |
|
55 |
private JRadioButton radioButtonColorTable = null; |
|
56 |
private JLabel labelLoadLayer = null; |
|
57 |
private ButtonGroup buttonGroup = null; |
|
57 | 58 |
|
58 |
private String palettesPath = System.getProperty("user.home") + |
|
59 |
File.separator + |
|
60 |
"gvSIG" + // PluginServices.getArguments()[0] + |
|
61 |
File.separator + "colortable"; |
|
62 |
|
|
59 |
/** |
|
60 |
*Inicializa componentes gr?ficos y traduce |
|
61 |
*/ |
|
63 | 62 |
public PreferenceLoadLayer() { |
64 |
initialize();
|
|
63 |
init(); |
|
65 | 64 |
translate(); |
66 | 65 |
} |
67 |
|
|
66 |
|
|
68 | 67 |
/** |
69 | 68 |
* Traduce los textos de esta clase |
70 | 69 |
*/ |
71 |
private void translate() {
|
|
72 |
getPanel().setBorder(BorderFactory.createTitledBorder(getText(this, "carga_capas")));
|
|
70 |
protected void translate() {
|
|
71 |
setBorder(BorderFactory.createTitledBorder(getText(this, "carga_capas"))); |
|
73 | 72 |
getLabelLoadLayer().setText(getText(this, "loadlayer_aplicar") + ":"); |
74 | 73 |
getRadioButtonRealce().setText(getText(this, "realce")); |
75 | 74 |
getRadioButtonColorTable().setText(getText(this, "tabla_color")); |
76 | 75 |
} |
77 | 76 |
|
78 |
private void initialize() {
|
|
77 |
protected void init() {
|
|
79 | 78 |
GridBagConstraints gridBagConstraints; |
80 | 79 |
|
81 |
getPanel().setLayout(new GridBagLayout());
|
|
80 |
setLayout(new GridBagLayout()); |
|
82 | 81 |
|
83 | 82 |
gridBagConstraints = new GridBagConstraints(); |
84 | 83 |
gridBagConstraints.gridx = 0; |
... | ... | |
87 | 86 |
gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; |
88 | 87 |
gridBagConstraints.anchor = GridBagConstraints.WEST; |
89 | 88 |
gridBagConstraints.insets = new Insets(5, 5, 2, 5); |
90 |
getPanel().add(getLabelLoadLayer(), gridBagConstraints);
|
|
89 |
add(getLabelLoadLayer(), gridBagConstraints); |
|
91 | 90 |
|
92 | 91 |
gridBagConstraints = new GridBagConstraints(); |
93 | 92 |
gridBagConstraints.gridx = 0; |
... | ... | |
95 | 94 |
gridBagConstraints.gridwidth = 2; |
96 | 95 |
gridBagConstraints.anchor = GridBagConstraints.WEST; |
97 | 96 |
gridBagConstraints.insets = new Insets(2, 5, 2, 5); |
98 |
getPanel().add(getRadioButtonRealce(), gridBagConstraints);
|
|
97 |
add(getRadioButtonRealce(), gridBagConstraints); |
|
99 | 98 |
|
100 | 99 |
gridBagConstraints = new GridBagConstraints(); |
101 | 100 |
gridBagConstraints.gridx = 0; |
102 | 101 |
gridBagConstraints.gridy = 2; |
103 | 102 |
gridBagConstraints.anchor = GridBagConstraints.WEST; |
104 | 103 |
gridBagConstraints.insets = new Insets(2, 5, 5, 2); |
105 |
getPanel().add(getRadioButtonColorTable(), gridBagConstraints);
|
|
104 |
add(getRadioButtonColorTable(), gridBagConstraints); |
|
106 | 105 |
|
107 | 106 |
gridBagConstraints = new GridBagConstraints(); |
108 | 107 |
gridBagConstraints.gridx = 1; |
... | ... | |
110 | 109 |
gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; |
111 | 110 |
gridBagConstraints.weightx = 1.0; |
112 | 111 |
gridBagConstraints.insets = new Insets(2, 2, 5, 5); |
113 |
getPanel().add(getComboBoxColorTable(), gridBagConstraints);
|
|
112 |
add(getComboBoxColorTable(), gridBagConstraints); |
|
114 | 113 |
} |
114 |
|
|
115 |
/** |
|
116 |
* Obtiene el path del fichero de paletas |
|
117 |
* @return |
|
118 |
*/ |
|
119 |
public String getPalettesPath() { |
|
120 |
return System.getProperty("user.home") + |
|
121 |
File.separator + |
|
122 |
"gvSIG" + // PluginServices.getArguments()[0] + |
|
123 |
File.separator + "colortable"; |
|
124 |
} |
|
125 |
|
|
126 |
/** |
|
127 |
* Obtiene el grupo de botones |
|
128 |
* @return ButtonGroup |
|
129 |
*/ |
|
130 |
public ButtonGroup getButtonGroup() { |
|
131 |
if(buttonGroup == null) |
|
132 |
buttonGroup = new ButtonGroup(); |
|
133 |
return buttonGroup; |
|
134 |
} |
|
115 | 135 |
|
116 | 136 |
public JRadioButton getRadioButtonRealce() { |
117 | 137 |
if (radioButtonRealce == null) { |
118 | 138 |
radioButtonRealce = new JRadioButton(); |
119 |
buttonGroup.add(radioButtonRealce);
|
|
139 |
getButtonGroup().add(radioButtonRealce);
|
|
120 | 140 |
radioButtonRealce.addActionListener(this); |
121 | 141 |
radioButtonRealce.setSelected(true); |
122 | 142 |
radioButtonRealce.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
... | ... | |
128 | 148 |
public JRadioButton getRadioButtonColorTable() { |
129 | 149 |
if (radioButtonColorTable == null) { |
130 | 150 |
radioButtonColorTable = new JRadioButton(); |
131 |
buttonGroup.add(radioButtonColorTable);
|
|
151 |
getButtonGroup().add(radioButtonColorTable);
|
|
132 | 152 |
radioButtonColorTable.addActionListener(this); |
133 | 153 |
radioButtonColorTable.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
134 | 154 |
radioButtonColorTable.setMargin(new Insets(0, 0, 0, 0)); |
... | ... | |
147 | 167 |
if (comboBoxColorTable == null) { |
148 | 168 |
comboBoxColorTable = new JComboBox(); |
149 | 169 |
|
150 |
ArrayList fileList = ColorTableLibraryPersistence.getPaletteFileList(palettesPath);
|
|
170 |
ArrayList fileList = ColorTableLibraryPersistence.getPaletteFileList(getPalettesPath());
|
|
151 | 171 |
|
152 | 172 |
for (int i = 0; i < fileList.size(); i++) { |
153 | 173 |
ArrayList paletteItems = new ArrayList(); |
154 |
String paletteName = ColorTableLibraryPersistence.loadPalette(palettesPath, (String) fileList.get(i), paletteItems);
|
|
174 |
String paletteName = ColorTableLibraryPersistence.loadPalette(getPalettesPath(), (String) fileList.get(i), paletteItems);
|
|
155 | 175 |
|
156 | 176 |
if (paletteItems.size() <= 0) |
157 | 177 |
continue; |
trunk/extensions/extRasterTools-SE/src/org/gvsig/raster/gui/preferences/panels/PreferenceGeneral.java | ||
---|---|---|
30 | 30 |
|
31 | 31 |
import org.gvsig.raster.Configuration; |
32 | 32 |
import org.gvsig.raster.RasterLibrary; |
33 |
import org.gvsig.raster.util.PanelBase;
|
|
33 |
import org.gvsig.raster.util.BasePanel;
|
|
34 | 34 |
/** |
35 | 35 |
* Clase para la configuracion general de Raster. Aqui tenemos todas las variables |
36 | 36 |
* que no tienen una secci?n en concreto. |
... | ... | |
38 | 38 |
* @version 12/12/2007 |
39 | 39 |
* @author BorSanZa - Borja S?nchez Zamorano (borja.sanchez@iver.es) |
40 | 40 |
*/ |
41 |
public class PreferenceGeneral extends PanelBase { |
|
42 |
private JCheckBox checkBoxPreview = null; |
|
43 |
private JCheckBox checkBoxCoordinates = null; |
|
44 |
private JLabel labelNumClases = null; |
|
45 |
private JComboBox comboBoxNumClases = null; |
|
46 |
private JCheckBox checkBoxProjection = null; |
|
47 |
|
|
41 |
public class PreferenceGeneral extends BasePanel { |
|
42 |
private static final long serialVersionUID = 1L; |
|
43 |
private JCheckBox checkBoxPreview = null; |
|
44 |
private JCheckBox checkBoxCoordinates = null; |
|
45 |
private JLabel labelNumClases = null; |
|
46 |
private JComboBox comboBoxNumClases = null; |
|
47 |
private JCheckBox checkBoxProjection = null; |
|
48 |
|
|
49 |
/** |
|
50 |
*Inicializa componentes gr?ficos y traduce |
|
51 |
*/ |
|
48 | 52 |
public PreferenceGeneral() { |
49 |
initialize();
|
|
53 |
init(); |
|
50 | 54 |
translate(); |
51 | 55 |
} |
52 |
|
|
56 |
|
|
53 | 57 |
/** |
54 | 58 |
* Todas las traducciones de esta clase. |
55 | 59 |
*/ |
56 |
private void translate() {
|
|
57 |
getPanel().setBorder(BorderFactory.createTitledBorder(getText(this, "general")));
|
|
60 |
protected void translate() {
|
|
61 |
setBorder(BorderFactory.createTitledBorder(getText(this, "general"))); |
|
58 | 62 |
getCheckBoxPreview().setText(getText(this, "previsualizar_automaticamente_raster")); |
59 | 63 |
getCheckBoxPreview().setToolTipText(getCheckBoxPreview().getText()); |
60 | 64 |
getLabelNumClases().setText(getText(this, "num_clases") + ":"); |
... | ... | |
62 | 66 |
getCheckBoxProjection().setText(getText(this, "ask_for_projection")); |
63 | 67 |
} |
64 | 68 |
|
65 |
private void initialize() {
|
|
69 |
protected void init() {
|
|
66 | 70 |
GridBagConstraints gridBagConstraints; |
67 | 71 |
|
68 |
getPanel().setLayout(new GridBagLayout());
|
|
72 |
setLayout(new GridBagLayout()); |
|
69 | 73 |
|
70 | 74 |
gridBagConstraints = new GridBagConstraints(); |
71 | 75 |
gridBagConstraints.gridx = 0; |
... | ... | |
75 | 79 |
gridBagConstraints.anchor = GridBagConstraints.WEST; |
76 | 80 |
gridBagConstraints.weighty = 1.0; |
77 | 81 |
gridBagConstraints.insets = new Insets(5, 5, 2, 5); |
78 |
getPanel().add(getCheckBoxPreview(), gridBagConstraints);
|
|
82 |
add(getCheckBoxPreview(), gridBagConstraints); |
|
79 | 83 |
|
80 | 84 |
gridBagConstraints = new GridBagConstraints(); |
81 | 85 |
gridBagConstraints.gridx = 0; |
82 | 86 |
gridBagConstraints.gridy = 1; |
83 | 87 |
gridBagConstraints.anchor = GridBagConstraints.EAST; |
84 | 88 |
gridBagConstraints.insets = new Insets(2, 5, 2, 2); |
85 |
getPanel().add(getLabelNumClases(), gridBagConstraints);
|
|
89 |
add(getLabelNumClases(), gridBagConstraints); |
|
86 | 90 |
|
87 | 91 |
gridBagConstraints = new GridBagConstraints(); |
88 | 92 |
gridBagConstraints.gridx = 1; |
... | ... | |
90 | 94 |
gridBagConstraints.anchor = GridBagConstraints.WEST; |
91 | 95 |
gridBagConstraints.weightx = 1.0; |
92 | 96 |
gridBagConstraints.insets = new Insets(2, 2, 2, 5); |
93 |
getPanel().add(getComboBoxNumClases(), gridBagConstraints);
|
|
97 |
add(getComboBoxNumClases(), gridBagConstraints); |
|
94 | 98 |
|
95 | 99 |
gridBagConstraints = new GridBagConstraints(); |
96 | 100 |
gridBagConstraints.gridx = 0; |
... | ... | |
100 | 104 |
gridBagConstraints.anchor = GridBagConstraints.WEST; |
101 | 105 |
gridBagConstraints.weighty = 1.0; |
102 | 106 |
gridBagConstraints.insets = new Insets(2, 5, 5, 5); |
103 |
getPanel().add(getCheckBoxCoordinates(), gridBagConstraints);
|
|
107 |
add(getCheckBoxCoordinates(), gridBagConstraints); |
|
104 | 108 |
|
105 | 109 |
gridBagConstraints = new GridBagConstraints(); |
106 | 110 |
gridBagConstraints.gridx = 0; |
... | ... | |
109 | 113 |
gridBagConstraints.fill = GridBagConstraints.BOTH; |
110 | 114 |
gridBagConstraints.anchor = GridBagConstraints.WEST; |
111 | 115 |
gridBagConstraints.insets = new Insets(2, 5, 5, 5); |
112 |
getPanel().add(getCheckBoxProjection(), gridBagConstraints);
|
|
116 |
add(getCheckBoxProjection(), gridBagConstraints); |
|
113 | 117 |
} |
114 | 118 |
|
115 | 119 |
private JCheckBox getCheckBoxPreview() { |
trunk/extensions/extRasterTools-SE/src/org/gvsig/rastertools/colortable/ui/library/ColorTableLibraryPanel.java | ||
---|---|---|
44 | 44 |
import org.gvsig.raster.datastruct.io.exceptions.RasterLegendIONotFound; |
45 | 45 |
import org.gvsig.raster.datastruct.persistence.ColorTableLibraryPersistence; |
46 | 46 |
import org.gvsig.raster.util.ExtendedFileFilter; |
47 |
import org.gvsig.raster.util.PanelBase;
|
|
47 |
import org.gvsig.raster.util.BasePanel;
|
|
48 | 48 |
import org.gvsig.raster.util.RasterToolsUtil; |
49 | 49 |
import org.gvsig.raster.util.RasterUtilities; |
50 | 50 |
|
... | ... | |
57 | 57 |
* 19/02/2008 |
58 | 58 |
* @author BorSanZa - Borja S?nchez Zamorano (borja.sanchez@iver.es) |
59 | 59 |
*/ |
60 |
public class ColorTableLibraryPanel extends PanelBase implements ActionListener, ListViewListener { |
|
60 |
public class ColorTableLibraryPanel extends BasePanel implements ActionListener, ListViewListener { |
|
61 |
private static final long serialVersionUID = 1L; |
|
61 | 62 |
private JPanel panelButtons = null; |
62 | 63 |
private JButton buttonAdd = null; |
63 | 64 |
private JButton buttonDel = null; |
... | ... | |
73 | 74 |
File.separator + |
74 | 75 |
"gvSIG" + // PluginServices.getArguments()[0] + |
75 | 76 |
File.separator + "colortable"; |
76 |
|
|
77 |
|
|
78 |
/** |
|
79 |
*Inicializa componentes gr?ficos y traduce |
|
80 |
*/ |
|
77 | 81 |
public ColorTableLibraryPanel() { |
78 |
initialize(); |
|
82 |
init(); |
|
83 |
translate(); |
|
79 | 84 |
} |
80 | 85 |
|
81 |
/** |
|
82 |
* Inicializa el panel de la libreria de tablas de color |
|
86 |
/* |
|
87 |
* (non-Javadoc) |
|
88 |
* @see org.gvsig.raster.util.BasePanel#init() |
|
83 | 89 |
*/ |
84 |
private void initialize() {
|
|
85 |
getPanel().setLayout(new BorderLayout());
|
|
90 |
protected void init() {
|
|
91 |
setLayout(new BorderLayout()); |
|
86 | 92 |
|
87 | 93 |
JPanel panel = new JPanel(); |
88 | 94 |
panel.setLayout(new BorderLayout()); |
... | ... | |
93 | 99 |
jScrollPane.setAutoscrolls(true); |
94 | 100 |
|
95 | 101 |
panel.add(jScrollPane, BorderLayout.CENTER); |
96 |
getPanel().add(panel, BorderLayout.CENTER);
|
|
97 |
getPanel().add(getPanelButtons(), BorderLayout.SOUTH);
|
|
98 |
getPanel().setPreferredSize(new Dimension(0, 192));
|
|
102 |
add(panel, BorderLayout.CENTER); |
|
103 |
add(getPanelButtons(), BorderLayout.SOUTH); |
|
104 |
setPreferredSize(new Dimension(0, 192)); |
|
99 | 105 |
|
100 | 106 |
loadDiskLibrary(); |
101 | 107 |
} |
108 |
|
|
109 |
/* |
|
110 |
* (non-Javadoc) |
|
111 |
* @see org.gvsig.raster.util.BasePanel#translate() |
|
112 |
*/ |
|
113 |
protected void translate() { |
|
114 |
} |
|
102 | 115 |
|
103 | 116 |
private void loadDiskLibrary() { |
104 | 117 |
ArrayList fileList = ColorTableLibraryPersistence.getPaletteFileList(palettesPath); |
... | ... | |
253 | 266 |
public void actionPerformed(ActionEvent e) { |
254 | 267 |
if (e.getSource() == getButtonAdd()) { |
255 | 268 |
AddLibrary addLibrary = new AddLibrary(); |
256 |
if (addLibrary.showConfirm(getPanel()) == JOptionPane.OK_OPTION) {
|
|
269 |
if (addLibrary.showConfirm(this) == JOptionPane.OK_OPTION) {
|
|
257 | 270 |
ColorTable colorTable = addLibrary.getColorTable(); |
258 | 271 |
if (colorTable != null) { |
259 | 272 |
ListViewItem item = new ListViewItem(new ColorTableIconPainter(colorTable), colorTable.getName()); |
... | ... | |
294 | 307 |
if (firstFileFilter != null) |
295 | 308 |
chooser.setFileFilter(firstFileFilter); |
296 | 309 |
|
297 |
int returnVal = chooser.showSaveDialog(getPanel());
|
|
310 |
int returnVal = chooser.showSaveDialog(this);
|
|
298 | 311 |
if (returnVal == JFileChooser.APPROVE_OPTION) { |
299 | 312 |
try { |
300 | 313 |
ExtendedFileFilter filter = (ExtendedFileFilter) chooser.getFileFilter(); |
... | ... | |
336 | 349 |
chooser.addChoosableFileFilter(allFilters); |
337 | 350 |
chooser.setFileFilter(allFilters); |
338 | 351 |
|
339 |
int returnVal = chooser.showOpenDialog(getPanel());
|
|
352 |
int returnVal = chooser.showOpenDialog(this);
|
|
340 | 353 |
|
341 | 354 |
if (returnVal == JFileChooser.APPROVE_OPTION) { |
342 | 355 |
try { |
... | ... | |
499 | 512 |
((ColorTableIconPainter) getListViewComponent().getSelectedValue().getIcon()).getColorTable().createPaletteFromColorItems(colorTable.getColorItems(), false); |
500 | 513 |
getListViewComponent().repaint(); |
501 | 514 |
} |
515 |
|
|
502 | 516 |
} |
trunk/extensions/extRasterTools-SE/src/org/gvsig/rastertools/colortable/ui/ColorTablePanel.java | ||
---|---|---|
96 | 96 |
list.add(getTabInterpolated()); |
97 | 97 |
getColorTableListener().setLastColorTableUI(getTabTable()); |
98 | 98 |
|
99 |
previewBasePanel = new PreviewBasePanel(ButtonsPanel.BUTTONS_NONE, list, (JPanel) getGeneralPanel().getPanel(), getPanelListView(), getColorTableListener(), (FLyrRasterSE) fLayer);
|
|
99 |
previewBasePanel = new PreviewBasePanel(ButtonsPanel.BUTTONS_NONE, list, (JPanel) getGeneralPanel(), getPanelListView(), getColorTableListener(), (FLyrRasterSE) fLayer); |
|
100 | 100 |
previewBasePanel.getTabbedPane().addChangeListener(this); |
101 | 101 |
previewBasePanel.getButtonsPanel().addButton(RasterToolsUtil.getText(this, "equidistar"), ButtonsPanel.BUTTON_LAST + 3); |
102 | 102 |
previewBasePanel.getButtonsPanel().addButton(RasterToolsUtil.getText(this, "guardar_predeterminado"), ButtonsPanel.BUTTON_LAST + 2); |
... | ... | |
137 | 137 |
jPanelListView.setBorder(javax.swing.BorderFactory.createTitledBorder(null, RasterToolsUtil.getText(this, "libreria"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null)); |
138 | 138 |
jPanelListView.setLayout(new BorderLayout()); |
139 | 139 |
|
140 |
jPanelListView.add(getColorTableLibraryPanel().getPanel());
|
|
140 |
jPanelListView.add(getColorTableLibraryPanel()); |
|
141 | 141 |
} |
142 | 142 |
return jPanelListView; |
143 | 143 |
} |
trunk/extensions/extRasterTools-SE/src/org/gvsig/rastertools/colortable/ui/ColorTableGlobalPanel.java | ||
---|---|---|
39 | 39 |
import org.gvsig.raster.IProcessActions; |
40 | 40 |
import org.gvsig.raster.RasterProcess; |
41 | 41 |
import org.gvsig.raster.dataset.properties.DatasetListStatistics; |
42 |
import org.gvsig.raster.util.PanelBase;
|
|
42 |
import org.gvsig.raster.util.BasePanel;
|
|
43 | 43 |
import org.gvsig.rastertools.colortable.data.ColorTableData; |
44 | 44 |
import org.gvsig.rastertools.statistics.StatisticsProcess; |
45 | 45 |
|
... | ... | |
51 | 51 |
* @version 07/01/2008 |
52 | 52 |
* @author BorSanZa - Borja S?nchez Zamorano (borja.sanchez@iver.es) |
53 | 53 |
*/ |
54 |
public class ColorTableGlobalPanel extends PanelBase implements ActionListener, PropertyChangeListener, IProcessActions { |
|
54 |
public class ColorTableGlobalPanel extends BasePanel implements ActionListener, PropertyChangeListener, IProcessActions { |
|
55 |
private static final long serialVersionUID = 1L; |
|
55 | 56 |
private JCheckBox checkBoxInterpolated = null; |
56 | 57 |
private JCheckBox checkBoxEnabled = null; |
57 | 58 |
private ColorTableData colorTableData = null; |
... | ... | |
67 | 68 |
private NumberFormat doubleEditFormat = null; |
68 | 69 |
private FLayer fLayer = null; |
69 | 70 |
|
71 |
/** |
|
72 |
*Inicializa componentes gr?ficos y traduce |
|
73 |
*/ |
|
74 |
public ColorTableGlobalPanel() { |
|
75 |
init(); |
|
76 |
translate(); |
|
77 |
} |
|
78 |
|
|
70 | 79 |
public ColorTableGlobalPanel(ColorTableData colorTableData) { |
71 | 80 |
doubleDisplayFormat = NumberFormat.getNumberInstance(); |
72 | 81 |
doubleDisplayFormat.setMinimumFractionDigits(0); |
73 | 82 |
doubleEditFormat = NumberFormat.getNumberInstance(); |
74 | 83 |
|
75 | 84 |
this.colorTableData = colorTableData; |
76 |
initialize();
|
|
85 |
init(); |
|
77 | 86 |
} |
78 | 87 |
|
79 |
/** |
|
80 |
* Inicializar panel |
|
88 |
/* |
|
89 |
* (non-Javadoc) |
|
90 |
* @see org.gvsig.raster.util.BasePanel#init() |
|
81 | 91 |
*/ |
82 |
private void initialize() {
|
|
92 |
protected void init() {
|
|
83 | 93 |
GridBagConstraints gridBagConstraints; |
84 | 94 |
|
85 |
getPanel().setLayout(new GridBagLayout());
|
|
95 |
setLayout(new GridBagLayout()); |
|
86 | 96 |
|
87 | 97 |
gridBagConstraints = new GridBagConstraints(); |
88 | 98 |
gridBagConstraints.gridx = 4; |
89 | 99 |
gridBagConstraints.gridy = 0; |
90 | 100 |
gridBagConstraints.insets = new Insets(5, 2, 2, 5); |
91 |
getPanel().add(getButtonStatistics(), gridBagConstraints);
|
|
101 |
add(getButtonStatistics(), gridBagConstraints); |
|
92 | 102 |
|
93 | 103 |
gridBagConstraints = new GridBagConstraints(); |
94 | 104 |
gridBagConstraints.gridx = 1; |
... | ... | |
96 | 106 |
gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; |
97 | 107 |
gridBagConstraints.weightx = 1.0; |
98 | 108 |
gridBagConstraints.insets = new Insets(5, 2, 2, 2); |
99 |
getPanel().add(getTextFieldMinim(), gridBagConstraints);
|
|
109 |
add(getTextFieldMinim(), gridBagConstraints); |
|
100 | 110 |
|
101 | 111 |
gridBagConstraints = new GridBagConstraints(); |
102 | 112 |
gridBagConstraints.gridx = 3; |
... | ... | |
104 | 114 |
gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; |
105 | 115 |
gridBagConstraints.weightx = 1.0; |
106 | 116 |
gridBagConstraints.insets = new Insets(5, 2, 2, 2); |
107 |
getPanel().add(getTextFieldMaxim(), gridBagConstraints);
|
|
117 |
add(getTextFieldMaxim(), gridBagConstraints); |
|
108 | 118 |
|
109 | 119 |
gridBagConstraints = new GridBagConstraints(); |
110 | 120 |
gridBagConstraints.gridx = 0; |
111 | 121 |
gridBagConstraints.gridy = 0; |
112 | 122 |
gridBagConstraints.insets = new Insets(5, 5, 2, 2); |
113 |
getPanel().add(getLabelMinim(), gridBagConstraints);
|
|
123 |
add(getLabelMinim(), gridBagConstraints); |
|
114 | 124 |
|
115 | 125 |
gridBagConstraints = new GridBagConstraints(); |
116 | 126 |
gridBagConstraints.gridx = 2; |
117 | 127 |
gridBagConstraints.gridy = 0; |
118 | 128 |
gridBagConstraints.insets = new Insets(5, 2, 2, 2); |
119 |
getPanel().add(getLabelMaxim(), gridBagConstraints);
|
|
129 |
add(getLabelMaxim(), gridBagConstraints); |
|
120 | 130 |
|
121 | 131 |
JPanel panel = new JPanel(); |
122 | 132 |
panel.setLayout(new GridBagLayout()); |
... | ... | |
148 | 158 |
gridBagConstraints.gridwidth = 5; |
149 | 159 |
gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; |
150 | 160 |
gridBagConstraints.insets = new java.awt.Insets(2, 5, 5, 5); |
151 |
getPanel().add(panel, gridBagConstraints);
|
|
161 |
add(panel, gridBagConstraints); |
|
152 | 162 |
} |
163 |
|
|
164 |
/* |
|
165 |
* (non-Javadoc) |
|
166 |
* @see org.gvsig.raster.util.BasePanel#translate() |
|
167 |
*/ |
|
168 |
protected void translate() { |
|
169 |
} |
|
153 | 170 |
|
154 | 171 |
/** |
155 | 172 |
* Obtiene el jCBInterpolated |
... | ... | |
211 | 228 |
return getCheckBoxInterpolated().isSelected(); |
212 | 229 |
} |
213 | 230 |
|
214 |
private boolean isEnabled() { |
|
231 |
private boolean isCheckEnabled() {
|
|
215 | 232 |
return getCheckBoxEnabled().isSelected(); |
216 | 233 |
} |
217 | 234 |
|
... | ... | |
242 | 259 |
} |
243 | 260 |
|
244 | 261 |
if (e.getSource() == getCheckBoxEnabled()) { |
245 |
colorTableData.setEnabled(isEnabled()); |
|
262 |
colorTableData.setEnabled(isCheckEnabled());
|
|
246 | 263 |
return; |
247 | 264 |
} |
248 | 265 |
|
... | ... | |
413 | 430 |
} |
414 | 431 |
|
415 | 432 |
public void interrupted() {} |
433 |
|
|
416 | 434 |
} |
trunk/extensions/extRasterTools-SE/src/org/gvsig/rastertools/colortable/ui/tabs/TabTable.java | ||
---|---|---|
23 | 23 |
import java.util.ArrayList; |
24 | 24 |
import java.util.Iterator; |
25 | 25 |
|
26 |
import javax.swing.JPanel; |
|
26 | 27 |
import javax.swing.JTable; |
27 | 28 |
import javax.swing.event.TableModelEvent; |
28 | 29 |
import javax.swing.event.TableModelListener; |
... | ... | |
33 | 34 |
import org.gvsig.raster.beans.previewbase.IUserPanelInterface; |
34 | 35 |
import org.gvsig.raster.datastruct.ColorItem; |
35 | 36 |
import org.gvsig.raster.datastruct.ColorTable; |
36 |
import org.gvsig.raster.util.PanelBase;
|
|
37 |
import org.gvsig.raster.util.BasePanel;
|
|
37 | 38 |
import org.gvsig.raster.util.RasterToolsUtil; |
38 | 39 |
/** |
39 | 40 |
* Pesta?a para definir una tabla de color en formato de tabla |
... | ... | |
41 | 42 |
* @version 27/06/2007 |
42 | 43 |
* @author BorSanZa - Borja S?nchez Zamorano (borja.sanchez@iver.es) |
43 | 44 |
*/ |
44 |
public class TabTable extends PanelBase implements IColorTableUI, TableModelListener, IUserPanelInterface {
|
|
45 |
private static final long serialVersionUID = -6971866166164473789L;
|
|
46 |
private ArrayList actionCommandListeners = new ArrayList(); |
|
47 |
private boolean listenerEnabled = false; |
|
45 |
public class TabTable extends BasePanel implements IColorTableUI, TableModelListener, IUserPanelInterface {
|
|
46 |
private static final long serialVersionUID = -6971866166164473789L;
|
|
47 |
private ArrayList actionCommandListeners = new ArrayList();
|
|
48 |
private boolean listenerEnabled = false;
|
|
48 | 49 |
|
49 | 50 |
/** |
50 | 51 |
* Tabla de color interna que se esta utilizando actualmente |
... | ... | |
57 | 58 |
* @param colorTablePanel |
58 | 59 |
*/ |
59 | 60 |
public TabTable() { |
60 |
initialize(); |
|
61 |
init(); |
|
62 |
translate(); |
|
61 | 63 |
getTableContainer().getTable().getJTable().getModel().addTableModelListener(this); |
62 | 64 |
} |
63 | 65 |
|
64 |
/** |
|
65 |
* Inicializar el panel |
|
66 |
/* |
|
67 |
* (non-Javadoc) |
|
68 |
* @see org.gvsig.raster.util.BasePanel#init() |
|
66 | 69 |
*/ |
67 |
private void initialize() {
|
|
68 |
getPanel().setLayout(new BorderLayout());
|
|
69 |
getPanel().add(getTableContainer(), BorderLayout.CENTER);
|
|
70 |
protected void init() {
|
|
71 |
setLayout(new BorderLayout()); |
|
72 |
add(getTableContainer(), BorderLayout.CENTER); |
|
70 | 73 |
} |
74 |
|
|
75 |
/* |
|
76 |
* (non-Javadoc) |
|
77 |
* @see org.gvsig.raster.util.BasePanel#translate() |
|
78 |
*/ |
|
79 |
protected void translate() { |
|
80 |
} |
|
71 | 81 |
|
72 | 82 |
private TableContainer getTableContainer() { |
73 | 83 |
if (tableContainer == null) { |
... | ... | |
223 | 233 |
public String getTitle() { |
224 | 234 |
return RasterToolsUtil.getText(this, "tabla"); |
225 | 235 |
} |
236 |
|
|
237 |
/* |
|
238 |
* (non-Javadoc) |
|
239 |
* @see org.gvsig.rastertools.colortable.ui.tabs.IColorTableUI#getPanel() |
|
240 |
*/ |
|
241 |
public JPanel getPanel() { |
|
242 |
return this; |
|
243 |
} |
|
226 | 244 |
} |
trunk/extensions/extRasterTools-SE/src/org/gvsig/rastertools/colortable/ui/tabs/TabInterpolated.java | ||
---|---|---|
30 | 30 |
import java.util.Iterator; |
31 | 31 |
|
32 | 32 |
import javax.swing.JLabel; |
33 |
import javax.swing.JPanel; |
|
33 | 34 |
import javax.swing.JTextField; |
34 | 35 |
|
35 | 36 |
import org.gvsig.gui.beans.colorbutton.ColorButton; |
... | ... | |
43 | 44 |
import org.gvsig.raster.datastruct.ColorItem; |
44 | 45 |
import org.gvsig.raster.datastruct.ColorTable; |
45 | 46 |
import org.gvsig.raster.util.MathUtils; |
46 |
import org.gvsig.raster.util.PanelBase;
|
|
47 |
import org.gvsig.raster.util.BasePanel;
|
|
47 | 48 |
import org.gvsig.raster.util.RasterToolsUtil; |
48 | 49 |
/** |
49 | 50 |
* Pesta?a para las interpolaciones de la tabla de color, aqui se tratar?n |
... | ... | |
52 | 53 |
* @version 27/06/2007 |
53 | 54 |
* @author BorSanZa - Borja S?nchez Zamorano (borja.sanchez@iver.es) |
54 | 55 |
*/ |
55 |
public class TabInterpolated extends PanelBase implements IColorTableUI, ColorSliderListener, ColorButtonListener, FocusListener, KeyListener, IUserPanelInterface {
|
|
56 |
public class TabInterpolated extends BasePanel implements IColorTableUI, ColorSliderListener, ColorButtonListener, FocusListener, KeyListener, IUserPanelInterface {
|
|
56 | 57 |
private static final long serialVersionUID = -5208861410196059899L; |
57 | 58 |
|
58 | 59 |
private ArrayList actionCommandListeners = new ArrayList(); |
... | ... | |
74 | 75 |
private JLabel jLabelValue = null; |
75 | 76 |
|
76 | 77 |
/** |
77 |
* Constructor de un TabInterpolated |
|
78 |
* @param colorTablePanel |
|
78 |
*Inicializa componentes gr?ficos y traduce |
|
79 | 79 |
*/ |
80 | 80 |
public TabInterpolated() { |
81 |
initialize(); |
|
81 |
init(); |
|
82 |
translate(); |
|
82 | 83 |
} |
83 |
|
|
84 |
/** |
|
85 |
* Creaci?n de todos los componentes del interfaz |
|
84 |
|
|
85 |
/* |
|
86 |
* (non-Javadoc) |
|
87 |
* @see org.gvsig.raster.util.BasePanel#init() |
|
86 | 88 |
*/ |
87 |
private void initialize() {
|
|
88 |
getPanel().setLayout(new GridBagLayout());
|
|
89 |
protected void init() {
|
|
90 |
setLayout(new GridBagLayout()); |
|
89 | 91 |
|
90 | 92 |
GridBagConstraints gridBagConstraints = new GridBagConstraints(); |
91 | 93 |
gridBagConstraints.gridwidth = 2; |
92 | 94 |
gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; |
93 | 95 |
gridBagConstraints.weightx = 1.0; |
94 | 96 |
gridBagConstraints.insets = new Insets(5, 5, 2, 5); |
95 |
getPanel().add(getColorSliderEdition(), gridBagConstraints);
|
|
97 |
add(getColorSliderEdition(), gridBagConstraints); |
|
96 | 98 |
|
97 | 99 |
gridBagConstraints = new GridBagConstraints(); |
98 | 100 |
gridBagConstraints.gridx = 0; |
... | ... | |
100 | 102 |
gridBagConstraints.anchor = GridBagConstraints.EAST; |
101 | 103 |
gridBagConstraints.weightx = 0.5; |
102 | 104 |
gridBagConstraints.insets = new Insets(2, 5, 2, 2); |
103 |
getPanel().add(getJLabelColor(), gridBagConstraints);
|
|
105 |
add(getJLabelColor(), gridBagConstraints); |
|
104 | 106 |
|
105 | 107 |
gridBagConstraints = new GridBagConstraints(); |
106 | 108 |
gridBagConstraints.gridx = 1; |
... | ... | |
108 | 110 |
gridBagConstraints.anchor = GridBagConstraints.WEST; |
109 | 111 |
gridBagConstraints.weightx = 0.5; |
110 | 112 |
gridBagConstraints.insets = new Insets(2, 2, 2, 5); |
111 |
getPanel().add(getColorButton(), gridBagConstraints);
|
|
113 |
add(getColorButton(), gridBagConstraints); |
|
112 | 114 |
|
113 | 115 |
gridBagConstraints = new GridBagConstraints(); |
114 | 116 |
gridBagConstraints.gridx = 0; |
115 | 117 |
gridBagConstraints.gridy = 2; |
116 | 118 |
gridBagConstraints.anchor = GridBagConstraints.EAST; |
117 | 119 |
gridBagConstraints.insets = new Insets(2, 5, 2, 2); |
118 |
getPanel().add(getJLabelClassName(), gridBagConstraints);
|
|
120 |
add(getJLabelClassName(), gridBagConstraints); |
|
119 | 121 |
|
120 | 122 |
gridBagConstraints = new GridBagConstraints(); |
121 | 123 |
gridBagConstraints.gridx = 1; |
... | ... | |
124 | 126 |
gridBagConstraints.weightx = 1.0; |
125 | 127 |
gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; |
126 | 128 |
gridBagConstraints.insets = new Insets(2, 2, 2, 5); |
127 |
getPanel().add(getJTextClassName(), gridBagConstraints);
|
|
129 |
add(getJTextClassName(), gridBagConstraints); |
|
128 | 130 |
|
129 | 131 |
gridBagConstraints = new GridBagConstraints(); |
130 | 132 |
gridBagConstraints.gridx = 0; |
131 | 133 |
gridBagConstraints.gridy = 3; |
132 | 134 |
gridBagConstraints.anchor = GridBagConstraints.EAST; |
133 | 135 |
gridBagConstraints.insets = new Insets(2, 5, 2, 2); |
134 |
getPanel().add(getJLabelValue(), gridBagConstraints);
|
|
136 |
add(getJLabelValue(), gridBagConstraints); |
|
135 | 137 |
|
136 | 138 |
gridBagConstraints = new GridBagConstraints(); |
137 | 139 |
gridBagConstraints.gridx = 1; |
... | ... | |
140 | 142 |
gridBagConstraints.weightx = 1.0; |
141 | 143 |
gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; |
142 | 144 |
gridBagConstraints.insets = new Insets(2, 2, 2, 5); |
143 |
getPanel().add(getJTextValue(), gridBagConstraints);
|
|
145 |
add(getJTextValue(), gridBagConstraints); |
|
144 | 146 |
} |
147 |
|
|
148 |
/* |
|
149 |
* (non-Javadoc) |
|
150 |
* @see org.gvsig.raster.util.BasePanel#translate() |
|
151 |
*/ |
|
152 |
protected void translate() { |
|
153 |
} |
|
145 | 154 |
|
146 | 155 |
private JLabel getJLabelColor() { |
147 | 156 |
if (jLabelColor == null) { |
... | ... | |
617 | 626 |
|
618 | 627 |
public void focusGained(FocusEvent e) {} |
619 | 628 |
public void keyTyped(KeyEvent e) {} |
629 |
|
|
630 |
/* |
|
631 |
* (non-Javadoc) |
|
632 |
* @see org.gvsig.rastertools.colortable.ui.tabs.IColorTableUI#getPanel() |
|
633 |
*/ |
|
634 |
public JPanel getPanel() { |
|
635 |
return this; |
|
636 |
} |
|
620 | 637 |
} |
trunk/extensions/extRasterTools-SE/src/org/gvsig/rastertools/properties/panels/NoDataPanel.java | ||
---|---|---|
25 | 25 |
import java.awt.event.ActionListener; |
26 | 26 |
import java.awt.event.ItemEvent; |
27 | 27 |
import java.awt.event.ItemListener; |
28 |
import java.io.FileNotFoundException; |
|
28 | 29 |
import java.io.IOException; |
29 | 30 |
import java.text.NumberFormat; |
30 | 31 |
|
... | ... | |
39 | 40 |
|
40 | 41 |
import org.gvsig.fmap.raster.layers.FLyrRasterSE; |
41 | 42 |
import org.gvsig.raster.ConfigurationEvent; |
42 |
import org.gvsig.raster.dataset.RasterDataset;
|
|
43 |
import org.gvsig.raster.datastruct.NoData;
|
|
43 |
import org.gvsig.raster.dataset.io.rmf.RmfBlocksManager;
|
|
44 |
import org.gvsig.raster.datastruct.serializer.NoDataRmfSerializer;
|
|
44 | 45 |
import org.gvsig.raster.hierarchy.IRasterProperties; |
45 |
import org.gvsig.raster.util.PanelBase;
|
|
46 |
import org.gvsig.raster.util.BasePanel;
|
|
46 | 47 |
/** |
47 | 48 |
* Panel para la gestion del valor NoData en el panel de propiedades |
48 | 49 |
* |
49 | 50 |
* @version 18/12/2007 |
50 | 51 |
* @author BorSanZa - Borja S?nchez Zamorano (borja.sanchez@iver.es) |
51 | 52 |
*/ |
52 |
public class NoDataPanel extends PanelBase implements ItemListener, ActionListener {
|
|
53 |
private static final long serialVersionUID = 7645641060812458944L; |
|
53 |
public class NoDataPanel extends BasePanel implements ItemListener, ActionListener {
|
|
54 |
private static final long serialVersionUID = 7645641060812458944L;
|
|
54 | 55 |
|
55 | 56 |
private JLabel jLabelValue = null; |
56 | 57 |
private JComboBox jComboBoxSetup = null; |
... | ... | |
60 | 61 |
private IRasterProperties layer = null; |
61 | 62 |
|
62 | 63 |
public NoDataPanel(INoDataPanel noDataPanel) { |
63 |
initialize(); |
|
64 |
translate(); |
|
65 | 64 |
this.noDataPanel = noDataPanel; |
66 | 65 |
setEnabledComponents(false); |
66 |
init(); |
|
67 |
translate(); |
|
67 | 68 |
} |
68 | 69 |
|
69 | 70 |
private JComboBox getComboBoxSetup() { |
... | ... | |
74 | 75 |
return jComboBoxSetup; |
75 | 76 |
} |
76 | 77 |
|
77 |
private void translate() {
|
|
78 |
protected void translate() {
|
|
78 | 79 |
getButtonSaveDefault().setText(getText(this, "guardar_predeterminado")); |
79 | 80 |
getComboBoxSetup().setModel(new DefaultComboBoxModel(new String[] { getText(this, "desactivado"), getText(this, "capa"), getText(this, "personalizado") })); |
80 | 81 |
getLabelValue().setText(getText(this, "value") + ":"); |
... | ... | |
109 | 110 |
return jLabelValue; |
110 | 111 |
} |
111 | 112 |
|
112 |
private void initialize() {
|
|
113 |
protected void init() {
|
|
113 | 114 |
GridBagConstraints gridBagConstraints; |
114 | 115 |
|
115 |
getPanel().setLayout(new GridBagLayout());
|
|
116 |
setLayout(new GridBagLayout()); |
|
116 | 117 |
|
117 | 118 |
int col = 0; |
118 | 119 |
gridBagConstraints = new GridBagConstraints(); |
... | ... | |
121 | 122 |
gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; |
122 | 123 |
gridBagConstraints.weightx = 1.0; |
123 | 124 |
gridBagConstraints.insets = new Insets(5, 5, 5, 2); |
124 |
getPanel().add(getComboBoxSetup(), gridBagConstraints);
|
|
125 |
add(getComboBoxSetup(), gridBagConstraints); |
|
125 | 126 |
|
126 | 127 |
col++; |
127 | 128 |
gridBagConstraints = new GridBagConstraints(); |
128 | 129 |
gridBagConstraints.gridx = col; |
129 | 130 |
gridBagConstraints.gridy = 0; |
130 | 131 |
gridBagConstraints.insets = new Insets(5, 2, 5, 2); |
131 |
getPanel().add(getLabelValue(), gridBagConstraints);
|
|
132 |
add(getLabelValue(), gridBagConstraints); |
|
132 | 133 |
|
133 | 134 |
col++; |
134 | 135 |
gridBagConstraints = new GridBagConstraints(); |
... | ... | |
137 | 138 |
gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; |
138 | 139 |
gridBagConstraints.weightx = 1.0; |
139 | 140 |
gridBagConstraints.insets = new Insets(5, 2, 5, 2); |
140 |
getPanel().add(getTextFieldValue(), gridBagConstraints);
|
|
141 |
add(getTextFieldValue(), gridBagConstraints); |
|
141 | 142 |
|
142 | 143 |
col++; |
143 | 144 |
gridBagConstraints = new GridBagConstraints(); |
144 | 145 |
gridBagConstraints.gridx = col; |
145 | 146 |
gridBagConstraints.gridy = 0; |
146 | 147 |
gridBagConstraints.insets = new Insets(5, 2, 5, 5); |
147 |
getPanel().add(getButtonSaveDefault(), gridBagConstraints);
|
|
148 |
add(getButtonSaveDefault(), gridBagConstraints); |
|
148 | 149 |
} |
149 | 150 |
|
150 | 151 |
/* |
Also available in: Unified diff