MiG InfoCom MiG Calendar InfoCom AB User Manual

Page 5

Advertising
background image

© 2007 MiG InfoCom AB

When you deploy you should use migcalendar.jar. It is smaller and still
contain all classes needed.

The Theme Editor, component API and the JavaBean properties all
mention the concept of Repetition. How does it work?
Repetition is a way to express which instances of something belong to
what index. For instance if you have two Colors that should be used to
draw every second or every third grid line you need this kind of flexible
system.

Basically it's an ordered list of objects that each contains information
about what indexes (e.g. rows or columns) it should “hit”. These objects
are then asked by the framework one at a time if a row index is a hit. The
first object in that list that accepts that index is chosen. The framework
then starts at the top of the object to get the which object applies to the
next index, and so on.

The class DefaultRepetion or one of its more specific sub classes is
normally used for this and it supports an offset and modulo integer to
denote for instance “every third index, starting with number two” or
“every fifth, starting with zero”. It also contains an optional minimum and
maximum index to accept.

Using these DefaultRepetion objects you can thus form complex patters
like “OOOOOXOOOXOOOXOOOXOOOOOOOOOO” or
“XOXOXOXOXXXXXXOXOXOXOX” without hard coding it.

This technique is very handy when you want to specify otherwise hard to
specify statements like: “Every even grid line should be black and every
odd grid line should be gray. Except the first five and last five which
should be light gray”. For a finite and known number of grid lines this can
be quite simple without a Repetition approach, but if the grid line count is
flexible or not known at design time you need a powerful algorithm like
this.

The Repetition approach is used in quite a few places in the component
even though you normally don't have to use the class directly. You might
be using one of it's more specific sub classes or be configuring it visually in
the Theme Editor or through a JavaBean property editor. Nevertheless it is
very important to understand how it works.

Can you run the Theme Editor with another AShape? I'd like to
test it with my custom created one.
Yes. Here are the command line switches for the Theme Editor:

ThemeEditor [theme filename] [-s DemoShapeFilename] [-e
PropertyEditorFactoryClass] [-e PropertyEditorFactoryClass]

Advertising