Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/HighlightEditPolicy.java')
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/HighlightEditPolicy.java37
1 files changed, 4 insertions, 33 deletions
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/HighlightEditPolicy.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/HighlightEditPolicy.java
index 80c51c180d1..02fc1dd7549 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/HighlightEditPolicy.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/HighlightEditPolicy.java
@@ -11,17 +11,15 @@
*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.common.editpolicies;
-import org.eclipse.draw2d.Ellipse;
-import org.eclipse.draw2d.IFigure;
import org.eclipse.gef.EditPart;
import org.eclipse.gef.Request;
import org.eclipse.gef.editpolicies.GraphicalEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
import org.eclipse.papyrus.infra.gmfdiag.common.utils.HighlightUtil;
-import org.eclipse.swt.SWT;
/**
* EditPolicy dedicated to highligh node/edge in case of mouseover.
+ *
* @author flefevre
*
*/
@@ -29,16 +27,12 @@ public class HighlightEditPolicy extends GraphicalEditPolicy {
public static final String HIGHLIGHT_ROLE = "Highlight Edit Policy";
- protected Indicator sourceIndicator;
- protected Indicator targetIndicator;
-
- @SuppressWarnings({ "rawtypes" })
@Override
public void showTargetFeedback(Request request) {
EditPart host = getHost();
- if(RequestConstants.REQ_DROP_OBJECTS.equals(request.getType())) {
+ if (RequestConstants.REQ_DROP_OBJECTS.equals(request.getType())) {
highlight(host);
}
}
@@ -64,41 +58,18 @@ public class HighlightEditPolicy extends GraphicalEditPolicy {
HighlightUtil.unhighlight();
}
- private void safeRemoveFeedback(IFigure feedback) {
- if (feedback == null || feedback.getParent() == null) {
- return;
- }
- feedback.getParent().remove(feedback);
- }
+
@Override
public void eraseTargetFeedback(Request request) {
unhighlight();
- safeRemoveFeedback(sourceIndicator);
- sourceIndicator = null;
- safeRemoveFeedback(targetIndicator);
- targetIndicator = null;
}
@Override
public void eraseSourceFeedback(Request request) {
super.eraseSourceFeedback(request);
- safeRemoveFeedback(sourceIndicator);
- sourceIndicator = null;
- safeRemoveFeedback(targetIndicator);
- targetIndicator = null;
+
}
- private static class Indicator extends Ellipse {
- /**
- * Constructor.
- *
- */
- public Indicator() {
- setLineWidth(2);
- setAntialias(SWT.ON);
- setSize(10, 10);
- }
- }
}

Back to the top