Example usage for javax.swing AbstractButton isSelected

List of usage examples for javax.swing AbstractButton isSelected

Introduction

In this page you can find the example usage for javax.swing AbstractButton isSelected.

Prototype

public boolean isSelected() 

Source Link

Document

Returns the state of the button.

Usage

From source file:sim.graph.MyPluggableRendererDemo.java

public void actionPerformed(ActionEvent e) {
    AbstractButton source = (AbstractButton) e.getSource();
    if (source == v_color) {
        vcf.setSeedColoring(source.isSelected());
    } else if (source == e_color) {
        ewcs.setWeighted(source.isSelected());
    } else if (source == v_stroke) {
        vsh.setHighlight(source.isSelected());
    } else if (source == v_labels) {
        if (source.isSelected())
            pr.setVertexStringer(vs);// w  ww . jav a  2  s  .c  o m
        else
            pr.setVertexStringer(vs_none);
    } else if (source == e_labels) {
        if (source.isSelected())
            pr.setEdgeStringer(es);
        else
            pr.setEdgeStringer(es_none);
    } else if (source == e_uarrow_pred) {
        show_arrow.showUndirected(source.isSelected());
    } else if (source == e_darrow_pred) {
        show_arrow.showDirected(source.isSelected());
    } else if (source == font) {
        ff.setBold(source.isSelected());
    } else if (source == v_shape) {
        vssa.useFunnyShapes(source.isSelected());
    } else if (source == v_size) {
        vssa.setScaling(source.isSelected());
    } else if (source == v_aspect) {
        vssa.setStretching(source.isSelected());
    } else if (source == e_line) {
        if (source.isSelected()) {
            pr.setEdgeShapeFunction(new EdgeShape.Line());
        }
    } else if (source == e_wedge) {
        if (source.isSelected())
            pr.setEdgeShapeFunction(new EdgeShape.Wedge(10));
    }
    //        else if (source == e_bent) 
    //        {
    //            if(source.isSelected())
    //            {
    //                pr.setEdgeShapeFunction(new EdgeShape.BentLine());
    //            }
    //        }
    else if (source == e_quad) {
        if (source.isSelected()) {
            pr.setEdgeShapeFunction(new EdgeShape.QuadCurve());
        }
    } else if (source == e_cubic) {
        if (source.isSelected()) {
            pr.setEdgeShapeFunction(new EdgeShape.CubicCurve());
        }
    } else if (source == e_show_d) {
        show_edge.showDirected(source.isSelected());
    } else if (source == e_show_u) {
        show_edge.showUndirected(source.isSelected());
    } else if (source == v_small) {
        show_vertex.filterSmall(source.isSelected());
    } else if (source == zoom_at_mouse) {
        gm.setZoomAtMouse(source.isSelected());
    } else if (source == no_gradient) {
        if (source.isSelected()) {
            gradient_level = GRADIENT_NONE;
        }
        //      } else if (source == gradient_absolute) {
        //         if (source.isSelected()) {
        //            gradient_level = GRADIENT_ABSOLUTE;
        //         }
    } else if (source == gradient_relative) {
        if (source.isSelected()) {
            gradient_level = GRADIENT_RELATIVE;
        }
    } else if (source == fill_edges) {
        edgePaint.useFill(source.isSelected());
    }
    visViewer.repaint();
}

From source file:test.visualization.PluggableRendererDemo.java

