DRCL J-Sim API

drcl.comp.tool
Class DotDump

java.lang.Object
  extended bydrcl.comp.tool.DotDump
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
DotDump2

public class DotDump
extends java.lang.Object
implements java.lang.Runnable

Static methods to visualize JavaSim component connections as a directed graph. Only components which have not-hidden ports are shown. "Normal" ports are displayed in blue, shadow ports in green (including shadow connections). If there is a blue arrow from port1 to port2 it means, that a message sent at port1 is delivered to port2. (except unexplainable loops from a port to itself) The class uses the "dot" program from the graphviz package (http://www.graphviz.org) for graph creation. It must be installed and in the path.

Author:
Peter Kolloch

Field Summary
 java.lang.String INDENT
           
 java.lang.String REAL_CONNECTION_COLOR
           
 java.lang.String SHADOW_CONNECTION_COLOR
           
 
Constructor Summary
DotDump()
           
DotDump(Component root_)
           
 
Method Summary
 java.awt.Image createComponentImage()
          Calls the dot program with the description generated by the dumpComponents(PrintStream) method as input and creates a Java image object from its output.
 void dumpComponents(java.io.PrintStream out)
          Dumps a graph description sutiable for the graphviz package of all components to the given PrintStream.
static void example()
           
 Component getRoot()
           
 java.lang.String info()
           
 boolean isShowBarePortEnabled()
           
 boolean isShowRootEnabled()
           
static void main(java.lang.String[] args)
           
 void reset()
          Automatically called before each rendering.
 void run()
           
 void setRoot(Component root_)
           
 void setShowBarePortEnabled(boolean s)
          Enables/disables showing ports that have no connection.
 void setShowRootEnabled(boolean s)
          Enables/disables showing the root component.
 void show()
          Runs _showComponents() in a separate thread.
 boolean showing(Component c)
          This method calls #_showing(Component) and takes care of bookkeeping blocked components.
 boolean showing(Port p)
          This method returns true if the host component of the port is not blocked and #_showing(Port) returns true.
 void toFile(java.lang.String fileName_)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INDENT

public java.lang.String INDENT

SHADOW_CONNECTION_COLOR

public java.lang.String SHADOW_CONNECTION_COLOR

REAL_CONNECTION_COLOR

public java.lang.String REAL_CONNECTION_COLOR
Constructor Detail

DotDump

public DotDump()

DotDump

public DotDump(Component root_)
Method Detail

setRoot

public void setRoot(Component root_)

getRoot

public Component getRoot()

reset

public void reset()
Automatically called before each rendering.


setShowBarePortEnabled

public void setShowBarePortEnabled(boolean s)
Enables/disables showing ports that have no connection. Default is off;


isShowBarePortEnabled

public boolean isShowBarePortEnabled()

setShowRootEnabled

public void setShowRootEnabled(boolean s)
Enables/disables showing the root component. Default is off;


isShowRootEnabled

public boolean isShowRootEnabled()

dumpComponents

public void dumpComponents(java.io.PrintStream out)
Dumps a graph description sutiable for the graphviz package of all components to the given PrintStream.


showing

public final boolean showing(Component c)
This method calls #_showing(Component) and takes care of bookkeeping blocked components.


showing

public final boolean showing(Port p)
This method returns true if the host component of the port is not blocked and #_showing(Port) returns true.


createComponentImage

public java.awt.Image createComponentImage()
                                    throws java.io.IOException
Calls the dot program with the description generated by the dumpComponents(PrintStream) method as input and creates a Java image object from its output.

Throws:
java.io.IOException

run

public void run()
Specified by:
run in interface java.lang.Runnable

show

public void show()
Runs _showComponents() in a separate thread.


toFile

public void toFile(java.lang.String fileName_)

example

public static void example()

info

public java.lang.String info()

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
Throws:
java.io.IOException

DRCL J-Sim API

Copyright © 1998-2003 Distributed Real-time Computing Lab (DRCL). All Rights Reserved.     ~ To J-Sim Home ~