Examples of Slider


Examples of com.vaadin.ui.Slider

        selectors.add(hsvGradient);

        VerticalLayout sliders = new VerticalLayout();
        sliders.setStyleName("hsv-sliders");

        hueSlider = new Slider("Hue", 0, 360);
        saturationSlider = new Slider("Saturation", 0, 100);
        valueSlider = new Slider("Value", 0, 100);

        float[] hsv = color.getHSV();
        setHsvSliderValues(hsv);

        hueSlider.setStyleName("hsv-slider");
View Full Code Here

Examples of fr.soleil.comete.swing.Slider

        stringPanel.add(textArea, BorderLayout.CENTER);
        stringPanel.add(fileBrowser, BorderLayout.NORTH);

        // number component
        Spinner spinner = new Spinner();
        Slider slider = new Slider();
        WheelSwitch wheelswitch = new WheelSwitch();

        // numberBox.connectWidget(spinner, stringKey);
        numberBox.connectWidget(spinner, numberKey);
        numberBox.connectWidget(slider, numberKey);
View Full Code Here

Examples of jaron.pde.Slider

    flightData.getThrottleOutput().addSignalListener(flightDataDisplay.createTextLine("Throttle"));
    flightData.getVerticalSpeed().addSignalListener(flightDataDisplay.createTextLine("Vert. speed [m/s]"));
    flightData.getYawAngularRate().addSignalListener(flightDataDisplay.createTextLine("Yaw rate [deg/sec]"));

    // Setup the sliders for the pitch PID gains
    pitchGainP = new Slider(this, "Pitch Gain-P", 40, 170);
    pitchGainP.setBandwidthY(0, 4);
    pitchGainP.setValue(PITCH_P);
    pitchGainI = new Slider(this, "Pitch Gain-I", 80, 170);
    pitchGainI.setBandwidthY(0, 2);
    pitchGainI.setValue(PITCH_I);
    pitchGainD = new Slider(this, "Pitch Gain-D", 120, 170);
    pitchGainD.setBandwidthY(0, 2);
    pitchGainD.setValue(PITCH_D);
    pitchMaxI = new Slider(this, "Pitch Max-I", 160, 170);
    pitchMaxI.setBandwidthY(0, 2);
    pitchMaxI.setValue(PITCH_M);
    pitchMinI = new Slider(this, "Pitch Min-I", 200, 170);
    pitchMinI.setBandwidthY(0, -2);
    pitchMinI.setValue(-PITCH_M);
    // Pitch PID to motion controller dependencies
    pitchMaxI.addSignalListener(motionController.getPitchMaxI());
    pitchMinI.addSignalListener(motionController.getPitchMinI());
    pitchGainP.addSignalListener(motionController.getPitchGainP());
    pitchGainI.addSignalListener(motionController.getPitchGainI());
    pitchGainD.addSignalListener(motionController.getPitchGainD());

    // Setup the sliders for the roll PID gains
    rollGainP = new Slider(this, "Roll Gain-P", 40, 300);
    rollGainP.setBandwidthY(0, 4);
    rollGainP.setValue(ROLL_P);
    rollGainI = new Slider(this, "Roll Gain-I", 80, 300);
    rollGainI.setBandwidthY(0, 2);
    rollGainI.setValue(ROLL_I);
    rollGainD = new Slider(this, "Roll Gain-D", 120, 300);
    rollGainD.setBandwidthY(0, 2);
    rollGainD.setValue(ROLL_D);
    rollMaxI = new Slider(this, "Roll Max-I", 160, 300);
    rollMaxI.setBandwidthY(0, 2);
    rollMaxI.setValue(ROLL_M);
    rollMinI = new Slider(this, "Roll Min-I", 200, 300);
    rollMinI.setBandwidthY(0, -2);
    rollMinI.setValue(-ROLL_M);
    // Roll PID to motion controller dependencies
    rollMaxI.addSignalListener(motionController.getRollMaxI());
    rollMinI.addSignalListener(motionController.getRollMinI());
    rollGainP.addSignalListener(motionController.getRollGainP());
    rollGainI.addSignalListener(motionController.getRollMinI());
    rollGainD.addSignalListener(motionController.getRollGainD());

    // Setup a graph to display the pitch angle and the elevator output
    String kLabelPitch = "Pitch angle";
    String kLabelElevator ="Elevator signal";
    graphPitch = new Graph(this, 250, 170, 150, 120);
    graphPitch.addGraph(kLabelPitch, Colors.BLACK);
    graphPitch.getSignal(kLabelPitch).setBandwidth(45, -45);
    graphPitch.addGraph(kLabelElevator, Colors.RED);
    // Connect the pitch graph to the flight data
    flightData.getPitchAngle().addSignalListener(graphPitch.getSignal(kLabelPitch));
    flightData.getElevatorOutput().addSignalListener(graphPitch.getSignal(kLabelElevator));

    // Setup a graph to display the roll angle and the aileron output
    String kLabelRoll = "Roll angle";
    String kLabelAileron ="Aileron signal";
    graphRoll = new Graph(this, 250, 300, 150, 120);
    graphRoll.addGraph(kLabelRoll, Colors.BLACK);
    graphRoll.getSignal(kLabelRoll).setBandwidth(-45, 45);
    graphRoll.addGraph(kLabelAileron, Colors.RED);
    // Connect the roll graph to the flight data
    flightData.getRollAngle().addSignalListener(graphRoll.getSignal(kLabelRoll));
    flightData.getAileronOutput().addSignalListener(graphRoll.getSignal(kLabelAileron));
   
    // Setup the sliders for the course PID gains
    courseGainP = new Slider(this, "Course Gain-P", 40, 430, 40, 120);
    courseGainP.setBandwidthY(0, 20);
    courseGainP.setValue(NAVIGATION_P);
    courseGainI = new Slider(this, "Course Gain-I", 80, 430, 40, 120);
    courseGainI.setBandwidthY(0, 5);
    courseGainI.setValue(NAVIGATION_I);
    courseGainD = new Slider(this, "Course Gain-D", 120, 430, 40, 120);
    courseGainD.setBandwidthY(0, 5);
    courseGainD.setValue(NAVIGATION_D);
    courseMaxI = new Slider(this, "Course Max-I", 160, 430);
    courseMaxI.setBandwidthY(0, 20);
    courseMaxI.setValue(NAVIGATION_M);
    courseMinI = new Slider(this, "Course Min-I", 200, 430, 40, 120);
    courseMinI.setBandwidthY(0, -20);
    courseMinI.setValue(-NAVIGATION_M);
    // Course PID to mission controller dependencies
    courseGainP.addListenerY(missionController.getCourseGainP());
    courseGainI.addListenerY(missionController.getCourseGainI());
