Hi,
I'm new to the list so don't shoot me for asking stupid questions that
may have already been asked. I was looking through the dia cvs stuff -
actually looking for an easy way to script/extend Dia. My first place
to go was the dtd files since I needed to manipulate the shapes directly
and I wanted to see how I could get to each of the elements within a
shape. I was surprised to find that Dia shapes do not yet support any
kind of Meta information. What I mean by that is that the text box
built-in shape does not have a parameter for say its name. The reason
for needing something like this is so scripts could easily query user
input. Something like:
get_shape("NameTag")->get_text("FirstName");
I was even more surprised that complex shapes like the UML diagram
shapes were hard coded. You see I want to be able to create UML
diagrams from C++, Python, etc. source files and visa versa. Why not
create all shapes equal by extending the shapes.dtd to allow for meta
information, inheritance and encapsulation of other shapes, and hooks
into code and scripts for validation purposes. Connectors would most
likely have to stay hard coded but a wrapper around them could allow for
inputs such as text boxes. The Dia SVG files would give the shapes both
visual appearance and contextual meaning. The scriptablity would allow
for helper dialog boxes to help fill in the details. An expanded
shapes file for a UML class would go something like this:
<?xml version="1.0"?>
<shape xmlns="http://www.daa.com.au/~james/dia-shape-ns"
xmlns:svg="http://www.w3.org/2000/svg">
<name>UML - Class</name>
<description>Class</description>
<icon>umlclass.xpm</icon>
<inherits>umlclassshape.xml</inherits>
<named_textbox x1="0" y1="0" x2="10" y2="5"
name="class_name" script="validate_class_name"/>
<edit_listbox x1="dynamic" x1_bind="class_name" y1="7"
x2="10" y2="dynamic" name="methods" script="validate_methods"/>
<edit_listbox x1="dynamic" x1_bind="methods" y1="7"
x2="10" y2="dynamic" name="attributes" script="validate_attributes"/>
.
.
.
</shape>
Of course the syntax would have to be better thought out and better
layouts created instead of the generic and inflexible x,y system. I can
just see this as being very useful. Imagine Dia embedded in a network
mapping program and having the ability to click on a computers icon and
remotely change its name, ipaddress, loaded software, etc. Or how about
a quick and dirty database designer ala Access. I don't know, it is
just a suggestion and something I may want to work on in the near
future. I want to know what you guys think. Are there plans for
something like this?
-J5