Package com.barrybecker4.ui.sliders

Examples of com.barrybecker4.ui.sliders.SliderProperties


        return p;
    }

    protected void addDebugLevel(JPanel p) {
        dbgLevelField_ =
                new NumberInput( GameContext.getLabel("DEBUG_LEVEL"), GameContext.getDebugMode(),
                                 GameContext.getLabel("DEBUG_LEVEL_TIP"), 0, 3, true);
        p.add( dbgLevelField_ );
    }
View Full Code Here


        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

        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

        Point pos = getPosition(position, cellSize, pieceSize, margin);
        Ellipse2D circle = new Ellipse2D.Float( pos.x, pos.y, pieceSize + 1, pieceSize + 1 );
        int hlOffset = (int) (pieceSize / 2.3 + 0.5)//spec highlight offset
        Color c = getPieceColor(planet);

        RoundGradientPaint rgp = new RoundGradientPaint(
                pos.x + hlOffset, pos.y + hlOffset, Color.white, SPEC_HIGHLIGHT_RADIUS, c );

        g2.setPaint( rgp );
        g2.fill( circle );
View Full Code Here

        SliderProperties[] props = new SliderProperties[1];

        String creatureName = creaturePop_.getName();

        props[0] = new SliderProperties(creatureName + BIRTH_RATE_LABEL,
                1.9, creaturePop_.getMaxBirthRate(), creaturePop_.getInitialBirthRate(), 1000.0);

        return props;
    }
View Full Code Here

    private SliderProperties[] createSliderProperties() {

        SliderProperties[] sliderProps;
        sliderProps = new SliderProperties[] {
                //                                      MIN   MAX    INITIAL    SCALE
                new SliderProperties(VISCOSITY_SLIDER, 0.0, 0.1, GridUpdater.DEFAULT_VISCOSITY, 100),
                new SliderProperties(B0_SLIDER, 1.0, 2.0, GridUpdater.DEFAULT_B0, 100),
                new SliderProperties(TIMESTEP_SLIDER, 0.001, 0.4, 0.01, 1000)};
         return sliderProps;
    }
View Full Code Here

    private SliderProperties[] createSliderProperties() {
        LocomotionParameters params = new LocomotionParameters();
        SliderProperties[] sliderProps;
        sliderProps = new SliderProperties[]{
                //                                     MIN  MAX   INITIAL   SCALE
                new SliderProperties(DIRECTION_SLIDER, -1.0, 1.0, params.getDirection(), 100),
                new SliderProperties(WAVE_SPEED_SLIDER, 0.0001, 0.1, params.getWaveSpeed(), 1000),
                new SliderProperties(WAVE_AMPLITUDE_SLIDER, 0.000, 0.3, params.getWaveAmplitude(), 100),
                new SliderProperties(WAVE_PERIOD_SLIDER, .5, 5.0, params.getWavePeriod(), 100),
                new SliderProperties(MASS_SCALE_SLIDER, 0.1, 6.0, params.getMassScale(), 100),
                new SliderProperties(SPRING_CONST_SLIDER, 0.1, 4.0, params.getSpringK(), 100),
                new SliderProperties(SPRING_DAMPING_SLIDER, 0.1, 4.0, params.getSpringDamping(), 100),
                new SliderProperties(SCALE_SLIDER, 0.2, 2.0, snakeSim_.getScale(), 100),
                new SliderProperties(TIMESTEP_SLIDER, 0.001, 0.5, SnakeSimulator.INITIAL_TIME_STEP, 1000)};
         return sliderProps;
    }
View Full Code Here

    private SliderProperties[] createSliderProperties()  {

        SliderProperties[] props = new SliderProperties[3];

        String creatureName = creaturePop_.getName();
        props[0] = new SliderProperties(creatureName + POPULATION_LABEL,
                0, 2000, creaturePop_.getInitialPopulation());
        props[1] = new SliderProperties(creatureName + BIRTH_RATE_LABEL,
                0, creaturePop_.getMaxBirthRate(), creaturePop_.getInitialBirthRate(), 1000);
        props[2] = new SliderProperties(creatureName + DEATH_RATE_LABEL,
                0, creaturePop_.getMaxDeathRate(), creaturePop_.getInitialDeathRate(), 1000.0);

        return props;
    }
View Full Code Here

        String creatureName = type.getName();
        setBackground(type.getColor());

        double size = type.getSize();
        props[0] = new SliderProperties(creatureName + SIZE_LABEL,
                                        MIN_FACTOR * size, MAX_FACTOR * size, size, 200);
        int gestation = type.getGestationPeriod();
        props[1] = new SliderProperties(creatureName + GESTATION_LABEL,
                                        1, (int)(MAX_FACTOR * gestation), gestation);
        int starveTime = type.getStarvationThreshold();
        props[2] = new SliderProperties(creatureName + STARVATION_LABEL,
                                       (int)(MIN_FACTOR * starveTime), (int)(MAX_FACTOR * starveTime), starveTime);
        int nutrition = type.getNutritionalValue();
        props[3] = new SliderProperties(creatureName + NUTRITION_LABEL,
                                         1, (int)(MAX_FACTOR * nutrition), nutrition);
        if (normSpeed > 0) {
            props[4] = new SliderProperties(creatureName + NORM_SPEED_LABEL,
                                             0, MAX_FACTOR * normSpeed, normSpeed, 1000.0);
            double maxSpeed = type.getMaxSpeed();
            props[5] = new SliderProperties(creatureName + MAX_SPEED_LABEL,
                                             0, MAX_FACTOR * maxSpeed, maxSpeed, 1000.0);
        }
        return props;
    }
View Full Code Here

TOP

Related Classes of com.barrybecker4.ui.sliders.SliderProperties

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.