Example usage for javax.swing JCheckBoxMenuItem getActionCommand

List of usage examples for javax.swing JCheckBoxMenuItem getActionCommand

Introduction

In this page you can find the example usage for javax.swing JCheckBoxMenuItem getActionCommand.

Prototype

public String getActionCommand() 

Source Link

Document

Returns the action command for this button.

Usage

From source file:de.tud.kom.p2psim.impl.skynet.visualization.SkyNetVisualization.java

private void displayAllMetricsOfAGroup(JMenu menu) {
    JCheckBoxMenuItem item = null;
    String name = null;/*from ww  w  . ja  v a 2s  .c o  m*/
    for (int i = 0; i < menu.getMenuComponentCount(); i++) {
        if (menu.getMenuComponent(i) instanceof JCheckBoxMenuItem) {
            item = (JCheckBoxMenuItem) menu.getMenuComponent(i);
            name = item.getActionCommand();
            if (!item.isSelected()) {
                item.setSelected(true);
                createPlotInWindow(name);
            }
        }
    }
}

From source file:de.tud.kom.p2psim.impl.skynet.visualization.SkyNetVisualization.java

private void removeAllMetricsOfAGroup(JMenu menu) {
    JCheckBoxMenuItem item = null;
    String name = null;/*from w  w w .j ava  2s .  c o m*/
    for (int i = 0; i < menu.getMenuComponentCount(); i++) {
        if (menu.getMenuComponent(i) instanceof JCheckBoxMenuItem) {
            item = (JCheckBoxMenuItem) menu.getMenuComponent(i);
            name = item.getActionCommand();
            if (item.isSelected()) {
                item.setSelected(false);
                deletePlotInWindow(name);
            }
        }
    }
}