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

Bug 360800

Summary: Text background color is ignored
Product: [Modeling] Graphiti Reporter: Hernan Gonzalez <hjg.com.ar>
Component: CoreAssignee: Project Inbox <graphiti-inbox>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: michael.wenz
Version: 0.8.0Flags: michael.wenz: juno+
Target Milestone: 0.9.0   
Hardware: All   
OS: All   
Whiteboard: Juno M3 Theme_round_offs

Description Hernan Gonzalez CLA 2011-10-13 07:45:25 EDT
Build Identifier: 

Currently the background attribute of a Text element is ignored, even if the filled attribute is set. Both attributes are ignored at displaying, in PictogramElementDelegate.refreshFigureForGraphicsAlgorithm() (furthermore, the 'filled' attribute is set by default -as by general GA default, specified in graphiti.ecore) 

Then, currently one needs to create an aditional Rectangle to set the Text background, which shouldn't be necessary (a Text has a height-width, set by the user)

I think that it would be more logical to 

1. Modify  GaServiceImpl.setDefaultTextAttributes() so that it sets setFilled(false)
2. Modifiy PictogramElementDelegate.refreshFigureForGraphicsAlgorithm() (for Text and Multitext) so that it honours the filled/background attributes:

Instead of
  label.setOpaque(false);

change it to

 label.setOpaque(text.getFilled());


To check: Is this backward compatible? As long as the user creates each Text element through GaServiceImpl, the  element creation procedure should be compatible. The problem is with already persisted Text elements: as they normmally will lack the filled attribute, the default will be assumed which is 'true' . This is a problem.




Reproducible: Always
Comment 1 Tim Kaiser CLA 2011-10-19 10:53:11 EDT
- rendering engine takes filled attribute of abstract texts into account
- migration service provides a method to adapt filled=true in old diagrams which effectively was a false value
- diagram editor does auto migration for old diagrams and on save stores a newly introduced version for the diagram (1.0.0), such that migration of new diagrams is not done
- user can override this method in the diagram editor if he wants to trigger migration himself (e.g. he might want to hinder a popup of the versioning system on opening the diagram etc)
Comment 2 Hernan Gonzalez CLA 2011-10-19 12:17:40 EDT
To clarify:

Does this mean that the deafult value for the "filled" attribute was changed at the 'graphiti.ecore' level?
Comment 3 Tim Kaiser CLA 2011-10-20 03:29:04 EDT
no
Comment 4 Michael Wenz CLA 2012-04-11 10:40:43 EDT
Bookkeeping: Set target release
Comment 5 Michael Wenz CLA 2012-06-28 10:46:09 EDT
Part of Graphiti 0.9.0 (Eclipse Juno)