org.free.garminimg
Class ImgFilesBag

java.lang.Object
  extended by org.free.garminimg.ImgFilesBag

public class ImgFilesBag
extends java.lang.Object

The main entry point of the library. Manages the list of .img mapFiles.

Instances of this class are supposed to be fully thread safe.


Constructor Summary
ImgFilesBag()
           
 
Method Summary
 void addDirectory(java.io.File directory)
          Add every .img mapFiles of the given directory.
 void addFile(java.io.File file)
          Add a single .img file to the repository.
 void clear()
          Remove every maps.
 org.free.garminimg.ProductFile.MapDesc getMapDescription(ImgFileBag imgFileBag)
           
 int getMaxLatitude()
           
 int getMaxLongitude()
           
 int getMinLatitude()
           
 int getMinLongitude()
           
 void printDebug(java.io.PrintStream out)
           
 void readMap(int minLong, int maxLong, int minLat, int maxLat, int resolution, int objectKindFilter, java.util.BitSet objectTypeFilter, MapListener listener)
          Read the map for the given coordinates.
 void readMapForDrawing(int minLong, int maxLong, int minLat, int maxLat, int resolution, int objectKindFilter, MapListener listener)
          Read the map for the given coordinates.
This method will try to have the objects sorted in an order that is suitable for drawing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImgFilesBag

public ImgFilesBag()
Method Detail

addFile

public void addFile(java.io.File file)
             throws java.io.IOException
Add a single .img file to the repository.

Throws:
java.io.IOException

addDirectory

public void addDirectory(java.io.File directory)
                  throws java.io.IOException
Add every .img mapFiles of the given directory. Does not go recursively in sub-directories.

Throws:
java.io.IOException

clear

public void clear()
           throws java.io.IOException
Remove every maps.

Throws:
java.io.IOException

readMapForDrawing

public void readMapForDrawing(int minLong,
                              int maxLong,
                              int minLat,
                              int maxLat,
                              int resolution,
                              int objectKindFilter,
                              MapListener listener)
                       throws java.io.IOException
Read the map for the given coordinates.
This method will try to have the objects sorted in an order that is suitable for drawing.

Parameters:
resolution - The resolution in "Garmin coordinate" units of the details we want. The smaller, the higher the details will be. If negative gets all the details.
listener - A visitor that will be called for every map objects.
objectKindFilter - Bitset of what kind of object to concider (see ObjectKind for possible values).
Throws:
java.io.IOException
See Also:
readMap(int,int,int,int,int,int,BitSet,MapListener)

readMap

public void readMap(int minLong,
                    int maxLong,
                    int minLat,
                    int maxLat,
                    int resolution,
                    int objectKindFilter,
                    java.util.BitSet objectTypeFilter,
                    MapListener listener)
             throws java.io.IOException
Read the map for the given coordinates.

Parameters:
resolution - The resolution in "Garmin coordinate" units of the details we want. The smaller, the higher the details will be. If negative gets all the details.
listener - A visitor that will be called for every map objects.
objectKindFilter - Bitset of what kind of object to concider (see ObjectKind for possible values).
objectTypeFilter - If not null, allows to filter by type. Must be used with a objectKindFilter allowing only one object kind.
Throws:
java.io.IOException
See Also:
MapListener, ObjectKind

printDebug

public void printDebug(java.io.PrintStream out)
                throws java.io.IOException
Throws:
java.io.IOException

getMinLongitude

public int getMinLongitude()
                    throws java.io.IOException
Throws:
java.io.IOException

getMaxLongitude

public int getMaxLongitude()
                    throws java.io.IOException
Throws:
java.io.IOException

getMinLatitude

public int getMinLatitude()
                   throws java.io.IOException
Throws:
java.io.IOException

getMaxLatitude

public int getMaxLatitude()
                   throws java.io.IOException
Throws:
java.io.IOException

getMapDescription

public org.free.garminimg.ProductFile.MapDesc getMapDescription(ImgFileBag imgFileBag)


Copyright © 2008. All Rights Reserved.