1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.data.projection;
|
---|
3 |
|
---|
4 | import java.util.Collection;
|
---|
5 |
|
---|
6 | import javax.swing.JPanel;
|
---|
7 |
|
---|
8 | public 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 | }
|
---|