Package com.barrybecker4.ui.components

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


        p.setBorder( BorderFactory.createTitledBorder( BorderFactory.createEtchedBorder(), "Board Configuration" ) );
        JLabel label = new JLabel( GameContext.getLabel("BOARD_SIZE") + ": " );
        label.setAlignmentX( Component.LEFT_ALIGNMENT );
        p.add( label );

        rowSizeField_ = new NumberInput(GameContext.getLabel("NUMBER_OF_ROWS"), initialNumRows);
        colSizeField_ = new NumberInput( GameContext.getLabel("NUMBER_OF_COLS"), initialNumCols);

        rowSizeField_.setAlignmentX( Component.LEFT_ALIGNMENT );
        colSizeField_.setAlignmentX( Component.LEFT_ALIGNMENT );
        p.add( rowSizeField_ );
        p.add( colSizeField_ );
View Full Code Here


        routePanel.setMinimumSize(new Dimension(30,60));
        routePanel.add(originPanel, BorderLayout.NORTH);
        routePanel.add(destPanel, BorderLayout.CENTER);
        routePanel.add(availableShips, BorderLayout.SOUTH);

        numShips_ = new NumberInput(GameContext.getLabel("NUMBER_OF_SHIPS_TO_SEND"), DEFAULT_FLEET_SIZE);

        mainPanel.add(routePanel, BorderLayout.NORTH);
        mainPanel.add(numShips_, BorderLayout.CENTER);
        mainPanel.add(buttonsPanel, BorderLayout.SOUTH);
