Theme editor – gui for themes – MiG InfoCom MiG Calendar Tutorial User Manual

Page 22

Advertising
background image

MiG InfoCom AB

Key's can be linked to other keys, and even chained. This means
that there can be one edit point for many related properties, say
colors for week days.

Default values for every key, or key hierarchy, are mandatory.
Though they can be

null

.

Keys can contain a ordered list of values. The values in the list can
have constraints, rather than the list object itself, which would be
the case for just using a

ArrayList

as the value.

All value change can optionally be validated (default) against the
key's capabilities (constraints). This means that an erratic value
can never end up in the

Theme

.

Both default values and capabilities (constraints) can be set
recursively on a key branch. This decreases the verboseness and
increases correctness when building themes.

Themes can be listened on for changes to keys using the normal
Java

xxxListener

pattern.

Loading and saving (serializing and deserializing) themes are
supported directly by the theme and is very simple.

Multiple themes, even of different types, can be loaded
simultaneously and are handled by the

Themes

class. They are

indexed with a context

String

as the key and are accessible

from the whole JVM since the

Themes

class is a Singleton.

For more information on themes, including how to build you own
and/or extend the CalendarTheme see the javadocs for

Theme

.

Theme Editor – GUI for Themes

The Theme Editor is a GUI application for editing themes. All
information needed to edit the theme is included in the theme class.
Theme properties are serialized to XML for storage in a file or
database. The

Theme

class implementation, e.g.

CalendarTheme

,

needs to be in the classpath for the Theme Editor to be able to edit it.
This is because the default values and key capabilities (i.e.
constraints) of the theme is not saved in the XML properties file, but is
located in the actual

xxxTheme

class.

The Theme Editor can edit any type of value that it recognizes. The
most common value types already have an associated editor, but it is
very easy to write your own, you only subclass

AbstractPropertyEditor

and registers it to the editor. You can

MiG Calendar Tutorial

Page 22 / 24

Advertising