Statistics
| Revision:

root / trunk / frameworks / _fwAndami / src / com / iver / andami / preferences / IPreference.java @ 9642

History | View | Annotate | Download (3.59 KB)

1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2004 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
 * For more information, contact:
20
 *
21
 *  Generalitat Valenciana
22
 *   Conselleria d'Infraestructures i Transport
23
 *   Av. Blasco Ib??ez, 50
24
 *   46010 VALENCIA
25
 *   SPAIN
26
 *
27
 *      +34 963862235
28
 *   gvsig@gva.es
29
 *      www.gvsig.gva.es
30
 *
31
 *    or
32
 *
33
 *   IVER T.I. S.A
34
 *   Salamanca 50
35
 *   46005 Valencia
36
 *   Spain
37
 *
38
 *   +34 963163400
39
 *   dac@iver.es
40
 */
41
package com.iver.andami.preferences;
42

    
43
import javax.swing.ImageIcon;
44
import javax.swing.JPanel;
45
/**
46
 * Interface that any entry in the application's preferences dialog must implement.
47
 * In addition to this interface, an abstract class is supplied to ease the addition
48
 * of new pages
49
 * @see com.iver.andami.preferences.AbstractPreferencePage
50
 *
51
 * @author jaume dominguez faus - jaume.dominguez@iver.es
52
 *
53
 */
54
public interface IPreference {
55

    
56
        /**
57
         * Returns an identifier for this preferences page that is used to reference
58
         * it inside the Map.
59
         * @return String, you'd typically use any kind of <code>this.getClass().getName();</code>
60
         */
61
        String getID();
62

    
63
        /**
64
         * Returns an string containing the title of the preferences page. This string
65
         * will be shown whether in the tree entry or in the page header.
66
         * @return String, the title of the page
67
         */
68
        String getTitle();
69

    
70
        /**
71
         * The page must be contained in a JPanel and whatever to be shown will be returned
72
         * by this function.<br>
73
         * <p>
74
         * The content is added, removed and repainted automatically upon the events received from
75
         * the mouse. So, you only have to care about the content and the functionality to make it
76
         * <br>
77
         * </p>
78
         * having sense.
79
         * @return JPanel holding the contents to be shown in the page.
80
         */
81
        JPanel getPanel();
82

    
83
        /**
84
         * Returns the ID of the parent of this layer. If this method returns null, which means
85
         * that this preferences page has no parent, this is new entry in the preferences
86
         * tree, otherwise this preferences page will be hanging on the page with the ID
87
         * returned by this.
88
         * @return
89
         */
90
        String getParentID();
91

    
92
        /**
93
         * Initializes the components of this preferences page to the last settings.
94
         */
95
        void initializeValues();
96

    
97
        /**
98
         * Saves the new settings
99
         * @return <b>true</b> if the values were correctly stored, <b>false</b> otherwise.
100
         * @throws StoreException
101
         */
102
        void saveValues() throws StoreException;
103

    
104
        /**
105
         * Restores the default values of this preferences page's settings. Values are not
106
         * saved until saveValues() is executed
107
         */
108
        void initializeDefaults();
109

    
110
        /**
111
         * Returns the image that will be shown in the header of this preferences page
112
         * @return
113
         */
114
        ImageIcon getIcon();
115

    
116
        /**
117
         * Tells if this preference page has changed any value
118
         * (used for storing values when necessary)
119
         * @return <b>True</b> if any value has changed, <b>false</b> otherwise.
120
         */
121
        boolean isValueChanged();
122

    
123
}
124

    
125