Example usage for java.awt.event ActionEvent getActionCommand

List of usage examples for java.awt.event ActionEvent getActionCommand

Introduction

In this page you can find the example usage for java.awt.event ActionEvent getActionCommand.

Prototype

public String getActionCommand() 

Source Link

Document

Returns the command string associated with this action.

Usage

From source file:cpsd.ImageGUI.java

private void LaplaceButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_LaplaceButtonActionPerformed
    radio = evt.getActionCommand(); // TODO add your handling code here:
}

From source file:cpsd.ImageGUI.java

private void PrewittButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_PrewittButtonActionPerformed
    radio = evt.getActionCommand(); // TODO add your handling code here:
}

From source file:BehaviorTest.java

public void actionPerformed(ActionEvent event) {
    if (event.getActionCommand().equals("Object Size") != false)
        m_SizeBehavior.setEnable(!m_SizeBehavior.getEnable());

    else if (event.getActionCommand().equals("Explode") != false)
        m_ExplodeBehavior.setEnable(!m_ExplodeBehavior.getEnable());

    else if (event.getActionCommand().equals("Stretch") != false)
        m_StretchBehavior.setEnable(!m_StretchBehavior.getEnable());

    else if (event.getActionCommand().equals("Rotate") != false)
        m_RotationInterpolator.setEnable(!m_RotationInterpolator.getEnable());

    else if (event.getActionCommand().equals("Bounds") != false)
        m_BoundsBehavior.setEnable(!m_BoundsBehavior.getEnable());

    else if (event.getActionCommand().equals("FPS") != false)
        m_FpsBehavior.setEnable(!m_FpsBehavior.getEnable());
}

From source file:cpsd.ImageGUI.java

private void RobinsonButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_RobinsonButtonActionPerformed
    radio = evt.getActionCommand(); // TODO add your handling code here:
}

From source file:es.emergya.ui.plugins.AdminPanel.java

@Override
public void actionPerformed(ActionEvent e) {
    String cmd = e.getActionCommand();
    if (cmd.indexOf("Seleccionar Tod") == 0) {
        for (int i = 0; i < table.getRowCount(); i++) {
            table.getModel().setValueAt(Boolean.TRUE, i, 0);
        }/*ww  w  .  ja va2s .  c  o m*/
    } else if (cmd.indexOf("Deseleccionar Tod") == 0) {
        for (int i = 0; i < table.getRowCount(); i++) {
            table.getModel().setValueAt(Boolean.FALSE, i, 0);
        }
    } else if (cmd.indexOf("Eliminar Seleccionad") == 0) {
        boolean alguno = false;
        for (int i = table.getRowCount() - 1; i >= 0 && !alguno; i--) {
            if ((Boolean) table.getModel().getValueAt(i, 0)) {
                alguno = true;
            }
        }

        if (!alguno) {
            return;
        }

        if (JOptionPane.showConfirmDialog(this, "Buttons.delete.confirm", "Selecciona una opcin",
                JOptionPane.YES_NO_OPTION) != JOptionPane.YES_OPTION) {
            return;
        }
        Vector<Object> fail = new Vector<Object>();
        int total = 0;
        for (int i = table.getRowCount() - 1; i >= 0; i--) {
            if ((Boolean) table.getModel().getValueAt(i, 0)) {
                DeleteAction a = (DeleteAction) ((JButton) table.getValueAt(i, table.getColumnCount() - 1))
                        .getAction();
                total++;
                if (!a.delete(false)) {
                    fail.add(table.getValueAt(i, 1));
                }

            }
        }

        if (this.father != null) {
            this.father.refresh(null);
            PluginEventHandler.fireChange(this.father);
        }

        if (total == 0) {
            JOptionPane.showMessageDialog(this, "No hay elementos seleccionados para eliminar.", null,
                    JOptionPane.ERROR_MESSAGE);
        }

        if (fail.size() > 0) {
            JOptionPane.showMessageDialog(this, errorString + ":\n" + fail.toString() + "\n" + errorCause, null,
                    JOptionPane.ERROR_MESSAGE);
        }

    } else
        log.error("Comando no encontrado: " + cmd);
}

