Example usage for java.awt.event ActionEvent ACTION_PERFORMED

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

Introduction

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

Prototype

int ACTION_PERFORMED

To view the source code for java.awt.event ActionEvent ACTION_PERFORMED.

Click Source Link

Document

This event id indicates that a meaningful action occurred.

Usage

From source file:net.sf.mzmine.modules.visualization.neutralloss.NeutralLossPlot.java

/**
 * @see org.jfree.chart.event.ChartProgressListener#chartProgress(org.jfree.chart.event.ChartProgressEvent)
 *///from  w w  w  .  j  a v  a 2 s  . com
public void chartProgress(ChartProgressEvent event) {

    super.chartProgress(event);

    if (event.getType() == ChartProgressEvent.DRAWING_FINISHED) {

        visualizer.updateTitle();

        if (showSpectrumRequest) {
            showSpectrumRequest = false;
            visualizer.actionPerformed(
                    new ActionEvent(event.getSource(), ActionEvent.ACTION_PERFORMED, "SHOW_SPECTRUM"));
        }
    }

}

From source file:com.sshtools.common.ui.SshToolsApplicationApplet.java

/**
 *
 *
 * @param name/*from www .java  2s  .c o  m*/
 */
public void doAction(String name) {
    StandardAction a = applicationPanel.getAction(name);

    if (a != null) {
        if (a.isEnabled()) {
            log.debug("Performing action " + a.getName());
            a.actionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, a.getActionCommand()));
        } else {
            log.warn("No performing action '" + a.getName() + "' because it is disabled.");
        }
    } else {
        log.error("No action named " + name);
    }
}

From source file:net.sf.mzmine.modules.visualization.ida.IDAPlot.java

@Override
public void mouseClicked(final MouseEvent event) {

    // Let the parent handle the event (selection etc.)
    super.mouseClicked(event);

    if (event.getX() < 70) { // User clicked on Y-axis
        if (event.getClickCount() == 2) { // Reset zoom on Y-axis
            XYDataset data = ((XYPlot) getChart().getPlot()).getDataset();
            Number maximum = DatasetUtilities.findMaximumRangeValue(data);
            getXYPlot().getRangeAxis().setRange(0, 1.05 * maximum.floatValue());
        } else if (event.getClickCount() == 1) {
            // Auto range on Y-axis
            getXYPlot().getRangeAxis().setAutoTickUnitSelection(true);
            getXYPlot().getRangeAxis().setAutoRange(true);
        }//  ww  w.  ja va2 s . c om
    } else if (event.getY() > this.getChartRenderingInfo().getPlotInfo().getPlotArea().getMaxY() - 41
            && event.getClickCount() == 2) {
        // Reset zoom on X-axis
        getXYPlot().getDomainAxis().setAutoTickUnitSelection(true);
        restoreAutoDomainBounds();
    } else if (event.getClickCount() == 2) {
        visualizer.actionPerformed(
                new ActionEvent(event.getSource(), ActionEvent.ACTION_PERFORMED, "SHOW_SPECTRUM"));
    }
}

From source file:net.sf.mzmine.modules.visualization.msms.MsMsPlot.java

@Override
public void mouseClicked(final MouseEvent event) {

    // Let the parent handle the event (selection etc.)
    super.mouseClicked(event);

    if (event.getX() < 70) { // User clicked on Y-axis
        if (event.getClickCount() == 2) { // Reset zoom on Y-axis
            XYDataset data = ((XYPlot) getChart().getPlot()).getDataset();
            Number maximum = DatasetUtils.findMaximumRangeValue(data);
            getXYPlot().getRangeAxis().setRange(0, 1.05 * maximum.floatValue());
        } else if (event.getClickCount() == 1) {
            // Auto range on Y-axis
            getXYPlot().getRangeAxis().setAutoTickUnitSelection(true);
            getXYPlot().getRangeAxis().setAutoRange(true);
        }/*ww w  .j a v  a2  s.  c o m*/
    } else if (event.getY() > this.getChartRenderingInfo().getPlotInfo().getPlotArea().getMaxY() - 41
            && event.getClickCount() == 2) {
        // Reset zoom on X-axis
        getXYPlot().getDomainAxis().setAutoTickUnitSelection(true);
        restoreAutoDomainBounds();
    } else if (event.getClickCount() == 2) {
        visualizer.actionPerformed(
                new ActionEvent(event.getSource(), ActionEvent.ACTION_PERFORMED, "SHOW_SPECTRUM"));
    }
}

From source file:org.adempiere.apps.graph.PerformanceIndicator.java

