public abstract class ListProjectionChoice extends AbstractProjectionChoice
Modifier and Type | Class and Description |
---|---|
protected class |
ListProjectionChoice.CBPanel |
Modifier and Type | Field and Description |
---|---|
protected int |
defaultIndex |
protected String[] |
entries |
protected int |
index |
protected String |
label |
cacheDir, id, name
Constructor and Description |
---|
ListProjectionChoice(String name,
String id,
String[] entries,
String label)
Constructs a new
ListProjectionChoice . |
ListProjectionChoice(String name,
String id,
String[] entries,
String label,
int defaultIndex)
Constructs a new
ListProjectionChoice . |
Modifier and Type | Method and Description |
---|---|
JPanel |
getPreferencePanel(ActionListener listener)
Generate and provide the GUI.
|
Collection<String> |
getPreferences(JPanel panel)
Extract preferences from the GUI.
|
protected abstract String |
indexToZone(int idx)
Convert 0-based index to preference value.
|
void |
setPreferences(Collection<String> args)
Set the internal state to match the preferences.
|
protected abstract int |
zoneToIndex(String zone)
Convert preference value to 0-based index.
|
getCacheDir, getCurrentCode, getId, getProjection, getProjectionName, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
allCodes, getPreferencesFromCode
protected int index
protected int defaultIndex
public ListProjectionChoice(String name, String id, String[] entries, String label, int defaultIndex)
ListProjectionChoice
.name
- the display nameid
- the unique id for this ProjectionChoiceentries
- the list of display entries for the combo-boxlabel
- a label shown left to the combo-boxdefaultIndex
- the default index for the combo-boxpublic ListProjectionChoice(String name, String id, String[] entries, String label)
ListProjectionChoice
.name
- the display nameid
- the unique id for this ProjectionChoiceentries
- the list of display entries for the combo-boxlabel
- a label shown left to the combo-boxprotected abstract String indexToZone(int idx)
idx
- 0-based indexzoneToIndex(java.lang.String)
protected abstract int zoneToIndex(String zone)
zone
- preference valueindexToZone(int)
public void setPreferences(Collection<String> args)
ProjectionChoice
args
- preferences as a list of strings; may be null
to reset everything.public JPanel getPreferencePanel(ActionListener listener)
ProjectionChoice
listener
- listener for any change of preferencespublic Collection<String> getPreferences(JPanel panel)
ProjectionChoice
panel
- projection preferences panelProjectionChoice.setPreferences(java.util.Collection<java.lang.String>)