From source file:LightTest.java

public void actionPerformed(ActionEvent event) {
    if (event.getActionCommand().equals("Color") != false)
        OnColor();/*  w ww  . j av a2 s  .  co m*/
    else if (event.getActionCommand().equals("Update") != false)
        synchLightToUi();
}

From source file:org.apache.jmeter.visualizers.CreateReport.java

@Override
public void actionPerformed(ActionEvent ev) {
    /*/*  w w w  .j  ava2s.c  o  m*/
     if(ev.equals(SAVEASCSV))
      {
         saveAsCsv.setSelected(true);
      }
      else if (ev.equals(SAVEASPDF)
      {
         saveAsPdf.setSelected(true);
      }
     */

    String action = ev.getActionCommand();

    if (action.equals(BROWSE)) {

        JFileChooser j = new JFileChooser();
        j.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
        int returnVal = j.showOpenDialog(this);

        if (returnVal == JFileChooser.APPROVE_OPTION) {
            basepath.setText(j.getSelectedFile().getAbsolutePath());
            BASEPATH = basepath.getText().trim();
            JOptionPane.showMessageDialog(null, "alert", basepath.getText(), JOptionPane.OK_OPTION);

        }
        if (ev.getSource() == saveTable) {
            JFileChooser chooser = FileDialoger.promptToSaveFile("summary.csv");//$NON-NLS-1$
            if (chooser == null) {
                return;
            }
            FileWriter writer = null;
            try {
                writer = new FileWriter(chooser.getSelectedFile());
                CSVSaveService.saveCSVStats(model, writer, saveHeaders.isSelected());
            } catch (FileNotFoundException e) {
                log.warn(e.getMessage());
            } catch (IOException e) {
                log.warn(e.getMessage());
            } finally {
                JOrphanUtils.closeQuietly(writer);
            }
        }
    }

}

From source file:de.tor.tribes.ui.views.DSWorkbenchSOSRequestAnalyzer.java

@Override
public void actionPerformed(ActionEvent e) {
    if (e.getActionCommand().equals("BBCopy")) {
        copySelectionToClipboardAsBBCode();
    } else if (e.getActionCommand().equals("Delete")) {
        removeSelection();/*w w  w.j a  va2  s  . co m*/
    }
}

From source file:techtonic.Onview.java

public void actionPerformed(ActionEvent e) {
    if (EDIT.equals(e.getActionCommand())) {
        button.setBackground(currentColor);
        colorChooser.setColor(currentColor);
        dialog.setVisible(true);/* w ww  .j  av  a 2 s . c o  m*/
        fireEditingStopped();
    } else {
        currentColor = colorChooser.getColor();
    }
}

From source file:canreg.client.gui.analysis.ExportReportInternalFrame.java

@Override
public void actionPerformed(ActionEvent e) {
    if ("refresh".equalsIgnoreCase(e.getActionCommand())) {
        Task refreshTask = refresh();/*from  ww  w. j  a va 2s  .com*/
        refreshTask.execute();
    } else if ("tableChanged".equalsIgnoreCase(e.getActionCommand())) {
        String tableName = rangeFilterPanel.getSelectedTable();
        variableChooserPanel.setTableName(tableName);
        variableChooserPanel.setVariablesInTable(rangeFilterPanel.getArrayOfVariablesInSelectedTables());
        variableChooserPanel.initPanel(dictionary);
        resultPanel.setVisible(false);
        // We can't add the source info if we don't have tumour info...
        if (tableName.equalsIgnoreCase(Globals.SOURCE_TABLE_NAME)
                || tableName.equalsIgnoreCase(Globals.PATIENT_TABLE_NAME)
                || tableName.equalsIgnoreCase(Globals.SOURCE_AND_TUMOUR_AND_PATIENT_JOIN_TABLE_NAME)
                || tableName.equalsIgnoreCase(Globals.SOURCE_AND_TUMOUR_JOIN_TABLE_NAME)) {
            exportSourceInformationCheckBox.setEnabled(false);
            exportSourceInformationCheckBox.setSelected(false);
        } else {
            // disable the export source information tool...
            exportSourceInformationCheckBox.setEnabled(true);
        }
    }
}