weka.core.Utils.getWekaJFrame()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(13.5k)|赞(0)|评价(0)|浏览(119)

本文整理了Java中weka.core.Utils.getWekaJFrame()方法的一些代码示例,展示了Utils.getWekaJFrame()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.getWekaJFrame()方法的具体详情如下:
包路径:weka.core.Utils
类名称:Utils
方法名:getWekaJFrame

Utils.getWekaJFrame介绍

[英]Returns a JFrame with the given title. The JFrame will be placed relative to the ancestor window of the given component (or relative to the given component itself, if it is a window), and will receive the icon image from that window if the window is a frame.
[中]返回具有给定标题的JFrame。JFrame将相对于给定组件的祖先窗口(或者相对于给定组件本身,如果它是一个窗口)放置,如果窗口是一个框架,JFrame将从该窗口接收图标图像。

代码示例

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * Pop up the host list panel
 */
private void popupHostPanel() {
 try {
  final JFrame jf = Utils.getWekaJFrame("Edit host names", this);
  
  jf.getContentPane().setLayout(new BorderLayout());
  jf.getContentPane().add(m_hostList,
        BorderLayout.CENTER);
  jf.addWindowListener(new WindowAdapter() {
  public void windowClosing(WindowEvent e) {
   jf.dispose();
  }
 });
  jf.pack();
  jf.setLocationRelativeTo(this);
  jf.setVisible(true);
 } catch (Exception ex) {
  ex.printStackTrace();
  System.err.println(ex.getMessage());
 }
}

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

@Override
public void actionPerformed(ActionEvent e) {
  final JFrame frame = Utils.getWekaJFrame("Weka Experiment Environment", m_Self);
 frame.getContentPane().setLayout(new BorderLayout());
 frame.getContentPane().add(new Experimenter(false),
   BorderLayout.CENTER);
 frame.addWindowListener(new WindowAdapter() {
   @Override
   public void windowClosing(WindowEvent w) {
    frame.dispose();
    m_Frames.remove(frame);
    checkExit();
   }
  });
 frame.pack();
 frame.setSize(1024, 768);
 frame.setLocationRelativeTo(m_Self);
 frame.setVisible(true);
 m_Frames.add(frame);
}
});

代码示例来源:origin: Waikato/weka-trunk

/**
 * Pop up the host list panel
 */
private void popupHostPanel() {
 try {
  final JFrame jf = Utils.getWekaJFrame("Edit host names", this);
  
  jf.getContentPane().setLayout(new BorderLayout());
  jf.getContentPane().add(m_hostList,
        BorderLayout.CENTER);
  jf.addWindowListener(new WindowAdapter() {
  public void windowClosing(WindowEvent e) {
   jf.dispose();
  }
 });
  jf.pack();
  jf.setLocationRelativeTo(this);
  jf.setVisible(true);
 } catch (Exception ex) {
  ex.printStackTrace();
  System.err.println(ex.getMessage());
 }
}

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

@Override
 public void actionPerformed(ActionEvent e) {
  final JFrame frame = Utils.getWekaJFrame("SqlViewer", m_Self);
  final SqlViewer sql = new SqlViewer(frame);
  frame.getContentPane().setLayout(new BorderLayout());
  frame.getContentPane().add(sql, BorderLayout.CENTER);
  frame.addWindowListener(new WindowAdapter() {
   @Override
   public void windowClosing(WindowEvent w) {
    sql.saveSize();
    frame.dispose();
    m_Frames.remove(frame);
    checkExit();
   }
  });
  frame.pack();
  frame.setSize(1024, 768);
  frame.setLocationRelativeTo(m_Self);
  frame.setVisible(true);
  m_Frames.add(frame);
 }
});

代码示例来源:origin: Waikato/weka-trunk

@Override
public void actionPerformed(ActionEvent e) {
  final JFrame frame = Utils.getWekaJFrame("Weka Experiment Environment", m_Self);
 frame.getContentPane().setLayout(new BorderLayout());
 frame.getContentPane().add(new Experimenter(false),
   BorderLayout.CENTER);
 frame.addWindowListener(new WindowAdapter() {
   @Override
   public void windowClosing(WindowEvent w) {
    frame.dispose();
    m_Frames.remove(frame);
    checkExit();
   }
  });
 frame.pack();
 frame.setSize(1024, 768);
 frame.setLocationRelativeTo(m_Self);
 frame.setVisible(true);
 m_Frames.add(frame);
}
});

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * Pops up a visualize panel to display cluster assignments
 * 
 * @param sp the visualize panel to display
 */
