beautypg.com

MiG InfoCom MiG Calendar Getting Started Guide User Manual

Page 16

background image

MiG InfoCom AB

Let's say that we want odd grid lines to be a bit brighter

since they only show 30 min boundaries.
Grid lines are repetition specifications evaluated in the order

they exist in the property list stored under the key:

String primGLKey = CalendarTheme.KEY_GRID_GRIDLINES_ + “PrimaryDim#”;

Default there is a

GridLineRepetition

that says: 'start at

grid line 0 and accept every grid line, setting color to gray

and width to 1'.
We can leave that repetition be and insert a new repetition

that goes something like: 'start at index 1 and accept every

second grid line, setting color to light gray and width to 1'.

Since this repetition is before the default one it is evaluated

first. It will only specify a 'hit' on odd grid lines though,

making them light gray. All other grid lines will be caught by

the second, default, rule making all other grid lines darker

gray.
You can easily insert repetitions that just changes a single

grid line, for instance the first or last or around lunch or

whatever. You can even reference them from the last grid line

making them very flexible to work with even if you don't

know beforehand how many you have. You could even say

that the middle 15% of the grid lines should be five pixels

wide and painted yellow..
Here are some code that make odd grid lines lighter a lighter

gray:

String glKey = CalendarTheme.KEY_GRID_GRIDLINES_ + “PrimaryDim#”;
GridLineRepetition glRep = new GridLineRepetition(1, 2, 1, new Color(245, 245, 245));
theme.addToList(glKey, 0, glRep); // add at index 0 to make first key in the list

MiG Calendar Getting Started Guide

Page 16 / 31