org.openstreetmap.fma.jtiledownloader.config
Class AppConfiguration

java.lang.Object
  extended by org.openstreetmap.fma.jtiledownloader.config.AppConfiguration
All Implemented Interfaces:
DownloadConfigurationSaverIf

public class AppConfiguration
extends java.lang.Object
implements DownloadConfigurationSaverIf


Field Summary
private  int _downloadThreads
           
private  int _inputPanelIndex
           
private  java.lang.String _lastZoom
           
private  int _minimumAgeInDays
           
private  java.lang.String _outputFolder
           
private  boolean _overwriteExistingFiles
           
private  java.lang.String _proxyServer
           
private  java.lang.String _proxyServerPassword
           
private  java.lang.String _proxyServerPort
           
private  boolean _proxyServerRequireesAuthentitication
           
private  java.lang.String _proxyServerUser
           
private  boolean _showTilePreview
           
private  boolean _slippyMap_NoDownload
           
private  boolean _slippyMap_SaveTiles
           
private  java.lang.String _tileServer
           
private  int _tileSortingPolicy
           
private  boolean _useProxyServer
           
private  boolean _waitAfterNrTiles
           
private  int _waitNrTiles
           
private  int _waitSeconds
           
private static java.lang.String APP_CONFIG_PROPERTIES
           
private static java.lang.String DOWNLOAD_THREADS
           
private static java.lang.String INPUT_PANEL_INDEX
           
private static AppConfiguration instance
           
private static java.lang.String LAST_OUTPUTFOLDER
           
private static java.lang.String LAST_ZOOM
           
private static java.util.logging.Logger log
           
private static java.lang.String MINIMUM_AGE_IN_DAYS
           
private static java.lang.String OVERWRITE_EXISTING_FILES
           
private  java.util.Properties prop
           
private static java.lang.String PROXY_SERVER
           
private static java.lang.String PROXY_SERVER_PASSWORD
           
private static java.lang.String PROXY_SERVER_PORT
           
private static java.lang.String PROXY_SERVER_USER
           
private static java.lang.String SHOW_TILE_PREVIEW
           
private static java.lang.String SLIPPYMAP_NODOWNLOAD
           
private static java.lang.String SLIPPYMAP_SAVETILES
           
private static java.lang.String TILE_SERVER
           
private static java.lang.String TILE_SORTING_POLICY
           
private static java.lang.String USE_PROXY_SERVER
           
private static java.lang.String USE_PROXY_SERVER_AUTH
           
private static java.lang.String WAIT_AFTER_NR_TILES
           
private static java.lang.String WAIT_NR_TILES
           
private static java.lang.String WAIT_SECONDS
           
 
Constructor Summary
private AppConfiguration()
           
 
Method Summary
 int getDownloadThreads()
          Getter for downloadThreads
 int getInputPanelIndex()
          Getter for inputPanelIndex
static AppConfiguration getInstance()
           
 java.lang.String getLastZoom()
          Getter for lastZoom
 int getMinimumAgeInDays()
          Getter for minimumAgeInDays
 java.lang.String getOutputFolder()
          Getter for outputFolder
 java.lang.String getProxyServer()
          Getter for proxyServer
 java.lang.String getProxyServerPassword()
          Getter for proxyServerPassword
 java.lang.String getProxyServerPort()
          Getter for proxyServerPort
 java.lang.String getProxyServerUser()
          Getter for proxyServerUser
 java.lang.String getTileServer()
          Getter for tileServer
 int getTileSortingPolicy()
           
 boolean getUseProxyServer()
          Getter for useProxyServer
 int getWaitNrTiles()
          Getter for waitNrTiles
 int getWaitSeconds()
          Getter for waitSeconds
 boolean isOverwriteExistingFiles()
          Getter for overwriteExistingFiles
 boolean isProxyServerRequiresAuthentitication()
          Getter for isProxyServerRequiresAuthentitication
 boolean isShowTilePreview()
          Getter for showTilePreview
 boolean isSlippyMap_NoDownload()
          Getter for slippyMap_NoDownload
 boolean isSlippyMap_SaveTiles()
          Getter for slippyMap_SaveTiles
 boolean isWaitingAfterNrOfTiles()
          Getter for isWaitingAfterNrOfTiles
 void loadDownloadConfig(DownloadConfiguration config)
           
