PEG vob_colorable--humppake: Abstract Colorable Vob

Author: Asko Soukka
Stakeholders:Benja Fallenstein, Tuomas Lukka
Date-created:2003-03-05
Last-Modified:2003-03-24
Revision: 1.8
Status: Current
Scope:Trivial
Type:Feature

This PEG proposes creating AbstractColorableVob class, which implements a new ColorableVob interface also defined by this PEG.

ColorableVob is a very basic vob type, which enhances the regular Vob with interface for placing multiple solid colors on its background. The multiple solid colors are used a lot in basic views i.e. to show cursor location and node properties. In the current implementations multiple solid colors are shown as parallel vertical stripes or sectors.

This PEG replaces the older PEG for Abstract Background Vob.

This PEG is depends on replacing current abstract class Vob with interface Vob and abstract class AbstractVob, which implements the first one.

Issues

Changes

The Java classes public interface ColorableVob and public abstract class AbstractColorableVob should be created after the following diagram:

peg.gen.html#abstractcolorablevob abstractcolorablevob

The following background vobs should be modified to inherit AbstractColorableVob:

  • gzz.vob.vobs.RectBgVob
  • gzz.vob.vobs.OvalBgVob

Cell Views and Node Views will be broken (and hast to be fixed) after this change, since background vobs' addColor interface will be removed to make vobs immutable.

The recommended way to fix Views is to store all needed vob prototypes as class attributes when instantiating the class at the first time. When a multi-colored version of any prototype (whose class implements Colorable) is needed, it will be created by passing colors to prototype's cloning method:

ColorableVob cloneColored(Color[] colors);