1 | monthlyDateAreaBean↵ | | 1 | monthlyDateAreaBean↵
|
2 | .setPrimaryDimensionLayout(monthlyVerticalGridDimensionLayout);↵ | | 2 | .setPrimaryDimensionLayout(monthlyVerticalGridDimensionLayout);↵
|
3 | monthlyDateAreaBean↵ | | 3 | monthlyDateAreaBean↵
|
4 | .setSecondaryDimensionLayout(monthlyHorizontalGridDimensionLayout);↵ | | 4 | .setSecondaryDimensionLayout(monthlyHorizontalGridDimensionLayout);↵
|
|
5 | ((DateGridHeader) monthlyWestDateHeaderBean.getHeader())↵ | | 5 | ((DateGridHeader) monthlyWestDateHeaderBean.getHeader())↵
|
6 | .setGridLineSpecification(new GridLineSpecification(↵ | | 6 | .setGridLineSpecification(new GridLineSpecification(↵
|
7 | new DefaultGridLineProvider(new GridLineRepetition[] {↵ | | 7 | new DefaultGridLineProvider(new GridLineRepetition[] {↵
|
8 | // horizontal light gray column separator line↵ | | 8 | // horizontal light gray column separator line↵
|
9 | new GridLineRepetition(0, 1, new AtStart(0f),↵ | | 9 | new GridLineRepetition(0, 1, new AtStart(0f),↵
|
10 | null, 1, lightGrayColor,↵ | | 10 | null, 1, lightGrayColor,↵
|
11 | new AtStart(3f), new AtEnd(-3f))↵ | | 11 | new AtStart(3f), new AtEnd(-3f))↵
|
|
12 | }), null↵ | | 12 | }), null↵
|
|
13 | ));↵ | | 13 | ));↵
|
14 | ((DateGridHeader) monthlyNorthDateHeaderBean.getHeader())↵ | | 14 | ((DateGridHeader) monthlyNorthDateHeaderBean.getHeader())↵
|
15 | .setGridLineSpecification(new GridLineSpecification(↵ | | 15 | .setGridLineSpecification(new GridLineSpecification(↵
|
16 | new DefaultGridLineProvider(new GridLineRepetition[] {↵ | | 16 | new DefaultGridLineProvider(new GridLineRepetition[] {↵
|
17 | // vertical light gray column separator line↵ | | 17 | // vertical light gray column separator line↵
|
18 | new GridLineRepetition(0, 1, new AtStart(0f),↵ | | 18 | new GridLineRepetition(0, 1, new AtStart(0f),↵
|
19 | null, 1, lightGrayColor,↵ | | 19 | null, 1, lightGrayColor,↵
|
20 | new AtStart(3f), new AtEnd(-3f))↵ | | 20 | new AtStart(3f), new AtEnd(-3f))↵
|
|
21 | }), null↵ | | 21 | }), null↵
|
|
22 | ));↵ | | 22 | ));↵
|
23 | // date area grid line↵ | | 23 | // date area grid line↵
|
24 | monthlyDateAreaBean.getDateArea().setGridLineSpecProvider(↵ | | 24 | monthlyDateAreaBean.getDateArea().setGridLineSpecProvider(↵
|
25 | new GridLineSpecProvider() {↵ | | 25 | new GridLineSpecProvider() {↵
|
26 | public GridLineSpecification createSpecification(↵ | | 26 | public GridLineSpecification createSpecification(↵
|
27 | DateArea dateArea) {↵ | | 27 | DateArea dateArea) {↵
|
28 | return new GridLineSpecification(↵ | | 28 | return new GridLineSpecification(↵
|
29 | // horizontal grid lines↵ | | 29 | // horizontal grid lines↵
|
30 | new DefaultGridLineProvider(↵ | | 30 | new DefaultGridLineProvider(↵
|
31 | new GridLineRepetition[] {↵ | | 31 | new GridLineRepetition[] {↵
|
32 | // dark gray line at 12 and 13↵ | | 32 | // dark gray line at 12 and 13↵
|
33 | new GridLineRepetition(0, 1,↵ | | 33 | new GridLineRepetition(0, 1,↵
|
34 | new AtStart(0.1f), new AtEnd(↵ | | 34 | new AtStart(0.1f), new AtEnd(↵
|
35 | -1f), 1, lightGrayColor) }),↵ | | 35 | -1f), 1, lightGrayColor) }),↵
|
36 | // vertical grid lines↵ | | 36 | // vertical grid lines↵
|
37 | new DefaultGridLineProvider(↵ | | 37 | new DefaultGridLineProvider(↵
|
38 | new GridLineRepetition[] {↵ | | 38 | new GridLineRepetition[] {↵
|
39 | // light gray line every day↵ | | 39 | // light gray line every day↵
|
40 | new GridLineRepetition(0, 1, null,↵ | | 40 | new GridLineRepetition(0, 1, null,↵
|
41 | null, 1, lightGrayColor) }),// vertical↵ | | 41 | null, 1, lightGrayColor) }),// vertical↵
|
42 | // grid↵ | | 42 | // grid↵
|
43 | // lines↵ | | 43 | // lines↵
|
44 | new DefaultGridLineProvider(↵ | | 44 | new DefaultGridLineProvider(↵
|
45 | new GridLineRepetition[] {↵ | | 45 | new GridLineRepetition[] {↵
|
46 | // light gray line every day↵ | | 46 | // light gray line every day↵
|
47 | new GridLineRepetition(0, 1,↵ | | 47 | new GridLineRepetition(0, 1,↵
|
48 | new AtStart(1f),↵ | | 48 | new AtStart(1f),↵
|
49 | new AtEnd(-2f), 1,↵ | | 49 | new AtEnd(-2f), 1,↵
|
50 | lightGrayColor) }));↵ | | 50 | lightGrayColor) }));↵
|
51 | }↵ | | 51 | }↵
|
52 | });↵ | | 52 | });↵
|
|
53 | monthlyDateAreaBean.setPrimaryDimension(SwingConstants.HORIZONTAL);↵ | | 53 | monthlyDateAreaBean.setPrimaryDimension(SwingConstants.HORIZONTAL);↵
|
54 | monthlyDateAreaBean↵ | | 54 | monthlyDateAreaBean↵
|
55 | .setPrimaryDimensionCellType(DateRangeI.RANGE_TYPE_DAY);↵ | | 55 | .setPrimaryDimensionCellType(DateRangeI.RANGE_TYPE_DAY);↵
|
56 | monthlyDateAreaBean.setPrimaryDimensionCellTypeCount(1);↵ | | 56 | monthlyDateAreaBean.setPrimaryDimensionCellTypeCount(1);↵
|
57 | monthlyDateAreaBean.setWrapBoundary(DateRangeI.RANGE_TYPE_WEEK);↵ | | 57 | monthlyDateAreaBean.setWrapBoundary(DateRangeI.RANGE_TYPE_WEEK);↵
|
|
58 | DefaultDateArea dateArea = monthlyDateAreaBean.getDateArea();↵ | | 58 | DefaultDateArea dateArea = monthlyDateAreaBean.getDateArea();↵
|
59 | dateArea.setActivitiesSupported(true);↵ | | 59 | dateArea.setActivitiesSupported(false);↵
|
|
60 | // select current day↵ | | 60 | // select current day↵
|
61 | monthlyDateAreaBean.getDateArea()↵ | | 61 | monthlyDateAreaBean.getDateArea()↵
|
62 | .addDecorator(↵ | | 62 | .addDecorator(↵
|
63 | new AbstractGridDecorator(monthlyDateAreaBean↵ | | 63 | new AbstractGridDecorator(monthlyDateAreaBean↵
|
64 | .getDateArea(), 20) {↵ | | 64 | .getDateArea(), 20) {↵
|
65 | public void doPaint(Graphics2D g2, Rectangle bounds) {↵ | | 65 | public void doPaint(Graphics2D g2, Rectangle bounds) {↵
|
66 | DateGrid dateGrid = (DateGrid) getGrid();↵ | | 66 | DateGrid dateGrid = (DateGrid) getGrid();↵
|
|
67 | DateRangeI dr = new DateRange(System↵ | | 67 | DateRangeI dr = new DateRange(System↵
|
68 | .currentTimeMillis(),↵ | | 68 | .currentTimeMillis(),↵
|
69 | DateRangeI.RANGE_TYPE_DAY, 1, null,↵ | | 69 | DateRangeI.RANGE_TYPE_DAY, 1, null,↵
|
70 | null);↵ | | 70 | null);↵
|
71 | Rectangle[] rects = dateGrid↵ | | 71 | Rectangle[] rects = dateGrid↵
|
72 | .getBoundsForDateRange(dr,↵ | | 72 | .getBoundsForDateRange(dr,↵
|
73 | Grid.SIZE_MODE_INSIDE);↵ | | 73 | Grid.SIZE_MODE_INSIDE);↵
|
|
74 | g2.setColor(new Color(250, 250, 250));↵ | | 74 | g2.setColor(new Color(250, 250, 250));↵
|
75 | for (int i = 0; i < rects.length; i++)↵ | | 75 | for (int i = 0; i < rects.length; i++)↵
|
76 | g2.fill(rects[i]);↵ | | 76 | g2.fill(rects[i]);↵
|
77 | }↵ | | 77 | }↵
|
|
78 | public void gridChanged(PropertyChangeEvent e) {↵ | | 78 | public void gridChanged(PropertyChangeEvent e) {↵
|
79 | }↵ | | 79 | }↵
|
|
80 | public void dispose() {↵ | | 80 | public void dispose() {↵
|
81 | }↵ | | 81 | }↵
|
82 | });↵ | | 82 | });↵
|
|
83 | final DateFormat defaultFormat = new SimpleDateFormat("MMMM dd"); | | 83 | final DateFormat defaultFormat = new SimpleDateFormat("MMMM dd");
|