private  void loadFromFile()
           
 void saveDownloadConfig(DownloadConfiguration config)
           
 void saveToFile()
           
 void setDownloadThreads(int downloadThreads)
          Setter for downloadThreads
 void setInputPanelIndex(int inputPanelIndex)
          Setter for inputPanelIndex
 void setLastZoom(java.lang.String lastZoom)
          Setter for lastZoom
 void setMinimumAgeInDays(int minimumAgeInDays)
          Setter for minimumAgeInDays
 void setOutputFolder(java.lang.String outputFolder)
          Setter for outputFolder
 void setOverwriteExistingFiles(boolean overwriteExistingFiles)
          Setter for overwriteExistingFiles
private  void setProperty(java.util.Properties prop, java.lang.String key, java.lang.String value)
           
 void setProxyServer(java.lang.String proxyServer)
          Setter for proxyServer
 void setProxyServerPassword(java.lang.String proxyServerPassword)
          Setter for proxyServerPassword
 void setProxyServerPort(java.lang.String proxyServerPort)
          Setter for proxyServerPort
 void setProxyServerRequiresAuthentitication(boolean useProxyServerAuthentitication)
          Setter for setProxyServerRequiresAuthentitication
 void setProxyServerUser(java.lang.String proxyServerUser)
          Setter for proxyServerUser
 void setShowTilePreview(boolean showTilePreview)
          Setter for showTilePreview
 void setSlippyMap_NoDownload(boolean slippyMapNoDownload)
          Setter for slippyMapNoDownload
 void setSlippyMap_SaveTiles(boolean slippyMapSaveTiles)
          Setter for slippyMapSaveTiles
 void setTileServer(java.lang.String tileServer)
          Setter for tileServer
 void setTileSortingPolicy(int tileSortingPolicy)
           
 void setUseProxyServer(boolean useProxyServer)
          Setter for useProxyServer
 void setWaitAfterNrTiles(boolean waitAfterNrTiles)
          Setter for waitAfterNrTiles
 void setWaitNrTiles(int waitNrTiles)
          Setter for waitNrTiles
 void setWaitSeconds(int waitSeconds)
          Setter for waitSeconds
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final java.util.logging.Logger log

APP_CONFIG_PROPERTIES

private static final java.lang.String APP_CONFIG_PROPERTIES
See Also:
Constant Field Values

instance

private static AppConfiguration instance

prop

private java.util.Properties prop

_useProxyServer

private boolean _useProxyServer

_proxyServer

private java.lang.String _proxyServer

_proxyServerPort

private java.lang.String _proxyServerPort

_proxyServerRequireesAuthentitication

private boolean _proxyServerRequireesAuthentitication

_proxyServerUser

private java.lang.String _proxyServerUser

_proxyServerPassword

private java.lang.String _proxyServerPassword

_showTilePreview

private boolean _showTilePreview

_slippyMap_NoDownload

private boolean _slippyMap_NoDownload

_slippyMap_SaveTiles

private boolean _slippyMap_SaveTiles

_tileServer

private java.lang.String _tileServer

_lastZoom

private java.lang.String _lastZoom

_outputFolder

private java.lang.String _outputFolder

_downloadThreads

private int _downloadThreads

_overwriteExistingFiles

private boolean _overwriteExistingFiles

_minimumAgeInDays

private int _minimumAgeInDays

_waitAfterNrTiles

private boolean _waitAfterNrTiles

_waitSeconds

private int _waitSeconds

_waitNrTiles

private int _waitNrTiles

_inputPanelIndex

private int _inputPanelIndex

_tileSortingPolicy

private int _tileSortingPolicy

USE_PROXY_SERVER

private static final java.lang.String USE_PROXY_SERVER
See Also:
Constant Field Values

PROXY_SERVER

private static final java.lang.String PROXY_SERVER
See Also:
Constant Field Values

PROXY_SERVER_PORT

private static final java.lang.String PROXY_SERVER_PORT
See Also:
Constant Field Values

USE_PROXY_SERVER_AUTH

private static final java.lang.String USE_PROXY_SERVER_AUTH
See Also:
Constant Field Values

PROXY_SERVER_USER

private static final java.lang.String PROXY_SERVER_USER
See Also:
Constant Field Values

PROXY_SERVER_PASSWORD

private static final java.lang.String PROXY_SERVER_PASSWORD
See Also:
Constant Field Values

SHOW_TILE_PREVIEW

private static final java.lang.String SHOW_TILE_PREVIEW
See Also:
Constant Field Values