protected void visualizeClusterAssignments(VisualizePanel sp) {
 if (sp != null) {
  String plotName = sp.getName();
  final javax.swing.JFrame jf =
   Utils.getWekaJFrame("Weka Clusterer Visualize: " + plotName, this);
  jf.getContentPane().setLayout(new BorderLayout());
  jf.getContentPane().add(sp, BorderLayout.CENTER);
  jf.addWindowListener(new java.awt.event.WindowAdapter() {
   @Override
   public void windowClosing(java.awt.event.WindowEvent e) {
    jf.dispose();
   }
  });
  jf.pack();
  jf.setSize(800, 600);
  jf.setLocationRelativeTo(SwingUtilities.getWindowAncestor(this));
  jf.setVisible(true);
 }
}

代码示例来源:origin: Waikato/weka-trunk

@Override
 public void actionPerformed(ActionEvent e) {
  final JFrame frame = Utils.getWekaJFrame("SqlViewer", m_Self);
  final SqlViewer sql = new SqlViewer(frame);
  frame.getContentPane().setLayout(new BorderLayout());
  frame.getContentPane().add(sql, BorderLayout.CENTER);
  frame.addWindowListener(new WindowAdapter() {
   @Override
   public void windowClosing(WindowEvent w) {
    sql.saveSize();
    frame.dispose();
    m_Frames.remove(frame);
    checkExit();
   }
  });
  frame.pack();
  frame.setSize(1024, 768);
  frame.setLocationRelativeTo(m_Self);
  frame.setVisible(true);
  m_Frames.add(frame);
 }
});

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * Pops up a VisualizePanel for visualizing the data and errors for the
 * classifier from the currently selected item in the results list.
 *
 * @param sp the VisualizePanel to pop up.
 */
protected void visualizeClassifierErrors(VisualizePanel sp) {
 if (sp != null) {
  String plotName = sp.getName();
  final javax.swing.JFrame jf =
   Utils.getWekaJFrame("Weka Classifier Visualize: " + plotName, this);
  jf.getContentPane().setLayout(new BorderLayout());
  jf.getContentPane().add(sp, BorderLayout.CENTER);
  jf.addWindowListener(new java.awt.event.WindowAdapter() {
   @Override
   public void windowClosing(java.awt.event.WindowEvent e) {
    jf.dispose();
   }
  });
  jf.pack();
  jf.setSize(800, 600);
  jf.setLocationRelativeTo(SwingUtilities.getWindowAncestor(this));
  jf.setVisible(true);
 }
}

代码示例来源:origin: Waikato/weka-trunk

/**
 * Pops up a visualize panel to display cluster assignments
 * 
 * @param sp the visualize panel to display
 */
protected void visualizeClusterAssignments(VisualizePanel sp) {
 if (sp != null) {
  String plotName = sp.getName();
  final javax.swing.JFrame jf =
   Utils.getWekaJFrame("Weka Clusterer Visualize: " + plotName, this);
  jf.getContentPane().setLayout(new BorderLayout());
  jf.getContentPane().add(sp, BorderLayout.CENTER);
  jf.addWindowListener(new java.awt.event.WindowAdapter() {
   @Override
   public void windowClosing(java.awt.event.WindowEvent e) {
    jf.dispose();
   }
  });
  jf.pack();
  jf.setSize(800, 600);
  jf.setLocationRelativeTo(SwingUtilities.getWindowAncestor(this));
  jf.setVisible(true);
 }
}

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

@Override
public void actionPerformed(ActionEvent e) {
  WorkbenchApp app = new WorkbenchApp();
  final JFrame frame = Utils.getWekaJFrame("Weka Workbench", m_Self);
 frame.add(app, BorderLayout.CENTER);
 frame.addWindowListener(new WindowAdapter() {
   @Override
   public void windowClosing(WindowEvent e) {
    frame.dispose();
    m_Frames.remove(frame);
    checkExit();
   }
  });
  app.showMenuBar(frame);
 frame.pack();
 frame.setSize(1024, 768);
 frame.setLocationRelativeTo(m_Self);
 frame.setVisible(true);
 m_Frames.add(frame);
}
});

代码示例来源:origin: Waikato/weka-trunk

