📄 graphvisualizer.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc (build 1.4.2_05) on Mon Mar 07 15:30:18 NZDT 2005 --><TITLE>GraphVisualizer</TITLE><META NAME="keywords" CONTENT="weka.gui.graphvisualizer.GraphVisualizer class"><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"><SCRIPT type="text/javascript">function windowTitle(){ parent.document.title="GraphVisualizer";}</SCRIPT></HEAD><BODY BGCOLOR="white" onload="windowTitle();"><!-- ========= START OF TOP NAVBAR ======= --><A NAME="navbar_top"><!-- --></A><A HREF="#skip-navbar_top" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../Tutorial.pdf"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="http://www.cs.waikato.ac.nz/ml/weka/index.html"><FONT CLASS="NavBarFont1"><B>Weka's home</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../weka/gui/graphvisualizer/GraphNode.html" title="class in weka.gui.graphvisualizer"><B>PREV CLASS</B></A> <A HREF="../../../weka/gui/graphvisualizer/HierarchicalBCEngine.html" title="class in weka.gui.graphvisualizer"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" target="_top"><B>FRAMES</B></A> <A HREF="GraphVisualizer.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: <A HREF="#nested_classes_inherited_from_class_javax.swing.JComponent">NESTED</A> | <A HREF="#fields_inherited_from_class_javax.swing.JComponent">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_top"></A><!-- ========= END OF TOP NAVBAR ========= --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">weka.gui.graphvisualizer</FONT><BR>Class GraphVisualizer</H2><PRE>java.lang.Object <IMG SRC="../../../resources/inherit.gif" ALT="extended by">java.awt.Component <IMG SRC="../../../resources/inherit.gif" ALT="extended by">java.awt.Container <IMG SRC="../../../resources/inherit.gif" ALT="extended by">javax.swing.JComponent <IMG SRC="../../../resources/inherit.gif" ALT="extended by">javax.swing.JPanel <IMG SRC="../../../resources/inherit.gif" ALT="extended by"><B>weka.gui.graphvisualizer.GraphVisualizer</B></PRE><DL><DT><B>All Implemented Interfaces:</B> <DD>javax.accessibility.Accessible, <A HREF="../../../weka/gui/graphvisualizer/GraphConstants.html" title="interface in weka.gui.graphvisualizer">GraphConstants</A>, java.awt.image.ImageObserver, <A HREF="../../../weka/gui/graphvisualizer/LayoutCompleteEventListener.html" title="interface in weka.gui.graphvisualizer">LayoutCompleteEventListener</A>, java.awt.MenuContainer, java.io.Serializable</DD></DL><HR><DL><DT>public class <B>GraphVisualizer</B><DT>extends javax.swing.JPanel<DT>implements <A HREF="../../../weka/gui/graphvisualizer/GraphConstants.html" title="interface in weka.gui.graphvisualizer">GraphConstants</A>, <A HREF="../../../weka/gui/graphvisualizer/LayoutCompleteEventListener.html" title="interface in weka.gui.graphvisualizer">LayoutCompleteEventListener</A></DL><P>This class displays the graph we want to visualize. It should be sufficient to use only this class in weka.gui.graphvisulizer package to visualize a graph. The description of a graph should be provided as a string argument using readBIF or readDOT method in either XMLBIF03 or DOT format. Alternatively, an InputStream in XMLBIF03 can also be provided to another variation of readBIF. It would be necessary in case input is in DOT format to call the layoutGraph() method to display the graph correctly after the call to readDOT. It is also necessary to do so if readBIF is called and the graph description doesn't have x y positions for nodes. <p> The graph's data is held in two FastVectors, nodes are stored as objects of GraphNode class and edges as objects of GraphEdge class. <p> The graph is displayed by positioning and drawing each node according to its x y position and then drawing all the edges coming out of it give by its edges[][] array, the arrow heads are ofcourse marked in the opposite(ie original direction) or both directions if the edge is reversed or is in both directions. The graph is centered if it is smaller than it's display area. The edges are drawn from the bottom of the current node to the top of the node given by edges[][] array in GraphNode class, to avoid edges crossing over other nodes. This might need to be changed if another layout engine is added or the current Hierarchical engine is updated to avoid such crossings over nodes.<P><P><DL><DT><B>Version:</B></DT> <DD>1.0 - 24 Apr 2003 - Initial version (Ashraf M. Kibriya)</DD><DT><B>Author:</B></DT> <DD>Ashraf M. Kibriya (amk14@cs.waikato.ac.nz)</DD><DT><B>See Also:</B><DD><A HREF="../../../serialized-form.html#weka.gui.graphvisualizer.GraphVisualizer">Serialized Form</A></DL><HR><P><!-- ======== NESTED CLASS SUMMARY ======== --><A NAME="nested_class_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Nested Class Summary</B></FONT></TD></TR></TABLE> <A NAME="nested_classes_inherited_from_class_javax.swing.JComponent"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Nested classes inherited from class javax.swing.JComponent</B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE>javax.swing.JComponent.AccessibleJComponent</CODE></TD></TR></TABLE> <!-- =========== FIELD SUMMARY =========== --><A NAME="field_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Field Summary</B></FONT></TD></TR></TABLE> <A NAME="fields_inherited_from_class_javax.swing.JComponent"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Fields inherited from class javax.swing.JComponent</B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE>TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW</CODE></TD></TR></TABLE> <A NAME="fields_inherited_from_class_java.awt.Component"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Fields inherited from class java.awt.Component</B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE>BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT</CODE></TD></TR></TABLE> <A NAME="fields_inherited_from_class_weka.gui.graphvisualizer.GraphConstants"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Fields inherited from interface weka.gui.graphvisualizer.<A HREF="../../../weka/gui/graphvisualizer/GraphConstants.html" title="interface in weka.gui.graphvisualizer">GraphConstants</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../../weka/gui/graphvisualizer/GraphConstants.html#DIRECTED">DIRECTED</A>, <A HREF="../../../weka/gui/graphvisualizer/GraphConstants.html#DOUBLE">DOUBLE</A>, <A HREF="../../../weka/gui/graphvisualizer/GraphConstants.html#NORMAL">NORMAL</A>, <A HREF="../../../weka/gui/graphvisualizer/GraphConstants.html#PLURAL_DUMMY">PLURAL_DUMMY</A>, <A HREF="../../../weka/gui/graphvisualizer/GraphConstants.html#REVERSED">REVERSED</A>, <A HREF="../../../weka/gui/graphvisualizer/GraphConstants.html#SINGULAR_DUMMY">SINGULAR_DUMMY</A></CODE></TD></TR></TABLE> <A NAME="fields_inherited_from_class_java.awt.image.ImageObserver"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Fields inherited from interface java.awt.image.ImageObserver</B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE>ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH</CODE></TD></TR></TABLE> <!-- ======== CONSTRUCTOR SUMMARY ======== --><A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Constructor Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../weka/gui/graphvisualizer/GraphVisualizer.html#GraphVisualizer()">GraphVisualizer</A></B>()</CODE><BR> Constructor<br> Sets up the gui and initializes all the other previously uninitialized variables.</TD></TR></TABLE> <!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/gui/graphvisualizer/GraphVisualizer.html#layoutCompleted(weka.gui.graphvisualizer.LayoutCompleteEvent)">layoutCompleted</A></B>(<A HREF="../../../weka/gui/graphvisualizer/LayoutCompleteEvent.html" title="class in weka.gui.graphvisualizer">LayoutCompleteEvent</A> le)</CODE><BR> This method is an implementation for LayoutCompleteEventListener class.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/gui/graphvisualizer/GraphVisualizer.html#layoutGraph()">layoutGraph</A></B>()</CODE><BR> This method lays out the graph by calling the LayoutEngine's layoutGraph() method.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/gui/graphvisualizer/GraphVisualizer.html#main(java.lang.String[])">main</A></B>(java.lang.String[] args)</CODE><BR> Main method to load a text file with the description of a graph from the command line</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/gui/graphvisualizer/GraphVisualizer.html#readBIF(java.io.InputStream)">readBIF</A></B>(java.io.InputStream instream)</CODE><BR> BIF reader<br> Reads a graph description in XMLBIF03 from an InputStrem</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../weka/gui/graphvisualizer/GraphVisualizer.html#readBIF(java.lang.String)">readBIF</A></B>(java.lang.String instring)</CODE><BR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -