当前位置: 首页>>代码示例>>Java>>正文


Java Region.setMouseTransparent方法代码示例

本文整理汇总了Java中javafx.scene.layout.Region.setMouseTransparent方法的典型用法代码示例。如果您正苦于以下问题:Java Region.setMouseTransparent方法的具体用法?Java Region.setMouseTransparent怎么用?Java Region.setMouseTransparent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.scene.layout.Region的用法示例。


在下文中一共展示了Region.setMouseTransparent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: PrintablePageSkin

import javafx.scene.layout.Region; //导入方法依赖的package包/类
public PrintablePageSkin(PrintablePage control) {
    super(control);

    calendarOne.setShowTodayButton(false);
    calendarOne.setShowMonthArrows(false);
    calendarOne.setShowYearArrows(false);
    calendarOne.setShowWeekNumbers(false);
    calendarOne.setShowToday(false);
    calendarOne.weekFieldsProperty().bind(control.weekFieldsProperty());
    calendarOne.visibleProperty().bind(control.showMiniCalendarsProperty());
    calendarOne.dateProperty().bind(control.pageStartDateProperty());
    calendarOne.managedProperty().bind(calendarOne.visibleProperty());

    calendarTwo.setShowTodayButton(false);
    calendarTwo.setShowMonthArrows(false);
    calendarTwo.setShowYearArrows(false);
    calendarTwo.setShowWeekNumbers(false);
    calendarTwo.setShowToday(false);
    calendarTwo.weekFieldsProperty().bind(control.weekFieldsProperty());
    calendarTwo.dateProperty().bind(Bindings.createObjectBinding(() -> calendarOne.getDate().plusMonths(1), calendarOne.dateProperty()));
    calendarTwo.visibleProperty().bind(control.showMiniCalendarsProperty());
    calendarTwo.managedProperty().bind(calendarTwo.visibleProperty());

    SourceGridView sourceView = new SourceGridView();
    sourceView.visibleProperty().bind(control.showCalendarKeysProperty());
    sourceView.managedProperty().bind(sourceView.visibleProperty());
    sourceView.bind(control);

    PrintPagePeriodFormatter formatter = new PrintPagePeriodFormatter(control);
    Label periodLabel = new Label();
    periodLabel.textProperty().bind(formatter.textProperty());
    periodLabel.getStyleClass().add("period-label");

    VBox titleSection = new VBox();
    titleSection.getChildren().addAll(periodLabel, sourceView);
    titleSection.getStyleClass().add("title-section");

    HBox calendarsBox = new HBox(calendarOne, calendarTwo);
    calendarsBox.addEventFilter(MouseEvent.MOUSE_CLICKED, Event::consume);
    calendarsBox.getStyleClass().add("mini-calendars");

    BorderPane header = new BorderPane();
    header.setCenter(titleSection);
    header.setRight(calendarsBox);
    header.getStyleClass().add("header");

    BorderPane container = new BorderPane();
    container.setTop(header);
    container.centerProperty().bind(control.viewProperty());
    container.getStyleClass().add("container");
    getChildren().add(container);

    InvalidationListener selectedDatesListener = obs -> updateSelectedDates();
    control.pageStartDateProperty().addListener(selectedDatesListener);
    control.pageEndDateProperty().addListener(selectedDatesListener);
    updateSelectedDates();

    Region glassPane = new Region();
    glassPane.prefWidthProperty().bind(getSkinnable().widthProperty());
    glassPane.prefHeightProperty().bind(getSkinnable().heightProperty());
    glassPane.getStyleClass().add("glasspane");
    glassPane.setMouseTransparent(false);
    getChildren().add(glassPane);
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:65,代码来源:PrintablePageSkin.java

示例2: DayViewSkin

import javafx.scene.layout.Region; //导入方法依赖的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.layout.Region.setMouseTransparent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。