MiG InfoCom MiG Calendar Getting Started Guide User Manual
Page 21
MiG InfoCom AB
GridLineDecorator glDecorator = new GridLineDecorator(dateArea, 60);
dateArea.addDecorator(glDecorator);
If you run it now the grid lines will show. 60 is the relative
layer in which this decorator will be painted. Lower layer will
be painted first and thus be overwritten by higher layers.
Notice that the default visible count and type is different from
the one provided by the default
CalendarTheme
. Here the
default is to show six weeks in a month-like view.
We didn't actually tell the decorator how the grid lines should
look like,
GridLineDecorator
will get that information
from the
DateGrid
object for every repaint.
Another important decorator is the
ActivityViewDecorator
. It is a special one since it's
actually a inner class of
DefaultDateArea
. It is so simply
because it has no meaning outside of that class and it need
access to it's members. It is not added by default (none
area) so we have to add it. The syntax for creating an inner
class may seem a bit strange. Here is how you add it:
AtFixed forcedSize = new AtFixed(16);
TimeBoundsLayout layout = new TimeBoundsLayout(
new AtFixed(2), new AtStart(2), new AtEnd(-2), 2,
MiG Calendar Getting Started Guide
Page 21 / 31
Illustration 11 With GridLineDecorator