Statistics
| Revision:

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 @ 1174

History | View | Annotate | Download (4.6 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

    
37
/**
38
 * Preferences for tile cache
39
 * @author Nacho Brodin (nachobrodin@gmail.com
40
 */
41
public class TileCachePreferences extends AbstractPreferencePage {
42
        private static final long         serialVersionUID = -1689657253810393874L;
43

    
44
        protected static String           id        = TileCachePreferences.class.getName();
45
        private ImageIcon                 icon;
46

    
47
        private TileCachePreferencesPanel tilecache = null;
48

    
49
        /**
50
         * Constructor de la clase RasterPreferences
51
         */
52
        public TileCachePreferences() {
53
                super();
54
                icon = IconThemeHelper.getImageIcon("pref-tilecache-icon");
55
                initialize();
56
        }
57

    
58
        /**
59
         * Inicializacion del panel de preferencias.
60
         */
61
        private void initialize() {
62
                setTitle("Frame");
63

    
64
                GridBagConstraints gridBagConstraints;
65

    
66
                JScrollPane scrollPane = new JScrollPane();
67

    
68
                scrollPane.getVerticalScrollBar().setUnitIncrement(20);
69

    
70
                JPanel panel = new JPanel();
71

    
72
                panel.setLayout(new GridBagLayout());
73

    
74
                gridBagConstraints = new GridBagConstraints();
75
                gridBagConstraints.gridx = 0;
76
                gridBagConstraints.gridy = 0;
77
                gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
78
                panel.add(getPreferenceTileCache(), gridBagConstraints);
79

    
80
                gridBagConstraints = new GridBagConstraints();
81
                gridBagConstraints.gridx = 0;
82
                gridBagConstraints.gridy = 7;
83
                gridBagConstraints.weightx = 1.0;
84
                gridBagConstraints.weighty = 1.0;
85
                panel.add(new JPanel(), gridBagConstraints);
86

    
87
                panel.setBorder(new EmptyBorder(5, 5, 5, 5));
88

    
89
                scrollPane.setViewportView(panel);
90

    
91
                setLayout(new BorderLayout());
92
                add(scrollPane, BorderLayout.CENTER);
93
        }
94

    
95
        /**
96
         * Gets a tile cache configuration panel
97
         * @return
98
         */
99
        private TileCachePreferencesPanel getPreferenceTileCache() {
100
                if (tilecache == null) {
101
                        tilecache = new TileCachePreferencesPanel();
102
                }
103
                return tilecache;
104
        }
105

    
106
        /*
107
         * (non-Javadoc)
108
         * @see com.iver.andami.preferences.IPreference#initializeValues()
109
         */
110
        public void initializeValues() {
111
                getPreferenceTileCache().initializeValues();
112
        }
113

    
114
        /*
115
         * (non-Javadoc)
116
         * @see com.iver.andami.preferences.AbstractPreferencePage#storeValues()
117
         */
118
        public void storeValues() throws StoreException {
119
                getPreferenceTileCache().storeValues();
120
        }
121

    
122
        /*
123
         * (non-Javadoc)
124
         * @see com.iver.andami.preferences.IPreference#initializeDefaults()
125
         */
126
        public void initializeDefaults() {
127
                getPreferenceTileCache().initializeDefaults();
128
        }
129

    
130
        /*
131
         * (non-Javadoc)
132
         * @see com.iver.andami.preferences.AbstractPreferencePage#isResizeable()
133
         */
134
        public boolean isResizeable() {
135
                return true;
136
        }
137

    
138
        /*
139
         * (non-Javadoc)
140
         * @see com.iver.andami.preferences.IPreference#getID()
141
         */
142
        public String getID() {
143
                return id;
144
        }
145

    
146
        /*
147
         * (non-Javadoc)
148
         * @see com.iver.andami.preferences.IPreference#getIcon()
149
         */
150
        public ImageIcon getIcon() {
151
                return icon;
152
        }
153

    
154
        /*
155
         * (non-Javadoc)
156
         * @see com.iver.andami.preferences.IPreference#getPanel()
157
         */
158
        public JPanel getPanel() {
159
                return this;
160
        }
161

    
162
        /*
163
         * (non-Javadoc)
164
         * @see com.iver.andami.preferences.IPreference#getTitle()
165
         */
166
        public String getTitle() {
167
                return "Tile Cache";
168
        }
169

    
170
        /*
171
         * (non-Javadoc)
172
         * @see com.iver.andami.preferences.IPreference#isValueChanged()
173
         */
174
        public boolean isValueChanged() {
175
                return true;
176
        }
177

    
178
        public void setChangesApplied() {}
179
}