com.bbn.openmap.image
Class ImageMaster

java.lang.Object
  extended by com.bbn.openmap.image.ImageMaster

public class ImageMaster
extends java.lang.Object

The ImageMaster is an organizer for running the ImageServer to create one or more images. It relies on a properties file, which sets up a series of entries for an ImageServer. Each entry has parameters for setting up a projection for an image, a parameters for a URL for the ImageServer to use to set up the layers for an image, and a parameter to set the name and path of the output image file.

Each map entry in the ImageServer has parameters for the projection and layer properties to use for the map image, and the size, location and format of the output image.


Nested Class Summary
 class ImageMaster.ImageMasterHelper
          The ImageMasterHelper contains an ImageServer, and acts like the ImageReceiver to create the Image file when the bits are ready.
 
Field Summary
static java.lang.String ErrorLogFileProperty
          Property for an error log file.
static java.lang.String ImageBackgroundColorProperty
          Property for the image's background color.
static java.lang.String ImageHeightProperty
          Property for an image's height.
static java.lang.String ImageLatitudeProperty
          Property for an image's projection center latitude.
static java.lang.String ImageLongitudeProperty
          Property for an image's projection center longitude.
static java.lang.String ImageNameProperty
          Property for an image's output name.
static java.lang.String ImageProjectionProperty
          Property for an image's projection type.
static java.lang.String ImageScaleProperty
          Property for an image's projection scale.
static java.lang.String ImageServersProperty
          Property for space separated image servers to be created.
static java.lang.String ImageWidthProperty
          Property for an image's width.
protected  java.util.Hashtable instantiatedLayers
          Hashtable of instantiated layers across servers, to reduce duplication of same layers.
static java.lang.String OutputLogFileProperty
          Property for an output log file.
static java.lang.String ScaleToHeightProperty
          Property for scaling the height of image after creation.
static java.lang.String ScaleToWidthProperty
          Property for scaling the width of image after creation.
static java.lang.String ServerPropertiesProperty
          Property for the properties file holding property for a particular image.
 
Constructor Summary
ImageMaster(java.util.Properties props)
          Create with properties.
ImageMaster(java.lang.String propertiesFile)
          Create with properties file.
ImageMaster(java.net.URL propertiesURL)
          Create with properties file URL.
 
Method Summary
protected  void doNext()
          This causes the ImageMaster to look through the list of ImageMasterHelpers and launch the next one that hasn't been completed.
 boolean loadProperties(java.util.Properties props, java.lang.String file)
          Load the named file from the named directory into the given Properties instance.
 boolean loadProperties(java.util.Properties props, java.net.URL url)
          Loads properties from a java resource.
protected  boolean loadPropertiesFromResource(java.util.Properties props, java.lang.String resourceName)
          Loads properties from a java resource.
static void main(java.lang.String[] args)
          Start up and go.
static void printHelp()
          printHelp should print a usage statement which reflects the command line needs of the ImageServer.
static void printMasterProps()
          Prints an example of the ImageMaster properties file.
static void printServerProps()
          Print the ImageServer properties file, referenced by the ImageMaster properties file.
 void run()
          Start the ImageMaster to go through the ImageMasterHelpers.
 ImageMaster.ImageMasterHelper[] setImageServers(java.util.Properties properties)
          Creates the ImageMasterHelper array from an ImageMaster properties object.
 void setProperties(java.util.Properties properties)
          Set the properties for the ImageMaster, which also gets all the ImageMasterHelpers created.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ImageServersProperty

public static final java.lang.String ImageServersProperty
Property for space separated image servers to be created.

See Also:
Constant Field Values

ServerPropertiesProperty

public static final java.lang.String ServerPropertiesProperty
Property for the properties file holding property for a particular image.

See Also:
Constant Field Values

ImageProjectionProperty

public static final java.lang.String ImageProjectionProperty
Property for an image's projection type.

See Also:
Constant Field Values

ImageLatitudeProperty

