CalendarView.java 文件源码

java
阅读 34 收藏 0 点赞 0 评论 0

项目:JProCalendarFX 作者:
/**
   * Constructs a new uk.co.senapt.desktop.ui.modules.calendar view.
   */
  public CalendarView() {
      getStyleClass().add(DEFAULT_STYLE_CLASS);

      this.dayPage = new DayPage();

      bind(dayPage, true);

      this.sourceView = new SourceView();
      this.searchResultView = new SearchResultView();
      this.yearMonthView = new YearMonthView();

      if (Boolean.getBoolean("calendarfx.developer")) { //$NON-NLS-1$
          this.developerConsole = new DeveloperConsole();
          this.developerConsole.setDateControl(this);
      }

      selectedPage.set(dayPage);

/*
       * We do have a user agent stylesheet, but it doesn't seem to work
 * properly when run as a standalone jar file.
 */
      getStylesheets().add(com.calendarfx.view.CalendarView.class.getResource("calendar.css").toExternalForm()); //$NON-NLS-1$

/*
       * We are "abusing" the properties map to pass new values of read-only
 * properties from the skin to the control.
 */
      getProperties().addListener((Change<?, ?> change) -> {
          if (change.getKey().equals(SELECTED_PAGE)) {
              if (change.getValueAdded() != null) {
                  PageBase page = (PageBase) change.getValueAdded();
                  selectedPage.set(page);
                  getProperties().remove(SELECTED_PAGE);
              }
          }
      });

      dayPage.hiddenProperty().addListener(fixSelectedPageListener);
      dayPage.setDayPageLayout(DayPageLayout.DAY_ONLY);
      fixSelectedPage();

      setTraysAnimated(false);

      getYearMonthView().setShowWeekNumbers(false);
  }
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号