source: josm/trunk/src/org/openstreetmap/josm/data/projection/ProjectionSubPrefs.java@ 2304

Last change on this file since 2304 was 2272, checked in by stoecker, 15 years ago

first partial support for sub preferences, not yet functional

File size: 1.5 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.data.projection;
3
4import java.util.Collection;
5
6import javax.swing.JPanel;
7
8public interface ProjectionSubPrefs {
9 /**
10 * Generates the GUI for the given preference and packs them in a JPanel
11 * so they may be displayed if the projection is selected.
12 *
13 * Implementation hints:
14 * <ul>
15 * <li>Do not return <code>null</code> as it is assumed that if this
16 * interface is implemented the projection actually has prefs to
17 * display/save.</li>
18 * <li>Cache the JPanel in a local variable so that changes are
19 * persistent even if the user chooses another projection in between.
20 * Destroy the panel on destroyCachedPanel() so that the pre-selected
21 * settings may update the preferences are updated from the outside</li>
22 * </li>
23 * @return
24 */
25 public JPanel getPreferencePanel();
26
27 /**
28 * Will be called if the preference dialog is dismissed.
29 */
30 public Collection<String> getPreferences();
31
32 /**
33 * Return null when code is not part of this projection.
34 */
35 public Collection<String> getPreferencesFromCode(String code);
36
37 /**
38 * Will be called if the preference dialog is dismissed.
39 */
40 public void setPreferences(Collection<String> args);
41
42 /**
43 * Resets all variables related to the projection preferences so they may
44 * update the next time getPreferencePanel is called.
45 */
46 public void destroyCachedPanel();
47}
Note: See TracBrowser for help on using the repository browser.