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


Java Bindings.bindContentBidirectional方法代碼示例

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


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

示例1: RecurrencePopup

import javafx.beans.binding.Bindings; //導入方法依賴的package包/類
public RecurrencePopup() {
    getStyleClass().add(DEFAULT_STYLE);

    root = new StackPane();
    root.getStylesheets().add(CalendarView.class.getResource("calendar.css").toExternalForm());

    recurrenceView = new RecurrenceView();
    recurrenceView.setShowSummary(false);

    Bindings.bindContentBidirectional(root.getStyleClass(), getStyleClass());

    setAutoFix(true);
    setAutoHide(true);
}
 
開發者ID:dlemmermann,項目名稱:CalendarFX,代碼行數:15,代碼來源:RecurrencePopup.java

示例2: PrintablePage

import javafx.beans.binding.Bindings; //導入方法依賴的package包/類
public PrintablePage() {
    getStyleClass().add(DEFAULT_STYLE);

    addEventFilter(KeyEvent.ANY, Event::consume);

    setFocusTraversable(false);

    // day view
    detailedDayView = new DetailedDayView();
    detailedDayView.setShowScrollBar(false);
    detailedDayView.setShowToday(false);
    detailedDayView.setEnableCurrentTimeMarker(false);
    detailedDayView.weekFieldsProperty().bind(weekFieldsProperty());
    detailedDayView.showAllDayViewProperty().bind(showAllDayEntriesProperty());
    detailedDayView.showAgendaViewProperty().bind(showEntryDetailsProperty());
    detailedDayView.layoutProperty().bind(layoutProperty());
    detailedDayView.getDayView().setStartTime(LocalTime.MIN);
    detailedDayView.getDayView().setEndTime(LocalTime.MAX);
    detailedDayView.getDayView().setEarlyLateHoursStrategy(DayViewBase.EarlyLateHoursStrategy.HIDE);
    detailedDayView.getDayView().setHoursLayoutStrategy(DayViewBase.HoursLayoutStrategy.FIXED_HOUR_COUNT);
    detailedDayView.getDayView().setVisibleHours(24);
    detailedDayView.dateProperty().bind(pageStartDateProperty());
    detailedDayView.addEventFilter(MouseEvent.ANY, weakMouseHandler);
    detailedDayView.getDayView().setTrimTimeBounds(true);

    Bindings.bindContent(detailedDayView.getCalendarSources(), getCalendarSources());
    Bindings.bindContent(detailedDayView.getCalendarVisibilityMap(), getCalendarVisibilityMap());

    // week view
    detailedWeekView = new DetailedWeekView();
    detailedWeekView.setShowScrollBar(false);
    detailedWeekView.getWeekView().setShowToday(false);
    detailedWeekView.layoutProperty().bind(layoutProperty());
    detailedWeekView.setEnableCurrentTimeMarker(false);
    detailedWeekView.showAllDayViewProperty().bind(showAllDayEntriesProperty());
    detailedWeekView.weekFieldsProperty().bind(weekFieldsProperty());
    detailedWeekView.setStartTime(LocalTime.MIN);
    detailedWeekView.setEndTime(LocalTime.MAX);
    detailedWeekView.setEarlyLateHoursStrategy(DayViewBase.EarlyLateHoursStrategy.HIDE);
    detailedWeekView.setHoursLayoutStrategy(DayViewBase.HoursLayoutStrategy.FIXED_HOUR_COUNT);
    detailedWeekView.setVisibleHours(24);
    detailedWeekView.addEventFilter(MouseEvent.ANY, weakMouseHandler);
    detailedWeekView.dateProperty().bind(pageStartDateProperty());
    detailedWeekView.getWeekView().setTrimTimeBounds(true);

    Bindings.bindContent(detailedWeekView.getCalendarSources(), getCalendarSources());
    Bindings.bindContent(detailedWeekView.getCalendarVisibilityMap(), getCalendarVisibilityMap());

    // month view
    monthView = new MonthView();
    monthView.setShowToday(false);
    monthView.setShowCurrentWeek(false);
    monthView.weekFieldsProperty().bind(weekFieldsProperty());
    monthView.showFullDayEntriesProperty().bind(showAllDayEntriesProperty());
    monthView.showTimedEntriesProperty().bind(showTimedEntriesProperty());
    monthView.addEventFilter(MouseEvent.ANY, weakMouseHandler);
    monthView.dateProperty().bind(pageStartDateProperty());

    Bindings.bindContent(monthView.getCalendarSources(), getCalendarSources());
    Bindings.bindContentBidirectional(monthView.getCalendarVisibilityMap(), getCalendarVisibilityMap());

    updateView();
    updateDimension();

    paperProperty().addListener(obs -> updateDimension());
    viewTypeProperty().addListener(obs -> updateView());

    periodSplitter = new PrintPeriodSplitter(this);
}
 
