From: Andrea A. <aa...@li...> - 2003-05-23 19:08:12
|
Hi everybody, I'd like to share by thougths on this subject too... I've read the logs, and of course Cameron's mail. And I feel the need to have a better understanding... So, here are my thoughts (and questions...) Since we need to support various input devices, and we also need to consider that even standard gui have different ways of providing "event" that the map control need to process, there should be at least: a) an event source manager: something that processes the real inputs, whatever they are, and converts them to a standard intermediate command; b) an command processor: something that processes the intermediate command and does the real work. Part a) is device dependent, and does not need uniform interfaces. The uniform part is all in b). Now, different devices will have different way to simulate mouse events and provide commands. Let's consider a real action: a user drags a zoom window. The widget should respond by drawing the current selected window until the user releases the mouse. This informations should be provided by means on PointTriggers, isn't it? Which also mean that PointTriggers work with device coordinates, not geographical ones. The MapPane accept the PointTrigger and forwards it to every active Tool, which may or may not trigger some Action. Now, there are a couple of things that I probably don't understand in Cameron list: in the same list we find MouseEvents and PointTriggers, but they are at a different leve: a MouseEvent is triggered by the standard Swing event handling mechanism thru the MapPane widget, should be handled outside it by a MouseEventProcessor, I guess, which issues PointTriggers, which are passed back to the MapPane thru a processPointTrigger method (or some other name), which forwards them to the active Tools, and so on... right? Or not? Or is the control chain completely outside the MapPane widget? Anyway, the tools will transform device coordinates into geographic ones and create Actions. Two questions: * this way mutliple tools will trasform more than once the device coordinates into geographics ones. Should we pass to tools PointTriggers in geographics coordinates? Maybe in both formats (device and geographic?) * are these Actions subclasses of the Swing Action class? Hope so, since otherwise this would be really confusing for people used to Swing guis. Moreover, Actions could be triggered by toolbar buttons, menu or keyboard shortcuts, and in this case there is no need for the PointTrigger, it's just a "zoom 10% more" or "pan 1/25 of the current display size to the right". Which applies also to vocal commands and gestures, I think many of this would be a direct command, such as a zoom, so in some way the gesture processor should be connected directly to Actions too... In this picture, what is the place for a MouseTool? Isn't the mouse event handling already processed by component listed in point a) above? Andrea |