View Full Code Here

Examples of javafx.scene.control.Slider

      }
      // personPA.bindBidirectional(path, lv.itemsProperty(),
      // (Class<T>) choices[0].getClass());
      ctrl = lv;
    } else if (controlType == Slider.class) {
      Slider sl = new Slider();
      sl.setShowTickLabels(true);
      sl.setShowTickMarks(true);
      sl.setMajorTickUnit(maxChars / 2);
      sl.setMinorTickCount(7);
      sl.setBlockIncrement(1);
      sl.setMax(maxChars + 1);
      sl.setSnapToTicks(true);
      // POJO binding magic...
      personPA.bindBidirectional(path, sl.valueProperty());
      ctrl = sl;
    } else if (controlType == PasswordField.class) {
      final PasswordField tf = new PasswordField() {
        @Override
        public void replaceText(int start, int end, String text) {
View Full Code Here

Examples of javafx.scene.control.Slider

        }
    };

    private void setShowTickMarks(boolean ticksVisible, boolean labelsVisible) {
        showTickMarks = (ticksVisible || labelsVisible);
        Slider slider = getSkinnable();
        if (showTickMarks) {
            if (tickLine == null) {
                tickLine = new NumberAxis();
                tickLine.setAutoRanging(false);
                tickLine.setSide(slider.getOrientation() == Orientation.VERTICAL ? Side.RIGHT : (slider.getOrientation() == null) ? Side.RIGHT: Side.BOTTOM);
                tickLine.setUpperBound(slider.getMax());
                tickLine.setLowerBound(slider.getMin());
                tickLine.setTickUnit(slider.getMajorTickUnit());
                tickLine.setTickMarkVisible(ticksVisible);
                tickLine.setTickLabelsVisible(labelsVisible);
                tickLine.setMinorTickVisible(ticksVisible);
                // add 1 to the slider minor tick count since the axis draws one
                // less minor ticks than the number given.
                tickLine.setMinorTickCount(Math.max(slider.getMinorTickCount(),0) + 1);
                if (slider.getLabelFormatter() != null) {
                    tickLine.setTickLabelFormatter(stringConverterWrapper);
                }
                getChildren().clear();
                getChildren().addAll(tickLine, track, fill, thumb);
            } else {
View Full Code Here

Examples of javafx.scene.control.Slider

        getSkinnable().requestLayout();
    }

    @Override protected void handleControlPropertyChanged(String p) {
        super.handleControlPropertyChanged(p);
        Slider slider = getSkinnable();
        if ("ORIENTATION".equals(p)) {
            if (showTickMarks && tickLine != null) {
                tickLine.setSide(slider.getOrientation() == Orientation.VERTICAL ? Side.RIGHT : (slider.getOrientation() == null) ? Side.RIGHT: Side.BOTTOM);
            }
            getSkinnable().requestLayout();
        } else if ("VALUE".equals(p)) {
            // only animate thumb if the track was clicked - not if the thumb is dragged
            positionThumb(trackClicked);
        } else if ("MIN".equals(p) ) {
            if (showTickMarks && tickLine != null) {
                tickLine.setLowerBound(slider.getMin());
            }
            getSkinnable().requestLayout();
        } else if ("MAX".equals(p)) {
            if (showTickMarks && tickLine != null) {
                tickLine.setUpperBound(slider.getMax());
            }
            getSkinnable().requestLayout();
        } else if ("SHOW_TICK_MARKS".equals(p) || "SHOW_TICK_LABELS".equals(p)) {
            setShowTickMarks(slider.isShowTickMarks(), slider.isShowTickLabels());
        else if ("MAJOR_TICK_UNIT".equals(p)) {
            if (tickLine != null) {
                tickLine.setTickUnit(slider.getMajorTickUnit());
                getSkinnable().requestLayout();
            }
        } else if ("MINOR_TICK_COUNT".equals(p)) {
            if (tickLine != null) {
                tickLine.setMinorTickCount(Math.max(slider.getMinorTickCount(),0) + 1);
                getSkinnable().requestLayout();
            }
        } else if ("TICK_LABEL_FORMATTER".equals(p)) {
            if (tickLine != null) {
                if (slider.getLabelFormatter() == null) {
                    tickLine.setTickLabelFormatter(null);
                } else {
                    tickLine.setTickLabelFormatter(stringConverterWrapper);
                    tickLine.requestAxisLayout();
                }
View Full Code Here

Examples of javafx.scene.control.Slider

    /**
     * Called when ever either min, max or value changes, so thumb's layoutX, Y is recomputed.
     */
    void positionThumb(final boolean animate) {
        Slider s = getSkinnable();
        if (s.getValue() > s.getMax()) return;// this can happen if we are bound to something
        boolean horizontal = s.getOrientation() == Orientation.HORIZONTAL;
        final double endX = (horizontal) ? trackStart + (((trackLength * ((s.getValue() - s.getMin()) /
                (s.getMax() - s.getMin()))) - thumbWidth/2)) : thumbLeft;
        final double endY = (horizontal) ? thumbTop :
                snappedTopInset() + trackLength - (trackLength * ((s.getValue() - s.getMin()) /
                        (s.getMax() - s.getMin()))); //  - thumbHeight/2

        if (animate) {
            // lets animate the thumb transition
            final double startX = thumb.getLayoutX();
            final double startY = thumb.getLayoutY();
View Full Code Here

Examples of javafx.scene.control.Slider

    double minTrackLength() {
        return 2*thumb.prefWidth(-1);
    }

    @Override protected double computeMinWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset) {
        final Slider s = getSkinnable();
        if (s.getOrientation() == Orientation.HORIZONTAL) {
            return (leftInset + minTrackLength() + thumb.minWidth(-1) + rightInset);
        } else {
            return(leftInset + thumb.prefWidth(-1) + rightInset);
        }
    }
View Full Code Here

Examples of javafx.scene.control.Slider

            return(leftInset + thumb.prefWidth(-1) + rightInset);
        }
    }

    @Override protected double computeMinHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset) {
        final Slider s = getSkinnable();
        if (s.getOrientation() == Orientation.HORIZONTAL) {
            return(topInset + thumb.prefHeight(-1) + bottomInset);
        } else {
            return(topInset + minTrackLength() + thumb.prefHeight(-1) + bottomInset);
        }
    }
View Full Code Here

Examples of javafx.scene.control.Slider

            return(topInset + minTrackLength() + thumb.prefHeight(-1) + bottomInset);
        }
    }

    @Override protected double computePrefWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset) {
        final Slider s = getSkinnable();
        if (s.getOrientation() == Orientation.HORIZONTAL) {
            if(showTickMarks) {
                return Math.max(140, tickLine.prefWidth(-1));
            } else {
                return 140;
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.