ABLE 2.0.0 07/02/2003 10:25:01

com.ibm.able.conversation
Class CPGraphViewer

java.lang.Object
  |
  +--com.ibm.able.conversation.CPGraphViewer

public class CPGraphViewer
extends java.lang.Object

This provides graphical display of a conversation policy, including a popup window showing details of selected states & transitions. States may be dragged around on the screen. The layout can also be saved and stored layouts can be loaded

TYPICAL USAGE:

1. Create a CPGraphViewer

2. Create a CPGraphLoader and load a state-machine into it.

3. Load the Layout from a saved file

4. Load the frame to diplay the viewer

OLD VERSION -- TO BE DELETED Replaced by AbleCpGraphViewer.


Constructor Summary
CPGraphViewer(java.lang.String frameName)
          Constructor for CPGraphViewer
CPGraphViewer(java.lang.String frameName, java.lang.String viewerName)
          Constructor for CPGraphViewer
 
Method Summary
 void fixDisplay()
          This tweaks the graph's display in misc ways:
 CPGraphLoader getCPGraphLoader()
          Returns the associated graph loader object
 javax.swing.JFrame getFrame()
          Returns the bounding frame
 java.awt.Graphics getGraphics()
          Returns the graphics object associated with the canvas
 javax.swing.JComponent getGraphPane()
          Returns the Swing component on which the graph is displayed.
 java.awt.Point getLocation()
          Returns the location where the viewer is set to be displayed
 java.lang.String getName()
          Returns the name of the frame
 boolean isVisible()
          Returns true if the frame displaying the CP is visible, false if not
 void loadFrame()
          Displays the (state-machine) graph object on a frame and displays the menu
 void loadFromLayout(java.io.File f)
          Loads the layout from the file represented by the file object
 void loadGraph(CPGraphLoader graphLoader)
          Loads the state-machine into the graph using a CPGraphLoader.
static void main(java.lang.String[] args)
          main -- for testing
 void saveCurrentLayout(java.io.File f)
          Saves the current layout into the file represented by the file object
 void setLocation(java.awt.Point p)
          Sets the location for displaying the viewer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CPGraphViewer

public CPGraphViewer(java.lang.String frameName)
Constructor for CPGraphViewer

Parameters:
frameName - name to be assigned to the displaying frame

CPGraphViewer

public CPGraphViewer(java.lang.String frameName,
                     java.lang.String viewerName)
Constructor for CPGraphViewer

Parameters:
frameName - name to be assigned to the displaying frame
viewerName - string identifier for the viewer
Method Detail

getFrame

public javax.swing.JFrame getFrame()
Returns the bounding frame

Returns:
return the bounding frame

getGraphics

public java.awt.Graphics getGraphics()
Returns the graphics object associated with the canvas

Returns:
the associated graphics object

getName

public java.lang.String getName()
Returns the name of the frame

Returns:
the name of the frame

fixDisplay

public void fixDisplay()
This tweaks the graph's display in misc ways:

(1) Moves the graph over & down a bit

(2) Fixes size of the canvas.


getGraphPane

public javax.swing.JComponent getGraphPane()
Returns the Swing component on which the graph is displayed.

Returns:
the Swing component on which the graph is displayed.

loadGraph

public void loadGraph(CPGraphLoader graphLoader)
Loads the state-machine into the graph using a CPGraphLoader.

Parameters:
graphLoader - CPGraphLoader object used to load the state-machine

getCPGraphLoader

public CPGraphLoader getCPGraphLoader()
Returns the associated graph loader object

Returns:
the associated graph loader object

saveCurrentLayout

public void saveCurrentLayout(java.io.File f)
Saves the current layout into the file represented by the file object

Parameters:
the - file object for storing the current layout

loadFromLayout

public void loadFromLayout(java.io.File f)
Loads the layout from the file represented by the file object

Parameters:
the - file object for loading the layout from

loadFrame

public void loadFrame()
Displays the (state-machine) graph object on a frame and displays the menu

isVisible

public boolean isVisible()
Returns true if the frame displaying the CP is visible, false if not

Returns:
Returns true if the frame displaying the CP is visible, false if not

setLocation

public void setLocation(java.awt.Point p)
Sets the location for displaying the viewer

Parameters:
p - the point to display the viewer at

getLocation

public java.awt.Point getLocation()
Returns the location where the viewer is set to be displayed

Returns:
the location of the viewer

main

public static void main(java.lang.String[] args)
main -- for testing

ABLE 2.0.0 07/02/2003 10:25:01

(C) Copyright IBM Corporation 1999, 2003