gzz-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gzz] [Gzz-commits] gzz/gzz/view LinebrokenCellContentView.java (fwd


From: Benja Fallenstein
Subject: Re: [Gzz] [Gzz-commits] gzz/gzz/view LinebrokenCellContentView.java (fwd)
Date: Fri, 10 Jan 2003 21:37:21 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021226 Debian/1.2.1-9

Tuomas Lukka wrote:
I believe that just giving the color to each vob is really straight-forward.


Yes, straightforward, but HORRIBLY CLUTTERY! I don't want every low-level
Vob that draws something to have a color parameter!

As for performance of low-level vobs, I think the most usual case is to have 3 to 6 different colors used for different kinds of vobs, e.g. the lighter and the two darker colors in a 3d rectangle/bevel, the background color for a cell, the default text color, and the window's background color. Example:

    scene.setColor(white)
    scene.map.put(background, boxCs)
    scene.setColor(lightGrey)
    scene.map.put(upperLine, boxCs)
    scene.map.put(leftLine, boxCs)
    scene.setColor(darkGrey)
    scene.map.put(rightLine, boxCs)
    scene.map.put(lowerLine, boxCs)
    scene.setColor(darkerGrey)
    scene.map.put(rightLine2, boxCs)
    scene.map.put(lowerLine2, boxCs)
    scene.setColor(black)
    scene.map.put(text, boxCs)

    (repeat for next cell)

If we have more than one 'foreground color,' we will need to change the AWT/GL state multiple times per cell anyway. (If this takes too long to be done for every vob, the drawing code can remember the last color and change AWT/GL state only if the current vob's color != the last color.)

As for simplicity of code, I believe things get easier if the views don't have to worry about color for things like borders and cell backgrounds because it will be stored in the vob. I believe that the stateful interface would make *some* sense if we could say:

    scene.fg = red
    subView.renderLotsOfThings()
    scene.fg = black

but we can't because we need multiple colors *in each cell* (or button or menu item or whatever).

If we could do

    scene.cellBorderColor = black
    scene.defaultTextColor = red
    scene.cellBgColor = white
    scene.windowBgColor = lightBlue

things would start to make sense, but that would not be in tune with any efficiency arguments.

- Benja





reply via email to

[Prev in Thread] Current Thread [Next in Thread]