ASSIGNED - bug 336488: move DiagramEditor base classes to public API 
https://bugs.eclipse.org/bugs/show_bug.cgi?id=336488

move refresh performance cache into own clas to reduce complexity of
DiagramEditorInternal
use PrecisionPoint to remove deprecation
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/DiagramEditorInternal.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/DiagramEditorInternal.java
index 879e527..7016c71 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/DiagramEditorInternal.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/DiagramEditorInternal.java
@@ -28,7 +28,6 @@
 
 import java.util.ArrayList;
 import java.util.EventObject;
-import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
@@ -110,7 +109,6 @@
 import org.eclipse.graphiti.internal.pref.GFPreferences;
 import org.eclipse.graphiti.internal.services.GraphitiInternal;
 import org.eclipse.graphiti.internal.util.T;
-import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
 import org.eclipse.graphiti.mm.pictograms.Diagram;
 import org.eclipse.graphiti.mm.pictograms.PictogramElement;
 import org.eclipse.graphiti.platform.IDiagramEditor;
@@ -118,7 +116,6 @@
 import org.eclipse.graphiti.tb.DefaultToolBehaviorProvider;
 import org.eclipse.graphiti.tb.IToolBehaviorProvider;
 import org.eclipse.graphiti.ui.editor.DiagramEditorContextMenuProvider;
-import org.eclipse.graphiti.ui.editor.DiagramEditorInputFactory;
 import org.eclipse.graphiti.ui.editor.DiagramEditorInput;
 import org.eclipse.graphiti.ui.internal.GraphitiUIPlugin;
 import org.eclipse.graphiti.ui.internal.IResourceRegistry;
@@ -271,19 +268,18 @@
 
 	private boolean directEditingActive = false;
 
-	/* keep refreshed EP/GA/PE to avoid multiple refresh of same figure */
-	private HashSet<EditPart> refreshedFigure4EP = new HashSet<EditPart>();
-
-	private HashSet<GraphicsAlgorithm> refreshedFigure4GA = new HashSet<GraphicsAlgorithm>();
-
-	private HashSet<PictogramElement> refreshedFigure4PE = new HashSet<PictogramElement>();
-
 	private IResourceRegistry resourceRegistry = new ResourceRegistry();
 
 	private boolean autoRefresh = true;
 
 	private TransactionalEditingDomain editingDomain = null;
 
+	private RefreshPerformanceCache refreshPerformanceCache = new RefreshPerformanceCache();
+
+	public RefreshPerformanceCache getRefreshPerformanceCache() {
+		return refreshPerformanceCache;
+	}
+
 	/**
 	 * Instantiates a new diagram editor.
 	 */
@@ -945,32 +941,7 @@
 		return pictogramElementsForSelection;
 	}
 
-	/**
-	 * Gets the refreshed figure4 ep.
-	 * 
-	 * @return the refreshed figure4 ep
-	 */
-	public HashSet<EditPart> getRefreshedFigure4EP() {
-		return refreshedFigure4EP;
-	}
 
-	/**
-	 * Gets the refreshed figure4 ga.
-	 * 
-	 * @return the refreshed figure4 ga
-	 */
-	public HashSet<GraphicsAlgorithm> getRefreshedFigure4GA() {
-		return refreshedFigure4GA;
-	}
-
-	/**
-	 * Gets the refreshed figure4 pe.
-	 * 
-	 * @return the refreshed figure4 pe
-	 */
-	public HashSet<PictogramElement> getRefreshedFigure4PE() {
-		return refreshedFigure4PE;
-	}
 
 	@Override
 	public IResourceRegistry getResourceRegistry() {
@@ -1299,15 +1270,6 @@
 		return autoRefresh;
 	}
 
-	/**
-	 * Inits the refresh.
-	 */
-	public void initRefresh() {
-		refreshedFigure4EP = new HashSet<EditPart>();
-		refreshedFigure4GA = new HashSet<GraphicsAlgorithm>();
-		refreshedFigure4PE = new HashSet<PictogramElement>();
-	}
-
 	@Override
 	public void refresh() {
 
@@ -1661,7 +1623,9 @@
 																// resource
 			IDiagramTypeProvider diagramTypeProvider = getConfigurationProvider().getDiagramTypeProvider();
 			diagramTypeProvider.resourceReloaded(diagram);
-			initRefresh(); // clean performance hashtables which have references
+			getRefreshPerformanceCache().initRefresh(); // clean performance
+														// hashtables which have
+														// references
 							// to old proxies
 			setPictogramElementsForSelection(null);
 			getGraphicalViewer().setContents(diagram); // create new edit parts
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/DiagramRefreshJob.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/DiagramRefreshJob.java
index 594383a..471f839 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/DiagramRefreshJob.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/DiagramRefreshJob.java
@@ -16,8 +16,8 @@
 package org.eclipse.graphiti.ui.internal.editor;
 
 import java.util.HashSet;
-import java.util.Set;
 import java.util.Map.Entry;
+import java.util.Set;
 
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
@@ -91,7 +91,7 @@
 			}
 		}
 
