gvsig-raster / org.gvsig.raster.tilecache / trunk / org.gvsig.raster.tilecache / org.gvsig.raster.tilecache.app / src / main / java / org / gvsig / raster / tilecache / app / TileCachePreferences.java @ 5981
History | View | Annotate | Download (4.79 KB)
1 |
/* gvSIG. Geographic Information System of the Valencian Government
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department
|
4 |
* of the Valencian Government (CIT)
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 2
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
* MA 02110-1301, USA.
|
20 |
*
|
21 |
*/
|
22 |
package org.gvsig.raster.tilecache.app; |
23 |
|
24 |
import java.awt.BorderLayout; |
25 |
import java.awt.GridBagConstraints; |
26 |
import java.awt.GridBagLayout; |
27 |
|
28 |
import javax.swing.ImageIcon; |
29 |
import javax.swing.JPanel; |
30 |
import javax.swing.JScrollPane; |
31 |
import javax.swing.border.EmptyBorder; |
32 |
|
33 |
import org.gvsig.andami.IconThemeHelper; |
34 |
import org.gvsig.andami.preferences.AbstractPreferencePage; |
35 |
import org.gvsig.andami.preferences.StoreException; |
36 |
import org.gvsig.tools.ToolsLocator; |
37 |
import org.gvsig.tools.i18n.I18nManager; |
38 |
|
39 |
/**
|
40 |
* Preferences for tile cache
|
41 |
* @author Nacho Brodin (nachobrodin@gmail.com
|
42 |
*/
|
43 |
public class TileCachePreferences extends AbstractPreferencePage { |
44 |
private static final long serialVersionUID = -1689657253810393874L; |
45 |
|
46 |
protected static String id = TileCachePreferences.class.getName(); |
47 |
private ImageIcon icon; |
48 |
|
49 |
private TileCachePreferencesPanel tilecache = null; |
50 |
|
51 |
private I18nManager i18n = ToolsLocator.getI18nManager();
|
52 |
|
53 |
/**
|
54 |
* Constructor de la clase RasterPreferences
|
55 |
*/
|
56 |
public TileCachePreferences() {
|
57 |
super();
|
58 |
icon = IconThemeHelper.getImageIcon("pref-tilecache-icon");
|
59 |
initialize(); |
60 |
} |
61 |
|
62 |
/**
|
63 |
* Inicializacion del panel de preferencias.
|
64 |
*/
|
65 |
private void initialize() { |
66 |
setTitle("Frame");
|
67 |
|
68 |
GridBagConstraints gridBagConstraints;
|
69 |
|
70 |
JScrollPane scrollPane = new JScrollPane(); |
71 |
|
72 |
scrollPane.getVerticalScrollBar().setUnitIncrement(20);
|
73 |
|
74 |
JPanel panel = new JPanel(); |
75 |
|
76 |
panel.setLayout(new GridBagLayout()); |
77 |
|
78 |
gridBagConstraints = new GridBagConstraints(); |
79 |
gridBagConstraints.gridx = 0;
|
80 |
gridBagConstraints.gridy = 0;
|
81 |
gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
|
82 |
panel.add(getPreferenceTileCache(), gridBagConstraints); |
83 |
|
84 |
gridBagConstraints = new GridBagConstraints(); |
85 |
gridBagConstraints.gridx = 0;
|
86 |
gridBagConstraints.gridy = 7;
|
87 |
gridBagConstraints.weightx = 1.0;
|
88 |
gridBagConstraints.weighty = 1.0;
|
89 |
panel.add(new JPanel(), gridBagConstraints); |
90 |
|
91 |
panel.setBorder(new EmptyBorder(5, 5, 5, 5)); |
92 |
|
93 |
scrollPane.setViewportView(panel); |
94 |
|
95 |
setLayout(new BorderLayout()); |
96 |
add(scrollPane, BorderLayout.CENTER);
|
97 |
} |
98 |
|
99 |
/**
|
100 |
* Gets a tile cache configuration panel
|
101 |
* @return tile cache configuration panel
|
102 |
*/
|
103 |
private TileCachePreferencesPanel getPreferenceTileCache() {
|
104 |
if (tilecache == null) { |
105 |
tilecache = new TileCachePreferencesPanel();
|
106 |
} |
107 |
return tilecache;
|
108 |
} |
109 |
|
110 |
/*
|
111 |
* (non-Javadoc)
|
112 |
* @see com.iver.andami.preferences.IPreference#initializeValues()
|
113 |
*/
|
114 |
public void initializeValues() { |
115 |
getPreferenceTileCache().initializeValues(); |
116 |
} |
117 |
|
118 |
/*
|
119 |
* (non-Javadoc)
|
120 |
* @see com.iver.andami.preferences.AbstractPreferencePage#storeValues()
|
121 |
*/
|
122 |
public void storeValues() throws StoreException { |
123 |
getPreferenceTileCache().storeValues(); |
124 |
} |
125 |
|
126 |
/*
|
127 |
* (non-Javadoc)
|
128 |
* @see com.iver.andami.preferences.IPreference#initializeDefaults()
|
129 |
*/
|
130 |
public void initializeDefaults() { |
131 |
getPreferenceTileCache().initializeDefaults(); |
132 |
} |
133 |
|
134 |
/*
|
135 |
* (non-Javadoc)
|
136 |
* @see com.iver.andami.preferences.AbstractPreferencePage#isResizeable()
|
137 |
*/
|
138 |
public boolean isResizeable() { |
139 |
return true; |
140 |
} |
141 |
|
142 |
/*
|
143 |
* (non-Javadoc)
|
144 |
* @see com.iver.andami.preferences.IPreference#getID()
|
145 |
*/
|
146 |
public String getID() { |
147 |
return id;
|
148 |
} |
149 |
|
150 |
/*
|
151 |
* (non-Javadoc)
|
152 |
* @see com.iver.andami.preferences.IPreference#getIcon()
|
153 |
*/
|
154 |
public ImageIcon getIcon() { |
155 |
return icon;
|
156 |
} |
157 |
|
158 |
/*
|
159 |
* (non-Javadoc)
|
160 |
* @see com.iver.andami.preferences.IPreference#getPanel()
|
161 |
*/
|
162 |
public JPanel getPanel() { |
163 |
return this; |
164 |
} |
165 |
|
166 |
/*
|
167 |
* (non-Javadoc)
|
168 |
* @see com.iver.andami.preferences.IPreference#getTitle()
|
169 |
*/
|
170 |
public String getTitle() { |
171 |
return i18n.getTranslation("tilecache"); |
172 |
} |
173 |
|
174 |
/*
|
175 |
* (non-Javadoc)
|
176 |
* @see com.iver.andami.preferences.IPreference#isValueChanged()
|
177 |
*/
|
178 |
public boolean isValueChanged() { |
179 |
return true; |
180 |
} |
181 |
|
182 |
public void setChangesApplied() {} |
183 |
} |