Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbblajer2007-07-04 13:22:22 +0000
committerbblajer2007-07-04 13:22:22 +0000
commit5f5bc699da368afbc6bba459c398165f37e08d9a (patch)
treeb92addd2606817b222cf2ed1814524b886bf54d2 /plugins/org.eclipse.gmf.runtime.lite/src/org
parent6f0aacbc7d42d7b869defa91a363efc0a19400d4 (diff)
downloadorg.eclipse.gmf-tooling-5f5bc699da368afbc6bba459c398165f37e08d9a.tar.gz
org.eclipse.gmf-tooling-5f5bc699da368afbc6bba459c398165f37e08d9a.tar.xz
org.eclipse.gmf-tooling-5f5bc699da368afbc6bba459c398165f37e08d9a.zip
Eliminated Jet templates in lite version;
i18n in lite RT; For generated classes whose names are not directly modifiable via gmfgen file, consistent className/qualifiedClassName template is exposed (and used throughout the generation process, including the Generator); Link labels and external node labels are not selectable, but movable; Inner elements are not selectable with marquee tool; Fixed copyright statements throughout the lite RT.
Diffstat (limited to 'plugins/org.eclipse.gmf.runtime.lite/src/org')
-rw-r--r--plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/internal/runtime/lite/Activator.java2
-rw-r--r--plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/commands/ChangeLocationCommand.java77
-rw-r--r--plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/commands/CreateNotationalEdgeCommand.java2
-rw-r--r--plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/commands/CreateNotationalElementCommand.java2
-rw-r--r--plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/commands/ReconnectNotationalEdgeSourceCommand.java2
-rw-r--r--plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/commands/ReconnectNotationalEdgeTargetCommand.java2
-rw-r--r--plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/commands/RemoveNotationalEdgeCommand.java2
-rw-r--r--plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/commands/RemoveNotationalElementCommand.java2
-rw-r--r--plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/commands/ReplaceNotationalElementCommand.java2
-rw-r--r--plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/labels/BaseExternalLabelEditPart.java115
-rw-r--r--plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/labels/BaseExternalNodeLabelEditPart.java29
-rw-r--r--plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/labels/BaseLinkLabelEditPart.java52
-rw-r--r--plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/tree/DiagramTreeEditPartFactory.java2
-rw-r--r--plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/update/canonical/ChildNotationModelRefresher.java2
-rw-r--r--plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/update/canonical/DelegatingViewService.java2
-rw-r--r--plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/update/canonical/EditPartRegistryBasedViewService.java2
-rw-r--r--plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/update/canonical/ElementDescriptor.java2
-rw-r--r--plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/update/canonical/IViewService.java2
-rw-r--r--plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/update/canonical/LinkDescriptor.java2
-rw-r--r--plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/update/canonical/NaiveViewService.java2
-rw-r--r--plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/update/canonical/OwnedLinksNotationModelRefresher.java2
-rw-r--r--plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/properties/PropertySourceProvider.java2
-rw-r--r--plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/properties/ResetValueCommand.java2
-rw-r--r--plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/properties/RootUndoablePropertySheetEntry.java2
-rw-r--r--plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/properties/SetValueCommand.java2
-rw-r--r--plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/properties/UndoablePropertySheetEntry.java2
-rw-r--r--plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/requests/CreateConnectionRequestEx.java2
-rw-r--r--plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/requests/CreateRequestEx.java2
-rw-r--r--plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/requests/ModelCreationFactory.java2
-rw-r--r--plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/services/IViewDecorator.java2
-rw-r--r--plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/services/ParserUtil.java2
31 files changed, 273 insertions, 54 deletions
diff --git a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/internal/runtime/lite/Activator.java b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/internal/runtime/lite/Activator.java
index 46484eae9..c6eab4b97 100644
--- a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/internal/runtime/lite/Activator.java
+++ b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/internal/runtime/lite/Activator.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006 Eclipse.org
+ * Copyright (c) 2006 Borland Software Corporation
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
diff --git a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/commands/ChangeLocationCommand.java b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/commands/ChangeLocationCommand.java
new file mode 100644
index 000000000..19e352132
--- /dev/null
+++ b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/commands/ChangeLocationCommand.java
@@ -0,0 +1,77 @@
+/**
+ * Copyright (c) 2007 Borland Software Corporation
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * bblajer - initial API and implementation
+ */
+package org.eclipse.gmf.runtime.lite.commands;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.common.command.AbstractCommand;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.transaction.util.TransactionUtil;
+import org.eclipse.gef.requests.ChangeBoundsRequest;
+import org.eclipse.gmf.runtime.notation.Node;
+import org.eclipse.gmf.runtime.notation.Location;
+
+public class ChangeLocationCommand extends AbstractCommand {
+ private final Node myNode;
+ private final ChangeBoundsRequest myRequest;
+ private final IFigure myReferenceFigure;
+
+ private Point myMoveDelta;
+
+ public ChangeLocationCommand(Node node, ChangeBoundsRequest request, IFigure figure) {
+ super("Change node position/size");
+ myNode = node;
+ myRequest = request;
+ myReferenceFigure = figure;
+ }
+
+ public boolean canUndo() {
+ return canExecute();
+ }
+
+ protected boolean prepare() {
+ if (myNode.getLayoutConstraint() instanceof Location == false) {
+ return false;
+ }
+ TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(myNode);
+ if (domain != null && domain.isReadOnly(myNode.eResource())) {
+ return false;
+ }
+ Location location = (Location) myNode.getLayoutConstraint();
+ Rectangle original = new Rectangle(location.getX(), location.getY(), 0, 0);
+ myReferenceFigure.translateToAbsolute(original);
+ Rectangle transformed = myRequest.getTransformedRectangle(original);
+ myReferenceFigure.translateToRelative(transformed);
+ myReferenceFigure.translateToRelative(original);
+ myMoveDelta = transformed.getTopLeft().translate(original.getTopLeft().negate());
+ return true;
+ }
+
+ public void undo() {
+ execute(myMoveDelta.getNegated());
+ }
+
+ public void execute() {
+ execute(myMoveDelta);
+ }
+
+ public void redo() {
+ execute();
+ }
+
+ private void execute(Point move) {
+ Location location = (Location) myNode.getLayoutConstraint();
+ location.setX(location.getX() + move.x);
+ location.setY(location.getY() + move.y);
+ }
+}
diff --git a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/commands/CreateNotationalEdgeCommand.java b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/commands/CreateNotationalEdgeCommand.java
index b1ec5be9a..128c2ff5e 100644
--- a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/commands/CreateNotationalEdgeCommand.java
+++ b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/commands/CreateNotationalEdgeCommand.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006 Eclipse.org
+ * Copyright (c) 2006 Borland Software Corporation
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
diff --git a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/commands/CreateNotationalElementCommand.java b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/commands/CreateNotationalElementCommand.java
index 1f026af17..93401fb43 100644
--- a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/commands/CreateNotationalElementCommand.java
+++ b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/commands/CreateNotationalElementCommand.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006 Eclipse.org
+ * Copyright (c) 2006 Borland Software Corporation
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
diff --git a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/commands/ReconnectNotationalEdgeSourceCommand.java b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/commands/ReconnectNotationalEdgeSourceCommand.java
index de520cd28..088732311 100644
--- a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/commands/ReconnectNotationalEdgeSourceCommand.java
+++ b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/commands/ReconnectNotationalEdgeSourceCommand.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006 Eclipse.org
+ * Copyright (c) 2006 Borland Software Corporation
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
diff --git a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/commands/ReconnectNotationalEdgeTargetCommand.java b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/commands/ReconnectNotationalEdgeTargetCommand.java
index 72c482894..4fa2b4e5b 100644
--- a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/commands/ReconnectNotationalEdgeTargetCommand.java
+++ b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/commands/ReconnectNotationalEdgeTargetCommand.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006 Eclipse.org
+ * Copyright (c) 2006 Borland Software Corporation
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
diff --git a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/commands/RemoveNotationalEdgeCommand.java b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/commands/RemoveNotationalEdgeCommand.java
index 741babe1f..c3862785a 100644
--- a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/commands/RemoveNotationalEdgeCommand.java
+++ b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/commands/RemoveNotationalEdgeCommand.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006 Eclipse.org
+ * Copyright (c) 2006 Borland Software Corporation
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
diff --git a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/commands/RemoveNotationalElementCommand.java b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/commands/RemoveNotationalElementCommand.java
index 610de6a29..8b7bdc6f8 100644
--- a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/commands/RemoveNotationalElementCommand.java
+++ b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/commands/RemoveNotationalElementCommand.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006 Eclipse.org
+ * Copyright (c) 2006 Borland Software Corporation
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
diff --git a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/commands/ReplaceNotationalElementCommand.java b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/commands/ReplaceNotationalElementCommand.java
index 005ba0dbd..d34179353 100644
--- a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/commands/ReplaceNotationalElementCommand.java
+++ b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/commands/ReplaceNotationalElementCommand.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006 Eclipse.org
+ * Copyright (c) 2006 Borland Software Corporation
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
diff --git a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/labels/BaseExternalLabelEditPart.java b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/labels/BaseExternalLabelEditPart.java
new file mode 100644
index 000000000..f5266dc2a
--- /dev/null
+++ b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/labels/BaseExternalLabelEditPart.java
@@ -0,0 +1,115 @@
+/**
+ * Copyright (c) 2007 Borland Software Corporation
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * bblajer - initial API and implementation
+ */
+package org.eclipse.gmf.runtime.lite.edit.parts.labels;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.transaction.util.TransactionUtil;
+import org.eclipse.gef.DragTracker;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Handle;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.RequestConstants;
+import org.eclipse.gef.SharedCursors;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
+import org.eclipse.gef.editpolicies.ResizableEditPolicy;
+import org.eclipse.gef.handles.NonResizableHandleKit;
+import org.eclipse.gef.requests.ChangeBoundsRequest;
+import org.eclipse.gef.tools.DragEditPartsTracker;
+import org.eclipse.gmf.runtime.lite.commands.ChangeLocationCommand;
+import org.eclipse.gmf.runtime.lite.commands.WrappingCommand;
+import org.eclipse.gmf.runtime.lite.edit.parts.update.IExternallyUpdatableEditPart;
+import org.eclipse.gmf.runtime.lite.edit.parts.update.UpdaterUtil;
+import org.eclipse.gmf.runtime.notation.Node;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.swt.graphics.Cursor;
+
+public abstract class BaseExternalLabelEditPart extends AbstractGraphicalEditPart {
+ public BaseExternalLabelEditPart(View view) {
+ setModel(view);
+ }
+
+ @Override
+ protected void createEditPolicies() {
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ResizableEditPolicy() {
+ @Override
+ public EditPart getTargetEditPart(Request request) {
+ if (RequestConstants.REQ_SELECTION.equals(request.getType())) {
+ return getHost().getParent();
+ }
+ return super.getTargetEditPart(request);
+ }
+ @Override
+ protected Command getMoveCommand(ChangeBoundsRequest request) {
+ final Node node = (Node) getModel();
+ ChangeLocationCommand emfCommand = new ChangeLocationCommand(node, request, getFigure());
+ return new WrappingCommand(TransactionUtil.getEditingDomain(node.getDiagram().getElement()), emfCommand);
+ }
+ });
+ }
+
+ public List<Handle> createSelectionHandles() {
+ ArrayList<Handle> result = new ArrayList<Handle>();
+ NonResizableHandleKit.addHandles(this, result, getLabelDragTracker(), getHandleCursor());
+ return result;
+ }
+
+ protected Cursor getHandleCursor() {
+ return SharedCursors.HAND;
+ }
+
+ protected DragTracker getLabelDragTracker() {
+ return new DragEditPartsTracker(this) {
+ @Override
+ protected boolean isMove() {
+ return true;
+ }
+ @Override
+ protected boolean handleButtonUp(int button) {
+ boolean result = super.handleButtonUp(button);
+ getViewer().setSelection(new StructuredSelection(getParent()));
+ return result;
+ }
+ };
+ }
+
+ protected IExternallyUpdatableEditPart.ExternalRefresher boundsRefresher = new IExternallyUpdatableEditPart.ExternalRefresher() {
+ public void refresh() {
+ if (!isActive()) {
+ return;
+ }
+ refreshBounds();
+ }
+ public boolean isAffectingEvent(Notification msg) {
+ if (NotationPackage.eINSTANCE.getLocation().getEStructuralFeatures().contains(msg.getFeature())) {
+ return true;
+ }
+ if (NotationPackage.eINSTANCE.getNode_LayoutConstraint() == msg.getFeature()) {
+ return UpdaterUtil.affects(msg, NotationPackage.eINSTANCE.getLocation());
+ }
+ return false;
+ }
+ };
+
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshBounds();
+ }
+
+ protected abstract void refreshBounds();
+}
diff --git a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/labels/BaseExternalNodeLabelEditPart.java b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/labels/BaseExternalNodeLabelEditPart.java
index a1dd91599..d4f20fff8 100644
--- a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/labels/BaseExternalNodeLabelEditPart.java
+++ b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/labels/BaseExternalNodeLabelEditPart.java
@@ -15,19 +15,14 @@ import org.eclipse.draw2d.AbstractLocator;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.PositionConstants;
import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.gmf.runtime.lite.edit.parts.update.IExternallyUpdatableEditPart;
-import org.eclipse.gmf.runtime.lite.edit.parts.update.UpdaterUtil;
import org.eclipse.gmf.runtime.notation.Location;
import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
-public abstract class BaseExternalNodeLabelEditPart extends AbstractGraphicalEditPart {
+public abstract class BaseExternalNodeLabelEditPart extends BaseExternalLabelEditPart {
public BaseExternalNodeLabelEditPart(View view) {
- setModel(view);
+ super(view);
}
public void refreshBounds() {
@@ -47,26 +42,6 @@ public abstract class BaseExternalNodeLabelEditPart extends AbstractGraphicalEdi
});
}
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshBounds();
- }
-
- protected IExternallyUpdatableEditPart.ExternalRefresher boundsRefresher = new IExternallyUpdatableEditPart.ExternalRefresher() {
- public void refresh() {
- refreshBounds();
- }
- public boolean isAffectingEvent(Notification msg) {
- if (NotationPackage.eINSTANCE.getLocation().getEStructuralFeatures().contains(msg.getFeature())) {
- return true;
- }
- if (NotationPackage.eINSTANCE.getNode_LayoutConstraint() == msg.getFeature()) {
- return UpdaterUtil.affects(msg, NotationPackage.eINSTANCE.getLocation());
- }
- return false;
- }
- };
-
public Point getReferencePoint() {
return getLabelLocation(((GraphicalEditPart) getParent()).getFigure());
}
diff --git a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/labels/BaseLinkLabelEditPart.java b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/labels/BaseLinkLabelEditPart.java
new file mode 100644
index 000000000..ba4fa1497
--- /dev/null
+++ b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/labels/BaseLinkLabelEditPart.java
@@ -0,0 +1,52 @@
+/**
+ * Copyright (c) 2007 Borland Software Corporation
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * bblajer - initial API and implementation
+ */
+package org.eclipse.gmf.runtime.lite.edit.parts.labels;
+
+import org.eclipse.draw2d.Connection;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.editpolicies.ConnectionEndpointEditPolicy;
+import org.eclipse.gmf.runtime.notation.Location;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.gmf.runtime.notation.Node;
+
+public abstract class BaseLinkLabelEditPart extends BaseExternalLabelEditPart {
+ public BaseLinkLabelEditPart(View view) {
+ super(view);
+ }
+
+ @Override
+ protected void createEditPolicies() {
+ super.createEditPolicies();
+// installEditPolicy(EditPolicy.CONNECTION_ENDPOINTS_ROLE, new ConnectionEndpointEditPolicy() {
+// public EditPart getHost() {
+// return getParent();
+// }
+// });
+ }
+
+ protected void refreshBounds() {
+ Node node = (Node) getModel();
+ assert node.getLayoutConstraint() instanceof Location;
+ final Location location = (Location) node.getLayoutConstraint();
+ GraphicalEditPart parent = (GraphicalEditPart) getParent();
+ Connection connection = (Connection) parent.getFigure();
+ parent.setLayoutConstraint(this, getFigure(), new org.eclipse.draw2d.ConnectionLocator(connection, getAlignment()) {
+ protected org.eclipse.draw2d.geometry.Point getReferencePoint() {
+ return super.getReferencePoint().translate(location.getX(), location.getY());
+ }
+ });
+ }
+
+ protected abstract int getAlignment();
+}
diff --git a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/tree/DiagramTreeEditPartFactory.java b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/tree/DiagramTreeEditPartFactory.java
index 78afb45ae..7da460362 100644
--- a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/tree/DiagramTreeEditPartFactory.java
+++ b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/tree/DiagramTreeEditPartFactory.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006 Eclipse.org
+ * Copyright (c) 2006 Borland Software Corporation
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
diff --git a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/update/canonical/ChildNotationModelRefresher.java b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/update/canonical/ChildNotationModelRefresher.java
index c1b62063d..72241c0aa 100644
--- a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/update/canonical/ChildNotationModelRefresher.java
+++ b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/update/canonical/ChildNotationModelRefresher.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006 Eclipse.org
+ * Copyright (c) 2006 Borland Software Corporation
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
diff --git a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/update/canonical/DelegatingViewService.java b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/update/canonical/DelegatingViewService.java
index bf2d006ec..000182de9 100644
--- a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/update/canonical/DelegatingViewService.java
+++ b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/update/canonical/DelegatingViewService.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006 Eclipse.org
+ * Copyright (c) 2006 Borland Software Corporation
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
diff --git a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/update/canonical/EditPartRegistryBasedViewService.java b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/update/canonical/EditPartRegistryBasedViewService.java
index ce59d7cfd..88d7b0c80 100644
--- a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/update/canonical/EditPartRegistryBasedViewService.java
+++ b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/update/canonical/EditPartRegistryBasedViewService.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006 Eclipse.org
+ * Copyright (c) 2006 Borland Software Corporation
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
diff --git a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/update/canonical/ElementDescriptor.java b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/update/canonical/ElementDescriptor.java
index 4847f42b5..157d75a56 100644
--- a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/update/canonical/ElementDescriptor.java
+++ b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/update/canonical/ElementDescriptor.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006 Eclipse.org
+ * Copyright (c) 2006 Borland Software Corporation
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
diff --git a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/update/canonical/IViewService.java b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/update/canonical/IViewService.java
index 053f20a78..7d784eac4 100644
--- a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/update/canonical/IViewService.java
+++ b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/update/canonical/IViewService.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006 Eclipse.org
+ * Copyright (c) 2006 Borland Software Corporation
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
diff --git a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/update/canonical/LinkDescriptor.java b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/update/canonical/LinkDescriptor.java
index 5b96d3ec6..24122c41b 100644
--- a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/update/canonical/LinkDescriptor.java
+++ b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/update/canonical/LinkDescriptor.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006 Eclipse.org
+ * Copyright (c) 2006 Borland Software Corporation
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
diff --git a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/update/canonical/NaiveViewService.java b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/update/canonical/NaiveViewService.java
index a57a68e12..8cb08e3e2 100644
--- a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/update/canonical/NaiveViewService.java
+++ b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/update/canonical/NaiveViewService.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006 Eclipse.org
+ * Copyright (c) 2006 Borland Software Corporation
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
diff --git a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/update/canonical/OwnedLinksNotationModelRefresher.java b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/update/canonical/OwnedLinksNotationModelRefresher.java
index 73df6995d..5a5a94ec2 100644
--- a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/update/canonical/OwnedLinksNotationModelRefresher.java
+++ b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/parts/update/canonical/OwnedLinksNotationModelRefresher.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006 Eclipse.org
+ * Copyright (c) 2006 Borland Software Corporation
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
diff --git a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/properties/PropertySourceProvider.java b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/properties/PropertySourceProvider.java
index c32143412..95aa9d458 100644
--- a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/properties/PropertySourceProvider.java
+++ b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/properties/PropertySourceProvider.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006 Eclipse.org
+ * Copyright (c) 2006 Borland Software Corporation
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
diff --git a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/properties/ResetValueCommand.java b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/properties/ResetValueCommand.java
index 99095924c..c7a07a166 100644
--- a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/properties/ResetValueCommand.java
+++ b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/properties/ResetValueCommand.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006 Eclipse.org
+ * Copyright (c) 2006 Borland Software Corporation
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
diff --git a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/properties/RootUndoablePropertySheetEntry.java b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/properties/RootUndoablePropertySheetEntry.java
index dd46da765..39756faa9 100644
--- a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/properties/RootUndoablePropertySheetEntry.java
+++ b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/properties/RootUndoablePropertySheetEntry.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006 Eclipse.org
+ * Copyright (c) 2006 Borland Software Corporation
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
diff --git a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/properties/SetValueCommand.java b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/properties/SetValueCommand.java
index 49f7c9f36..c033ced76 100644
--- a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/properties/SetValueCommand.java
+++ b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/properties/SetValueCommand.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006 Eclipse.org
+ * Copyright (c) 2006 Borland Software Corporation
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
diff --git a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/properties/UndoablePropertySheetEntry.java b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/properties/UndoablePropertySheetEntry.java
index fd3e7f53c..7d13cedef 100644
--- a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/properties/UndoablePropertySheetEntry.java
+++ b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/properties/UndoablePropertySheetEntry.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006 Eclipse.org
+ * Copyright (c) 2006 Borland Software Corporation
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
diff --git a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/requests/CreateConnectionRequestEx.java b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/requests/CreateConnectionRequestEx.java
index 65cb331b8..2e79d7b67 100644
--- a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/requests/CreateConnectionRequestEx.java
+++ b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/requests/CreateConnectionRequestEx.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006 Eclipse.org
+ * Copyright (c) 2006 Borland Software Corporation
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
diff --git a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/requests/CreateRequestEx.java b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/requests/CreateRequestEx.java
index 42b1db2f6..fde39d872 100644
--- a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/requests/CreateRequestEx.java
+++ b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/requests/CreateRequestEx.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006 Eclipse.org
+ * Copyright (c) 2006 Borland Software Corporation
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
diff --git a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/requests/ModelCreationFactory.java b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/requests/ModelCreationFactory.java
index de46ca110..772823457 100644
--- a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/requests/ModelCreationFactory.java
+++ b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/requests/ModelCreationFactory.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006 Eclipse.org
+ * Copyright (c) 2006 Borland Software Corporation
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
diff --git a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/services/IViewDecorator.java b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/services/IViewDecorator.java
index dc9f507a8..9c50ee0c4 100644
--- a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/services/IViewDecorator.java
+++ b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/services/IViewDecorator.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006 Eclipse.org
+ * Copyright (c) 2006 Borland Software Corporation
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
diff --git a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/services/ParserUtil.java b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/services/ParserUtil.java
index 6e0b6669d..3f1b4fe7e 100644
--- a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/services/ParserUtil.java
+++ b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/services/ParserUtil.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006 Eclipse.org
+ * Copyright (c) 2006 Borland Software Corporation
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0

Back to the top