public void actionPerformed(ActionEvent e) {
    AbstractButton source = (AbstractButton) e.getSource();
    if (source == v_color) {
        seedDrawColor.setSeedColoring(source.isSelected());
        seedFillColor.setSeedColoring(source.isSelected());
    } else if (source == e_color) {
        ewcs.setWeighted(source.isSelected());
    } else if (source == v_stroke) {
        vsh.setHighlight(source.isSelected());
    } else if (source == v_labels) {
        if (source.isSelected())
            vv.getRenderContext().setVertexLabelTransformer(vs);
        else//  w w  w . jav  a2  s  .  com
            vv.getRenderContext().setVertexLabelTransformer(vs_none);
    } else if (source == e_labels) {
        if (source.isSelected())
            vv.getRenderContext().setEdgeLabelTransformer(es);
        else
            vv.getRenderContext().setEdgeLabelTransformer(es_none);
    } else if (source == e_uarrow_pred) {
        show_arrow.showUndirected(source.isSelected());
    } else if (source == e_darrow_pred) {
        show_arrow.showDirected(source.isSelected());
    } else if (source == font) {
        vff.setBold(source.isSelected());
        eff.setBold(source.isSelected());
    } else if (source == v_shape) {
        vssa.useFunnyShapes(source.isSelected());
    } else if (source == v_size) {
        vssa.setScaling(source.isSelected());
    } else if (source == v_aspect) {
        vssa.setStretching(source.isSelected());
    } else if (source == e_line) {
        if (source.isSelected()) {
            vv.getRenderContext().setEdgeShapeTransformer(new EdgeShape.Line<Integer, Number>());
        }
    } else if (source == e_ortho) {
        if (source.isSelected())
            vv.getRenderContext().setEdgeShapeTransformer(new EdgeShape.Orthogonal<Integer, Number>());
    } else if (source == e_wedge) {
        if (source.isSelected())
            vv.getRenderContext().setEdgeShapeTransformer(new EdgeShape.Wedge<Integer, Number>(10));
    }
    //        else if (source == e_bent) 
    //        {
    //            if(source.isSelected())
    //            {
    //                vv.getRenderContext().setEdgeShapeFunction(new EdgeShape.BentLine());
    //            }
    //        }
    else if (source == e_quad) {
        if (source.isSelected()) {
            vv.getRenderContext().setEdgeShapeTransformer(new EdgeShape.QuadCurve<Integer, Number>());
        }
    } else if (source == e_cubic) {
        if (source.isSelected()) {
            vv.getRenderContext().setEdgeShapeTransformer(new EdgeShape.CubicCurve<Integer, Number>());
        }
    } else if (source == e_show_d) {
        show_edge.showDirected(source.isSelected());
    } else if (source == e_show_u) {
        show_edge.showUndirected(source.isSelected());
    } else if (source == v_small) {
        show_vertex.filterSmall(source.isSelected());
    } else if (source == zoom_at_mouse) {
        gm.setZoomAtMouse(source.isSelected());
    } else if (source == no_gradient) {
        if (source.isSelected()) {
            gradient_level = GRADIENT_NONE;
        }
        //      } else if (source == gradient_absolute) {
        //         if (source.isSelected()) {
        //            gradient_level = GRADIENT_ABSOLUTE;
        //         }
    } else if (source == gradient_relative) {
        if (source.isSelected()) {
            gradient_level = GRADIENT_RELATIVE;
        }
    } else if (source == fill_edges) {
        if (source.isSelected()) {
            vv.getRenderContext().setEdgeFillPaintTransformer(edgeFillPaint);
        } else {
            vv.getRenderContext().setEdgeFillPaintTransformer(new ConstantTransformer(null));
        }
        //            edgePaint.useFill(source.isSelected());
    }
    vv.repaint();
}

From source file:com.google.code.facebook.graph.sna.applet.PluggableRendererDemo.java