@Override
public void actionPerformed(ActionEvent e) {
  WorkbenchApp app = new WorkbenchApp();
  final JFrame frame = Utils.getWekaJFrame("Weka Workbench", m_Self);
 frame.add(app, BorderLayout.CENTER);
 frame.addWindowListener(new WindowAdapter() {
   @Override
   public void windowClosing(WindowEvent e) {
    frame.dispose();
    m_Frames.remove(frame);
    checkExit();
   }
  });
  app.showMenuBar(frame);
 frame.pack();
 frame.setSize(1024, 768);
 frame.setLocationRelativeTo(m_Self);
 frame.setVisible(true);
 m_Frames.add(frame);
}
});

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

@Override
 public void actionPerformed(ActionEvent e) {
  final GUI bayesNetGUI = new GUI();
  JMenuBar bayesBar = bayesNetGUI.getMenuBar();
  final JFrame frame = Utils.getWekaJFrame("Bayes Network Editor", m_Self);
  frame.setJMenuBar(bayesBar);
  frame.getContentPane().add(bayesNetGUI,
      BorderLayout.CENTER);
  frame.addWindowListener(new WindowAdapter() {
   @Override
   public void windowClosing(WindowEvent w) {
    frame.dispose();
    m_Frames.remove(frame);
    checkExit();
   }
  });
  frame.pack();
  frame.setSize(1024, 768);
  frame.setLocationRelativeTo(m_Self);
  frame.setVisible(true);
  m_Frames.add(frame);
 }
});

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

@Override
 public void actionPerformed(ActionEvent e) {
  final JFrame appFrame = Utils.getWekaJFrame(p.getApplicationName(), m_Self);
  appFrame.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
  JMenuBar appMenu = p.getMenuBar();
  if (appMenu != null) {
   appFrame.setJMenuBar(appMenu);
  }
  appFrame.getContentPane().add((JComponent) p,
   BorderLayout.CENTER);
  appFrame.addWindowListener(new WindowAdapter() {
   @Override
   public void windowClosed(WindowEvent e) {
    m_Frames.remove(appFrame);
    checkExit();
   }
  });
  appFrame.pack();
  appFrame.setSize(1024, 768);
  appFrame.setLocationRelativeTo(m_Self);
  appFrame.setVisible(true);
  m_Frames.add(appFrame);
 }
});

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

public void actionPerformed(ActionEvent ae) {
  if (m_Instances != null) {
   try {
    final weka.gui.beans.AttributeSummarizer as =
     new weka.gui.beans.AttributeSummarizer();
    as.setColoringIndex(m_AttVisualizePanel.getColoringIndex());
    as.setInstances(m_Instances);
    final javax.swing.JFrame jf = Utils.getWekaJFrame("All attributes", PreprocessPanel.this);
    jf.getContentPane().setLayout(new java.awt.BorderLayout());
    jf.getContentPane().add(as, java.awt.BorderLayout.CENTER);
    jf.addWindowListener(new java.awt.event.WindowAdapter() {
     @Override
     public void windowClosing(java.awt.event.WindowEvent e) {
      visAllBut.setEnabled(true);
      jf.dispose();
     }
    });
    jf.pack();
    jf.setSize(1000, 600);
    jf.setLocationRelativeTo(SwingUtilities.getWindowAncestor(PreprocessPanel.this));
    jf.setVisible(true);
   } catch (Exception ex) {
    ex.printStackTrace();
   }
  }
 }
});

代码示例来源:origin: Waikato/weka-trunk

@Override
 public void actionPerformed(ActionEvent e) {
  final JFrame appFrame = Utils.getWekaJFrame(p.getApplicationName(), m_Self);
  appFrame.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
  JMenuBar appMenu = p.getMenuBar();
  if (appMenu != null) {
   appFrame.setJMenuBar(appMenu);
  }
  appFrame.getContentPane().add((JComponent) p,
   BorderLayout.CENTER);
  appFrame.addWindowListener(new WindowAdapter() {
   @Override
   public void windowClosed(WindowEvent e) {
    m_Frames.remove(appFrame);
    checkExit();
   }
  });
  appFrame.pack();
  appFrame.setSize(1024, 768);
  appFrame.setLocationRelativeTo(m_Self);
  appFrame.setVisible(true);
  m_Frames.add(appFrame);
 }
});

代码示例来源:origin: Waikato/weka-trunk