開發者ID:dlemmermann,項目名稱:CalendarFX,代碼行數:70,代碼來源:PrintablePage.java

示例3: bind

import javafx.beans.binding.Bindings; //導入方法依賴的package包/類
public final void bind(DateControl dateControl) {
    Bindings.bindContentBidirectional(calendars, dateControl.getCalendars());
    Bindings.bindContentBidirectional(calendarVisibilityMap, dateControl.getCalendarVisibilityMap());
}
 
開發者ID:dlemmermann,項目名稱:CalendarFX,代碼行數:5,代碼來源:CalendarHeaderView.java

示例4: bind

import javafx.beans.binding.Bindings; //導入方法依賴的package包/類
/**
 * Binds several properties of the given date control to the same properties
 * of this control. This kind of binding is needed to create UIs with nested
 * date controls. The {@link CalendarView} for example consists of several
 * pages. Each page is a date control that consists of several other date
 * controls. The {@link DayPage} consists of the {@link AgendaView}, a
 * single {@link DayView}, and a {@link YearMonthView} . All of these
 * controls are bound to each other so that the application can simply
 * change properties on the {@link CalendarView} without worrying about the
 * nested controls.
 *
 * @param otherControl the control that will be bound to this control
 * @param bindDate     determines if the date property will also be bound
 */
public final void bind(DateControl otherControl, boolean bindDate) {
    requireNonNull(otherControl);

    boundDateControls.add(otherControl);

    // bind maps
    Bindings.bindContentBidirectional(otherControl.getCalendarVisibilityMap(), getCalendarVisibilityMap());

    // bind lists
    Bindings.bindContentBidirectional(otherControl.getCalendarSources(), getCalendarSources());
    Bindings.bindContentBidirectional(otherControl.getSelections(), getSelections());
    Bindings.bindContentBidirectional(otherControl.getWeekendDays(), getWeekendDays());

    // bind properties
    Bindings.bindBidirectional(otherControl.suspendUpdatesProperty(), suspendUpdatesProperty());
    Bindings.bindBidirectional(otherControl.entryFactoryProperty(), entryFactoryProperty());
    Bindings.bindBidirectional(otherControl.defaultCalendarProviderProperty(), defaultCalendarProviderProperty());
    Bindings.bindBidirectional(otherControl.virtualGridProperty(), virtualGridProperty());
    Bindings.bindBidirectional(otherControl.draggedEntryProperty(), draggedEntryProperty());
    Bindings.bindBidirectional(otherControl.requestedTimeProperty(), requestedTimeProperty());

    Bindings.bindBidirectional(otherControl.selectionModeProperty(), selectionModeProperty());
    Bindings.bindBidirectional(otherControl.selectionModeProperty(), selectionModeProperty());
    Bindings.bindBidirectional(otherControl.weekFieldsProperty(), weekFieldsProperty());
    Bindings.bindBidirectional(otherControl.layoutProperty(), layoutProperty());

    Bindings.bindBidirectional(otherControl.startTimeProperty(), startTimeProperty());
    Bindings.bindBidirectional(otherControl.endTimeProperty(), endTimeProperty());
    Bindings.bindBidirectional(otherControl.timeProperty(), timeProperty());
    Bindings.bindBidirectional(otherControl.usagePolicyProperty(), usagePolicyProperty());

    if (bindDate) {
        Bindings.bindBidirectional(otherControl.dateProperty(), dateProperty());
    }

    Bindings.bindBidirectional(otherControl.todayProperty(), todayProperty());
    Bindings.bindBidirectional(otherControl.zoneIdProperty(), zoneIdProperty());

    // edit callbacks
    Bindings.bindBidirectional(otherControl.entryDetailsCallbackProperty(), entryDetailsCallbackProperty());
    Bindings.bindBidirectional(otherControl.dateDetailsCallbackProperty(), dateDetailsCallbackProperty());
    Bindings.bindBidirectional(otherControl.contextMenuCallbackProperty(), contextMenuCallbackProperty());
    Bindings.bindBidirectional(otherControl.entryContextMenuCallbackProperty(), entryContextMenuCallbackProperty());
    Bindings.bindBidirectional(otherControl.calendarSourceFactoryProperty(), calendarSourceFactoryProperty());
    Bindings.bindBidirectional(otherControl.entryDetailsPopOverContentCallbackProperty(), entryDetailsPopOverContentCallbackProperty());
    Bindings.bindBidirectional(otherControl.entryEditPolicyProperty(), entryEditPolicyProperty());
}
 