-		ed.initRefresh();
+		ed.getRefreshPerformanceCache().initRefresh();
 		// prove if switch to auto activate direct editing is required
 		// if yes, call always global editor refresh -> this refresh will activate the direct editing
 		IDirectEditingInfo dei = ed.getConfigurationProvider().getFeatureProvider().getDirectEditingInfo();
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/RefreshPerformanceCache.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/RefreshPerformanceCache.java
new file mode 100644
index 0000000..86efafe
--- /dev/null
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/RefreshPerformanceCache.java
@@ -0,0 +1,66 @@
+package org.eclipse.graphiti.ui.internal.editor;

+

+import java.util.HashSet;

+

+import org.eclipse.gef.EditPart;

+import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;

+import org.eclipse.graphiti.mm.pictograms.PictogramElement;

+

+public class RefreshPerformanceCache {

+

+	/* keep refreshed EP/GA/PE to avoid multiple refresh of same figure */

+	private HashSet<EditPart> refreshedFigure4EP = new HashSet<EditPart>();

+

+	private HashSet<GraphicsAlgorithm> refreshedFigure4GA = new HashSet<GraphicsAlgorithm>();

+

+	private HashSet<PictogramElement> refreshedFigure4PE = new HashSet<PictogramElement>();

+

+	/**

+	 * Gets the refreshed figure4 ep.

+	 * 

+	 * @return the refreshed figure4 ep

+	 */

+	public HashSet<EditPart> getRefreshedFigure4EP() {

+		return refreshedFigure4EP;

+	}

+

+	/**

+	 * Gets the refreshed figure4 ga.

+	 * 

+	 * @return the refreshed figure4 ga

+	 */

+	public HashSet<GraphicsAlgorithm> getRefreshedFigure4GA() {

+		return refreshedFigure4GA;

+	}

+

+	/**

+	 * Gets the refreshed figure4 pe.

+	 * 

+	 * @return the refreshed figure4 pe

+	 */

+	public HashSet<PictogramElement> getRefreshedFigure4PE() {

+		return refreshedFigure4PE;

+	}

+

+	/**

+	 * Inits the refresh.

+	 */

+	public void initRefresh() {

+		refreshedFigure4EP.clear();

+		refreshedFigure4GA.clear();

+		refreshedFigure4PE.clear();

+	}

+

+	public boolean shouldRefresh(EditPart ep) {

+		return getRefreshedFigure4EP().add(ep);

+	}

+

+	public boolean shouldRefresh(PictogramElement pe) {

+		return getRefreshedFigure4PE().add(pe);

+	}

+

+	public boolean shouldRefresh(GraphicsAlgorithm ga) {

+		return getRefreshedFigure4GA().add(ga);

+	}

+

+}

diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/parts/DiagramEditPart.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/parts/DiagramEditPart.java
index d2dfcc5..dff304a 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/parts/DiagramEditPart.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/parts/DiagramEditPart.java
@@ -179,7 +179,7 @@
 	@Override
 	public void refresh() {
 		DiagramEditorInternal editor = (DiagramEditorInternal) getConfigurationProvider().getWorkbenchPart();
-		editor.initRefresh();
+		editor.getRefreshPerformanceCache().initRefresh();
 		super.refresh();
 	}
 }
\ No newline at end of file
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/parts/PictogramElementDelegate.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/parts/PictogramElementDelegate.java
index cfe8cbd..bfde0a5 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/parts/PictogramElementDelegate.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/parts/PictogramElementDelegate.java
@@ -40,6 +40,7 @@
 import org.eclipse.draw2d.geometry.Dimension;
 import org.eclipse.draw2d.geometry.Point;
 import org.eclipse.draw2d.geometry.PointList;
+import org.eclipse.draw2d.geometry.PrecisionPoint;
 import org.eclipse.gef.EditPart;
 import org.eclipse.gef.EditPartViewer;
 import org.eclipse.gef.GraphicalEditPart;
@@ -318,7 +319,7 @@
 
 		// DR: Avoid multiple refresh of the same edit part
 		if (!isForceRefresh() && getEditor().isMultipleRefreshSupressionActive()) {
-			if (!getEditor().getRefreshedFigure4EP().add(getContainerEditPart())) {
+			if (!getEditor().getRefreshPerformanceCache().shouldRefresh(getContainerEditPart())) {
 				return;
 			}
 		}
@@ -439,7 +440,7 @@
 		}
 
 		if (!isForceRefresh() && getEditor().isMultipleRefreshSupressionActive()) {
-			if (!getEditor().getRefreshedFigure4GA().add(graphicsAlgorithm)) {
+			if (!getEditor().getRefreshPerformanceCache().shouldRefresh(graphicsAlgorithm)) {
 				return;
 			}
 		}
@@ -1062,7 +1063,7 @@
 
 		if (pe != null) {
 			if (!isForceRefresh() && getEditor().isMultipleRefreshSupressionActive()) {
-				if (!getEditor().getRefreshedFigure4PE().add(pe)) {
+				if (!getEditor().getRefreshPerformanceCache().shouldRefresh(pe)) {
 					return;
 				}
 			}
@@ -1299,7 +1300,7 @@
 					+ gaLocation.getX();
 			double newY = gaBoundsForAnchor.getY() + (gaBoundsForAnchor.getHeight() * bra.getRelativeHeight())
 					+ gaLocation.getY();
-			point = new Point(newX, newY);
+			point = new PrecisionPoint(newX, newY);
 
 		} else if (pe instanceof FixPointAnchor && pe.equals(graphicsAlgorithm.getPictogramElement())) {
 			FixPointAnchor fpa = (FixPointAnchor) pe;