1 41 42 package org.jfree.chart; 43 44 import java.awt.Color ; 45 import java.awt.Font ; 46 import java.awt.Paint ; 47 import java.text.DateFormat ; 48 import java.util.Date ; 49 import java.util.Locale ; 50 51 64 public class DateTitle extends TextTitle { 65 66 73 public DateTitle() { 74 75 this(DateFormat.LONG); 76 77 } 78 79 88 public DateTitle(int style) { 89 this(style, Locale.getDefault(), 90 new Font ("Dialog", Font.PLAIN, 12), Color.black); 91 } 92 93 106 public DateTitle(int style, Locale locale, Font font, Paint paint) { 107 108 this(style, locale, font, paint, 109 AbstractTitle.BOTTOM, 110 AbstractTitle.RIGHT, 111 AbstractTitle.MIDDLE, 112 AbstractTitle.DEFAULT_SPACER); 113 } 114 115 134 public DateTitle(int style, Locale locale, Font font, Paint paint, 135 int position, int horizontalAlignment, int verticalAlignment, 136 Spacer spacer) { 137 138 super(DateFormat.getDateInstance(style, locale).format(new Date ()), 139 font, paint, 140 position, horizontalAlignment, verticalAlignment, 141 spacer); 142 143 } 144 145 156 public void setDateFormat(int style, Locale locale) { 157 158 setText(DateFormat.getDateInstance(style, locale).format(new Date ())); 159 160 } 161 162 } 163 | Popular Tags |