public void actionPerformed(ActionEvent e) {
    AbstractButton source = (AbstractButton) e.getSource();
    if (source == v_color) {
        seedDrawColor.setSeedColoring(source.isSelected());
        seedFillColor.setSeedColoring(source.isSelected());
    } else if (source == e_color) {
        ewcs.setWeighted(source.isSelected());
    } else if (source == v_stroke) {
        vsh.setHighlight(source.isSelected());
    } else if (source == v_labels) {
        if (source.isSelected())
            vv.getRenderContext().setVertexLabelTransformer(vs);
        else/*from  w  w  w.ja  v a  2s .  co  m*/
            vv.getRenderContext().setVertexLabelTransformer(vs_none);
    } else if (source == e_labels) {
        if (source.isSelected())
            vv.getRenderContext().setEdgeLabelTransformer(es);
        else
            vv.getRenderContext().setEdgeLabelTransformer(es_none);
    } else if (source == e_uarrow_pred) {
        show_arrow.showUndirected(source.isSelected());
    } else if (source == e_darrow_pred) {
        show_arrow.showDirected(source.isSelected());
    } else if (source == e_arrow_centered) {
        if (source.isSelected()) {
            vv.getRenderer().getEdgeRenderer()
                    .setEdgeArrowRenderingSupport(new CenterEdgeArrowRenderingSupport());
        } else {
            vv.getRenderer().getEdgeRenderer()
                    .setEdgeArrowRenderingSupport(new BasicEdgeArrowRenderingSupport());
        }
    } else if (source == font) {
        vff.setBold(source.isSelected());
        eff.setBold(source.isSelected());
    } else if (source == v_shape) {
        vssa.useFunnyShapes(source.isSelected());
    } else if (source == v_size) {
        vssa.setScaling(source.isSelected());
    } else if (source == v_aspect) {
        vssa.setStretching(source.isSelected());
    } else if (source == e_line) {
        if (source.isSelected()) {
            vv.getRenderContext().setEdgeShapeTransformer(new EdgeShape.Line<Integer, Number>());
        }
    } else if (source == e_ortho) {
        if (source.isSelected())
            vv.getRenderContext().setEdgeShapeTransformer(new EdgeShape.Orthogonal<Integer, Number>());
    } else if (source == e_wedge) {
        if (source.isSelected())
            vv.getRenderContext().setEdgeShapeTransformer(new EdgeShape.Wedge<Integer, Number>(10));
    }
    //        else if (source == e_bent) 
    //        {
    //            if(source.isSelected())
    //            {
    //                vv.getRenderContext().setEdgeShapeFunction(new EdgeShape.BentLine());
    //            }
    //        }
    else if (source == e_quad) {
        if (source.isSelected()) {
            vv.getRenderContext().setEdgeShapeTransformer(new EdgeShape.QuadCurve<Integer, Number>());
        }
    } else if (source == e_cubic) {
        if (source.isSelected()) {
            vv.getRenderContext().setEdgeShapeTransformer(new EdgeShape.CubicCurve<Integer, Number>());
        }
    } else if (source == e_show_d) {
        show_edge.showDirected(source.isSelected());
    } else if (source == e_show_u) {
        show_edge.showUndirected(source.isSelected());
    } else if (source == v_small) {
        show_vertex.filterSmall(source.isSelected());
    } else if (source == zoom_at_mouse) {
        gm.setZoomAtMouse(source.isSelected());
    } else if (source == no_gradient) {
        if (source.isSelected()) {
            gradient_level = GRADIENT_NONE;
        }
        //      } else if (source == gradient_absolute) {
        //         if (source.isSelected()) {
        //            gradient_level = GRADIENT_ABSOLUTE;
        //         }
    } else if (source == gradient_relative) {
        if (source.isSelected()) {
            gradient_level = GRADIENT_RELATIVE;
        }
    } else if (source == fill_edges) {
        if (source.isSelected()) {
            vv.getRenderContext().setEdgeFillPaintTransformer(edgeFillPaint);
        } else {
            vv.getRenderContext().setEdgeFillPaintTransformer(new ConstantTransformer(null));
        }
        //            edgePaint.useFill(source.isSelected());
    }
    vv.repaint();
}

From source file:edu.uci.ics.jung.samples.PluggableRendererDemo.java

