Example usage for org.jfree.chart ChartPanel PROPERTIES_COMMAND

List of usage examples for org.jfree.chart ChartPanel PROPERTIES_COMMAND

Introduction

In this page you can find the example usage for org.jfree.chart ChartPanel PROPERTIES_COMMAND.

Prototype

String PROPERTIES_COMMAND

To view the source code for org.jfree.chart ChartPanel PROPERTIES_COMMAND.

Click Source Link

Document

Properties action command.

Usage

From source file:ucar.unidata.idv.control.McVHistogramWrapper.java

/**
 * Add the default menu items//ww w  .j  ava  2  s  .  c  o m
 *
 * @param items List of menu items
 *
 * @return The items list
 */
@Override
public List getPopupMenuItems(List items) {
    items = super.getPopupMenuItems(items);
    for (Object o : items) {
        if (o instanceof JMenuItem) {
            JMenuItem menuItem = (JMenuItem) o;
            if ("Properties...".equals(menuItem.getText())) {
                if (menuItem.getActionListeners().length == 0) {
                    menuItem.setActionCommand(ChartPanel.PROPERTIES_COMMAND);
                    menuItem.addActionListener(buildHistoPropsListener());
                }
            }
        }
    }
    return items;
}

From source file:edu.wisc.ssec.mcidasv.control.McIDASVHistogramWrapper.java

/**
 * Add the default menu items//from w w  w .  j  a v a  2  s  .  com
 * 
 * @param items List of menu items
 * 
 * @return The items list
 */
@Override
protected List getPopupMenuItems(List items) {
    items = super.getPopupMenuItems(items);
    for (Object o : items) {
        if (o instanceof JMenuItem) {
            JMenuItem menuItem = (JMenuItem) o;
            if ("Properties...".equals(menuItem.getText())) {
                menuItem.setActionCommand(ChartPanel.PROPERTIES_COMMAND);
                menuItem.addActionListener(buildHistoPropsListener());
            }
        }
    }
    return items;
}

From source file:ucar.unidata.idv.control.McVHistogramWrapper.java

/**
 * @return {@link ActionListener} that listens for
 * {@link ChartPanel#PROPERTIES_COMMAND} events and shows the histogram
 * properties./*  w w w . ja va 2  s  .  c  om*/
 */
private ActionListener buildHistoPropsListener() {
    return new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent event) {
            String command = event.getActionCommand();
            if (ChartPanel.PROPERTIES_COMMAND.equals(command)) {
                McVHistogramWrapper.this.showProperties();
                return;
            }
        }
    };
}

From source file:edu.wisc.ssec.mcidasv.control.McIDASVHistogramWrapper.java

/**
 * @return {@link ActionListener} that listens for
 * {@link ChartPanel#PROPERTIES_COMMAND} events and shows the histogram
 * properties./*from  w ww. j  av  a  2  s.  c  o m*/
 */
private ActionListener buildHistoPropsListener() {
    return new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent event) {
            String command = event.getActionCommand();
            if (ChartPanel.PROPERTIES_COMMAND.equals(command)) {
                McIDASVHistogramWrapper.this.showProperties();
                return;
            }
        }
    };
}