com.partnersoft.io.formats.rover
Class RoverLib

java.lang.Object
  extended by com.partnersoft.io.formats.rover.RoverLib
All Implemented Interfaces:
RoverConstants

public class RoverLib
extends java.lang.Object
implements RoverConstants

Various utility methods for rover files.

Author:
Paul Reavis Copyright 2002 Partner Software, Inc.

Field Summary
 
Fields inherited from interface com.partnersoft.io.formats.rover.RoverConstants
ALIGN_BOTTOM_CENTER, ALIGN_BOTTOM_FIT, ALIGN_BOTTOM_LEFT, ALIGN_BOTTOM_RIGHT, ALIGN_CENTER, ALIGN_CENTER_LEFT, ALIGN_CENTER_RIGHT, ALIGN_CODE_CENTER, ALIGN_CODE_FIT, ALIGN_CODE_HIGH, ALIGN_CODE_LOW, ALIGN_FIT, ALIGN_FIT_LEFT, ALIGN_FIT_RIGHT, ALIGN_TOP_CENTER, ALIGN_TOP_FIT, ALIGN_TOP_LEFT, ALIGN_TOP_RIGHT, COMMENT, DATA_FIELDS_MAX, EOF, FLOAT_COORDS, GEOMETRY_TYPE_NAMES, HAS_DATA, HAS_OFFSET, HAS_ROTATION, IMAGE, LIST, MASK_TYPECODE, NAMING, POINT, POINT_COLOR, POLYGON, POLYLINE, POP, PUSH, ROTATION_MULT, TEXEL_COORD_MAX, TEXEL_COORD_SIZE, TEXT, TEXT_LONG, TILE_COORD_MAX, TILE_SIZE_PIXELS, VALUE
 
Constructor Summary
RoverLib()
           
 
Method Summary
static void convertDatabaseDumpToLookup(java.lang.String mapPath, java.lang.String name)
           
static void dumpConnectivity(java.io.File mapDir, java.lang.String name, java.lang.Object contents)
           
static void dumpDataItems(java.lang.String mapPath, java.util.ArrayList items)
           
static void dumpDatatypes(java.io.File mapDir, java.util.ArrayList contents)
           
static void dumpFindItem(java.io.File mapDir, java.lang.String name, boolean internal, java.lang.Object contents)
           
static void dumpFonts(java.io.File file, java.util.Map contents)
           
static void dumpGraphicTypes(java.io.File mapDir, java.lang.String type, java.util.ArrayList names)
           
static void dumpIcons(java.io.File mapDir, java.util.ArrayList contents)
           
static void dumpLegend(java.io.File mapDir, java.lang.String name, java.util.Map contents)
           
static void dumpMapSet(java.io.File mapDir, java.util.Map contents)
           
static void dumpStyles(java.io.File mapDir, java.lang.String type, java.util.ArrayList contents)
           
static void dumpTextures(java.io.File file, java.util.Map contents)
           
static void dumpTiles(java.io.File mapDir, int lod, java.lang.String type, java.util.TreeMap contents)
           
static long generateTileKey(int tileLOD, int tileX, int tileY, int geometryType)
          Generates a long hashcode from the various parameters.
static PackratDatatype getDatatype(java.lang.String name)
           
static java.util.List[] getListsViewOfConnectivity(VfsFile file)
           
static java.util.List[] getListsViewOfFindItem(VfsFile file)
           
static java.util.List[] getListsViewOfLookup(VfsFile file)
           
static java.util.List[] getListsViewOfTiles(VfsFile file)
           
static java.util.List[] getListsViewOfTilesbonk(VfsFile file)
           
static java.util.List getListViewOfDataItems(VfsDirectory mapDataDir)
           
static java.util.List getListViewOfHilites(VfsDirectory mapDataDir)
           
static java.util.List[] loadConnectivity(java.io.File mapDir, java.lang.String name)
           
static java.util.List[] loadConnectivity(VfsFile file)
           
static java.util.ArrayList loadDataItems(VfsDirectory mapDataDir)
           
static java.util.ArrayList loadDatatypes(VfsDirectory mapDataDir)
           
static java.util.List[] loadFindItem(java.io.File mapDir, java.lang.String name)
           
static java.util.List[] loadFindItem(VfsFile file)
           
