Package javax.swing

Examples of javax.swing.JMenuItem.addActionListener()


        }
    });
  }
  else if(((Drawable)temp_classifier).graphType()==Drawable.BayesNet) {
      visGrph.setText("Visualize graph");
      visGrph.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
      Thread th = new Thread() {
        public void run() {
        visualizeBayesNet(grph, selectedName);
        }
View Full Code Here


    }
    resultListMenu.add(visGrph);

    JMenuItem visMargin = new JMenuItem("Visualize margin curve");
    if ((preds != null) && (classAtt != null) && (classAtt.isNominal())) {
      visMargin.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
      try {
        MarginCurve tc = new MarginCurve();
        Instances result = tc.getCurve(preds);
        VisualizePanel vmc = new VisualizePanel();
View Full Code Here

    JMenu visThreshold = new JMenu("Visualize threshold curve");
    if ((preds != null) && (classAtt != null) && (classAtt.isNominal())) {
      for (int i = 0; i < classAtt.numValues(); i++) {
  JMenuItem clv = new JMenuItem(classAtt.value(i));
  final int classValue = i;
  clv.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        try {
    ThresholdCurve tc = new ThresholdCurve();
    Instances result = tc.getCurve(preds, classValue);
    //VisualizePanel vmc = new VisualizePanel();
View Full Code Here

    JMenu visCostBenefit = new JMenu("Cost/Benefit analysis");
    if ((preds != null) && (classAtt != null) && (classAtt.isNominal())) {
      for (int i = 0; i < classAtt.numValues(); i++) {
        JMenuItem clv = new JMenuItem(classAtt.value(i));
        final int classValue = i;
        clv.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
              try {
                ThresholdCurve tc = new ThresholdCurve();
                Instances result = tc.getCurve(preds, classValue);
View Full Code Here

    JMenu visCost = new JMenu("Visualize cost curve");
    if ((preds != null) && (classAtt != null) && (classAtt.isNominal())) {
      for (int i = 0; i < classAtt.numValues(); i++) {
  JMenuItem clv = new JMenuItem(classAtt.value(i));
  final int classValue = i;
  clv.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        try {
    CostCurve cc = new CostCurve();
    Instances result = cc.getCurve(preds, classValue);
    VisualizePanel vmc = new VisualizePanel();
View Full Code Here

                }
            }
        });
        JPopupMenu popup = new JPopupMenu();
        JMenuItem close = new JMenuItem("Close");
        close.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                close(getComponent(tabbedPane.getSelectedIndex()));
            }
        });
View Full Code Here

  private boolean add(LogisimMenuItem item, String display) {
    if (shouldShow(item)) {
      JMenuItem menu = new JMenuItem(display);
      items.put(item, menu);
      menu.setEnabled(isEnabled(item));
      menu.addActionListener(listener);
      add(menu);
      return true;
    } else {
      return false;
    }
View Full Code Here

    public void configureMenu(JPopupMenu menu, Project proj) {
      this.proj = proj;
      String name = instance.getFactory().getDisplayName();
      String text = Strings.get("subcircuitViewItem", name);
      JMenuItem item = new JMenuItem(text);
      item.addActionListener(this);
      menu.add(item);
    }

    public void actionPerformed(ActionEvent e) {
      CircuitState superState = proj.getCircuitState();
View Full Code Here

  }

  private JMenuItem createItem(boolean enabled, String label) {
    JMenuItem ret = new JMenuItem(label);
    ret.setEnabled(enabled);
    ret.addActionListener(this);
    return ret;
  }

  public void actionPerformed(ActionEvent evt) {
    Object src = evt.getSource();
View Full Code Here

    sessionMenu = new JMenu(this.properties.getValue("sessionMenu"));
    JMenuItem openSession = new JMenuItem(properties.getValue("openSession"));
    JMenuItem closeSession = new JMenuItem(properties.getValue("closeSession"));
    JMenuItem exit = new JMenuItem(properties.getValue("exit"));

    exit.addActionListener(new QuitAppli());
    closeSession.addActionListener(new CloseSession());
    //this.sessionMenu.add(openSession);
    this.sessionMenu.add(closeSession);
    this.sessionMenu.add(exit);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.