Re: Does everyone make large objects, or is it just how I am using Dia?



Andrey,

Thanks! Sorry about the 'prefix' thing. It's just what I remembered from the manual, which is the same as the page link you sent. It says:

   As in the example, you may use "compound names". Many shapes
   have first part of its name to indicate the sheet in which
   they appear, but this is optional.

So, I had copied a shape and renamed it in its file, and I had copied from a sheet file and renamed the shape there. The names of both my sheet and the shape were different than the original. It wasn't until I changed the first part of the compound name inside the shape file from 'BPMN - ' to 'BPMN2 - ' that I could see my changes _and_ had no 'duplicate' error.

I'm sure having made some of these or being familiar with the source code, the questions that I have most likely cannot even be seen.

For example, I started with this file from BPMN sheet with the filename 'Start-Event-Message.shape':

01 <?xml version="1.0" encoding="UTF-8"?>
02 <shape xmlns="http://www.daa.com.au/~james/dia-shape-ns"; xmlns:svg="http://www.w3.org/2000/svg";>
03   <name>BPMN - Start-Event-Message</name>
04   <icon>Start-Event-Message.png</icon>
05   <connections>
06     <point x="0" y="0"/>
07     <point x="10" y="0"/>
08     <point x="10" y="10"/>
09     <point x="0" y="10"/>
10     <point x="5" y="12"/>
11     <point x="5" y="-2"/>
12     <point x="-2" y="5"/>
13     <point x="12" y="5"/>
14   </connections>
15   <aspectratio type="fixed"/>
16   <svg:svg>
17     <svg:ellipse style="fill: default" cx="5" cy="5" rx="7" ry="7"/>
18 <svg:ellipse style="fill: none; fill-opacity:0; stroke-width: 0.1; stroke: #000000" cx="5" cy="5" rx="7" ry="7"/>
19     <svg:rect style="fill: default" x="1" y="2" width="8" height="6"/>
20 <svg:rect style="fill: none; fill-opacity:0; stroke-width: 0.1; stroke: #000000" x="1" y="2" width="8" height="6"/> 21 <svg:line style="fill: none; fill-opacity:0; stroke-width: 0.1; stroke: #000000" x1="1" y1="2" x2="5" y2="5"/> 22 <svg:line style="fill: none; fill-opacity:0; stroke-width: 0.1; stroke: #000000" x1="9" y1="2" x2="5" y2="5"/>
23   </svg:svg>
24 </shape>

line 02: None of the sample files I have opened have online files that match the 'xmlns=' field. I don't know if that was a cause of my 'duplicate' error, but none of the files reference the xml namespace anyway.

line 03: This is where nothing worked with all the files renamed and this field set to 'BPMN - Start-Event-Message by dunn'. When I changed it to 'BPMN2 - Start-Event-Message by dunn' it worked.

line 05-14: Here, the bounding box of the shape is 14x14, but the connection points have strange numbers. I thought they must just be relative to the bounding box size of the shape. But that wouldn't explain the negative numbers. So then I figured the points must all be relative to a 10x10 area centered in the center of the shape, but when I opened other files this was not true. When I opened other files they were different ranges but those had svg size in line 16. One of them had svg limits of 10,12 but was a circle. I don't know how the two are related. I'll figure it out with trial and error tonight though.

lines 17-18: I don't know why the duplicate svg shapes all through the files. It doesn't seem to need it and I don't know why it's done like that.

So, I am swimming in total ignorance :-! I am not just working with "A typical shape file may look something like this...", because I have all of the sample files from the installation. I don't know which are supposed to be shining examples of what should be done, but I'm sure I'll get something working.

What I really don't think I'll figure out from the samples is the 'xmlns=' part, because I have no samples of what should be there.

I suppose I'll lose the xml namespace and the duplicate shape definitions. I only ask such things because I don't want to go back and change the files I create because I didn't know the obvious.

Thanks, Andrey!
   -- Dunn


On 07/25/2014 07:58 PM, Andrey Repin wrote:
Greetings, dunn!

I actually didn't have any files or shapes to share because I was about
to create some, but if I have other questions, can we add an attachment
on the mailing list messages?
Yes.

I've actually been working on figuring out why the shapes are coded the
way they are.
Quite easy - to be scalable.

I copied some into my local shapes folder and couldn't figure out why my
changes would not show up.
Because they weren't listed in any sheet. Or because your shapes have
duplicate names. Or both.

It took a lot of tweaking thinking it was not having extents on the svg
part, whether line thickness were not being accepted because in some shapes
they're stated with reals, other integers, and some not at all.
In reality (pun intended), the shape measuring units are relative to the shape
itself, and bear [almost] no significance for resulting diagram.

It turns out there was something to do with the prefix on the name of the shapes.
There's no such thing as prefix.

I still couldn't state definitely what I had wrong.
It will take some more testing to figure out how the sheet file finds the
shapes (since I noticed this when I got a 'Duplicate Object" error after a
couple of hours of confusion :-!).  (My file was still showing me the one I had
copied even though I had created a new sheet and renamed the shape. Sheesh!)
https://git.gnome.org/browse/dia/plain/doc/custom-shapes

I haven't really used Dia before trying to customize it though, and it
wasn't until I had made my first shape that I learned everything is
brought in at the same size anyway.  (It would be nice to learn we can
change this with Python on insertion or something!)
Yes.


--
WBR,
Andrey Repin (anrdaemon freemail ru) 26.07.2014, <06:49>

Sorry for my terrible english...

_______________________________________________
dia-list mailing list
dia-list gnome org
https://mail.gnome.org/mailman/listinfo/dia-list
FAQ at http://live.gnome.org/Dia/Faq
Main page at http://live.gnome.org/Dia






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