org.openstreetmap.josm.gui.preferences.projection
Class AbstractProjectionChoice

java.lang.Object
  extended by org.openstreetmap.josm.gui.preferences.projection.AbstractProjectionChoice
All Implemented Interfaces:
ProjectionChoice
Direct Known Subclasses:
CustomProjectionChoice, ListProjectionChoice, SingleProjectionChoice

public abstract class AbstractProjectionChoice
extends java.lang.Object
implements ProjectionChoice


Field Summary
protected  java.lang.String cacheDir
           
protected  java.lang.String id
           
protected  java.lang.String name
           
 
Constructor Summary
AbstractProjectionChoice(java.lang.String name, java.lang.String id)
          Constructor (without cacheDir argument).
AbstractProjectionChoice(java.lang.String name, java.lang.String id, java.lang.String cacheDir)
          Constructor.
 
Method Summary
 java.lang.String getCacheDir()
           
abstract  java.lang.String getCurrentCode()
           
 java.lang.String getId()
          Get a unique id for the projection choice.
 Projection getProjection()
          Get the projection that matches the internal state.
abstract  java.lang.String getProjectionName()
           
 java.lang.String toString()
          Short name of the projection choice as shown in the GUI (combo box).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.openstreetmap.josm.gui.preferences.projection.ProjectionChoice
allCodes, getPreferencePanel, getPreferences, getPreferencesFromCode, setPreferences
 

Field Detail

name

protected java.lang.String name

id

protected java.lang.String id

cacheDir

protected java.lang.String cacheDir
Constructor Detail

AbstractProjectionChoice

public AbstractProjectionChoice(java.lang.String name,
                                java.lang.String id,
                                java.lang.String cacheDir)
Constructor.

Parameters:
name - short name of the projection choice as shown in the GUI
id - unique identifier for the projection choice
cacheDir - a cache directory name

AbstractProjectionChoice

public AbstractProjectionChoice(java.lang.String name,
                                java.lang.String id)
Constructor (without cacheDir argument). Only for core projection choices, where chacheDir is the same as the second part of the id.

Method Detail

getId

public java.lang.String getId()
Description copied from interface: ProjectionChoice
Get a unique id for the projection choice. Will be used to save the user selection to the preference file.

Specified by:
getId in interface ProjectionChoice
Returns:
the string identifier

getCacheDir

public java.lang.String getCacheDir()

toString

public java.lang.String toString()
Description copied from interface: ProjectionChoice
Short name of the projection choice as shown in the GUI (combo box).

Specified by:
toString in interface ProjectionChoice
Overrides:
toString in class java.lang.Object
Returns:
the name

getCurrentCode

public abstract java.lang.String getCurrentCode()

getProjectionName

public abstract java.lang.String getProjectionName()

getProjection

public Projection getProjection()
Description copied from interface: ProjectionChoice
Get the projection that matches the internal state.

Specified by:
getProjection in interface ProjectionChoice


JOSM