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


Java Line.setManaged方法代碼示例

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


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

示例1: snapshotNode

import javafx.scene.shape.Line; //導入方法依賴的package包/類
private void snapshotNode(Scene scene, Node node) {
    SnapshotParameters params = new SnapshotParameters();
    Bounds layoutBounds = node.getLayoutBounds();
    Bounds bounds = node.localToScene(layoutBounds);

    if (!(bounds.getWidth() > 0 && bounds.getHeight() > 0)) {
        return;
    }

    params.setViewport(new Rectangle2D(bounds.getMinX(), bounds.getMinY(), bounds.getWidth(), bounds.getHeight()));
    WritableImage writable = new WritableImage((int) bounds.getWidth(), (int) bounds.getHeight());
    writable = scene.getRoot().snapshot(params, writable);

    ImageView imageView = new ImageView(writable);
    imageView.getStyleClass().add("snapshot-image");
    imageView.setManaged(false);
    imageView.setLayoutX(bounds.getMinX());
    imageView.setLayoutY(bounds.getMinY());
    imageView.setFitWidth(bounds.getWidth());
    imageView.setFitHeight(bounds.getHeight());

    Region rect = new Region();
    rect.getStyleClass().add("snapshot-background");
    rect.setLayoutX(bounds.getMinX() - 5);
    rect.setLayoutY(bounds.getMinY() - 5);
    rect.resize(bounds.getWidth() + 10, bounds.getHeight() + 10);
    rect.setManaged(false);

    Line line = new Line();
    line.setStartX(bounds.getMaxX() + 4);
    line.setStartY(bounds.getMaxY() + 4);
    line.setEndX(bounds.getMaxX() + 200);
    line.setEndY(bounds.getMaxY() + 200);
    line.setStroke(imagePattern);
    line.setStrokeWidth(5);
    line.setManaged(false);

    getChildren().addAll(rect, imageView); //, line);
}
 
開發者ID:dlemmermann,項目名稱:CalendarFX,代碼行數:40,代碼來源:IntroPaneSkin.java

示例2: createLine

import javafx.scene.shape.Line; //導入方法依賴的package包/類
private void createLine(String styleClass) {
    Line line = new Line();
    line.setManaged(false);
    line.getStyleClass().add(styleClass);
    line.setMouseTransparent(true);
    lines.add(line);
    getChildren().add(line);
}
 
開發者ID:dlemmermann,項目名稱:CalendarFX,代碼行數:9,代碼來源:DayViewSkin.java

示例3: AnimatedIcon

import javafx.scene.shape.Line; //導入方法依賴的package包/類
public AnimatedIcon() {
    iconFill = new SimpleObjectProperty<>(Color.ORANGE);

    line1 = new Line(4, 8, 28, 8);
    line1.setStrokeWidth(3);
    line1.strokeProperty().bind(iconFill);
    line1.setManaged(false);
    line1.setStrokeLineCap(StrokeLineCap.ROUND);

    line2 = new Line(4, 16, 28, 16);
    line2.setStrokeWidth(3);
    line2.strokeProperty().bind(iconFill);
    line2.setManaged(false);
    line2.setStrokeLineCap(StrokeLineCap.ROUND);

    line3 = new Line(4, 24, 28, 24);
    line3.setStrokeWidth(3);
    line3.strokeProperty().bind(iconFill);
    line3.setManaged(false);
    line3.setStrokeLineCap(StrokeLineCap.ROUND);

    getChildren().addAll(line1, line2, line3);
    setPrefWidth(32);
    setPrefHeight(32);
    setMinWidth(USE_PREF_SIZE);
    setMinHeight(USE_PREF_SIZE);
    setMaxWidth(USE_PREF_SIZE);
    setMaxHeight(USE_PREF_SIZE);
}
 
開發者ID:hendrikebbers,項目名稱:ExtremeGuiMakeover,代碼行數:30,代碼來源:AnimatedIcon.java

示例4: DayViewSkin

import javafx.scene.shape.Line; //導入方法依賴的package包/類
public DayViewSkin(T view) {
    super(view);

    earlyHoursRegion = new Region();
    earlyHoursRegion.setMouseTransparent(true);
    earlyHoursRegion.getStyleClass().add("early-hours-region"); //$NON-NLS-1$
    earlyHoursRegion.setManaged(false);
    getChildren().add(earlyHoursRegion);

    lateHoursRegion = new Region();
    lateHoursRegion.setMouseTransparent(true);
    lateHoursRegion.getStyleClass().add("late-hours-region"); //$NON-NLS-1$
    lateHoursRegion.setManaged(false);
    getChildren().add(lateHoursRegion);

    for (int i = 1; i < 24; i++) {
        createLine("half-hour-line"); //$NON-NLS-1$
        createLine("full-hour-line"); //$NON-NLS-1$
    }

    createLine("half-hour-line"); //$NON-NLS-1$

    currentTimeCircle = new Circle(4);
    currentTimeCircle.getStyleClass().add("current-time-circle"); //$NON-NLS-1$
    currentTimeCircle.setManaged(false);
    currentTimeCircle.setMouseTransparent(true);
    currentTimeCircle.setOpacity(0);
    currentTimeCircle.visibleProperty().bind(view.enableCurrentTimeMarkerProperty());
    getChildren().add(currentTimeCircle);

    currentTimeLine = new Line();
    currentTimeLine.getStyleClass().add("current-time-line"); //$NON-NLS-1$
    currentTimeLine.setManaged(false);
    currentTimeLine.setMouseTransparent(true);
    currentTimeLine.setOpacity(0);
    currentTimeLine.visibleProperty().bind(view.enableCurrentTimeMarkerProperty());
    getChildren().add(currentTimeLine);

    if (!(this instanceof WeekDayViewSkin)) {
        /*
         * Dragging inside week day views will be handled by a drag controller
         * installed on the week view, not on the individual days.
         */
        new DayViewEditController(view);
    }

    setupCurrentTimeMarkerSupport();

    view.draggedEntryProperty().addListener(it -> addOrRemoveDraggedEntryView());

    view.showCurrentTimeMarkerProperty().addListener(it -> updateTimelineVisibility());
    view.showCurrentTimeTodayMarkerProperty().addListener(it -> updateTimelineVisibility());

    view.layoutProperty().addListener(it -> view.requestLayout());

    updateShowMarkers();
    updateTimelineVisibility();

    view.dateProperty().addListener(it -> {
        if (displayedDate == null || !displayedDate.equals(view.getDate())) {
            loadData("date changed");
        }
    });

    view.suspendUpdatesProperty().addListener(evt -> loadData("suspend updates was set to false"));
    view.getCalendars().addListener((javafx.beans.Observable obs) -> loadData("list of calendars changed"));

    updateLineStyling();

    final InvalidationListener styleLinesListener = it -> updateLineStyling();
    view.startTimeProperty().addListener(styleLinesListener);
    view.endTimeProperty().addListener(styleLinesListener);
    view.earlyLateHoursStrategyProperty().addListener(styleLinesListener);

    loadData("initial data loading");
}
 
開發者ID:dlemmermann,項目名稱:CalendarFX,代碼行數:77,代碼來源:DayViewSkin.java


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