Re: How to create a new shape for block diagrams?

On Thu, 2007-07-19 at 17:17 +0200, GÃnter Dannoritzer wrote:

I have been using dia now for a while and one drawing type I am using it
for quite often is that of block diagrams. Now I would like to get a new
shape that speeds up the drawing of these block diagrams and wonder how
to create one.

To give you an idea what type of block diagram I am looking for I picked
a data sheet from the web:

On page 2 of that document they show a block diagram and I would like to
have a shape that supports the creation of these blocks.

I am using dia 0.96.1 and I know there is one shape, the data shape in
AADL, that comes pretty close to what I am looking for.

What is missing in that shape is that I can add the port name and it
gets displayed in the block.

That could be done reasonably easily, unless you want to do fancy
avoidance of overlapping and autoresize, which would make it tougher.

Also I would like a text field for the block name, which is now
available in the AADL block, and a second text field outside the block
for the instance name.

That part is not too tricky.

A minor changed would be to move the arrow of the in port outside of the
block line and for an out port not have an arrow, just a connection
point I can connect a line to.

You're probably wanting to use Add Connection Point instead and then
have the arrowhead be on the line instead of part of the port.

Now the cream would be to have a dialog that allows me to enter all the
ports that I want to add to that shape at once. I am not sure how
feasible that is?

At the moment, it would take a fair amount of hacking.  The only object
that has anything like it is the UML class, and it's dangerously
complex.  There's been a bit of work done towards having a List property
available that allows adding multiple instances of properties like the
UML class attributes/operations, but it's not ready yet.

I looked in the source under:

And it looks like I find what I am looking for in aadldata.c and aadlport.c.


In the source the author calls the objects a plug in. Could I also
create that as a Python plugin or does it need to be in C?

If you want to extend the AADL shape, I'm afraid it'd have to be in C.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]