@Override
 public void actionPerformed(ActionEvent e) {
  final GUI bayesNetGUI = new GUI();
  JMenuBar bayesBar = bayesNetGUI.getMenuBar();
  final JFrame frame = Utils.getWekaJFrame("Bayes Network Editor", m_Self);
  frame.setJMenuBar(bayesBar);
  frame.getContentPane().add(bayesNetGUI,
      BorderLayout.CENTER);
  frame.addWindowListener(new WindowAdapter() {
   @Override
   public void windowClosing(WindowEvent w) {
    frame.dispose();
    m_Frames.remove(frame);
    checkExit();
   }
  });
  frame.pack();
  frame.setSize(1024, 768);
  frame.setLocationRelativeTo(m_Self);
  frame.setVisible(true);
  m_Frames.add(frame);
 }
});

代码示例来源:origin: Waikato/weka-trunk

public void actionPerformed(ActionEvent ae) {
  if (m_Instances != null) {
   try {
    final weka.gui.beans.AttributeSummarizer as =
     new weka.gui.beans.AttributeSummarizer();
    as.setColoringIndex(m_AttVisualizePanel.getColoringIndex());
    as.setInstances(m_Instances);
    final javax.swing.JFrame jf = Utils.getWekaJFrame("All attributes", PreprocessPanel.this);
    jf.getContentPane().setLayout(new java.awt.BorderLayout());
    jf.getContentPane().add(as, java.awt.BorderLayout.CENTER);
    jf.addWindowListener(new java.awt.event.WindowAdapter() {
     @Override
     public void windowClosing(java.awt.event.WindowEvent e) {
      visAllBut.setEnabled(true);
      jf.dispose();
     }
    });
    jf.pack();
    jf.setSize(1000, 600);
    jf.setLocationRelativeTo(SwingUtilities.getWindowAncestor(PreprocessPanel.this));
    jf.setVisible(true);
   } catch (Exception ex) {
    ex.printStackTrace();
   }
  }
 }
});

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * Pops up a TreeVisualizer for the associator from the currently selected
 * item in the results list
 * 
 * @param dottyString the description of the tree in dotty format
 * @param treeName the title to assign to the display
 */
protected void visualizeTree(String dottyString, String treeName) {
 final javax.swing.JFrame jf =
  Utils.getWekaJFrame("Weka Associator Tree Visualizer: " + treeName, this);
 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() {
  @Override
  public void windowClosing(java.awt.event.WindowEvent e) {
   jf.dispose();
  }
 });
 jf.pack();
 jf.setSize(800, 600);
 jf.setLocationRelativeTo(SwingUtilities.getWindowAncestor(this));
 jf.setVisible(true);
 tv.fitToScreen();
}

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

protected synchronized void openExplorer() {
 if (m_Instances != null) {
  if (m_mainPerspective == null || !m_mainPerspective.acceptsInstances()) {
   Explorer exp = new Explorer();
   exp.getPreprocessPanel().setInstances(m_Instances);
   final JFrame jf = Utils.getWekaJFrame("Weka Explorer", this);
   jf.getContentPane().setLayout(new BorderLayout());
   jf.getContentPane().add(exp, BorderLayout.CENTER);
   jf.addWindowListener(new WindowAdapter() {
    @Override
    public void windowClosing(WindowEvent e) {
     jf.dispose();
    }
   });
   jf.pack();
   jf.setSize(1024, 768);
   jf.setLocationRelativeTo(SwingUtilities.getWindowAncestor(this));
   jf.setVisible(true);
  } else {
   m_mainPerspective.setInstances(m_Instances);
   m_mainPerspective.getMainApplication().getPerspectiveManager()
    .setActivePerspective(m_mainPerspective.getPerspectiveID());
  }
 }
}

代码示例来源:origin: Waikato/weka-trunk

protected synchronized void openExplorer() {
 if (m_Instances != null) {
  if (m_mainPerspective == null || !m_mainPerspective.acceptsInstances()) {
   Explorer exp = new Explorer();
   exp.getPreprocessPanel().setInstances(m_Instances);
   final JFrame jf = Utils.getWekaJFrame("Weka Explorer", this);
   jf.getContentPane().setLayout(new BorderLayout());
   jf.getContentPane().add(exp, BorderLayout.CENTER);
   jf.addWindowListener(new WindowAdapter() {
    @Override
    public void windowClosing(WindowEvent e) {
     jf.dispose();
    }
   });
   jf.pack();
   jf.setSize(1024, 768);
   jf.setLocationRelativeTo(SwingUtilities.getWindowAncestor(this));
   jf.setVisible(true);
  } else {
   m_mainPerspective.setInstances(m_Instances);
   m_mainPerspective.getMainApplication().getPerspectiveManager()
    .setActivePerspective(m_mainPerspective.getPerspectiveID());
  }
 }
}

相关文章