422
|
1 |
/*
|
|
2 |
* Copyright (c) 2007 Borland Software Corporation
|
|
3 |
*
|
|
4 |
* All rights reserved. This program and the accompanying materials
|
|
5 |
* are made available under the terms of the Eclipse Public License v1.0
|
|
6 |
* which accompanies this distribution, and is available at
|
|
7 |
* http://www.eclipse.org/legal/epl-v10.html
|
|
8 |
*
|
|
9 |
* Contributors:
|
|
10 |
* Dmitry Stadnik (Borland) - initial API and implementation
|
|
11 |
*/
|
|
12 |
|
|
13 |
«IMPORT "http://www.eclipse.org/gmf/2008/GenModel"»
|
|
14 |
«EXTENSION xpt::diagram::ViewmapAttributesUtils»
|
|
15 |
|
|
16 |
«DEFINE LinkViewFactory FOR gmfgen::GenLink-»
|
|
17 |
«EXPAND xpt::Common::copyright FOR getDiagram().editorGen-»
|
|
18 |
package «getDiagram().notationViewFactoriesPackageName»;
|
|
19 |
|
|
20 |
«EXPAND xpt::Common::generatedClassComment»
|
|
21 |
public class «notationViewFactoryClassName» extends org.eclipse.gmf.runtime.diagram.ui.view.factories.ConnectionViewFactory {
|
|
22 |
|
|
23 |
«EXPAND xpt::Common::generatedMemberComment»
|
|
24 |
protected java.util.List createStyles(org.eclipse.gmf.runtime.notation.View view) {
|
|
25 |
java.util.List styles = new java.util.ArrayList();
|
|
26 |
«IF !isFixedForeground(viewmap)-»
|
|
27 |
styles.add(org.eclipse.gmf.runtime.notation.NotationFactory.eINSTANCE.createConnectorStyle());
|
|
28 |
«ELSE-»
|
|
29 |
styles.add(org.eclipse.gmf.runtime.notation.NotationFactory.eINSTANCE.createRoutingStyle());
|
|
30 |
«ENDIF-»
|
|
31 |
«IF !isFixedFont(viewmap)-»
|
|
32 |
styles.add(org.eclipse.gmf.runtime.notation.NotationFactory.eINSTANCE.createFontStyle());
|
|
33 |
«ENDIF-»
|
|
34 |
«EXPAND xpt::diagram::views::Utils::addCustomStyles("styles")-»
|
|
35 |
return styles;
|
|
36 |
}
|
|
37 |
|
|
38 |
«EXPAND xpt::Common::generatedMemberComment»
|
|
39 |
protected void decorateView(org.eclipse.gmf.runtime.notation.View containerView, org.eclipse.gmf.runtime.notation.View view,
|
|
40 |
org.eclipse.core.runtime.IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
|
|
41 |
«EXPAND xpt::diagram::views::Utils::updateSemanticHint-»
|
|
42 |
super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
|
|
43 |
«EXPAND xpt::diagram::views::Utils::foregroundColour("view") FOR viewmap-»
|
|
44 |
«IF labels.size() > 0-»
|
|
45 |
org.eclipse.core.runtime.IAdaptable eObjectAdapter = null;
|
|
46 |
«EXPAND xpt::diagram::views::Utils::domainElementAdapter("eObjectAdapter") FOR modelFacet-»
|
|
47 |
«EXPAND xpt::diagram::views::Utils::createChildNode FOREACH labels-»
|
|
48 |
«ENDIF-»
|
|
49 |
}
|
|
50 |
«EXPAND additions-»
|
|
51 |
}
|
|
52 |
«ENDDEFINE»
|
|
53 |
|
|
54 |
«DEFINE additions FOR gmfgen::GenLink»«ENDDEFINE»
|