Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoratikhomirov2010-04-21 16:30:37 -0400
committeratikhomirov2010-04-21 16:30:37 -0400
commit647484e48e1f54a3b28e5e8cbf9e0db2f171ed9a (patch)
tree6a92b90ea056c0797aa521b2e4cd20c307d96d47
parent0885e8eef90a367f467871a80ed43f856131528e (diff)
downloadorg.eclipse.gmf-tooling-647484e48e1f54a3b28e5e8cbf9e0db2f171ed9a.tar.gz
org.eclipse.gmf-tooling-647484e48e1f54a3b28e5e8cbf9e0db2f171ed9a.tar.xz
org.eclipse.gmf-tooling-647484e48e1f54a3b28e5e8cbf9e0db2f171ed9a.zip
[251372] use Draw2d.ScalablePolygonShape instead custom code
-rw-r--r--tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/setup/figures/GenericFigureCheck.java20
1 files changed, 8 insertions, 12 deletions
diff --git a/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/setup/figures/GenericFigureCheck.java b/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/setup/figures/GenericFigureCheck.java
index 27f3c4cf2..adbbf40f5 100644
--- a/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/setup/figures/GenericFigureCheck.java
+++ b/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/setup/figures/GenericFigureCheck.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006 Borland Software Corporation
+ * Copyright (c) 2006, 2010 Borland Software Corporation and others
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -17,8 +17,10 @@ import java.lang.reflect.Method;
import java.util.Iterator;
import java.util.List;
+import org.eclipse.draw2d.AbstractPointListShape;
import org.eclipse.draw2d.Graphics;
import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.ScalablePolygonShape;
import org.eclipse.draw2d.geometry.PointList;
import org.eclipse.draw2d.geometry.Transform;
import org.eclipse.emf.codegen.util.CodeGenUtil;
@@ -164,15 +166,15 @@ public class GenericFigureCheck extends FigureCheck {
protected void checkPolylinePoints(Figure gmfFigure, IFigure d2dFigure) {
if (gmfFigure instanceof ScalablePolygon){
- checkScalablePolygon((ScalablePolygon) gmfFigure, d2dFigure);
- //ad hoc code is generated, not related to d2d.Polyline
- return;
+ assertNotNull(d2dFigure);
+ assertTrue(ScalablePolygonShape.class.isInstance(d2dFigure));
+ // FALL-THROUGH, test as regular point list owner
}
if (gmfFigure instanceof Polyline && gmfFigure.eIsSet(GMFGraphPackage.eINSTANCE.getPolyline_Template())) {
Polyline gmfPolyline = (Polyline) gmfFigure;
- assertTrue(d2dFigure instanceof org.eclipse.draw2d.Polyline);
- org.eclipse.draw2d.Polyline d2dPolyline = (org.eclipse.draw2d.Polyline) d2dFigure;
+ assertTrue(d2dFigure instanceof AbstractPointListShape);
+ AbstractPointListShape d2dPolyline = (AbstractPointListShape) d2dFigure;
PointList d2dPoints = d2dPolyline.getPoints();
List<Point> gmfPoints = gmfPolyline.getTemplate();
@@ -192,12 +194,6 @@ public class GenericFigureCheck extends FigureCheck {
}
}
- protected void checkScalablePolygon(ScalablePolygon gmfFigure, IFigure figure) {
- //hard to write checks -- we do not even know the class of d2d figure
- //all we may check is that it can be compiled and instantiated
- assertNotNull(figure);
- }
-
private void checkPoint(Transform tr, Point ePoint, org.eclipse.draw2d.geometry.Point d2dPoint) {
assertEquals(tr.getTransformed(new org.eclipse.draw2d.geometry.Point(ePoint.getX(), ePoint.getY())), d2dPoint);
}

Back to the top