MiG InfoCom AB
here area a more thorough explanation.
A Decorator is a generic interface that encapsulates how to
paint something. A GridDecorator is a sub interface and
used to decorate things relative to a Grid. They have an
layerIndex that denotes how to order them is a repaint
cycle. Lower indexed decorators will be painted before higher
indexed ones, making higher indexed decorators appear on
top.
They can also interact with the user since the container of
them should offer all InputEvents (such as MouseEvents
and KeyEvents) to the decorators. Event notification stops if
a decorator consumes the event. If no decorator consumes it
it would normally mean that the container if the decorators
should process it. The code that processes the InputEvents
in the decorators should as always be very fast to not
introduce delays in the GUI.
For DefaultDateArea and AbstractDateHeaders
Currently decorators are use in these two classes and their
sub classes. DecoratorSupport is a class that handles
them and can be utilized should you choose to use them for
other purposes.
Examples of Decorators Included
The Decorator hierarchy is one of the more extensive
hierarchies in the MiG Calendar component. This is done to
minimize code duplication. For a UML diagram of this
structure see the MiG Calendar Technical Specification.
CellLabelDecorator – Draws labels in the cells of the
Grid.
DateSeparatorDecorator – Draws separator lines
between date boundaries in the grid. For instance dividing
months in a month view.
EvenFieldFillDecorator – To fill different backgrounds
for even/odd date ranges. For instance every other month
can have a yellowish background.
GridLineDecorator – Draws the grid lines in a Grid.
HeaderShapeGridDecorator – Draws the labels for
headers. Very flexible and can merge cells. Also manages
mouse over and press interactions.
ImageDecorator – A generic decorator to place images
somewhere on the Grid.
NoFitShapeDecorator – Paints a custom aligned AShape
in cells that had ActivityViews that couldn't fit.
MiG Calendar Getting Started Guide Page 29 / 31
Komentarze do niniejszej Instrukcji