PathwayLogic Assistant API

pla.graph
Class PLAGraph

java.lang.Object
  extended by g2d.glyph.Identifiable
      extended by g2d.glyph.Attributable
          extended by g2d.glyph.Glyphish
              extended by g2d.glyph.GlyphList
                  extended by g2d.graph.IOPGraph
                      extended by pla.graph.PLAGraph
All Implemented Interfaces:
KeyListener, MouseListener, MouseMotionListener, EventListener

public class PLAGraph
extends IOPGraph

Author:
linda

Field Summary
static Color avoidFillColor
           
static Color bidirEdgeColor
           
static Color cxtBorderColor
           
static Color cxtFillColor
           
static Color foundFillColor
           
static Color goalFillColor
           
static Color initFillColor
           
static Color ngoalFillColor
           
static Color nodeBorderColor
           
static Color noneFillColor
           
static Color ruleFillColor
           
static Color unidirEdgeColor
           
static Color usesFillColor
           
 
Fields inherited from class g2d.glyph.Glyphish
DEBUG
 
Fields inherited from class g2d.glyph.Identifiable
uid
 
Constructor Summary
PLAGraph()
           
 
Method Summary
 void addNode(IOPNode n)
           
 void clear()
           
 boolean doLayout(PLAGraph context)
          Layout graph.
 String getDiffStatus()
          Assembles difference in status from previous call to this method (or when nodes have been added and removed) in a handy String format that Maude's setStatus request can readily understand.
 PLANode getOccurrence(IOPEdge edge)
          Get the node that corresponds to an occurrence from a given edge in this bipartite graph.
 PLANode getPLANode(NodeThing nt)
          Find node associated with given node thing in this graph.
 PLANode getPLANode(String longname)
          Find node associated with given long name in this graph.
 PLANode[] getPLANodes()
          Get all nodes as an array of PLANode entries.
 PLANode getRule(IOPEdge edge)
          Get the node that corresponds to a rule from a given edge in this bipartite graph.
 boolean isDotLayout()
          Obtain current layout mode of this graph.
 void resetAllStatus()
          Go through all nodes and remove flags.
 void rmNode(IOPNode n)
           
 
Methods inherited from class g2d.graph.IOPGraph
add2Manifold, addChangeListener, addEdge, cloneFromGraph, createManifold, doLayout, fireChange, getAntiAliased, getBufferedImage, getEdge, getEdge, getEdge, getEdgesInArray, getGlyphThing, getGraphItem, getHeight, getNode, getNode, getNodesInArray, getThumbNail, getWidth, makeAdjacencyList, makeDotInput, paint, printAdjacencyList, removeChangeListener, rmEdge, setAntiAliased, setGraph, setHeight, setStrokeWidth, setWidth, size, writeGraph
 
Methods inherited from class g2d.glyph.GlyphList
add, add, contains, getBounds, getListIterator, inside, intersects, length, paint, remove, transform
 
Methods inherited from class g2d.glyph.Glyphish
keyPressed, keyReleased, keyTyped, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, rotate, rotate, scale, setKeyAction, setMouseAction, shear, translate
 
Methods inherited from class g2d.glyph.Attributable
getAttribute, getAttributeAsBoolean, getAttributeAsByte, getAttributeAsChar, getAttributeAsDouble, getAttributeAsFloat, getAttributeAsInt, getAttributeAsShort, getAttributeAsString, getKeys, getStaticAttribute, getStaticKeys, isAttribute, isStaticAttribute, removeAllAttributes, removeAllStaticAttributes, removeAttribute, removeStaticAttribute, setAttribute, setStaticAttribute
 
Methods inherited from class g2d.glyph.Identifiable
getObject, getUID, setUID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

noneFillColor

public static Color noneFillColor

initFillColor

public static Color initFillColor

goalFillColor

public static Color goalFillColor

ngoalFillColor

public static Color ngoalFillColor

avoidFillColor

public static Color avoidFillColor

usesFillColor

public static Color usesFillColor

foundFillColor

public static Color foundFillColor

nodeBorderColor

public static Color nodeBorderColor

cxtBorderColor

public static Color cxtBorderColor

cxtFillColor

public static Color cxtFillColor

ruleFillColor

public static Color ruleFillColor

bidirEdgeColor

public static Color bidirEdgeColor

unidirEdgeColor

public static Color unidirEdgeColor
Constructor Detail

PLAGraph

public PLAGraph()
Method Detail

addNode

public void addNode(IOPNode n)
Overrides:
addNode in class IOPGraph

rmNode

public void rmNode(IOPNode n)
Overrides:
rmNode in class IOPGraph

clear

public void clear()
Overrides:
clear in class IOPGraph

getPLANodes

public PLANode[] getPLANodes()
Get all nodes as an array of PLANode entries.

Returns:
Array of all existing PLANodes

getPLANode

public PLANode getPLANode(NodeThing nt)
Find node associated with given node thing in this graph.

Parameters:
nt - NodeThing to look for
Returns:
PLANode corresponding to given node thing or NULL if no such element exists

getPLANode

public PLANode getPLANode(String longname)
Find node associated with given long name in this graph.

Parameters:
longname - String of long name to look for
Returns:
PLANode corresponding to given long name or NULL if no such element exists

getDiffStatus

public String getDiffStatus()
Assembles difference in status from previous call to this method (or when nodes have been added and removed) in a handy String format that Maude's setStatus request can readily understand.

Returns:
String that contains IDs and their status of all nodes that have changed since the last call to this method

resetAllStatus

public void resetAllStatus()
Go through all nodes and remove flags. Tell Maude.


doLayout

public boolean doLayout(PLAGraph context)
Layout graph. If given context is null will invoke dot to position nodes and edges in graph. This results in compact layout. If given context is not null, will use it as the super graph to position all nodes and edges exactly as they are in super graph. This will add context nodes and edges from super graph that are not currently in this graph.

Parameters:
context -
Returns:
true

isDotLayout

public boolean isDotLayout()
Obtain current layout mode of this graph.

Returns:
true if currently using dot layout and false otherwise

getOccurrence

public PLANode getOccurrence(IOPEdge edge)
Get the node that corresponds to an occurrence from a given edge in this bipartite graph.

Parameters:
edge - IOPEdge between 2 PLANodes
Returns:
PLANode that corresponds to occurrence

getRule

public PLANode getRule(IOPEdge edge)
Get the node that corresponds to a rule from a given edge in this bipartite graph.

Parameters:
edge - IOPEdge between 2 PLANodes
Returns:
PLANode that corresponds to rule

PathwayLogic Assistant API