Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcletavernie2012-11-23 10:52:23 +0000
committercletavernie2012-11-23 10:52:23 +0000
commit6424abf6e7e922c90a56eec84fd3f9b2de9dfae5 (patch)
tree8d3239a03710422cba8493b4dbe9ee2bb9aeda71 /plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src
parentc7ed19562dfcf443385c0213765c98ffc841409f (diff)
downloadorg.eclipse.papyrus-6424abf6e7e922c90a56eec84fd3f9b2de9dfae5.tar.gz
org.eclipse.papyrus-6424abf6e7e922c90a56eec84fd3f9b2de9dfae5.tar.xz
org.eclipse.papyrus-6424abf6e7e922c90a56eec84fd3f9b2de9dfae5.zip
391945: [Refactoring] Part 2: Refactoring on Kepler (0.10)
https://bugs.eclipse.org/bugs/show_bug.cgi?id=391945
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/handlers/GraphicalCommandHandler.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/DiagramDecorationAdapter.java17
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/ValidationDecoratorProvider.java4
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/AspectUnspecifiedTypeConnectionTool.java3
4 files changed, 12 insertions, 14 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/handlers/GraphicalCommandHandler.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/handlers/GraphicalCommandHandler.java
index ab0abafaf42..c3a6f30ecc2 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/handlers/GraphicalCommandHandler.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/handlers/GraphicalCommandHandler.java
@@ -130,7 +130,7 @@ public abstract class GraphicalCommandHandler extends AbstractHandler {
* @return the editing domain (can be null)
*/
protected TransactionalEditingDomain getEditingDomain() {
- ServiceUtilsForActionHandlers serviceUtils = new ServiceUtilsForActionHandlers();
+ ServiceUtilsForActionHandlers serviceUtils = ServiceUtilsForActionHandlers.getInstance();
TransactionalEditingDomain editingDomain = null;
try {
editingDomain = serviceUtils.getTransactionalEditingDomain();
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/DiagramDecorationAdapter.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/DiagramDecorationAdapter.java
index 9bd01a2c2fa..fae86a714fa 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/DiagramDecorationAdapter.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/DiagramDecorationAdapter.java
@@ -13,6 +13,8 @@
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.common.providers;
+import java.util.List;
+
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.Label;
import org.eclipse.draw2d.Locator;
@@ -20,7 +22,6 @@ import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.PrecisionRectangle;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.emf.common.util.BasicEList;
-import org.eclipse.emf.common.util.EList;
import org.eclipse.gef.EditPart;
import org.eclipse.gef.GraphicalEditPart;
import org.eclipse.gef.handles.HandleBounds;
@@ -47,9 +48,9 @@ public class DiagramDecorationAdapter {
/** The decoration. */
- protected EList<IDecoration> decorations;
+ protected List<IDecoration> decorations;
- protected EList<IPapyrusDecoration> pDecorations;
+ protected List<IPapyrusDecoration> pDecorations;
/** The decoration image. */
protected Image decorationImage;
@@ -132,7 +133,7 @@ public class DiagramDecorationAdapter {
* the is volatile
* @return the set of JFace decorations
*/
- public EList<IDecoration> setDecorations(EList<IPapyrusDecoration> pDecorations, int percentageFromSource, int margin, boolean isVolatile) {
+ public List<IDecoration> setDecorations(List<IPapyrusDecoration> pDecorations, int percentageFromSource, int margin, boolean isVolatile) {
final int distBetweenIconsPercent = 20;
final int percentageMin = 10;
@@ -321,10 +322,7 @@ public class DiagramDecorationAdapter {
}
public void relocate(IFigure target) {
- Rectangle bounds =
- reference instanceof HandleBounds
- ? new PrecisionRectangle(((HandleBounds)reference).getHandleBounds())
- : new PrecisionRectangle(reference.getBounds());
+ Rectangle bounds = reference instanceof HandleBounds ? new PrecisionRectangle(((HandleBounds)reference).getHandleBounds()) : new PrecisionRectangle(reference.getBounds());
reference.translateToAbsolute(bounds);
target.translateToRelative(bounds);
@@ -337,8 +335,7 @@ public class DiagramDecorationAdapter {
if(decorationX > pTL.x) {
// only set position, if it is inside the figure, i.e. bigger than left margin
pDecoration.setX(decorationX);
- }
- else {
+ } else {
pDecoration.setX(pTL.x);
}
target.setLocation(pDecoration);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/ValidationDecoratorProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/ValidationDecoratorProvider.java
index 1c9b0020c6b..6fffc9ccdfc 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/ValidationDecoratorProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/ValidationDecoratorProvider.java
@@ -18,11 +18,11 @@ package org.eclipse.papyrus.uml.diagram.common.providers;
import static org.eclipse.papyrus.uml.diagram.common.Activator.log;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
import java.util.Observable;
import java.util.Observer;
-import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.emf.transaction.util.TransactionUtil;
import org.eclipse.gef.EditPart;
@@ -172,7 +172,7 @@ public abstract class ValidationDecoratorProvider extends AbstractProvider imple
// add decoration
if(editPart instanceof org.eclipse.gef.GraphicalEditPart) {
if(view.getElement() != null) {
- EList<IPapyrusDecoration> decorations = decorationService.getDecorations(view.getElement(), false);
+ List<IPapyrusDecoration> decorations = decorationService.getDecorations(view.getElement(), false);
if((decorations != null) && (decorations.size() > 0)) {
if(view instanceof Edge) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/AspectUnspecifiedTypeConnectionTool.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/AspectUnspecifiedTypeConnectionTool.java
index 16974a0e1e9..33a36f69640 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/AspectUnspecifiedTypeConnectionTool.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/AspectUnspecifiedTypeConnectionTool.java
@@ -52,6 +52,7 @@ import org.eclipse.gmf.runtime.emf.type.core.IElementType;
import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
import org.eclipse.gmf.runtime.notation.Connector;
+import org.eclipse.gmf.runtime.notation.Edge;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.infra.core.services.ServiceException;
import org.eclipse.papyrus.infra.core.utils.EditorUtils;
@@ -284,7 +285,7 @@ public class AspectUnspecifiedTypeConnectionTool extends UnspecifiedTypeConnecti
listener = new NotificationListener() {
public void notifyChanged(Notification notification) {
- Connector newValue = (Connector)notification.getNewValue();
+ Edge newValue = (Edge)notification.getNewValue();
EditPart editPart = (EditPart)getCurrentViewer().getEditPartRegistry().get(newValue);
for(IAspectAction action : postActions) {
action.run(editPart);

Back to the top