Bug 417396 - [CSS] The CSS Engine shall support label visibility & mask
Summary: [CSS] The CSS Engine shall support label visibility & mask
Status: RESOLVED FIXED
Alias: None
Product: Papyrus
Classification: Modeling
Component: Diagram (show other bugs)
Version: 1.0.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: M4   Edit
Assignee: Camille Letavernier CLA
QA Contact:
URL:
Whiteboard: Usability
Keywords: plan
: 419405 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-09-17 03:46 EDT by Camille Letavernier CLA
Modified: 2015-04-09 04:10 EDT (History)
2 users (show)

See Also:
cletavernier: luna+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Camille Letavernier CLA 2013-09-17 03:46:45 EDT
Currently, the granularity of the DOM Model associated to the notation Model doesn't allow for manipulating the labels.

The CSS Engine shall support the following labels:

- Floatting labels (e.g. the 5  labels of an Association)
- Labels in List Compartments (e.g. Property)

It shall support both visibility, and mask-managed labels. For example, we wan't to be able to write the following stylesheet:

Class > Compartment[type=attribute] > Property {
	label: visibility name type; /* + p1 : String */
}

Note that the mask-managed labels is only a set of booleans. It is not ordered. This example would be equivalent to:

label: type visibility name; /* + p1 : String */

For floating labels, we want to be able to write:

Association > Property:roleLabel1, Association > Property:roleLabel2 {
	visible: false; /* hidden */
}

Association > Property:multiplicityLabel1, Association > Property:multiplicityLabel2 {
	visible:true;
	label: visibility name type multiplicity; /* +class1 : Class1 [1] */
}

(Note that in these two examples, the actual selectors might be slightly different, because of N-ary associations. More complex selectors might be required to distinguish each association end).
Comment 1 Camille Letavernier CLA 2013-10-17 04:45:13 EDT
*** Bug 419405 has been marked as a duplicate of this bug. ***
Comment 2 Camille Letavernier CLA 2013-10-17 04:46:19 EDT
Shapes labels must also be covered. For example, it should be possible to hide the label of a Class.

This is especially useful when displaying elements as symbols (with only the Symbols compartment visible).
Comment 3 Camille Letavernier CLA 2014-01-29 11:52:06 EST
I've pushed the initial contribution in a4609aa.

The framework is not complete. Especially:

- Not all labels are supported (They need to be configured one by one, each time there is a Mask-based label configuration)
- SysML Diagrams rely on a different mechanism and do not support masks yet

The commit has not been pushed to master. Instead, it is in a specific branch (bugs/417396-CSSLabels)

- The Label element has been added to the DOM Model
- Label visibility is supported (visible: true | false)
- Association, Operation and Properties are properly supported in Class Diagram

Example: 

Port > Label {
	visible: false;
}

Operation {
	label: visibility name "return type";
}

TODO:

- Support all Mask-based label display
- Generate notation types mappings for all diagrams (To avoid manipulating computer-types from CSS Stylesheets)
- Adapt the SysML Diagram labels framework to support CSS
Comment 4 Camille Letavernier CLA 2014-02-04 10:47:30 EST
A new contribution is available in commit 2c374bf. The following points have been solved:

- Support all Mask-based label display
- Adapt the SysML Diagram labels framework to support CSS

TODO:

- Generate notation types mappings for all diagrams (To avoid manipulating computer-types from CSS Stylesheets)
- Move the mask managed edit policy from the label node to the top-level node for shapes (Because label nodes are no longer selectable)
- Some preference pages need to be either fixed or fully removed (Some of them currently throw exceptions)
- Some initial values are forced (Especially for labels visibility), which is not compatible with the CSS framework (Forced values have a higher priority than CSS-computed values, so CSS is never used). Workaround: use the "Default style" button to remove forced values.

This contributions introduces major API changes in the mask-managed API (For both SysML and UML diagrams, which rely on two different frameworks). The configuration doesn't rely on bitmasks anymore. Instead, we now use collections of strings, which are much easier to manipulate from stylesheets.

The constants values have changed (from integer to strings). The masks are no longer configurable from the preferences.

Example:

Operation {
	maskLabel: visibility name type;
}

The contribution is not yet merged to master. It is in a separate feature branch (bugs/417396-CSSLabels)
Comment 5 Camille Letavernier CLA 2014-03-07 07:29:09 EST
The CSS-Labels branch has been merged to master (Between M5 and M6)

Update of the current state:

> - Generate notation types mappings for all diagrams (To avoid manipulating computer-types from CSS Stylesheets)
> - Some preference pages need to be either fixed or fully removed (Some of them currently throw exceptions)
> - Some initial values are forced (Especially for labels visibility), which is not compatible with the CSS framework (Forced values have a higher priority than CSS-computed values, so CSS is never used). 

Done

Todo:

> - Move the mask managed edit policy from the label node to the top-level node for shapes (Because label nodes are no longer selectable)
Comment 6 Camille Letavernier CLA 2014-03-28 05:23:01 EDT
I close this task

I've opened a specific entry for this:

> Todo:
>	> - Move the mask managed edit policy from the label node to the top-level node for shapes (Because label nodes are no longer selectable)

See Bug 431443
Comment 7 Toni Siljamäki CLA 2015-04-09 04:10:18 EDT
This bug should be reopened. See bug 464240.