Package weka.gui.treevisualizer

Examples of weka.gui.treevisualizer.TreeVisualizer$NodeInfo


    final javax.swing.JFrame jf =
      new javax.swing.JFrame("Weka Classifier Tree Visualizer: "+treeName);
    jf.setSize(500,400);
    jf.getContentPane().setLayout(new BorderLayout());
    if (graphString.contains("digraph")) {
      TreeVisualizer tv = new TreeVisualizer(null,
               graphString,
               new PlaceNode2());
      jf.getContentPane().add(tv, BorderLayout.CENTER);
      jf.addWindowListener(new java.awt.event.WindowAdapter() {
    public void windowClosing(java.awt.event.WindowEvent e) {
      jf.dispose();
    }
        });
      jf.setVisible(true);
      tv.fitToScreen();
    } else if (graphString.startsWith("Newick:")) {
      HierarchyVisualizer tv = new HierarchyVisualizer(graphString.substring(7));
      jf.getContentPane().add(tv, BorderLayout.CENTER);
      jf.addWindowListener(new java.awt.event.WindowAdapter() {
        public void windowClosing(java.awt.event.WindowEvent e) {
          jf.dispose();
        }
      });
      jf.setVisible(true);
      tv.fitToScreen();
    }
  }
View Full Code Here


  protected void visualizeTree(String dottyString, String treeName) {
    final javax.swing.JFrame jf =
      new javax.swing.JFrame("Weka Classifier Tree Visualizer: "+treeName);
    jf.setSize(500,400);
    jf.getContentPane().setLayout(new BorderLayout());
    TreeVisualizer tv = new TreeVisualizer(null,
             dottyString,
             new PlaceNode2());
    jf.getContentPane().add(tv, BorderLayout.CENTER);
    jf.addWindowListener(new java.awt.event.WindowAdapter() {
  public void windowClosing(java.awt.event.WindowEvent e) {
    jf.dispose();
  }
      });
   
    jf.setVisible(true);
    tv.fitToScreen();
  }
View Full Code Here

    if(grphType == Drawable.TREE){
        final javax.swing.JFrame jf =
            new javax.swing.JFrame(Messages.getInstance().getString("GraphViewer_DoPopup_Jf_JFrame_Text_First") + name);
        jf.setSize(500,400);
        jf.getContentPane().setLayout(new BorderLayout());
        TreeVisualizer tv =
            new TreeVisualizer(null,
       grphString,
       new PlaceNode2());
        jf.getContentPane().add(tv, BorderLayout.CENTER);
        jf.addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent e) {
View Full Code Here

        // create frame
        final JFrame frame = new JFrame(Messages.getInstance().getString("GUIChooser_TreeVisualizer_File_Text") + filename);
        frame.setIconImage(m_Icon);
        frame.getContentPane().setLayout(new BorderLayout());
        frame.getContentPane().add(new TreeVisualizer(null, top, arrange), BorderLayout.CENTER);
        frame.addWindowListener(new WindowAdapter() {
          public void windowClosing(WindowEvent e) {
            m_TreeVisualizers.remove(frame);
            frame.dispose();
            checkExit();
View Full Code Here

    final javax.swing.JFrame jf =
      new javax.swing.JFrame(Messages.getInstance().getString("ClustererPanel_VisualizeTree_JFrame_Text") + treeName);
    jf.setSize(500,400);
    jf.getContentPane().setLayout(new BorderLayout());
    if (graphString.contains("digraph")) {
      TreeVisualizer tv = new TreeVisualizer(null,
          graphString,
          new PlaceNode2());
      jf.getContentPane().add(tv, BorderLayout.CENTER);
      jf.addWindowListener(new java.awt.event.WindowAdapter() {
        public void windowClosing(java.awt.event.WindowEvent e) {
          jf.dispose();
        }
      });

      jf.setVisible(true);
      tv.fitToScreen();
    } else if (graphString.startsWith(Messages.getInstance().getString("ClustererPanel_VisualizeTree_GraphStringStartsWith_Text"))) {
      HierarchyVisualizer tv = new HierarchyVisualizer(graphString.substring(7));
      jf.getContentPane().add(tv, BorderLayout.CENTER);
      jf.addWindowListener(new java.awt.event.WindowAdapter() {
          public void windowClosing(java.awt.event.WindowEvent e) {
                  jf.dispose();
          }
      });
      jf.setVisible(true);
      tv.fitToScreen();
    }
  }
View Full Code Here

  protected void visualizeTree(String dottyString, String treeName) {
    final javax.swing.JFrame jf =
      new javax.swing.JFrame(Messages.getInstance().getString("ClassifierPanel_VisualizeTree_JF_JFrame_Text") + treeName);
    jf.setSize(500,400);
    jf.getContentPane().setLayout(new BorderLayout());
    TreeVisualizer tv = new TreeVisualizer(null,
             dottyString,
             new PlaceNode2());
    jf.getContentPane().add(tv, BorderLayout.CENTER);
    jf.addWindowListener(new java.awt.event.WindowAdapter() {
  public void windowClosing(java.awt.event.WindowEvent e) {
    jf.dispose();
  }
      });
   
    jf.setVisible(true);
    tv.fitToScreen();
  }
View Full Code Here

    }

    // create frame
    createFrame(
        m_Self, jMenuItemVisualizationTreeVisualizer.getText() + " - " + filename,
        new TreeVisualizer(null, top, arrange), new BorderLayout(),
        BorderLayout.CENTER, 800, 600, null, true, true);
  }
      });

      // Visualization/GraphVisualizer
