當前位置: 首頁>>代碼示例>>Java>>正文


Java Orientation.HORIZONTAL屬性代碼示例

本文整理匯總了Java中javafx.geometry.Orientation.HORIZONTAL屬性的典型用法代碼示例。如果您正苦於以下問題:Java Orientation.HORIZONTAL屬性的具體用法?Java Orientation.HORIZONTAL怎麽用?Java Orientation.HORIZONTAL使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在javafx.geometry.Orientation的用法示例。


在下文中一共展示了Orientation.HORIZONTAL屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createBottomXAxis

private Axis createBottomXAxis(final double MIN, final double MAX, final boolean AUTO_SCALE) {
    Axis axis = new Axis(Orientation.HORIZONTAL, Position.BOTTOM);
    axis.setMinValue(MIN);
    axis.setMaxValue(MAX);
    axis.setPrefHeight(AXIS_WIDTH);
    axis.setAutoScale(AUTO_SCALE);

    AnchorPane.setBottomAnchor(axis, 0d);
    AnchorPane.setLeftAnchor(axis, 25d);
    AnchorPane.setRightAnchor(axis, 25d);

    return axis;
}
 
開發者ID:HanSolo,項目名稱:charts,代碼行數:13,代碼來源:ChartTest.java

示例2: createControl

@Override
protected Node createControl() {
    RecurrenceView view = new RecurrenceView();

    Label label = new Label("Rule: " + view.getRecurrenceRule());
    label.setMaxWidth(300);
    label.setWrapText(true);

    view.recurrenceRuleProperty().addListener(it -> label.setText(view.getRecurrenceRule()));

    Separator separator = new Separator(Orientation.HORIZONTAL);

    VBox box = new VBox(20);
    box.setFillWidth(true);
    box.getChildren().addAll(view, separator, label);
    box.setAlignment(Pos.CENTER);

    return box;
}
 
開發者ID:dlemmermann,項目名稱:CalendarFX,代碼行數:19,代碼來源:HelloRecurrenceView.java

示例3: init

@Override public void init() {
    xAxisBottom = new Axis(-20, 20, Orientation.HORIZONTAL, Position.BOTTOM);
    xAxisBottom.setPrefHeight(20);
    AnchorPane.setLeftAnchor(xAxisBottom, 20d);
    AnchorPane.setRightAnchor(xAxisBottom, 20d);
    AnchorPane.setBottomAnchor(xAxisBottom, 0d);

    xAxisTop = new Axis(0, 100, Orientation.HORIZONTAL, Position.TOP);
    xAxisTop.setPrefHeight(20);
    AnchorPane.setLeftAnchor(xAxisTop, 20d);
    AnchorPane.setRightAnchor(xAxisTop, 20d);
    AnchorPane.setTopAnchor(xAxisTop, 0d);

    yAxisLeft = new Axis(-20, 20, Orientation.VERTICAL, Position.LEFT);
    yAxisLeft.setPrefWidth(20);
    AnchorPane.setLeftAnchor(yAxisLeft, 0d);
    AnchorPane.setTopAnchor(yAxisLeft, 20d);
    AnchorPane.setBottomAnchor(yAxisLeft, 20d);

    Converter tempConverter     = new Converter(TEMPERATURE, CELSIUS); // Type Temperature with BaseUnit Celsius
    double    tempFahrenheitMin = tempConverter.convert(-20, FAHRENHEIT);
    double    tempFahrenheitMax = tempConverter.convert(20, FAHRENHEIT);

    yAxisRight = new Axis(tempFahrenheitMin, tempFahrenheitMax, Orientation.VERTICAL, Position.RIGHT);
    yAxisRight.setPrefWidth(20);
    yAxisRight.setAutoScale(false);
    AnchorPane.setRightAnchor(yAxisRight, 0d);
    AnchorPane.setTopAnchor(yAxisRight, 20d);
    AnchorPane.setBottomAnchor(yAxisRight, 20d);
}
 
開發者ID:HanSolo,項目名稱:charts,代碼行數:30,代碼來源:AxisTest.java

示例4: createCenterXAxis

