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.
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.
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); }
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.
Should ViewTool hide the coordinate system biased approach like VanishingClient currently does?
RESOLVED: Not. Learning the coordinate system approach is crucial for view development. Though, coordinate system should be easy to use.
How cells should be placed through ViewTool?
RESOLVED: The drawing box, cell, its 2D coordinates, depth and scale could be passed to ViewTool's place. It will return an appropriate coordinate system for placing vob self by VobScene's put().
int placeCS(Box box, Cell cell, float x, float y, float depth, float scale);
How connections should be created through ViewTool?
How rasters could be used through ViewTool?
Should basic views be rewritten using ViewTool?
Is ViewTool only obvious shortcuts to add inside VobCoorder or VobScene?