PEG loom_viewtool--humppake: ViewTool

Author: Asko Soukka
Author: Benja Fallenstein
Date-created:2002-12-10
Last-Modified:2003-04-25
Revision: 1.2
Status: Incomplete
Scope:Minor
Type:Feature

This PEG is about creating a ViewTool. The ViewTool would offer easy-to-use interface for prototyping new views - and lowering the treshold of starting development of new view.

Motivation

Yes, I (humppake) believe that the view interface in GZZ 0.8 is much more flexible than the on in 0.6. Although, I worked on 0.8 for weeks, and I still had problems with our coordinate system biased approach for drawing. It's good, but feels too abstract at first sight, since you are used handle only one coordinate system at time.

I think there should be easy-to-use interface for prototyping new views. Something with you can start directly by putting some vobs into the space and see the results without needing to think about optimal view spesific coordinate systems first.

Current VanishingClient

In view gzz.view.VobVanishingClient has been done a lot of work for abstracting some of the general things that view must do - and thus, made them easier to do.

/** An interface abstracting some things away from the vanishing view.
 */
public interface VanishingClient {
    final int CENTER = 1;

    Object getVobSize(Cell c, float fract, int flags, Dimension into);
    void place(Cell c, Object o, float fract, int x0, int y0, int x1, int y1,
                int depth, float rot);

    /** There should be a connection between the given cells.
     * If one of the cells hasn't yet been placed, this means that 
     * a stub in that direction should be drawn.
     */
    void connect(Cell c1, Cell c2, int dx, int dy);
}
View BFRaster PlainVanishing VobVanishingClient VanishingClient View BFRaster PlainVanishing VobVanishingClient VanishingClient vanishingview

Describing shortly (this will be replaced with sequence diagram): VobVanishingClient implements both the View and VanishingClient interface. When its render() is called, it will call PlainVanishing, where the views placing logic is handled. PlainVanishing will then use VanishingClient's abstracted interface for placing cells.

Issues

Changes

This is currently in its very beginning.

View View umltool

Finally basic views should rewrite using ViewTool.