private Axis createCenterXAxis(final double MIN, final double MAX, final boolean AUTO_SCALE) {
    Axis axis = new Axis(Orientation.HORIZONTAL, Position.CENTER);
    axis.setMinValue(MIN);
    axis.setMaxValue(MAX);
    axis.setPrefHeight(AXIS_WIDTH);
    axis.setAutoScale(AUTO_SCALE);

    AnchorPane.setBottomAnchor(axis, axis.getZeroPosition());
    AnchorPane.setLeftAnchor(axis, 25d);
    AnchorPane.setRightAnchor(axis, 25d);

    return axis;
}
 
開發者ID:HanSolo,項目名稱:charts,代碼行數:13,代碼來源:ChartTest.java

示例5: getControlPanel

@Override
public Node getControlPanel() {
    VBox vBox = new VBox();
    vBox.setFillWidth(true);
    vBox.setSpacing(10);

    // button
    Button button = new Button("Create Entries");
    button.setMaxWidth(Double.MAX_VALUE);
    button.setOnAction(evt -> createEntries());
    VBox.setVgrow(button, Priority.NEVER);
    vBox.getChildren().add(button);

    // box
    comboBox = new ComboBox<>();
    comboBox.getItems().addAll(100, 1000, 2000, 3000, 10000, 100000, 1000000);
    comboBox.getSelectionModel().select(0);
    comboBox.setMaxWidth(Double.MAX_VALUE);
    vBox.getChildren().add(comboBox);

    // label
    label = new Label("Time: ");
    vBox.getChildren().add(label);

    // Separator
    Separator separator = new Separator(Orientation.HORIZONTAL);
    vBox.getChildren().add(separator);

    // sheet
    CalendarPropertySheet sheet = new CalendarPropertySheet(calendarView.getPropertySheetItems());
    VBox.setVgrow(sheet, Priority.ALWAYS);
    vBox.getChildren().add(sheet);

    return vBox;
}
 
開發者ID:dlemmermann,項目名稱:CalendarFX,代碼行數:35,代碼來源:HelloPerformance.java

示例6: createTopXAxis

private Axis createTopXAxis(final double MIN, final double MAX, final boolean AUTO_SCALE) {
    Axis axis = new Axis(Orientation.HORIZONTAL, Position.TOP);
    axis.setMinValue(MIN);
    axis.setMaxValue(MAX);
    axis.setPrefHeight(AXIS_WIDTH);
    axis.setAutoScale(AUTO_SCALE);

    AnchorPane.setTopAnchor(axis, 25d);
    AnchorPane.setLeftAnchor(axis, 25d);
    AnchorPane.setRightAnchor(axis, 25d);

    return axis;
}
 
開發者ID:HanSolo,項目名稱:charts,代碼行數:13,代碼來源:PlayfairTest.java

示例7: computePrefWidth

@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;
        }
    } else {
        return leftInset + Math.max(thumb.prefWidth(-1), track.prefWidth(-1)) +
                ((showTickMarks) ? (trackToTickGap + tickLine.prefWidth(-1)) : 0) + rightInset;
    }
}
 
開發者ID:thane98,項目名稱:FEFEditor,代碼行數:14,代碼來源:FilledSliderSkin.java

示例8: computePrefHeight

@Override
protected double computePrefHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset) {
    final Slider s = getSkinnable();
    if (s.getOrientation() == Orientation.HORIZONTAL) {
        return topInset + Math.max(thumb.prefHeight(-1), track.prefHeight(-1)) +
                ((showTickMarks) ? (trackToTickGap + tickLine.prefHeight(-1)) : 0) + bottomInset;
    } else {
        if (showTickMarks) {
            return Math.max(140, tickLine.prefHeight(-1));
        } else {
            return 140;
        }
    }
}
 
開發者ID:thane98,項目名稱:FEFEditor,代碼行數:14,代碼來源:FilledSliderSkin.java

示例9: init