@SuppressWarnings({ "rawtypes", "unchecked" })
public void actionPerformed(ActionEvent e) {
    AbstractButton source = (AbstractButton) e.getSource();
    if (source == v_color) {
        seedDrawColor.setSeedColoring(source.isSelected());
        seedFillColor.setSeedColoring(source.isSelected());
    } else if (source == e_color) {
        ewcs.setWeighted(source.isSelected());
    } else if (source == v_stroke) {
        vsh.setHighlight(source.isSelected());
    } else if (source == v_labels) {
        if (source.isSelected())
            vv.getRenderContext().setVertexLabelTransformer(vs);
        else//w w  w  .  ja  v a  2  s  .com
            vv.getRenderContext().setVertexLabelTransformer(vs_none);
    } else if (source == e_labels) {
        if (source.isSelected())
            vv.getRenderContext().setEdgeLabelTransformer(es);
        else
            vv.getRenderContext().setEdgeLabelTransformer(es_none);
    } else if (source == e_uarrow_pred) {
        show_arrow.showUndirected(source.isSelected());
    } else if (source == e_darrow_pred) {
        show_arrow.showDirected(source.isSelected());
    } else if (source == e_arrow_centered) {
        if (source.isSelected()) {
            vv.getRenderer().getEdgeRenderer()
                    .setEdgeArrowRenderingSupport(new CenterEdgeArrowRenderingSupport());
        } else {
            vv.getRenderer().getEdgeRenderer()
                    .setEdgeArrowRenderingSupport(new BasicEdgeArrowRenderingSupport());
        }
    } else if (source == font) {
        vff.setBold(source.isSelected());
        eff.setBold(source.isSelected());
    } else if (source == v_shape) {
        vssa.useFunnyShapes(source.isSelected());
    } else if (source == v_size) {
        vssa.setScaling(source.isSelected());
    } else if (source == v_aspect) {
        vssa.setStretching(source.isSelected());
    } else if (source == e_line) {
        if (source.isSelected()) {
            vv.getRenderContext().setEdgeShapeTransformer(new EdgeShape.Line<Integer, Number>());
        }
    } else if (source == e_ortho) {
        if (source.isSelected())
            vv.getRenderContext().setEdgeShapeTransformer(new EdgeShape.Orthogonal<Integer, Number>());
    } else if (source == e_wedge) {
        if (source.isSelected())
            vv.getRenderContext().setEdgeShapeTransformer(new EdgeShape.Wedge<Integer, Number>(10));
    }
    //        else if (source == e_bent) 
    //        {
    //            if(source.isSelected())
    //            {
    //                vv.getRenderContext().setEdgeShapeFunction(new EdgeShape.BentLine());
    //            }
    //        }
    else if (source == e_quad) {
        if (source.isSelected()) {
            vv.getRenderContext().setEdgeShapeTransformer(new EdgeShape.QuadCurve<Integer, Number>());
        }
    } else if (source == e_cubic) {
        if (source.isSelected()) {
            vv.getRenderContext().setEdgeShapeTransformer(new EdgeShape.CubicCurve<Integer, Number>());
        }
    } else if (source == e_show_d) {
        show_edge.showDirected(source.isSelected());
    } else if (source == e_show_u) {
        show_edge.showUndirected(source.isSelected());
    } else if (source == v_small) {
        show_vertex.filterSmall(source.isSelected());
    } else if (source == zoom_at_mouse) {
        gm.setZoomAtMouse(source.isSelected());
    } else if (source == no_gradient) {
        if (source.isSelected()) {
            gradient_level = GRADIENT_NONE;
        }
        //      } else if (source == gradient_absolute) {
        //         if (source.isSelected()) {
        //            gradient_level = GRADIENT_ABSOLUTE;
        //         }
    } else if (source == gradient_relative) {
        if (source.isSelected()) {
            gradient_level = GRADIENT_RELATIVE;
        }
    } else if (source == fill_edges) {
        if (source.isSelected()) {
            vv.getRenderContext().setEdgeFillPaintTransformer(edgeFillPaint);
        } else {
            vv.getRenderContext().setEdgeFillPaintTransformer(new ConstantTransformer(null));
        }
        //            edgePaint.useFill(source.isSelected());
    }
    vv.repaint();
}

From source file:de.unikassel.jung.PluggableRendererDemo.java