開發者ID:dlemmermann,項目名稱:CalendarFX,代碼行數:62,代碼來源:DateControl.java

示例5: bind

import javafx.beans.binding.Bindings; //導入方法依賴的package包/類
public final void bind(DateControl dateControl) {
    Bindings.bindContentBidirectional(calendarSources, dateControl.getCalendarSources());
    Bindings.bindContentBidirectional(calendarVisibilityMap, dateControl.getCalendarVisibilityMap());
}
 
開發者ID:dlemmermann,項目名稱:CalendarFX,代碼行數:5,代碼來源:SourceView.java

示例6: GoogleCalendarAppViewSkin

import javafx.beans.binding.Bindings; //導入方法依賴的package包/類
public GoogleCalendarAppViewSkin(GoogleCalendarAppView control) {
    super(control);

    calendarView = control.getCalendarView();
    dataManager = new GoogleCalendarDataManager();
    cookieManager = new CookieManager();
    syncManager = new GoogleSyncManager();
    searchProvider = new GoogleCalendarSearchTextManager(dataManager);

    CalendarViewTimeUpdateThread timeUpdateThread = new CalendarViewTimeUpdateThread(calendarView);
    GoogleAutoRefreshThread autoRefreshThread = new GoogleAutoRefreshThread(dataManager);
    GoogleNotificationPopupThread notificationThread = new GoogleNotificationPopupThread(calendarView);

    loginView = new WebView();
    loginView.setVisible(false);
    loginView.getEngine().titleProperty().addListener((obs, oldValue, newValue) -> {
        if (newValue != null && newValue.contains("Success code=")) {
            String code = newValue.split("code=")[1];
            if (SecurityService.getInstance().authorize(code)) {
                login();
            }
        }
    });

    Bindings.bindContentBidirectional(control.getLogPane().getItems(), GoogleTaskExecutor.getInstance().getLog());

    StatusBar statusBar = new StatusBar();
    statusBar.textProperty().bind(Bindings.when(GoogleTaskExecutor.getInstance().progressProperty().isEqualTo(0)).then("").otherwise("Loading..."));
    statusBar.progressProperty().bind(GoogleTaskExecutor.getInstance().progressProperty());

    calendarView.addEventFilter(LoadEvent.LOAD, dataManager);
    calendarView.setEntryFactory(new GoogleEntryCreateCallback());
    calendarView.setCalendarSourceFactory(new GoogleCalendarCreateCallback(control.getScene().getWindow()));
    calendarView.setEntryDetailsPopOverContentCallback(new GoogleEntryPopOverContentProvider());

    calendarPane = new BorderPane();
    calendarPane.setTop(createMenuBar(autoRefreshThread));
    calendarPane.setCenter(calendarView);
    calendarPane.setBottom(statusBar);

    DeveloperConsole developerConsole = calendarView.getDeveloperConsole();
    if (developerConsole != null) {
        developerConsole.getTabPane().getTabs().add(new Tab("Google", control.getLogPane()));
    }

    getChildren().add(new StackPane(loginView, calendarPane));
    CookieHandler.setDefault(cookieManager);

    timeUpdateThread.start();
    autoRefreshThread.start();
    notificationThread.start();

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


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