Book a Demo

Author Topic: Double note sizes  (Read 13690 times)

DavidM

  • EA User
  • **
  • Posts: 82
  • Karma: +0/-0
    • View Profile
Double note sizes
« on: September 06, 2016, 02:44:56 pm »
Hi,
I have created this related shape script example straight from the example page. Everything works as it should once I save and re-load and set the features for realized to be visible.

However , the note when assigned is exactly twice the length of the text. This means that when I have  10 lines of text, I have 20 lines of text with 10 of them being blank.

Is this a feature I have to live with, or is there anything I have to do?



I thought maybe making a stereotype  of the note and re-sizing, but it seemed overkill, plus I want to add pin features and I'm not sure how that is done in MDG.

Any help would be appreciated.

Thanks

shape RelatedElement { // add Child Compartments to the parent.
 
     if(HasProperty("Connector.Type", "Realization"))
    {
            
           if(HasProperty("Element.IsSource"))
            {
               SetCompartmentName("Sub Capabilities");
               AppendCompartmentText("#element.NAME#");
               
            }
       }
 }
« Last Edit: September 06, 2016, 03:10:08 pm by DavidM »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Double note sizes
« Reply #1 on: September 06, 2016, 06:31:51 pm »
How is that script related to the element's notes? I can't follow.

q.

DavidM

  • EA User
  • **
  • Posts: 82
  • Karma: +0/-0
    • View Profile
Re: Double note sizes
« Reply #2 on: September 08, 2016, 01:35:41 pm »
Hi Qwerty.

What I am doing is trying to populate a Note, connected to an element, with the contents of the element realized components.

Say for example we a logical element called Bus. From that element we realize it to other elements called Double decker bus, tour bus, city bus.

When I create a note and assign it to an element feature, I would expect the note to contain
Double Decker bus
Tour Bus
City bus using the attached code on the element Bus.

This works well, but what happens, is the note is substantially larger than the 3 rows consumed. i.e. there is a lot of "dead space" beneath them.

I cannot re-size them, it ignores me (I call it the teenager syndrome ;-))
So I am left with notes much bigger than the text they contain.

Now image I have an element of say 14 realized elements, I have 28 rows, 14 populated and a lot of distracting space taken up in the diagram.

It looks very, very messy and not practical.

Hope this makes sense.


Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Double note sizes
« Reply #3 on: September 08, 2016, 04:12:27 pm »
David,

So for each connected element you make a new compartment?
That might be the problem.

Have you tried adding them all in one compartment?
I can imagine that EA automatically adds some whitespace above and below compartments, which would result in something you described.

If that doesn't work, maybe you can try it without a compartment, using the Print or PrintWrapped functions.

Geert


KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Double note sizes
« Reply #4 on: September 08, 2016, 04:35:54 pm »
There's nothing wrong with your shape script. It works fine on my machine. (Sorry, not that helpful)
The Sparx Team
[email protected]

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Double note sizes
« Reply #5 on: September 08, 2016, 04:45:43 pm »
OK, now I can reproduce it. It seems to only happen if the last line of text has spaces in it. It upsets the word-wrapping somehow. If we can reproduce it, we can fix it...
The Sparx Team
[email protected]

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Double note sizes
« Reply #6 on: September 09, 2016, 10:32:03 am »
OK, now I can reproduce it. It seems to only happen if the last line of text has spaces in it. It upsets the word-wrapping somehow. If we can reproduce it, we can fix it...
But only if someone posts a bug report?

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

DavidM

  • EA User
  • **
  • Posts: 82
  • Karma: +0/-0
    • View Profile
Re: Double note sizes
« Reply #7 on: September 11, 2016, 12:59:50 pm »
A sorry guys,
Been away on holiday.
To try and answer all the questions
- No I am only doing this in one shapescript compartment - the example given is from the sparx web page, and if the compartment already exists it is intelligent enough t ore-use.

Blank last line - is that actually in the code of if a blank line is somehow being generated in the list of dependencies? I shall check out my examples, but I don't recall having a blank line.

If it is a bug - do I need to create a bug request as suggested to initiate getting it fixed?
Thanks,
David

davidson

  • EA User
  • **
  • Posts: 36
  • Karma: +0/-0
    • View Profile
Re: Double note sizes
« Reply #8 on: September 11, 2016, 01:56:14 pm »
Can I just check below.

 if(HasProperty("Element.IsSource"))
            {
               SetCompartmentName("Sub Capabilities");
               AppendCompartmentText("#element.NAME#");
               THIS BLANK LINE CAUSES THE PROBLEM?
            }

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Double note sizes
« Reply #9 on: September 11, 2016, 07:41:12 pm »
The RelatedElement seems to be quite buggy (see also http://sparxsystems.com/forums/smf/index.php/topic,35992.0.html. http://sparxsystems.com/forums/smf/index.php/topic,31032.msg224960.html#msg224960 and others). I tried this feature once again and this time even did not manage to show up in V13. So I'd recommend to send a bug report (bottom right of this page; Support section).

q.

davidson

  • EA User
  • **
  • Posts: 36
  • Karma: +0/-0
    • View Profile
Re: Double note sizes
« Reply #10 on: September 12, 2016, 06:46:43 am »
I just tried this taking out the space and it still produces the large note.

BTW - I am using a shapescript (hence the notes to describe what is in the compartment) for the original icon.

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Double note sizes
« Reply #11 on: September 12, 2016, 09:04:56 am »
Can I just check below.

 if(HasProperty("Element.IsSource"))
            {
               SetCompartmentName("Sub Capabilities");
               AppendCompartmentText("#element.NAME#");
               THIS BLANK LINE CAUSES THE PROBLEM?
            }
No, I meant the last line of text being passed into AppendCompartmentText(), i.e. the last value of #element.NAME#, had spaces in it. After I reproduced the issue, I took the spaces out of the element name and the note displayed correctly. This leads me to believe it's a problem with the word-wrapping.
« Last Edit: September 12, 2016, 09:40:44 am by KP »
The Sparx Team
[email protected]

davidson

  • EA User
  • **
  • Posts: 36
  • Karma: +0/-0
    • View Profile
Re: Double note sizes
« Reply #12 on: September 12, 2016, 11:42:34 am »
Ah Yes - that seems to be the issue. Thanks
Pity I know what the problem is now, but I need spaces.....

davidson

  • EA User
  • **
  • Posts: 36
  • Karma: +0/-0
    • View Profile
Re: Double note sizes
« Reply #13 on: September 12, 2016, 11:46:52 am »
Further feedback on this erratic defect.

I changed the dependancy of one element to remove spaces. Saved it. Re-loaded it and re-sized it to the correct position and it worked.
Even when I put the spaces back in.

When I tried it on another however, it didn't work and wouldn't re-size, and no change was implemented.


« Last Edit: September 12, 2016, 11:52:18 am by davidson »

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Double note sizes
« Reply #14 on: September 12, 2016, 04:51:23 pm »
Welcome to EAUI...

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!