main
Class GenerateImage

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

public class GenerateImage
extends GenerateMap

The GenerateImage class provides methods for creating a JPEG image of the map.


Field Summary
private  java.lang.String imageName
           
private  java.awt.Graphics2D mapGraphics
           
private  MapImage mapImage
           
private  java.awt.image.BufferedImage mapJPEG
           
 
Fields inherited from class main.GenerateMap
description, edgeParameters, imageParameters, map, nodeParameters, ORIGINAL_NODE_SIZE_FACTOR, scenarioConfig
 
Constructor Summary
GenerateImage()
          Constructs a new GenerateImage.
 
Method Summary
protected  void clearData()
          removes all nodes of mapImage
protected  void drawEdge(DrawableEdge drawableEdge)
          Draws an edge on the map.
protected  void drawLabel(DrawableLabel drawableLabel)
          Draws a label on the map.
protected  void drawNode(DrawableNode drawableNode)
          Draws a node on the map.
protected  java.awt.Rectangle getDrawingAreaBounds()
          Gets the size of the drawing area.
 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

mapJPEG

private java.awt.image.BufferedImage mapJPEG

mapGraphics

private java.awt.Graphics2D mapGraphics

mapImage

private MapImage mapImage

imageName

private java.lang.String imageName
Constructor Detail

GenerateImage

public GenerateImage()
Constructs a new GenerateImage.

Method Detail

initialize

protected void initialize()
                   throws java.io.FileNotFoundException,
                          java.io.IOException,
                          java.text.ParseException
Initializes the map.

Specified by:
initialize in class GenerateMap
Throws:
java.io.FileNotFoundException - if a file is not found
java.io.IOException - if an I/O error occurs
java.text.ParseException - if a parse error occurs

clearData

protected void clearData()
removes all nodes of mapImage

Specified by:
clearData in class GenerateMap

drawNode

protected void drawNode(DrawableNode drawableNode)
Draws a node on the map.

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

getDrawingAreaBounds

protected java.awt.Rectangle getDrawingAreaBounds()
Gets the size of the drawing area.

Returns:
a rectangle with the Bounds of the drawing area.

drawLabel

protected void drawLabel(DrawableLabel drawableLabel)
Draws a label on the map.

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

drawEdge

protected void drawEdge(DrawableEdge drawableEdge)
Draws an edge on the map.

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