Package com.barrybecker4.ui.components

Examples of com.barrybecker4.ui.components.NumberInput$NumberKeyAdapter


    protected JPanel createCustomBoardConfigPanel() {
        JPanel p = new JPanel();
        p.setLayout( new BoxLayout( p, BoxLayout.Y_AXIS ) );

        handicapField_ =
           new NumberInput(GameContext.getLabel("HANDICAP_LABEL"), ((GoBoard) board_).getHandicap());

        p.add( handicapField_ );
        assert ( handicapField_!=null );
        return p;
    }
View Full Code Here


        frictionPanel.setBorder(
                BorderFactory.createTitledBorder( BorderFactory.createEtchedBorder(), "Friction" ) );

        NewtonianSimulator sim = (NewtonianSimulator) getSimulator();
        staticFrictionField_ =
                new NumberInput( "static Friction (.0 small - 0.4 large):  ", sim.getStaticFriction(),
                                 "This controls amount of static surface friction.", 0.0, 0.4, false);
        dynamicFrictionField_ =
                new NumberInput( "dynamic friction (.0 small - .4 large):  ", sim.getDynamicFriction(),
                                  "This controls amount of dynamic surface friction.", 0.0, 0.4, false);

        frictionPanel.add( staticFrictionField_ );
        frictionPanel.add( dynamicFrictionField_ );
View Full Code Here

        recordAnimationCheckbox_.setToolTipText( "Record each animation frame to a unique file" );
        recordAnimationCheckbox_.addActionListener( this );
        togglesPanel.add( recordAnimationCheckbox_ );

        timeStepField_ =
                new NumberInput("Time Step (.001 slow - .9 fast but unstable):  ",  simulator_.getTimeStep(),
                                "This controls the size of the numerical intergration steps",
                                0.001, 0.9, false);
        numStepsPerFrameField_ =
                new NumberInput("Num Steps Per Frame (1 slow but smooth - "+MAX_NUM_STEPS_PER_FRAME+" (fast but choppy):  ",
                                simulator_.getNumStepsPerFrame(),
                               "This controls the number of the numerical intergration steps per animation frame",
                               1, MAX_NUM_STEPS_PER_FRAME, true);

        textInputsPanel.add( timeStepField_ );
        textInputsPanel.add( numStepsPerFrameField_ );

        scaleField_ =
                new NumberInput( "Geometry Scale (1.0 = standard size):  ", simulator_.getScale(),
                                 "This controls the size of the objects in the simulation",
                                 0.01, 1000, false);
        scaleField_.setEnabled( false );
        textInputsPanel.add( scaleField_ );
View Full Code Here

        waveTypeCombo_.setToolTipText("Select a type of wave form to use for muscle contractions.");

        LocomotionParameters params = ((SnakeSimulator) getSimulator()).getLocomotionParams();

        waveSpeedField_ =
                new NumberInput("Wave Speed (.001 slow - .9 fast):  ", params.getWaveSpeed(),
                     "This controls the speed at which the force function that travels down the body of the snake",
                     0.001, 0.9, false);
        waveAmplitudeField_ =
                new NumberInput("Wave Amplitude (.001 small - 2.0 large):  ", params.getWaveAmplitude(),
                    "This controls the amplitude of the force function that travels down the body of the snake",
                    0.001, 0.9, false);
        wavePeriodField_ =
                new NumberInput("Wave Period (0.5 small - 5.0 large):  ", params.getWavePeriod(),
                    "This controls the period (in number of PI radians) of the force function "
                    + "that travels down the body of the snake", 0.5, 5.0, false);
        massScaleField_ =
                new NumberInput("Mass Scale (.1 small - 6.0 large):  ", params.getMassScale(),
                    "This controls the overall mass of the snake. A high number indicates that the snake weighs a lot.",
                    0.1, 6.0, false);

        springKField_ =
                new NumberInput("Spring Stiffness  (0.1 small - 4.0 large):  ", params.getSpringK(),
                    "This controls the stiffness of the springs used to make up the snake's body.",
                    0.1, 4.0, false);

        springDampingField_ =
                new NumberInput("Spring Damping (.1 small - 4.0 large):  ", params.getSpringDamping(),
                    "This controls how quickly the spring returns to rest once released.",
                    0.1, 4.0, false);

        snakeParamPanel.add(snakeCombo_);
        snakeParamPanel.add(waveTypeCombo_);
