com.partnersoft.maps.translator
Class DynamicMapTranslator

java.lang.Object
  extended by com.partnersoft.maps.translator.DynamicMapTranslator

public class DynamicMapTranslator
extends java.lang.Object

Frontend for dynamic map translation - actually, for pretty much all translation now. This is the class of the "translator" variable passed to translator frontend scripts.

Copyright 2009 Partner Software, Inc.

Version:
$Id$
Author:
Paul Reavis

Constructor Summary
DynamicMapTranslator(MapSpace space, MapSet mapSet, DatabaseRoverSet roverSet)
           
DynamicMapTranslator(MapSpace space, MapSet mapSet, MemoryRoverSet roverSet)
           
DynamicMapTranslator(MapSpace space, MapSet mapSet, RoverSet roverSet, java.lang.String publishedName)
           
 
Method Summary
 RoverBundle finish()
           
 java.lang.String getCurrentEntityName()
           
 java.lang.String getCurrentFileName()
           
 java.lang.String getCurrentFrontendName()
           
 RoverDatabase getDatabase()
           
 RoverDatabaseBuilder getDatabaseBuilder()
           
 MapDataItem getMapDataItem(java.lang.String findItemType, java.lang.String findItemValue)
           
 RoverProfile getProfile()
           
 boolean getReadFromFrontendSpools()
           
 boolean getWriteToFrontendSpools()
           
 boolean isDataMerging()
           
 boolean isIncremental()
          Returns true if this is an incremental translator, and therefore allows use of the remove functions.
 boolean placePointsUsingDataItem(java.lang.String mapsetName, int dataID, java.lang.String dataType, java.lang.String graphicType, Naming data)
          Similar to placeShapesUsingDataItem,
 boolean placePointsUsingFindItem(java.lang.String findItemType, java.lang.String findItemValue, java.lang.String dataType, java.lang.String graphicType, Naming data)
          Similar to placeShapesUsingFindItem(), but forces the shapes to points instead of copying text or lines or other shapes.
 boolean placeShapesUsingDataItem(java.lang.String mapsetName, int dataID, java.lang.String dataType, java.lang.String graphicType, Naming data)
          This is similar to placeShapesUsingFindItem(), but instead refers to a data item directly by rover ID.
 boolean placeShapesUsingFindItem(java.lang.String findItemType, java.lang.String findItemValue, java.lang.String dataType, java.lang.String graphicType, Naming data)
          A powerful little method.
 void process(MapDataGraphic graphic)
           
 boolean processDataItem(int dataID, java.lang.String dataType, java.lang.String graphicType, Naming data)
          Deprecated. old name for placeShapesUsingDataItem().
 boolean processDataItemAsPoints(int dataID, java.lang.String dataType, java.lang.String graphicType, Naming data)
          Deprecated. placePointsUsingDataItem(), but forces the shapes to points instead of copying text or lines or other shapes. Generally the points will be placed at the beginnings of lines or other graphics.
 boolean processDataItemColor(int dataID, java.lang.String dataType, java.lang.String graphicType, Naming data, int red, int green, int blue, int alpha)
          Deprecated.  
 boolean processFindItem(java.lang.String findItemType, java.lang.String findItemValue, java.lang.String dataType, java.lang.String graphicType, Naming data)
          Deprecated. old name for placeShapesUsingFindItem
 boolean processFindItemAsPoints(java.lang.String findItemType, java.lang.String findItemValue, java.lang.String dataType, java.lang.String graphicType, Naming data)
          Deprecated. use placePointsUsingFindItem() instead
 boolean processFindItemColor(java.lang.String findItemType, java.lang.String findItemValue, java.lang.String dataType, java.lang.String graphicType, Naming data, int red, int green, int blue, int alpha)
          Deprecated.  
 void removeByEntity(java.lang.String frontendName, java.lang.String fileName, java.lang.String entityName)
           
 void removeByFile(java.lang.String frontendName, java.lang.String fileName)
           
 void removeByFrontend(java.lang.String frontendName)
           
 void setCurrentEntityName(java.lang.String currentEntityName)
           
 void setCurrentFileName(java.lang.String currentFileName)
           
 void setCurrentFrontendName(java.lang.String currentFrontendName)
           
 void setDataMerging(boolean tizit)
           
 void setReadFromFrontendSpools(boolean readFromFrontendSpools)
           
 void setTiledRoverBuilderListeners(java.util.Collection<TiledRoverBuilderListener> tiledRoverBuilderListeners)
           
 void setWriteToFrontendSpools(boolean writeToFrontendSpools)
           
 void start()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DynamicMapTranslator

