Package barsuift.simLife.j2d.action

Examples of barsuift.simLife.j2d.action.SpeedAction


    }

    private JPanel createSpeedPanel(UniverseTimeController timeController) {
        JPanel speedPanel = new JPanel();
        speedPanel.setLayout(new BoxLayout(speedPanel, BoxLayout.LINE_AXIS));
        SpeedAction action1 = new SpeedAction(timeController, "1", "1 cycle / sec", Mnemonics.SPEED_1,
                Accelerators.SPEED_1, "1");
        JRadioButton speed1 = new JRadioButton(action1);
        speed1.setSelected(true);

        SpeedAction action10 = new SpeedAction(timeController, "10", "10 cycles / sec", Mnemonics.SPEED_10,
                Accelerators.SPEED_10, "10");
        JRadioButton speed10 = new JRadioButton(action10);

        ButtonGroup speedSwitch = new ButtonGroup();
        speedSwitch.add(speed1);
View Full Code Here


    }

    private JPanel createSpeedPanel(MainSynchronizer synchronizer) {
        JPanel speedPanel = new JPanel();
        speedPanel.setLayout(new BoxLayout(speedPanel, BoxLayout.LINE_AXIS));
        SpeedAction actionNormalSpeed = new SpeedAction(synchronizer, "Normal", "Normal speed", Mnemonics.SPEED_NORMAL,
                Speed.NORMAL.name());
        JRadioButton normalSpeed = new JRadioButton(actionNormalSpeed);

        SpeedAction actionFastSpeed = new SpeedAction(synchronizer, "Fast", "Fast speed (about 5 times faster))",
                Mnemonics.SPEED_FAST, Speed.FAST.name());
        JRadioButton fastSpeed = new JRadioButton(actionFastSpeed);

        SpeedAction actionVeryFastSpeed = new SpeedAction(synchronizer, "Very fast",
                "Very fast speed (about 20 times faster)", Mnemonics.SPEED_VERY_FAST, Speed.VERY_FAST.name());
        JRadioButton veryFastSpeed = new JRadioButton(actionVeryFastSpeed);

        Speed speed = synchronizer.getSpeed();
        normalSpeed.setSelected(speed == Speed.NORMAL);
View Full Code Here

TOP

Related Classes of barsuift.simLife.j2d.action.SpeedAction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.