Page 1 of 1

Support for Extending ToolSystem

Posted: Thu 16. Sep 2010, 01:13
by karunaMaitri
I have a few requests for extending the ToolSystem.
These are broadly of two types:
  • 1. to provide additional tools
  • 2. to provide additional documentation and structure that helps the developers to extend the existing ToolSystem
I like several features of jReality that enable creation of complex geometries by programming. These features make creating such complex geometries quite easy. I feel jReality can benefit a great deal if it provides additional support to the developers for extending the existing tools that can cope with complex geometries. Specifically, tools for using Keyboard keys and menus seem to be missing. I list out some of the places where such tools are missing.
  • 1. swing folder: Tools to use with the JRJComponent for key boards and menus. (see todo: MouseEventTool)
  • 2. tools folder: no tools for key board events and menu events
My second set of requests are about providing support for developers to extend the tool system.
  • 1. Some documentation would be nice that would help the developers understand how events in tools are supported starting with DeviceManager. For example, how can we make use of DeviceKeyboard, that extends RawDevice in Tool development.
  • 2. It appears as though jReality has been following a design philosophy where a tool can be created using a combination of methods (activate(), perform(), and deactivate()). Together they support an event handling mechanism. The DragEventTool, illustrates how a new event handling mechanism can be introduced into this event handling mechanism. If a developer wants to set up an additional event handling mechanism (inside the event handling mechanism of activate, perform and deactivate), some documentation (or structure) would help. For example, if I want to introduce JOGL event handling mechanism into this event handling, how can I do it? If there is a principled way of understanding it, it would be very helpful.
Thank you!
Karuna

Re: Support for Extending ToolSystem

Posted: Sun 19. Sep 2010, 11:02
by gunn
Your point is well-taken that the tool system documentation could be improved. In particular, a clear explanation of the role of activation slots, current slots, virtual devices, and the role of the global tool configuration file is needed, in addition to a description of the tool event handling loop. As far as I know, such a document does not exist. If it does exist, it should be linked to the tool section of the developer tutorial .

There could indeed be a simple tutorial illustrating the use of keyboard input within a tool. Look at the tutorial example de.jreality.tutorial.scene.CameraPathExample. That shows how to add a keyboard listener to the viewing component of a jReality viewer. I believe however that this approach to handling keyboard events is inferior (because it is not GUI independent -- it only works for AWT-based window systems and not for example for SWT). So, it should be replaced by use of keyboard input through the tool system. Anyone care to write a tutorial showing how this approach works?

I'm not sure whether the menu topic belongs in the tool system or in the plugin system, which is independent of the tool system. In fact, your reference to Swing components might be better dealt with within the plugin system, which is the recommended way to add GUI elements to your jReality application. See the examples in the plugin section of the tutorial distribution.

As far as extending the tool system: I think the first step is to understand the existing tools and what they can do. Please continue to post your questions regarding your tool needs, the community can help you decide if there is an existing tool that can do what you want.