I'm having to temporalily "un-refactor" change to IObservationProvider name pending a IP issue question that affects 3rd part dependencies.
diff --git a/org.eclipse.amp.agf/plugins/org.eclipse.amp.agf.core/src/org/eclipse/amp/agf/gef/GenericEditPart.java b/org.eclipse.amp.agf/plugins/org.eclipse.amp.agf.core/src/org/eclipse/amp/agf/gef/GenericEditPart.java
index 94fdcfe..ee50903 100644
--- a/org.eclipse.amp.agf/plugins/org.eclipse.amp.agf.core/src/org/eclipse/amp/agf/gef/GenericEditPart.java
+++ b/org.eclipse.amp.agf/plugins/org.eclipse.amp.agf.core/src/org/eclipse/amp/agf/gef/GenericEditPart.java
@@ -36,7 +36,9 @@
import org.eclipse.draw2d.geometry.Insets;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.EditPolicy;
import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
+import org.eclipse.gef.editpolicies.SelectionEditPolicy;
import org.eclipse.ui.statushandlers.StatusManager;
public abstract class GenericEditPart extends AbstractGraphicalEditPart implements PropertyChangeListener {
@@ -48,14 +50,16 @@
public static final Border HIGHLIGHT_RECTANGLE = new MarginBorder(2) {
@Override
public void paint(IFigure figure, Graphics graphics, Insets insets) {
- Rectangle r = new Rectangle(new Point(0, 0), SIZE_INSET_1);
- graphics.setLineWidth(2);
- graphics.setForegroundColor(ColorConstants.yellow);
+ Rectangle r = Rectangle.SINGLETON;
+ r.setBounds(figure.getBounds());
+ r.shrink(1, 1);
+ graphics.setLineWidth(figure.getBounds().width / 10);
+ graphics.setForegroundColor(ColorConstants.black);
graphics.setLineStyle(Graphics.LINE_SOLID);
// graphics.setXORMode(false);
graphics.drawRectangle(r);
graphics.setLineStyle(Graphics.LINE_DASH);
- graphics.setForegroundColor(ColorConstants.black);
+ graphics.setForegroundColor(ColorConstants.yellow);
graphics.drawRectangle(r);
}
};
@@ -70,6 +74,7 @@
graphics.setForegroundColor(ColorConstants.black);
graphics.drawOval(r);
r.shrink(1, 1);
+ graphics.setLineStyle(Graphics.LINE_DASH);
graphics.setForegroundColor(ColorConstants.yellow);
graphics.drawOval(r);
}
@@ -278,22 +283,22 @@
}
protected void createEditPolicies() {
- // installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new SelectionEditPolicy() {
- //
- // @Override
- // protected void setSelectedState(int type) {
- // super.setSelectedState(type);
- // updateSelection();
- // }
- //
- // @Override
- // protected void hideSelection() {
- // }
- //
- // @Override
- // protected void showSelection() {
- // }
- // });
+ installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new SelectionEditPolicy() {
+
+ @Override
+ protected void setSelectedState(int type) {
+ super.setSelectedState(type);
+ updateSelection();
+ }
+
+ @Override
+ protected void hideSelection() {
+ }
+
+ @Override
+ protected void showSelection() {
+ }
+ });
}
public void propertyChange(PropertyChangeEvent evt) {