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

Adding shapes



I'm enjoying using Dia and if I can just add a few shapes for my work, it'll
be an invaluable tool but I'm having trouble adding shapes.

I'm working with Dia 0.9 on W2k and FIPA's AUML (as described in
http://www.fipa.org/specs/fipa00025/).  I'd like to add some shapes to the
UML palette.  My first experiment was for the connector for the exclusive-or
of multiple possible messages.  It is a strong vertical line with a diamond
over its center and an 'x' in the diamond.  It looks something like this:

    |
    |
    |
   / \
  / x \
  \   /
   \ /
    |
    |
    |

Resizing this should never change the width, nor the aspect of the diamond
and x, but should only lengthen the vertical line.  My first cut at this
was:

<?xml version="1.0"?>

<shape xmlns="http://www.daa.com.au/~james/dia-shape-ns";
       xmlns:svg="http://www.w3.org/2000/svg";>
  <name>AUML - exclusive OR</name>
  <description>Exclusive OR</description>
  <connections>
    <point x="0" y="3"/>
    <point x="0" y="2"/>
    <point x="-1" y="0"/>
    <point x="1" y="0"/>
    <point x="0" y="-2"/>
    <point x="0" y="-3"/>
  </connections>
  <svg:svg width="3.0" height="3.0">
    <svg:line style="stroke-width: 2" x1="0" y1="1" x2="0" y2="3"/>
    <svg:line style="stroke-width: 2" x1="0" y1="-1" x2="0" y2="-3"/>
    <svg:g>
      <svg:polygon style="stroke-width: 1  fill:background"
                   points="-1,0 0,1 1,0 0,-1"/>
      <svg:line style="stroke-width: .5"
                x1="-.25" y1=".25" x2=".25" y2="-.25"/>
      <svg:line style="stroke-width: .5"
                x1="-.25" y1="-.25" x2=".25" y2=".25"/>
    </svg:g>
  </svg:svg>
</shape>

But I have several problems.

First, when I have great difficulty getting this shape loaded into Dia.  The
documents suggest that just having this file in the right directory will
work but that has not been my experience.  I have developed a long, tedious
set of steps that involves removing the prior instance of my developing
shape, adding a new one, and restarting Dia.  (This is made extremely
painful by the slow, slow file browsing in the shape manager.)  So, what
_do_ I have to do to get Dia to see auml-xor.shape and load it?

Second, when I create one of these, it has the wrong size and aspect.  The
diamond is no a square rotated 45 degrees but rhombus.  How do I set the
size of shapes created from my own XML?

Finally, resizing this shape distorts the diamond further.  How can I limit
resizing to lengthening the vertical bar?

Thanks for any pointers.

                                            Chris
  

--
Christopher Nelson                           GE Fanuc, Albany 
Chris.Nelson@GEFanuc.com                         518.464.4992 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] Mail converted by Mofo Magic and the Flying D

 
All trademarks and copyrights are the property of their respective owners.

Other Directory Sites: SeekWonder | Directory Owners Forum

GuideSMACK