static java.util.Map loadFonts(VfsFile file)
          Returns an empty Map if there is no font file or if the file is empty.
static java.util.ArrayList loadGraphicTypes(VfsDirectory mapDataDir, java.lang.String type)
           
static java.util.ArrayList loadHilites(java.io.File mapDir)
           
static Naming loadMapSet(VfsDirectory mapDataDir)
           
static java.util.Map loadTextures(VfsFile file)
           
static java.util.Map loadTiles(java.io.File tileFile)
           
static java.util.Map loadTiles(java.io.InputStream innie)
           
static java.util.Map loadTiles(VfsDirectory mapDataDir, int lod, java.lang.String type)
           
static int packTileCoordinate(int x, int y)
           
static void pickleGraphic(RoverGraphic graphic, ByteBuffer buffy)
           
static java.util.Map readLegend(VfsDirectory mapDataDir, java.lang.String name)
           
static java.util.ArrayList readStyles(VfsDirectory mapDataDir, java.lang.String type)
           
static java.util.ArrayList stringTableBytesToList(ByteBuffer buffy)
           
static int textAlignmentToCode(java.lang.String textAlignment)
           
static int[] unpackTileCoordinate(int packedCoord)
          Unpacks a tile coordinate into an int array.
static RoverGraphic unpickleGraphic(ByteBuffer buffy)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RoverLib

public RoverLib()
Method Detail

getListViewOfDataItems

public static java.util.List getListViewOfDataItems(VfsDirectory mapDataDir)
                                             throws java.io.IOException
Throws:
java.io.IOException

getListViewOfHilites

public static java.util.List getListViewOfHilites(VfsDirectory mapDataDir)
                                           throws java.io.IOException
Throws:
java.io.IOException

getListsViewOfConnectivity

public static java.util.List[] getListsViewOfConnectivity(VfsFile file)
                                                   throws java.io.IOException
Throws:
java.io.IOException

getListsViewOfFindItem

public static java.util.List[] getListsViewOfFindItem(VfsFile file)
                                               throws java.io.IOException
Throws:
java.io.IOException

getListsViewOfLookup

public static java.util.List[] getListsViewOfLookup(VfsFile file)
                                             throws java.io.IOException
Throws:
java.io.IOException

getListsViewOfTiles

public static java.util.List[] getListsViewOfTiles(VfsFile file)
                                            throws java.io.IOException
Throws:
java.io.IOException

getListsViewOfTilesbonk

public static java.util.List[] getListsViewOfTilesbonk(VfsFile file)
                                                throws java.io.IOException
Throws:
java.io.IOException

generateTileKey

public static long generateTileKey(int tileLOD,
                                   int tileX,
                                   int tileY,
                                   int geometryType)
Generates a long hashcode from the various parameters.


packTileCoordinate

public static int packTileCoordinate(int x,
                                     int y)

getDatatype

public static PackratDatatype getDatatype(java.lang.String name)

unpackTileCoordinate

public static int[] unpackTileCoordinate(int packedCoord)
Unpacks a tile coordinate into an int array. Order is x, y.


stringTableBytesToList

public static java.util.ArrayList stringTableBytesToList(ByteBuffer buffy)

dumpTiles

public static void dumpTiles(java.io.File mapDir,
                             int lod,
                             java.lang.String type,
                             java.util.TreeMap contents)
                      throws java.io.IOException
Throws:
java.io.IOException

loadTiles

public static java.util.Map loadTiles(VfsDirectory mapDataDir,
                                      int lod,
                                      java.lang.String type)
                               throws java.io.IOException
Throws:
java.io.IOException

loadTiles

public static java.util.Map loadTiles(java.io.File tileFile)
                               throws java.io.IOException
Throws:
java.io.IOException

loadTiles

public static java.util.Map loadTiles(java.io.InputStream innie)
                               throws java.io.IOException
Throws:
java.io.IOException

dumpFindItem

public static void dumpFindItem(java.io.File mapDir,
                                java.lang.String name,
                                boolean internal,
                                java.lang.Object contents)
                         throws java.io.IOException
Throws:
java.io.IOException

loadFindItem

public static java.util.List[] loadFindItem(java.io.File mapDir,
                                            java.lang.String name)
                                     throws java.io.IOException
Throws:
java.io.IOException

loadFindItem

