root / trunk / frameworks / _fwAndami / src / com / iver / andami / preferences / IPreference.java @ 9211
History | View | Annotate | Download (3.53 KB)
1 | 5792 | caballero | /* 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 | 6575 | jaume | *
|
51 | 5792 | caballero | * @author jaume dominguez faus - jaume.dominguez@iver.es
|
52 | *
|
||
53 | */
|
||
54 | public interface IPreference { |
||
55 | 6575 | jaume | |
56 | 5792 | caballero | /**
|
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 | 6575 | jaume | |
63 | 5792 | caballero | /**
|
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 | 6575 | jaume | |
70 | 5792 | caballero | /**
|
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 | 6575 | jaume | |
83 | 5792 | caballero | /**
|
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 | 6575 | jaume | * @return
|
89 | 5792 | caballero | */
|
90 | String getParentID();
|
||
91 | 6575 | jaume | |
92 | 5792 | caballero | /**
|
93 | * Initializes the components of this preferences page to the last settings.
|
||
94 | */
|
||
95 | void initializeValues();
|
||
96 | 6575 | jaume | |
97 | 5792 | caballero | /**
|
98 | * Saves the new settings
|
||
99 | * @return <b>true</b> if the values were correctly stored, <b>false</b> otherwise.
|
||
100 | 6660 | caballero | * @throws StoreException
|
101 | 5792 | caballero | */
|
102 | 6808 | jaume | void saveValues() throws StoreException; |
103 | 6575 | jaume | |
104 | 5792 | caballero | /**
|
105 | * Restores the default values of this preferences page's settings.
|
||
106 | */
|
||
107 | void initializeDefaults();
|
||
108 | 6575 | jaume | |
109 | 5792 | caballero | /**
|
110 | * Returns the image that will be shown in the header of this preferences page
|
||
111 | * @return
|
||
112 | */
|
||
113 | ImageIcon getIcon();
|
||
114 | |||
115 | 6575 | jaume | /**
|
116 | 6805 | jaume | * Tells if this preference page has changed any value
|
117 | * (used for storing values when necessary)
|
||
118 | * @return <b>True</b> if any value has changed, <b>false</b> otherwise.
|
||
119 | 6575 | jaume | */
|
120 | 6805 | jaume | boolean isValueChanged();
|
121 | 6808 | jaume | |
122 | 5792 | caballero | } |
123 |