SLIPPYMAP_NODOWNLOAD

private static final java.lang.String SLIPPYMAP_NODOWNLOAD
See Also:
Constant Field Values

SLIPPYMAP_SAVETILES

private static final java.lang.String SLIPPYMAP_SAVETILES
See Also:
Constant Field Values

TILE_SERVER

private static final java.lang.String TILE_SERVER
See Also:
Constant Field Values

LAST_ZOOM

private static final java.lang.String LAST_ZOOM
See Also:
Constant Field Values

LAST_OUTPUTFOLDER

private static final java.lang.String LAST_OUTPUTFOLDER
See Also:
Constant Field Values

DOWNLOAD_THREADS

private static final java.lang.String DOWNLOAD_THREADS
See Also:
Constant Field Values

OVERWRITE_EXISTING_FILES

private static final java.lang.String OVERWRITE_EXISTING_FILES
See Also:
Constant Field Values

MINIMUM_AGE_IN_DAYS

private static final java.lang.String MINIMUM_AGE_IN_DAYS
See Also:
Constant Field Values

WAIT_AFTER_NR_TILES

private static final java.lang.String WAIT_AFTER_NR_TILES
See Also:
Constant Field Values

WAIT_SECONDS

private static final java.lang.String WAIT_SECONDS
See Also:
Constant Field Values

WAIT_NR_TILES

private static final java.lang.String WAIT_NR_TILES
See Also:
Constant Field Values

INPUT_PANEL_INDEX

private static final java.lang.String INPUT_PANEL_INDEX
See Also:
Constant Field Values

TILE_SORTING_POLICY

private static final java.lang.String TILE_SORTING_POLICY
See Also:
Constant Field Values
Constructor Detail

AppConfiguration

private AppConfiguration()
Method Detail

getInstance

public static AppConfiguration getInstance()

saveToFile

public void saveToFile()

setProperty

private void setProperty(java.util.Properties prop,
                         java.lang.String key,
                         java.lang.String value)

loadFromFile

private void loadFromFile()

getUseProxyServer

public final boolean getUseProxyServer()
Getter for useProxyServer

Returns:
the useProxyServer

setUseProxyServer

public final void setUseProxyServer(boolean useProxyServer)
Setter for useProxyServer

Parameters:
useProxyServer - the useProxyServer to set

getProxyServer

public final java.lang.String getProxyServer()
Getter for proxyServer

Returns:
the proxyServer

setProxyServer

public final void setProxyServer(java.lang.String proxyServer)
Setter for proxyServer

Parameters:
proxyServer - the proxyServer to set

getProxyServerPort

public final java.lang.String getProxyServerPort()
Getter for proxyServerPort

Returns:
the proxyServerPort

setProxyServerPort

public final void setProxyServerPort(java.lang.String proxyServerPort)
Setter for proxyServerPort

Parameters:
proxyServerPort - the proxyServerPort to set

isProxyServerRequiresAuthentitication

public final boolean isProxyServerRequiresAuthentitication()
Getter for isProxyServerRequiresAuthentitication

Returns:
the isProxyServerRequiresAuthentitication

setProxyServerRequiresAuthentitication

public final void setProxyServerRequiresAuthentitication(boolean useProxyServerAuthentitication)
Setter for setProxyServerRequiresAuthentitication

Parameters:
useProxyServerAuthentitication -

getProxyServerUser

public final java.lang.String getProxyServerUser()
Getter for proxyServerUser

Returns:
the proxyServerUser

setProxyServerUser

public final void setProxyServerUser(java.lang.String proxyServerUser)
Setter for proxyServerUser

Parameters:
proxyServerUser - the proxyServerUser to set

getProxyServerPassword

public final java.lang.String getProxyServerPassword()
Getter for proxyServerPassword

Returns:
the proxyServerPassword

setProxyServerPassword

public final void setProxyServerPassword(java.lang.String proxyServerPassword)
Setter for proxyServerPassword

Parameters:
proxyServerPassword - the proxyServerPassword to set

setShowTilePreview

public void setShowTilePreview(boolean showTilePreview)
Setter for showTilePreview

Parameters:
showTilePreview - the showTilePreview to set

isShowTilePreview

public boolean isShowTilePreview()
Getter for showTilePreview

Returns:
the showTilePreview

setWaitAfterNrTiles

public void setWaitAfterNrTiles(boolean waitAfterNrTiles)
Setter for waitAfterNrTiles