View Full Code Here

    @Override
    protected JComponent[] getControllerParamComponents() {

        GalacticOptions options = (GalacticOptions)controller_.getOptions();

        numPlanets_ =  new NumberInput( GameContext.getLabel("NUMBER_OF_PLANETS"), options.getNumPlanets(),
                                        GameContext.getLabel("NUMBER_OF_PLANETS_TIP"),
                                        Galaxy.MIN_NUM_PLANETS, Galaxy.MAX_NUM_PLANETS, true);
        planetProductionRate_ =
                new NumberInput(GameContext.getLabel("PLANETS_PRODUCTION_RATE"), options.getPlanetProductionRate(),
                                GameContext.getLabel("PLANETS_PRODUCTION_RATE_TIP"), 0, 10, true);
        initialFleetSize_ = new NumberInput(GameContext.getLabel("INITIAL_FLEET_SIZE"), options.getInitialFleetSize(),
                                            GameContext.getLabel("INITIAL_FLEET_SIZE_TIP"), 1, 100, true);
        neutralsBuild_ = new JCheckBox( GameContext.getLabel("SHOULD_NEUTRALS_BUILD"), options.doNeutralsBuild() );
        neutralsBuild_.setToolTipText(GameContext.getLabel("SHOULD_NEUTRALS_BUILD_TIP"));
        maxYearsToPlay_ =  new NumberInput(GameContext.getLabel("MAX_YEARS_TO_PLAY"), options.getMaxYearsToPlay(),
                                           GameContext.getLabel("MAX_YEARS_TO_PLAY_TIP"), 1, 100, true);

        initMultiControllerParamComponents(options);
        return new JComponent[] {
            numPlanets_, planetProductionRate_, initialFleetSize_, neutralsBuild_, maxYearsToPlay_,
View Full Code Here

    @Override
    protected JComponent[] getControllerParamComponents() {
        SetOptions options = (SetOptions) controller_.getOptions();

        initialNumCards_ =
                new NumberInput(GameContext.getLabel("INITIAL_NUM_CARDS"), options.getInitialNumCardsShown(),
                                GameContext.getLabel("INITIAL_NUM_CARDS_TIP"), 8, 81, true);

        initMultiControllerParamComponents(options);

        return new JComponent[] {initialNumCards_, maxNumPlayers_, numRobotPlayers_};
View Full Code Here

        return paramPanel;
    }

    private void initializeFields() {
        numStocksField_ =
                new NumberInput("Number of stocks in each sample (1 - 1000): ", StockSampleOptions.DEFAULT_NUM_STOCKS,
                        "The number of stocks in each trial. The average value of which will be one data point.",
                        1, 1000, true);
        numTimePeriodsField_ =
                new NumberInput("Number of time periods (1 - 1000): ", StockSampleOptions.DEFAULT_NUM_TIME_PERIODS,
                        "Number of time periods (for example months or years).",
                        1, 1000, true);
        percentIncreaseField_ =
                new NumberInput("Amount to increse each time period if heads (0 - 100): ",
                        100* StockSampleOptions.DEFAULT_PERCENT_INCREASE,
                        "Amount to increase after each time period if coin toss is heads.",
                        0, 100, true);
        percentDecreaseField_ =
                new NumberInput("Amount to decrese each time period if tails (0 - 100): ",
                        100* StockSampleOptions.DEFAULT_PERCENT_DECREASE,
                        "Amount to decrease after each time period if coin toss is tails.",
                        0, 100, true);
        startingValueField_ =
                new NumberInput("Starting stock value : ", StockSampleOptions.DEFAULT_STARTING_VALUE,
                        "Starting value of each stock in the sample (in dollars). For simplicity, they are all the same.",
                        1, 1000000, false);
        xResolutionField_ =
                new NumberInput("Resolution (1 - 5): ", StockSampleOptions.DEFAULT_X_RESOLUTION,
                        "1 is low resolution 5 is high (meaning more bins on the x axis).",
                        1, 5, true);
    }
View Full Code Here

    /** constructor */
    public TopControlPanel(MazeController controller) {

        this.controller = controller;
        thicknessField = new NumberInput("Thickness", PASSAGE_THICKNESS,
                                          "The passage thickness", 2, 200, true);
        animationSpeedField = new NumberInput("Speed", INITIAL_ANIMATION_SPEED,
                                               "The animation speed (large number is slow).", 1, 100, true);

        forwardProbField = new NumberInput("Forward", 0.34,
                                            "The probability of moving straight forward", 0, 1.0, false);
        leftProbField = new NumberInput("Left", 0.33,
                                         "The probability of moving left", 0, 1.0, false);
        rightProbField = new NumberInput("Right", 0.33,
                                          "The probability of moving right", 0, 1.0, false);

        add(thicknessField);
        add(animationSpeedField);
        add(forwardProbField);
View Full Code Here

    protected void initialize() {

        this.setLayout( new BoxLayout( this, BoxLayout.Y_AXIS ) );

        percentLessThanBestThreshField_ =
            new NumberInput(GameContext.getLabel("PERCENT_LESS_THAN_BEST_THRESH"), bestMovesOptions_.getPercentLessThanBestThresh(),
                            GameContext.getLabel("PERCENT_LESS_THAN_BEST_THRESH_TIP"), 0, 100, true);

        bestPercentageField_ =
                new NumberInput( GameContext.getLabel("PERCENTAGE_AT_PLY"), bestMovesOptions_.getPercentageBestMoves(),
                                 GameContext.getLabel("PERCENTAGE_AT_PLY_TIP"), 0, 100, true);
        minBestMovesField_ =
                new NumberInput( GameContext.getLabel("MIN_BEST_MOVES"), bestMovesOptions_.getMinBestMoves(),
                                 GameContext.getLabel("MIN_BEST_MOVES_TIP"), 1, 100, true);

        add( percentLessThanBestThreshField_ );
        add( bestPercentageField_ );
        add( minBestMovesField_ );
View Full Code Here

        setLayout( new BoxLayout( this, BoxLayout.Y_AXIS ) );

        // look ahead
        lookAheadField_ =
                new NumberInput(GameContext.getLabel("MOVES_TO_LOOKAHEAD"), bruteOptions_.getLookAhead(),
                                GameContext.getLabel("MOVES_TO_LOOKAHEAD_TIP"), 1, MAX_ALLOWED_LOOKAHEAD, true);

        this.add( lookAheadField_ );

        // alpha-beta pruning option
View Full Code Here

    protected void initialize() {

        setLayout( new BoxLayout( this, BoxLayout.Y_AXIS ) );

        maxSimulationsField_ =
            new NumberInput(GameContext.getLabel("MAX_NUM_SIMULATIONS"), monteCarloOptions_.getMaxSimulations(),
                            GameContext.getLabel("MAX_NUM_SIMULATIONS_TIP"), 1, ABS_MAX_NUM_SIMULATIONS, true);
        exploreExploitRatioField_ =
            new NumberInput(GameContext.getLabel("EXPLORE_EXPLOIT_RATIO"), monteCarloOptions_.getExploreExploitRatio(),
                            GameContext.getLabel("EXPLORE_EXPLOIT_RATIO_TIP"), 0, ABS_MAX_EE_RATIO, false);
        randomLookHeadField_ =
            new NumberInput(GameContext.getLabel("RANDOM_LOOK_AHEAD"), monteCarloOptions_.getRandomLookAhead(),
                            GameContext.getLabel("RANDOM_LOOK_AHEAD_TIP"), 1, 1000, true);
        add( maxSimulationsField_ );
        add( exploreExploitRatioField_ );
        add( randomLookHeadField_ );
    }
View Full Code Here

        super(parent, controller);
    }

    protected void initMultiControllerParamComponents(MultiGameOptions options) {
        maxNumPlayers_ =
            new NumberInput(GameContext.getLabel("MAX_NUM_PLAYERS"), options.getMaxNumPlayers(),
                            GameContext.getLabel("MAX_NUM_PLAYERS_TIP"), options.getMinNumPlayers(),
                            ABS_MAX_NUM_PLAYERS, true);
        maxNumPlayers_.addKeyListener(this);

        numRobotPlayers_ =
                new NumberInput(GameContext.getLabel("NUM_ROBOTS"), options.getNumRobotPlayers(),
                                GameContext.getLabel("NUM_ROBOTS_TIP"), 0, ABS_MAX_NUM_PLAYERS, true);
    }
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.