@Override
public void actionPerformed(final ActionEvent e) {
    AbstractButton source = (AbstractButton) e.getSource();
    if (source == v_color) {
        seedDrawColor.setSeedColoring(source.isSelected());
        seedFillColor.setSeedColoring(source.isSelected());
    } else if (source == e_color) {
        ewcs.setWeighted(source.isSelected());
    } else if (source == v_stroke) {
        vsh.setHighlight(source.isSelected());
    } else if (source == v_labels) {
        if (source.isSelected()) {
            vv.getRenderContext().setVertexLabelTransformer(vs);
        } else {/*  w  w  w  . j  a  v  a2s  .  co m*/
            vv.getRenderContext().setVertexLabelTransformer(vs_none);
        }
    } else if (source == e_labels) {
        if (source.isSelected()) {
            vv.getRenderContext().setEdgeLabelTransformer(es);
        } else {
            vv.getRenderContext().setEdgeLabelTransformer(es_none);
        }
    } else if (source == e_uarrow_pred) {
        show_arrow.showUndirected(source.isSelected());
    } else if (source == e_darrow_pred) {
        show_arrow.showDirected(source.isSelected());
    } else if (source == e_arrow_centered) {
        if (source.isSelected()) {
            vv.getRenderer().getEdgeRenderer()
                    .setEdgeArrowRenderingSupport(new CenterEdgeArrowRenderingSupport());
        } else {
            vv.getRenderer().getEdgeRenderer()
                    .setEdgeArrowRenderingSupport(new BasicEdgeArrowRenderingSupport());
        }
    } else if (source == font) {
        vff.setBold(source.isSelected());
        eff.setBold(source.isSelected());
    } else if (source == v_shape) {
        vssa.useFunnyShapes(source.isSelected());
    } else if (source == v_size) {
        vssa.setScaling(source.isSelected());
    } else if (source == v_aspect) {
        vssa.setStretching(source.isSelected());
    } else if (source == e_line) {
        if (source.isSelected()) {
            vv.getRenderContext().setEdgeShapeTransformer(new EdgeShape.Line<Integer, Number>());
        }
    } else if (source == e_ortho) {
        if (source.isSelected()) {
            vv.getRenderContext().setEdgeShapeTransformer(new EdgeShape.Orthogonal<Integer, Number>());
        }
    } else if (source == e_wedge) {
        if (source.isSelected()) {
            vv.getRenderContext().setEdgeShapeTransformer(new EdgeShape.Wedge<Integer, Number>(10));
        }
    }
    // else if (source == e_bent)
    // {
    // if(source.isSelected())
    // {
    // vv.getRenderContext().setEdgeShapeFunction(new EdgeShape.BentLine());
    // }
    // }
    else if (source == e_quad) {
        if (source.isSelected()) {
            vv.getRenderContext().setEdgeShapeTransformer(new EdgeShape.QuadCurve<Integer, Number>());
        }
    } else if (source == e_cubic) {
        if (source.isSelected()) {
            vv.getRenderContext().setEdgeShapeTransformer(new EdgeShape.CubicCurve<Integer, Number>());
        }
    } else if (source == e_show_d) {
        show_edge.showDirected(source.isSelected());
    } else if (source == e_show_u) {
        show_edge.showUndirected(source.isSelected());
    } else if (source == v_small) {
        show_vertex.filterSmall(source.isSelected());
    } else if (source == zoom_at_mouse) {
        gm.setZoomAtMouse(source.isSelected());
    } else if (source == no_gradient) {
        if (source.isSelected()) {
            gradient_level = GRADIENT_NONE;
        }
        // } else if (source == gradient_absolute) {
        // if (source.isSelected()) {
        // gradient_level = GRADIENT_ABSOLUTE;
        // }
    } else if (source == gradient_relative) {
        if (source.isSelected()) {
            gradient_level = GRADIENT_RELATIVE;
        }
    } else if (source == fill_edges) {
        if (source.isSelected()) {
            vv.getRenderContext().setEdgeFillPaintTransformer(edgeFillPaint);
        } else {
            vv.getRenderContext().setEdgeFillPaintTransformer(new ConstantTransformer(null));
        }
        // edgePaint.useFill(source.isSelected());
    }
    vv.repaint();
}

From source file:geovista.network.gui.NodeLinkView.java

@Override
public void actionPerformed(ActionEvent e) {
    // TODO Auto-generated method stub

    AbstractButton source = (AbstractButton) e.getSource();

    if (source == v_small) {
        show_vertex.filterSmall(source.isSelected());
    } else if (source == e_labels) {
        if (source.isSelected()) {
            vv.getRenderContext().setEdgeLabelTransformer(edge_label);
        } else {/*w w w  .ja v a  2  s .c  o m*/
            vv.getRenderContext().setEdgeLabelTransformer(es_none);
        }
    }
    /*
     * if (source == v_shape) { vssa.useFunnyShapes(source.isSelected()); }
     * else
     */// if (source == v_size)
    {
        // vssa.setScaling(source.isSelected());
    }
    /*
     * else if (source == v_aspect) {
     * vssa.setStretching(source.isSelected()); }
     */
    vv.repaint();

}

From source file:org.neuroph.netbeans.main.easyneurons.NeuralGraphRenderer.java

@Override
public void actionPerformed(ActionEvent e) {
    AbstractButton source = (AbstractButton) e.getSource();

    if (source == e_line) {
        if (source.isSelected()) {
            vv.getRenderContext().setEdgeShapeTransformer(new EdgeShape.Line<Neuron, Connection>());
        }//from   w w w  .  ja v  a2s  .c o  m
    } else if (source == e_quad) {
        if (source.isSelected()) {
            vv.getRenderContext().setEdgeShapeTransformer(new EdgeShape.QuadCurve<Neuron, Connection>());
        }
    } else if (source == e_cubic) {
        if (source.isSelected()) {
            vv.getRenderContext().setEdgeShapeTransformer(new EdgeShape.CubicCurve<Neuron, Connection>());
        }
    } else if (source == v_labels) {
        if (source.isSelected())
            vv.getRenderContext().setVertexLabelTransformer(vs);
        else
            vv.getRenderContext().setVertexLabelTransformer(vs_none);
    } else if (source == e_labels) {
        if (source.isSelected())
            vv.getRenderContext().setEdgeLabelTransformer(es);
        else
            vv.getRenderContext().setEdgeLabelTransformer(es_none);
    } else if (source == font) {
        vff.setBold(source.isSelected());
        eff.setBold(source.isSelected());
    } else if (source == e_color) {
        ewcs.setWeighted(source.isSelected());
    } else if (source == v_size) {
        vssa.setScaling(source.isSelected());
    } else if (source == v_stroke) {
        vsh.setHighlight(source.isSelected());
    }
    vv.repaint();
}