Parameters:
waitAfterNrTiles - the waitAfterNrTiles to set

isWaitingAfterNrOfTiles

public boolean isWaitingAfterNrOfTiles()
Getter for isWaitingAfterNrOfTiles

Returns:
the isWaitingAfterNrOfTiles

setWaitSeconds

public void setWaitSeconds(int waitSeconds)
Setter for waitSeconds

Parameters:
waitSeconds - the waitSeconds to set

getWaitSeconds

public int getWaitSeconds()
Getter for waitSeconds

Returns:
the waitSeconds

setWaitNrTiles

public void setWaitNrTiles(int waitNrTiles)
Setter for waitNrTiles

Parameters:
waitNrTiles - the waitNrTiles to set

getWaitNrTiles

public int getWaitNrTiles()
Getter for waitNrTiles

Returns:
the waitNrTiles

getInputPanelIndex

public final int getInputPanelIndex()
Getter for inputPanelIndex

Returns:
the inputPanelIndex

setInputPanelIndex

public final void setInputPanelIndex(int inputPanelIndex)
Setter for inputPanelIndex

Parameters:
inputPanelIndex - the inputPanelIndex to set

isOverwriteExistingFiles

public final boolean isOverwriteExistingFiles()
Getter for overwriteExistingFiles

Returns:
the overwriteExistingFiles

setOverwriteExistingFiles

public final void setOverwriteExistingFiles(boolean overwriteExistingFiles)
Setter for overwriteExistingFiles

Parameters:
overwriteExistingFiles - the _verwriteExistingFiles to set

getMinimumAgeInDays

public int getMinimumAgeInDays()
Getter for minimumAgeInDays

Returns:
the minimumAgeInDays

setMinimumAgeInDays

public void setMinimumAgeInDays(int minimumAgeInDays)
Setter for minimumAgeInDays

Parameters:
minimumAgeInDays - the minimumAgeInDays to set

loadDownloadConfig

public void loadDownloadConfig(DownloadConfiguration config)
Specified by:
loadDownloadConfig in interface DownloadConfigurationSaverIf

saveDownloadConfig

public void saveDownloadConfig(DownloadConfiguration config)
Specified by:
saveDownloadConfig in interface DownloadConfigurationSaverIf
See Also:
DownloadConfigurationSaverIf.saveDownloadConfig(org.openstreetmap.fma.jtiledownloader.config.DownloadConfiguration)

getLastZoom

public java.lang.String getLastZoom()
Getter for lastZoom

Returns:
the lastZoom

setLastZoom

public void setLastZoom(java.lang.String lastZoom)
Setter for lastZoom

Parameters:
lastZoom - the lastZoom to set

getOutputFolder

public java.lang.String getOutputFolder()
Getter for outputFolder

Returns:
the outputFolder

setOutputFolder

public void setOutputFolder(java.lang.String outputFolder)
Setter for outputFolder

Parameters:
outputFolder - the outputFolder to set

getTileServer

public java.lang.String getTileServer()
Getter for tileServer

Returns:
the tileServer

setTileServer

public void setTileServer(java.lang.String tileServer)
Setter for tileServer

Parameters:
tileServer - the tileServer to set

isSlippyMap_NoDownload

public boolean isSlippyMap_NoDownload()
Getter for slippyMap_NoDownload

Returns:
the slippyMap_NoDownload

setSlippyMap_NoDownload

public void setSlippyMap_NoDownload(boolean slippyMapNoDownload)
Setter for slippyMapNoDownload

Parameters:
slippyMapNoDownload - the slippyMap_NoDownload to set

isSlippyMap_SaveTiles

public boolean isSlippyMap_SaveTiles()
Getter for slippyMap_SaveTiles

Returns:
the slippyMap_SaveTiles

setSlippyMap_SaveTiles

public void setSlippyMap_SaveTiles(boolean slippyMapSaveTiles)
Setter for slippyMapSaveTiles

Parameters:
slippyMapSaveTiles - the slippyMap_SaveTiles to set

getDownloadThreads

public int getDownloadThreads()
Getter for downloadThreads

Returns:
the downloadThreads

setDownloadThreads

public void setDownloadThreads(int downloadThreads)
Setter for downloadThreads

Parameters:
downloadThreads - the downloadThreads to set

getTileSortingPolicy

public int getTileSortingPolicy()

setTileSortingPolicy

public void setTileSortingPolicy(int tileSortingPolicy)