public static final java.lang.String ImageLatitudeProperty
Property for an image's projection center latitude.

See Also:
Constant Field Values

ImageLongitudeProperty

public static final java.lang.String ImageLongitudeProperty
Property for an image's projection center longitude.

See Also:
Constant Field Values

ImageScaleProperty

public static final java.lang.String ImageScaleProperty
Property for an image's projection scale.

See Also:
Constant Field Values

ImageHeightProperty

public static final java.lang.String ImageHeightProperty
Property for an image's height.

See Also:
Constant Field Values

ImageWidthProperty

public static final java.lang.String ImageWidthProperty
Property for an image's width.

See Also:
Constant Field Values

ImageBackgroundColorProperty

public static final java.lang.String ImageBackgroundColorProperty
Property for the image's background color.

See Also:
Constant Field Values

ImageNameProperty

public static final java.lang.String ImageNameProperty
Property for an image's output name.

See Also:
Constant Field Values

ScaleToWidthProperty

public static final java.lang.String ScaleToWidthProperty
Property for scaling the width of image after creation.

See Also:
Constant Field Values

ScaleToHeightProperty

public static final java.lang.String ScaleToHeightProperty
Property for scaling the height of image after creation.

See Also:
Constant Field Values

OutputLogFileProperty

public static final java.lang.String OutputLogFileProperty
Property for an output log file.

See Also:
Constant Field Values

ErrorLogFileProperty

public static final java.lang.String ErrorLogFileProperty
Property for an error log file.

See Also:
Constant Field Values

instantiatedLayers

protected java.util.Hashtable instantiatedLayers
Hashtable of instantiated layers across servers, to reduce duplication of same layers.

Constructor Detail

ImageMaster

public ImageMaster(java.util.Properties props)
Create with properties.


ImageMaster

public ImageMaster(java.lang.String propertiesFile)
Create with properties file.


ImageMaster

public ImageMaster(java.net.URL propertiesURL)
Create with properties file URL.

Method Detail

loadPropertiesFromResource

protected boolean loadPropertiesFromResource(java.util.Properties props,
                                             java.lang.String resourceName)
Loads properties from a java resource. This will load the named resource identifier into the given properties instance.

Parameters:
props - the Properties instance to receive the properties
resourceName - the name of the resource to load
Returns:
true if all's well.

loadProperties

public boolean loadProperties(java.util.Properties props,
                              java.net.URL url)
Loads properties from a java resource. This will load the named resource identifier into the given properties instance.

Parameters:
props - the Properties instance to receive the properties
url - the url to load
Returns:
true if all's well.

loadProperties

public boolean loadProperties(java.util.Properties props,
                              java.lang.String file)
Load the named file from the named directory into the given Properties instance. If the file is not found a warning is issued. If an IOException occurs, a fatal error is printed and the application will exit.

Parameters:
file - the name of the file
Returns:
true if all's well.

setProperties

public void setProperties(java.util.Properties properties)
Set the properties for the ImageMaster, which also gets all the ImageMasterHelpers created.


run

public void run()
Start the ImageMaster to go through the ImageMasterHelpers.


doNext

protected void doNext()
This causes the ImageMaster to look through the list of ImageMasterHelpers and launch the next one that hasn't been completed. It will cause the program to exit if there is nothing more to do.


setImageServers

public ImageMaster.ImageMasterHelper[] setImageServers(java.util.Properties properties)
Creates the ImageMasterHelper array from an ImageMaster properties object. After this method is called, call run() to start the servers on their creative ways.

Parameters:
properties - the ImageMaster properties.
Returns:
ImageMasterHelper array.

main

public static void main(java.lang.String[] args)
Start up and go.


printHelp

public static void printHelp()
printHelp should print a usage statement which reflects the command line needs of the ImageServer.


printMasterProps

public static void printMasterProps()
Prints an example of the ImageMaster properties file.


printServerProps

public static void printServerProps()
Print the ImageServer properties file, referenced by the ImageMaster properties file.



Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details