massim.competition2011
Class GraphPolicy

java.lang.Object
  extended by massim.visualization.svg.SvgXmlFile
      extended by massim.competition2011.GraphPolicy

public class GraphPolicy
extends SvgXmlFile


Field Summary
static int AGENT_RADIUS
           
static java.lang.String COLOR_BLUE
           
static java.lang.String COLOR_GRAY
           
static java.lang.String COLOR_GREEN
           
 org.w3c.dom.Document doc
           
static int NODE_RADIUS
           
static java.lang.String previewFile
           
static java.lang.String svgFile
           
 
Fields inherited from class massim.visualization.svg.SvgXmlFile
svgEnding
 
Constructor Summary
GraphPolicy()
           
 
Method Summary
 void create()
           
 void createFolder(java.lang.String name)
           
 void createPreviewSvg()
          Method creates preview-SVG when called; should be called at the end of the match because it needs the number of SVGs created
 org.w3c.dom.Document createXML()
           
 void drawEdge(GraphEdge e)
           
 int drawFirstTable(java.util.Vector<TeamState> teamsStates, long width, int currStep)
          Draws a table containing the following information in the top right corner: TeamName, Total Score, Step Score, Current Zone Value, Current Achievement Points, Achievements
 void drawGraph(java.lang.String string, int sizeX, int sizeY, java.util.Vector<GraphNode> nodes, java.util.Vector<GraphEdge> edges)
           
 void drawNode(GraphNode n)
           
 void drawRoundRect(int x, int y, int width, int height, boolean fill, java.lang.String fillColor, java.lang.String frameColor, int frameWidth)
           
 int drawSecondTable(java.util.Vector<GraphSimulationAgentState> agents, long width, int y)
          Draws name, role, current energy, max energy,current health, max health, strength and vis range of agent in output "table"
 void drawText(int x, int y, java.lang.String t, java.lang.String color)
           
 java.lang.String getTeamOne()
           
 void listAchievements(int y, long width, java.util.Vector<TeamState> teamsStates)
           
 void save(double internalWidth, double internalHeight)
           
 void setTeamNames(java.util.Vector<java.lang.String> teamNames2)
           
 
Methods inherited from class massim.visualization.svg.SvgXmlFile
generateXML, openFile, saveXML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

svgFile

public static java.lang.String svgFile

previewFile

public static java.lang.String previewFile

doc

public org.w3c.dom.Document doc

NODE_RADIUS

public static final int NODE_RADIUS
See Also:
Constant Field Values

AGENT_RADIUS

public static final int AGENT_RADIUS
See Also:
Constant Field Values

COLOR_GREEN

public static final java.lang.String COLOR_GREEN
See Also:
Constant Field Values

COLOR_BLUE

public static final java.lang.String COLOR_BLUE
See Also:
Constant Field Values

COLOR_GRAY

public static final java.lang.String COLOR_GRAY
See Also:
Constant Field Values
Constructor Detail

GraphPolicy

public GraphPolicy()
Method Detail

create

public void create()

drawGraph

public void drawGraph(java.lang.String string,
                      int sizeX,
                      int sizeY,
                      java.util.Vector<GraphNode> nodes,
                      java.util.Vector<GraphEdge> edges)

drawEdge

public void drawEdge(GraphEdge e)

drawNode

public void drawNode(GraphNode n)

drawText

public void drawText(int x,
                     int y,
                     java.lang.String t,
                     java.lang.String color)

drawRoundRect

public void drawRoundRect(int x,
                          int y,
                          int width,
                          int height,
                          boolean fill,
                          java.lang.String fillColor,
                          java.lang.String frameColor,
                          int frameWidth)

drawFirstTable

public int drawFirstTable(java.util.Vector<TeamState> teamsStates,
                          long width,
                          int currStep)
Draws a table containing the following information in the top right corner: TeamName, Total Score, Step Score, Current Zone Value, Current Achievement Points, Achievements

Parameters:
teamsStates - - the teams' states
Returns:
the current y-position after drawing the table

drawSecondTable

public int drawSecondTable(java.util.Vector<GraphSimulationAgentState> agents,
                           long width,
                           int y)
Draws name, role, current energy, max energy,current health, max health, strength and vis range of agent in output "table"

Returns:
current y-position

listAchievements

public void listAchievements(int y,
                             long width,
                             java.util.Vector<TeamState> teamsStates)

save

public void save(double internalWidth,
                 double internalHeight)

createXML

public org.w3c.dom.Document createXML()

createPreviewSvg

public void createPreviewSvg()
Method creates preview-SVG when called; should be called at the end of the match because it needs the number of SVGs created


createFolder

public void createFolder(java.lang.String name)

setTeamNames

public void setTeamNames(java.util.Vector<java.lang.String> teamNames2)

getTeamOne

public java.lang.String getTeamOne()


Copyright © 2011. All Rights Reserved.