From source file:com.cybercom.svp.machine.gui.MachineForm.java

private void buttonSendNotificationActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonSendNotificationActionPerformed

    try {//from   w w w . j  a v  a2 s.  c  o  m
        validateForMachineActions();

        if (processThread != null && processThread.isAlive()) {
            interrupted = true;
            buttonStartStopSewing.setText("Start sewing");
        }

        for (Enumeration<AbstractButton> buttons = groupNotification.getElements(); buttons
                .hasMoreElements();) {
            AbstractButton button = buttons.nextElement();

            if (button.isSelected()) {
                if (button == buttonBobbinEmpty) {
                    sendEvent(objToXml(MachineEvent.class, getBobbinEmptyEventfromMachine()));
                } else if (button == buttonChangeColor) {
                    sendEvent(objToXml(MachineEvent.class, getChangeThreadEventfromMachine(1)));
                } else if (button == buttonCutThreadEnds) {
                    sendEvent(objToXml(MachineEvent.class, getCutThreadEventfromMachine()));
                } else if (button == buttonThreadBreak) {
                    sendEvent(objToXml(MachineEvent.class, getThreadBreakEventfromMachine()));
                }

            }
        }
    } catch (Exception ex) {
        JOptionPane.showMessageDialog(this, ex.getMessage());
    }

}

From source file:SoundManagerTest.java

/**
 * Performs actions when a button is pressed.
 *///from w  ww.java  2  s .c  om
public void actionPerformed(ActionEvent e) {
    String command = e.getActionCommand();
    AbstractButton button = (AbstractButton) e.getSource();
    if (command == EXIT) {
        midiPlayer.close();
        soundManager.close();
        stop();
    } else if (command == PAUSE) {
        // pause the sound
        soundManager.setPaused(button.isSelected());
        midiPlayer.setPaused(button.isSelected());
    } else if (command == PLAY_MUSIC) {
        // toggle music on or off
        if (button.isSelected()) {
            midiPlayer.play(music, true);
        } else {
            midiPlayer.stop();
        }
    } else if (command == MUSIC_DRUMS) {
        // toggle drums on or off
        Sequencer sequencer = midiPlayer.getSequencer();
        if (sequencer != null) {
            boolean mute = sequencer.getTrackMute(DRUM_TRACK);
            sequencer.setTrackMute(DRUM_TRACK, !mute);
        }
    } else if (command == PLAY_SOUND) {
        // play a normal sound
        soundManager.play(boop);
    } else if (command == PLAY_ECHO_SOUND) {
        // play a sound with an echo
        EchoFilter filter = new EchoFilter(11025, .6f);
        soundManager.play(boop, filter, false);
    } else if (command == PLAY_LOOPING_SOUND) {
        // play or stop the looping sound
        if (button.isSelected()) {
            lastloopingSound = soundManager.play(bzz, null, true);
        } else if (lastloopingSound != null) {
            try {
                lastloopingSound.close();
            } catch (IOException ex) {
            }
            lastloopingSound = null;
        }
    } else if (command == PLAY_MANY_SOUNDS) {
        // play several sounds at once, to test the system
        for (int i = 0; i < MANY_SOUNDS_COUNT; i++) {
            soundManager.play(boop);
        }
    }
}

From source file:eu.apenet.dpt.standalone.gui.ead2edm.EdmOptionsPanel.java

private boolean isRadioBtnChecked(ButtonGroup buttonGroup) {
    Enumeration<AbstractButton> enumeration = buttonGroup.getElements();
    while (enumeration.hasMoreElements()) {
        AbstractButton btn = enumeration.nextElement();
        if (btn.isSelected()) {
            return true;
        }/*from   w  w w . j  av a 2 s. c  om*/
    }
    return false;
}