public DynamicMapTranslator(MapSpace space,
                            MapSet mapSet,
                            MemoryRoverSet roverSet)
                     throws java.io.IOException
Throws:
java.io.IOException

DynamicMapTranslator

public DynamicMapTranslator(MapSpace space,
                            MapSet mapSet,
                            DatabaseRoverSet roverSet)
                     throws java.io.IOException
Throws:
java.io.IOException

DynamicMapTranslator

public DynamicMapTranslator(MapSpace space,
                            MapSet mapSet,
                            RoverSet roverSet,
                            java.lang.String publishedName)
                     throws java.io.IOException
Throws:
java.io.IOException
Method Detail

start

public void start()
           throws java.io.IOException
Throws:
java.io.IOException

finish

public RoverBundle finish()
                   throws java.io.IOException
Throws:
java.io.IOException

process

public void process(MapDataGraphic graphic)
             throws java.io.IOException
Throws:
java.io.IOException

isIncremental

public boolean isIncremental()
Returns true if this is an incremental translator, and therefore allows use of the remove functions.

Returns:

removeByFrontend

public void removeByFrontend(java.lang.String frontendName)
                      throws java.sql.SQLException
Throws:
java.sql.SQLException

removeByFile

public void removeByFile(java.lang.String frontendName,
                         java.lang.String fileName)
                  throws java.sql.SQLException
Throws:
java.sql.SQLException

removeByEntity

public void removeByEntity(java.lang.String frontendName,
                           java.lang.String fileName,
                           java.lang.String entityName)
                    throws java.sql.SQLException
Throws:
java.sql.SQLException

isDataMerging

public boolean isDataMerging()

setDataMerging

public void setDataMerging(boolean tizit)

processFindItem

public boolean processFindItem(java.lang.String findItemType,
                               java.lang.String findItemValue,
                               java.lang.String dataType,
                               java.lang.String graphicType,
                               Naming data)
                        throws java.io.IOException
Deprecated. old name for placeShapesUsingFindItem

Parameters:
findItemType -
findItemValue -
dataType -
graphicType -
data -
Returns:
Throws:
java.io.IOException

placeShapesUsingFindItem

public boolean placeShapesUsingFindItem(java.lang.String findItemType,
                                        java.lang.String findItemValue,
                                        java.lang.String dataType,
                                        java.lang.String graphicType,
                                        Naming data)
                                 throws java.io.IOException
A powerful little method. Using the given find item and lookup value, gets the shapes from the find item index, and makes copies of them in the current mapset with the specified dataType, graphicType, and data.

Generally you'll want to use a Find Item on static (background) maps. Regardless you should never specify a find item for the map set that you're calling this from, that would be a loop or something.

Parameters:
findItemType -
findItemValue -
dataType -
graphicType -
data -
Returns:
Throws:
java.io.IOException

processFindItemColor

public boolean processFindItemColor(java.lang.String findItemType,
                                    java.lang.String findItemValue,
                                    java.lang.String dataType,
                                    java.lang.String graphicType,
                                    Naming data,
                                    int red,
                                    int green,
                                    int blue,
                                    int alpha)
                             throws java.io.IOException
Deprecated. 

Throws:
java.io.IOException

getMapDataItem

public MapDataItem getMapDataItem(java.lang.String findItemType,
                                  java.lang.String findItemValue)

processDataItem

public boolean processDataItem(int dataID,
                               java.lang.String dataType,
                               java.lang.String graphicType,
                               Naming data)
                        throws java.io.IOException