/**
 * Notifies all listeners that have registered interest for
 * notification on this event type.  The event instance 
 * is lazily created using the <code>event</code> 
 * parameter.//from   w ww . ja va  2  s  . c  o  m
 *
 * @param event  the <code>ActionEvent</code> object
 * @see EventListenerList
 */
protected void fireActionPerformed(MouseEvent event) {
    // Guaranteed to return a non-null array
    ActionListener[] listeners = getActionListeners();
    ActionEvent e = null;
    // Process the listeners first to last
    for (int i = 0; i < listeners.length; i++) {
        //   Lazily create the event:
        if (e == null)
            e = new ActionEvent(this, ActionEvent.ACTION_PERFORMED, "pi", event.getWhen(),
                    event.getModifiers());
        listeners[i].actionPerformed(e);
    }
}

From source file:net.sf.mzmine.modules.visualization.tic.TICPlot.java

@Override
public void chartProgress(final ChartProgressEvent event) {

    super.chartProgress(event);

    if (event.getType() == ChartProgressEvent.DRAWING_FINISHED) {

        if (visualizer instanceof TICVisualizerWindow) {

            ((TICVisualizerWindow) visualizer).updateTitle();
        }/*from   w w w. ja  v a2s .c o m*/

        if (showSpectrumRequest) {

            showSpectrumRequest = false;
            visualizer.actionPerformed(
                    new ActionEvent(event.getSource(), ActionEvent.ACTION_PERFORMED, "SHOW_SPECTRUM"));
        }
    }
}

From source file:net.mariottini.swing.JFontChooser.java

/**
 * Called when the user approves a font. Call this method to close the dialog and approve the
 * currently selected font.//  w  w w.j  a v  a 2 s.com
 */
public void approveSelection() {
    ActionEvent event = new ActionEvent(this, ActionEvent.ACTION_PERFORMED, APPROVE_SELECTION);
    dispatchActionEvent(event);
}

From source file:de.juwimm.cms.Main.java

private void showAdminPanel() throws Exception {
    Constants.CMS_CLIENT_VIEW = Constants.CLIENT_VIEW_ADMIN;
    panRibbon.setView(false);/*from   w  w w  .  ja v  a2 s. co  m*/

    if (comm.isUserInRole(UserRights.SITE_ROOT)) {
        try {
            if (panRoot == null) {
                panRoot = new PanAdministrationRoot();
            }
            panRoot.reload();
        } catch (UserHasNoUnitsException ex) {
            JOptionPane.showMessageDialog(UIConstants.getMainFrame(), ex.getMessage(),
                    rb.getString("msgbox.title.loginFailed"), JOptionPane.ERROR_MESSAGE);
            ActionHub.fireActionPerformed(
                    new ActionEvent(this, ActionEvent.ACTION_PERFORMED, Constants.ACTION_LOGOFF));
            return;
        }
        setCenterPanel(panRoot);
    } else {
        try {
            if (panAdmin == null) {
                panAdmin = new PanAdministrationAdmin();
            }
            panAdmin.reload();
        } catch (UserHasNoUnitsException ex) {
            JOptionPane.showMessageDialog(UIConstants.getMainFrame(), ex.getMessage(),
                    rb.getString("msgbox.title.loginFailed"), JOptionPane.ERROR_MESSAGE);
            ActionHub.fireActionPerformed(
                    new ActionEvent(this, ActionEvent.ACTION_PERFORMED, Constants.ACTION_LOGOFF));
            return;
        }
        setCenterPanel(panAdmin);
    }
}

From source file:net.mariottini.swing.JFontChooser.java

/**
 * Called when the user cancels the operation. Call this method to close the dialog without
 * selecting a font./*  w w  w  .  j  a v a  2s. c o m*/
 */
public void cancelSelection() {
    ActionEvent event = new ActionEvent(this, ActionEvent.ACTION_PERFORMED, CANCEL_SELECTION);
    dispatchActionEvent(event);
}

From source file:de.juwimm.cms.content.panel.PanDocuments.java

private void btnFileActionPerformed(ActionEvent e) {
    if (e.getActionCommand().equals("CLICK")) {
        Enumeration en = bgrp.getElements();
        while (en.hasMoreElements()) {
            PanDocumentSymbol.JToggleBtt btn = (PanDocumentSymbol.JToggleBtt) en.nextElement();
            if (!btn.isSelected()) {
                btn.unClick();//from w  w w.java2s.  c o  m
            } else {
                btn.doClick();
            }
        }
        intDocId = new Integer(bgrp.getSelection().getActionCommand());
        selectDocument(intDocId);
    } else {
        ActionEvent ae = new ActionEvent(this, ActionEvent.ACTION_PERFORMED, "CLICK");
        ((PanDocumentSymbol.JToggleBtt) e.getSource()).fireActionPerformedT(ae);
    }
}