edu.iastate.metnet.ui
Class StructureQueryHelper

java.lang.Object
  extended by edu.iastate.metnet.ui.StructureQueryHelper

public class StructureQueryHelper
extends java.lang.Object

helper functions

Author:
Jie Li

Field Summary
(package private) static org.apache.log4j.Logger logger
          log4j facility
 
Constructor Summary
StructureQueryHelper()
           
 
Method Summary
(package private)  java.util.Map createBounds(org.jgraph.graph.CellView view, java.awt.Color color)
          create the box for the label
(package private)  java.util.Map createLines(org.jgraph.graph.CellView view, java.awt.Color color)
          create an line
(package private)  java.lang.Object[] getGraphModel(org.jgraph.JGraph graph)
          try to recognize the graph data model from the user interface
(package private)  java.util.List getPredEdgeList(org.jgraph.graph.GraphModel model, org.jgraph.graph.GraphCell cell)
          get the predecessor edges
(package private)  org.jgraph.graph.DefaultGraphCell getSourceNode(org.jgraph.graph.GraphModel model, org.jgraph.graph.GraphCell cell)
          get the source node list of the edge
(package private)  java.util.List getSuccEdgeList(org.jgraph.graph.GraphModel model, org.jgraph.graph.GraphCell cell)
          get the successor edge list
(package private)  org.jgraph.graph.DefaultGraphCell getTargetNode(org.jgraph.graph.GraphModel model, org.jgraph.graph.GraphCell cell)
          get the target node list of the edge
(package private)  boolean isEdge(org.jgraph.graph.GraphModel model, java.lang.Object cell)
          detect if it is a vertex
(package private)  boolean isVertex(org.jgraph.graph.GraphModel model, java.lang.Object cell)
          detect if it is a vertex
(package private)  java.lang.Integer nextPortObject()
          create unique port number
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

static org.apache.log4j.Logger logger
log4j facility

Constructor Detail

StructureQueryHelper

public StructureQueryHelper()
Method Detail

nextPortObject

java.lang.Integer nextPortObject()
create unique port number

Returns:
unique port number

getPredEdgeList

java.util.List getPredEdgeList(org.jgraph.graph.GraphModel model,
                               org.jgraph.graph.GraphCell cell)
get the predecessor edges

Parameters:
model - the graph model
cell - the graph element
Returns:
the edge list

getSuccEdgeList

java.util.List getSuccEdgeList(org.jgraph.graph.GraphModel model,
                               org.jgraph.graph.GraphCell cell)
get the successor edge list

Parameters:
model - the graph model
cell - the graph element
Returns:
the successor edge list

getSourceNode

org.jgraph.graph.DefaultGraphCell getSourceNode(org.jgraph.graph.GraphModel model,
                                                org.jgraph.graph.GraphCell cell)
get the source node list of the edge

Parameters:
model - the graph model
cell - the edge

isVertex

boolean isVertex(org.jgraph.graph.GraphModel model,
                 java.lang.Object cell)
detect if it is a vertex

Parameters:
cell - the cell
Returns:
if it is a vertex

getGraphModel

java.lang.Object[] getGraphModel(org.jgraph.JGraph graph)
try to recognize the graph data model from the user interface

Returns:
the graph data model,the vertex is the blockid

isEdge

boolean isEdge(org.jgraph.graph.GraphModel model,
               java.lang.Object cell)
detect if it is a vertex

Parameters:
cell - the cell
Returns:
if it is a vertex

getTargetNode

org.jgraph.graph.DefaultGraphCell getTargetNode(org.jgraph.graph.GraphModel model,
                                                org.jgraph.graph.GraphCell cell)
get the target node list of the edge

Parameters:
model - the graph model
cell - the edge cell
Returns:
the target node

createBounds

java.util.Map createBounds(org.jgraph.graph.CellView view,
                           java.awt.Color color)
create the box for the label

Parameters:
view - the box view
color - the color
Returns:
the box attribute map

createLines

java.util.Map createLines(org.jgraph.graph.CellView view,
                          java.awt.Color color)
create an line

Parameters:
view - the cell view
color - the color
Returns:
the line attribute map