Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2014-08-21 11:37:18 +0000
committerCamille Letavernier2014-08-21 11:37:18 +0000
commitea48a20561464c3cbb7895d430583669a9f82fcc (patch)
tree0fdf9eebacbbb301b13bafce3ca4a6952ff6e91c /extraplugins/layout
parentf91b71175fd97557cf378cdcad845a44a6274b16 (diff)
downloadorg.eclipse.papyrus-ea48a20561464c3cbb7895d430583669a9f82fcc.tar.gz
org.eclipse.papyrus-ea48a20561464c3cbb7895d430583669a9f82fcc.tar.xz
org.eclipse.papyrus-ea48a20561464c3cbb7895d430583669a9f82fcc.zip
[Code style] Apply clean-up and formatter on Extra plug-ins
Diffstat (limited to 'extraplugins/layout')
-rw-r--r--extraplugins/layout/org.eclipse.papyrus.layout.algorithms.gridAlgorithm/src/org/eclipse/papyrus/layout/algorithms/gridalgorithm/Activator.java4
-rw-r--r--extraplugins/layout/org.eclipse.papyrus.layout.algorithms.gridAlgorithm/src/org/eclipse/papyrus/layout/algorithms/gridalgorithm/GridAlgorithm.java6
-rw-r--r--extraplugins/layout/org.eclipse.papyrus.layout.algorithms.horizontalAlgorithm/src/org/eclipse/papyrus/layout/algorithms/horizontalalgorithm/Activator.java4
-rw-r--r--extraplugins/layout/org.eclipse.papyrus.layout.algorithms.horizontalAlgorithm/src/org/eclipse/papyrus/layout/algorithms/horizontalalgorithm/HorizontalAlgorithm.java6
-rw-r--r--extraplugins/layout/org.eclipse.papyrus.layout.algorithms.horizontalSymmetryAlgorithm/src/org/eclipse/papyrus/layout/algorithms/horizontalsymmetryalgorithm/Activator.java4
-rw-r--r--extraplugins/layout/org.eclipse.papyrus.layout.algorithms.horizontalSymmetryAlgorithm/src/org/eclipse/papyrus/layout/algorithms/horizontalsymmetryalgorithm/HorizontalSymmetryAlgorithm.java5
-rw-r--r--extraplugins/layout/org.eclipse.papyrus.layout.algorithms.horizontalSymmetryAlgorithm/src/org/eclipse/papyrus/layout/algorithms/horizontalsymmetryalgorithm/HorizontalSymmetryLayoutAlgorithm.java30
-rw-r--r--extraplugins/layout/org.eclipse.papyrus.layout.algorithms.horizontalTreeAlgorithm/src/org/eclipse/papyrus/layout/algorithms/horizontaltreealgorithm/Activator.java4
-rw-r--r--extraplugins/layout/org.eclipse.papyrus.layout.algorithms.horizontalTreeAlgorithm/src/org/eclipse/papyrus/layout/algorithms/horizontaltreealgorithm/HorizontalTreeAlgorithm.java6
-rw-r--r--extraplugins/layout/org.eclipse.papyrus.layout.algorithms.radialAlgorithm/src/org/eclipse/papyrus/layout/algorithms/radialalgorithm/Activator.java4
-rw-r--r--extraplugins/layout/org.eclipse.papyrus.layout.algorithms.radialAlgorithm/src/org/eclipse/papyrus/layout/algorithms/radialalgorithm/RadialAlgorithm.java6
-rw-r--r--extraplugins/layout/org.eclipse.papyrus.layout.algorithms.springAlgorithm/src/org/eclipse/papyrus/layout/algorithms/springalgorithm/Activator.java4
-rw-r--r--extraplugins/layout/org.eclipse.papyrus.layout.algorithms.springAlgorithm/src/org/eclipse/papyrus/layout/algorithms/springalgorithm/SpringAlgorithm.java6
-rw-r--r--extraplugins/layout/org.eclipse.papyrus.layout.algorithms.treeAlgorithm/src/org/eclipse/papyrus/layout/algorithms/treealgorithm/Activator.java4
-rw-r--r--extraplugins/layout/org.eclipse.papyrus.layout.algorithms.treeAlgorithm/src/org/eclipse/papyrus/layout/algorithms/treealgorithm/TreeAlgorithm.java6
-rw-r--r--extraplugins/layout/org.eclipse.papyrus.layout.algorithms.verticalAlgorithm/src/org/eclipse/papyrus/layout/algorithms/verticalalgorithm/Activator.java4
-rw-r--r--extraplugins/layout/org.eclipse.papyrus.layout.algorithms.verticalAlgorithm/src/org/eclipse/papyrus/layout/algorithms/verticalalgorithm/VerticalAlgorithm.java6
-rw-r--r--extraplugins/layout/org.eclipse.papyrus.layout.algorithms.verticalSymmetryAlgorithm/src/org/eclipse/papyrus/layout/algorithms/verticalsymmetryalgorithm/Activator.java4
-rw-r--r--extraplugins/layout/org.eclipse.papyrus.layout.algorithms.verticalSymmetryAlgorithm/src/org/eclipse/papyrus/layout/algorithms/verticalsymmetryalgorithm/VerticalSymmetryAlgorithm.java5
-rw-r--r--extraplugins/layout/org.eclipse.papyrus.layout.algorithms.verticalSymmetryAlgorithm/src/org/eclipse/papyrus/layout/algorithms/verticalsymmetryalgorithm/VerticalSymmetryLayoutAlgorithm.java29
-rw-r--r--extraplugins/layout/org.eclipse.papyrus.layout.subeditor.gmf/src/org/eclipse/papyrus/layout/subeditor/gmf/Activator.java4
-rw-r--r--extraplugins/layout/org.eclipse.papyrus.layout.subeditor.gmf/src/org/eclipse/papyrus/layout/subeditor/gmf/GMFLayoutAreaCreator.java83
-rw-r--r--extraplugins/layout/org.eclipse.papyrus.layout.subeditor.gmf/src/org/eclipse/papyrus/layout/subeditor/gmf/GMFSubEditor.java68
-rw-r--r--extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/Activator.java31
-rw-r--r--extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/EditorPropertyTester.java19
-rw-r--r--extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/LayoutTool.java14
-rw-r--r--extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/LayoutToolAlgorithms.java33
-rw-r--r--extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/LayoutToolAreaInterface.java2
-rw-r--r--extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/LayoutToolExtensionPointManager.java48
-rw-r--r--extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/LayoutToolToolbar.java100
-rw-r--r--extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/LayouttoolController.java101
-rw-r--r--extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/LayouttoolInterface.java44
-rw-r--r--extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/managealgorithms/AlgorithmFactory.java6
-rw-r--r--extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/managealgorithms/ZestAlgortihms.java34
-rw-r--r--extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/utils/Constants.java2
35 files changed, 353 insertions, 383 deletions
diff --git a/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.gridAlgorithm/src/org/eclipse/papyrus/layout/algorithms/gridalgorithm/Activator.java b/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.gridAlgorithm/src/org/eclipse/papyrus/layout/algorithms/gridalgorithm/Activator.java
index 1cd8c942f1e..a5cda39af4a 100644
--- a/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.gridAlgorithm/src/org/eclipse/papyrus/layout/algorithms/gridalgorithm/Activator.java
+++ b/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.gridAlgorithm/src/org/eclipse/papyrus/layout/algorithms/gridalgorithm/Activator.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -59,7 +59,7 @@ public class Activator extends AbstractUIPlugin {
/**
* Returns the shared instance.
- *
+ *
* @return the shared instance
*/
public static Activator getDefault() {
diff --git a/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.gridAlgorithm/src/org/eclipse/papyrus/layout/algorithms/gridalgorithm/GridAlgorithm.java b/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.gridAlgorithm/src/org/eclipse/papyrus/layout/algorithms/gridalgorithm/GridAlgorithm.java
index 9dfcc0fc092..5e66c12ed97 100644
--- a/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.gridAlgorithm/src/org/eclipse/papyrus/layout/algorithms/gridalgorithm/GridAlgorithm.java
+++ b/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.gridAlgorithm/src/org/eclipse/papyrus/layout/algorithms/gridalgorithm/GridAlgorithm.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -14,9 +14,6 @@
package org.eclipse.papyrus.layout.algorithms.gridalgorithm;
import org.eclipse.papyrus.layout.managealgorithms.AlgorithmFactory;
-import org.eclipse.zest.layouts.LayoutStyles;
-import org.eclipse.zest.layouts.algorithms.AbstractLayoutAlgorithm;
-import org.eclipse.zest.layouts.algorithms.GridLayoutAlgorithm;
/**
* The Class GridAlgorithm.
@@ -28,6 +25,7 @@ public class GridAlgorithm implements AlgorithmFactory {
*
* @see org.eclipse.papyrus.layout.managealgorithms.AlgorithmFactory#createAlgorithm()
*/
+ @Override
public AbstractLayoutAlgorithm createAlgorithm() {
return new GridLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING);
}
diff --git a/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.horizontalAlgorithm/src/org/eclipse/papyrus/layout/algorithms/horizontalalgorithm/Activator.java b/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.horizontalAlgorithm/src/org/eclipse/papyrus/layout/algorithms/horizontalalgorithm/Activator.java
index 769892fff9b..ab58bc2d175 100644
--- a/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.horizontalAlgorithm/src/org/eclipse/papyrus/layout/algorithms/horizontalalgorithm/Activator.java
+++ b/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.horizontalAlgorithm/src/org/eclipse/papyrus/layout/algorithms/horizontalalgorithm/Activator.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -59,7 +59,7 @@ public class Activator extends AbstractUIPlugin {
/**
* Returns the shared instance.
- *
+ *
* @return the shared instance
*/
public static Activator getDefault() {
diff --git a/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.horizontalAlgorithm/src/org/eclipse/papyrus/layout/algorithms/horizontalalgorithm/HorizontalAlgorithm.java b/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.horizontalAlgorithm/src/org/eclipse/papyrus/layout/algorithms/horizontalalgorithm/HorizontalAlgorithm.java
index 6d3aa2c9e03..eb1661b8473 100644
--- a/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.horizontalAlgorithm/src/org/eclipse/papyrus/layout/algorithms/horizontalalgorithm/HorizontalAlgorithm.java
+++ b/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.horizontalAlgorithm/src/org/eclipse/papyrus/layout/algorithms/horizontalalgorithm/HorizontalAlgorithm.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -14,9 +14,6 @@
package org.eclipse.papyrus.layout.algorithms.horizontalalgorithm;
import org.eclipse.papyrus.layout.managealgorithms.AlgorithmFactory;
-import org.eclipse.zest.layouts.LayoutStyles;
-import org.eclipse.zest.layouts.algorithms.AbstractLayoutAlgorithm;
-import org.eclipse.zest.layouts.algorithms.HorizontalLayoutAlgorithm;
/**
* The Class HorizontalAlgorithm.
@@ -28,6 +25,7 @@ public class HorizontalAlgorithm implements AlgorithmFactory {
*
* @see org.eclipse.papyrus.layout.managealgorithms.AlgorithmFactory#createAlgorithm()
*/
+ @Override
public AbstractLayoutAlgorithm createAlgorithm() {
return new HorizontalLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING);
}
diff --git a/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.horizontalSymmetryAlgorithm/src/org/eclipse/papyrus/layout/algorithms/horizontalsymmetryalgorithm/Activator.java b/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.horizontalSymmetryAlgorithm/src/org/eclipse/papyrus/layout/algorithms/horizontalsymmetryalgorithm/Activator.java
index b856ecf9db7..c8ec56fa142 100644
--- a/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.horizontalSymmetryAlgorithm/src/org/eclipse/papyrus/layout/algorithms/horizontalsymmetryalgorithm/Activator.java
+++ b/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.horizontalSymmetryAlgorithm/src/org/eclipse/papyrus/layout/algorithms/horizontalsymmetryalgorithm/Activator.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -59,7 +59,7 @@ public class Activator extends AbstractUIPlugin {
/**
* Returns the shared instance.
- *
+ *
* @return the shared instance
*/
public static Activator getDefault() {
diff --git a/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.horizontalSymmetryAlgorithm/src/org/eclipse/papyrus/layout/algorithms/horizontalsymmetryalgorithm/HorizontalSymmetryAlgorithm.java b/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.horizontalSymmetryAlgorithm/src/org/eclipse/papyrus/layout/algorithms/horizontalsymmetryalgorithm/HorizontalSymmetryAlgorithm.java
index 46080ea271f..983b6f70319 100644
--- a/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.horizontalSymmetryAlgorithm/src/org/eclipse/papyrus/layout/algorithms/horizontalsymmetryalgorithm/HorizontalSymmetryAlgorithm.java
+++ b/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.horizontalSymmetryAlgorithm/src/org/eclipse/papyrus/layout/algorithms/horizontalsymmetryalgorithm/HorizontalSymmetryAlgorithm.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -14,8 +14,6 @@
package org.eclipse.papyrus.layout.algorithms.horizontalsymmetryalgorithm;
import org.eclipse.papyrus.layout.managealgorithms.AlgorithmFactory;
-import org.eclipse.zest.layouts.LayoutStyles;
-import org.eclipse.zest.layouts.algorithms.AbstractLayoutAlgorithm;
/**
* The Class HorizontalSymmetryAlgorithm.
@@ -27,6 +25,7 @@ public class HorizontalSymmetryAlgorithm implements AlgorithmFactory {
*
* @see org.eclipse.papyrus.layout.managealgorithms.AlgorithmFactory#createAlgorithm()
*/
+ @Override
public AbstractLayoutAlgorithm createAlgorithm() {
return new HorizontalSymmetryLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING);
}
diff --git a/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.horizontalSymmetryAlgorithm/src/org/eclipse/papyrus/layout/algorithms/horizontalsymmetryalgorithm/HorizontalSymmetryLayoutAlgorithm.java b/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.horizontalSymmetryAlgorithm/src/org/eclipse/papyrus/layout/algorithms/horizontalsymmetryalgorithm/HorizontalSymmetryLayoutAlgorithm.java
index 3470b8b2549..ea9c675cc41 100644
--- a/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.horizontalSymmetryAlgorithm/src/org/eclipse/papyrus/layout/algorithms/horizontalsymmetryalgorithm/HorizontalSymmetryLayoutAlgorithm.java
+++ b/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.horizontalSymmetryAlgorithm/src/org/eclipse/papyrus/layout/algorithms/horizontalsymmetryalgorithm/HorizontalSymmetryLayoutAlgorithm.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -13,11 +13,6 @@
*****************************************************************************/
package org.eclipse.papyrus.layout.algorithms.horizontalsymmetryalgorithm;
-import org.eclipse.zest.layouts.LayoutStyles;
-import org.eclipse.zest.layouts.algorithms.AbstractLayoutAlgorithm;
-import org.eclipse.zest.layouts.dataStructures.InternalNode;
-import org.eclipse.zest.layouts.dataStructures.InternalRelationship;
-
/**
* The Class HorizontalSymmetryLayoutAlgorithm.
*/
@@ -25,9 +20,9 @@ public class HorizontalSymmetryLayoutAlgorithm extends AbstractLayoutAlgorithm {
/**
* Instantiates a new horizontal symmetry layout algorithm.
- *
+ *
* @param styles
- * the styles
+ * the styles
*/
public HorizontalSymmetryLayoutAlgorithm(int styles) {
super(styles);
@@ -85,14 +80,15 @@ public class HorizontalSymmetryLayoutAlgorithm extends AbstractLayoutAlgorithm {
*/
@Override
protected boolean isValidConfiguration(boolean asynchronous, boolean continuous) {
- if(asynchronous && continuous)
+ if (asynchronous && continuous) {
return false;
- else if(asynchronous && !continuous)
+ } else if (asynchronous && !continuous) {
return true;
- else if(!asynchronous && continuous)
+ } else if (!asynchronous && continuous) {
return false;
- else if(!asynchronous && !continuous)
+ } else if (!asynchronous && !continuous) {
return true;
+ }
return false;
}
@@ -123,7 +119,7 @@ public class HorizontalSymmetryLayoutAlgorithm extends AbstractLayoutAlgorithm {
protected void preLayoutAlgorithm(InternalNode[] entitiesToLayout, InternalRelationship[] relationshipsToConsider,
double x, double y, double width, double height) {
double middle = calculateMiddleArea(y, height);
- for(InternalNode node : entitiesToLayout) {
+ for (InternalNode node : entitiesToLayout) {
// node.setLocationInLayout(node.getXInLayout(),middle+(middle - node.getYInLayout()));
node.setLocation(node.getInternalX(), (middle + (middle - node.getInternalY())) - node.getHeightInLayout());
// node.setInternalLocation(node.getXInLayout(), middle+(middle - node.getYInLayout()));
@@ -132,12 +128,12 @@ public class HorizontalSymmetryLayoutAlgorithm extends AbstractLayoutAlgorithm {
/**
* Calculate middle area.
- *
+ *
* @param y
- * the y
+ * the y
* @param height
- * the height
- *
+ * the height
+ *
* @return the double
*/
private double calculateMiddleArea(double y, double height) {
diff --git a/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.horizontalTreeAlgorithm/src/org/eclipse/papyrus/layout/algorithms/horizontaltreealgorithm/Activator.java b/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.horizontalTreeAlgorithm/src/org/eclipse/papyrus/layout/algorithms/horizontaltreealgorithm/Activator.java
index aff5af16e97..998baa00a96 100644
--- a/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.horizontalTreeAlgorithm/src/org/eclipse/papyrus/layout/algorithms/horizontaltreealgorithm/Activator.java
+++ b/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.horizontalTreeAlgorithm/src/org/eclipse/papyrus/layout/algorithms/horizontaltreealgorithm/Activator.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -59,7 +59,7 @@ public class Activator extends AbstractUIPlugin {
/**
* Returns the shared instance.
- *
+ *
* @return the shared instance
*/
public static Activator getDefault() {
diff --git a/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.horizontalTreeAlgorithm/src/org/eclipse/papyrus/layout/algorithms/horizontaltreealgorithm/HorizontalTreeAlgorithm.java b/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.horizontalTreeAlgorithm/src/org/eclipse/papyrus/layout/algorithms/horizontaltreealgorithm/HorizontalTreeAlgorithm.java
index e05eb44d511..c4c168ea051 100644
--- a/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.horizontalTreeAlgorithm/src/org/eclipse/papyrus/layout/algorithms/horizontaltreealgorithm/HorizontalTreeAlgorithm.java
+++ b/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.horizontalTreeAlgorithm/src/org/eclipse/papyrus/layout/algorithms/horizontaltreealgorithm/HorizontalTreeAlgorithm.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -14,9 +14,6 @@
package org.eclipse.papyrus.layout.algorithms.horizontaltreealgorithm;
import org.eclipse.papyrus.layout.managealgorithms.AlgorithmFactory;
-import org.eclipse.zest.layouts.LayoutStyles;
-import org.eclipse.zest.layouts.algorithms.AbstractLayoutAlgorithm;
-import org.eclipse.zest.layouts.algorithms.HorizontalTreeLayoutAlgorithm;
/**
* The Class HorizontalTreeAlgorithm.
@@ -28,6 +25,7 @@ public class HorizontalTreeAlgorithm implements AlgorithmFactory {
*
* @see org.eclipse.papyrus.layout.managealgorithms.AlgorithmFactory#createAlgorithm()
*/
+ @Override
public AbstractLayoutAlgorithm createAlgorithm() {
return new HorizontalTreeLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING);
}
diff --git a/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.radialAlgorithm/src/org/eclipse/papyrus/layout/algorithms/radialalgorithm/Activator.java b/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.radialAlgorithm/src/org/eclipse/papyrus/layout/algorithms/radialalgorithm/Activator.java
index d2b7561752f..b39f5653f8b 100644
--- a/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.radialAlgorithm/src/org/eclipse/papyrus/layout/algorithms/radialalgorithm/Activator.java
+++ b/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.radialAlgorithm/src/org/eclipse/papyrus/layout/algorithms/radialalgorithm/Activator.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -59,7 +59,7 @@ public class Activator extends AbstractUIPlugin {
/**
* Returns the shared instance.
- *
+ *
* @return the shared instance
*/
public static Activator getDefault() {
diff --git a/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.radialAlgorithm/src/org/eclipse/papyrus/layout/algorithms/radialalgorithm/RadialAlgorithm.java b/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.radialAlgorithm/src/org/eclipse/papyrus/layout/algorithms/radialalgorithm/RadialAlgorithm.java
index 6b1ab45eb6d..b8ebbd319f4 100644
--- a/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.radialAlgorithm/src/org/eclipse/papyrus/layout/algorithms/radialalgorithm/RadialAlgorithm.java
+++ b/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.radialAlgorithm/src/org/eclipse/papyrus/layout/algorithms/radialalgorithm/RadialAlgorithm.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -14,9 +14,6 @@
package org.eclipse.papyrus.layout.algorithms.radialalgorithm;
import org.eclipse.papyrus.layout.managealgorithms.AlgorithmFactory;
-import org.eclipse.zest.layouts.LayoutStyles;
-import org.eclipse.zest.layouts.algorithms.AbstractLayoutAlgorithm;
-import org.eclipse.zest.layouts.algorithms.RadialLayoutAlgorithm;
/**
* The Class RadialAlgorithm.
@@ -28,6 +25,7 @@ public class RadialAlgorithm implements AlgorithmFactory {
*
* @see org.eclipse.papyrus.layout.managealgorithms.AlgorithmFactory#createAlgorithm()
*/
+ @Override
public AbstractLayoutAlgorithm createAlgorithm() {
return new RadialLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING);
}
diff --git a/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.springAlgorithm/src/org/eclipse/papyrus/layout/algorithms/springalgorithm/Activator.java b/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.springAlgorithm/src/org/eclipse/papyrus/layout/algorithms/springalgorithm/Activator.java
index f7b2b59cf1f..1f0b9edad26 100644
--- a/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.springAlgorithm/src/org/eclipse/papyrus/layout/algorithms/springalgorithm/Activator.java
+++ b/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.springAlgorithm/src/org/eclipse/papyrus/layout/algorithms/springalgorithm/Activator.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -59,7 +59,7 @@ public class Activator extends AbstractUIPlugin {
/**
* Returns the shared instance.
- *
+ *
* @return the shared instance
*/
public static Activator getDefault() {
diff --git a/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.springAlgorithm/src/org/eclipse/papyrus/layout/algorithms/springalgorithm/SpringAlgorithm.java b/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.springAlgorithm/src/org/eclipse/papyrus/layout/algorithms/springalgorithm/SpringAlgorithm.java
index cbea9ef5a4a..918caae2b14 100644
--- a/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.springAlgorithm/src/org/eclipse/papyrus/layout/algorithms/springalgorithm/SpringAlgorithm.java
+++ b/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.springAlgorithm/src/org/eclipse/papyrus/layout/algorithms/springalgorithm/SpringAlgorithm.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -14,9 +14,6 @@
package org.eclipse.papyrus.layout.algorithms.springalgorithm;
import org.eclipse.papyrus.layout.managealgorithms.AlgorithmFactory;
-import org.eclipse.zest.layouts.LayoutStyles;
-import org.eclipse.zest.layouts.algorithms.AbstractLayoutAlgorithm;
-import org.eclipse.zest.layouts.algorithms.SpringLayoutAlgorithm;
/**
* The Class SpringAlgorithm.
@@ -28,6 +25,7 @@ public class SpringAlgorithm implements AlgorithmFactory {
*
* @see org.eclipse.papyrus.layout.managealgorithms.AlgorithmFactory#createAlgorithm()
*/
+ @Override
public AbstractLayoutAlgorithm createAlgorithm() {
return new SpringLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING);
}
diff --git a/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.treeAlgorithm/src/org/eclipse/papyrus/layout/algorithms/treealgorithm/Activator.java b/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.treeAlgorithm/src/org/eclipse/papyrus/layout/algorithms/treealgorithm/Activator.java
index 046e79d0b90..873ad0e09cb 100644
--- a/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.treeAlgorithm/src/org/eclipse/papyrus/layout/algorithms/treealgorithm/Activator.java
+++ b/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.treeAlgorithm/src/org/eclipse/papyrus/layout/algorithms/treealgorithm/Activator.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -59,7 +59,7 @@ public class Activator extends AbstractUIPlugin {
/**
* Returns the shared instance.
- *
+ *
* @return the shared instance
*/
public static Activator getDefault() {
diff --git a/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.treeAlgorithm/src/org/eclipse/papyrus/layout/algorithms/treealgorithm/TreeAlgorithm.java b/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.treeAlgorithm/src/org/eclipse/papyrus/layout/algorithms/treealgorithm/TreeAlgorithm.java
index 3c7ddcf0ec1..5be0c1c9609 100644
--- a/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.treeAlgorithm/src/org/eclipse/papyrus/layout/algorithms/treealgorithm/TreeAlgorithm.java
+++ b/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.treeAlgorithm/src/org/eclipse/papyrus/layout/algorithms/treealgorithm/TreeAlgorithm.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -14,9 +14,6 @@
package org.eclipse.papyrus.layout.algorithms.treealgorithm;
import org.eclipse.papyrus.layout.managealgorithms.AlgorithmFactory;
-import org.eclipse.zest.layouts.LayoutStyles;
-import org.eclipse.zest.layouts.algorithms.AbstractLayoutAlgorithm;
-import org.eclipse.zest.layouts.algorithms.TreeLayoutAlgorithm;
/**
* The Class TreeAlgorithm.
@@ -28,6 +25,7 @@ public class TreeAlgorithm implements AlgorithmFactory {
*
* @see org.eclipse.papyrus.layout.managealgorithms.AlgorithmFactory#createAlgorithm()
*/
+ @Override
public AbstractLayoutAlgorithm createAlgorithm() {
return new TreeLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING);
}
diff --git a/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.verticalAlgorithm/src/org/eclipse/papyrus/layout/algorithms/verticalalgorithm/Activator.java b/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.verticalAlgorithm/src/org/eclipse/papyrus/layout/algorithms/verticalalgorithm/Activator.java
index fc806bdc442..c912e84dba4 100644
--- a/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.verticalAlgorithm/src/org/eclipse/papyrus/layout/algorithms/verticalalgorithm/Activator.java
+++ b/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.verticalAlgorithm/src/org/eclipse/papyrus/layout/algorithms/verticalalgorithm/Activator.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -59,7 +59,7 @@ public class Activator extends AbstractUIPlugin {
/**
* Returns the shared instance.
- *
+ *
* @return the shared instance
*/
public static Activator getDefault() {
diff --git a/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.verticalAlgorithm/src/org/eclipse/papyrus/layout/algorithms/verticalalgorithm/VerticalAlgorithm.java b/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.verticalAlgorithm/src/org/eclipse/papyrus/layout/algorithms/verticalalgorithm/VerticalAlgorithm.java
index 7ae8390fdc6..d72df5cfb9a 100644
--- a/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.verticalAlgorithm/src/org/eclipse/papyrus/layout/algorithms/verticalalgorithm/VerticalAlgorithm.java
+++ b/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.verticalAlgorithm/src/org/eclipse/papyrus/layout/algorithms/verticalalgorithm/VerticalAlgorithm.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -14,9 +14,6 @@
package org.eclipse.papyrus.layout.algorithms.verticalalgorithm;
import org.eclipse.papyrus.layout.managealgorithms.AlgorithmFactory;
-import org.eclipse.zest.layouts.LayoutStyles;
-import org.eclipse.zest.layouts.algorithms.AbstractLayoutAlgorithm;
-import org.eclipse.zest.layouts.algorithms.VerticalLayoutAlgorithm;
/**
* The Class VerticalAlgorithm.
@@ -28,6 +25,7 @@ public class VerticalAlgorithm implements AlgorithmFactory {
*
* @see org.eclipse.papyrus.layout.managealgorithms.AlgorithmFactory#createAlgorithm()
*/
+ @Override
public AbstractLayoutAlgorithm createAlgorithm() {
return new VerticalLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING);
}
diff --git a/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.verticalSymmetryAlgorithm/src/org/eclipse/papyrus/layout/algorithms/verticalsymmetryalgorithm/Activator.java b/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.verticalSymmetryAlgorithm/src/org/eclipse/papyrus/layout/algorithms/verticalsymmetryalgorithm/Activator.java
index efadbaeb80f..50be5b90ebb 100644
--- a/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.verticalSymmetryAlgorithm/src/org/eclipse/papyrus/layout/algorithms/verticalsymmetryalgorithm/Activator.java
+++ b/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.verticalSymmetryAlgorithm/src/org/eclipse/papyrus/layout/algorithms/verticalsymmetryalgorithm/Activator.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -59,7 +59,7 @@ public class Activator extends AbstractUIPlugin {
/**
* Returns the shared instance.
- *
+ *
* @return the shared instance
*/
public static Activator getDefault() {
diff --git a/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.verticalSymmetryAlgorithm/src/org/eclipse/papyrus/layout/algorithms/verticalsymmetryalgorithm/VerticalSymmetryAlgorithm.java b/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.verticalSymmetryAlgorithm/src/org/eclipse/papyrus/layout/algorithms/verticalsymmetryalgorithm/VerticalSymmetryAlgorithm.java
index 52c688a265b..af63f7bc968 100644
--- a/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.verticalSymmetryAlgorithm/src/org/eclipse/papyrus/layout/algorithms/verticalsymmetryalgorithm/VerticalSymmetryAlgorithm.java
+++ b/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.verticalSymmetryAlgorithm/src/org/eclipse/papyrus/layout/algorithms/verticalsymmetryalgorithm/VerticalSymmetryAlgorithm.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -14,8 +14,6 @@
package org.eclipse.papyrus.layout.algorithms.verticalsymmetryalgorithm;
import org.eclipse.papyrus.layout.managealgorithms.AlgorithmFactory;
-import org.eclipse.zest.layouts.LayoutStyles;
-import org.eclipse.zest.layouts.algorithms.AbstractLayoutAlgorithm;
/**
* The Class VerticalSymmetryAlgorithm.
@@ -27,6 +25,7 @@ public class VerticalSymmetryAlgorithm implements AlgorithmFactory {
*
* @see org.eclipse.papyrus.layout.managealgorithms.AlgorithmFactory#createAlgorithm()
*/
+ @Override
public AbstractLayoutAlgorithm createAlgorithm() {
return new VerticalSymmetryLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING);
}
diff --git a/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.verticalSymmetryAlgorithm/src/org/eclipse/papyrus/layout/algorithms/verticalsymmetryalgorithm/VerticalSymmetryLayoutAlgorithm.java b/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.verticalSymmetryAlgorithm/src/org/eclipse/papyrus/layout/algorithms/verticalsymmetryalgorithm/VerticalSymmetryLayoutAlgorithm.java
index 18ba797206b..c11d792db1e 100644
--- a/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.verticalSymmetryAlgorithm/src/org/eclipse/papyrus/layout/algorithms/verticalsymmetryalgorithm/VerticalSymmetryLayoutAlgorithm.java
+++ b/extraplugins/layout/org.eclipse.papyrus.layout.algorithms.verticalSymmetryAlgorithm/src/org/eclipse/papyrus/layout/algorithms/verticalsymmetryalgorithm/VerticalSymmetryLayoutAlgorithm.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -13,11 +13,6 @@
*****************************************************************************/
package org.eclipse.papyrus.layout.algorithms.verticalsymmetryalgorithm;
-import org.eclipse.zest.layouts.LayoutStyles;
-import org.eclipse.zest.layouts.algorithms.AbstractLayoutAlgorithm;
-import org.eclipse.zest.layouts.dataStructures.InternalNode;
-import org.eclipse.zest.layouts.dataStructures.InternalRelationship;
-
/**
* The Class VerticalSymmetryLayoutAlgorithm.
*/
@@ -25,9 +20,9 @@ public class VerticalSymmetryLayoutAlgorithm extends AbstractLayoutAlgorithm {
/**
* Instantiates a new vertical symmetry layout algorithm.
- *
+ *
* @param styles
- * the styles
+ * the styles
*/
public VerticalSymmetryLayoutAlgorithm(int styles) {
super(styles);
@@ -85,13 +80,13 @@ public class VerticalSymmetryLayoutAlgorithm extends AbstractLayoutAlgorithm {
*/
@Override
protected boolean isValidConfiguration(boolean asynchronous, boolean continuous) {
- if(asynchronous && continuous) {
+ if (asynchronous && continuous) {
return false;
- } else if(asynchronous && !continuous) {
+ } else if (asynchronous && !continuous) {
return true;
- } else if(!asynchronous && continuous) {
+ } else if (!asynchronous && continuous) {
return false;
- } else if(!asynchronous && !continuous) {
+ } else if (!asynchronous && !continuous) {
return true;
}
return false;
@@ -123,19 +118,19 @@ public class VerticalSymmetryLayoutAlgorithm extends AbstractLayoutAlgorithm {
protected void preLayoutAlgorithm(InternalNode[] entitiesToLayout, InternalRelationship[] relationshipsToConsider,
double x, double y, double width, double height) {
double middle = calculateMiddleArea(x, width);
- for(InternalNode node : entitiesToLayout) {
+ for (InternalNode node : entitiesToLayout) {
node.setLocation((middle + (middle - node.getInternalX())) - node.getWidthInLayout(), node.getInternalY());
}
}
/**
* Calculate middle area.
- *
+ *
* @param x
- * the x
+ * the x
* @param width
- * the width
- *
+ * the width
+ *
* @return the double
*/
private double calculateMiddleArea(double x, double width) {
diff --git a/extraplugins/layout/org.eclipse.papyrus.layout.subeditor.gmf/src/org/eclipse/papyrus/layout/subeditor/gmf/Activator.java b/extraplugins/layout/org.eclipse.papyrus.layout.subeditor.gmf/src/org/eclipse/papyrus/layout/subeditor/gmf/Activator.java
index cfad2aa51a0..2b019636c73 100644
--- a/extraplugins/layout/org.eclipse.papyrus.layout.subeditor.gmf/src/org/eclipse/papyrus/layout/subeditor/gmf/Activator.java
+++ b/extraplugins/layout/org.eclipse.papyrus.layout.subeditor.gmf/src/org/eclipse/papyrus/layout/subeditor/gmf/Activator.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -59,7 +59,7 @@ public class Activator extends AbstractUIPlugin {
/**
* Returns the shared instance.
- *
+ *
* @return the shared instance
*/
public static Activator getDefault() {
diff --git a/extraplugins/layout/org.eclipse.papyrus.layout.subeditor.gmf/src/org/eclipse/papyrus/layout/subeditor/gmf/GMFLayoutAreaCreator.java b/extraplugins/layout/org.eclipse.papyrus.layout.subeditor.gmf/src/org/eclipse/papyrus/layout/subeditor/gmf/GMFLayoutAreaCreator.java
index cd789539118..db60d1ed9cd 100644
--- a/extraplugins/layout/org.eclipse.papyrus.layout.subeditor.gmf/src/org/eclipse/papyrus/layout/subeditor/gmf/GMFLayoutAreaCreator.java
+++ b/extraplugins/layout/org.eclipse.papyrus.layout.subeditor.gmf/src/org/eclipse/papyrus/layout/subeditor/gmf/GMFLayoutAreaCreator.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -71,13 +71,13 @@ public class GMFLayoutAreaCreator implements LayoutToolAreaInterface {
* @see org.eclipse.papyrus.layout.LayoutToolAreaInterface#paintLayoutArea()
*/
public void paintLayoutArea() {
- idwp = (IDiagramWorkbenchPart)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
+ idwp = (IDiagramWorkbenchPart) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
.getActiveEditor();
editPartParent = idwp.getDiagramEditPart();
childs = editPartParent.getChildren();
- if(myEditPartNode == null || !childs.contains(myEditPartNode)) {
+ if (myEditPartNode == null || !childs.contains(myEditPartNode)) {
createLayoutArea();
- } else if(myEditPartNode != null && childs.contains(myEditPartNode)) {
+ } else if (myEditPartNode != null && childs.contains(myEditPartNode)) {
deleteLayoutArea();
createLayoutArea();
}
@@ -85,7 +85,7 @@ public class GMFLayoutAreaCreator implements LayoutToolAreaInterface {
/**
* Gets the area.
- *
+ *
* @return the area
*/
public static EditPart getArea() {
@@ -96,10 +96,10 @@ public class GMFLayoutAreaCreator implements LayoutToolAreaInterface {
* Delete layout area.
*/
public static void deleteLayoutArea() {
- if(myEditPartNode != null) {
- CommandStack cs = ((GraphicalEditPart)editPartParent).getViewer().getEditDomain().getCommandStack();
+ if (myEditPartNode != null) {
+ CommandStack cs = ((GraphicalEditPart) editPartParent).getViewer().getEditDomain().getCommandStack();
CompositeCommand mycommand = new CompositeCommand("mcb");
- DeleteCommand dc = new DeleteCommand(ted, (View)myEditPartNode.getModel());
+ DeleteCommand dc = new DeleteCommand(ted, (View) myEditPartNode.getModel());
mycommand.add(dc);
cs.execute(new ICommandProxy(mycommand));
myEditPartNode = null;
@@ -109,31 +109,31 @@ public class GMFLayoutAreaCreator implements LayoutToolAreaInterface {
/**
* Gets the bounds.
- *
+ *
* @return the bounds
*/
public static Rectangle getBounds() {
- if(myEditPartNode != null) {
- return ((GraphicalEditPart)myEditPartNode).getFigure().getBounds();
+ if (myEditPartNode != null) {
+ return ((GraphicalEditPart) myEditPartNode).getFigure().getBounds();
}
return null;
}
/**
* Gets the transactional editing domain.
- *
+ *
* @return the transactional editing domain
*/
private TransactionalEditingDomain getTransactionalEditingDomain() {
TransactionalEditingDomain ted = null;
IEditorPart activeEditor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
.getActiveEditor();
- if(activeEditor instanceof IDiagramWorkbenchPart) {
- IDiagramWorkbenchPart workbenchPart = (IDiagramWorkbenchPart)activeEditor;
- ted = (TransactionalEditingDomain)workbenchPart.getAdapter(EditingDomain.class);
- if(ted == null) {
- if(workbenchPart instanceof DiagramEditor) {
- DiagramEditor editor = (DiagramEditor)workbenchPart;
+ if (activeEditor instanceof IDiagramWorkbenchPart) {
+ IDiagramWorkbenchPart workbenchPart = (IDiagramWorkbenchPart) activeEditor;
+ ted = (TransactionalEditingDomain) workbenchPart.getAdapter(EditingDomain.class);
+ if (ted == null) {
+ if (workbenchPart instanceof DiagramEditor) {
+ DiagramEditor editor = (DiagramEditor) workbenchPart;
ted = editor.getEditingDomain();
}
}
@@ -145,29 +145,30 @@ public class GMFLayoutAreaCreator implements LayoutToolAreaInterface {
* Creates the layout area.
*/
private void createLayoutArea() {
- CommandStack cs = ((GraphicalEditPart)editPartParent).getViewer().getEditDomain().getCommandStack();
+ CommandStack cs = ((GraphicalEditPart) editPartParent).getViewer().getEditDomain().getCommandStack();
CompositeCommand command2 = new CompositeCommand("cb2");
CreateViewRequest.ViewDescriptor viewDescriptor = new CreateViewRequest.ViewDescriptor(null, Node.class,
"Note", -1, false, PreferencesHint.USE_DEFAULTS);
ted = getTransactionalEditingDomain();
- CreateCommand cc = new CreateCommand(getTransactionalEditingDomain(), viewDescriptor, (View)editPartParent
+ CreateCommand cc = new CreateCommand(getTransactionalEditingDomain(), viewDescriptor, (View) editPartParent
.getModel());
command2.add(cc);
cs.execute(new ICommandProxy(command2));
- node = (Node)((CreateViewRequest.ViewDescriptor)cc.getCommandResult().getReturnValue())
+ node = (Node) ((CreateViewRequest.ViewDescriptor) cc.getCommandResult().getReturnValue())
.getAdapter(Node.class);
- for(EditPart n : childs) {
- if(n.getModel().equals(node))
+ for (EditPart n : childs) {
+ if (n.getModel().equals(node)) {
myEditPartNode = n;
+ }
}
- ((GraphicalEditPart)myEditPartNode).getFigure().setBackgroundColor(null);
- ((GraphicalEditPart)myEditPartNode).getFigure().setOpaque(false);
+ ((GraphicalEditPart) myEditPartNode).getFigure().setBackgroundColor(null);
+ ((GraphicalEditPart) myEditPartNode).getFigure().setOpaque(false);
CompositeCommand command = new CompositeCommand("cb");
SetBoundsCommand sbc = new SetBoundsCommand(getTransactionalEditingDomain(), "changebounds",
- new EObjectAdapter((View)myEditPartNode.getModel()), calculateBoundsLayoutArea());
+ new EObjectAdapter((View) myEditPartNode.getModel()), calculateBoundsLayoutArea());
command.add(sbc);
- SendToBackCommand stbc = new SendToBackCommand(getTransactionalEditingDomain(), (View)myEditPartNode
+ SendToBackCommand stbc = new SendToBackCommand(getTransactionalEditingDomain(), (View) myEditPartNode
.getModel());
command.add(stbc);
cs.execute(new ICommandProxy(command));
@@ -175,27 +176,27 @@ public class GMFLayoutAreaCreator implements LayoutToolAreaInterface {
/**
* Calculate bounds layout area.
- *
+ *
* @return the rectangle
*/
private Rectangle calculateBoundsLayoutArea() {
- int minX = ((Bounds)((Node)childs.get(0).getModel()).getLayoutConstraint()).getX();
- int maxX = ((Bounds)((Node)childs.get(0).getModel()).getLayoutConstraint()).getX();
- int minY = ((Bounds)((Node)childs.get(0).getModel()).getLayoutConstraint()).getY();
- int maxY = ((Bounds)((Node)childs.get(0).getModel()).getLayoutConstraint()).getY();
- for(EditPart e : childs) {
- if(e != childs.get(childs.size() - 1)) {
- minX = Math.min(minX, ((GraphicalEditPart)e).getFigure().getBounds().x - this.margin);
- maxX = Math.max(maxX, ((GraphicalEditPart)e).getFigure().getBounds().x
- + ((GraphicalEditPart)e).getFigure().getBounds().width + this.margin);
- minY = Math.min(minY, ((GraphicalEditPart)e).getFigure().getBounds().y - this.margin);
- maxY = Math.max(maxY, ((GraphicalEditPart)e).getFigure().getBounds().y
- + ((GraphicalEditPart)e).getFigure().getBounds().height + this.margin);
+ int minX = ((Bounds) ((Node) childs.get(0).getModel()).getLayoutConstraint()).getX();
+ int maxX = ((Bounds) ((Node) childs.get(0).getModel()).getLayoutConstraint()).getX();
+ int minY = ((Bounds) ((Node) childs.get(0).getModel()).getLayoutConstraint()).getY();
+ int maxY = ((Bounds) ((Node) childs.get(0).getModel()).getLayoutConstraint()).getY();
+ for (EditPart e : childs) {
+ if (e != childs.get(childs.size() - 1)) {
+ minX = Math.min(minX, ((GraphicalEditPart) e).getFigure().getBounds().x - this.margin);
+ maxX = Math.max(maxX, ((GraphicalEditPart) e).getFigure().getBounds().x
+ + ((GraphicalEditPart) e).getFigure().getBounds().width + this.margin);
+ minY = Math.min(minY, ((GraphicalEditPart) e).getFigure().getBounds().y - this.margin);
+ maxY = Math.max(maxY, ((GraphicalEditPart) e).getFigure().getBounds().y
+ + ((GraphicalEditPart) e).getFigure().getBounds().height + this.margin);
}
}
maxX = maxX - minX;
maxY = maxY - minY;
- if(minX == 0 && minY == 0 && maxX == 0 && maxY == 0) {
+ if (minX == 0 && minY == 0 && maxX == 0 && maxY == 0) {
return new Rectangle(20, 20, 20, 20);
}
return new Rectangle(minX, minY, maxX, maxY);
diff --git a/extraplugins/layout/org.eclipse.papyrus.layout.subeditor.gmf/src/org/eclipse/papyrus/layout/subeditor/gmf/GMFSubEditor.java b/extraplugins/layout/org.eclipse.papyrus.layout.subeditor.gmf/src/org/eclipse/papyrus/layout/subeditor/gmf/GMFSubEditor.java
index 0c23be5a3eb..becc81cf048 100644
--- a/extraplugins/layout/org.eclipse.papyrus.layout.subeditor.gmf/src/org/eclipse/papyrus/layout/subeditor/gmf/GMFSubEditor.java
+++ b/extraplugins/layout/org.eclipse.papyrus.layout.subeditor.gmf/src/org/eclipse/papyrus/layout/subeditor/gmf/GMFSubEditor.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -57,15 +57,15 @@ public class GMFSubEditor implements LayouttoolInterface {
*/
public void execute(Map<EditPart, Rectangle> map) {
TransactionalEditingDomain ted = getTransactionalEditingDomain();
- if(ted != null) {
+ if (ted != null) {
CommandStack cs = null;
// Add a command to apply new bounds of all nodes
- for(Entry<EditPart, Rectangle> s : map.entrySet()) {
- SetBoundsCommand boundsCommand = new SetBoundsCommand(ted, "apply layout", new EObjectAdapter((View)s
+ for (Entry<EditPart, Rectangle> s : map.entrySet()) {
+ SetBoundsCommand boundsCommand = new SetBoundsCommand(ted, "apply layout", new EObjectAdapter((View) s
.getKey().getModel()), s.getValue());
command.add(boundsCommand);
- GraphicalEditPart gep = (GraphicalEditPart)s.getKey();
- if(cs == null) {
+ GraphicalEditPart gep = (GraphicalEditPart) s.getKey();
+ if (cs == null) {
cs = gep.getViewer().getEditDomain().getCommandStack();
}
}
@@ -82,19 +82,19 @@ public class GMFSubEditor implements LayouttoolInterface {
/**
* Gets the transactional editing domain.
- *
+ *
* @return the transactional editing domain
*/
private TransactionalEditingDomain getTransactionalEditingDomain() {
TransactionalEditingDomain ted = null;
IEditorPart activeEditor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
.getActiveEditor();
- if(activeEditor instanceof IDiagramWorkbenchPart) {
- IDiagramWorkbenchPart workbenchPart = (IDiagramWorkbenchPart)activeEditor;
- ted = (TransactionalEditingDomain)workbenchPart.getAdapter(EditingDomain.class);
- if(ted == null) {
- if(workbenchPart instanceof DiagramEditor) {
- DiagramEditor editor = (DiagramEditor)workbenchPart;
+ if (activeEditor instanceof IDiagramWorkbenchPart) {
+ IDiagramWorkbenchPart workbenchPart = (IDiagramWorkbenchPart) activeEditor;
+ ted = (TransactionalEditingDomain) workbenchPart.getAdapter(EditingDomain.class);
+ if (ted == null) {
+ if (workbenchPart instanceof DiagramEditor) {
+ DiagramEditor editor = (DiagramEditor) workbenchPart;
ted = editor.getEditingDomain();
}
}
@@ -108,10 +108,10 @@ public class GMFSubEditor implements LayouttoolInterface {
* @see org.eclipse.papyrus.layout.LayouttoolInterface#getBounds(org.eclipse.gef.EditPart)
*/
public Rectangle getBounds(EditPart element) {
- if(element.getModel() instanceof Node) {
- Node node = (Node)element.getModel();
- if(node.getLayoutConstraint() instanceof Bounds) {
- Bounds bounds = (Bounds)node.getLayoutConstraint();
+ if (element.getModel() instanceof Node) {
+ Node node = (Node) element.getModel();
+ if (node.getLayoutConstraint() instanceof Bounds) {
+ Bounds bounds = (Bounds) node.getLayoutConstraint();
return new Rectangle(bounds.getX(), bounds.getY(), bounds.getWidth(), bounds.getHeight());
}
}
@@ -124,10 +124,10 @@ public class GMFSubEditor implements LayouttoolInterface {
* @see org.eclipse.papyrus.layout.LayouttoolInterface#getTarget(org.eclipse.gef.EditPart)
*/
public EditPart getTarget(EditPart element) {
- if(element.getModel() instanceof Edge) {
- Edge edge = (Edge)element.getModel();
+ if (element.getModel() instanceof Edge) {
+ Edge edge = (Edge) element.getModel();
removeBendPoints(edge);
- AbstractConnectionEditPart acep = (AbstractConnectionEditPart)element;
+ AbstractConnectionEditPart acep = (AbstractConnectionEditPart) element;
return acep.getTarget();
}
return null;
@@ -135,13 +135,13 @@ public class GMFSubEditor implements LayouttoolInterface {
/**
* Removes the bend points.
- *
+ *
* @param edge
- * the edge
+ * the edge
*/
public void removeBendPoints(Edge edge) {
SetConnectionBendpointsCommand scbc = new SetConnectionBendpointsCommand(getTransactionalEditingDomain());
- scbc.setEdgeAdapter(new EObjectAdapter((View)edge));
+ scbc.setEdgeAdapter(new EObjectAdapter(edge));
scbc.setNewPointList(new PointList(), new Point(), new Point());
command.add(scbc);
}
@@ -153,15 +153,15 @@ public class GMFSubEditor implements LayouttoolInterface {
*/
public Rectangle getLayoutArea(EditPart[] element) {
Rectangle bounds;
- if(GMFLayoutAreaCreator.getBounds() != null) {
+ if (GMFLayoutAreaCreator.getBounds() != null) {
bounds = GMFLayoutAreaCreator.getBounds();
GMFLayoutAreaCreator.deleteLayoutArea();
return bounds;
}
- for(EditPart e : element) {
- if(e.getModel() instanceof Node) {
- if(e.getParent() instanceof GraphicalEditPart) {
- GraphicalEditPart gep = (GraphicalEditPart)e.getParent();
+ for (EditPart e : element) {
+ if (e.getModel() instanceof Node) {
+ if (e.getParent() instanceof GraphicalEditPart) {
+ GraphicalEditPart gep = (GraphicalEditPart) e.getParent();
bounds = gep.getFigure().getBounds();
bounds.x = 0;
bounds.y = 0;
@@ -178,10 +178,10 @@ public class GMFSubEditor implements LayouttoolInterface {
* @see org.eclipse.papyrus.layout.LayouttoolInterface#getSource(org.eclipse.gef.EditPart)
*/
public EditPart getSource(EditPart element) {
- if(element.getModel() instanceof Edge) {
- Edge edge = (Edge)element.getModel();
+ if (element.getModel() instanceof Edge) {
+ Edge edge = (Edge) element.getModel();
removeBendPoints(edge);
- AbstractConnectionEditPart acep = (AbstractConnectionEditPart)element;
+ AbstractConnectionEditPart acep = (AbstractConnectionEditPart) element;
return acep.getSource();
}
return null;
@@ -193,8 +193,8 @@ public class GMFSubEditor implements LayouttoolInterface {
* @see org.eclipse.papyrus.layout.LayouttoolInterface#isNode(org.eclipse.gef.EditPart)
*/
public boolean isNode(EditPart element) {
- if(element.getModel() instanceof Node) {
- if(GMFLayoutAreaCreator.getArea() != null && element.equals(GMFLayoutAreaCreator.getArea())) {
+ if (element.getModel() instanceof Node) {
+ if (GMFLayoutAreaCreator.getArea() != null && element.equals(GMFLayoutAreaCreator.getArea())) {
return false;
}
return true;
@@ -208,7 +208,7 @@ public class GMFSubEditor implements LayouttoolInterface {
* @see org.eclipse.papyrus.layout.LayouttoolInterface#isRelationship(org.eclipse.gef.EditPart)
*/
public boolean isRelationship(EditPart element) {
- if(element.getModel() instanceof Edge) {
+ if (element.getModel() instanceof Edge) {
return true;
}
return false;
diff --git a/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/Activator.java b/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/Activator.java
index c9461939bf0..7a80ffa424e 100644
--- a/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/Activator.java
+++ b/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/Activator.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -13,6 +13,7 @@
*****************************************************************************/
package org.eclipse.papyrus.layout;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.plugin.AbstractUIPlugin;
@@ -61,7 +62,7 @@ public class Activator extends AbstractUIPlugin {
/**
* Returns the shared instance.
- *
+ *
* @return the shared instance
*/
public static Activator getDefault() {
@@ -70,10 +71,10 @@ public class Activator extends AbstractUIPlugin {
/**
* Returns an image descriptor for the image file at the given plug-in relative path.
- *
+ *
* @param path
- * the path
- *
+ * the path
+ *
* @return the image descriptor
*/
public static ImageDescriptor getImageDescriptor(String path) {
@@ -82,23 +83,23 @@ public class Activator extends AbstractUIPlugin {
/**
* Log.
- *
+ *
* @param string
- * the string
+ * the string
* @param e
- * the e
+ * the e
*/
public void log(String string, Exception e) {
- getLog().log(new Status(Status.ERROR, PLUGIN_ID, string, e));
+ getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, string, e));
}
/**
* Log.
- *
+ *
* @param string
- * the string
+ * the string
* @param severity
- * the severity
+ * the severity
*/
public void log(String string, int severity) {
getLog().log(new Status(severity, PLUGIN_ID, string));
@@ -106,11 +107,11 @@ public class Activator extends AbstractUIPlugin {
/**
* Log.
- *
+ *
* @param string
- * the string
+ * the string
*/
public void log(String string) {
- log(string, Status.WARNING);
+ log(string, IStatus.WARNING);
}
}
diff --git a/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/EditorPropertyTester.java b/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/EditorPropertyTester.java
index de93a9a9e54..009b103a03a 100644
--- a/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/EditorPropertyTester.java
+++ b/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/EditorPropertyTester.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -30,21 +30,22 @@ public class EditorPropertyTester extends PropertyTester {
/**
* Test if the current editor is a registered editor.
- *
+ *
* @param receiver
- * the receiver
+ * the receiver
* @param property
- * the property
+ * the property
* @param args
- * the args
+ * the args
* @param expectedValue
- * the expected value
- *
+ * the expected value
+ *
* @return true, if test
*/
+ @Override
public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
- if(receiver instanceof IWorkbenchPart && "isCorrectEditor".equals(property)) {
- IWorkbenchPart part = (IWorkbenchPart)receiver;
+ if (receiver instanceof IWorkbenchPart && "isCorrectEditor".equals(property)) {
+ IWorkbenchPart part = (IWorkbenchPart) receiver;
return LayoutToolExtensionPointManager.getInstance().getSubEditor(part) != null;
}
return false;
diff --git a/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/LayoutTool.java b/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/LayoutTool.java
index 8bd38fbfd29..3f22f17ead3 100644
--- a/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/LayoutTool.java
+++ b/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/LayoutTool.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -30,7 +30,7 @@ public class LayoutTool {
/**
* Gets the single instance of LayoutTool.
- *
+ *
* @return single instance of LayoutTool
*/
public static LayoutTool getInstance() {
@@ -48,16 +48,16 @@ public class LayoutTool {
*/
/**
* Apply layout.
- *
+ *
* @param algoName
- * the algo name
+ * the algo name
* @param parts
- * the parts
+ * the parts
*/
public void applyLayout(String algoName, List<EditPart> parts) {
Collection<LayoutToolAlgorithms> algorithmes = ZestAlgortihms.getRegisteredAlgorithmes();
- for(LayoutToolAlgorithms algorithme : algorithmes) {
- if(algorithme.getName().equals(algoName)) {
+ for (LayoutToolAlgorithms algorithme : algorithmes) {
+ if (algorithme.getName().equals(algoName)) {
LayouttoolController controller = new LayouttoolController(parts, algorithme.getAlgorithm());
controller.execute();
break;
diff --git a/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/LayoutToolAlgorithms.java b/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/LayoutToolAlgorithms.java
index a65fae7c045..ca00273a828 100644
--- a/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/LayoutToolAlgorithms.java
+++ b/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/LayoutToolAlgorithms.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -15,7 +15,6 @@
package org.eclipse.papyrus.layout;
import org.eclipse.swt.graphics.Image;
-import org.eclipse.zest.layouts.algorithms.AbstractLayoutAlgorithm;
/**
* The class LayoutToolAlgorithms contains all information needed for an algorithm.
@@ -39,7 +38,7 @@ public class LayoutToolAlgorithms {
/**
* Gets the path.
- *
+ *
* @return path
*/
public String getPath() {
@@ -48,9 +47,9 @@ public class LayoutToolAlgorithms {
/**
* Sets the path.
- *
+ *
* @param path
- * the path
+ * the path
*/
public void setPath(String path) {
this.path = path;
@@ -58,7 +57,7 @@ public class LayoutToolAlgorithms {
/**
* Gets the tool tip text.
- *
+ *
* @return toolTip text
*/
public String getToolTipText() {
@@ -67,9 +66,9 @@ public class LayoutToolAlgorithms {
/**
* Sets the tool tip text.
- *
+ *
* @param toolTipText
- * the toolTip text
+ * the toolTip text
*/
public void setToolTipText(String toolTipText) {
this.toolTipText = toolTipText;
@@ -77,9 +76,9 @@ public class LayoutToolAlgorithms {
/**
* Sets the algorithm.
- *
+ *
* @param algorithm
- * the algorithm to apply
+ * the algorithm to apply
*/
public void setAlgorithm(AbstractLayoutAlgorithm algorithm) {
this.algorithm = algorithm;
@@ -87,7 +86,7 @@ public class LayoutToolAlgorithms {
/**
* Gets the algorithm.
- *
+ *
* @return algorithm
*/
public AbstractLayoutAlgorithm getAlgorithm() {
@@ -96,9 +95,9 @@ public class LayoutToolAlgorithms {
/**
* Sets the name.
- *
+ *
* @param name
- * the name of the algorithm
+ * the name of the algorithm
*/
public void setName(String name) {
this.name = name;
@@ -106,7 +105,7 @@ public class LayoutToolAlgorithms {
/**
* Gets the name.
- *
+ *
* @return name of the algorithm
*/
public String getName() {
@@ -115,9 +114,9 @@ public class LayoutToolAlgorithms {
/**
* Sets the icon.
- *
+ *
* @param icon
- * display on the toolbar
+ * display on the toolbar
*/
public void setIcon(Image icon) {
this.icon = icon;
@@ -125,7 +124,7 @@ public class LayoutToolAlgorithms {
/**
* Gets the icon.
- *
+ *
* @return icon
*/
public Image getIcon() {
diff --git a/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/LayoutToolAreaInterface.java b/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/LayoutToolAreaInterface.java
index 7e7f90dab11..4134d58a1af 100644
--- a/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/LayoutToolAreaInterface.java
+++ b/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/LayoutToolAreaInterface.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
diff --git a/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/LayoutToolExtensionPointManager.java b/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/LayoutToolExtensionPointManager.java
index 1626828a301..c7cd1d7a23c 100644
--- a/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/LayoutToolExtensionPointManager.java
+++ b/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/LayoutToolExtensionPointManager.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -43,7 +43,7 @@ public class LayoutToolExtensionPointManager {
/**
* Gets the single instance of LayoutToolExtensionPointManager.
- *
+ *
* @return single instance of LayoutToolExtensionPointManager
*/
public static LayoutToolExtensionPointManager getInstance() {
@@ -52,22 +52,22 @@ public class LayoutToolExtensionPointManager {
/**
* Gets the layout area creator.
- *
+ *
* @return layout area creator
*/
public LayoutToolAreaInterface getLayoutAreaCreator() {
try {
- for(IConfigurationElement e : configurationElementsLayoutTools) {
+ for (IConfigurationElement e : configurationElementsLayoutTools) {
Class<?> o;
- LayouttoolInterface interfaceL = (LayouttoolInterface)Platform.getBundle(e.getContributor().getName())
+ LayouttoolInterface interfaceL = (LayouttoolInterface) Platform.getBundle(e.getContributor().getName())
.loadClass(e.getAttribute(Constants.EXTENSION_INTERFACE)).newInstance();
o = interfaceL.getEditorClass();
IWorkbenchPart activeEditor = getActiveEditor();
- if(activeEditor != null) {
- if(o.isAssignableFrom(activeEditor.getClass())) {
- if(e.getAttribute(Constants.EXTENSION_INTERFACE_LAYOUT_AREA) != null) {
- return (LayoutToolAreaInterface)e
+ if (activeEditor != null) {
+ if (o.isAssignableFrom(activeEditor.getClass())) {
+ if (e.getAttribute(Constants.EXTENSION_INTERFACE_LAYOUT_AREA) != null) {
+ return (LayoutToolAreaInterface) e
.createExecutableExtension(Constants.EXTENSION_INTERFACE_LAYOUT_AREA);
}
}
@@ -89,28 +89,28 @@ public class LayoutToolExtensionPointManager {
/**
* Gets the sub editor.
- *
+ *
* @param part
- * the part
- *
+ * the part
+ *
* @return subEditor class
*/
public LayouttoolInterface getSubEditor(IWorkbenchPart part) {
try {
- for(IConfigurationElement e : configurationElementsLayoutTools) {
+ for (IConfigurationElement e : configurationElementsLayoutTools) {
Class<?> o;
- LayouttoolInterface interfaceL = (LayouttoolInterface)Platform.getBundle(e.getContributor().getName())
+ LayouttoolInterface interfaceL = (LayouttoolInterface) Platform.getBundle(e.getContributor().getName())
.loadClass(e.getAttribute(Constants.EXTENSION_INTERFACE)).newInstance();
o = interfaceL.getEditorClass();
IWorkbenchPart activeEditor = null;
- if(part != null) {
+ if (part != null) {
activeEditor = part;
} else {
activeEditor = getActiveEditor();
}
- if(activeEditor != null) {
- if(o.isAssignableFrom(activeEditor.getClass())) {
- return (LayouttoolInterface)e.createExecutableExtension(Constants.EXTENSION_INTERFACE);
+ if (activeEditor != null) {
+ if (o.isAssignableFrom(activeEditor.getClass())) {
+ return (LayouttoolInterface) e.createExecutableExtension(Constants.EXTENSION_INTERFACE);
}
}
}
@@ -130,7 +130,7 @@ public class LayoutToolExtensionPointManager {
/**
* Gets the sub editor.
- *
+ *
* @return subEditor class
*/
public LayouttoolInterface getSubEditor() {
@@ -139,15 +139,15 @@ public class LayoutToolExtensionPointManager {
/**
* Gets the active editor.
- *
+ *
* @return active editor
*/
public IEditorPart getActiveEditor() {
IEditorPart editor = null;
- if(PlatformUI.getWorkbench() != null) {
- if(PlatformUI.getWorkbench().getActiveWorkbenchWindow() != null) {
- if(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage() != null) {
- if(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor() != null) {
+ if (PlatformUI.getWorkbench() != null) {
+ if (PlatformUI.getWorkbench().getActiveWorkbenchWindow() != null) {
+ if (PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage() != null) {
+ if (PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor() != null) {
editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
}
}
diff --git a/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/LayoutToolToolbar.java b/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/LayoutToolToolbar.java
index bfb1576b1a5..283ca5396f1 100644
--- a/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/LayoutToolToolbar.java
+++ b/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/LayoutToolToolbar.java
@@ -107,7 +107,7 @@ public class LayoutToolToolbar extends ContributionItem {
* Instantiates a new layout tool toolbar.
*
* @param id
- * the id
+ * the id
*/
public LayoutToolToolbar(String id) {
super(id);
@@ -122,7 +122,7 @@ public class LayoutToolToolbar extends ContributionItem {
public void fill(final ToolBar toolBar, int index) {
this.toolbar = toolBar;
itemDropDown = new ToolItem(toolBar, SWT.DROP_DOWN);
- if(currentAlgorithm == null) {
+ if (currentAlgorithm == null) {
itemDropDown.setImage(imageLayout);
} else {
itemDropDown.setImage(currentAlgorithm.getIcon());
@@ -134,7 +134,7 @@ public class LayoutToolToolbar extends ContributionItem {
@Override
public void handleEvent(Event event) {
getMenu(toolbar);
- if(event.detail == SWT.ARROW) {
+ if (event.detail == SWT.ARROW) {
Rectangle bounds = itemDropDown.getBounds();
Point point = toolBar.toDisplay(bounds.x, bounds.y + bounds.height);
menu.setLocation(point);
@@ -148,21 +148,21 @@ public class LayoutToolToolbar extends ContributionItem {
@Override
public void handleEvent(Event event) {
getSelection();
- if(currentAlgorithm == null && event.y == 0 && itemForMenu.getData() != null && itemForMenu.getData().equals(itemLayoutText)) {
+ if (currentAlgorithm == null && event.y == 0 && itemForMenu.getData() != null && itemForMenu.getData().equals(itemLayoutText)) {
createLayoutArea();
}
- if(hasElementsSelected()) {
- if(event.y == 0) {
- if(currentAlgorithm != null) {
+ if (hasElementsSelected()) {
+ if (event.y == 0) {
+ if (currentAlgorithm != null) {
callAlgorithm();
}
}
- for(MenuItem menuItem : menu.getItems()) {
+ for (MenuItem menuItem : menu.getItems()) {
menuItem.setEnabled(true);
}
} else {
- for(MenuItem menuItem : menu.getItems()) {
- if(!menuItem.getText().equals(itemLayoutText)) {
+ for (MenuItem menuItem : menu.getItems()) {
+ if (!menuItem.getText().equals(itemLayoutText)) {
menuItem.setEnabled(false);
}
}
@@ -178,17 +178,17 @@ public class LayoutToolToolbar extends ContributionItem {
* Gets the menu.
*
* @param parent
- * the parent
+ * the parent
*
* @return Menu
*/
public Menu getMenu(Control parent) {
menu = new Menu(parent);
insertIntoMenuAlgorithms();
- if(menu.getItems().length > 0) {
- if(parent instanceof ToolBar) {
- toolbar = (ToolBar)parent;
- if(toolbar.getItems().length == 1) {
+ if (menu.getItems().length > 0) {
+ if (parent instanceof ToolBar) {
+ toolbar = (ToolBar) parent;
+ if (toolbar.getItems().length == 1) {
itemForMenu = toolbar.getItem(0);
}
}
@@ -201,27 +201,27 @@ public class LayoutToolToolbar extends ContributionItem {
* Add algorithms into the menu.
*/
private void insertIntoMenuAlgorithms() {
- if(algorithmes == null || algorithmes.isEmpty()) {
+ if (algorithmes == null || algorithmes.isEmpty()) {
Activator.getDefault().log("Algorithms not found");
return;
}
Map<String, Menu> mapMenuPath = new HashMap<String, Menu>();
- for(final LayoutToolAlgorithms a : algorithmes) {
+ for (final LayoutToolAlgorithms a : algorithmes) {
Menu submenu = menu;
- if(a.getPath() != null) {
+ if (a.getPath() != null) {
String[] pathSplit = a.getPath().split("\\.");
String subString = "";
- for(int i = 0; i < pathSplit.length; i++) {
+ for (int i = 0; i < pathSplit.length; i++) {
subString += pathSplit[i];
- if(!mapMenuPath.keySet().contains(subString)) {
+ if (!mapMenuPath.keySet().contains(subString)) {
MenuItem itemPath = new MenuItem(submenu, SWT.CASCADE);
itemPath.setText(pathSplit[i]);
submenu = new Menu(submenu);
itemPath.setMenu(submenu);
mapMenuPath.put(subString, submenu);
} else {
- for(String path : mapMenuPath.keySet()) {
- if(subString.equals(path)) {
+ for (String path : mapMenuPath.keySet()) {
+ if (subString.equals(path)) {
submenu = mapMenuPath.get(path);
}
}
@@ -233,18 +233,18 @@ public class LayoutToolToolbar extends ContributionItem {
item.setText(a.getName());
item.setImage(a.getIcon());
item.setData(a);
- if(a.getToolTipText() != null) {
+ if (a.getToolTipText() != null) {
final ToolTip toolTip = new ToolTip(menu.getShell(), SWT.NONE);
toolTip.setText(item.getText());
- toolTip.setMessage(((LayoutToolAlgorithms)item.getData()).getToolTipText());
+ toolTip.setMessage(((LayoutToolAlgorithms) item.getData()).getToolTipText());
item.addListener(SWT.Arm, new Listener() {
@Override
public void handleEvent(Event event) {
- if(currentToolTip != null) {
+ if (currentToolTip != null) {
currentToolTip.setVisible(false);
}
- if(layoutToolTip != null) {
+ if (layoutToolTip != null) {
layoutToolTip.setVisible(false);
}
currentToolTip = toolTip;
@@ -260,11 +260,11 @@ public class LayoutToolToolbar extends ContributionItem {
@Override
public void handleEvent(Event event) {
- if(currentToolTip != null) {
+ if (currentToolTip != null) {
currentToolTip.setVisible(false);
currentToolTip = null;
}
- if(layoutToolTip != null) {
+ if (layoutToolTip != null) {
layoutToolTip.setVisible(false);
}
}
@@ -274,8 +274,8 @@ public class LayoutToolToolbar extends ContributionItem {
@Override
public void widgetSelected(SelectionEvent e) {
- if(((MenuItem)e.getSource()).getSelection()) {
- if(currentToolTip != null) {
+ if (((MenuItem) e.getSource()).getSelection()) {
+ if (currentToolTip != null) {
currentToolTip.setVisible(false);
}
handleSelected(e, item);
@@ -289,15 +289,15 @@ public class LayoutToolToolbar extends ContributionItem {
* Handle selected.
*
* @param e
- * the e
+ * the e
* @param item
- * the item
+ * the item
*/
private void handleSelected(SelectionEvent e, MenuItem item) {
- LayoutToolAlgorithms layoutToolAlgorithms = (LayoutToolAlgorithms)item.getData();
- if(itemForMenu != null) {
+ LayoutToolAlgorithms layoutToolAlgorithms = (LayoutToolAlgorithms) item.getData();
+ if (itemForMenu != null) {
itemForMenu.setImage(layoutToolAlgorithms.getIcon());
- if(layoutToolAlgorithms.getToolTipText() != null) {
+ if (layoutToolAlgorithms.getToolTipText() != null) {
itemForMenu.setToolTipText(layoutToolAlgorithms.getToolTipText());
} else {
itemForMenu.setToolTipText(null);
@@ -311,7 +311,7 @@ public class LayoutToolToolbar extends ContributionItem {
* Run.
*
* @param action
- * the action
+ * the action
*/
public void run(IAction action) {
callAlgorithm();
@@ -321,7 +321,7 @@ public class LayoutToolToolbar extends ContributionItem {
* Call algorithm.
*/
private void callAlgorithm() {
- if(currentAlgorithm == null) {
+ if (currentAlgorithm == null) {
MessageDialog.openWarning(Display.getDefault().getActiveShell(), "Warning", "Please choose an algorithm");
return;
}
@@ -332,9 +332,9 @@ public class LayoutToolToolbar extends ContributionItem {
* Selection changed.
*
* @param action
- * the action
+ * the action
* @param selection
- * the selection
+ * the selection
*/
public void selectionChanged(IAction action, ISelection selection) {
theSelection = selection;
@@ -357,12 +357,12 @@ public class LayoutToolToolbar extends ContributionItem {
*/
public List<EditPart> getEditPartSelected() {
List<EditPart> editParts = new ArrayList<EditPart>();
- if(theSelection instanceof IStructuredSelection) {
- IStructuredSelection selec = (IStructuredSelection)theSelection;
+ if (theSelection instanceof IStructuredSelection) {
+ IStructuredSelection selec = (IStructuredSelection) theSelection;
List<?> objects = selec.toList();
- for(Object iter : objects) {
- if(iter instanceof EditPart) {
- EditPart e = (EditPart)iter;
+ for (Object iter : objects) {
+ if (iter instanceof EditPart) {
+ EditPart e = (EditPart) iter;
editParts.add(e);
}
}
@@ -375,7 +375,7 @@ public class LayoutToolToolbar extends ContributionItem {
* Sort editParts to have editParts which have less parents in first.
*
* @param editParts
- * the edit parts
+ * the edit parts
*/
public static void sort(List<EditPart> editParts) {
Collections.sort(editParts, new Comparator<EditPart>() {
@@ -391,14 +391,14 @@ public class LayoutToolToolbar extends ContributionItem {
* Gets the nb parents.
*
* @param part
- * editPart
+ * editPart
*
* @return number parents of the editPart
*/
private static int getNbParents(EditPart part) {
int result = 0;
EditPart tmp = part;
- while(tmp.getParent() != null) {
+ while (tmp.getParent() != null) {
result++;
tmp = tmp.getParent();
}
@@ -426,7 +426,7 @@ public class LayoutToolToolbar extends ContributionItem {
* create layout area icon.
*/
private void createLayoutAreaIcon() {
- if(LayoutToolExtensionPointManager.getInstance().getLayoutAreaCreator() != null) {
+ if (LayoutToolExtensionPointManager.getInstance().getLayoutAreaCreator() != null) {
new MenuItem(menu, SWT.SEPARATOR);
final MenuItem itemLayout = new MenuItem(menu, SWT.PUSH);
@@ -441,7 +441,7 @@ public class LayoutToolToolbar extends ContributionItem {
@Override
public void handleEvent(Event event) {
- if(currentToolTip != null) {
+ if (currentToolTip != null) {
currentToolTip.setVisible(false);
}
layoutToolTip.setText(itemLayout.getText());
@@ -457,7 +457,7 @@ public class LayoutToolToolbar extends ContributionItem {
@Override
public void widgetSelected(SelectionEvent e) {
- if(layoutToolTip != null) {
+ if (layoutToolTip != null) {
layoutToolTip.setVisible(false);
}
createLayoutArea();
diff --git a/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/LayouttoolController.java b/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/LayouttoolController.java
index d2de2bb2c21..24cc3f76e20 100644
--- a/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/LayouttoolController.java
+++ b/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/LayouttoolController.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -22,11 +22,6 @@ import java.util.Map;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.gef.EditPart;
import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.zest.layouts.InvalidLayoutConfiguration;
-import org.eclipse.zest.layouts.LayoutAlgorithm;
-import org.eclipse.zest.layouts.algorithms.AbstractLayoutAlgorithm;
-import org.eclipse.zest.layouts.exampleStructures.SimpleNode;
-import org.eclipse.zest.layouts.exampleStructures.SimpleRelationship;
/**
* The class LayouttoolController.
@@ -53,11 +48,11 @@ public class LayouttoolController {
/**
* The Constructor.
- *
+ *
* @param list
- * of EditPart selected
+ * of EditPart selected
* @param currentAlgorithm
- * algorithm to apply
+ * algorithm to apply
*/
public LayouttoolController(List<EditPart> list, AbstractLayoutAlgorithm currentAlgorithm) {
listEditPartSelected = list;
@@ -70,17 +65,17 @@ public class LayouttoolController {
*/
public void execute() {
subEditor = LayoutToolExtensionPointManager.getInstance().getSubEditor();
- if(subEditor == null) {
+ if (subEditor == null) {
Activator.getDefault().log("Editor not found");
return;
}
- if(listEditPartSelected == null || listEditPartSelected.size() <= 1) {
+ if (listEditPartSelected == null || listEditPartSelected.size() <= 1) {
Activator.getDefault().log("Select at least two elements");
return;
}
// create all nodes
createNodes();
- if(listNodes == null || listNodes.size() <= 1) {
+ if (listNodes == null || listNodes.size() <= 1) {
Activator.getDefault().log("Any node selected");
return;
}
@@ -100,7 +95,7 @@ public class LayouttoolController {
try {
currentLayoutAlgorithm
.applyLayout(listSimpleNode, listSimpleRelationship, layoutArea.preciseX(), layoutArea.preciseY(),
- layoutArea.preciseWidth() - 40, layoutArea.preciseHeight() - 5, false, false);
+ layoutArea.preciseWidth() - 40, layoutArea.preciseHeight() - 5, false, false);
} catch (InvalidLayoutConfiguration e) {
Activator.getDefault().log(e.getMessage() + " : Layout cannot be applied", e);
}
@@ -113,23 +108,23 @@ public class LayouttoolController {
* SimpleRelationships.
*/
private void createRelationships() {
- for(int i = 0; i < listNodes.size(); i++) {
- List<EditPart> sources = getSourceRelationships((EditPart)listNodes.get(i).getRealObject());
- for(EditPart source : sources) {
+ for (int i = 0; i < listNodes.size(); i++) {
+ List<EditPart> sources = getSourceRelationships((EditPart) listNodes.get(i).getRealObject());
+ for (EditPart source : sources) {
EditPart node = subEditor.getTarget(source);
SimpleRelationship relationship = getSimpleRelationship(subEditor.getSource(source), subEditor
.getTarget(source));
- if(!listRelationships.contains(relationship) && listNodesEditPart.contains(node)) {
+ if (!listRelationships.contains(relationship) && listNodesEditPart.contains(node)) {
listRelationships.add(relationship);
}
listNodes.get(i).addRelationship(relationship);
}
- List<EditPart> targets = getTargetRelationships((EditPart)listNodes.get(i).getRealObject());
- for(EditPart target : targets) {
+ List<EditPart> targets = getTargetRelationships((EditPart) listNodes.get(i).getRealObject());
+ for (EditPart target : targets) {
EditPart node = subEditor.getSource(target);
SimpleRelationship relationship = getSimpleRelationship(subEditor.getSource(target), subEditor
.getTarget(target));
- if(!listRelationships.contains(relationship) && listNodesEditPart.contains(node)) {
+ if (!listRelationships.contains(relationship) && listNodesEditPart.contains(node)) {
listRelationships.add(relationship);
}
listNodes.get(i).addRelationship(relationship);
@@ -141,10 +136,10 @@ public class LayouttoolController {
* For all nodes selected, create SimpleNodes.
*/
private void createNodes() {
- for(EditPart editPart : listEditPartSelected) {
- if(subEditor.isNode(editPart)) {
+ for (EditPart editPart : listEditPartSelected) {
+ if (subEditor.isNode(editPart)) {
Rectangle coordinates = subEditor.getBounds(editPart);
- if(coordinates != null) {
+ if (coordinates != null) {
listNodes.add(getSimpleNode(editPart, coordinates));
listNodesEditPart.add(editPart);
}
@@ -154,12 +149,12 @@ public class LayouttoolController {
/**
* Gets the simple relationship.
- *
+ *
* @param source
- * node
+ * node
* @param destination
- * node
- *
+ * node
+ *
* @return SimpleRelationship
*/
public SimpleRelationship getSimpleRelationship(EditPart source, EditPart destination) {
@@ -168,12 +163,12 @@ public class LayouttoolController {
EditPart editPart;
// for all nodes, search the source SimpleNode and the destination SimpleNode of this
// relationship
- for(SimpleNode sn : listNodes) {
- editPart = (EditPart)sn.getRealObject();
- if(editPart.equals(source)) {
+ for (SimpleNode sn : listNodes) {
+ editPart = (EditPart) sn.getRealObject();
+ if (editPart.equals(source)) {
simpleNodeSource = sn;
}
- if(editPart.equals(destination)) {
+ if (editPart.equals(destination)) {
simpleNodeDestination = sn;
}
}
@@ -183,27 +178,27 @@ public class LayouttoolController {
/**
* Match each editPart with their new coordinates.
- *
+ *
* @return map EditPart with his news coordinates
*/
public Map<EditPart, Rectangle> matchEditPartCoordinates() {
Map<EditPart, Rectangle> map = new HashMap<EditPart, Rectangle>();
- for(SimpleNode node : this.listNodes) {
- Rectangle coordinates = new Rectangle((int)node.getXInLayout(), (int)node.getYInLayout(), (int)node
- .getWidthInLayout(), (int)node.getHeightInLayout());
- map.put((EditPart)node.getRealObject(), coordinates);
+ for (SimpleNode node : this.listNodes) {
+ Rectangle coordinates = new Rectangle((int) node.getXInLayout(), (int) node.getYInLayout(), (int) node
+ .getWidthInLayout(), (int) node.getHeightInLayout());
+ map.put((EditPart) node.getRealObject(), coordinates);
}
return map;
}
/**
* Gets the simple node.
- *
+ *
* @param element
- * node
+ * node
* @param coordinates
- * the coordinates
- *
+ * the coordinates
+ *
* @return SimpleNode
*/
public SimpleNode getSimpleNode(EditPart element, Rectangle coordinates) {
@@ -212,14 +207,14 @@ public class LayouttoolController {
/**
* Gets the simple node.
- *
+ *
* @param element
- * node
+ * node
* @param coordinates
- * the coordinates
+ * the coordinates
* @param ignoreInLayout
- * ignore a node when apply layout
- *
+ * ignore a node when apply layout
+ *
* @return SimpleNode
*/
public SimpleNode getSimpleNode(EditPart element, Rectangle coordinates, boolean ignoreInLayout) {
@@ -231,28 +226,28 @@ public class LayouttoolController {
/**
* Gets the source relationships.
- *
+ *
* @param editPart
- * node
- *
+ * node
+ *
* @return list of EditPart
*/
public List<EditPart> getSourceRelationships(EditPart editPart) {
- GraphicalEditPart gep = (GraphicalEditPart)editPart;
+ GraphicalEditPart gep = (GraphicalEditPart) editPart;
List<EditPart> sourceConnections = gep.getSourceConnections();
return sourceConnections;
}
/**
* Gets the target relationships.
- *
+ *
* @param editPart
- * node
- *
+ * node
+ *
* @return list of EditPart
*/
public List<EditPart> getTargetRelationships(EditPart editPart) {
- GraphicalEditPart gep = (GraphicalEditPart)editPart;
+ GraphicalEditPart gep = (GraphicalEditPart) editPart;
List<EditPart> targetConnections = gep.getTargetConnections();
return targetConnections;
}
diff --git a/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/LayouttoolInterface.java b/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/LayouttoolInterface.java
index 0130a532ecf..1b152e0bece 100644
--- a/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/LayouttoolInterface.java
+++ b/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/LayouttoolInterface.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -26,76 +26,76 @@ public interface LayouttoolInterface {
/**
* Get the registered editor class.
- *
+ *
* @return Class
*/
Class getEditorClass();
/**
* Is a node.
- *
+ *
* @param element
- * the element
- *
+ * the element
+ *
* @return true, if the EditPart is a node
*/
boolean isNode(EditPart element);
/**
* Is a relationship.
- *
+ *
* @param element
- * the element
- *
+ * the element
+ *
* @return true, if the EditPart is a relationship
*/
boolean isRelationship(EditPart element);
/**
* Get bounds of EditPart.
- *
+ *
* @param element
- * the Node to have their coordinates
- *
+ * the Node to have their coordinates
+ *
* @return Rectangle coordinates of the node
*/
Rectangle getBounds(EditPart element);
/**
* Get source of relationship.
- *
+ *
* @param element
- * relationship to have his source
- *
+ * relationship to have his source
+ *
* @return EditPart source node of the relationship
*/
EditPart getSource(EditPart element);
/**
* Get destination of relationship.
- *
+ *
* @param element
- * relationship to have his destination
- *
+ * relationship to have his destination
+ *
* @return EditPart destination node of the relationship
*/
EditPart getTarget(EditPart element);
/**
* Get layout area.
- *
+ *
* @param element
- * the element
- *
+ * the element
+ *
* @return Rectangle coordinates of layout area
*/
Rectangle getLayoutArea(EditPart[] element);
/**
* Execute layout.
- *
+ *
* @param map
- * the map
+ * the map
*/
void execute(Map<EditPart, Rectangle> map);
diff --git a/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/managealgorithms/AlgorithmFactory.java b/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/managealgorithms/AlgorithmFactory.java
index 5571cc2fff3..ad30984886f 100644
--- a/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/managealgorithms/AlgorithmFactory.java
+++ b/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/managealgorithms/AlgorithmFactory.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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
@@ -14,8 +14,6 @@
package org.eclipse.papyrus.layout.managealgorithms;
-import org.eclipse.zest.layouts.algorithms.AbstractLayoutAlgorithm;
-
/**
* The class AlgorithmFactory.
*/
@@ -23,7 +21,7 @@ public interface AlgorithmFactory {
/**
* Creates the algorithm.
- *
+ *
* @return algorithm
*/
AbstractLayoutAlgorithm createAlgorithm();
diff --git a/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/managealgorithms/ZestAlgortihms.java b/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/managealgorithms/ZestAlgortihms.java
index c095b85ee81..17d6d586be2 100644
--- a/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/managealgorithms/ZestAlgortihms.java
+++ b/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/managealgorithms/ZestAlgortihms.java
@@ -44,45 +44,45 @@ public class ZestAlgortihms {
public static Collection<LayoutToolAlgorithms> getRegisteredAlgorithmes() {
IConfigurationElement[] elements = Platform.getExtensionRegistry().getConfigurationElementsFor(Constants.EXTENSION_POINT_ID_ALGORITHMS);
LinkedList<LayoutToolAlgorithms> algo = new LinkedList<LayoutToolAlgorithms>();
- for(IConfigurationElement e : elements) {
+ for (IConfigurationElement e : elements) {
try {
LayoutToolAlgorithms algorithm = new LayoutToolAlgorithms();
- AlgorithmFactory factory = (AlgorithmFactory)e.createExecutableExtension(Constants.EXTENSION_CLASS_ALGORITHMS);
+ AlgorithmFactory factory = (AlgorithmFactory) e.createExecutableExtension(Constants.EXTENSION_CLASS_ALGORITHMS);
algorithm.setAlgorithm(factory.createAlgorithm());
- if(e.getAttribute(Constants.EXTENSION_NAME) != null) {
+ if (e.getAttribute(Constants.EXTENSION_NAME) != null) {
String name = e.getAttribute(Constants.EXTENSION_NAME);
name = format(name);
algorithm.setName(name);
}
- if(e.getAttribute(Constants.EXTENSION_ICON) != null) {
+ if (e.getAttribute(Constants.EXTENSION_ICON) != null) {
algorithm.setIcon(getIcon(e, e.getAttribute(Constants.EXTENSION_ICON)));
}
- if(e.getAttribute(Constants.EXTENSION_TOOLTIP) != null) {
+ if (e.getAttribute(Constants.EXTENSION_TOOLTIP) != null) {
algorithm.setToolTipText(e.getAttribute(Constants.EXTENSION_TOOLTIP));
}
- if(e.getAttribute(Constants.EXTENSION_PATH) != null) {
+ if (e.getAttribute(Constants.EXTENSION_PATH) != null) {
algorithm.setPath(e.getAttribute(Constants.EXTENSION_PATH));
}
algo.add(algorithm);
} catch (CoreException e1) {
e1.printStackTrace();
}
- if(!algo.isEmpty()) {
+ if (!algo.isEmpty()) {
Collections.sort(algo, new Comparator<LayoutToolAlgorithms>() {
@Override
public int compare(LayoutToolAlgorithms arg0, LayoutToolAlgorithms arg1) {
int length0 = 0;
- if(arg0.getPath() != null) {
+ if (arg0.getPath() != null) {
String[] pathSplit0 = arg0.getPath().split("\\.");
length0 = pathSplit0.length;
}
int length1 = 0;
- if(arg1.getPath() != null) {
+ if (arg1.getPath() != null) {
String[] pathSplit1 = arg1.getPath().split("\\.");
length1 = pathSplit1.length;
}
- if(length1 == length0) {
+ if (length1 == length0) {
String a = arg0.getPath() + arg0.getName();
String b = arg1.getPath() + arg1.getName();
return a.compareTo(b);
@@ -100,15 +100,15 @@ public class ZestAlgortihms {
* Format.
*
* @param name
- * of algorithm
+ * of algorithm
*
* @return name formated
*/
private static String format(String name) {
String[] split = name.split("\\s");
StringBuffer result = new StringBuffer("");
- for(String s : split) {
- if(s.length() > 0) {
+ for (String s : split) {
+ if (s.length() > 0) {
result.append(s.substring(0, 1).toUpperCase());
result.append(s.substring(1, s.length()).toLowerCase());
result.append(" ");
@@ -121,18 +121,18 @@ public class ZestAlgortihms {
* Gets the icon.
*
* @param e
- * IConfigurationElement
+ * IConfigurationElement
* @param attribute
- * name of icon
+ * name of icon
*
* @return icon of algorithm
*/
private static Image getIcon(IConfigurationElement e, String attribute) {
try {
Bundle bundle = Platform.getBundle(e.getContributor().getName());
- if(bundle != null) {
+ if (bundle != null) {
URL resource = bundle.getResource(attribute);
- if(resource != null) {
+ if (resource != null) {
return new Image(Display.getDefault(), resource.openStream());
}
}
diff --git a/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/utils/Constants.java b/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/utils/Constants.java
index 382cbd44344..36394d0a7cc 100644
--- a/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/utils/Constants.java
+++ b/extraplugins/layout/org.eclipse.papyrus.layout/src/org/eclipse/papyrus/layout/utils/Constants.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2009 Atos Origin.
*
- *
+ *
* 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

Back to the top