main
Class GenerateDescription

java.lang.Object
  extended by main.GenerateMap
      extended by main.GenerateDescription
All Implemented Interfaces:
java.util.Comparator<DrawableNode>

public class GenerateDescription
extends GenerateMap

The GenerateDescription class provides methods for generating a description of a map, so that the description could be read and transformed into a visual map easily. The format is as follows: if an error occurs, only the error is printed. Otherwise, the string "success" is printed on the first line, the image file to use is printed on the second line, the map description is printed on the following lines, then the string "drawing_start" on its own line, then one line for each node or edge to be drawn.


Field Summary
private  java.lang.String descriptionString
           
 
Fields inherited from class main.GenerateMap
description, edgeParameters, imageParameters, map, nodeParameters, ORIGINAL_NODE_SIZE_FACTOR, scenarioConfig
 
Constructor Summary
GenerateDescription()
          Constructs a new GenerateDescription.
 
Method Summary
protected  void clearData()
          removes the previously generated data ie all nodes of the mapImage
protected  void drawEdge(DrawableEdge drawableEdge)
          Constructs a line that specifies how to draw the given edge.
protected  void drawLabel(DrawableLabel drawableLabel)
          Constructs a line that specifies how to draw the given label.
protected  void drawNode(DrawableNode drawableNode)
          Constructs a line that specifies how to draw the given node.
 java.lang.Object getMap()
          Finishes creating the map and returns it.
protected  void initialize()
          Initializes the map.
 
Methods inherited from class main.GenerateMap
compare, createMap, drawEdges, drawLables, drawNodes, getAllowedGroups, getDescription, getImageName, getNodeSizeFactor, getScenarioConfig, isDrawEdges, isDrawOnlyScenarioNodes, positionInRange, recreateMap, setAllowedGroups, setDrawEdges, setDrawOnlyScenarioNodes, setNodeSizeFactor, setScenarioConfig, transformLatitude, transformLongitude
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Field Detail

descriptionString

private java.lang.String descriptionString
Constructor Detail

GenerateDescription

public GenerateDescription()
Constructs a new GenerateDescription.

Method Detail

initialize

protected void initialize()
Initializes the map.

Specified by:
initialize in class GenerateMap

clearData

protected void clearData()
removes the previously generated data ie all nodes of the mapImage

Specified by:
clearData in class GenerateMap

drawNode

protected void drawNode(DrawableNode drawableNode)
Constructs a line that specifies how to draw the given node. The line is in the format:

node red green blue size id cityName x-coord y-coord

Specified by:
drawNode in class GenerateMap
Parameters:
drawableNode - a DrawableNode

drawLabel

protected void drawLabel(DrawableLabel drawableLabel)
Constructs a line that specifies how to draw the given label. The line is in the format:

label red green blue size id text x-coord y-coord

Specified by:
drawLabel in class GenerateMap
Parameters:
drawableLabel - a DrawableLabel

drawEdge

protected void drawEdge(DrawableEdge drawableEdge)
Constructs a line that specifies how to draw the given edge. The line is in the format:

edge red green blue size x-coord1 y-coord1 x-coord2 y-coord2

Specified by:
drawEdge in class GenerateMap
Parameters:
drawableEdge - a DrawableEdge

getMap

public java.lang.Object getMap()
Finishes creating the map and returns it.

Specified by:
getMap in class GenerateMap
Returns:
the map Object