当前位置: 首页>>代码示例>>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;未经允许,请勿转载。