Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 360451

Summary: [SysML] Smart atomic flow-port icons are sometimes replaced by red squares
Product: [Modeling] Papyrus Reporter: Alain Le Guennec <alain.leguennec>
Component: CoreAssignee: Project Inbox <mdt-papyrus-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: benoit.maggi, eclipse-bugzilla, yann.tanguy
Version: 0.8.1   
Target Milestone: 0.9.0   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
The model used to reproduced the issue. none

Description Alain Le Guennec CLA 2011-10-10 11:05:28 EDT
The new "smart" atomic flow-port icons are sometimes replaced by red squares on IBDs or BDDs.
This is a symptom of the old static icon implementation re-surfacing
(but the old static icons have been removed from the resources, leading to unresolved icons, hence red squares).

To reproduce, load the attached model, and "auto-resize" the part.

The red squares can also be observed in the "Filter->Show/Hide Content" for the part.

You can also notice some related errors in the error log:
Unable to resolve plug-in "platform:/plugin/icons/portandflows/icons/portandflows/FlowPort_IN.gif".
Unable to resolve plug-in "platform:/plugin/icons/portandflows/icons/portandflows/FlowPort_OUT.gif".
Unable to resolve plug-in "platform:/plugin/icons/portandflows/icons/portandflows/FlowPort_INOUT.gif".
Comment 1 Alain Le Guennec CLA 2011-10-10 11:16:32 EDT
Created attachment 204888 [details]
The model used to reproduced the issue.
Comment 2 Yann Tanguy CLA 2011-10-10 11:21:20 EDT
Probably the "auto-resize" that does not move the Port to the new location correctly.
Comment 3 Yann Tanguy CLA 2011-10-11 04:21:05 EDT
Fix for reported exceptions r5771 (branch) & r5772 (trunk)

The method supposed to retrieve the image URI is incorrect in case the location given in the UML profile file is relative (not fixed), the location in the SysML profile have been turned into absolute platform URIs to avoid this.

Still to be fixed: the auto-resize issue...
Comment 4 Yann Tanguy CLA 2011-10-11 05:11:31 EDT
(In reply to comment #3)
> Fix for reported exceptions r5771 (branch) & r5772 (trunk)
> 
> The method supposed to retrieve the image URI is incorrect in case the location
> given in the UML profile file is relative (not fixed), the location in the SysML
> profile have been turned into absolute platform URIs to avoid this.

Fix for SysML icons in model explorer r5773 (branch) & r5774 (trunk).
Comment 5 Yann Tanguy CLA 2011-10-11 07:38:48 EDT
During autosize (or after while in autosize) layout changes can occur on the figure itself or another (a child for instance) that modify figure size without any resize request. This result in Port location becoming incorrect (the location is currently updated by edit part request).
I cannot figure out any simple fix for this, the side of the parent where the Port is located should maybe be stored in the notation model instead of calculated with the Port position... For the moment my recommendation is to forbid the autosize mode on element that can graphically hold Ports.
Comment 6 Yann Tanguy CLA 2011-10-12 09:58:52 EDT
Make same size can also break FlowPort location.
Comment 7 Yann Tanguy CLA 2011-11-07 11:02:31 EST
"Make same size" fixed by using edit part resize commands.
"Autosize" disabled on element that can hold ports.

Done in r6203 (0.8.X).
Comment 8 Yann Tanguy CLA 2011-11-21 05:49:24 EST
(In reply to comment #7)
> "Make same size" fixed by using edit part resize commands.
> "Autosize" disabled on element that can hold ports.
> 
> Done in r6203 (0.8.X).
In r6257 merge into trunk.
Comment 9 Yann Tanguy CLA 2012-03-15 19:12:04 EDT
In r7411:
To avoid port position issue related to auto-size, the related elements (Block, BlockProperty) in IBD & BDD have auto-size disabled on creation. This is achieved by setting View dimension to their default size given in preferences. A specific XYLayoutPolicy has to be applied on any possible container (StructureCompartment, Diagrams...) to avoid SetBoundsCommand to be contributed on View creation with dimension set to (-1, -1).
Comment 10 Yann Tanguy CLA 2012-03-16 20:23:41 EDT
In r7432 - Merge in trunk (0.9.0)
Comment 11 Tristan Faure CLA 2012-04-02 08:48:05 EDT
in some cases width == -1 and in other cases the height == -1 
that's why the condition for height and widht fix has been modified to take in account :
widht == -1 and height ==-1
widht == -1 and height != -1
widht != -1 and height == -1

commited on 0.8.X
Comment 12 Benoit Maggi CLA 2015-12-03 09:08:55 EST
Following Yann Tanguy comment
=> Patched in 0.9.0