⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 daytextformatter.java

📁 It is all about project scheduling. GanttProject is a tool for creating a project schedule by means
💻 JAVA
字号:
package net.sourceforge.ganttproject.time.gregorian;import java.text.MessageFormat;import java.util.Date;import java.util.HashMap;import net.sourceforge.ganttproject.time.DateFrameable;import net.sourceforge.ganttproject.time.TextFormatter;import net.sourceforge.ganttproject.time.TimeUnit;import net.sourceforge.ganttproject.time.TimeUnitText;public class DayTextFormatter extends CachingTextFormatter implements TextFormatter {    /** cache for holding formatted day names * */    private final HashMap textCache = new HashMap();    protected TimeUnitText createTimeUnitText(Date adjustedLeft) {        return new TimeUnitText(MessageFormat.format("{0}", new Object[] { ""              + adjustedLeft.getDate() }));    }//    public TimeUnitText format(TimeUnit timeUnit, Date baseDate) {//        String result = null;//        if (timeUnit instanceof DateFrameable) {//            Date adjustedLeft = ((DateFrameable) timeUnit).adjustLeft(baseDate);//            result = (String) textCache.get(adjustedLeft);//            if (result == null) {//                result = MessageFormat.format("{0}", new Object[] { ""//                        + adjustedLeft.getDate() });//                textCache.put(adjustedLeft, result);//            }//        }//        return new TimeUnitText(result);//    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -