日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

GMF Labels

發布時間:2025/3/21 编程问答 21 豆豆
生活随笔 收集整理的這篇文章主要介紹了 GMF Labels 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

為什么80%的碼農都做不了架構師?>>> ??

原文地址:http://wiki.eclipse.org/GMF_Labels

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.

Contents

[hide]
  • 1 Graphical Definition
  • 2 Mapping
  • 3 Generator Model
    • 3.1 GenLabel
    • 3.2 LabelModelFacet
  • 4 Pending Requests

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 the 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 uses icon from EMF item providers. The following visual facets are recognized by tooling in DiagramLabel:

  • AlignmentFacet - specifies link label position relative to the link figure; in generator model alignment is copied to "alignment" property of GenLinkLabel
  • LabelOffsetFacet - initial distance between the label and node / link figure; in generator model represented by LabelOffsetAttributes instance in label viewmap

Mapping

LabelMapping and its subclasses define label within the mapping model.

Basic LabelMapping instance supports 3rd and 4th usecases. It has "diagramLabel" reference to graphical definition and "readOnly" flag.

FeatureLabelMapping extends LabelMapping to support 1st usecase by referencing domain attributes and providing format options:

  • "features" reference: at least one attribute from domain model; all attributes should be defined within EClass of parent node / link
  • "viewPattern": pattern to construct label text from feature value(s)
  • "editorPattern": pattern to construct text for inplace editor from feature value(s)
  • "editPattern": pattern to parse text entered by user in new feature value(s)
  • "viewMethod": method to produce text from feature value(s) by pattern; used with "viewPattern" and "editorPattern"
  • "editMethod": method to parse text entered by user in new feature value(s); used with "editPattern"

Currently supported methods are:

  • MESSAGE_FORMAT uses java.text.MessageFormat class
  • NATIVE only one attribute should be specified; calls EcoreUtil.convertToString(...) / EcoreUtil.createFromString(...) methods
  • REGEXP calls String.split(...) method
  • PRINTF calls String.format(...) method

DesignLabelMapping is a LabelMapping flavour to handle 2nd usecase. Now it's empty but there should be a way to define view style used to store label text in notation model [1].

Generator Model

Two hierarchies describe labels in generator model: descendants of GenLabel used to express label presentation in context of parent node / link and descendants of LabelModelFacet that denote label semantic. GenLabel references LabelModelFacet by "modelFacet" reference thus linking them together.

GenLabel

Basic GenLabel has "elementIcon" flag copied from graphical definition and "readOnly" flag from the mapping model. GenNodeLabel and GenExternalNodeLabel are concrete classes that should be used to represent inner and external node labels respectively. GenLinkLabel is for the link labels and has "alignment" attribute derived from respective visual facet. GenChildLabelNode provides the same attributes as GenLabel but prefixed with "label" word; this class is used for nodes within list compartments.

LabelModelFacet

Model facet reflects label usecase:

  • "feature label": FeatureLabelModelFacet instance; properties "features", "viewPattern" and "editPattern" are taken from FeatureLabelMapping
  • "design label": DesignLabelModelFacet instance
  • "default label" and "custom label": no model facet (null)

In fact during mapping model to generator model transformation the following rules are obeyed:

  • FeatureLabelMapping -> FeatureLabelModelFacet
  • DesignLabelMapping -> DesignLabelModelFacet
  • LabelMapping -> null

Pending Requests

This is a list of enhancements related to GMF labels; hopefully future versions of GMF will implement them:

  • Support "design" labels for nodes backed up with domain element
  • Allow to define labels based on attributes of referenced objects
  • Allow to specify notation style for design label mapping
  • It should be possible to specify whether empty string should be written in domain model when user provides emty string for the label
  • Provide user feedback when invalid value is provided for the diagram label via direct editing
  • Generate resizable labels (optionally)

轉載于:https://my.oschina.net/dollyn/blog/360640

總結

以上是生活随笔為你收集整理的GMF Labels的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 亚洲天堂网络 | 丰满大肥婆肥奶大屁股 | 草逼视频免费看 | 老王66福利网 | 天天操天天干天天摸 | 午夜欧美福利 | 无码人妻精品一区二区三应用大全 | 草逼国产| 秋霞欧美在线观看 | 欧美日韩免费在线视频 | 日本黄色中文字幕 | 国产精品色网 | 九九热精品在线视频 | 国产乱人视频 | 精品人妻无码一区二区性色 | 亚洲一区二区精品视频 | 中文字幕乱码免费 | 欧美大片在线 | 日韩视频免费观看 | 99热官网| 国产无遮挡又黄又爽免费视频 | 99这里只有精品视频 | 亚洲无码精品在线观看 | 99久久视频 | 国产精品播放 | 美女精品久久 | 窝窝午夜看片 | 国产色播 | 古风h啪肉h文 | 久久久久久一区二区三区 | 欧美成人一区二免费视频软件 | 激情免费网站 | 日韩精品电影一区二区 | 免费网站在线观看人数在哪动漫 | 一区二区三区 中文字幕 | 欧美久草 | 亚洲va欧美va天堂v国产综合 | 欧美xxx在线观看 | 一区精品二区国产 | 99精品人妻无码专区在线视频区 | 久久水蜜桃 | hd性videos意大利精品 | av免费网站在线观看 | 久久精品国产av一区二区三区 | 欧美日韩免费视频 | 五月丁香综合激情六月久久 | 亚洲成av人影院 | 精品国产污污免费网站入口 | 国产男男网站 | 亚洲福利一区二区 | aaa国产| 精品国产乱子伦一区二区 | 怡红院成人网 | 人与动物黄色片 | 国精品一区 | 91久久超碰 | 国产精品av一区 | 日本成人综合 | 91人人爽 | 久久99精品国产91久久来源 | 性做久久久久久久久 | 青青精品视频 | 色婷婷五 | 97欧美视频 | 日韩精品久久 | 久久人人爽人人爽人人片 | 国产黄色影视 | 亚洲卡一卡二卡三 | 成人午夜av| 午夜插插插 | 久久加久久 | 国产又粗又猛又爽又黄的视频小说 | 丁香色婷婷| 国产亚洲一区二区三区四区 | 插少妇视频 | 口述3p做爰全过程 | 激情五月婷婷色 | 一级片日韩 | 六月婷婷激情网 | 在线观看视频日韩 | 二区在线视频 | 日韩av成人网 | 亚洲欧美日韩精品久久亚洲区 | 99精品久久精品一区二区 | www.白虎| 男人天堂电影 | 亚洲av永久一区二区三区蜜桃 | 日本免费在线观看 | 黄色大片网址 | 中国女人黄色大片 | 欧美另类一区 | 中文成人在线 | 欧美日韩一区二区三区 | 一区免费观看 | 日韩av手机在线观看 | 各处沟厕大尺度偷拍女厕嘘嘘 | 激情亚洲网 | 你懂的网址在线观看 | 黄色片播放器 |