Improving appearance of UML diagrams

W

Weeble

I found the standard UML diagram elements in Visio 2003 to be messy
and ugly, so I set about making my own version of some of them.

Firstly, I took the class diagram, turned off the display of the fill
and lines on the three component shapes, inserted a slightly prettier
background into the group. Next I edited the shapesheet so that when
it automatically resizes itself, it rounds up to the nearest 5mm,
making the shapes easier to lay out neatly, and I made similar changes
to the formulae to position the connection points, so that they will
appear on grid-lines and make it easy to have nice straight lines
connecting the shapes.

Overall, I'm very happy with the result. It's both more attractive and
easier to position than the standard version. I made it into a master
and when I add it to a diagram it behaves just like the standard UML
class shape, adding itself to the model and having all the right
dialogs for editing it. My problem is that I can't put one class on
more than one page. If I drag a class from the UML Model Explorer onto
a page, it always appears as the standard class shape, while if I copy
and paste a class from one page to another, it creates a new entry in
the Model Explorer.

Is there any way to achieve the results I want? I don't seem to be
able to edit the standard UML stencil, or control what shapes the
Model Explorer creates when I drag a class onto a page. I can't find a
way to change which class in the model is associated with a given
shape. (I tried changing User.UMLObjectGUID for the shape, but it just
seems to revert as soon as I do anything.) Is it simply impossible?
 
P

Paul Herber

I found the standard UML diagram elements in Visio 2003 to be messy
and ugly, so I set about making my own version of some of them.

Firstly, I took the class diagram, turned off the display of the fill
and lines on the three component shapes, inserted a slightly prettier
background into the group. Next I edited the shapesheet so that when
it automatically resizes itself, it rounds up to the nearest 5mm,
making the shapes easier to lay out neatly, and I made similar changes
to the formulae to position the connection points, so that they will
appear on grid-lines and make it easy to have nice straight lines
connecting the shapes.

Overall, I'm very happy with the result. It's both more attractive and
easier to position than the standard version. I made it into a master
and when I add it to a diagram it behaves just like the standard UML
class shape, adding itself to the model and having all the right
dialogs for editing it. My problem is that I can't put one class on
more than one page. If I drag a class from the UML Model Explorer onto
a page, it always appears as the standard class shape, while if I copy
and paste a class from one page to another, it creates a new entry in
the Model Explorer.

Is there any way to achieve the results I want? I don't seem to be
able to edit the standard UML stencil, or control what shapes the
Model Explorer creates when I drag a class onto a page. I can't find a
way to change which class in the model is associated with a given
shape. (I tried changing User.UMLObjectGUID for the shape, but it just
seems to revert as soon as I do anything.) Is it simply impossible?

Visio prevents you from editing the build-in stencils while they are
at their normal location. Copy the stencil file, copy it, say, to My
Documents and open it from there. When you are done, close Visio and
copy the stencil back to its original location. Probably a good idea
to save a copy of the original file just in case. I hope I'm not
teaching you to suck eggs here.
When editing the shapes in a stencil it's important to keep the
shape's name the same, shapes have two names, one you can see and edit
(Name) and one that is more difficult, its Universal Name (NameU).
Renaming the shape can stop things from working properly, so always
work with the original shape.
Now when you drag your new shape to the document you might see your
changes. I can't tell you what aspects of the shape's properties get
overwritten by the UML addon.
Also, if this is a drawing that already contains Class shapes then
there will already be a Class master in the Document Stencil. The
Model Explorer may not use the one you expect, but with a new drawing
it should work.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top