org.primordion.xholon.io
Class AbstractNetworkViewerJung

java.lang.Object
  extended byorg.primordion.xholon.io.AbstractNetworkViewerJung
All Implemented Interfaces:
IGraphicalNetworkViewer, IViewer
Direct Known Subclasses:
NetworkViewerJung, NetworkViewerJungCell

public abstract class AbstractNetworkViewerJung
extends java.lang.Object
implements IGraphicalNetworkViewer

Graphical network viewer constructed using the JUNG software.

This requires the Java classes that implement JUNG. Download these from the JUNG web site, download the additional third-party Java classes specified at that site, and install the various downloaded jar files.

This is an abstract class.

Since:
0.2 (Created on November 29, 2005)
Author:
Ken Webb
See Also:
jung.sourceforge.net

Nested Class Summary
 class AbstractNetworkViewerJung.XholonEdgeStringer
          The XholonEdgeStringer class stores labels for edges, and allows applications to get and set these.
 class AbstractNetworkViewerJung.XholonVertexStringer
          The XholonVertexStringer class stores labels for vertices (nodes), and allows applications to get and set these.
 
Field Summary
 
Fields inherited from interface org.primordion.xholon.io.IGraphicalNetworkViewer
LAYOUT_CIRCLE, LAYOUT_DAG, LAYOUT_FR, LAYOUT_ISOM, LAYOUT_KK, LAYOUT_KKINT, LAYOUT_NONE, LAYOUT_SPRING, LAYOUT_STATIC
 
Constructor Summary
AbstractNetworkViewerJung()
          Constructor.
 
Method Summary
 void createGraph(IXholon xhRoot, java.lang.String title, boolean showNodeLabels)
          Create a graph using a tree layout.
 boolean isActive()
          Is this viewer active?
 void refresh()
          Refresh the physical display to reflect changed information, such as the current coloring of the icons when states change in a state machine.
 void refresh(IXholon xhNode)
          Refresh the physical display for this sub tree only, to reflect changed information, such as the current coloring of the icons when states change in a state machine.
 void remove()
          Remove the graph from the screen.
 void setGraphSize(int sizeX, int sizeY)
          Set the size of the graph.
 void setLabelFontSize(int fontSize)
          Set the font size for displaying labels on vertices.
 void setLayoutType(int layoutType)
          Select one of the layout types available with JUNG.
 void setShowContainers(boolean showContainers)
          Select whether of not to include containers, and their edges, in the graph.
 void writeImage(java.io.File file, java.lang.String formatName)
          Write an image to file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractNetworkViewerJung

public AbstractNetworkViewerJung()
Constructor.

Method Detail

setGraphSize

public void setGraphSize(int sizeX,
                         int sizeY)
Description copied from interface: IGraphicalNetworkViewer
Set the size of the graph.

Specified by:
setGraphSize in interface IGraphicalNetworkViewer
Parameters:
sizeX - Size in the x direction.
sizeY - Size in the y direction.

setLabelFontSize

public void setLabelFontSize(int fontSize)
Description copied from interface: IGraphicalNetworkViewer
Set the font size for displaying labels on vertices.

Specified by:
setLabelFontSize in interface IGraphicalNetworkViewer
Parameters:
fontSize - The font size (default is 9).

setLayoutType

public void setLayoutType(int layoutType)
Description copied from interface: IGraphicalNetworkViewer
Select one of the layout types available with JUNG. The default is the FRLayout.

Specified by:
setLayoutType in interface IGraphicalNetworkViewer
Parameters:
layoutType - The layout type.

setShowContainers

public void setShowContainers(boolean showContainers)
Description copied from interface: IGraphicalNetworkViewer
Select whether of not to include containers, and their edges, in the graph.

Specified by:
setShowContainers in interface IGraphicalNetworkViewer
Parameters:
showContainers - Whether or not to show containers.

isActive

public boolean isActive()
Is this viewer active?

Specified by:
isActive in interface IGraphicalNetworkViewer
Returns:
true or false

createGraph

public void createGraph(IXholon xhRoot,
                        java.lang.String title,
                        boolean showNodeLabels)
Description copied from interface: IGraphicalNetworkViewer
Create a graph using a tree layout.

Specified by:
createGraph in interface IGraphicalNetworkViewer
Parameters:
xhRoot - The root of the IXholon tree.
title - The title to appear in the viewer window,
showNodeLabels - Whether vertices (nodes) should initially appear labelled.

writeImage

public void writeImage(java.io.File file,
                       java.lang.String formatName)
Write an image to file.

Parameters:
file - The file that will be written.
formatName - The name of a format. Currently supported are "jpeg" and "png".

remove

public void remove()
Description copied from interface: IGraphicalNetworkViewer
Remove the graph from the screen.

Specified by:
remove in interface IGraphicalNetworkViewer

refresh

public void refresh()
Description copied from interface: IGraphicalNetworkViewer
Refresh the physical display to reflect changed information, such as the current coloring of the icons when states change in a state machine.

Specified by:
refresh in interface IGraphicalNetworkViewer

refresh

public void refresh(IXholon xhNode)
Description copied from interface: IGraphicalNetworkViewer
Refresh the physical display for this sub tree only, to reflect changed information, such as the current coloring of the icons when states change in a state machine.

Specified by:
refresh in interface IGraphicalNetworkViewer