@Override public void init() {
    xAxisBottom = new Axis(0, 1000, Orientation.HORIZONTAL, AxisType.LOGARITHMIC, Position.BOTTOM);
    xAxisBottom.setPrefHeight(20);
    AnchorPane.setLeftAnchor(xAxisBottom, 20d);
    AnchorPane.setRightAnchor(xAxisBottom, 20d);
    AnchorPane.setBottomAnchor(xAxisBottom, 0d);

    yAxisLeft = new Axis(0, 1000, Orientation.VERTICAL, AxisType.LOGARITHMIC, Position.LEFT);
    yAxisLeft.setPrefWidth(20);
    AnchorPane.setLeftAnchor(yAxisLeft, 0d);
    AnchorPane.setTopAnchor(yAxisLeft, 20d);
    AnchorPane.setBottomAnchor(yAxisLeft, 20d);
}
 
開發者ID:HanSolo,項目名稱:charts,代碼行數:13,代碼來源:LogAxisTest.java

示例10: mousePressedOnTrack

private void mousePressedOnTrack(MouseEvent mouseEvent)
{
    if (!thumb.isPressed()) {
        if (getSkinnable().getOrientation() == Orientation.HORIZONTAL) {
            getBehavior().trackPress(mouseEvent, (mouseEvent.getX() / trackLength));
        } else {
            getBehavior().trackPress(mouseEvent, (mouseEvent.getY() / trackLength));
        }
    }
}
 
開發者ID:thane98,項目名稱:3DSFE-Randomizer,代碼行數:10,代碼來源:FilledSliderSkin.java

示例11: mouseDraggedOnTrack

private void mouseDraggedOnTrack(MouseEvent mouseEvent)
{
    if (!thumb.isPressed()) {
        if (getSkinnable().getOrientation() == Orientation.HORIZONTAL) {
            getBehavior().trackPress(mouseEvent, (mouseEvent.getX() / trackLength));
        } else {
            getBehavior().trackPress(mouseEvent, (mouseEvent.getY() / trackLength));
        }
    }
}
 
開發者ID:thane98,項目名稱:3DSFE-Randomizer,代碼行數:10,代碼來源:FilledSliderSkin.java

示例12: positionThumb

/**
 * 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();
        Transition transition = new Transition() {
            {
                setCycleDuration(Duration.millis(200));
            }

            @Override protected void interpolate(double frac) {
                if (!Double.isNaN(startX)) {
                    thumb.setLayoutX(startX + frac * (endX - startX));
                }
                if (!Double.isNaN(startY)) {
                    thumb.setLayoutY(startY + frac * (endY - startY));
                }
            }
        };
        transition.play();
    } else {
        thumb.setLayoutX(endX);
        thumb.setLayoutY(endY);
    }
}
 
開發者ID:thane98,項目名稱:3DSFE-Randomizer,代碼行數:37,代碼來源:FilledSliderSkin.java

示例13: computeMinWidth

@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);
    }
}
 
開發者ID:thane98,項目名稱:3DSFE-Randomizer,代碼行數:8,代碼來源:FilledSliderSkin.java

示例14: createBottomXAxis

private Axis createBottomXAxis(final double MIN, final double MAX, final boolean AUTO_SCALE, final double AXIS_WIDTH) {
    Axis axis = new Axis(Orientation.HORIZONTAL, Position.BOTTOM);
    axis.setMinValue(MIN);
    axis.setMaxValue(MAX);
    axis.setPrefHeight(AXIS_WIDTH);
    axis.setAutoScale(AUTO_SCALE);

    AnchorPane.setBottomAnchor(axis, 0d);
    AnchorPane.setLeftAnchor(axis, AXIS_WIDTH);
    AnchorPane.setRightAnchor(axis, AXIS_WIDTH);

    return axis;
}
 
開發者ID:HanSolo,項目名稱:charts,代碼行數:13,代碼來源:LineChartTest.java

示例15: computePrefWidth

@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;
        }
    } else {
        return leftInset + Math.max(thumb.prefWidth(-1), track.prefWidth(-1)) +
                ((showTickMarks) ? (trackToTickGap+tickLine.prefWidth(-1)) : 0) + rightInset;
    }
}
 
開發者ID:thane98,項目名稱:3DSFE-Randomizer,代碼行數:13,代碼來源:FilledSliderSkin.java


注:本文中的javafx.geometry.Orientation.HORIZONTAL屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。