Class PrefuseTreeVisualization

  • All Implemented Interfaces:
    java.io.Serializable, weka.gui.visualize.plugins.TreeVisualizePlugin

    public class PrefuseTreeVisualization
    extends java.lang.Object
    implements java.io.Serializable, weka.gui.visualize.plugins.TreeVisualizePlugin
    Displays a tree in GraphViz's dotty format as Prefuse tree.

    See also the treeml.dtd.

    Based on the prefuse.demos.TreeView demo class.

    Version:
    $Revision$
    Author:
    jeffrey heer (original prefuse demo), fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    prefuse.demos.TreeView, Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String LABEL
      the constant for "label".
      static java.lang.String TREE
      the constant for "tree".
      static java.lang.String TREE_EDGES
      the constant for "tree.edges".
      static java.lang.String TREE_NODES
      the constant for "tree.nodes".
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.lang.String convert​(java.lang.String dotty)
      Converts the dotty format to GraphML.
      PrefuseTreeVisualization.TreePanel display​(java.lang.String dotty, java.lang.String name)
      Displays the graph.
      protected void displayError​(java.lang.String msg)
      Displays the error.
      java.lang.String getDesignVersion()
      Get the specific version of Weka the class is designed for.
      java.lang.String getMaxVersion()
      Get the maximum version of Weka, exclusive, the class is designed to work with.
      java.lang.String getMinVersion()
      Get the minimum version of Weka, inclusive, the class is designed to work with.
      javax.swing.JMenuItem getVisualizeMenuItem​(java.lang.String dotty, java.lang.String name)
      Get a JMenu or JMenuItem which contain action listeners that perform the visualization of the tree in GraphViz's dotty format.
      protected prefuse.data.Tree parse​(java.lang.String graphml)
      Parses the graph in GraphML and returns the built graph.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • TREE

        public static final java.lang.String TREE
        the constant for "tree".
        See Also:
        Constant Field Values
      • TREE_NODES

        public static final java.lang.String TREE_NODES
        the constant for "tree.nodes".
        See Also:
        Constant Field Values
      • TREE_EDGES

        public static final java.lang.String TREE_EDGES
        the constant for "tree.edges".
        See Also:
        Constant Field Values
      • LABEL

        public static final java.lang.String LABEL
        the constant for "label".
        See Also:
        Constant Field Values
    • Constructor Detail

      • PrefuseTreeVisualization

        public PrefuseTreeVisualization()
    • Method Detail

      • getMinVersion

        public java.lang.String getMinVersion()
        Get the minimum version of Weka, inclusive, the class is designed to work with. eg: 3.5.0
        Specified by:
        getMinVersion in interface weka.gui.visualize.plugins.TreeVisualizePlugin
        Returns:
        the minimum version
      • getMaxVersion

        public java.lang.String getMaxVersion()
        Get the maximum version of Weka, exclusive, the class is designed to work with. eg: 3.6.0
        Specified by:
        getMaxVersion in interface weka.gui.visualize.plugins.TreeVisualizePlugin
        Returns:
        the maximum version
      • getDesignVersion

        public java.lang.String getDesignVersion()
        Get the specific version of Weka the class is designed for. eg: 3.5.1
        Specified by:
        getDesignVersion in interface weka.gui.visualize.plugins.TreeVisualizePlugin
        Returns:
        the version the plugin was designed for
      • getVisualizeMenuItem

        public javax.swing.JMenuItem getVisualizeMenuItem​(java.lang.String dotty,
                                                          java.lang.String name)
        Get a JMenu or JMenuItem which contain action listeners that perform the visualization of the tree in GraphViz's dotty format. Exceptions thrown because of changes in Weka since compilation need to be caught by the implementer.
        Specified by:
        getVisualizeMenuItem in interface weka.gui.visualize.plugins.TreeVisualizePlugin
        Parameters:
        dotty - the tree in dotty format
        name - the name of the item (in the Explorer's history list)
        Returns:
        menuitem for opening visualization(s), or null to indicate no visualization is applicable for the input
        See Also:
        NoClassDefFoundError, IncompatibleClassChangeError
      • displayError

        protected void displayError​(java.lang.String msg)
        Displays the error.
        Parameters:
        msg - the error to display
      • convert

        protected java.lang.String convert​(java.lang.String dotty)
        Converts the dotty format to GraphML.
        Parameters:
        dotty - the graph in dotty format
        Returns:
        the graph in tree XML or null in case of an error
      • parse

        protected prefuse.data.Tree parse​(java.lang.String graphml)
        Parses the graph in GraphML and returns the built graph.
        Parameters:
        graphml - the graph in GraphML
        Returns:
        the graph or null in case of an error
      • display

        public PrefuseTreeVisualization.TreePanel display​(java.lang.String dotty,
                                                          java.lang.String name)
        Displays the graph.
        Parameters:
        dotty - the graph in dotty format
        name - the name of the graph
        Returns: