|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectcz.cuni.amis.pogamut.episodic.visualizer.VisualizationRenderer
public class VisualizationRenderer
VisualizationRenderer is responsible for actual visualization
itself. It draws the visualization window and controls it. It does not
know almost anything about the nodes it is visualizing. All it does is
provide a group of functions for adding and manipulating with graph
representations of memory. All its methods are called from
VisualizationCreator class only.
The only knowlegde about the memory it has are: the index of schema bag visualization graph, so that custom detail about selected counts can be displayed upon request; some information about node and edges type so that different edges and labels can be filtered out and so that tree layout of the graphs is generated correctly without the object nodes connecting several trees together.
| Nested Class Summary | |
|---|---|
class |
VisualizationRenderer.AdditionalInfo
This structure holds an additional info about all vertices in all the graphs. |
class |
VisualizationRenderer.GraphChooser
Listener attached to the combobox choosing the graph that should be displayed in a visualization window. |
class |
VisualizationRenderer.HideEdge
Class holding information about an edge that is not part of the tree structures. |
class |
VisualizationRenderer.ObjectVertex
Class holding information about vertex representing an object node. |
protected class |
VisualizationRenderer.PopupGraphMousePlugin
Listener object that is responsible for making popup window visible upon right-click. |
| Field Summary | |
|---|---|
protected int |
graph_index
Index of a graph that is currently displayed in the visualizer window. |
protected Map<Integer,String> |
graph_names
Names of graphs that are used to populate the graph chooser combo box in a visualization window. |
protected Map<Integer,edu.uci.ics.jung.graph.Graph<Integer,Integer>> |
graphs
Actual graph structures holding the visualized representation of all structures in memory. |
protected Map<Integer,Integer> |
lastNonObjectNode
|
protected Integer |
lastSchemaEpisodeNode
|
protected Map<Integer,edu.uci.ics.jung.algorithms.layout.Layout<Integer,Integer>> |
layouts
Layouts for all the graphs in a visualizer structure. |
| Constructor Summary | |
|---|---|
VisualizationRenderer()
Construtor of a renderer. |
|
| Method Summary | |
|---|---|
boolean |
addEdge(int index,
int id,
EdgeType type,
int v1,
int v2,
String label,
Color c)
Adds a new edge into a specified graph. |
boolean |
addEdge(int index,
int id,
int v1,
int v2,
String label,
Color c)
Adds a new edge into a specified graph. |
boolean |
addGraph(int index,
String label,
Dimension dim)
Adds a new graph to the list of graphs that can be displayed by the visualizer and adds a new item to the combobox. |
void |
addVertex(int index,
int id,
double x,
double y,
String label,
Color c)
Adds a new vertex to the specified graph while setting some other info and positioning the vertex on a given position. |
void |
addVertex(int index,
int id,
double x,
double y,
String label,
Color c,
VertexType type)
Adds a new vertex to the specified graph while setting some other info and positioning the vertex on a given position. |
void |
addVertex(int index,
int id,
String label)
Adds a new vertex to the specified graph. |
void |
addVertex(int index,
int id,
String label,
Color c,
VertexType type)
Adds a new vertex to the specified graph while setting some other info. |
boolean |
clearGraph(int index)
|
void |
createTreeLayout(int index)
Creates tree layout of a given graph using algorithm for finding a minimum spanning tree. |
void |
positionObjectNodes(int y)
Updates the positions of object nodes on the visible display so they are always displayed on the screen as the user scrolls across the graph. |
void |
removeEdge(int index,
int id)
Deletes a given edge from specified graph. |
boolean |
removeGraph(int index)
Deletes a specified graph from list of possibly visualized graphs. |
void |
setEdgeTooltip(int id,
String tip)
Sets a text that should be displayed when mouse is hovering over an edge. |
void |
setSchemaMessageCommand(ISchemaMessageCommand command,
int schemaGraph)
Sets the schemaGraph index and SchemaMessageCommand
class so that count info can be displayed correctly. |
void |
setVertexDetail(int id,
String tip)
Sets a text that should be displayed when additional info is displayed after right clicking on the specified vertex. |
void |
setVertexLocation(int graph,
int id,
double x,
double y)
Position an existing vertex to a specified location. |
void |
setVertexSaturation(int id,
double saturation)
Set the saturation of a vertex based on its score. |
void |
setVertexTooltip(int id,
String tip)
Sets a text that should be displayed when mouse is hovering over a vertex. |
void |
updateTime(String time)
Refreshes the time information displayed on visualized graph. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Map<Integer,edu.uci.ics.jung.graph.Graph<Integer,Integer>> graphs
protected Map<Integer,edu.uci.ics.jung.algorithms.layout.Layout<Integer,Integer>> layouts
protected Map<Integer,String> graph_names
protected Integer lastSchemaEpisodeNode
protected Map<Integer,Integer> lastNonObjectNode
protected int graph_index
| Constructor Detail |
|---|
public VisualizationRenderer()
| Method Detail |
|---|
public void setSchemaMessageCommand(ISchemaMessageCommand command,
int schemaGraph)
schemaGraph index and SchemaMessageCommand
class so that count info can be displayed correctly.
command - Reference to a SchemaMessageCommand class
providing text to be displayed for selected nodes when popup window
with actual schema count is invoked.schemaGraph - Index of a graph visualizing schema bag, so
the renderer will know when to use schemaMessageCommand to retrieve
the info text and when to use inner AdditionalInfo class.public void updateTime(String time)
time - String with time information to be displayed in a visualizer window.public void positionObjectNodes(int y)
time - String with time information to be displayed in a visualizer window.
public void addVertex(int index,
int id,
String label)
index - Index of a graph the vertex should be added to.id - Unique ID of a new vertex.label - String that will be used as vertex label.
public void addVertex(int index,
int id,
String label,
Color c,
VertexType type)
index - Index of a graph the vertex should be added to.id - Unique ID of a new vertex.label - String that will be used as vertex label.color - Color of a new vertex.type - VertexType of a new vertex.
public void addVertex(int index,
int id,
double x,
double y,
String label,
Color c)
The position can change if createTreeLayout method is
invoked for the given graph.
index - Index of a graph the vertex should be added to.id - Unique ID of a new vertex.x - Horizontal coordinate of a new vertex.y - Vertical coordinate of a new vertex.label - String that will be used as vertex label.color - Color of a new vertex.
public void addVertex(int index,
int id,
double x,
double y,
String label,
Color c,
VertexType type)
The position can change if createTreeLayout method is
invoked for the given graph.
index - Index of a graph the vertex should be added to.id - Unique ID of a new vertex.x - Horizontal coordinate of a new vertex.y - Vertical coordinate of a new vertex.label - String that will be used as vertex label.color - Color of a new vertex.type - VertexType of a new vertex.
public void setVertexLocation(int graph,
int id,
double x,
double y)
graph - Index of a graph the vertex belongs to.id - ID of a vertex that is supposed to be moved.x - New X coordination.y - New Y coordination.
public boolean addEdge(int index,
int id,
int v1,
int v2,
String label,
Color c)
index - Index of a graph the edge should be added to.id - Unique ID of a new edge.v1 - ID of a vertex on one end of this edge.v2 - ID of a vertex on the other end of this edge.label - Label of a new edge.c - Color of the new edge.
public boolean addEdge(int index,
int id,
EdgeType type,
int v1,
int v2,
String label,
Color c)
index - Index of a graph the edge should be added to.id - Unique ID of a new edge.type - EdgeType of a new edge.v1 - ID of a vertex on one end of this edge.v2 - ID of a vertex on the other end of this edge.label - Label of a new edge.c - Color of the new edge.
public void removeEdge(int index,
int id)
index - Index of a graph containing the edge that should be removed.id - ID of an edge that should be removed.
public void setVertexDetail(int id,
String tip)
id - ID of a vertex with the new detailed info.tip - Text containing detialed info of a vertex.
public void setVertexSaturation(int id,
double saturation)
id - ID of a vertex with newly specified saturation.saturation - Saturation value. One means is normal color.
Zero means gray color.
public void setVertexTooltip(int id,
String tip)
id - ID of a vertex with the new tooltip.tip - Text containing a tooltip for a vertex.
public void setEdgeTooltip(int id,
String tip)
id - ID of a edge with the new tooltip.tip - Text containing a tooltip for an edge.
public boolean addGraph(int index,
String label,
Dimension dim)
index - Index of a new graph. If the index is not unique the
new graph will not be added.label - Name of the new graph to be displayed in a combobox.dim - Dimension of a view window.
public boolean removeGraph(int index)
index - Index of a graph that is to be removed.
public boolean clearGraph(int index)
public void createTreeLayout(int index)
For the algorithm to work, graph has to be a forest, so sequence nodes and object vertices are removed from graph first and returned back after the new layout is created.
index - Index of a graph that should have the tree layout.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||