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


Java JXMonthView.DAYS_IN_WEEK属性代码示例

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


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

示例1: updateLocale

/**
 * Updates internal state according to monthView's locale. Revalidates the
 * monthView if the boolean parameter is true.
 * 
 * @param revalidate a boolean indicating whether the monthView should be 
 * revalidated after the change.
 */
protected void updateLocale(boolean revalidate) {
    Locale locale = monthView.getLocale();
    if (getRenderingHandler() != null) {
        getRenderingHandler().setLocale(locale);
    }

    // fixed JW: respect property in UIManager if available
    // PENDING JW: what to do if weekdays had been set
    // with JXMonthView method? how to detect?
    daysOfTheWeek = (String[]) UIManager.get("JXMonthView.daysOfTheWeek");

    if (daysOfTheWeek == null) {
        daysOfTheWeek = new String[7];
        String[] dateFormatSymbols = DateFormatSymbols.getInstance(locale)
                .getShortWeekdays();
        daysOfTheWeek = new String[JXMonthView.DAYS_IN_WEEK];
        for (int i = Calendar.SUNDAY; i <= Calendar.SATURDAY; i++) {
            daysOfTheWeek[i - 1] = dateFormatSymbols[i];
        }
    }
    if (revalidate) {
        monthView.invalidate();
        monthView.validate();
    }
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:32,代码来源:BasicMonthViewUI.java

示例2: updateLocale

/**
 * Updates internal state according to monthView's locale. Revalidates the
 * monthView if the boolean parameter is true.
 * 
 * @param revalidate a boolean indicating whether the monthView should be 
 * revalidated after the change.
 */
protected void updateLocale(boolean revalidate) {
    Locale locale = monthView.getLocale();
    if (renderingHandler != null) {
        renderingHandler.setLocale(locale);
    }
    monthsOfTheYear = new DateFormatSymbols(locale).getMonths();

    // fixed JW: respect property in UIManager if available
    // PENDING JW: what to do if weekdays had been set
    // with JXMonthView method? how to detect?
    daysOfTheWeek = (String[]) UIManager.get("JXMonthView.daysOfTheWeek");

    if (daysOfTheWeek == null) {
        daysOfTheWeek = new String[7];
        String[] dateFormatSymbols = new DateFormatSymbols(locale)
                .getShortWeekdays();
        daysOfTheWeek = new String[JXMonthView.DAYS_IN_WEEK];
        for (int i = Calendar.SUNDAY; i <= Calendar.SATURDAY; i++) {
            daysOfTheWeek[i - 1] = dateFormatSymbols[i];
        }
    }
    if (revalidate) {
        monthView.invalidate();
        monthView.validate();
    }
}
 
开发者ID:sing-group,项目名称:aibench-project,代码行数:33,代码来源:BasicMonthViewUI.java


注:本文中的org.jdesktop.swingx.JXMonthView.DAYS_IN_WEEK属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。