Jump to: navigation, search

Difference between revisions of "Graphical Modeling Framework/Concepts/Labels"

Line 3: Line 3:
 
'''1. "feature based label"'''
 
'''1. "feature based label"'''
  
Label is always defined in context of a diagram node or a link. If it's based on EClass from domain model then label may be used to represent attribute(s) of this class. Tooling will generate code that constructs label text and converts user input to the new value for attribute(s).
+
Label is always defined in context of a diagram node or a link. If it's based on ''EClass'' from domain model then label may be used to represent attribute(s) of this class. Tooling will generate code that constructs label text and converts user input to the new value for attribute(s).
  
 
'''2. "design label"'''
 
'''2. "design label"'''
  
It may be desirable to have a label that is not stored in domain model. Tooling may generate code that will use notation style (DescriptionStyle for example) to store label text in notation model.
+
It may be desirable to have a label that is not stored in domain model. Tooling may generate code that will use notation style (''DescriptionStyle'' for example) to store label text in notation model.
  
 
'''3. "default label"'''
 
'''3. "default label"'''
Line 15: Line 15:
 
'''4. "custom label"'''
 
'''4. "custom label"'''
  
GMF runtime defines IParser interface that is responsible to provide label text and editing support. In this usecase toolsmith is supposed to provide his own IParser implementation.
+
GMF runtime defines ''IParser'' interface that is responsible to provide label text and editing support. In this usecase toolsmith is supposed to provide his own ''IParser'' implementation.
  
==Related requests in bugzilla==
+
==Graphical Definition==
 +
 
 +
The only possible label figure is ''Label''. In generated diagram editor the actual figure may be ''Label'' from Draw2D or ''WrapLabel'' from GMF runtime. Attribute "text" of the figure is a text shown on diagram when parser is not available.
 +
 
 +
Position of label figure within model is important; it's used to determine whether label should be inner or external. Link labels are always external but node labels may be located whether inside node figure or "float" near it. If label figure is contained within parent node figure (directly or indirectly) it's inner label.
 +
 
 +
''DiagramLabel'' element refers to the label figure and is being referenced by ''LabelMapping'' from mapping models. If "elementIcon" attribute is set then label use icon from EMF item providers.
 +
 
 +
==Mapping==
 +
 
 +
==Related Requests==
  
 
*[https://bugs.eclipse.org/bugs/show_bug.cgi?id=161380 Refactor labels in GMF 2.0]
 
*[https://bugs.eclipse.org/bugs/show_bug.cgi?id=161380 Refactor labels in GMF 2.0]
 
*[https://bugs.eclipse.org/bugs/show_bug.cgi?id=150816 Support "design" labels for nodes backed up with domain element]
 
*[https://bugs.eclipse.org/bugs/show_bug.cgi?id=150816 Support "design" labels for nodes backed up with domain element]
 
*[https://bugs.eclipse.org/bugs/show_bug.cgi?id=138179 Allow to define labels based on attributes of referenced objects]
 
*[https://bugs.eclipse.org/bugs/show_bug.cgi?id=138179 Allow to define labels based on attributes of referenced objects]

Revision as of 06:08, 20 October 2006

Labels represent pieces of text possibly associated with icons on diagram surface. Text may be edited using inplace facility. There are many possibilities to construct labels but all of them are grouped in four usecases:

1. "feature based label"

Label is always defined in context of a diagram node or a link. If it's based on EClass from domain model then label may be used to represent attribute(s) of this class. Tooling will generate code that constructs label text and converts user input to the new value for attribute(s).

2. "design label"

It may be desirable to have a label that is not stored in domain model. Tooling may generate code that will use notation style (DescriptionStyle for example) to store label text in notation model.

3. "default label"

This is a read-only label with fixed text.

4. "custom label"

GMF runtime defines IParser interface that is responsible to provide label text and editing support. In this usecase toolsmith is supposed to provide his own IParser implementation.

Graphical Definition

The only possible label figure is Label. In generated diagram editor the actual figure may be Label from Draw2D or WrapLabel from GMF runtime. Attribute "text" of the figure is a text shown on diagram when parser is not available.

Position of label figure within model is important; it's used to determine whether label should be inner or external. Link labels are always external but node labels may be located whether inside node figure or "float" near it. If label figure is contained within parent node figure (directly or indirectly) it's inner label.

DiagramLabel element refers to the label figure and is being referenced by LabelMapping from mapping models. If "elementIcon" attribute is set then label use icon from EMF item providers.

Mapping

Related Requests