View Full Code Here

  //now to remove all the stuff
  m_focus.m_set1 = null;
  m_focus.m_set2 = null;
  m_focus.setInfo(m_focus.m_attrib1, m_focus.m_attrib2, null);
  //tree_frame.getContentPane().removeAll();
  m_tView = new TreeVisualizer(this, graph(), new PlaceNode2());
  //tree_frame.getContentPane().add(m_tView);
  m_reps.setComponentAt(0, m_tView);
  //tree_frame.getContentPane().doLayout();
  m_tView.setHighlight(m_focus.m_identity);
      }
View Full Code Here

 
 
  //tree_frame.getContentPane().removeAll(); 
  m_focus.setInfo(e.getAttribute1(), e.getAttribute2(), e.getValues());
  //System.out.println(graph());
  m_tView = new TreeVisualizer(this, graph(), new PlaceNode2());
  //tree_frame.getContentPane().add(m_tView);
  //tree_frame.getContentPane().doLayout();
  m_reps.setComponentAt(0, m_tView);
 
  m_focus = m_focus.m_set2;
View Full Code Here

              /*        m_classifiers = new GenericObjectEditor();
        m_classifiers.setClassType(Classifier.class);
        m_classifiers.setValue(new weka.classifiers.rules.ZeroR());
        ((GenericObjectEditor.GOEPanel)m_classifiers.getCustomEditor())
              .addOkListener(this); */
        m_tView = new TreeVisualizer(UserClassifier.this, graph(),
             new PlaceNode2());
        m_tView.setHighlight(m_focus.m_identity);
        m_reps.setComponentAt(0, m_tView);
        m_iView.setShapes(null);
      } catch(Exception er) {
        System.out.println("Error : " + er);
        System.out.println("Part of user input so had to catch here");
              JOptionPane.showMessageDialog(
                         null,
                         "Unable to use " + m_focus.getClassifier().getClass().getName()
                         + " at this node.\n"
                         + "This exception was produced:\n"
                         + er.toString(),
                         "UserClassifier",
                         JOptionPane.ERROR_MESSAGE);
      }
    }
  });
   
    m_built = false;
    m_mainWin = new JFrame();
   
    m_mainWin.addWindowListener(new WindowAdapter() {
  public void windowClosing(WindowEvent e) {
    int well = JOptionPane.showConfirmDialog(m_mainWin,
               "Are You Sure...\n"
               + "Click Yes To Accept"
               + " The Tree"
               + "\n Click No To Return",
               "Accept Tree",
               JOptionPane.YES_NO_OPTION);
   
    if (well == 0) {
      m_mainWin.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
      blocker(false);
     
    }
    else {
      m_mainWin.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
    }
  }
      });
   
    m_reps = new JTabbedPane();
    m_mainWin.getContentPane().add(m_reps);
   
    //make a backup of the instances so that any changes don't go past here.
    Instances te = new Instances(i, i.numInstances());
    for (int noa = 0; noa < i.numInstances(); noa++) {
      te.add(i.instance(noa));
    }
   
    te.deleteWithMissingClass(); //remove all instances with a missing class
    //from training
   
    m_top = new TreeClass(null, 0, 0, m_nextId, 1, te, null);
    m_focus = m_top;
    //System.out.println(graph());
    m_tView = new TreeVisualizer(this, graph(), new PlaceNode1());
   
    m_reps.add("Tree Visualizer", m_tView);
    //tree_frame = new JFrame();
    //tree_frame.getContentPane().add(m_tView);
    //tree_frame.setSize(800,600);
View Full Code Here

TOP

Related Classes of weka.gui.treevisualizer.TreeVisualizer$NodeInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.