Deprecated. old name for placeShapesUsingDataItem().

Parameters:
dataID -
dataType -
graphicType -
data -
Returns:
Throws:
java.io.IOException

placeShapesUsingDataItem

public boolean placeShapesUsingDataItem(java.lang.String mapsetName,
                                        int dataID,
                                        java.lang.String dataType,
                                        java.lang.String graphicType,
                                        Naming data)
                                 throws java.io.IOException
This is similar to placeShapesUsingFindItem(), but instead refers to a data item directly by rover ID.

Parameters:
dataID -
dataType -
graphicType -
data -
Returns:
Throws:
java.io.IOException

processDataItemColor

public boolean processDataItemColor(int dataID,
                                    java.lang.String dataType,
                                    java.lang.String graphicType,
                                    Naming data,
                                    int red,
                                    int green,
                                    int blue,
                                    int alpha)
                             throws java.io.IOException
Deprecated. 

Parameters:
dataID -
dataType -
graphicType -
data -
red -
green -
blue -
alpha -
Returns:
Throws:
java.io.IOException

processFindItemAsPoints

public boolean processFindItemAsPoints(java.lang.String findItemType,
                                       java.lang.String findItemValue,
                                       java.lang.String dataType,
                                       java.lang.String graphicType,
                                       Naming data)
                                throws java.io.IOException
Deprecated. use placePointsUsingFindItem() instead

Throws:
java.io.IOException

placePointsUsingFindItem

public boolean placePointsUsingFindItem(java.lang.String findItemType,
                                        java.lang.String findItemValue,
                                        java.lang.String dataType,
                                        java.lang.String graphicType,
                                        Naming data)
                                 throws java.io.IOException
Similar to placeShapesUsingFindItem(), but forces the shapes to points instead of copying text or lines or other shapes. Generally the points will be placed at the beginnings of lines or other graphics.

Parameters:
findItemType -
findItemValue -
dataType -
graphicType -
data -
Returns:
Throws:
java.io.IOException

processDataItemAsPoints

public boolean processDataItemAsPoints(int dataID,
                                       java.lang.String dataType,
                                       java.lang.String graphicType,
                                       Naming data)
                                throws java.io.IOException
Deprecated. placePointsUsingDataItem(), but forces the shapes to points instead of copying text or lines or other shapes. Generally the points will be placed at the beginnings of lines or other graphics.

Throws:
java.io.IOException

placePointsUsingDataItem

public boolean placePointsUsingDataItem(java.lang.String mapsetName,
                                        int dataID,
                                        java.lang.String dataType,
                                        java.lang.String graphicType,
                                        Naming data)
                                 throws java.io.IOException
Similar to placeShapesUsingDataItem,

Parameters:
dataID -
dataType -
graphicType -
data -
Returns:
Throws:
java.io.IOException

getProfile

public RoverProfile getProfile()

getCurrentFrontendName

public java.lang.String getCurrentFrontendName()

setCurrentFrontendName

public void setCurrentFrontendName(java.lang.String currentFrontendName)

getCurrentFileName

public java.lang.String getCurrentFileName()

setCurrentFileName

public void setCurrentFileName(java.lang.String currentFileName)

getCurrentEntityName

public java.lang.String getCurrentEntityName()

setCurrentEntityName

public void setCurrentEntityName(java.lang.String currentEntityName)

getDatabaseBuilder

public RoverDatabaseBuilder getDatabaseBuilder()

getDatabase

public RoverDatabase getDatabase()

getWriteToFrontendSpools

public boolean getWriteToFrontendSpools()

setWriteToFrontendSpools

public void setWriteToFrontendSpools(boolean writeToFrontendSpools)

getReadFromFrontendSpools

public boolean getReadFromFrontendSpools()

setReadFromFrontendSpools

public void setReadFromFrontendSpools(boolean readFromFrontendSpools)

setTiledRoverBuilderListeners

public void setTiledRoverBuilderListeners(java.util.Collection<TiledRoverBuilderListener> tiledRoverBuilderListeners)