Book a Demo

Author Topic: Label "roams" in Rectangular notation  (Read 7171 times)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Label "roams" in Rectangular notation
« on: February 03, 2017, 11:24:42 am »
We have developed a shapescript technology to allow us to provide different name forms for the same item on various diagrams.  This is similar to the Name<->Alias problem, but more flexible.

We use a label in both notational forms (Rectangular and Non-Rectangular).  The label is positioned via a setorigin() statement.  In non-rectangular (so-called, Icon notation) the origin is respected.  In rectangular mode the behaviour is anomalous.  While the name contains no space, the origin is respected.  However, once a space is present, the origin is not respected and the label moves vertically (and sometimes horizontally), depending upon a seemingly random set of variables.  If you re-position it to the desired location, a diagram reload will put it back where EA decides it should be.

NOTE: using [Alt+Z] does not move the label from where you've positioned it, but reload of the diagram does.

Labels on connectors don't move when you reload the diagram, only when you move the connector (implicit move) or the label itself (explicit move).  I realise that the label on a shape has a set origin, so why doesn't EA respect that at all times?  Word wrap should extend the label "downward" - not "upward" as appears to be the case at present.

While we're fixing this is there any way to set the label sizing?

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

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Label "roams" in Rectangular notation
« Reply #1 on: February 03, 2017, 08:05:15 pm »
Have a look at chapter 2.5.1 of my Inside book. I think that's the only way here.

q.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Label "roams" in Rectangular notation
« Reply #2 on: March 10, 2017, 11:06:50 am »
Create a stereotype with the following code:
Code: [Select]
shape main
{
drawnativeshape();
}

shape Label
{
setorigin("NW",0,0);
print("An element with a very long name  An element with a very long name");
}
Create an element with that stereotype. You will (should) see the name wrapped in the top left corner (but partly outside the element). Save the diagram. Reload the diagram. The name should have changed position and "unwrapped". BTW: setting print() or printwrapped() seems to make NO difference here. Move the label, save and reload the diagram, the label returns to the second point (after the first reload - reasonable).

Now start changing the location of the label (in the shape script): NW->N->NE->E->SE->S->SW->W->CENTER. Observe how the location of the label changes weirdly, sometimes to go to where you expect, others not! Now change the location of the label X & Y (in particular use + and - values for both X & Y (so that the label is supposed to "flip" about the 0 axis), and repeat the movement around the shape.

Now tell me this code isn't SCREWED!

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

Glassboy

  • EA Practitioner
  • ***
  • Posts: 1367
  • Karma: +112/-75
    • View Profile
Re: Label "roams" in Rectangular notation
« Reply #3 on: March 10, 2017, 12:14:37 pm »
Now start changing the location of the label (in the shape script): NW->N->NE->E->SE->S->SW->W->CENTER. Observe how the location of the label changes weirdly, sometimes to go to where you expect, others not! Now change the location of the label X & Y (in particular use + and - values for both X & Y (so that the label is supposed to "flip" about the 0 axis), and repeat the movement around the shape.

Now tell me this code isn't SCREWED!

The irony being your description of the direction change is a description of a screwing motion?

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Label "roams" in Rectangular notation
« Reply #4 on: March 10, 2017, 01:09:27 pm »
Now start changing the location of the label (in the shape script): NW->N->NE->E->SE->S->SW->W->CENTER. Observe how the location of the label changes weirdly, sometimes to go to where you expect, others not! Now change the location of the label X & Y (in particular use + and - values for both X & Y (so that the label is supposed to "flip" about the 0 axis), and repeat the movement around the shape.

Now tell me this code isn't SCREWED!

The irony being your description of the direction change is a description of a screwing motion?
I thought I was visually punning...

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

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Label "roams" in Rectangular notation
« Reply #5 on: March 10, 2017, 09:20:09 pm »
I'm already too disillusioned to continue working as outsourced QA of Sparx.

q.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Label "roams" in Rectangular notation
« Reply #6 on: March 10, 2017, 09:24:03 pm »
I'm already too disillusioned to continue working as outsourced QA of Sparx.

q.
So am I, but we need this to handle multiple naming of the same object.  It's really important when different parts of the organisation name the same thing in different ways.

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

Glassboy

  • EA Practitioner
  • ***
  • Posts: 1367
  • Karma: +112/-75
    • View Profile
Re: Label "roams" in Rectangular notation
« Reply #7 on: March 14, 2017, 02:17:11 pm »
I'm already too disillusioned to continue working as outsourced QA of Sparx.

Having been using another tool for six months I can tell you things could be much much much much worse.  For example connectors could be first class citizens, not the fun useful thing they are in EA.