本文整理汇总了Java中org.eclipse.gmf.runtime.notation.View.getDiagram方法的典型用法代码示例。如果您正苦于以下问题:Java View.getDiagram方法的具体用法?Java View.getDiagram怎么用?Java View.getDiagram使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.gmf.runtime.notation.View
的用法示例。
在下文中一共展示了View.getDiagram方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getElement2ViewMap
import org.eclipse.gmf.runtime.notation.View; //导入方法依赖的package包/类
/**
* @generated
*/
public final Map<EObject, View> getElement2ViewMap() {
if (element2ViewMap == null) {
element2ViewMap = new HashMap<EObject, View>();
// map possible notation elements to itself as these can't be found by view.getElement()
for (EObject element : elementSet) {
if (element instanceof View) {
View view = (View) element;
if (view.getDiagram() == scope.getDiagram()) {
element2ViewMap.put(element, view); // take only those that part of our diagram
}
}
}
buildElement2ViewMap(scope, element2ViewMap, elementSet);
}
return element2ViewMap;
}
示例2: getMeasurementUnitAnnotation
import org.eclipse.gmf.runtime.notation.View; //导入方法依赖的package包/类
protected EAnnotation getMeasurementUnitAnnotation(List<EObject> views) {
View firstView = (View) views.get(0);
Diagram dgrm = firstView.getDiagram();
EAnnotation measureUnitAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
measureUnitAnnotation.setSource(dgrm.getMeasurementUnit().getName());
return measureUnitAnnotation;
}
示例3: activate
import org.eclipse.gmf.runtime.notation.View; //导入方法依赖的package包/类
public void activate() {
if (viewId == null) {
return;
}
// add self to global decorators registry
List<IDecorator> list = allDecorators.get(viewId);
if (list == null) {
list = new ArrayList<IDecorator>(2);
list.add(this);
allDecorators.put(viewId, list);
} else if (!list.contains(this)) {
list.add(this);
}
// start listening to changes in resources
View view = (View) getDecoratorTarget().getAdapter(View.class);
if (view == null) {
return;
}
Diagram diagramView = view.getDiagram();
if (diagramView == null) {
return;
}
if (fileObserver == null) {
FileChangeManager.getInstance().addFileObserver(fileObserver = new MarkerObserver(diagramView));
}
}