Author Topic: Is it possible to suppress attached diagram indicator?  (Read 5523 times)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8607
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Is it possible to suppress attached diagram indicator?
« on: April 01, 2020, 11:01:34 am »
As we're aware when there's an attached diagram to an item (for most of you, most often the Composite Structure diagram), EA places the "Chain Links" indicator at bottom right of the item.

Is it possible to selectively suppress this?  Either by shape script or general diagram setting?  When we publish diagrams for "executives" it confuses them.

A crappy "solution" is to "paint over" the chain links - but that requires a chap[e script and a mechanism to trigger the suppression (such as a diagram stereotype or User-Selectable property - per item).

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

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Is it possible to suppress attached diagram indicator?
« Reply #1 on: April 01, 2020, 06:43:58 pm »
Hi Paolo,


I'm a little confused, you seem to ask if there's a shape script solution which doesn't require a shape script?
Does not compute.

Anyway, I tested a simple shape script that only calls DrawNativeShape() or DrawParentShape(). Both result in the link symbol being drawn.
I also tested adding an empty "SE" decoration -- didn't work.

The only way I can see would be to write a shape script that does everything the native shape does, except draw the link symbol. But as I'm sure you're well aware, that means you can't include attributes or operations in your shape.

So I think it's the crappy solution, although I don't see a need for a triggering mechanism.
Something like
Code: (Shape Script) [Select]
shape main {
DrawNativeShape();
}
decoration Nope {
orientation = "SE";
if (HasProperty("isdrawcompositelinkicon", "true")) {
SetFillColor(0, 0, 0);
Rectangle(-75, 0, 75, 50);
}
}
should do it, no?


/Uffe
My theories are always correct, just apply them to the right reality.

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Is it possible to suppress attached diagram indicator?
« Reply #2 on: April 01, 2020, 06:54:42 pm »
Me again,

I think I see what you mean with a trigger -- you want to enable this only when publishing for dummies executives, right?

The only way I can see to do that without, as you say, setting tags or fiddling with the diagram properties, would be to create an Add-In which can respond to a shape script query.
Might be overkill, although perhaps if a shape script can call a Model Add-In or whatever they're called, it could be doable. But that's just speculation.

/U
My theories are always correct, just apply them to the right reality.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8085
  • Karma: +118/-20
    • View Profile
Re: Is it possible to suppress attached diagram indicator?
« Reply #3 on: April 02, 2020, 07:48:07 am »
By using an alternate image?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Is it possible to suppress attached diagram indicator?
« Reply #4 on: April 02, 2020, 08:20:36 am »
The answer is: no. If you really want to use alternate images then good luck showing the original compartments. Uffe's solution creates a black bar (like censored). If you happen to get the fill color it will not match the gradient used for shapes completely. So an obscure censor bar.

q.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8607
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Is it possible to suppress attached diagram indicator?
« Reply #5 on: April 02, 2020, 09:03:46 am »
By using an alternate image?
As qwerty said, I want to retain the original compartments/contents.  So alternate images are out.

We have switched off gradient fill because, as qwerty said, it B**GERS up any rectangles you use to hide the icons that EA won't remove with drawnativeshape(). I already have the chain links shape in the shapescript for those shapes that EA doesn't display the chainlink.

I've tested painting over and it works (after a fashion), but the result is, as I intimated, "crappy".  I guess I'll have to use that.  Alternatively, I could use a small rectangle (using getUserFillColor()).

Is there any support for a feature request?

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: +396/-301
  • I'm no guru at all
    • View Profile
Re: Is it possible to suppress attached diagram indicator?
« Reply #6 on: April 02, 2020, 10:04:50 am »
Well, to be honest: my only feature request is "fix the damn bugs". And of course "stop moving menues around randomly". Won't happen, I know.

q.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8607
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Is it possible to suppress attached diagram indicator?
« Reply #7 on: June 04, 2020, 04:26:27 pm »
Having recently got to play in the BPMN "Pool" (pun intended)  ;)  I note with interest that when you provide an attached diagram to an Activity,
Code: [Select]
the BPMN shape adds a [+] (a plus sign inside a box) in the centre of the bottom of the shape, instead of the "chain-link" indicator.  Further, if I enable the [Is Expanded] context menu item, the [+] disappears entirely!  So it is obviously possible to suppress the indicator (or change its shape).

So again, my question is how can I suppress/change the indicator?  Can someone explain how the Activity Shapescript is doing it?
(Having reverse-engineered it, there's at least one undocumented function in it - DrawComposedDiagram() )

TIA,
Paolo
« Last Edit: June 04, 2020, 04:29:16 pm by Paolo F Cantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!


Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8607
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Is it possible to suppress attached diagram indicator?
« Reply #9 on: June 04, 2020, 07:06:53 pm »
https://sparxsystems.com/enterprise_architect_user_guide/13.5/modeling_tools/add_composite_diagram_compartm.html

q.
Thanks, but that's not the part of the shapescript operation I'm after.

The operation isn't documented in the Drawing Methods page, nor is the compartment listed in the list of compartments.

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

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8085
  • Karma: +118/-20
    • View Profile
Re: Is it possible to suppress attached diagram indicator?
« Reply #10 on: June 05, 2020, 08:04:20 am »
That entire element is drawn via a shape script. Which means you can't take that approach if you want to preserve compartments.

The function has its own page in the help.

https://sparxsystems.com/enterprise_architect_user_guide/15.2/modeling/add_composite_diagram_compartm.html

My example is
Code: [Select]
shape main
{
layouttype="Border";
shape NameCompartment
{
preferredHeight = 32;
bold = True;
v_Align="center";
h_Align="center";
Print("#Name#");
}
shape CompositeIndicator
{
preferredHeight = 32;
SetFixedRegion(34,0,66,32);
Rectangle(36,2,64,28);
MoveTo(50,4);
LineTo(50,26);
MoveTo(38,15);
LineTo(62,15);
}
shape InlineDiagram
{
DrawComposedDiagram();
}

Rectangle(0,0,100,100);
AddSubShape("NameCompartment","N");
if(HasProperty("IsComposite","True"))
{
if(HasProperty("ShowComposedDiagram","true"))
{
AddSubShape("InlineDiagram","CENTER");
}
else
{
AddSubShape("CompositeIndicator","S");
}
}
}

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8607
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Is it possible to suppress attached diagram indicator?
« Reply #11 on: June 05, 2020, 08:31:21 am »
Thanks, Eve,

So the secret is to NOT use drawnativeshape?  In which case you can't have compartments.  That's in line with the observed behaviour in the BPMN Activity shape.  I'll have a think about how I can use that.

Is there support for conditional suppression of the indicator among the user base?  Something along the lines of either a parameter to drawnativeshape() or function such as show/hide label(), perhaps?

I'll try to recall if I've already put in a feature request.

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

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8085
  • Karma: +118/-20
    • View Profile
Re: Is it possible to suppress attached diagram indicator?
« Reply #12 on: June 05, 2020, 09:13:53 am »
Yes. The composite indicator is a part the native shape.