cz.cuni.amis.pogamut.episodic.visualizer
Class VisualizationCreator

Package class diagram package VisualizationCreator
java.lang.Object
  extended by cz.cuni.amis.pogamut.episodic.visualizer.VisualizationCreator
All Implemented Interfaces:
IVisualizationListener, EventListener

public class VisualizationCreator
extends Object
implements IVisualizationListener

VisualizatonCreator is a class connecting agent's memory with the VisualizationRenderer module. It has access to the memory structures and based on the memory contents it uses renderer to visualize it. It uses renderer methods to display chronobags as separate graphs and nodes as individual vertices.

For agent's memory it provides several simple methods that can take care of visualization of different structures. Thus each time, new node is added to some memory structure, a method can be called to redraw that structure only, so that visualization always reflects current memory contents.

Author:
Michal Cermak

Constructor Summary
VisualizationCreator()
           
 
Method Summary
 void createChronobagView(AgentMemory mem)
          This method is responsible for creating the graph that will hold the vertices representing individual chronobags.
 void createDecisionTree(DecisionTree dTree)
          This method is responsible for creating the graph that will hold the vertices representing nodes of decision tree.
 void createPresentChronobag(Chronobag bag)
          This method is responsible for creating the graph that will hold the vertices representing nodes of current chronobag.
 void createSchemaBag(SchemaBag schemas)
          This method is responsible for creating the graph that will hold the vertices representing nodes of a schema bag.
 void createTreeLayout(Chronobag c, int graph)
           
 void handleVisualizationEvent(VisualizationEvent e)
           
static void main(String[] args)
           
 void refreshChronobag(Chronobag chronobag, int graphIndex)
          Calling this method causes the visualization of specified chronobag to refresh.
 void refreshChronobagView(SchemaBag schemas, Collection<Chronobag> chronobags)
          Calling this method causes the visualization of a chronobag overview to refresh.
 void refreshPastChronobags(HashSet<Chronobag> past)
          Calling this method causes all the graphs visualizing the past chronobags to refresh.
 void refreshPresentChronobag(Chronobag present)
          Calling this method causes the visualization of the chronobag representing current day to refresh.
 void refreshSchemaBag(SchemaBag schemas)
          Calling this method causes the visualization of a schema bag to refresh.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VisualizationCreator

public VisualizationCreator()
Method Detail

handleVisualizationEvent

public void handleVisualizationEvent(VisualizationEvent e)
Specified by:
handleVisualizationEvent in interface IVisualizationListener

refreshPastChronobags

public void refreshPastChronobags(HashSet<Chronobag> past)
Calling this method causes all the graphs visualizing the past chronobags to refresh. If new chronobag was added to the list of past chronobags, its visualization is created.

Parameters:
past - List of past chronobags in agent's memory.

refreshPresentChronobag

public void refreshPresentChronobag(Chronobag present)
Calling this method causes the visualization of the chronobag representing current day to refresh.

Parameters:
present - Reference to chronobag containing episodes from current day.
time - String containing time information to be used as a label.
timeOnly - True if no new node was added to the chronobag, and only updated part should be label with current time information. False if whole chronobag needs to be redrawn.

refreshChronobag

public void refreshChronobag(Chronobag chronobag,
                             int graphIndex)
Calling this method causes the visualization of specified chronobag to refresh.

Parameters:
present - Reference to chronobag that is to be refreshed.
time - String containing time information to be used as a label.
timeOnly - True if no new node was added to the chronobag, and only updated part should be label with current time information. False if whole chronobag needs to be redrawn.

createPresentChronobag

public void createPresentChronobag(Chronobag bag)
This method is responsible for creating the graph that will hold the vertices representing nodes of current chronobag. It should be called only one, at the beginning of visualization process.

Parameters:
bag - Reference to the current chronobag, so its nodes can be displayed for the first time.

createDecisionTree

public void createDecisionTree(DecisionTree dTree)
This method is responsible for creating the graph that will hold the vertices representing nodes of decision tree. It should be called only one, at the beginning of visualization process.

Parameters:
dTree - Reference to the decision tree, so its nodes can be displayed.

createChronobagView

public void createChronobagView(AgentMemory mem)
This method is responsible for creating the graph that will hold the vertices representing individual chronobags. It should be called only one, at the beginning of visualization process.

Parameters:
schemas - Reference to the schema bag so a vertex representing schema bag can be added to the visualization with correct additional information.
present - Reference to the current chronobagso a vertex representing it can be added to the visualization with correct additional information.

createSchemaBag

public void createSchemaBag(SchemaBag schemas)
This method is responsible for creating the graph that will hold the vertices representing nodes of a schema bag. It should be called only one, at the beginning of visualization process.

This method also sets a reference to SchemaMessageCommand class so that each time a counter is increased, the visualization does not have to be refreshed, but actual count will be provided via the call to SchemaMessageCommand's method getSchemaMessage.

Parameters:
schemas - Reference to the schema bag, so its nodes can be displayed.

refreshSchemaBag

public void refreshSchemaBag(SchemaBag schemas)
Calling this method causes the visualization of a schema bag to refresh.

Unless new node was added to the schema bag it only updates the current time information label. Actual counts will still be up to date because they will be provided via the call to SchemaMessageCommand's method getSchemaMessage.

Parameters:
schemas - Reference to a schema bag so that it can be refreshed.
time - String containing time information to be used as a label.

refreshChronobagView

public void refreshChronobagView(SchemaBag schemas,
                                 Collection<Chronobag> chronobags)
Calling this method causes the visualization of a chronobag overview to refresh. It adds newly created chronobags to it and updates the chronobag summary information.

Parameters:
schemas - Reference to a schema bag so that its summary can be refreshed.
present - Reference to a current chronobag so that its summary can be refreshed.
past - Reference to a list of past chronobags. If new chronobag was added there it is added to the visualization too. Summary of all chronobags are also updated.

createTreeLayout

public void createTreeLayout(Chronobag c,
                             int graph)

main

public static void main(String[] args)


Copyright © 2013 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.