Book a Demo

Author Topic: drawnativeshape unresponsive to appearance  (Read 6155 times)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
drawnativeshape unresponsive to appearance
« on: September 09, 2009, 02:31:01 pm »
{EDIT: This post has been refactored, following diagnosis as to what was actually causing the problem.}

The shapescript formatting will not override any local formating applied by a "Style" from the Format Tool - nor should it.

However, there is a problem if you've previously applied such a style and now you wish to apply formatting via stereotyping.  There doesn't seem to be a way to remove the direct formatting via the UI (To be confirmed by Sparxians)

Reported.

VERY frustrated,
Paolo
« Last Edit: September 09, 2009, 05:18:51 pm by PaoloFCantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: drawnativeshape unresponsive to appearance
« Reply #1 on: September 09, 2009, 03:56:12 pm »
What does your shape script look like? Mine looks like this and works fine:

Code: [Select]
shape main
{
      setfillcolor(255,128,128);
      drawnativeshape();
}
The Sparx Team
[email protected]

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: drawnativeshape unresponsive to appearance
« Reply #2 on: September 09, 2009, 04:44:19 pm »
Quote
What does your shape script look like? Mine looks like this and works fine:

Code: [Select]
shape main
{
      setfillcolor(255,128,128);
      drawnativeshape();
}
Mine is a bit more complicated (it contains a subshape).

But I now don't think the drawnativeshape is the problem!  

After doing some more digging, it appears that it is not working only on SOME diagrams.  At first I thought it was the diagram type - since the type of diagram that it wasn't responding on was "Activity".  But changing the Diagram Type didn't help (in either direction).  

Then I recalled that on these particular Activity diagrams a "Style" had been applied from the Format Tool.  I later decided to apply the stereotype and obviously (and I concede, correctly) the local style application overrode the stereotype appearance.  So I set the style to "Default style" but that (it now transpires) doesn't actually reset or remove the applied style - just changes it.  I've gone into the Default Appearance menu and played around, but nothing seems to remove the "overlayed" style.

So how can I remove the application of the style from the format tool - using the UI?  The EAUI (and I use that epithet advisedly) and the Help are silent on the matter.
[Second EDIT:  I found a way to do this via EAUI.  However, I'll first see if the Sparxians can solve it...  Trouble is it involves half-a-dozen mouse clicks per shape!]

I'm happy to go into the DB to fix it so we can prove that that's the problem...
[Edit: Been there, done that... GOT THE "T" SHIRT!  That's the problem!  If I manually remove the additional formatting from the ObjectStyle of the appropriate Diagram Object - Alles ist in Ordnung!  (excuse my poor German :D)  Consistency is restored!]

Paolo

PS: I'll refactor the original post since the source of the inconsistency is not in shapescript.
« Last Edit: September 09, 2009, 05:31:46 pm by PaoloFCantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Makulik

  • EA User
  • **
  • Posts: 400
  • Karma: +0/-0
    • View Profile
Re: drawnativeshape unresponsive to appearance
« Reply #3 on: September 09, 2009, 10:02:45 pm »
Hi Paolo,

Your german's just fine  ;) ...

WBR
Günther

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: drawnativeshape unresponsive to appearance
« Reply #4 on: September 10, 2009, 04:18:38 pm »
Thanks Günther!

The Sparxians have also worked out the EAUI fix to remove any locally applied formatting to a diagram item:

You select the item and then use the Format tool, drop-down for the dimension you want to remove and select "Default Color" for instance.  This will NOT set the colour to the default colour for the shape, but remove the colour formatting completely.

It's EAUI because in the Default Appearance [F4] dialog, there's also an option to set the default colour, but this checkbox has NO effect if local formatting has been applied.

Now, since you don't know what local formatting has been applied to the item on this diagram, you need to remove all 4 dimensions so that's at least 8 mouse clicks per item!  By the way, there doesn't seem to be a mechanism to set the default pen width...

I've indicated that I consider this a workaround ONLY!  There needs to be specific items in the UI to remove any locally applied formatting.

How do you know that there has been local rendering applied?  Well Sparx will need to provide an inspector that can tell you that (like the one in MSWord - that tells you what paragraph, character and local styles have been applied).  Since I suspect more and more customers will be using conditional shapescripts you’ll need to be able to “inspect” each item on a diagram to work out why it's looking it’s looking...

Thoughts?  Votes (for the button and/or inspector)?
Paolo
« Last Edit: September 10, 2009, 04:25:39 pm by PaoloFCantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: drawnativeshape unresponsive to appearance
« Reply #5 on: September 10, 2009, 08:51:23 pm »
Yes, for the "button" in whatever incarnation that turns out to be. [The forum is a great place to communally sort this out.]

Yes, for the inspector. Once again there needs to be some thought as to how this can be made to work well (enough) without requiring major surgery to the product.

Paolo has presented some very interesting ideas for discussion. The floor is open people!
No, you can't have it!

Ian Stuart

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: drawnativeshape unresponsive to appearance
« Reply #6 on: September 11, 2009, 10:33:41 pm »
Not sure if this is the same issue...

I want my requirements to show the colours that are in the Settings... General types.. Status...

Can't seem to get this to work :-( as any requirements I put on a diagram have a single colour rather than the left hand part being the colur shown in the General Types dialogue as per the status... I have ensured that the Status applies to requirements (in fact I selected all just in case)

Ian

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: drawnativeshape unresponsive to appearance
« Reply #7 on: September 11, 2009, 11:11:22 pm »
Hi Ian,

The Tools|Options|Objects|Show Status Colors on diagrams controls this.  Is the checkbox marked?

Paolo
« Last Edit: September 11, 2009, 11:12:13 pm by PaoloFCantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Ian Stuart

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: drawnativeshape unresponsive to appearance
« Reply #8 on: September 11, 2009, 11:44:01 pm »
Bingo, many thanks.  It's a big complex app isn't it!

Ian