de.fhg.igd.gps.maps
Class DarmstadtMapConfiguration

java.lang.Object
  extended byde.fhg.igd.gps.maps.DarmstadtMapConfiguration

public class DarmstadtMapConfiguration
extends Object

The DarmstadtMapConfiguration class is used to read metadata for maps of Darmstadt. This metadata is usually stored in a file called "karten.txt" which contains metadata for multiple map sets.

Author:
Dennis Bartussek

Field Summary
private  int index_
          index of current configuration
private  LinkedList mapConfiguration_
          list of configurations for all map sets.
 
Constructor Summary
DarmstadtMapConfiguration(File f)
          Creates a new DarmstadtMapConfiguration to read from the specified File object.
DarmstadtMapConfiguration(String pathname)
          Creates a new DarmstadtMapConfiguration to read from the specified file pathname.
 
Method Summary
 LinkedList getConfigurationNames()
          Returns a LinkedList of all configuration names contained in this DarmstadtMapConfiguration.
 String getFormat()
          Returns the extension of the tile image files of the currently selected configuration.
 Longitude getGeoX1()
          Returns the Longitude of the western border of the currently selected configuration.
 Longitude getGeoX2()
          Returns the Longitude of the eastern border of the currently selected configuration.
 Latitude getGeoY1()
          Returns the Latitude of the northern border of the currently selected configuration.
 Latitude getGeoY2()
          Returns the Latitude of the southern border of the currently selected configuration.
 int getId()
          Returns the id of the currently selected configuration.
 String getPath()
          Returns the path to the tile images of the currently selected configuration.
 int getRectH()
          Returns the height of a tile image of the currently selected configuration measured in pixels.
 int getRectW()
          Returns the width of a tile image of the currently selected configuration measured in pixels.
 int getSizeH()
          Returns the height of the entire map of the currently selected configuration measured in pixels.
 int getSizeW()
          Returns the width of the entire map of the currently selected configuration measured in pixels.
 void load(File f)
          Reads and parses the specified File object.
 boolean select(int index)
          Selects the configuration at the given index.
private  DarmstadtMapConfigurationEntry selectedEntry()
          Returns the currently selected configuration.
 String toString()
          Returns the string representation of this class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mapConfiguration_

private LinkedList mapConfiguration_
list of configurations for all map sets. Each entry contains metadata for one map set.


index_

private int index_
index of current configuration

Constructor Detail

DarmstadtMapConfiguration

public DarmstadtMapConfiguration(File f)
                          throws FileNotFoundException,
                                 IOException
Creates a new DarmstadtMapConfiguration to read from the specified File object.

Parameters:
f - the configuration file to read from
Throws:
FileNotFoundException - if the specified file could not be opened for reading
IOException - if an input or an output exception occured

DarmstadtMapConfiguration

public DarmstadtMapConfiguration(String pathname)
                          throws FileNotFoundException,
                                 IOException
Creates a new DarmstadtMapConfiguration to read from the specified file pathname.

Parameters:
pathname - the name of the configuration path to read from
Throws:
FileNotFoundException - if the specified path could not be opened for reading
IOException - if an input or an output exception occured
Method Detail

select

public boolean select(int index)
Selects the configuration at the given index.

Parameters:
index - the index of the configuration to select
Returns:
true if the configuration has been selected, otherwise false

load

public void load(File f)
          throws FileNotFoundException,
                 IOException,
                 AngularDistanceFormatException
Reads and parses the specified File object.

Parameters:
f - the configuration file to read from
Throws:
FileNotFoundException - if the specified file could not be opened for reading
IOException - if an input or an output exception occured
AngularDistanceFormatException - if an exception occured while parsing an AngluarDistance

getConfigurationNames

public LinkedList getConfigurationNames()
Returns a LinkedList of all configuration names contained in this DarmstadtMapConfiguration.

Returns:
a LinkedList of all configuration names contained in this DarmstadtMapConfiguration.

getId

public int getId()
Returns the id of the currently selected configuration.

Returns:
the id of the currently selected confiuration

getSizeW

public int getSizeW()
Returns the width of the entire map of the currently selected configuration measured in pixels.

Returns:
the width of the enitre map of the currently selected configuration measured in pixels

getSizeH

public int getSizeH()
Returns the height of the entire map of the currently selected configuration measured in pixels.

Returns:
the height of the enitre map of the currently selected configuration measured in pixels

getGeoX1

public Longitude getGeoX1()
Returns the Longitude of the western border of the currently selected configuration.

Returns:
the Longitude of the western border of the currently selected configuration

getGeoY1

public Latitude getGeoY1()
Returns the Latitude of the northern border of the currently selected configuration.

Returns:
the Latitude of the northern border of the currently selected configuration

getGeoX2

public Longitude getGeoX2()
Returns the Longitude of the eastern border of the currently selected configuration.

Returns:
the Longitude of the eastern border of the currently selected configuration

getGeoY2

public Latitude getGeoY2()
Returns the Latitude of the southern border of the currently selected configuration.

Returns:
the Latitude of the southern border of the currently selected configuration

getRectH

public int getRectH()
Returns the height of a tile image of the currently selected configuration measured in pixels.

Returns:
the height of a tile image of the currently selected configuration measured in pixels

getRectW

public int getRectW()
Returns the width of a tile image of the currently selected configuration measured in pixels.

Returns:
the width of a tile image of the currently selected configuration measured in pixels

getFormat

public String getFormat()
Returns the extension of the tile image files of the currently selected configuration.

Returns:
the extension of the tile image files of the currently selected configuration

getPath

public String getPath()
Returns the path to the tile images of the currently selected configuration.

Returns:
the path to the tile images of the currently selected configuration

toString

public String toString()
Returns the string representation of this class.

Returns:
the string representation of this class

selectedEntry

private DarmstadtMapConfigurationEntry selectedEntry()
Returns the currently selected configuration.

Returns:
the currently selected configuration


Copyright © Fraunhofer Gesellschaft. All Rights Reserved.