org.esa.beam.framework.dataop.dem
Class AbstractElevationModelDescriptor

java.lang.Object
  extended by org.esa.beam.framework.dataop.dem.AbstractElevationModelDescriptor
All Implemented Interfaces:
ElevationModelDescriptor

public abstract class AbstractElevationModelDescriptor
extends Object
implements ElevationModelDescriptor

The AbstractElevationModelDescriptor offers a default implementation for the installDemFiles(Object) method. It uses the properties values returned ElevationModelDescriptor.getDemArchiveUrl() and getDemInstallDir() methods in order to download and install the DEM.

Version:
$Revision$
Author:
Norman Fomferra

Field Summary
static String INSTALL_DIR_PROPERTY_NAME
           
static String PROPERTIES_FILE_NAME
           
 
Fields inherited from interface org.esa.beam.framework.dataop.dem.ElevationModelDescriptor
DEM_INSTALLATION_CANCELED, DEM_INSTALLATION_ERROR, DEM_INSTALLATION_IN_PROGRESS, DEM_INSTALLED
 
Constructor Summary
protected AbstractElevationModelDescriptor()
           
 
Method Summary
 File getDemInstallDir()
          Returns the directory (if any) where the DEM files shall be located.
 File getDemPropertiesFile()
          Gets the DEM properties file "${BEAM-HOME}/beam-core/auxdata/dem/${DEM}/dem.properties".
 int getInstallationStatus()
          Currently not used.
 boolean installDemFiles(Object uiComponent)
          Asynchronously installs the files required to use the DEM if not already done or in progress.
 boolean isInstallingDem()
          Tests whether or not the DEM is currently being installed.
protected  Properties loadProperties()
          Loads DEM properties from the "${BEAM-HOME}/beam-core/auxdata/dem/${DEM}/dem.properties" file.
protected  File promptForDemInstallDir(Component parent)
          Prompts the user for the installation directory.
 void setDemInstallDir(File demInstallDir)
           
protected  void storeProperties()
          Stores DEM properties in the "${BEAM-HOME}/beam-core/auxdata/dem/${DEM}/dem.properties" file.
protected  void storeProperties(Properties properties)
          Stores DEM properties in the "${BEAM-HOME}/beam-core/auxdata/dem/${DEM}/dem.properties" file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.esa.beam.framework.dataop.dem.ElevationModelDescriptor
createDem, getDatum, getDemArchiveUrl, getName, getNoDataValue, isDemInstalled
 

Field Detail

PROPERTIES_FILE_NAME

public static final String PROPERTIES_FILE_NAME
See Also:
Constant Field Values

INSTALL_DIR_PROPERTY_NAME

public static final String INSTALL_DIR_PROPERTY_NAME
See Also:
Constant Field Values
Constructor Detail

AbstractElevationModelDescriptor

protected AbstractElevationModelDescriptor()
Method Detail

getDemPropertiesFile

public File getDemPropertiesFile()
Gets the DEM properties file "${BEAM-HOME}/beam-core/auxdata/dem/${DEM}/dem.properties".


getDemInstallDir

public File getDemInstallDir()
Description copied from interface: ElevationModelDescriptor
Returns the directory (if any) where the DEM files shall be located.

Specified by:
getDemInstallDir in interface ElevationModelDescriptor
Returns:
the DEM file directory

setDemInstallDir

public void setDemInstallDir(File demInstallDir)

isInstallingDem

public boolean isInstallingDem()
Description copied from interface: ElevationModelDescriptor
Tests whether or not the DEM is currently being installed.

Specified by:
isInstallingDem in interface ElevationModelDescriptor
Returns:
true, if so

getInstallationStatus

public int getInstallationStatus()
Description copied from interface: ElevationModelDescriptor
Currently not used.

Specified by:
getInstallationStatus in interface ElevationModelDescriptor

installDemFiles

public boolean installDemFiles(Object uiComponent)
Description copied from interface: ElevationModelDescriptor
Asynchronously installs the files required to use the DEM if not already done or in progress.

Specified by:
installDemFiles in interface ElevationModelDescriptor
Parameters:
uiComponent - an optional UI component which serves as parent for progress monitoring
Returns:
true, if the DEM is already installed, is being installed or will be installed. False, if an error occurred or the user canceled the installation

loadProperties

protected Properties loadProperties()
Loads DEM properties from the "${BEAM-HOME}/beam-core/auxdata/dem/${DEM}/dem.properties" file.


storeProperties

protected void storeProperties()
Stores DEM properties in the "${BEAM-HOME}/beam-core/auxdata/dem/${DEM}/dem.properties" file.


storeProperties

protected void storeProperties(Properties properties)
Stores DEM properties in the "${BEAM-HOME}/beam-core/auxdata/dem/${DEM}/dem.properties" file.

Parameters:
properties - the properties

promptForDemInstallDir

protected File promptForDemInstallDir(Component parent)
Prompts the user for the installation directory.

Parameters:
parent - the parent UI component
Returns:
the installation directory or null if the user canceled the directory selection


Copyright © 2002-2013 Brockmann Consult GmbH. All Rights Reserved.