View Full Code Here

        TrebuchetSimulator simulator = (TrebuchetSimulator) getSimulator();
        Trebuchet treb = simulator.getTrebuchet();

        counterWeightLeverlLengthField_ =
                new NumberInput( "Counter Weight Lever Length (1.0 short - 3.0 long):  ",
                                 treb.getCounterWeightLeverLength(),
                                 "This controls the distance from the fulcrum point to the point "
                                 + "where the counter weight is attached to the the end of the arm.",
                                 1.0, 3.0, false);

        counterWeightMassField_ =
                new NumberInput( "Counter Weight Mass  (2.0 light - 60.0 heavy):  ",
                                 treb.getCounterWeightMass(),
                                 "This controls mass of main counterweight on the right ",
                                 2.0, 60.0, false);

        projectileMassField_ =
                new NumberInput( "Projectile Mass  (0.2 light - 5.0 heavy):  ",
                                 treb.getProjectileMass(),
                                 "This controls mass of the projectile thrown.",
                                 0.2, 5.0, false);

        slingLengthField_ =
                new NumberInput( "Sling Length  (0.2 short - 3.0 long):  ",
                                 treb.getSlingLength(),
                                 "This controls the magnitude of the sling.",
                                 0.2, 3.0, false);

        slingLeverLengthField_ =
                new NumberInput( "Sling Lever Length  (1.0 short - 5.0 long):  ",
                                 treb.getSlingLeverLength(),
                                 "This controls magnitude of the lever arm from the fulcrum to the sling attachment point.",
                                 1.0, 5.0, false);

        slingReleaseAngleField_ =
                new NumberInput( "Sling Release Angle  (0.0 small - PI/2 large):  ",
                                 treb.getSlingReleaseAngle(),
                                 "The angle between the sling and the lever arm when the projectile will be released. ",
                                 0, Math.PI / 2, false);

        trebParamPanel.add( counterWeightLeverlLengthField_ );
View Full Code Here

            JLabel instr3 = new JLabel("If you want, you can \"all in\" one of the players by raising $"+(allInAmount_ - callAmount_ - ante_));
            instructionsPanel.add(instr3, BorderLayout.SOUTH);
        }
        if (callAmount_ > 0) {
            raiseAmount_ = new NumberInput(GameContext.getLabel("AMOUNT_TO_RAISE1"), DEFAULT_RAISE_AMOUNT);
        }
        else {
            raiseAmount_ = new NumberInput(GameContext.getLabel("AMOUNT_TO_RAISE2"), DEFAULT_RAISE_AMOUNT);
        }

        primaryPanel.add(instructionsPanel, BorderLayout.NORTH);
        primaryPanel.add(raiseAmount_, BorderLayout.CENTER);
        mainPanel.add(primaryPanel, BorderLayout.CENTER);
View Full Code Here

     */
    @Override
    protected JComponent[] getControllerParamComponents() {

        PokerOptions options = (PokerOptions)controller_.getOptions();
        ante_ = new NumberInput( GameContext.getLabel("ANTE"), options.getAnte(),
                                 GameContext.getLabel("ANTE_TIP"),
                                 1, 100 * PokerOptions.DEFAULT_ANTE, true);
        initialChips_ =
                new NumberInput(GameContext.getLabel("INITIAL_CASH"), options.getInitialCash(),
                                GameContext.getLabel("INITIAL_CASH_TIP"),
                                1, 1000 * PokerOptions.DEFAULT_INITIAL_CASH, true);
        maxAbsoluteRaise_ =
                new NumberInput(GameContext.getLabel("MAX_RAISE"), options.getMaxAbsoluteRaise(),
                                GameContext.getLabel("MAX_RAISE_TIP"),
                                1, 100 * PokerOptions.DEFAULT_MAX_ABS_RAISE, true);

        initMultiControllerParamComponents(options);

View Full Code Here

        paramPanel.setLayout(new BorderLayout());
        JPanel innerPanel = new JPanel();
        innerPanel.setLayout( new BoxLayout(innerPanel, BoxLayout.Y_AXIS));

        numDiceField_ =
                new NumberInput("Number of Dice (1 - 200): ", 2,
                                "This sets the number of dice to throw on each step of the simulation.", 1, 200, true);
        numSidesField_ =
                new NumberInput( "Number of Sides on Dice (2 - 100): ", 6,
                                  "This sets the number of sides on each dice that is thrown.", 1, 100, true);

        innerPanel.add( numDiceField_ );
        innerPanel.add( numSidesField_);
        JPanel fill = new JPanel();
View Full Code Here

        ButtonGroup buttonGroup = new ButtonGroup();
        consoleOutputButton_ = createRadioButton("CONSOLE");
        windowOutputButton_ = createRadioButton("SEPARATE_WINDOW");
        fileOutputButton_ = createRadioButton("THIS_FILE");

        p.add( new RadioButtonPanel( consoleOutputButton_, buttonGroup, true ) );
        p.add( new RadioButtonPanel( windowOutputButton_, buttonGroup, false ) );
        p.add( new RadioButtonPanel( fileOutputButton_, buttonGroup, false ) );
        logDestination_ = GameContext.getLogger().getDestination();
        switch (logDestination_) {
            case Log.LOG_TO_CONSOLE:
                consoleOutputButton_.setSelected( true );
                break;
View Full Code Here

     * initialize UI for server.
     */
    private void initUI(String gameName) {
        JPanel panel = new JPanel();
        JLabel label = new JLabel("Commands received over the socket:");
        textArea = new ScrollingTextArea(20, 44);

        panel.setLayout(new BorderLayout());
        panel.setBackground(Color.white);
        panel.add("North", label);
        JScrollPane scrollPane = new JScrollPane(textArea);
View Full Code Here

TOP

Related Classes of com.barrybecker4.ui.components.NumberInput$NumberKeyAdapter

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.