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


Java Circle.setMouseTransparent方法代碼示例

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


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

示例1: DayViewSkin

import javafx.scene.shape.Circle; //導入方法依賴的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

示例2: MonthEntryViewSkin

import javafx.scene.shape.Circle; //導入方法依賴的package包/類
public MonthEntryViewSkin(MonthEntryView view) {
    super(view);

    Entry<?> entry = view.getEntry();
    if (entry.isRecurrence()) {
        entry = entry.getRecurrenceSourceEntry();
    }

    Calendar calendar = entry.getCalendar();

    colorDot = new Circle();
    colorDot.setRadius(2.5);
    colorDot.setMouseTransparent(true);

    titleLabel = new Label();
    titleLabel.setGraphic(colorDot);
    titleLabel.setMinSize(0, 0);
    titleLabel.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
    titleLabel.setMouseTransparent(true);

    timeLabel = new Label();
    timeLabel.setMouseTransparent(true);
    timeLabel.setMaxHeight(Double.MAX_VALUE);
    timeLabel.setMouseTransparent(true);

    // update in these cases
    entry.titleProperty().addListener(weakUpdateViewListener);
    entry.fullDayProperty().addListener(weakUpdateViewListener);
    entry.intervalProperty().addListener(weakUpdateViewListener);
    entry.calendarProperty().addListener(weakUpdateViewListener);

    view.positionProperty().addListener(weakUpdateViewListener);

    if (calendar != null) {
        calendar.styleProperty().addListener(weakUpdateViewListener);
    }

    getChildren().addAll(titleLabel, timeLabel);

    updateView();
}
 
開發者ID:dlemmermann,項目名稱:CalendarFX,代碼行數:42,代碼來源:MonthEntryViewSkin.java

示例3: initialize

import javafx.scene.shape.Circle; //導入方法依賴的package包/類
@Override
public void initialize(URL location, ResourceBundle resources) {
    backgroundImageView.setMouseTransparent(true);

    movieList.setCellFactory(c -> new MovieListCell());
    movieList.setItems(model.getMovies());
    movieList.setCacheHint(CacheHint.SPEED);

    model.selectedMovieProperty().bind(movieList.getSelectionModel().selectedItemProperty());
    model.selectedMovieProperty().addListener((obs, oldVal, newVal) -> updateDetailArea());
    detailView.visibleProperty().bind(model.selectedMovieProperty().isNotNull());

    maximizeAppIconView.setOnMouseClicked(e -> ((Stage) rootPane.getScene().getWindow()).setFullScreen(!((Stage) rootPane.getScene().getWindow()).isFullScreen()));
    closeAppIconView.setOnMouseClicked(e -> rootPane.getScene().getWindow().hide());

    moviePosterWrapper.setRotationAxis(new Point3D(0, 1, 0));
    moviePosterWrapper.setCache(true);
    moviePosterWrapper.setCacheShape(true);
    moviePosterWrapper.setCacheHint(CacheHint.SPEED);
    posterImageView.setCache(true);
    posterImageView.setCacheHint(CacheHint.SPEED);

    Util.installWindowDragListener(rootPane);

    final ChangeListener backgroundImageResizeListener = (obs, oldVal, newVal) -> {
        final Image image = backgroundImageView.getImage();
        if (backgroundImageView.getImage() != null) {
            Dimension2D backgroundDimension = shouldFitIn(image.getWidth(), image.getHeight(), rootPane.getWidth(), rootPane.getHeight());
            backgroundImageView.setFitWidth(backgroundDimension.getWidth());
            backgroundImageView.setFitHeight(backgroundDimension.getHeight());
        }
    };
    rootPane.widthProperty().addListener(backgroundImageResizeListener);
    rootPane.heightProperty().addListener(backgroundImageResizeListener);
    backgroundImageView.imageProperty().addListener(backgroundImageResizeListener);

    addFeatureSupport();

    updateDetailArea();


    watchTrailerButton.setOnAction(e -> playTrailer());
    mediaView.fitWidthProperty().bind(rootPane.widthProperty().subtract(64.0));

    mediaStateIcon = new AnimatedIcon();
    mediaStateIcon.setOpacity(0.6);
    mediaStateIcon.setScaleX(4.0);
    mediaStateIcon.setScaleY(4.0);
    mediaStateIcon.setMouseTransparent(true);
    mediaStateIcon.toPause();

    Circle circle = new Circle();
    circle.setMouseTransparent(true);
    circle.setRadius(76);
    circle.setStroke(Color.ORANGE);
    circle.setStrokeWidth(8);
    circle.setOpacity(0.6);

    StackPane mediaControl = new StackPane(circle, mediaStateIcon);
    mediaControl.setMouseTransparent(true);
    mediaControl.setMinWidth(USE_PREF_SIZE);
    mediaControl.setMinHeight(USE_PREF_SIZE);
    mediaControl.setMaxWidth(USE_PREF_SIZE);
    mediaControl.setMaxHeight(USE_PREF_SIZE);
    mediaControl.setVisible(false);

    mediaPane.getChildren().addAll(mediaControl);

    //TODO: Animation
    mediaView.setOnMouseEntered(e -> mediaControl.setVisible(true));
    mediaView.setOnMouseExited(e -> mediaControl.setVisible(false));

    movieList.getSelectionModel().select(0);

    rootPane.setOnKeyPressed(evt -> {
        if (evt.getCode().equals(KeyCode.ESCAPE)) {
            stopTrailer();
        }
    });
}
 
開發者ID:hendrikebbers,項目名稱:ExtremeGuiMakeover,代碼行數:81,代碼來源:MasterDetailViewController.java


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