[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gzz] PEG Colorable Vob
From: |
Tuomas Lukka |
Subject: |
Re: [Gzz] PEG Colorable Vob |
Date: |
Wed, 12 Mar 2003 12:27:04 +0200 |
User-agent: |
Mutt/1.4i |
On Wed, Mar 12, 2003 at 11:58:43AM +0200, Asko Soukka wrote:
> Tue, 11 Mar 2003, Asko Soukka wrote:
> > And finally an example how using this would look in BoxCellView:
> ...
> > /** If multiple colors found, clone multi-colored version
> > * of default vob. Otherwise use default vob as it is.
> > */
> > final ColorableVob bg;
> > if (vobColors.size() > 0) {
> > Color[] colors = (Color[]) vobColors.toArray(new Color[1]);
> > bg = (ColorableVob)defaultBg.cloneColored(colors);
> > } else bg = defaultBg;
>
> Should Colorable.cloneColored() return itself, if attribute colors is
> empty or null? It would make the previous example cleaner - no ifs would
> be needed anymore:
>
> Color[] colors = (Color[]) vobColors.toArray(new Color[1]);
> bg = (ColorableVob)defaultBg.cloneColored(colors);
Absolutely not.
It should return itself, if
1) parameter colors is empty or null
***AND***
2) its own colors are empty or null.
It is *allowed* to return itself also, if parameter colors == its own colors,
but not obligated to compare the lists.
Tuomas