Lines 13-22
Link Here
|
13 |
|
13 |
|
14 |
import junit.framework.Assert; |
14 |
import junit.framework.Assert; |
15 |
|
15 |
|
|
|
16 |
import org.eclipse.gmf.gmfgraph.ColorConstants; |
16 |
import org.eclipse.gmf.gmfgraph.Figure; |
17 |
import org.eclipse.gmf.gmfgraph.Figure; |
17 |
import org.eclipse.gmf.gmfgraph.FigureGallery; |
18 |
import org.eclipse.gmf.gmfgraph.FigureGallery; |
18 |
import org.eclipse.gmf.gmfgraph.GMFGraphFactory; |
19 |
import org.eclipse.gmf.gmfgraph.GMFGraphFactory; |
19 |
import org.eclipse.gmf.gmfgraph.Point; |
|
|
20 |
import org.eclipse.gmf.gmfgraph.PolygonDecoration; |
20 |
import org.eclipse.gmf.gmfgraph.PolygonDecoration; |
21 |
import org.eclipse.gmf.gmfgraph.PolylineConnection; |
21 |
import org.eclipse.gmf.gmfgraph.PolylineConnection; |
22 |
import org.eclipse.gmf.graphdef.codegen.StandaloneGenerator.Config; |
22 |
import org.eclipse.gmf.graphdef.codegen.StandaloneGenerator.Config; |
Lines 85-115
Link Here
|
85 |
if (myEcoreContainmentRef == null) { |
85 |
if (myEcoreContainmentRef == null) { |
86 |
myEcoreContainmentRef = GMFGraphFactory.eINSTANCE.createPolylineConnection(); |
86 |
myEcoreContainmentRef = GMFGraphFactory.eINSTANCE.createPolylineConnection(); |
87 |
myEcoreContainmentRef.setName("ContainmentRef"); |
87 |
myEcoreContainmentRef.setName("ContainmentRef"); |
88 |
PolygonDecoration df = createRhomb(); |
88 |
PolygonDecoration df = createBlueRhomb(); |
89 |
df.setFill(true); |
89 |
df.setFill(true); |
90 |
myEcoreContainmentRef.setSourceDecoration(df); |
90 |
myEcoreContainmentRef.setSourceDecoration(df); |
91 |
} |
91 |
} |
92 |
return myEcoreContainmentRef; |
92 |
return myEcoreContainmentRef; |
93 |
} |
93 |
} |
94 |
|
94 |
|
95 |
private PolygonDecoration createRhomb() { |
95 |
private PolygonDecoration createBlueRhomb() { |
96 |
PolygonDecoration df = GMFGraphFactory.eINSTANCE.createPolygonDecoration(); |
96 |
PolygonDecoration df = GMFGraphFactory.eINSTANCE.createPolygonDecoration(); |
97 |
Point p = GMFGraphFactory.eINSTANCE.createPoint(); |
97 |
df.getTemplate().add(FigureGeneratorUtil.createPoint(-1, 1)); |
98 |
p.setX(-1); |
98 |
df.getTemplate().add(FigureGeneratorUtil.createPoint(0, 0)); |
99 |
p.setY(1); |
99 |
df.getTemplate().add(FigureGeneratorUtil.createPoint(-1, -1)); |
100 |
df.getTemplate().add(p); |
100 |
df.getTemplate().add(FigureGeneratorUtil.createPoint(-2, 0)); |
101 |
p = GMFGraphFactory.eINSTANCE.createPoint(); |
101 |
|
102 |
p.setX(0); |
102 |
df.setBackgroundColor(FigureGeneratorUtil.createConstantColor(ColorConstants.BLUE_LITERAL)); |
103 |
p.setY(0); |
103 |
df.setForegroundColor(FigureGeneratorUtil.createRGBColor(0, 0, 255)); |
104 |
df.getTemplate().add(p); |
|
|
105 |
p = GMFGraphFactory.eINSTANCE.createPoint(); |
106 |
p.setX(-1); |
107 |
p.setY(-1); |
108 |
df.getTemplate().add(p); |
109 |
p = GMFGraphFactory.eINSTANCE.createPoint(); |
110 |
p.setX(-2); |
111 |
p.setY(0); |
112 |
df.getTemplate().add(p); |
113 |
return df; |
104 |
return df; |
114 |
} |
105 |
} |
115 |
|
106 |
|