public static java.util.List[] loadFindItem(VfsFile file)
                                     throws java.io.IOException
Throws:
java.io.IOException

dumpConnectivity

public static void dumpConnectivity(java.io.File mapDir,
                                    java.lang.String name,
                                    java.lang.Object contents)
                             throws java.io.IOException
Throws:
java.io.IOException

loadConnectivity

public static java.util.List[] loadConnectivity(java.io.File mapDir,
                                                java.lang.String name)
                                         throws java.io.IOException
Throws:
java.io.IOException

loadConnectivity

public static java.util.List[] loadConnectivity(VfsFile file)
                                         throws java.io.IOException
Throws:
java.io.IOException

dumpIcons

public static void dumpIcons(java.io.File mapDir,
                             java.util.ArrayList contents)
                      throws java.io.IOException
Throws:
java.io.IOException

dumpTextures

public static void dumpTextures(java.io.File file,
                                java.util.Map contents)
                         throws java.io.IOException
Throws:
java.io.IOException

dumpFonts

public static void dumpFonts(java.io.File file,
                             java.util.Map contents)
                      throws java.io.IOException
Throws:
java.io.IOException

dumpStyles

public static void dumpStyles(java.io.File mapDir,
                              java.lang.String type,
                              java.util.ArrayList contents)
                       throws java.io.IOException
Throws:
java.io.IOException

loadTextures

public static java.util.Map loadTextures(VfsFile file)
                                  throws java.io.IOException
Throws:
java.io.IOException

loadFonts

public static java.util.Map loadFonts(VfsFile file)
                               throws java.io.IOException
Returns an empty Map if there is no font file or if the file is empty.

Throws:
java.io.IOException

readStyles

public static java.util.ArrayList readStyles(VfsDirectory mapDataDir,
                                             java.lang.String type)
                                      throws java.io.IOException
Throws:
java.io.IOException

dumpLegend

public static void dumpLegend(java.io.File mapDir,
                              java.lang.String name,
                              java.util.Map contents)
                       throws java.io.IOException
Throws:
java.io.IOException

readLegend

public static java.util.Map readLegend(VfsDirectory mapDataDir,
                                       java.lang.String name)
                                throws java.io.IOException
Throws:
java.io.IOException

dumpMapSet

public static void dumpMapSet(java.io.File mapDir,
                              java.util.Map contents)
                       throws java.io.IOException
Throws:
java.io.IOException

loadMapSet

public static Naming loadMapSet(VfsDirectory mapDataDir)
                         throws java.io.IOException
Throws:
java.io.IOException

dumpDatatypes

public static void dumpDatatypes(java.io.File mapDir,
                                 java.util.ArrayList contents)
                          throws java.io.IOException
Throws:
java.io.IOException

loadDatatypes

public static java.util.ArrayList loadDatatypes(VfsDirectory mapDataDir)
                                         throws java.io.IOException
Throws:
java.io.IOException

loadDataItems

public static java.util.ArrayList loadDataItems(VfsDirectory mapDataDir)
                                         throws java.io.IOException
Throws:
java.io.IOException

dumpDataItems

public static void dumpDataItems(java.lang.String mapPath,
                                 java.util.ArrayList items)
                          throws java.io.IOException
Throws:
java.io.IOException

loadHilites

public static java.util.ArrayList loadHilites(java.io.File mapDir)
                                       throws java.io.IOException
Throws:
java.io.IOException

dumpGraphicTypes

public static void dumpGraphicTypes(java.io.File mapDir,
                                    java.lang.String type,
                                    java.util.ArrayList names)
                             throws java.io.IOException
Throws:
java.io.IOException

loadGraphicTypes

public static java.util.ArrayList loadGraphicTypes(VfsDirectory mapDataDir,
                                                   java.lang.String type)
                                            throws java.io.IOException
Throws:
java.io.IOException

textAlignmentToCode

public static int textAlignmentToCode(java.lang.String textAlignment)

pickleGraphic

public static void pickleGraphic(RoverGraphic graphic,
                                 ByteBuffer buffy)

unpickleGraphic

public static RoverGraphic unpickleGraphic(ByteBuffer buffy)

convertDatabaseDumpToLookup

public static void convertDatabaseDumpToLookup(java.lang.String mapPath,
                                               java.lang.String name)
                                        throws java.io.IOException
Throws:
java.io.IOException