X-Powered-By: PHP/5.2.8 Set-Cookie: PHPSESSID=6b99d2279a5794af3ecddecd4d95c8c4; path=/ Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Content-type: text/html
|
Home Services People Process More About Us |
GraphNode Drawlets Example
This really simple example shows a way to use Drawlets without a tool palette. We've simply added a new type of Figure called a GraphNode and had it take advantage of supplied LineConnectionHandle (in the shapes.lines kit) and TextEditHandle (in the text kit) to allow you to connect Nodes together and edit the text of the node. Then we made a simple subclass of the standard SelectionTool to override its double-click action. We made an instance of this tool the tool of our canvas (boring, standard background and foreground color), and this is the result:
This demonstrates some of the flexibility you get from Drawlets. You don't have to use a tool palette, but you can. You decide the kind of handles you want on your figures. You decide whether you want to provide users with the ability to choose various DrawingStyle elements (color, font, etc.) in the manner you choose. You simply piece together the pieces that you want.
Notice that all of this was done without having to modify the framework. All of the other pieces only care that objects implement certain interfaces. We simply added our own type of figure and a special tool. The rest just worked!
Now how much would you pay?
| Copyright © 2002-03 by RoleModel Software, Inc. All rights reserved. |