Backport code changes from RCP
diff --git a/bundles/org.eclipse.rap.draw2d/.checkstyle b/bundles/org.eclipse.rap.draw2d/.checkstyle
deleted file mode 100644
index 00370b8..0000000
--- a/bundles/org.eclipse.rap.draw2d/.checkstyle
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<fileset-config file-format-version="1.1.0" simple-config="false">
-<fileset name="All Java Files" check-config-name="Checkstyle Generic" enabled="true"><file-match-pattern match-pattern=".java$" include-pattern="true"/>
-</fileset>
-<fileset name="All API Files" check-config-name="API Checkstyle" enabled="true"><file-match-pattern match-pattern=".java$" include-pattern="true"/>
-<file-match-pattern match-pattern=".internal.*.java$" include-pattern="false"/>
-</fileset>
-</fileset-config>
\ No newline at end of file
diff --git a/bundles/org.eclipse.rap.draw2d/.classpath b/bundles/org.eclipse.rap.draw2d/.classpath
index ce73933..304e861 100644
--- a/bundles/org.eclipse.rap.draw2d/.classpath
+++ b/bundles/org.eclipse.rap.draw2d/.classpath
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/bundles/org.eclipse.rap.draw2d/about.ini b/bundles/org.eclipse.rap.draw2d/about.ini
index f4b4beb..b33a339 100644
--- a/bundles/org.eclipse.rap.draw2d/about.ini
+++ b/bundles/org.eclipse.rap.draw2d/about.ini
@@ -8,4 +8,4 @@
aboutText=%blurb
# Property "featureImage" contains path to feature image (32x32)
-featureImage=modeling32.png
+featureImage=gef_eclipse_logo_32.png
diff --git a/bundles/org.eclipse.rap.draw2d/about.properties b/bundles/org.eclipse.rap.draw2d/about.properties
index 27e20f0..789b55a 100644
--- a/bundles/org.eclipse.rap.draw2d/about.properties
+++ b/bundles/org.eclipse.rap.draw2d/about.properties
@@ -14,7 +14,7 @@
# fill-ins are supplied by about.mappings
# This file should be translated.
-blurb=Eclipse Graphical Editing Framework Draw2d\n\
+blurb=Draw2d\n\
\n\
Version: {featureVersion}\n\
Build id: {0}\n\
diff --git a/bundles/org.eclipse.rap.draw2d/build.properties b/bundles/org.eclipse.rap.draw2d/build.properties
index 3a4ebf3..3cf685d 100644
--- a/bundles/org.eclipse.rap.draw2d/build.properties
+++ b/bundles/org.eclipse.rap.draw2d/build.properties
@@ -1,18 +1,19 @@
-###############################################################################
-# Copyright (c) 2002, 2009 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-bin.includes = about.*,\
- modeling32.png,\
- META-INF/,\
- .,\
- plugin.properties
-bin.excludes = **/doc-files/**
-source.. = src/
-src.includes = src/org/eclipse/draw2d/images/
\ No newline at end of file
+###############################################################################
+# Copyright (c) 2002, 2009 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+###############################################################################
+bin.includes = about.*,\
+ META-INF/,\
+ .,\
+ plugin.properties,\
+ gef_eclipse_logo_32.png
+source.. = src/
+src.includes = src/org/eclipse/draw2d/images/,\
+ about.html
+
diff --git a/bundles/org.eclipse.rap.draw2d/gef_eclipse_logo_32.png b/bundles/org.eclipse.rap.draw2d/gef_eclipse_logo_32.png
new file mode 100644
index 0000000..c3f107b
--- /dev/null
+++ b/bundles/org.eclipse.rap.draw2d/gef_eclipse_logo_32.png
Binary files differ
diff --git a/bundles/org.eclipse.rap.draw2d/modeling32.png b/bundles/org.eclipse.rap.draw2d/modeling32.png
deleted file mode 100644
index 6b08de2..0000000
--- a/bundles/org.eclipse.rap.draw2d/modeling32.png
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.rap.draw2d/plugin.properties b/bundles/org.eclipse.rap.draw2d/plugin.properties
index e4a1eab..244f505 100644
--- a/bundles/org.eclipse.rap.draw2d/plugin.properties
+++ b/bundles/org.eclipse.rap.draw2d/plugin.properties
@@ -8,5 +8,5 @@
# Contributors:
# IBM Corporation - initial API and implementation
###############################################################################
-Plugin.name=Graphical Editing Framework Draw2d
-Plugin.providerName = Eclipse.org
+Plugin.name=Draw2d
+Plugin.providerName=Eclipse GEF
diff --git a/bundles/org.eclipse.rap.draw2d/readme.txt b/bundles/org.eclipse.rap.draw2d/readme.txt
index ce93b3c..14adf68 100644
--- a/bundles/org.eclipse.rap.draw2d/readme.txt
+++ b/bundles/org.eclipse.rap.draw2d/readme.txt
@@ -1 +1 @@
-The source version of this port is: 3.10.0.qualifier
\ No newline at end of file
+The source version of this port is: 3.10.100.qualifier
\ No newline at end of file
diff --git a/bundles/org.eclipse.rap.draw2d/src/org/eclipse/draw2d/BufferedGraphicsSource.java b/bundles/org.eclipse.rap.draw2d/src/org/eclipse/draw2d/BufferedGraphicsSource.java
index 4d2c618..ea2944b 100644
--- a/bundles/org.eclipse.rap.draw2d/src/org/eclipse/draw2d/BufferedGraphicsSource.java
+++ b/bundles/org.eclipse.rap.draw2d/src/org/eclipse/draw2d/BufferedGraphicsSource.java
@@ -116,7 +116,7 @@
imageGC.setLineWidth(controlGC.getLineWidth());
//imageGC.setXORMode(controlGC.getXORMode());
graphics = new SWTGraphics(imageGC);
- //graphics.translate(inUse.getLocation().negate());
+ graphics.translate(inUse.getLocation().negate());
} else {
graphics = new SWTGraphics(controlGC);
}
diff --git a/bundles/org.eclipse.rap.draw2d/src/org/eclipse/draw2d/Figure.java b/bundles/org.eclipse.rap.draw2d/src/org/eclipse/draw2d/Figure.java
index 0d98aec..07e779a 100644
--- a/bundles/org.eclipse.rap.draw2d/src/org/eclipse/draw2d/Figure.java
+++ b/bundles/org.eclipse.rap.draw2d/src/org/eclipse/draw2d/Figure.java
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Mike Marchand - fix for bug #472848
*******************************************************************************/
package org.eclipse.draw2d;
@@ -454,7 +455,9 @@
if (fig.containsPoint(PRIVATE_POINT.x, PRIVATE_POINT.y)) {
fig = fig.findMouseEventTargetAt(PRIVATE_POINT.x,
PRIVATE_POINT.y);
- return fig;
+ if (fig != null) {
+ return fig;
+ }
}
}
}
diff --git a/bundles/org.eclipse.rap.draw2d/src/org/eclipse/draw2d/LightweightSystem.java b/bundles/org.eclipse.rap.draw2d/src/org/eclipse/draw2d/LightweightSystem.java
index 487719d..0228b2b 100644
--- a/bundles/org.eclipse.rap.draw2d/src/org/eclipse/draw2d/LightweightSystem.java
+++ b/bundles/org.eclipse.rap.draw2d/src/org/eclipse/draw2d/LightweightSystem.java
@@ -6,7 +6,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * IBM Corporation - initial API and implementation
+ * IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.draw2d;
diff --git a/bundles/org.eclipse.rap.draw2d/src/org/eclipse/draw2d/PrinterGraphics.java b/bundles/org.eclipse.rap.draw2d/src/org/eclipse/draw2d/PrinterGraphics.java
index 430d75a..3a4bad9 100644
--- a/bundles/org.eclipse.rap.draw2d/src/org/eclipse/draw2d/PrinterGraphics.java
+++ b/bundles/org.eclipse.rap.draw2d/src/org/eclipse/draw2d/PrinterGraphics.java
@@ -6,7 +6,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * IBM Corporation - initial API and implementation
+ * IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.draw2d;
diff --git a/bundles/org.eclipse.rap.draw2d/src/org/eclipse/draw2d/UpdateManager.java b/bundles/org.eclipse.rap.draw2d/src/org/eclipse/draw2d/UpdateManager.java
index 9056b6e..8674b12 100644
--- a/bundles/org.eclipse.rap.draw2d/src/org/eclipse/draw2d/UpdateManager.java
+++ b/bundles/org.eclipse.rap.draw2d/src/org/eclipse/draw2d/UpdateManager.java
@@ -157,7 +157,18 @@
*/
public abstract void performUpdate();
- void paint(GC gc) {
+ /**
+ * Invoked by the {@link LightweightSystem} (
+ * {@link LightweightSystem#paint(GC)}) to have the update manger paint its
+ * contents. Delegates to {@link #performUpdate(Rectangle)} with the passed
+ * in gc's clipping region ({@link GC#getClipping()}) by default. Subclasses
+ * may override if they need to access the {@link GC} for updating.
+ *
+ * @param gc
+ * The {@link GC} to be used for updating
+ * @since 3.10
+ */
+ protected void paint(GC gc) {
performUpdate(new Rectangle(gc.getClipping()));
}
diff --git a/bundles/org.eclipse.rap.draw2d/src/org/eclipse/draw2d/geometry/PrecisionGeometry.java b/bundles/org.eclipse.rap.draw2d/src/org/eclipse/draw2d/geometry/PrecisionGeometry.java
index 6ed4c9b..5247734 100644
--- a/bundles/org.eclipse.rap.draw2d/src/org/eclipse/draw2d/geometry/PrecisionGeometry.java
+++ b/bundles/org.eclipse.rap.draw2d/src/org/eclipse/draw2d/geometry/PrecisionGeometry.java
@@ -1,12 +1,12 @@
/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
+ * Copyright (c) 2010 itemis AG and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * IBM Corporation - initial API and implementation
+ * Alexander Nyßen (itemis AG) - initial API and implementation
*******************************************************************************/
package org.eclipse.draw2d.geometry;
diff --git a/bundles/org.eclipse.rap.draw2d/src/org/eclipse/draw2d/geometry/Straight.java b/bundles/org.eclipse.rap.draw2d/src/org/eclipse/draw2d/geometry/Straight.java
index ba05a21..7c150a0 100644
--- a/bundles/org.eclipse.rap.draw2d/src/org/eclipse/draw2d/geometry/Straight.java
+++ b/bundles/org.eclipse.rap.draw2d/src/org/eclipse/draw2d/geometry/Straight.java
@@ -1,13 +1,12 @@
/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
+ * Copyright (c) 2010 Research Group Software Construction, RWTH Aachen University and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Research Group Software Construction,
- * RWTH Aachen University, Germany - initial API and implementation
+ * Alexander Nyßen (Research Group Software Contruction, RWTH Aachen University) - initial API and implementation
*
*******************************************************************************/
package org.eclipse.draw2d.geometry;
diff --git a/bundles/org.eclipse.rap.draw2d/src/org/eclipse/draw2d/geometry/Vector.java b/bundles/org.eclipse.rap.draw2d/src/org/eclipse/draw2d/geometry/Vector.java
index 6b44f8c..874a6d0 100644
--- a/bundles/org.eclipse.rap.draw2d/src/org/eclipse/draw2d/geometry/Vector.java
+++ b/bundles/org.eclipse.rap.draw2d/src/org/eclipse/draw2d/geometry/Vector.java
@@ -7,8 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
- * Research Group Software Construction,
- * RWTH Aachen University, Germany - Contribution for Bugzilla 245182
+ * Alexander Nyßen (Research Group Software Construction, RWTH Aachen University) - Contribution for Bugzilla 245182
*
*******************************************************************************/
package org.eclipse.draw2d.geometry;
diff --git a/bundles/org.eclipse.rap.draw2d/src/org/eclipse/draw2d/parts/Thumbnail.java b/bundles/org.eclipse.rap.draw2d/src/org/eclipse/draw2d/parts/Thumbnail.java
index 8246378..efd575f 100644
--- a/bundles/org.eclipse.rap.draw2d/src/org/eclipse/draw2d/parts/Thumbnail.java
+++ b/bundles/org.eclipse.rap.draw2d/src/org/eclipse/draw2d/parts/Thumbnail.java
@@ -33,6 +33,7 @@
* Figure.
*
* @author Eric Bordeau
+ * @author Alexander Nyßen (anyssen)
*/
public class Thumbnail extends Figure implements UpdateListener {
@@ -41,10 +42,13 @@
* several tiles and updating each tile individually.
*/
class ThumbnailUpdater implements Runnable {
- static final int MAX_BUFFER_SIZE = 256;
+ private static final int MIN_TILE_SIZE = 256;
+ private static final int MAX_NUMBER_OF_TILES = 16;
private int currentHTile, currentVTile;
private int hTiles, vTiles;
private Dimension tileSize;
+ private Dimension sourceSize; // the source size that was used for the
+ // tileSize computation
private boolean isActive = true;
private boolean isRunning = false;
@@ -114,17 +118,27 @@
* tile size and current tile index.
*/
public void resetTileValues() {
- hTiles = (int) Math.ceil((float) getSourceRectangle().width
- / (float) MAX_BUFFER_SIZE);
- vTiles = (int) Math.ceil((float) getSourceRectangle().height
- / (float) MAX_BUFFER_SIZE);
+ // Keep track of source size that matches the computed tile size.
+ sourceSize = getSourceRectangle().getSize();
- tileSize = new Dimension(
- (int) Math.ceil((float) getSourceRectangle().width
- / (float) hTiles),
- (int) Math.ceil((float) getSourceRectangle().height
- / (float) vTiles));
+ // Compute number of horizontal and vertical tiles and the size of
+ // each tile (while the last tile in horizontal and vertical
+ // direction may be smaller); ensure that all tiles except those on
+ // the bottom and right border will have at least a size of
+ // MIN_TILE_SIZE size and that at most MAX_NUMBER_OF_TILES tiles
+ // will be created.
+ hTiles = Math.min(
+ (int) Math.ceil((float) sourceSize.width
+ / (float) MIN_TILE_SIZE), MAX_NUMBER_OF_TILES);
+ vTiles = Math.min(
+ (int) Math.ceil((float) sourceSize.height
+ / (float) MIN_TILE_SIZE), MAX_NUMBER_OF_TILES);
+ tileSize = new Dimension((int) Math.ceil((float) sourceSize.width
+ / (float) hTiles),
+ (int) Math.ceil((float) sourceSize.height / (float) vTiles));
+ // Reset the current indices so that the next update will start with
+ // the first tile in horizontal and vertical direction
currentHTile = 0;
currentVTile = 0;
}
@@ -151,36 +165,36 @@
public void run() {
if (!isActive() || !isRunning() || tileGraphics == null)
return;
+
int v = getCurrentVTile();
int sy1 = v * tileSize.height;
- int sy2 = Math.min((v + 1) * tileSize.height,
- getSourceRectangle().height);
+ int sy2 = Math.min((v + 1) * tileSize.height, sourceSize.height);
int h = getCurrentHTile();
int sx1 = h * tileSize.width;
- int sx2 = Math.min((h + 1) * tileSize.width,
- getSourceRectangle().width);
+ int sx2 = Math.min((h + 1) * tileSize.width, sourceSize.width);
tileGraphics.pushState();
// clear the background (by filling with the background color)
Rectangle rect = new Rectangle(0, 0, sx2 - sx1, sy2 - sy1);
tileGraphics.fillRectangle(rect);
- // let the source figure paint into the tile image
+ // Let the source figure paint into the tile image.
// IMPORTANT (fix for bug #309912): we do not let the source figure
// paint directly into the thumbnail image, because we cannot ensure
// that it paints completely inside the current tile area (it may
// set its own clip inside paint(Graphics) and overwrite areas of
- // tile that have already been rendered. By providing an own tile
+ // tiles that have already been rendered. By providing an own tile
// image and copying from it into the thumbnail image, we are safe.
org.eclipse.draw2d.geometry.Point p = getSourceRectangle()
.getLocation();
- tileGraphics.translate(-p.x - sx1, -p.y - sy1);
+ tileGraphics.translate(-p.x * getScaleX() - sx1, -p.y * getScaleY()
+ - sy1);
tileGraphics.scale(getScaleX());
sourceFigure.paint(tileGraphics);
tileGraphics.popState();
- // copy the painted tile image into the thumbnail image
+ // Copy the painted tile image into the thumbnail image.
thumbnailGC.drawImage(tileImage, 0, 0, sx2 - sx1, sy2 - sy1, sx1,
sy1, sx2 - sx1, sy2 - sy1);
@@ -194,9 +208,9 @@
setCurrentVTile(0);
}
- if (getCurrentHTile() != 0 || getCurrentVTile() != 0)
+ if (getCurrentHTile() != 0 || getCurrentVTile() != 0) {
Display.getCurrent().asyncExec(this);
- else if (isDirty()) {
+ } else if (isDirty()) {
setDirty(false);
Display.getCurrent().asyncExec(this);
repaint();
@@ -280,8 +294,8 @@
tileGraphics.setBackgroundColor(color);
tileGraphics.setFont(sourceFigure.getFont());
- setScales(targetSize.width / (float) getSourceRectangle().width,
- targetSize.height / (float) getSourceRectangle().height);
+ setScales(targetSize.width / (float) sourceSize.width,
+ targetSize.height / (float) sourceSize.height);
Display.getCurrent().asyncExec(this);
}
diff --git a/bundles/org.eclipse.rap.draw2d/src/org/eclipse/draw2d/text/BidiProcessor.java b/bundles/org.eclipse.rap.draw2d/src/org/eclipse/draw2d/text/BidiProcessor.java
index 280995d..9b32df3 100644
--- a/bundles/org.eclipse.rap.draw2d/src/org/eclipse/draw2d/text/BidiProcessor.java
+++ b/bundles/org.eclipse.rap.draw2d/src/org/eclipse/draw2d/text/BidiProcessor.java
@@ -6,7 +6,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * IBM Corporation - initial API and implementation
+ * IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.draw2d.text;
diff --git a/bundles/org.eclipse.rap.gef/.checkstyle b/bundles/org.eclipse.rap.gef/.checkstyle
deleted file mode 100644
index 19f5dab..0000000
--- a/bundles/org.eclipse.rap.gef/.checkstyle
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<fileset-config file-format-version="1.1.0" simple-config="false">
-<fileset name="API Source files" check-config-name="API Checkstyle" enabled="true"><file-match-pattern match-pattern=".java$" include-pattern="true"/>
-<file-match-pattern match-pattern="org.eclipse.*.internal.*.java$" include-pattern="false"/>
-</fileset>
-<fileset name="All source" check-config-name="Checkstyle Generic" enabled="true"><file-match-pattern match-pattern=".java$" include-pattern="true"/>
-</fileset>
-</fileset-config>
\ No newline at end of file
diff --git a/bundles/org.eclipse.rap.gef/.settings/checkstyleAPI.xml b/bundles/org.eclipse.rap.gef/.settings/checkstyleAPI.xml
deleted file mode 100644
index 55c5999..0000000
--- a/bundles/org.eclipse.rap.gef/.settings/checkstyleAPI.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.2//EN" "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
-
-<module name="Checker">
-<property name="severity" value="warning"/>
-<module name="TreeWalker">
-<module name="FileContentsHolder">
-</module>
-<module name="JavadocMethod">
-<property name="scope" value="protected"/>
-<property name="allowUndeclaredRTE" value="true"/>
-<property name="tokens" value="METHOD_DEF, CTOR_DEF"/>
-</module>
-<module name="JavadocType">
-<property name="scope" value="protected"/>
-<property name="tokens" value="CLASS_DEF, INTERFACE_DEF"/>
-</module>
-<module name="JavadocVariable">
-<property name="scope" value="protected"/>
-</module>
-</module>
-</module>
diff --git a/bundles/org.eclipse.rap.gef/.settings/checkstyleGeneric.xml b/bundles/org.eclipse.rap.gef/.settings/checkstyleGeneric.xml
deleted file mode 100644
index 511ef9c..0000000
--- a/bundles/org.eclipse.rap.gef/.settings/checkstyleGeneric.xml
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.rap.gef/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.rap.gef/.settings/org.eclipse.jdt.core.prefs
index a77f351..4e0f29e 100644
--- a/bundles/org.eclipse.rap.gef/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.rap.gef/.settings/org.eclipse.jdt.core.prefs
@@ -1,4 +1,4 @@
-#Tue Nov 16 19:49:32 CET 2010
+#Wed Nov 23 00:18:18 CET 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.codeComplete.argumentPrefixes=
org.eclipse.jdt.core.codeComplete.argumentSuffixes=
@@ -151,9 +151,12 @@
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
diff --git a/bundles/org.eclipse.rap.gef/.settings/org.eclipse.pde.api.tools.prefs b/bundles/org.eclipse.rap.gef/.settings/org.eclipse.pde.api.tools.prefs
index 718eb37..fdc2159 100644
--- a/bundles/org.eclipse.rap.gef/.settings/org.eclipse.pde.api.tools.prefs
+++ b/bundles/org.eclipse.rap.gef/.settings/org.eclipse.pde.api.tools.prefs
@@ -1,5 +1,93 @@
-#Thu Jan 26 12:03:13 CST 2012
+#Wed Dec 10 16:00:46 EST 2008
+ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error
+ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error
+CLASS_ELEMENT_TYPE_ADDED_METHOD=Error
+CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
+CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
CLASS_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error
+CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error
+CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error
+CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error
+CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error
+CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
+CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error
+ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error
+ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error
+ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+FIELD_ELEMENT_TYPE_ADDED_VALUE=Error
+FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error
+FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
+FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
+FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error
+FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error
+FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error
+FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error
+ILLEGAL_EXTEND=Error
+ILLEGAL_IMPLEMENT=Error
+ILLEGAL_INSTANTIATE=Error
+ILLEGAL_OVERRIDE=Error
+ILLEGAL_REFERENCE=Error
+INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Error
+INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error
+INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error
+INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
INTERFACE_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error
+INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+INVALID_JAVADOC_TAG=Error
+INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Error
+LEAK_EXTEND=Error
+LEAK_FIELD_DECL=Error
+LEAK_IMPLEMENT=Error
+LEAK_METHOD_PARAM=Error
+LEAK_METHOD_RETURN_TYPE=Error
+METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
METHOD_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error
+METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
+METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
+METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error
+METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error
eclipse.preferences.version=1
+incompatible_api_component_version=Error
+incompatible_api_component_version_include_major_without_breaking_change=Disabled
+incompatible_api_component_version_include_minor_without_api_change=Disabled
+invalid_since_tag_version=Error
+malformed_since_tag=Error
+missing_since_tag=Error
+report_api_breakage_when_major_version_incremented=Disabled
+report_resolution_errors_api_component=Error
diff --git a/bundles/org.eclipse.rap.gef/about.ini b/bundles/org.eclipse.rap.gef/about.ini
index f4b4beb..b2b0561 100644
--- a/bundles/org.eclipse.rap.gef/about.ini
+++ b/bundles/org.eclipse.rap.gef/about.ini
@@ -1,11 +1,11 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=modeling32.png
+# about.ini
+# contains information about a feature
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# "%key" are externalized strings defined in about.properties
+# This file does not need to be translated.
+
+# Property "aboutText" contains blurb for "About" dialog (translated)
+aboutText=%blurb
+
+# Property "featureImage" contains path to feature image (32x32)
+featureImage=gef_eclipse_logo_32.png
diff --git a/bundles/org.eclipse.rap.gef/about.properties b/bundles/org.eclipse.rap.gef/about.properties
index 627d484..2f6a86a 100644
--- a/bundles/org.eclipse.rap.gef/about.properties
+++ b/bundles/org.eclipse.rap.gef/about.properties
@@ -14,7 +14,7 @@
# fill-ins are supplied by about.mappings
# This file should be translated.
-blurb=Eclipse Graphical Editing Framework GEF\n\
+blurb=GEF (MVC)\n\
\n\
Version: {featureVersion}\n\
Build id: {0}\n\
diff --git a/bundles/org.eclipse.rap.gef/build.properties b/bundles/org.eclipse.rap.gef/build.properties
index fd53748..edcaf88 100644
--- a/bundles/org.eclipse.rap.gef/build.properties
+++ b/bundles/org.eclipse.rap.gef/build.properties
@@ -1,22 +1,22 @@
-###############################################################################
-# Copyright (c) 2002, 2009 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-bin.includes = about.*,\
- modeling32.png,\
- plugin.xml,\
- plugin.properties,\
- icons/*.gif,\
- .,\
- META-INF/
-bin.excludes = **/doc-files/**
-source.. = src/
-src.includes = src/org/eclipse/gef/internal/icons/,\
- src/org/eclipse/gef/ui/console/icons/,\
- src/org/eclipse/gef/ui/stackview/icons/
+###############################################################################
+# Copyright (c) 2002, 2009 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+###############################################################################
+bin.includes = about.*,\
+ gef_eclipse_logo_32.png,\
+ plugin.xml,\
+ plugin.properties,\
+ icons/*.gif,\
+ .,\
+ META-INF/
+source.. = src/
+src.includes = src/org/eclipse/gef/internal/icons/,\
+ src/org/eclipse/gef/ui/console/icons/,\
+ src/org/eclipse/gef/ui/stackview/icons/,\
+ about.html
diff --git a/bundles/org.eclipse.rap.gef/gef_eclipse_logo_32.png b/bundles/org.eclipse.rap.gef/gef_eclipse_logo_32.png
new file mode 100644
index 0000000..c3f107b
--- /dev/null
+++ b/bundles/org.eclipse.rap.gef/gef_eclipse_logo_32.png
Binary files differ
diff --git a/bundles/org.eclipse.rap.gef/modeling32.png b/bundles/org.eclipse.rap.gef/modeling32.png
deleted file mode 100644
index 6b08de2..0000000
--- a/bundles/org.eclipse.rap.gef/modeling32.png
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.rap.gef/plugin.properties b/bundles/org.eclipse.rap.gef/plugin.properties
index fd6d0ec..d27efd7 100644
--- a/bundles/org.eclipse.rap.gef/plugin.properties
+++ b/bundles/org.eclipse.rap.gef/plugin.properties
@@ -8,8 +8,8 @@
# Contributors:
# IBM Corporation - initial API and implementation
###############################################################################
-Plugin.name= Graphical Editing Framework GEF
-Plugin.providerName= Eclipse.org
+Plugin.name= GEF (MVC)
+Plugin.providerName=Eclipse GEF
##############################################
# Zoom Actions
diff --git a/bundles/org.eclipse.rap.gef/readme.txt b/bundles/org.eclipse.rap.gef/readme.txt
index ce93b3c..4758734 100644
--- a/bundles/org.eclipse.rap.gef/readme.txt
+++ b/bundles/org.eclipse.rap.gef/readme.txt
@@ -1 +1 @@
-The source version of this port is: 3.10.0.qualifier
\ No newline at end of file
+The source version of this port is: 3.11.0.qualifier
\ No newline at end of file
diff --git a/bundles/org.eclipse.rap.gef/src/org/eclipse/gef/commands/CommandStack.java b/bundles/org.eclipse.rap.gef/src/org/eclipse/gef/commands/CommandStack.java
index a9efcce..33011a7 100644
--- a/bundles/org.eclipse.rap.gef/src/org/eclipse/gef/commands/CommandStack.java
+++ b/bundles/org.eclipse.rap.gef/src/org/eclipse/gef/commands/CommandStack.java
@@ -19,7 +19,7 @@
* An implementation of a command stack. A stack manages the executing, undoing,
* and redoing of {@link Command Commands}. Executed commands are pushed onto a
* a stack for undoing later. Commands which are undone are pushed onto a redo
- * stack. Whenever a new command is executed, the Redo stack is flushed.
+ * stack. Whenever a new command is executed, the redo stack is flushed.
* <P>
* A CommandStack contains a dirty property. This property can be used to
* determine when persisting changes is required. The stack is dirty whenever
@@ -32,26 +32,37 @@
public class CommandStack {
/**
- * Constant indicating notification after a command has been executed (value
- * is 8).
+ * Constant indicating notification after a command has been executed.
*/
public static final int POST_EXECUTE = 8;
/**
- * Constant indicating notification after a command has been redone (value
- * is 16).
+ * Constant indicating notification after a command has been redone.
*/
public static final int POST_REDO = 16;
/**
- * Constant indicating notification after a command has been undone (value
- * is 32).
+ * Constant indicating notification after a command has been undone.
*/
public static final int POST_UNDO = 32;
/**
- * A bit-mask indicating notification after a command has done something.
- * Currently this includes after a command has been undone, redone, or
- * executed. This will include new events should they be introduced in the
- * future.
+ * Constant indicating notification after flushing the stack.
+ *
+ * @since 3.11
+ */
+ public static final int POST_FLUSH = 256;
+
+ /**
+ * Constant indicating notification after marking the save location of the
+ * stack.
+ *
+ * @since 3.11
+ */
+ public static final int POST_MARK_SAVE = 512;
+
+ /**
+ * A bit-mask indicating notification after the command stack has changed.
+ * This includes after a command has been undone, redone, or executed, as
+ * well as after it has been flushed or the save location has been marked.
* <P>
* Usage<BR/>
*
@@ -63,29 +74,42 @@
* </PRE>
*/
public static final int POST_MASK = new Integer(POST_EXECUTE | POST_UNDO
- | POST_REDO).intValue();
+ | POST_REDO | POST_FLUSH | POST_MARK_SAVE).intValue();
/**
- * Constant indicating notification prior to executing a command (value is
- * 1).
+ * Constant indicating notification prior to executing a command.
*/
public static final int PRE_EXECUTE = 1;
/**
- * Constant indicating notification prior to redoing a command (value is 2).
+ * Constant indicating notification prior to redoing a command.
*/
public static final int PRE_REDO = 2;
/**
- * Constant indicating notification prior to undoing a command (value is 4).
+ * Constant indicating notification prior to undoing a command.
*/
public static final int PRE_UNDO = 4;
/**
- * A bit-mask indicating notification before a command makes a change.
- * Currently this includes before a command has been undone, redone, or
- * executed. This will include new events should they be introduced in the
- * future.
+ * Constant indicating notification prior to flushing the stack.
+ *
+ * @since 3.11
+ */
+ public static final int PRE_FLUSH = 64;
+
+ /**
+ * Constant indicating notification prior to marking the save location of
+ * the stack.
+ *
+ * @since 3.11
+ */
+ public static final int PRE_MARK_SAVE = 128;
+
+ /**
+ * A bit-mask indicating notification before the command stack is changed.
+ * This includes before a command has been undone, redone, or executed, and
+ * before the stack is being flushed or the save location is marked.
* <P>
* Usage<BR/>
*
@@ -99,7 +123,7 @@
* @since 3.7 Had package visibility before.
*/
public static final int PRE_MASK = new Integer(PRE_EXECUTE | PRE_UNDO
- | PRE_REDO).intValue();
+ | PRE_REDO | PRE_FLUSH | PRE_MARK_SAVE).intValue();
private List eventListeners = new ArrayList();
@@ -144,6 +168,9 @@
*
* @param listener
* the listener
+ * @deprecated Use
+ * {@link #addCommandStackEventListener(CommandStackEventListener)}
+ * instead.
*/
public void addCommandStackListener(CommandStackListener listener) {
listeners.add(listener);
@@ -221,10 +248,12 @@
* method might be called when performing "revert to saved".
*/
public void flush() {
+ notifyListeners(null, PRE_FLUSH);
flushRedo();
flushUndo();
saveLocation = 0;
notifyListeners();
+ notifyListeners(null, POST_FLUSH);
}
private void flushRedo() {
@@ -298,14 +327,16 @@
* this checkpoint.
*/
public void markSaveLocation() {
+ notifyListeners(null, PRE_MARK_SAVE);
saveLocation = undoable.size();
notifyListeners();
+ notifyListeners(null, POST_MARK_SAVE);
}
/**
* Sends notification to all {@link CommandStackListener}s.
*
- * @deprecated
+ * @deprecated Use {@link #notifyListeners(Command, int)} instead.
*/
protected void notifyListeners() {
EventObject event = new EventObject(this);
@@ -367,6 +398,7 @@
*
* @param listener
* the listener
+ * @deprecated Use {@link CommandStackEventListener} instead.
*/
public void removeCommandStackListener(CommandStackListener listener) {
listeners.remove(listener);
diff --git a/bundles/org.eclipse.rap.gef/src/org/eclipse/gef/commands/CommandStackListener.java b/bundles/org.eclipse.rap.gef/src/org/eclipse/gef/commands/CommandStackListener.java
index 7378798..2b6bc48 100644
--- a/bundles/org.eclipse.rap.gef/src/org/eclipse/gef/commands/CommandStackListener.java
+++ b/bundles/org.eclipse.rap.gef/src/org/eclipse/gef/commands/CommandStackListener.java
@@ -15,6 +15,9 @@
/**
* A CommandStackListener is notified whenever the {@link CommandStack}'s state
* has changed.
+ *
+ * @deprecated Use {@link CommandStackEventListener} instead and filter for
+ * post-events using {@link CommandStack#POST_MASK}.
*/
public interface CommandStackListener {
diff --git a/bundles/org.eclipse.rap.gef/src/org/eclipse/gef/editparts/ScalableRootEditPart.java b/bundles/org.eclipse.rap.gef/src/org/eclipse/gef/editparts/ScalableRootEditPart.java
index e4a25f6..ba12ad4 100644
--- a/bundles/org.eclipse.rap.gef/src/org/eclipse/gef/editparts/ScalableRootEditPart.java
+++ b/bundles/org.eclipse.rap.gef/src/org/eclipse/gef/editparts/ScalableRootEditPart.java
@@ -17,6 +17,7 @@
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.Layer;
import org.eclipse.draw2d.LayeredPane;
+import org.eclipse.draw2d.ScalableFigure;
import org.eclipse.draw2d.ScalableLayeredPane;
import org.eclipse.draw2d.StackLayout;
import org.eclipse.draw2d.Viewport;
@@ -98,8 +99,8 @@
* @author Eric Bordeau
* @since 2.1.1
*/
-public class ScalableRootEditPart extends SimpleRootEditPart implements
- LayerConstants, LayerManager {
+public class ScalableRootEditPart extends SimpleRootEditPart
+ implements LayerConstants, LayerManager {
class FeedbackLayer extends Layer {
FeedbackLayer() {
@@ -137,11 +138,24 @@
* Constructor for ScalableFreeformRootEditPart
*/
public ScalableRootEditPart() {
- zoomManager = new ZoomManager((ScalableLayeredPane) getScaledLayers(),
+ zoomManager = createZoomManager((ScalableLayeredPane) getScaledLayers(),
((Viewport) getFigure()));
}
/**
+ * Responsible of creating a {@link ZoomManager} to be used by this
+ * {@link ScalableRootEditPart}.
+ *
+ * @return A new {@link ZoomManager} bound to the given
+ * {@link ScalableFigure} and {@link Viewport}.
+ * @since 3.10
+ */
+ protected ZoomManager createZoomManager(ScalableFigure scalableFigure,
+ Viewport viewport) {
+ return new ZoomManager(scalableFigure, viewport);
+ }
+
+ /**
* @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
*/
protected IFigure createFigure() {
@@ -330,14 +344,14 @@
protected void refreshGridLayer() {
boolean visible = false;
GridLayer grid = (GridLayer) getLayer(GRID_LAYER);
- Boolean val = (Boolean) getViewer().getProperty(
- SnapToGrid.PROPERTY_GRID_VISIBLE);
+ Boolean val = (Boolean) getViewer()
+ .getProperty(SnapToGrid.PROPERTY_GRID_VISIBLE);
if (val != null)
visible = val.booleanValue();
- grid.setOrigin((Point) getViewer().getProperty(
- SnapToGrid.PROPERTY_GRID_ORIGIN));
- grid.setSpacing((Dimension) getViewer().getProperty(
- SnapToGrid.PROPERTY_GRID_SPACING));
+ grid.setOrigin((Point) getViewer()
+ .getProperty(SnapToGrid.PROPERTY_GRID_ORIGIN));
+ grid.setSpacing((Dimension) getViewer()
+ .getProperty(SnapToGrid.PROPERTY_GRID_SPACING));
grid.setVisible(visible);
}
diff --git a/bundles/org.eclipse.rap.gef/src/org/eclipse/gef/internal/PropertySourceAdapterFactory.java b/bundles/org.eclipse.rap.gef/src/org/eclipse/gef/internal/PropertySourceAdapterFactory.java
index 8d2b870..0b921fc 100644
--- a/bundles/org.eclipse.rap.gef/src/org/eclipse/gef/internal/PropertySourceAdapterFactory.java
+++ b/bundles/org.eclipse.rap.gef/src/org/eclipse/gef/internal/PropertySourceAdapterFactory.java
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Requel Wermelinger (reguel.wermelinger@ivyteam.ch) - Fix for bug #462235
*******************************************************************************/
package org.eclipse.gef.internal;
@@ -23,6 +24,10 @@
public Object getAdapter(Object adaptableObject, Class adapterType) {
AbstractEditPart part = (AbstractEditPart) adaptableObject;
Object model = part.getModel();
+ // model can be null
+ if (model == null) {
+ return null;
+ }
// check if model is already of the desired adapter type
if (adapterType.isInstance(model)) {
return model;
diff --git a/bundles/org.eclipse.rap.gef/src/org/eclipse/gef/tools/DragEditPartsTracker.java b/bundles/org.eclipse.rap.gef/src/org/eclipse/gef/tools/DragEditPartsTracker.java
index 63066d9..001dc79 100644
--- a/bundles/org.eclipse.rap.gef/src/org/eclipse/gef/tools/DragEditPartsTracker.java
+++ b/bundles/org.eclipse.rap.gef/src/org/eclipse/gef/tools/DragEditPartsTracker.java
@@ -124,6 +124,48 @@
}
/**
+ * Returns the bounds of the {@link #getSourceEditPart() source edit part's}
+ * figure in absolute coordinates. In case the source figure implements
+ * {@link HandleBounds} the {@link HandleBounds#getHandleBounds() handle
+ * bounds} are returned in absolute coordinates, other wise the
+ * {@link IFigure#getBounds() figure bounds}.
+ *
+ * @return The bounds of the source figure in absolute coordinates.
+ *
+ * @since 3.11
+ */
+ protected PrecisionRectangle getSourceBounds() {
+ return this.sourceRectangle;
+ }
+
+ /**
+ * Returns the unioned bounds of the {@link #getOperationSet() operation set
+ * edit parts'} figures in absolute coordinates. In case the figures
+ * implement {@link HandleBounds} their
+ * {@link HandleBounds#getHandleBounds() handle bounds} will be used,
+ * otherwise their {@link IFigure#getBounds() figure bounds}.
+ *
+ * @return The unioned bounds of the operation set figures in absolute
+ * coordinates.
+ * @since 3.11
+ */
+ protected PrecisionRectangle getOperationSetBounds() {
+ return this.compoundSrcRect;
+ }
+
+ /**
+ * Returns the {@link SnapToHelper} used by this
+ * {@link DragEditPartsTracker}.
+ *
+ * @return The {@link SnapToHelper} used by this
+ * {@link DragEditPartsTracker}.
+ * @since 3.11
+ */
+ protected SnapToHelper getSnapToHelper() {
+ return snapToHelper;
+ }
+
+ /**
* Erases feedback and calls {@link #performDrag()}. Sets the state to
* terminal.
*
diff --git a/bundles/org.eclipse.rap.gef/src/org/eclipse/gef/ui/actions/ActionBarContributor.java b/bundles/org.eclipse.rap.gef/src/org/eclipse/gef/ui/actions/ActionBarContributor.java
index 26aa5fb..990671d 100644
--- a/bundles/org.eclipse.rap.gef/src/org/eclipse/gef/ui/actions/ActionBarContributor.java
+++ b/bundles/org.eclipse.rap.gef/src/org/eclipse/gef/ui/actions/ActionBarContributor.java
@@ -153,7 +153,8 @@
IActionBars bars = getActionBars();
for (int i = 0; i < globalActionKeys.size(); i++) {
String id = (String) globalActionKeys.get(i);
- bars.setGlobalActionHandler(id, registry.getAction(id));
+ IAction handler = registry != null ? registry.getAction(id) : null;
+ bars.setGlobalActionHandler(id, handler);
}
}
diff --git a/bundles/org.eclipse.rap.gef/src/org/eclipse/gef/ui/properties/UndoablePropertySheetEntry.java b/bundles/org.eclipse.rap.gef/src/org/eclipse/gef/ui/properties/UndoablePropertySheetEntry.java
index 0fd98e2..013861e 100644
--- a/bundles/org.eclipse.rap.gef/src/org/eclipse/gef/ui/properties/UndoablePropertySheetEntry.java
+++ b/bundles/org.eclipse.rap.gef/src/org/eclipse/gef/ui/properties/UndoablePropertySheetEntry.java
@@ -10,13 +10,11 @@
*******************************************************************************/
package org.eclipse.gef.ui.properties;
-import java.util.EventObject;
-
import org.eclipse.ui.views.properties.IPropertySource;
import org.eclipse.ui.views.properties.PropertySheetEntry;
import org.eclipse.gef.commands.CommandStack;
-import org.eclipse.gef.commands.CommandStackListener;
+import org.eclipse.gef.commands.CommandStackEventListener;
import org.eclipse.gef.commands.CompoundCommand;
import org.eclipse.gef.commands.ForwardUndoCompoundCommand;
@@ -35,7 +33,7 @@
*/
public class UndoablePropertySheetEntry extends PropertySheetEntry {
- private CommandStackListener commandStackListener;
+ private CommandStackEventListener commandStackListener;
private CommandStack commandStack;
@@ -57,12 +55,15 @@
*/
public UndoablePropertySheetEntry(CommandStack commandStack) {
this.commandStack = commandStack;
- this.commandStackListener = new CommandStackListener() {
- public void commandStackChanged(EventObject e) {
- refreshFromRoot();
+ this.commandStackListener = new CommandStackEventListener() {
+ public void stackChanged(
+ org.eclipse.gef.commands.CommandStackEvent event) {
+ if ((event.getDetail() & CommandStack.POST_MASK) != 0) {
+ refreshFromRoot();
+ }
}
};
- this.commandStack.addCommandStackListener(commandStackListener);
+ this.commandStack.addCommandStackEventListener(commandStackListener);
}
/**
@@ -77,7 +78,7 @@
*/
public void dispose() {
if (commandStack != null)
- commandStack.removeCommandStackListener(commandStackListener);
+ commandStack.removeCommandStackEventListener(commandStackListener);
super.dispose();
}
diff --git a/bundles/org.eclipse.rap.zest.core/.classpath b/bundles/org.eclipse.rap.zest.core/.classpath
index 6425d71..2fbb7a2 100644
--- a/bundles/org.eclipse.rap.zest.core/.classpath
+++ b/bundles/org.eclipse.rap.zest.core/.classpath
@@ -1,11 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4">
- <accessrules>
- <accessrule kind="discouraged" pattern="**/System/**"/>
- </accessrules>
- </classpathentry>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/bundles/org.eclipse.rap.zest.core/.refactorings/2015/12/52/refactorings.history b/bundles/org.eclipse.rap.zest.core/.refactorings/2015/12/52/refactorings.history
new file mode 100644
index 0000000..33225d0
--- /dev/null
+++ b/bundles/org.eclipse.rap.zest.core/.refactorings/2015/12/52/refactorings.history
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<session version="1.0">
+<refactoring accessors="true" comment="Delete element from project 'org.eclipse.rap.zest.core'
- Original project: 'org.eclipse.rap.zest.core'
- Original element: 'modeling32.png'" description="Delete element" element1="modeling32.png" elements="0" flags="589830" id="org.eclipse.jdt.ui.delete" resources="1" stamp="1450980656174" subPackages="false" version="1.0"/>
+</session>
\ No newline at end of file
diff --git a/bundles/org.eclipse.rap.zest.core/.refactorings/2015/12/52/refactorings.index b/bundles/org.eclipse.rap.zest.core/.refactorings/2015/12/52/refactorings.index
new file mode 100644
index 0000000..6696b3d
--- /dev/null
+++ b/bundles/org.eclipse.rap.zest.core/.refactorings/2015/12/52/refactorings.index
@@ -0,0 +1 @@
+1450980656174 Delete element
diff --git a/bundles/org.eclipse.rap.zest.core/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.rap.zest.core/.settings/org.eclipse.jdt.core.prefs
index 1200bb9..3f35116 100644
--- a/bundles/org.eclipse.rap.zest.core/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.rap.zest.core/.settings/org.eclipse.jdt.core.prefs
@@ -1,4 +1,4 @@
-#Thu Dec 09 15:46:05 PST 2010
+#Sun Nov 27 13:31:26 CET 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
@@ -135,12 +135,11 @@
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
org.eclipse.jdt.core.formatter.indentation.size=4
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
diff --git a/bundles/org.eclipse.rap.zest.core/.settings/org.eclipse.pde.api.tools.prefs b/bundles/org.eclipse.rap.zest.core/.settings/org.eclipse.pde.api.tools.prefs
index 4a5aff4..da65176 100644
--- a/bundles/org.eclipse.rap.zest.core/.settings/org.eclipse.pde.api.tools.prefs
+++ b/bundles/org.eclipse.rap.zest.core/.settings/org.eclipse.pde.api.tools.prefs
@@ -1,5 +1,86 @@
-#Thu Jan 26 12:03:58 CST 2012
+#Wed Oct 15 15:09:10 EDT 2008
+ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error
+ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error
+CLASS_ELEMENT_TYPE_ADDED_METHOD=Error
+CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
+CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
CLASS_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error
+CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error
+CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error
+CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error
+CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error
+CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
+CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error
+ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error
+ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error
+ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+FIELD_ELEMENT_TYPE_ADDED_VALUE=Error
+FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error
+FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
+FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
+FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error
+FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error
+FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error
+FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error
+ILLEGAL_EXTEND=Error
+ILLEGAL_IMPLEMENT=Error
+ILLEGAL_INSTANTIATE=Error
+ILLEGAL_OVERRIDE=Error
+ILLEGAL_REFERENCE=Error
+INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Error
+INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error
+INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
INTERFACE_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error
+INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+INVALID_JAVADOC_TAG=Error
+LEAK_EXTEND=Error
+LEAK_FIELD_DECL=Error
+LEAK_IMPLEMENT=Error
+LEAK_METHOD_PARAM=Error
+LEAK_METHOD_RETURN_TYPE=Error
+METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
METHOD_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error
+METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
+METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
+METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error
+METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error
eclipse.preferences.version=1
+incompatible_api_component_version=Error
+incompatible_api_component_version_include_major_without_breaking_change=Disabled
+incompatible_api_component_version_include_minor_without_api_change=Disabled
+invalid_since_tag_version=Error
+malformed_since_tag=Error
+missing_since_tag=Error
diff --git a/bundles/org.eclipse.rap.zest.core/about.ini b/bundles/org.eclipse.rap.zest.core/about.ini
index f4b4beb..b33a339 100644
--- a/bundles/org.eclipse.rap.zest.core/about.ini
+++ b/bundles/org.eclipse.rap.zest.core/about.ini
@@ -8,4 +8,4 @@
aboutText=%blurb
# Property "featureImage" contains path to feature image (32x32)
-featureImage=modeling32.png
+featureImage=gef_eclipse_logo_32.png
diff --git a/bundles/org.eclipse.rap.zest.core/about.mappings b/bundles/org.eclipse.rap.zest.core/about.mappings
index 720ca87..bddaab4 100644
--- a/bundles/org.eclipse.rap.zest.core/about.mappings
+++ b/bundles/org.eclipse.rap.zest.core/about.mappings
@@ -1,6 +1,6 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
+# about.mappings
+# contains fill-ins for about.properties
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file does not need to be translated.
+
0=@build@
\ No newline at end of file
diff --git a/bundles/org.eclipse.rap.zest.core/about.properties b/bundles/org.eclipse.rap.zest.core/about.properties
index 0502573..4bc640f 100644
--- a/bundles/org.eclipse.rap.zest.core/about.properties
+++ b/bundles/org.eclipse.rap.zest.core/about.properties
@@ -14,7 +14,7 @@
# fill-ins are supplied by about.mappings
# This file should be translated.
-blurb=Graphical Editing Framework Zest Visualization Toolkit\n\
+blurb=Zest\n\
\n\
Version: {featureVersion}\n\
Build id: {0}\n\
diff --git a/bundles/org.eclipse.rap.zest.core/build.properties b/bundles/org.eclipse.rap.zest.core/build.properties
index 17a84f1..4acda0c 100644
--- a/bundles/org.eclipse.rap.zest.core/build.properties
+++ b/bundles/org.eclipse.rap.zest.core/build.properties
@@ -9,7 +9,7 @@
# IBM Corporation - initial API and implementation
###############################################################################
bin.includes = about.*,\
- modeling32.png,\
+ gef_eclipse_logo_32.png,\
META-INF/,\
.,\
src/icons/,\
@@ -17,3 +17,4 @@
jars.compile.order = .
source.. = src/
output.. = bin/
+src.includes = about.html
diff --git a/bundles/org.eclipse.rap.zest.core/gef_eclipse_logo_32.png b/bundles/org.eclipse.rap.zest.core/gef_eclipse_logo_32.png
new file mode 100644
index 0000000..c3f107b
--- /dev/null
+++ b/bundles/org.eclipse.rap.zest.core/gef_eclipse_logo_32.png
Binary files differ
diff --git a/bundles/org.eclipse.rap.zest.core/modeling32.png b/bundles/org.eclipse.rap.zest.core/modeling32.png
deleted file mode 100644
index 6b08de2..0000000
--- a/bundles/org.eclipse.rap.zest.core/modeling32.png
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.rap.zest.core/plugin.properties b/bundles/org.eclipse.rap.zest.core/plugin.properties
index 52ad81e..0e58b94 100644
--- a/bundles/org.eclipse.rap.zest.core/plugin.properties
+++ b/bundles/org.eclipse.rap.zest.core/plugin.properties
@@ -8,5 +8,5 @@
# Contributors:
# IBM Corporation - initial API and implementation
###############################################################################
-Plugin.name=Graphical Editing Framework Zest Core
-Plugin.providerName = Eclipse.org
+Plugin.name=Zest Core
+Plugin.providerName=Eclipse GEF
diff --git a/bundles/org.eclipse.rap.zest.core/readme.txt b/bundles/org.eclipse.rap.zest.core/readme.txt
index 82168f0..b8153a7 100644
--- a/bundles/org.eclipse.rap.zest.core/readme.txt
+++ b/bundles/org.eclipse.rap.zest.core/readme.txt
@@ -1 +1 @@
-The source version of this port is: 1.5.200.qualifier
\ No newline at end of file
+The source version of this port is: 1.5.300.qualifier
\ No newline at end of file
diff --git a/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/viewers/GraphViewer.java b/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/viewers/GraphViewer.java
index 27a5769..c83d043 100644
--- a/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/viewers/GraphViewer.java
+++ b/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/viewers/GraphViewer.java
@@ -37,12 +37,11 @@
import org.eclipse.zest.core.widgets.GraphItem;
import org.eclipse.zest.layouts.LayoutAlgorithm;
-/*
+/**
* This view is used to represent a static graph. Static graphs can be layed
* out, but do not continually update their layout locations.
*
* @author Ian Bull
- *
* @author Chris Callendar
*/
public class GraphViewer extends AbstractStructuredGraphViewer implements
diff --git a/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/viewers/INestedContentProvider.java b/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/viewers/INestedContentProvider.java
index aabe5d0..07726ec 100644
--- a/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/viewers/INestedContentProvider.java
+++ b/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/viewers/INestedContentProvider.java
@@ -9,7 +9,7 @@
******************************************************************************/
package org.eclipse.zest.core.viewers;
-/*
+/**
* A content provider for nested graphs. Any entity based content provider
* (IGraphEntityContentProvider or IGraphEntityRelationshipContentProvider) can
* also implement this interface. Any node that "hasChildren" will be rendered
@@ -22,20 +22,22 @@
public interface INestedContentProvider {
/**
- * Does the current node have children? If so, it will be rendered as a
+ * Does the current node have children? If so, it will be rendered as a
* container.
*
- * @param element The current node
+ * @param element
+ * The current node
* @return True if it has children, false otherwise
*/
public boolean hasChildren(Object element);
/**
- * Gets the children of this node. This method will not be called
- * if hasChildren returns false.
+ * Gets the children of this node. This method will not be called if
+ * hasChildren returns false.
*
- * @param element The current node
- * @return The list of children for this node.
+ * @param element
+ * The current node
+ * @return The list of children for this node.
*/
public Object[] getChildren(Object element);
}
diff --git a/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/viewers/internal/AbstractStructuredGraphViewer.java b/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/viewers/internal/AbstractStructuredGraphViewer.java
index d011820..41fedda 100644
--- a/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/viewers/internal/AbstractStructuredGraphViewer.java
+++ b/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/viewers/internal/AbstractStructuredGraphViewer.java
@@ -35,14 +35,15 @@
import org.eclipse.zest.core.widgets.ZestStyles;
import org.eclipse.zest.layouts.LayoutAlgorithm;
-/*
+/**
* Abstraction of graph viewers to implement functionality used by all of them.
* Not intended to be implemented by clients. Use one of the provided children
* instead.
*
* @author Del Myers
*/
-public abstract class AbstractStructuredGraphViewer extends AbstractZoomableViewer {
+public abstract class AbstractStructuredGraphViewer extends
+ AbstractZoomableViewer {
/**
* Contains top-level styles for the entire graph. Set in the constructor. *
*/
@@ -90,7 +91,8 @@
public int compare(Object arg0, Object arg1) {
if (arg0 instanceof GraphNode && arg1 instanceof GraphConnection) {
return 1;
- } else if (arg0 instanceof GraphConnection && arg1 instanceof GraphNode) {
+ } else if (arg0 instanceof GraphConnection
+ && arg1 instanceof GraphNode) {
return -1;
}
if (arg0.equals(arg1)) {
@@ -100,7 +102,8 @@
}
private String getObjectString(Object o) {
- String s = o.getClass().getName() + "@" + Integer.toHexString(o.hashCode());
+ String s = o.getClass().getName() + "@"
+ + Integer.toHexString(o.hashCode());
while (storedStrings.contains(s)) {
s = s + 'X';
}
@@ -205,7 +208,8 @@
* true if the layout algorithm should be run immediately. This
* is a hint.
*/
- public abstract void setLayoutAlgorithm(LayoutAlgorithm algorithm, boolean run);
+ public abstract void setLayoutAlgorithm(LayoutAlgorithm algorithm,
+ boolean run);
/**
* Gets the current layout algorithm.
@@ -271,10 +275,12 @@
return node;
}
- GraphConnection addGraphModelConnection(Object element, GraphNode source, GraphNode target) {
+ GraphConnection addGraphModelConnection(Object element, GraphNode source,
+ GraphNode target) {
GraphConnection connection = this.getGraphModelConnection(element);
if (connection == null) {
- connection = new GraphConnection((Graph) getControl(), SWT.NONE, source, target);
+ connection = new GraphConnection((Graph) getControl(), SWT.NONE,
+ source, target);
this.connectionsMap.put(element, connection);
connection.setData(element);
}
@@ -313,7 +319,9 @@
/*
* (non-Javadoc)
*
- * @see org.eclipse.jface.viewers.StructuredViewer#internalRefresh(java.lang.Object)
+ * @see
+ * org.eclipse.jface.viewers.StructuredViewer#internalRefresh(java.lang.
+ * Object)
*/
protected void internalRefresh(Object element) {
if (getInput() == null) {
@@ -327,7 +335,8 @@
// After all the items are loaded, we call update to ensure drawing.
// This way the damaged area does not get too big if we start
// adding and removing more nodes
- getGraphControl().getLightweightSystem().getUpdateManager().performUpdate();
+ getGraphControl().getLightweightSystem().getUpdateManager()
+ .performUpdate();
}
protected void doUpdateItem(Widget item, Object element, boolean fullMap) {
@@ -342,7 +351,9 @@
/*
* (non-Javadoc)
*
- * @see org.eclipse.jface.viewers.StructuredViewer#doFindInputItem(java.lang.Object)
+ * @see
+ * org.eclipse.jface.viewers.StructuredViewer#doFindInputItem(java.lang.
+ * Object)
*/
protected Widget doFindInputItem(Object element) {
@@ -355,7 +366,8 @@
/*
* (non-Javadoc)
*
- * @see org.eclipse.jface.viewers.StructuredViewer#doFindItem(java.lang.Object)
+ * @see
+ * org.eclipse.jface.viewers.StructuredViewer#doFindItem(java.lang.Object)
*/
protected Widget doFindItem(Object element) {
Widget node = (Widget) nodesMap.get(element);
@@ -398,8 +410,9 @@
/*
* (non-Javadoc)
*
- * @see org.eclipse.jface.viewers.StructuredViewer#setSelectionToWidget(java.util.List,
- * boolean)
+ * @see
+ * org.eclipse.jface.viewers.StructuredViewer#setSelectionToWidget(java.
+ * util.List, boolean)
*/
protected void setSelectionToWidget(List l, boolean reveal) {
Graph control = (Graph) getControl();
@@ -415,7 +428,8 @@
selection.add(conn);
}
}
- control.setSelection((GraphNode[]) selection.toArray(new GraphNode[selection.size()]));
+ control.setSelection((GraphNode[]) selection
+ .toArray(new GraphNode[selection.size()]));
}
/**
@@ -432,7 +446,7 @@
* (non-Javadoc)
*
* @see org.eclipse.jface.viewers.Viewer#inputChanged(java.lang.Object,
- * java.lang.Object)
+ * java.lang.Object)
*/
protected void inputChanged(Object input, Object oldInput) {
IStylingGraphModelFactory factory = getFactory();
@@ -476,9 +490,11 @@
GraphNode newNode = (GraphNode) nodesMap.get(data);
if (newNode != null) {
GraphNode oldNode = (GraphNode) oldNodesMap.get(data);
- newNode.setLocation(oldNode.getLocation().x, oldNode.getLocation().y);
+ newNode.setLocation(oldNode.getLocation().x,
+ oldNode.getLocation().y);
if (oldNode.isSizeFixed()) {
- newNode.setSize(oldNode.getSize().width, oldNode.getSize().height);
+ newNode.setSize(oldNode.getSize().width,
+ oldNode.getSize().height);
}
}
}
@@ -557,7 +573,9 @@
/*
* (non-Javadoc)
*
- * @see org.eclipse.jface.viewers.StructuredViewer#getRawChildren(java.lang.Object)
+ * @see
+ * org.eclipse.jface.viewers.StructuredViewer#getRawChildren(java.lang.Object
+ * )
*/
protected Object[] getRawChildren(Object parent) {
if (parent == getInput()) {
@@ -628,12 +646,14 @@
* @param connection
*/
public void removeRelationship(Object connection) {
- GraphConnection relationship = (GraphConnection) connectionsMap.get(connection);
+ GraphConnection relationship = (GraphConnection) connectionsMap
+ .get(connection);
if (relationship != null) {
// remove the relationship from the layout algorithm
if (getLayoutAlgorithm() != null) {
- getLayoutAlgorithm().removeRelationship(relationship.getLayoutRelationship());
+ getLayoutAlgorithm().removeRelationship(
+ relationship.getLayoutRelationship());
}
// remove the relationship from the model
relationship.dispose();
@@ -667,8 +687,10 @@
// remove the node from the layout algorithm and all the connections
if (getLayoutAlgorithm() != null) {
getLayoutAlgorithm().removeEntity(node.getLayoutEntity());
- getLayoutAlgorithm().removeRelationships(node.getSourceConnections());
- getLayoutAlgorithm().removeRelationships(node.getTargetConnections());
+ getLayoutAlgorithm().removeRelationships(
+ node.getSourceConnections());
+ getLayoutAlgorithm().removeRelationships(
+ node.getTargetConnections());
}
// remove the node and it's connections from the model
node.dispose();
@@ -686,10 +708,12 @@
* @param destNode
* The destination node data object.
*/
- public void addRelationship(Object connection, Object srcNode, Object destNode) {
+ public void addRelationship(Object connection, Object srcNode,
+ Object destNode) {
// create the new relationship
IStylingGraphModelFactory modelFactory = getFactory();
- modelFactory.createConnection(getGraphControl(), connection, srcNode, destNode);
+ modelFactory.createConnection(getGraphControl(), connection, srcNode,
+ destNode);
}
@@ -704,11 +728,13 @@
IStylingGraphModelFactory modelFactory = getFactory();
if (connectionsMap.get(connection) == null) {
if (modelFactory.getContentProvider() instanceof IGraphContentProvider) {
- IGraphContentProvider content = ((IGraphContentProvider) modelFactory.getContentProvider());
+ IGraphContentProvider content = ((IGraphContentProvider) modelFactory
+ .getContentProvider());
Object source = content.getSource(connection);
Object dest = content.getDestination(connection);
// create the new relationship
- modelFactory.createConnection(getGraphControl(), connection, source, dest);
+ modelFactory.createConnection(getGraphControl(), connection,
+ source, dest);
} else {
throw new UnsupportedOperationException();
}
@@ -722,8 +748,10 @@
* @return GraphModelConnection[]
*/
protected GraphConnection[] getConnectionsArray(Graph graph) {
- GraphConnection[] connsArray = new GraphConnection[graph.getConnections().size()];
- connsArray = (GraphConnection[]) graph.getConnections().toArray(connsArray);
+ GraphConnection[] connsArray = new GraphConnection[graph
+ .getConnections().size()];
+ connsArray = (GraphConnection[]) graph.getConnections().toArray(
+ connsArray);
return connsArray;
}
diff --git a/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/viewers/internal/AbstractStylingModelFactory.java b/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/viewers/internal/AbstractStylingModelFactory.java
index 6ec5123..2adffcd 100644
--- a/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/viewers/internal/AbstractStylingModelFactory.java
+++ b/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/viewers/internal/AbstractStylingModelFactory.java
@@ -30,7 +30,7 @@
import org.eclipse.zest.core.widgets.GraphNode;
import org.eclipse.zest.core.widgets.IContainer;
-/*
+/**
* Base class that can be used for model factories. Offers facilities to style
* the items that have been created by the factory.
*
@@ -38,7 +38,8 @@
*/
// @tag zest.bug.160367-Refreshing.fix : update the factory to use the
// IStylingGraphModelFactory
-public abstract class AbstractStylingModelFactory implements IStylingGraphModelFactory {
+public abstract class AbstractStylingModelFactory implements
+ IStylingGraphModelFactory {
private AbstractStructuredGraphViewer viewer;
private int connectionStyle;
private int nodeStyle;
@@ -71,7 +72,8 @@
leftList = getConnectionList(dest, source);
}
- int size = (leftList != null) ? leftList.size() + rightList.size() : rightList.size();
+ int size = (leftList != null) ? leftList.size() + rightList.size()
+ : rightList.size();
// adjust the arcs going from source to destination
adjustCurves(rightList, size);
// adjust the arcs going from destination to source
@@ -85,12 +87,13 @@
* the bezier curves based on the number of curves in the list.
*
* @param connections
- * @param size
-+ * total number of arcs - may be bigger then connections.size
+ * @param size
+ * + * total number of arcs - may be bigger then connections.size
*/
protected void adjustCurves(List connections, int size) {
/*
- * The connections should be curved if source and dest are equal, or there are multiple arcs between two nodes
+ * The connections should be curved if source and dest are equal, or
+ * there are multiple arcs between two nodes
*/
for (int i = 0; i < connections.size(); i++) {
GraphConnection conn = (GraphConnection) connections.get(i);
@@ -135,7 +138,8 @@
/*
* (non-Javadoc)
*
- * @see org.eclipse.zest.core.internal.graphmodel.IStylingGraphModelFactory#getLabelProvider()
+ * @see org.eclipse.zest.core.internal.graphmodel.IStylingGraphModelFactory#
+ * getLabelProvider()
*/
public IBaseLabelProvider getLabelProvider() {
return viewer.getLabelProvider();
@@ -144,7 +148,8 @@
/*
* (non-Javadoc)
*
- * @see org.eclipse.zest.core.internal.graphmodel.IStylingGraphModelFactory#getContentProvider()
+ * @see org.eclipse.zest.core.internal.graphmodel.IStylingGraphModelFactory#
+ * getContentProvider()
*/
public IStructuredContentProvider getContentProvider() {
return (IStructuredContentProvider) viewer.getContentProvider();
@@ -153,10 +158,12 @@
/*
* (non-Javadoc)
*
- * @see org.eclipse.zest.core.internal.graphmodel.IStylingGraphModelFactory#createConnection(org.eclipse.zest.core.internal.graphmodel.GraphModel,
- * java.lang.Object, java.lang.Object, java.lang.Object)
+ * @see org.eclipse.zest.core.internal.graphmodel.IStylingGraphModelFactory#
+ * createConnection(org.eclipse.zest.core.internal.graphmodel.GraphModel,
+ * java.lang.Object, java.lang.Object, java.lang.Object)
*/
- public GraphConnection createConnection(Graph graph, Object element, Object source, Object dest) {
+ public GraphConnection createConnection(Graph graph, Object element,
+ Object source, Object dest) {
if (source == null || dest == null) {
return null;
}
@@ -164,7 +171,8 @@
GraphNode sn = viewer.getGraphModelNode(source);
GraphNode dn = viewer.getGraphModelNode(dest);
if (oldConnection != null) {
- if (sn != oldConnection.getSource() || dn != oldConnection.getDestination()) {
+ if (sn != oldConnection.getSource()
+ || dn != oldConnection.getDestination()) {
viewer.removeGraphModelConnection(oldConnection);
} else {
styleItem(oldConnection);
@@ -205,23 +213,27 @@
/*
* (non-Javadoc)
*
- * @see org.eclipse.zest.core.internal.graphmodel.IStylingGraphModelFactory#createNode(org.eclipse.zest.core.internal.graphmodel.GraphModel,
- * java.lang.Object)
+ * @see org.eclipse.zest.core.internal.graphmodel.IStylingGraphModelFactory#
+ * createNode(org.eclipse.zest.core.internal.graphmodel.GraphModel,
+ * java.lang.Object)
*/
public GraphNode createNode(Graph graph, Object element, IFigure figure) {
GraphNode node = null;
if (getContentProvider() instanceof INestedContentProvider) {
- boolean isContainer = ((INestedContentProvider) getContentProvider()).hasChildren(element);
+ boolean isContainer = ((INestedContentProvider) getContentProvider())
+ .hasChildren(element);
if (isContainer) {
node = viewer.addGraphModelContainer(element);
styleItem(node);
- Object[] childNodes = ((INestedContentProvider) getContentProvider()).getChildren(element);
+ Object[] childNodes = ((INestedContentProvider) getContentProvider())
+ .getChildren(element);
childNodes = filter(getViewer().getInput(), childNodes);
if (childNodes == null) {
return node;
}
for (int i = 0; i < childNodes.length; i++) {
- GraphNode childNode = viewer.addGraphModelNode((IContainer) node, childNodes[i]);
+ GraphNode childNode = viewer.addGraphModelNode(
+ (IContainer) node, childNodes[i]);
styleItem(childNode);
}
((IContainer) node).applyLayout();
@@ -236,7 +248,8 @@
public GraphNode createNode(Graph graph, Object element) {
IFigure nodeFigure = null;
if (getLabelProvider() instanceof IFigureProvider) {
- nodeFigure = ((IFigureProvider) getLabelProvider()).getFigure(element);
+ nodeFigure = ((IFigureProvider) getLabelProvider())
+ .getFigure(element);
}
return this.createNode(graph, element, nodeFigure);
}
@@ -288,7 +301,8 @@
/*
* (non-Javadoc)
*
- * @see org.eclipse.zest.core.internal.graphmodel.IStylingGraphModelFactory#refreshGraph(org.eclipse.zest.core.internal.graphmodel.GraphModel)
+ * @see org.eclipse.zest.core.internal.graphmodel.IStylingGraphModelFactory#
+ * refreshGraph(org.eclipse.zest.core.internal.graphmodel.GraphModel)
*/
public void refreshGraph(Graph graph) {
// with this kind of graph, it is just as easy and cost-effective to
@@ -308,11 +322,14 @@
// save a little time, go with the smallest list as the primary list
if (nodes.length < nodesMap.keySet().size()) {
for (int i = 0; i < nodes.length; i++) {
- GraphNode oldNode = (GraphNode) nodesMap.get(nodes[i].getData());
+ GraphNode oldNode = (GraphNode) nodesMap
+ .get(nodes[i].getData());
if (oldNode != null) {
- nodes[i].setLocation(oldNode.getLocation().x, oldNode.getLocation().y);
+ nodes[i].setLocation(oldNode.getLocation().x,
+ oldNode.getLocation().y);
if (oldNode.isSizeFixed()) {
- nodes[i].setSize(oldNode.getSize().width, oldNode.getSize().height);
+ nodes[i].setSize(oldNode.getSize().width,
+ oldNode.getSize().height);
}
}
}
@@ -322,9 +339,11 @@
GraphNode node = viewer.getGraphModelNode(key);
if (node != null) {
GraphNode oldNode = (GraphNode) nodesMap.get(key);
- node.setLocation(oldNode.getLocation().x, oldNode.getLocation().y);
+ node.setLocation(oldNode.getLocation().x,
+ oldNode.getLocation().y);
if (oldNode.isSizeFixed()) {
- node.setSize(oldNode.getSize().width, oldNode.getSize().height);
+ node.setSize(oldNode.getSize().width,
+ oldNode.getSize().height);
}
}
}
@@ -382,7 +401,8 @@
/*
* (non-Javadoc)
*
- * @see org.eclipse.zest.core.internal.graphmodel.IStylingGraphModelFactory#isFiltered(java.lang.Object)
+ * @see org.eclipse.zest.core.internal.graphmodel.IStylingGraphModelFactory#
+ * isFiltered(java.lang.Object)
*/
protected Object[] filter(Object parent, Object[] elements) {
Object[] result = elements;
@@ -396,8 +416,9 @@
/*
* (non-Javadoc)
*
- * @see org.eclipse.zest.core.internal.graphmodel.IStylingGraphModelFactory#refresh(org.eclipse.zest.core.internal.graphmodel.GraphModel,
- * java.lang.Object)
+ * @see
+ * org.eclipse.zest.core.internal.graphmodel.IStylingGraphModelFactory#refresh
+ * (org.eclipse.zest.core.internal.graphmodel.GraphModel, java.lang.Object)
*/
public void refresh(Graph graph, Object element) {
refresh(graph, element, false);
@@ -415,13 +436,17 @@
}
/**
- * Converts the list of GraphConnections objects into an array and return it.
+ * Converts the list of GraphConnections objects into an array and return
+ * it.
+ *
* @param graph
* @return
*/
protected GraphConnection[] getConnectionArray(Graph graph) {
- GraphConnection[] connectionArray = new GraphConnection[graph.getConnections().size()];
- connectionArray = (GraphConnection[]) graph.getConnections().toArray(connectionArray);
+ GraphConnection[] connectionArray = new GraphConnection[graph
+ .getConnections().size()];
+ connectionArray = (GraphConnection[]) graph.getConnections().toArray(
+ connectionArray);
return connectionArray;
}
}
diff --git a/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/viewers/internal/GraphItemStyler.java b/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/viewers/internal/GraphItemStyler.java
index 3042361..0143bc0 100644
--- a/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/viewers/internal/GraphItemStyler.java
+++ b/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/viewers/internal/GraphItemStyler.java
@@ -26,14 +26,15 @@
import org.eclipse.zest.core.widgets.GraphNode;
import org.eclipse.zest.core.widgets.ZestStyles;
-/*
+/**
* Helper class used to style graph elements based on graph element stylers.
*
* @author Del Myers
*/
// @tag bug(151327-Styles) : created to help resolve this bug
public class GraphItemStyler {
- public static void styleItem(GraphItem item, final IBaseLabelProvider labelProvider) {
+ public static void styleItem(GraphItem item,
+ final IBaseLabelProvider labelProvider) {
if (item instanceof GraphNode) {
GraphNode node = (GraphNode) item;
@@ -57,12 +58,15 @@
node.setFont(fontProvider.getFont(entity));
}
if (labelProvider instanceof ILabelProvider) {
- String text = ((ILabelProvider) labelProvider).getText(node.getData());
+ String text = ((ILabelProvider) labelProvider).getText(node
+ .getData());
node.setText((text != null) ? text : "");
- node.setImage(((ILabelProvider) labelProvider).getImage(node.getData()));
+ node.setImage(((ILabelProvider) labelProvider).getImage(node
+ .getData()));
}
if (labelProvider instanceof ISelfStyleProvider) {
- ((ISelfStyleProvider) labelProvider).selfStyleNode(entity, node);
+ ((ISelfStyleProvider) labelProvider)
+ .selfStyleNode(entity, node);
}
} else if (item instanceof GraphConnection) {
GraphConnection conn = (GraphConnection) item;
@@ -75,19 +79,23 @@
conn.setConnectionStyle(SWT.NONE);
}
if (labelProvider instanceof ILabelProvider) {
- String text = ((ILabelProvider) labelProvider).getText(conn.getExternalConnection());
+ String text = ((ILabelProvider) labelProvider).getText(conn
+ .getExternalConnection());
conn.setText((text != null) ? text : "");
- conn.setImage(((ILabelProvider) labelProvider).getImage(conn.getExternalConnection()));
+ conn.setImage(((ILabelProvider) labelProvider).getImage(conn
+ .getExternalConnection()));
}
if (labelProvider instanceof IEntityConnectionStyleProvider) {
- styleEntityConnection(conn, (IEntityConnectionStyleProvider) labelProvider);
+ styleEntityConnection(conn,
+ (IEntityConnectionStyleProvider) labelProvider);
} else if (labelProvider instanceof IConnectionStyleProvider) {
styleConnection(conn, (IConnectionStyleProvider) labelProvider);
}
int swt = getLineStyleForZestStyle(conn.getConnectionStyle());
conn.setLineStyle(swt);
if (labelProvider instanceof ISelfStyleProvider) {
- ((ISelfStyleProvider) labelProvider).selfStyleConnection(conn.getData(), conn);
+ ((ISelfStyleProvider) labelProvider).selfStyleConnection(
+ conn.getData(), conn);
}
}
}
@@ -96,7 +104,8 @@
* @param conn
* @param provider
*/
- private static void styleConnection(GraphConnection conn, IConnectionStyleProvider provider) {
+ private static void styleConnection(GraphConnection conn,
+ IConnectionStyleProvider provider) {
Object rel = conn.getExternalConnection();
Color c;
int style = provider.getConnectionStyle(rel);
@@ -147,7 +156,8 @@
* @param conn
* @param provider
*/
- private static void styleEntityConnection(GraphConnection conn, IEntityConnectionStyleProvider provider) {
+ private static void styleEntityConnection(GraphConnection conn,
+ IEntityConnectionStyleProvider provider) {
Object src = conn.getSource().getData();
Object dest = conn.getDestination().getData();
Color c;
@@ -159,7 +169,8 @@
conn.setConnectionStyle(style);
}
// @tag bug(152530-Bezier(fisx))
- // @tag TODO curved connections bezier : add back the bezier connection stuff
+ // @tag TODO curved connections bezier : add back the bezier connection
+ // stuff
// if (ZestStyles.checkStyle(conn.getConnectionStyle(),
// ZestStyles.CONNECTIONS_BEZIER)
// && provider instanceof IEntityConnectionStyleBezierExtension) {
@@ -205,17 +216,14 @@
private static void styleNode(GraphNode node, IEntityStyleProvider provider) {
Object entity = node.getData();
// @tag ADJACENT : Removed highlight adjacent
- //node.setHighlightAdjacentNodes(provider.highlightAdjacentEntities(entity));
+ // node.setHighlightAdjacentNodes(provider.highlightAdjacentEntities(entity));
// @tag ADJACENT : Removed highlight adjacent
/*
- if (provider.highlightAdjacentEntities(entity)) {
- Color c = provider.getAdjacentEntityHighlightColor(entity);
- if (c != null) {
- node.setHighlightAdjacentColor(c);
- }
- }
- */
+ * if (provider.highlightAdjacentEntities(entity)) { Color c =
+ * provider.getAdjacentEntityHighlightColor(entity); if (c != null) {
+ * node.setHighlightAdjacentColor(c); } }
+ */
Color c;
IFigure figure;
int width = -1;
@@ -251,7 +259,9 @@
*
*/
public static int getLineStyleForZestStyle(int style) {
- int lineStyles = ZestStyles.CONNECTIONS_DASH_DOT | ZestStyles.CONNECTIONS_DASH | ZestStyles.CONNECTIONS_DOT | ZestStyles.CONNECTIONS_SOLID;
+ int lineStyles = ZestStyles.CONNECTIONS_DASH_DOT
+ | ZestStyles.CONNECTIONS_DASH | ZestStyles.CONNECTIONS_DOT
+ | ZestStyles.CONNECTIONS_SOLID;
style = style & lineStyles;
if (style == 0) {
style = ZestStyles.CONNECTIONS_SOLID;
diff --git a/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/viewers/internal/GraphModelEntityFactory.java b/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/viewers/internal/GraphModelEntityFactory.java
index 501d9bf..8e94a34 100644
--- a/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/viewers/internal/GraphModelEntityFactory.java
+++ b/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/viewers/internal/GraphModelEntityFactory.java
@@ -23,7 +23,7 @@
import org.eclipse.zest.core.widgets.GraphItem;
import org.eclipse.zest.core.widgets.GraphNode;
-/*
+/**
*
* @author Ian Bull
*/
@@ -39,7 +39,8 @@
/*
* (non-Javadoc)
*
- * @see org.eclipse.zest.core.internal.graphmodel.IStylingGraphModelFactory#createGraphModel()
+ * @see org.eclipse.zest.core.internal.graphmodel.IStylingGraphModelFactory#
+ * createGraphModel()
*/
public Graph createGraphModel(Graph model) {
doBuildGraph(model);
@@ -49,7 +50,9 @@
/*
* (non-Javadoc)
*
- * @see org.eclipse.zest.core.internal.graphmodel.AbstractStylingModelFactory#doBuildGraph(org.eclipse.zest.core.internal.graphmodel.GraphModel)
+ * @see
+ * org.eclipse.zest.core.internal.graphmodel.AbstractStylingModelFactory
+ * #doBuildGraph(org.eclipse.zest.core.internal.graphmodel.GraphModel)
*/
protected void doBuildGraph(Graph model) {
super.doBuildGraph(model);
@@ -73,8 +76,9 @@
}
}
- // We may have other entities (such as children of containers)
- Set keySet = ((AbstractStructuredGraphViewer) getViewer()).getNodesMap().keySet();
+ // We may have other entities (such as children of containers)
+ Set keySet = ((AbstractStructuredGraphViewer) getViewer())
+ .getNodesMap().keySet();
entities = keySet.toArray();
for (int i = 0; i < entities.length; i++) {
@@ -84,7 +88,8 @@
if (filterElement(inputElement, data)) {
continue;
}
- Object[] related = ((IGraphEntityContentProvider) getContentProvider()).getConnectedTo(data);
+ Object[] related = ((IGraphEntityContentProvider) getContentProvider())
+ .getConnectedTo(data);
if (related != null) {
for (int j = 0; j < related.length; j++) {
@@ -93,7 +98,8 @@
if (filterElement(inputElement, related[j])) {
continue;
}
- EntityConnectionData connectionData = new EntityConnectionData(data, related[j]);
+ EntityConnectionData connectionData = new EntityConnectionData(
+ data, related[j]);
if (filterElement(inputElement, connectionData)) {
continue;
}
@@ -106,8 +112,9 @@
/*
* (non-Javadoc)
*
- * @see org.eclipse.zest.core.internal.graphmodel.IStylingGraphModelFactory#refresh(org.eclipse.zest.core.internal.graphmodel.GraphModel,
- * java.lang.Object)
+ * @see
+ * org.eclipse.zest.core.internal.graphmodel.IStylingGraphModelFactory#refresh
+ * (org.eclipse.zest.core.internal.graphmodel.GraphModel, java.lang.Object)
*/
public void refresh(Graph graph, Object element, boolean refreshLabels) {
if (element == null) {
@@ -133,10 +140,12 @@
if (refreshLabels) {
update(node);
- for (Iterator it = node.getSourceConnections().iterator(); it.hasNext();) {
+ for (Iterator it = node.getSourceConnections().iterator(); it
+ .hasNext();) {
update((GraphItem) it.next());
}
- for (Iterator it = node.getTargetConnections().iterator(); it.hasNext();) {
+ for (Iterator it = node.getTargetConnections().iterator(); it
+ .hasNext();) {
update((GraphItem) it.next());
}
}
@@ -149,7 +158,8 @@
*/
private void reconnect(Graph graph, Object element, boolean refreshLabels) {
GraphNode node = viewer.getGraphModelNode(element);
- Object[] related = ((IGraphEntityContentProvider) getContentProvider()).getConnectedTo(element);
+ Object[] related = ((IGraphEntityContentProvider) getContentProvider())
+ .getConnectedTo(element);
List connections = node.getSourceConnections();
LinkedList toAdd = new LinkedList();
LinkedList toDelete = new LinkedList();
@@ -157,10 +167,12 @@
HashSet oldExternalConnections = new HashSet();
HashSet newExternalConnections = new HashSet();
for (Iterator it = connections.iterator(); it.hasNext();) {
- oldExternalConnections.add(((GraphConnection) it.next()).getExternalConnection());
+ oldExternalConnections.add(((GraphConnection) it.next())
+ .getExternalConnection());
}
for (int i = 0; i < related.length; i++) {
- newExternalConnections.add(new EntityConnectionData(element, related[i]));
+ newExternalConnections.add(new EntityConnectionData(element,
+ related[i]));
}
for (Iterator it = oldExternalConnections.iterator(); it.hasNext();) {
Object next = it.next();
@@ -204,8 +216,10 @@
/*
* (non-Javadoc)
*
- * @see org.eclipse.zest.core.internal.graphmodel.IStylingGraphModelFactory#refresh(org.eclipse.zest.core.internal.graphmodel.GraphModel,
- * java.lang.Object, boolean)
+ * @see
+ * org.eclipse.zest.core.internal.graphmodel.IStylingGraphModelFactory#refresh
+ * (org.eclipse.zest.core.internal.graphmodel.GraphModel, java.lang.Object,
+ * boolean)
*/
public void refresh(Graph graph, Object element) {
refresh(graph, element, false);
diff --git a/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/viewers/internal/GraphModelEntityRelationshipFactory.java b/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/viewers/internal/GraphModelEntityRelationshipFactory.java
index 35cda4f..cb9b03b 100644
--- a/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/viewers/internal/GraphModelEntityRelationshipFactory.java
+++ b/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/viewers/internal/GraphModelEntityRelationshipFactory.java
@@ -17,7 +17,7 @@
import org.eclipse.zest.core.widgets.GraphContainer;
import org.eclipse.zest.core.widgets.GraphNode;
-/*
+/**
* A factory for the IGraphEntityRelationshipContentProvider.
*
* @author Del Myers
@@ -25,19 +25,24 @@
// @tag bug.154580-Content.fix
// @tag bug.160367-Refreshing.fix : updated to use new
// AbstractStylingModelFactory
-public class GraphModelEntityRelationshipFactory extends AbstractStylingModelFactory {
+public class GraphModelEntityRelationshipFactory extends
+ AbstractStylingModelFactory {
- public GraphModelEntityRelationshipFactory(AbstractStructuredGraphViewer viewer) {
+ public GraphModelEntityRelationshipFactory(
+ AbstractStructuredGraphViewer viewer) {
super(viewer);
if (!(viewer.getContentProvider() instanceof IGraphEntityRelationshipContentProvider)) {
- throw new IllegalArgumentException("Expected IGraphEntityRelationshipContentProvider");
+ throw new IllegalArgumentException(
+ "Expected IGraphEntityRelationshipContentProvider");
}
}
/*
* (non-Javadoc)
*
- * @see org.eclipse.zest.core.internal.graphmodel.AbstractStylingModelFactory#createGraphModel()
+ * @see
+ * org.eclipse.zest.core.internal.graphmodel.AbstractStylingModelFactory
+ * #createGraphModel()
*/
public Graph createGraphModel(Graph model) {
doBuildGraph(model);
@@ -47,11 +52,14 @@
/*
* (non-Javadoc)
*
- * @see org.eclipse.zest.core.internal.graphmodel.AbstractStylingModelFactory#doBuildGraph(org.eclipse.zest.core.internal.graphmodel.GraphModel)
+ * @see
+ * org.eclipse.zest.core.internal.graphmodel.AbstractStylingModelFactory
+ * #doBuildGraph(org.eclipse.zest.core.internal.graphmodel.GraphModel)
*/
protected void doBuildGraph(Graph model) {
super.doBuildGraph(model);
- Object[] nodes = getContentProvider().getElements(getViewer().getInput());
+ Object[] nodes = getContentProvider().getElements(
+ getViewer().getInput());
nodes = filter(getViewer().getInput(), nodes);
createModelNodes(model, nodes);
createModelRelationships(model);
@@ -78,16 +86,20 @@
listOfNodes.addAll(childNodes);
}
}
- modelNodes = (GraphNode[]) listOfNodes.toArray(new GraphNode[listOfNodes.size()]);
+ modelNodes = (GraphNode[]) listOfNodes
+ .toArray(new GraphNode[listOfNodes.size()]);
IGraphEntityRelationshipContentProvider content = getCastedContent();
for (int i = 0; i < modelNodes.length; i++) {
for (int j = 0; j < modelNodes.length; j++) {
- Object[] rels = content.getRelationships(modelNodes[i].getData(), modelNodes[j].getData());
+ Object[] rels = content.getRelationships(
+ modelNodes[i].getData(), modelNodes[j].getData());
if (rels != null) {
rels = filter(getViewer().getInput(), rels);
for (int r = 0; r < rels.length; r++) {
- createConnection(model, rels[r], modelNodes[i].getData(), modelNodes[j].getData());
+ createConnection(model, rels[r],
+ modelNodes[i].getData(),
+ modelNodes[j].getData());
}
}
}
@@ -111,8 +123,9 @@
/*
* (non-Javadoc)
*
- * @see org.eclipse.zest.core.internal.graphmodel.IStylingGraphModelFactory#refresh(org.eclipse.zest.core.internal.graphmodel.GraphModel,
- * java.lang.Object)
+ * @see
+ * org.eclipse.zest.core.internal.graphmodel.IStylingGraphModelFactory#refresh
+ * (org.eclipse.zest.core.internal.graphmodel.GraphModel, java.lang.Object)
*/
public void refresh(Graph graph, Object element) {
refresh(graph, element, false);
@@ -121,8 +134,10 @@
/*
* (non-Javadoc)
*
- * @see org.eclipse.zest.core.internal.graphmodel.IStylingGraphModelFactory#refresh(org.eclipse.zest.core.internal.graphmodel.GraphModel,
- * java.lang.Object, boolean)
+ * @see
+ * org.eclipse.zest.core.internal.graphmodel.IStylingGraphModelFactory#refresh
+ * (org.eclipse.zest.core.internal.graphmodel.GraphModel, java.lang.Object,
+ * boolean)
*/
public void refresh(Graph graph, Object element, boolean updateLabels) {
// with this kind of graph, it is just as easy and cost-effective to
diff --git a/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/widgets/Graph.java b/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/widgets/Graph.java
index 128bcae..b22da13 100644
--- a/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/widgets/Graph.java
+++ b/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/widgets/Graph.java
@@ -59,7 +59,7 @@
import org.eclipse.zest.layouts.algorithms.TreeLayoutAlgorithm;
import org.eclipse.zest.layouts.constraints.LayoutConstraint;
-/*
+/**
* Holds the nodes and connections for the graph.
*
* @author Chris Callendar
diff --git a/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/widgets/GraphConnection.java b/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/widgets/GraphConnection.java
index b35b104..d86d5e3 100644
--- a/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/widgets/GraphConnection.java
+++ b/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/widgets/GraphConnection.java
@@ -33,7 +33,7 @@
import org.eclipse.zest.layouts.LayoutRelationship;
import org.eclipse.zest.layouts.constraints.LayoutConstraint;
-/*
+/**
* This is the graph connection model which stores the source and destination
* nodes and the properties of this connection (color, line width etc).
*
@@ -76,7 +76,8 @@
private GraphLayoutConnection layoutConnection = null;
private boolean hasCustomTooltip;
- public GraphConnection(Graph graphModel, int style, GraphNode source, GraphNode destination) {
+ public GraphConnection(Graph graphModel, int style, GraphNode source,
+ GraphNode destination) {
super(graphModel, style);
this.connectionStyle |= graphModel.getConnectionStyle();
diff --git a/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/widgets/GraphContainer.java b/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/widgets/GraphContainer.java
index 5d67eb7..b6f1422 100644
--- a/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/widgets/GraphContainer.java
+++ b/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/widgets/GraphContainer.java
@@ -39,7 +39,7 @@
import org.eclipse.zest.layouts.LayoutStyles;
import org.eclipse.zest.layouts.algorithms.TreeLayoutAlgorithm;
-/*
+/**
* A Container than can be added to a Graph. Nodes can be added to this
* container. The container supports collapsing and expanding and has the same
* properties as the nodes. Containers cannot have custom figures.
@@ -67,14 +67,16 @@
private ScrollPane scrollPane;
private LayoutAlgorithm layoutAlgorithm;
private boolean isExpanded = false;
- //private ScalableFreeformLayeredPane scalledLayer;
+ // private ScalableFreeformLayeredPane scalledLayer;
private AspectRatioFreeformLayer scalledLayer;
/**
- * Creates a new GraphContainer. A GraphContainer may contain nodes,
- * and has many of the same properties as a graph node.
- * @param graph The graph that the container is being added to
- * @param style
+ * Creates a new GraphContainer. A GraphContainer may contain nodes, and has
+ * many of the same properties as a graph node.
+ *
+ * @param graph
+ * The graph that the container is being added to
+ * @param style
*/
public GraphContainer(IContainer graph, int style) {
this(graph, style, "");
@@ -97,18 +99,17 @@
* Custom figures cannot be set on a GraphContainer.
*/
public void setCustomFigure(IFigure nodeFigure) {
- throw new RuntimeException("Operation not supported: Containers cannot have custom figures");
+ throw new RuntimeException(
+ "Operation not supported: Containers cannot have custom figures");
}
/*
* (non-Javadoc)
- * @see org.eclipse.mylar.zest.core.widgets.GraphItem#getItemType()
- public int getItemType() {
- return GraphItem.CONTAINER;
- }
-
- /**
- * Gets the figure for this container.
+ *
+ * @see org.eclipse.mylar.zest.core.widgets.GraphItem#getItemType() public
+ * int getItemType() { return GraphItem.CONTAINER; }
+ *
+ * /** Gets the figure for this container.
*/
public IFigure getNodeFigure() {
return this.nodeFigure;
@@ -116,6 +117,7 @@
/**
* Close this node.
+ *
* @param animate
*/
public void close(boolean animate) {
diff --git a/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/widgets/GraphNode.java b/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/widgets/GraphNode.java
index b8def67..fcab04e 100644
--- a/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/widgets/GraphNode.java
+++ b/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/widgets/GraphNode.java
@@ -31,7 +31,7 @@
import org.eclipse.zest.layouts.LayoutEntity;
import org.eclipse.zest.layouts.constraints.LayoutConstraint;
-/*
+/**
* Simple node class which has the following properties: color, size, location,
* and a label. It also has a list of connections and anchors.
*
@@ -45,18 +45,18 @@
public static final int HIGHLIGHT_NONE = 0;
public static final int HIGHLIGHT_ON = 1;
// @tag ADJACENT : Removed highlight adjacent
- //public static final int HIGHLIGHT_ADJACENT = 2;
+ // public static final int HIGHLIGHT_ADJACENT = 2;
private int nodeStyle;
- private List /* IGraphModelConnection */sourceConnections;
- private List /* IGraphModelConnection */targetConnections;
+ private List /* IGraphModelConnection */ sourceConnections;
+ private List /* IGraphModelConnection */ targetConnections;
private Color foreColor;
private Color backColor;
private Color highlightColor;
// @tag ADJACENT : Removed highlight adjacent
- //private Color highlightAdjacentColor;
+ // private Color highlightAdjacentColor;
private Color borderColor;
private Color borderHighlightColor;
private int borderWidth;
@@ -85,22 +85,26 @@
}
public GraphNode(IContainer graphModel, int style, Object data) {
- this(graphModel.getGraph(), style, "" /*text*/, null /*image*/, data);
+ this(graphModel.getGraph(), style, "" /* text */, null /* image */,
+ data);
}
public GraphNode(IContainer graphModel, int style, String text) {
this(graphModel, style, text, null);
}
- public GraphNode(IContainer graphModel, int style, String text, Object data) {
- this(graphModel.getGraph(), style, text, null /*image*/, data);
+ public GraphNode(IContainer graphModel, int style, String text,
+ Object data) {
+ this(graphModel.getGraph(), style, text, null /* image */, data);
}
- public GraphNode(IContainer graphModel, int style, String text, Image image) {
+ public GraphNode(IContainer graphModel, int style, String text,
+ Image image) {
this(graphModel, style, text, image, null);
}
- public GraphNode(IContainer graphModel, int style, String text, Image image, Object data) {
+ public GraphNode(IContainer graphModel, int style, String text, Image image,
+ Object data) {
super(graphModel.getGraph(), style, data);
initModel(graphModel, text, image);
if (nodeFigure == null) {
@@ -109,7 +113,7 @@
// This is a hack because JAVA sucks!
// I don't want to expose addNode so I can't put it in the
- // IContainer interface.
+ // IContainer interface.
if (this.parent.getItemType() == GRAPH) {
((Graph) this.parent).addNode(this);
} else if (this.parent.getItemType() == CONTAINER) {
@@ -133,7 +137,7 @@
this.backColor = parent.getGraph().LIGHT_BLUE;
this.highlightColor = parent.getGraph().HIGHLIGHT_COLOR;
// @tag ADJACENT : Removed highlight adjacent
- //this.highlightAdjacentColor = ColorConstants.orange();
+ // this.highlightAdjacentColor = ColorConstants.orange;
this.nodeStyle = SWT.NONE;
this.borderColor = ColorConstants.lightGray();
this.borderHighlightColor = ColorConstants.blue();
@@ -178,7 +182,8 @@
super.dispose();
this.isDisposed = true;
while (getSourceConnections().size() > 0) {
- GraphConnection connection = (GraphConnection) getSourceConnections().get(0);
+ GraphConnection connection = (GraphConnection) getSourceConnections()
+ .get(0);
if (!connection.isDisposed()) {
connection.dispose();
} else {
@@ -186,7 +191,8 @@
}
}
while (getTargetConnections().size() > 0) {
- GraphConnection connection = (GraphConnection) getTargetConnections().get(0);
+ GraphConnection connection = (GraphConnection) getTargetConnections()
+ .get(0);
if (!connection.isDisposed()) {
connection.dispose();
} else {
@@ -206,8 +212,9 @@
}
/**
- * Determines if this node has a fixed size or if it is packed to the size of its contents.
- * To set a node to pack, set its size (-1, -1)
+ * Determines if this node has a fixed size or if it is packed to the size
+ * of its contents. To set a node to pack, set its size (-1, -1)
+ *
* @return
*/
public boolean isSizeFixed() {
@@ -256,7 +263,8 @@
/*
* (non-Javadoc)
*
- * @see org.eclipse.mylar.zest.core.internal.graphmodel.IGraphModelNode#isSelected()
+ * @see org.eclipse.mylar.zest.core.internal.graphmodel.IGraphModelNode#
+ * isSelected ()
*/
public boolean isSelected() {
return selected;
@@ -379,10 +387,9 @@
*/
// @tag ADJACENT : Removed highlight adjacent
/*
- public Color getHighlightAdjacentColor() {
- return highlightAdjacentColor;
- }
- */
+ * public Color getHighlightAdjacentColor() { return highlightAdjacentColor;
+ * }
+ */
/**
* Set the highlight adjacent colour for this node. This is the colour that
@@ -390,10 +397,9 @@
*/
// @tag ADJACENT : Removed highlight adjacent
/*
- public void setHighlightAdjacentColor(Color c) {
- this.highlightAdjacentColor = c;
- }
- */
+ * public void setHighlightAdjacentColor(Color c) {
+ * this.highlightAdjacentColor = c; }
+ */
/**
* Highlights the node changing the background color and border color. The
@@ -406,19 +412,15 @@
}
// @tag ADJACENT : Removed highlight adjacent
/*
- if (ZestStyles.checkStyle(getNodeStyle(), ZestStyles.NODES_HIGHLIGHT_ADJACENT)) {
- for (Iterator iter = sourceConnections.iterator(); iter.hasNext();) {
- GraphConnection conn = (GraphConnection) iter.next();
- conn.highlight();
- conn.getDestination().highlightAdjacent();
- }
- for (Iterator iter = targetConnections.iterator(); iter.hasNext();) {
- GraphConnection conn = (GraphConnection) iter.next();
- conn.highlight();
- conn.getSource().highlightAdjacent();
- }
- }
- */
+ * if (ZestStyles.checkStyle(getNodeStyle(),
+ * ZestStyles.NODES_HIGHLIGHT_ADJACENT)) { for (Iterator iter =
+ * sourceConnections.iterator(); iter.hasNext();) { GraphConnection conn
+ * = (GraphConnection) iter.next(); conn.highlight();
+ * conn.getDestination().highlightAdjacent(); } for (Iterator iter =
+ * targetConnections.iterator(); iter.hasNext();) { GraphConnection conn
+ * = (GraphConnection) iter.next(); conn.highlight();
+ * conn.getSource().highlightAdjacent(); } }
+ */
if (parent.getItemType() == GraphItem.CONTAINER) {
((GraphContainer) parent).highlightNode(this);
} else {
@@ -434,34 +436,24 @@
public void unhighlight() {
// @tag ADJACENT : Removed highlight adjacent
- //boolean highlightedAdjacently = (highlighted == HIGHLIGHT_ADJACENT);
+ // boolean highlightedAdjacently = (highlighted == HIGHLIGHT_ADJACENT);
if (highlighted == HIGHLIGHT_NONE) {
return;
}
// @tag ADJACENT : Removed highlight adjacent
/*
- if (!highlightedAdjacently) {
- // IF we are highlighted as an adjacent node, we don't need to deal
- // with our connections.
- if (ZestStyles.checkStyle(getNodeStyle(), ZestStyles.NODES_HIGHLIGHT_ADJACENT)) {
- // unhighlight the adjacent edges
- for (Iterator iter = sourceConnections.iterator(); iter.hasNext();) {
- GraphConnection conn = (GraphConnection) iter.next();
- conn.unhighlight();
- if (conn.getDestination() != this) {
- conn.getDestination().unhighlight();
- }
- }
- for (Iterator iter = targetConnections.iterator(); iter.hasNext();) {
- GraphConnection conn = (GraphConnection) iter.next();
- conn.unhighlight();
- if (conn.getSource() != this) {
- conn.getSource().unhighlight();
- }
- }
- }
- }
- */
+ * if (!highlightedAdjacently) { // IF we are highlighted as an adjacent
+ * node, we don't need to deal // with our connections. if
+ * (ZestStyles.checkStyle(getNodeStyle(),
+ * ZestStyles.NODES_HIGHLIGHT_ADJACENT)) { // unhighlight the adjacent
+ * edges for (Iterator iter = sourceConnections.iterator();
+ * iter.hasNext();) { GraphConnection conn = (GraphConnection)
+ * iter.next(); conn.unhighlight(); if (conn.getDestination() != this) {
+ * conn.getDestination().unhighlight(); } } for (Iterator iter =
+ * targetConnections.iterator(); iter.hasNext();) { GraphConnection conn
+ * = (GraphConnection) iter.next(); conn.unhighlight(); if
+ * (conn.getSource() != this) { conn.getSource().unhighlight(); } } } }
+ */
if (parent.getItemType() == GraphItem.CONTAINER) {
((GraphContainer) parent).unhighlightNode(this);
} else {
@@ -480,7 +472,7 @@
if (nodeFigure == null || nodeFigure.getParent() == null) {
return; // node figure has not been created yet
}
- //nodeFigure.setBounds(bounds);
+ // nodeFigure.setBounds(bounds);
nodeFigure.getParent().setConstraint(nodeFigure, bounds);
}
@@ -493,19 +485,12 @@
*/
// @tag ADJACENT : removed highlight adjacent
/*
- public void highlightAdjacent() {
- if (highlighted > 0) {
- return;
- }
- highlighted = HIGHLIGHT_ADJACENT;
- updateFigureForModel(nodeFigure);
- if (parent.getItemType() == GraphItem.CONTAINER) {
- ((GraphContainer) parent).highlightNode(this);
- } else {
- ((Graph) parent).highlightNode(this);
- }
- }
- */
+ * public void highlightAdjacent() { if (highlighted > 0) { return; }
+ * highlighted = HIGHLIGHT_ADJACENT; updateFigureForModel(nodeFigure); if
+ * (parent.getItemType() == GraphItem.CONTAINER) { ((GraphContainer)
+ * parent).highlightNode(this); } else { ((Graph)
+ * parent).highlightNode(this); } }
+ */
/**
* Returns if the nodes adjacent to this node will be highlighted when this
@@ -515,10 +500,9 @@
*/
// @tag ADJACENT : Removed highlight adjacent
/*
- public boolean isHighlightAdjacentNodes() {
- return ZestStyles.checkStyle(nodeStyle, ZestStyles.NODES_HIGHLIGHT_ADJACENT);
- }
- */
+ * public boolean isHighlightAdjacentNodes() { return
+ * ZestStyles.checkStyle(nodeStyle, ZestStyles.NODES_HIGHLIGHT_ADJACENT); }
+ */
/**
* Sets if the adjacent nodes to this one should be highlighted when this
@@ -529,15 +513,12 @@
*/
// @tag ADJACENT : Removed highlight adjacent
/*
- public void setHighlightAdjacentNodes(boolean highlightAdjacentNodes) {
- if (!highlightAdjacentNodes) {
- this.nodeStyle |= ZestStyles.NODES_HIGHLIGHT_ADJACENT;
- this.nodeStyle ^= ZestStyles.NODES_HIGHLIGHT_ADJACENT;
- return;
- }
- this.nodeStyle |= ZestStyles.NODES_HIGHLIGHT_ADJACENT;
- }
- */
+ * public void setHighlightAdjacentNodes(boolean highlightAdjacentNodes) {
+ * if (!highlightAdjacentNodes) { this.nodeStyle |=
+ * ZestStyles.NODES_HIGHLIGHT_ADJACENT; this.nodeStyle ^=
+ * ZestStyles.NODES_HIGHLIGHT_ADJACENT; return; } this.nodeStyle |=
+ * ZestStyles.NODES_HIGHLIGHT_ADJACENT; }
+ */
public Color getBorderColor() {
return borderColor;
@@ -580,7 +561,8 @@
/*
* (non-Javadoc)
*
- * @see org.eclipse.swt.widgets.Item#setImage(org.eclipse.swt.graphics.Image)
+ * @see
+ * org.eclipse.swt.widgets.Item#setImage(org.eclipse.swt.graphics.Image)
*/
public void setImage(Image image) {
super.setImage(image);
@@ -611,14 +593,16 @@
*/
public void setNodeStyle(int nodeStyle) {
this.nodeStyle = nodeStyle;
- this.cacheLabel = ((this.nodeStyle & ZestStyles.NODES_CACHE_LABEL) > 0) ? true : false;
+ this.cacheLabel = ((this.nodeStyle & ZestStyles.NODES_CACHE_LABEL) > 0)
+ ? true : false;
}
/*
* (non-Javadoc)
*
- * @see org.eclipse.mylar.zest.core.internal.graphmodel.IGraphModelNode#setSize(double,
- * double)
+ * @see
+ * org.eclipse.mylar.zest.core.internal.graphmodel.IGraphModelNode#setSize
+ * (double, double)
*/
public void setSize(double width, double height) {
if ((width != size.width) || (height != size.height)) {
@@ -631,7 +615,8 @@
/*
* (non-Javadoc)
*
- * @see org.eclipse.mylar.zest.core.internal.graphmodel.IGraphModelNode#getBorderHighlightColor()
+ * @see org.eclipse.mylar.zest.core.internal.graphmodel.IGraphModelNode#
+ * getBorderHighlightColor()
*/
public Color getBorderHighlightColor() {
return borderHighlightColor;
@@ -655,12 +640,14 @@
this.getFigure().setVisible(visible);
List sConnections = (this).getSourceConnections();
List tConnections = (this).getTargetConnections();
- for (Iterator iterator2 = sConnections.iterator(); iterator2.hasNext();) {
+ for (Iterator iterator2 = sConnections.iterator(); iterator2
+ .hasNext();) {
GraphConnection connection = (GraphConnection) iterator2.next();
connection.setVisible(visible);
}
- for (Iterator iterator2 = tConnections.iterator(); iterator2.hasNext();) {
+ for (Iterator iterator2 = tConnections.iterator(); iterator2
+ .hasNext();) {
GraphConnection connection = (GraphConnection) iterator2.next();
connection.setVisible(visible);
}
@@ -681,7 +668,7 @@
protected IFigure fishEye(boolean enable, boolean animate) {
if (isDisposed) {
// If a fisheyed figure is still left on the canvas, we could get
- // called once more after the dispose is called. Since we cleaned
+ // called once more after the dispose is called. Since we cleaned
// up everything on dispose, we can just return null here.
return null;
}
@@ -695,12 +682,14 @@
// Get the current Bounds
Rectangle rectangle = nodeFigure.getBounds().getCopy();
- FontData fontData = Display.getCurrent().getSystemFont().getFontData()[0];
+ FontData fontData = Display.getCurrent().getSystemFont()
+ .getFontData()[0];
fontData.setHeight(12);
fishEyeFont = new Font(Display.getCurrent(), fontData);
fishEyeFigure.setFont(fishEyeFont);
- // Calculate how much we have to expand the current bounds to get to the new bounds
+ // Calculate how much we have to expand the current bounds to get to
+ // the new bounds
Dimension newSize = fishEyeFigure.getPreferredSize();
Rectangle currentSize = rectangle.getCopy();
nodeFigure.translateToAbsolute(currentSize);
@@ -708,13 +697,15 @@
int expandedW = (newSize.width - currentSize.width) / 2 + 1;
Dimension expandAmount = new Dimension(expandedW, expandedH);
nodeFigure.translateToAbsolute(rectangle);
- rectangle.expand(new Insets(expandAmount.height, expandAmount.width, expandAmount.height, expandAmount.width));
+ rectangle.expand(new Insets(expandAmount.height, expandAmount.width,
+ expandAmount.height, expandAmount.width));
if (expandedH <= 0 && expandedW <= 0) {
return null;
}
- //Add the fisheye
- this.getGraphModel().fishEye(nodeFigure, fishEyeFigure, rectangle, true);
+ // Add the fisheye
+ this.getGraphModel().fishEye(nodeFigure, fishEyeFigure, rectangle,
+ true);
if (fishEyeFigure != null) {
isFisheyeEnabled = true;
}
@@ -722,7 +713,8 @@
} else {
// Remove the fisheye and dispose the font
- this.getGraphModel().removeFishEye(fishEyeFigure, nodeFigure, animate);
+ this.getGraphModel().removeFishEye(fishEyeFigure, nodeFigure,
+ animate);
if (fishEyeFont != null) {
this.fishEyeFont.dispose();
this.fishEyeFont = null;
@@ -796,7 +788,8 @@
protected IFigure createFigureForModel() {
GraphNode node = this;
boolean cacheLabel = (this).cacheLabel();
- GraphLabel label = new GraphLabel(node.getText(), node.getImage(), cacheLabel);
+ GraphLabel label = new GraphLabel(node.getText(), node.getImage(),
+ cacheLabel);
label.setFont(this.font);
if (checkStyle(ZestStyles.NODES_HIDE_TEXT)) {
label.setText("");
@@ -808,7 +801,8 @@
private IFigure createFishEyeFigure() {
GraphNode node = this;
boolean cacheLabel = this.cacheLabel();
- GraphLabel label = new GraphLabel(node.getText(), node.getImage(), cacheLabel);
+ GraphLabel label = new GraphLabel(node.getText(), node.getImage(),
+ cacheLabel);
if (!checkStyle(ZestStyles.NODES_HIDE_TEXT)) {
label.setText(this.getText());
diff --git a/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/widgets/internal/CachedLabel.java b/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/widgets/internal/CachedLabel.java
index 30b8ecc..5449b8e 100644
--- a/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/widgets/internal/CachedLabel.java
+++ b/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/widgets/internal/CachedLabel.java
@@ -65,8 +65,8 @@
* (non-Javadoc)
*
* @see
- * org.eclipse.draw2d.Figure#setForegroundColor(org.eclipse.swt.graphics
- * .Color)
+ * org.eclipse.draw2d.Figure#setForegroundColor(org.eclipse.swt.graphics.
+ * Color)
*/
public void setForegroundColor(Color fg) {
updateInvalidation();
@@ -77,8 +77,8 @@
* (non-Javadoc)
*
* @see
- * org.eclipse.draw2d.Figure#setBackgroundColor(org.eclipse.swt.graphics
- * .Color)
+ * org.eclipse.draw2d.Figure#setBackgroundColor(org.eclipse.swt.graphics.
+ * Color)
*/
public void setBackgroundColor(Color bg) {
updateInvalidation();
@@ -122,9 +122,8 @@
/*
* (non-Javadoc)
*
- * @see
- * org.eclipse.draw2d.Figure#setBounds(org.eclipse.draw2d.geometry.Rectangle
- * )
+ * @see org.eclipse.draw2d.Figure#setBounds(org.eclipse.draw2d.geometry.
+ * Rectangle)
*/
public void setBounds(Rectangle rect) {
boolean resize = (rect.width != bounds.width)
@@ -206,8 +205,7 @@
// @tag TODO : Dispose of the image properly
// ZestPlugin.getDefault().addImage(cachedImage.toString(),
// cachedImage);
- // UNSUPPORTED - image constructor not implemented in RAP
- // GC gc = new GC(cachedImage);
+
GC gc = new GC(cachedImage.getDevice());
Graphics graphics2 = new SWTGraphics(gc);
diff --git a/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/widgets/internal/PolylineArcConnection.java b/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/widgets/internal/PolylineArcConnection.java
index 5589a3c..9ced92b 100644
--- a/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/widgets/internal/PolylineArcConnection.java
+++ b/bundles/org.eclipse.rap.zest.core/src/org/eclipse/zest/core/widgets/internal/PolylineArcConnection.java
@@ -14,7 +14,7 @@
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.PointList;
-/*
+/**
* A connection that draws an arc between nodes, based on a given depth for the
* arc. This connection is drawn as an arc, defined as the circular arc with the
* chord (ax, ay) - (bx, by) (where a and b are the anchors) and a depth d
@@ -41,7 +41,9 @@
/*
* (non-Javadoc)
*
- * @see org.eclipse.draw2d.Polyline#setPoints(org.eclipse.draw2d.geometry.PointList)
+ * @see
+ * org.eclipse.draw2d.Polyline#setPoints(org.eclipse.draw2d.geometry.PointList
+ * )
*/
public void setPoints(PointList points) {
updateArc(points);
@@ -111,7 +113,8 @@
// the center of the chord
float cartChordX = (x2 + x1) / 2;
float cartChordY = (y2 + y1) / 2;
- float chordLength = (float) Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
+ float chordLength = (float) Math.sqrt((x1 - x2) * (x1 - x2)
+ + (y1 - y2) * (y1 - y2));
if (Math.abs(depth) >= chordLength / 2) {
depth = (chordLength / 3) * (depth / Math.abs(depth));
}
@@ -134,7 +137,8 @@
float th1;
if (Float.isNaN(chordNormal)) {
- cartCenterX = (y1 > y2) ? (cartChordX - r + (depth)) : (cartChordX + r - (depth));
+ cartCenterX = (y1 > y2) ? (cartChordX - r + (depth))
+ : (cartChordX + r - (depth));
cartCenterY = cartChordY;
th1 = PI / 2;
} else if (Float.isInfinite(chordNormal)) {
@@ -144,9 +148,11 @@
} else {
// assume that the center of the chord is on the origin.
th1 = (float) Math.atan(chordNormal);
- cartCenterX = (r - (depth)) * (float) Math.sin(th1) + cartChordX;// cartChordX+r
+ cartCenterX = (r - (depth)) * (float) Math.sin(th1)
+ + cartChordX;// cartChordX+r
// -depth;
- cartCenterY = (r - (depth)) * (float) Math.cos(th1) + cartChordY;// cartChordY+r-depth;
+ cartCenterY = (r - (depth)) * (float) Math.cos(th1)
+ + cartChordY;// cartChordY+r-depth;
}
// figure out the new angles
diff --git a/bundles/org.eclipse.rap.zest.layouts/.classpath b/bundles/org.eclipse.rap.zest.layouts/.classpath
index 6425d71..2fbb7a2 100644
--- a/bundles/org.eclipse.rap.zest.layouts/.classpath
+++ b/bundles/org.eclipse.rap.zest.layouts/.classpath
@@ -1,11 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4">
- <accessrules>
- <accessrule kind="discouraged" pattern="**/System/**"/>
- </accessrules>
- </classpathentry>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/bundles/org.eclipse.rap.zest.layouts/.refactorings/2015/12/1/refactorings.history b/bundles/org.eclipse.rap.zest.layouts/.refactorings/2015/12/1/refactorings.history
new file mode 100644
index 0000000..4b8537b
--- /dev/null
+++ b/bundles/org.eclipse.rap.zest.layouts/.refactorings/2015/12/1/refactorings.history
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<session version="1.0">
+<refactoring accessors="true" comment="Delete element from project 'org.eclipse.rap.zest.layouts'
- Original project: 'org.eclipse.rap.zest.layouts'
- Original element: '.api_filters'" description="Delete element" element1=".settings/.api_filters" elements="0" flags="589830" id="org.eclipse.jdt.ui.delete" resources="1" stamp="1451308265833" subPackages="false" version="1.0"/>
+</session>
\ No newline at end of file
diff --git a/bundles/org.eclipse.rap.zest.layouts/.refactorings/2015/12/1/refactorings.index b/bundles/org.eclipse.rap.zest.layouts/.refactorings/2015/12/1/refactorings.index
new file mode 100644
index 0000000..ee2ed7e
--- /dev/null
+++ b/bundles/org.eclipse.rap.zest.layouts/.refactorings/2015/12/1/refactorings.index
@@ -0,0 +1 @@
+1451308265833 Delete element
diff --git a/bundles/org.eclipse.rap.zest.layouts/.settings/.api_filters b/bundles/org.eclipse.rap.zest.layouts/.settings/.api_filters
deleted file mode 100644
index 4e85620..0000000
--- a/bundles/org.eclipse.rap.zest.layouts/.settings/.api_filters
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><component id="org.eclipse.zest.layouts" version="2">
- <resource path="META-INF/MANIFEST.MF" type="org.eclipse.swt.browser.WebKit">
- <filter id="305426566">
- <message_arguments>
- <message_argument value="org.eclipse.swt.browser.WebKit"/>
- <message_argument value="org.eclipse.zest.layouts_1.1.0"/>
- </message_arguments>
- </filter>
- </resource>
-</component>
\ No newline at end of file
diff --git a/bundles/org.eclipse.rap.zest.layouts/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.rap.zest.layouts/.settings/org.eclipse.jdt.core.prefs
index 2809ca2..a5170fb 100644
--- a/bundles/org.eclipse.rap.zest.layouts/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.rap.zest.layouts/.settings/org.eclipse.jdt.core.prefs
@@ -1,4 +1,4 @@
-#Thu Dec 09 15:46:14 PST 2010
+#Sun Nov 27 13:31:26 CET 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
@@ -135,12 +135,11 @@
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
org.eclipse.jdt.core.formatter.indentation.size=4
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
diff --git a/bundles/org.eclipse.rap.zest.layouts/.settings/org.eclipse.pde.api.tools.prefs b/bundles/org.eclipse.rap.zest.layouts/.settings/org.eclipse.pde.api.tools.prefs
index b261c3d..6bd0f2a 100644
--- a/bundles/org.eclipse.rap.zest.layouts/.settings/org.eclipse.pde.api.tools.prefs
+++ b/bundles/org.eclipse.rap.zest.layouts/.settings/org.eclipse.pde.api.tools.prefs
@@ -1,5 +1,86 @@
-#Thu Jan 26 12:04:24 CST 2012
+#Wed Oct 15 15:09:30 EDT 2008
+ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error
+ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error
+CLASS_ELEMENT_TYPE_ADDED_METHOD=Error
+CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
+CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
CLASS_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error
+CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error
+CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error
+CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error
+CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error
+CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
+CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error
+ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error
+ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error
+ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+FIELD_ELEMENT_TYPE_ADDED_VALUE=Error
+FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error
+FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
+FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
+FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error
+FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error
+FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error
+FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error
+ILLEGAL_EXTEND=Error
+ILLEGAL_IMPLEMENT=Error
+ILLEGAL_INSTANTIATE=Error
+ILLEGAL_OVERRIDE=Error
+ILLEGAL_REFERENCE=Error
+INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Error
+INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error
+INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
INTERFACE_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error
+INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+INVALID_JAVADOC_TAG=Error
+LEAK_EXTEND=Error
+LEAK_FIELD_DECL=Error
+LEAK_IMPLEMENT=Error
+LEAK_METHOD_PARAM=Error
+LEAK_METHOD_RETURN_TYPE=Error
+METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
METHOD_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error
+METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
+METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
+METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error
+METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error
eclipse.preferences.version=1
+incompatible_api_component_version=Error
+incompatible_api_component_version_include_major_without_breaking_change=Disabled
+incompatible_api_component_version_include_minor_without_api_change=Disabled
+invalid_since_tag_version=Error
+malformed_since_tag=Error
+missing_since_tag=Error
diff --git a/bundles/org.eclipse.rap.zest.layouts/plugin.properties b/bundles/org.eclipse.rap.zest.layouts/plugin.properties
index 76ef68d..1b2fff0 100644
--- a/bundles/org.eclipse.rap.zest.layouts/plugin.properties
+++ b/bundles/org.eclipse.rap.zest.layouts/plugin.properties
@@ -8,5 +8,5 @@
# Contributors:
# IBM Corporation - initial API and implementation
###############################################################################
-Plugin.name=Graphical Editing Framework Zest Layouts
-Plugin.providerName = Eclipse Modeling Project
+Plugin.name=Zest Layouts
+Plugin.providerName=Eclipse GEF
diff --git a/bundles/org.eclipse.rap.zest.layouts/readme.txt b/bundles/org.eclipse.rap.zest.layouts/readme.txt
index c45857f..ed3c009 100644
--- a/bundles/org.eclipse.rap.zest.layouts/readme.txt
+++ b/bundles/org.eclipse.rap.zest.layouts/readme.txt
@@ -1 +1 @@
-The source version of this port is: 1.1.200.qualifier
\ No newline at end of file
+The source version of this port is: 1.1.300.qualifier
\ No newline at end of file
diff --git a/tests/org.eclipse.gef.test/plugin.properties b/tests/org.eclipse.gef.test/plugin.properties
index 1e0c0f2..509f364 100644
--- a/tests/org.eclipse.gef.test/plugin.properties
+++ b/tests/org.eclipse.gef.test/plugin.properties
@@ -9,4 +9,4 @@
# IBM Corporation - initial API and implementation
###############################################################################
Plugin.name=Graphical Editing Framework GEF Tests
-Plugin.providerName=Eclipse.org
+Plugin.providerName=Eclipse GEF
diff --git a/tests/org.eclipse.gef.test/src/org/eclipse/gef/test/CommandStackTest.java b/tests/org.eclipse.gef.test/src/org/eclipse/gef/test/CommandStackTest.java
new file mode 100644
index 0000000..f5ba733
--- /dev/null
+++ b/tests/org.eclipse.gef.test/src/org/eclipse/gef/test/CommandStackTest.java
@@ -0,0 +1,231 @@
+package org.eclipse.gef.test;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.CommandStack;
+import org.eclipse.gef.commands.CommandStackEvent;
+import org.eclipse.gef.commands.CommandStackEventListener;
+import org.junit.Assert;
+
+import junit.framework.TestCase;
+
+public class CommandStackTest extends TestCase {
+
+ public void testCommandStackEventListenerNotifications() {
+ final List commandStackEvents = new ArrayList();
+
+ // capture all notifications in an event list
+ CommandStack stack = new CommandStack();
+ stack.addCommandStackEventListener(new CommandStackEventListener() {
+ public void stackChanged(CommandStackEvent event) {
+ commandStackEvents.add(event);
+ }
+ });
+
+ Command c = new Command() {
+ };
+
+ // test execution pre and post events
+ Assert.assertEquals(0, commandStackEvents.size());
+ stack.execute(c);
+
+ Assert.assertEquals(2, commandStackEvents.size());
+ Assert.assertEquals(c,
+ ((CommandStackEvent) commandStackEvents.get(0)).getCommand());
+ Assert.assertTrue(((CommandStackEvent) commandStackEvents.get(0))
+ .isPreChangeEvent());
+ Assert.assertFalse(((CommandStackEvent) commandStackEvents.get(0))
+ .isPostChangeEvent());
+ Assert.assertEquals(stack,
+ ((CommandStackEvent) commandStackEvents.get(0)).getSource());
+ Assert.assertEquals(CommandStack.PRE_EXECUTE,
+ ((CommandStackEvent) commandStackEvents.get(0)).getDetail());
+ Assert.assertNotEquals(0,
+ ((CommandStackEvent) commandStackEvents.get(0)).getDetail()
+ & CommandStack.PRE_MASK);
+ Assert.assertEquals(0,
+ ((CommandStackEvent) commandStackEvents.get(0)).getDetail()
+ & CommandStack.POST_MASK);
+
+ Assert.assertEquals(c,
+ ((CommandStackEvent) commandStackEvents.get(1)).getCommand());
+ Assert.assertFalse(((CommandStackEvent) commandStackEvents.get(1))
+ .isPreChangeEvent());
+ Assert.assertTrue(((CommandStackEvent) commandStackEvents.get(1))
+ .isPostChangeEvent());
+ Assert.assertEquals(stack,
+ ((CommandStackEvent) commandStackEvents.get(1)).getSource());
+ Assert.assertEquals(CommandStack.POST_EXECUTE,
+ ((CommandStackEvent) commandStackEvents.get(1)).getDetail());
+ Assert.assertEquals(0,
+ ((CommandStackEvent) commandStackEvents.get(1)).getDetail()
+ & CommandStack.PRE_MASK);
+ Assert.assertNotEquals(0,
+ ((CommandStackEvent) commandStackEvents.get(1)).getDetail()
+ & CommandStack.POST_MASK);
+
+ // // test undo pre and post events
+ commandStackEvents.clear();
+ Assert.assertEquals(0, commandStackEvents.size());
+ stack.undo();
+
+ Assert.assertEquals(2, commandStackEvents.size());
+ Assert.assertEquals(c,
+ ((CommandStackEvent) commandStackEvents.get(0)).getCommand());
+ Assert.assertTrue(((CommandStackEvent) commandStackEvents.get(0))
+ .isPreChangeEvent());
+ Assert.assertFalse(((CommandStackEvent) commandStackEvents.get(0))
+ .isPostChangeEvent());
+ Assert.assertEquals(stack,
+ ((CommandStackEvent) commandStackEvents.get(0)).getSource());
+ Assert.assertEquals(CommandStack.PRE_UNDO,
+ ((CommandStackEvent) commandStackEvents.get(0)).getDetail());
+ Assert.assertNotEquals(0,
+ ((CommandStackEvent) commandStackEvents.get(0)).getDetail()
+ & CommandStack.PRE_MASK);
+ Assert.assertEquals(0,
+ ((CommandStackEvent) commandStackEvents.get(0)).getDetail()
+ & CommandStack.POST_MASK);
+
+ Assert.assertEquals(c,
+ ((CommandStackEvent) commandStackEvents.get(1)).getCommand());
+ Assert.assertFalse(((CommandStackEvent) commandStackEvents.get(1))
+ .isPreChangeEvent());
+ Assert.assertTrue(((CommandStackEvent) commandStackEvents.get(1))
+ .isPostChangeEvent());
+ Assert.assertEquals(stack,
+ ((CommandStackEvent) commandStackEvents.get(1)).getSource());
+ Assert.assertEquals(CommandStack.POST_UNDO,
+ ((CommandStackEvent) commandStackEvents.get(1)).getDetail());
+ Assert.assertEquals(0,
+ ((CommandStackEvent) commandStackEvents.get(1)).getDetail()
+ & CommandStack.PRE_MASK);
+ Assert.assertNotEquals(0,
+ ((CommandStackEvent) commandStackEvents.get(1)).getDetail()
+ & CommandStack.POST_MASK);
+
+ // // test redo pre and post events
+ commandStackEvents.clear();
+ Assert.assertEquals(0, commandStackEvents.size());
+ stack.redo();
+
+ Assert.assertEquals(2, commandStackEvents.size());
+ Assert.assertEquals(c,
+ ((CommandStackEvent) commandStackEvents.get(0)).getCommand());
+ Assert.assertTrue(((CommandStackEvent) commandStackEvents.get(0))
+ .isPreChangeEvent());
+ Assert.assertFalse(((CommandStackEvent) commandStackEvents.get(0))
+ .isPostChangeEvent());
+ Assert.assertEquals(stack,
+ ((CommandStackEvent) commandStackEvents.get(0)).getSource());
+ Assert.assertEquals(CommandStack.PRE_REDO,
+ ((CommandStackEvent) commandStackEvents.get(0)).getDetail());
+ Assert.assertNotEquals(0,
+ ((CommandStackEvent) commandStackEvents.get(0)).getDetail()
+ & CommandStack.PRE_MASK);
+ Assert.assertEquals(0,
+ ((CommandStackEvent) commandStackEvents.get(0)).getDetail()
+ & CommandStack.POST_MASK);
+
+ Assert.assertEquals(c,
+ ((CommandStackEvent) commandStackEvents.get(1)).getCommand());
+ Assert.assertFalse(((CommandStackEvent) commandStackEvents.get(1))
+ .isPreChangeEvent());
+ Assert.assertTrue(((CommandStackEvent) commandStackEvents.get(1))
+ .isPostChangeEvent());
+ Assert.assertEquals(stack,
+ ((CommandStackEvent) commandStackEvents.get(1)).getSource());
+ Assert.assertEquals(CommandStack.POST_REDO,
+ ((CommandStackEvent) commandStackEvents.get(1)).getDetail());
+ Assert.assertEquals(0,
+ ((CommandStackEvent) commandStackEvents.get(1)).getDetail()
+ & CommandStack.PRE_MASK);
+ Assert.assertNotEquals(0,
+ ((CommandStackEvent) commandStackEvents.get(1)).getDetail()
+ & CommandStack.POST_MASK);
+
+ // test flush event
+ commandStackEvents.clear();
+ Assert.assertEquals(0, commandStackEvents.size());
+ stack.flush();
+
+ Assert.assertEquals(2, commandStackEvents.size());
+ Assert.assertEquals(null,
+ ((CommandStackEvent) commandStackEvents.get(0)).getCommand());
+ Assert.assertTrue(((CommandStackEvent) commandStackEvents.get(0))
+ .isPreChangeEvent());
+ Assert.assertFalse(((CommandStackEvent) commandStackEvents.get(0))
+ .isPostChangeEvent());
+ Assert.assertEquals(stack,
+ ((CommandStackEvent) commandStackEvents.get(0)).getSource());
+ // Assert.assertEquals(CommandStack.PRE_FLUSH,
+ // ((CommandStackEvent) commandStackEvents.get(0)).getDetail());
+ Assert.assertNotEquals(0,
+ ((CommandStackEvent) commandStackEvents.get(0)).getDetail()
+ & CommandStack.PRE_MASK);
+ Assert.assertEquals(0,
+ ((CommandStackEvent) commandStackEvents.get(0)).getDetail()
+ & CommandStack.POST_MASK);
+
+ Assert.assertEquals(null,
+ ((CommandStackEvent) commandStackEvents.get(1)).getCommand());
+ Assert.assertFalse(((CommandStackEvent) commandStackEvents.get(1))
+ .isPreChangeEvent());
+ Assert.assertTrue(((CommandStackEvent) commandStackEvents.get(1))
+ .isPostChangeEvent());
+ Assert.assertEquals(stack,
+ ((CommandStackEvent) commandStackEvents.get(1)).getSource());
+ // Assert.assertEquals(CommandStack.POST_FLUSH,
+ // ((CommandStackEvent) commandStackEvents.get(1)).getDetail());
+ Assert.assertEquals(0,
+ ((CommandStackEvent) commandStackEvents.get(1)).getDetail()
+ & CommandStack.PRE_MASK);
+ Assert.assertNotEquals(0,
+ ((CommandStackEvent) commandStackEvents.get(1)).getDetail()
+ & CommandStack.POST_MASK);
+
+ // test mark save location event
+ commandStackEvents.clear();
+ Assert.assertEquals(0, commandStackEvents.size());
+ stack.redo();
+ stack.markSaveLocation();
+
+ Assert.assertEquals(2, commandStackEvents.size());
+ Assert.assertEquals(null,
+ ((CommandStackEvent) commandStackEvents.get(0)).getCommand());
+ Assert.assertTrue(((CommandStackEvent) commandStackEvents.get(0))
+ .isPreChangeEvent());
+ Assert.assertFalse(((CommandStackEvent) commandStackEvents.get(0))
+ .isPostChangeEvent());
+ Assert.assertEquals(stack,
+ ((CommandStackEvent) commandStackEvents.get(0)).getSource());
+ // Assert.assertEquals(CommandStack.PRE_MARK_SAVE,
+ // ((CommandStackEvent) commandStackEvents.get(0)).getDetail());
+ Assert.assertNotEquals(0,
+ ((CommandStackEvent) commandStackEvents.get(0)).getDetail()
+ & CommandStack.PRE_MASK);
+ Assert.assertEquals(0,
+ ((CommandStackEvent) commandStackEvents.get(0)).getDetail()
+ & CommandStack.POST_MASK);
+
+ Assert.assertEquals(null,
+ ((CommandStackEvent) commandStackEvents.get(1)).getCommand());
+ Assert.assertFalse(((CommandStackEvent) commandStackEvents.get(1))
+ .isPreChangeEvent());
+ Assert.assertTrue(((CommandStackEvent) commandStackEvents.get(1))
+ .isPostChangeEvent());
+ Assert.assertEquals(stack,
+ ((CommandStackEvent) commandStackEvents.get(1)).getSource());
+ // Assert.assertEquals(CommandStack.POST_MARK_SAVE,
+ // ((CommandStackEvent) commandStackEvents.get(1)).getDetail());
+ Assert.assertEquals(0,
+ ((CommandStackEvent) commandStackEvents.get(1)).getDetail()
+ & CommandStack.PRE_MASK);
+ Assert.assertNotEquals(0,
+ ((CommandStackEvent) commandStackEvents.get(1)).getDetail()
+ & CommandStack.POST_MASK);
+
+ }
+}
diff --git a/tests/org.eclipse.zest.tests/.refactorings/2015/12/52/refactorings.history b/tests/org.eclipse.zest.tests/.refactorings/2015/12/52/refactorings.history
new file mode 100644
index 0000000..bebbaf4
--- /dev/null
+++ b/tests/org.eclipse.zest.tests/.refactorings/2015/12/52/refactorings.history
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<session version="1.0">
<refactoring accessors="true" comment="Delete element from project 'org.eclipse.rap.zest.test'
- Original project: 'org.eclipse.rap.zest.test'
- Original element: 'icons'" description="Delete element" element1="icons" elements="0" flags="589830" id="org.eclipse.jdt.ui.delete" resources="1" stamp="1450980339690" subPackages="false" version="1.0"/>
<refactoring accessors="true" comment="Delete 3 elements from project 'org.eclipse.rap.zest.test'
- Original project: 'org.eclipse.rap.zest.test'
- Original elements:
 org.eclipse.rap.zest.test/src/org.eclipse.zest.tests.jface
 org.eclipse.rap.zest.test/src/org.eclipse.zest.tests.swt
 org.eclipse.rap.zest.test/src/org.eclipse.zest.tests.uml" description="Delete elements" element1="/src<org.eclipse.zest.tests.uml" element2="/src<org.eclipse.zest.tests.swt" element3="/src<org.eclipse.zest.tests.jface" elements="3" flags="589830" id="org.eclipse.jdt.ui.delete" resources="0" stamp="1450980349608" subPackages="false" version="1.0"/>
<refactoring accessors="true" comment="Delete 3 elements from project 'org.eclipse.rap.zest.test'
- Original project: 'org.eclipse.rap.zest.test'
- Original elements:
 test.xml
 zx.png
 zxsnow.png" description="Delete elements" element1="zxsnow.png" element2="test.xml" element3="zx.png" elements="0" flags="589830" id="org.eclipse.jdt.ui.delete" resources="3" stamp="1450980376056" subPackages="false" version="1.0"/>
<refactoring accessors="true" comment="Delete element from project 'org.eclipse.rap.zest.test'
- Original project: 'org.eclipse.rap.zest.test'
- Original element: 'ibull.jpg'" description="Delete element" element1="ibull.jpg" elements="0" flags="589830" id="org.eclipse.jdt.ui.delete" resources="1" stamp="1450980383432" subPackages="false" version="1.0"/>
+</session>
\ No newline at end of file
diff --git a/tests/org.eclipse.zest.tests/.refactorings/2015/12/52/refactorings.index b/tests/org.eclipse.zest.tests/.refactorings/2015/12/52/refactorings.index
new file mode 100644
index 0000000..caac959
--- /dev/null
+++ b/tests/org.eclipse.zest.tests/.refactorings/2015/12/52/refactorings.index
@@ -0,0 +1,4 @@
+1450980339690 Delete element
+1450980349608 Delete elements
+1450980376056 Delete elements
+1450980383432 Delete element
diff --git a/tests/org.eclipse.zest.tests/build.properties b/tests/org.eclipse.zest.tests/build.properties
index 01360dd..4a0003d 100644
--- a/tests/org.eclipse.zest.tests/build.properties
+++ b/tests/org.eclipse.zest.tests/build.properties
@@ -9,7 +9,6 @@
# IBM Corporation - initial API and implementation
###############################################################################
bin.includes = plugin.*,\
- test.xml,\
.,\
META-INF/
jars.compile.order = .
diff --git a/tests/org.eclipse.zest.tests/ibull.jpg b/tests/org.eclipse.zest.tests/ibull.jpg
deleted file mode 100644
index 6f039fa..0000000
--- a/tests/org.eclipse.zest.tests/ibull.jpg
+++ /dev/null
Binary files differ
diff --git a/tests/org.eclipse.zest.tests/icons/nest.gif b/tests/org.eclipse.zest.tests/icons/nest.gif
deleted file mode 100644
index 83a71cb..0000000
--- a/tests/org.eclipse.zest.tests/icons/nest.gif
+++ /dev/null
Binary files differ
diff --git a/tests/org.eclipse.zest.tests/icons/sample.gif b/tests/org.eclipse.zest.tests/icons/sample.gif
deleted file mode 100644
index 34fb3c9..0000000
--- a/tests/org.eclipse.zest.tests/icons/sample.gif
+++ /dev/null
Binary files differ
diff --git a/tests/org.eclipse.zest.tests/icons/static.gif b/tests/org.eclipse.zest.tests/icons/static.gif
deleted file mode 100644
index ac98755..0000000
--- a/tests/org.eclipse.zest.tests/icons/static.gif
+++ /dev/null
Binary files differ
diff --git a/tests/org.eclipse.zest.tests/icons/timeline.gif b/tests/org.eclipse.zest.tests/icons/timeline.gif
deleted file mode 100644
index aaab92b..0000000
--- a/tests/org.eclipse.zest.tests/icons/timeline.gif
+++ /dev/null
Binary files differ
diff --git a/tests/org.eclipse.zest.tests/icons/zest.gif b/tests/org.eclipse.zest.tests/icons/zest.gif
deleted file mode 100644
index 4e4079c..0000000
--- a/tests/org.eclipse.zest.tests/icons/zest.gif
+++ /dev/null
Binary files differ
diff --git a/tests/org.eclipse.zest.tests/icons/zest1.jpg b/tests/org.eclipse.zest.tests/icons/zest1.jpg
deleted file mode 100644
index 7620327..0000000
--- a/tests/org.eclipse.zest.tests/icons/zest1.jpg
+++ /dev/null
Binary files differ
diff --git a/tests/org.eclipse.zest.tests/icons/zest2.gif b/tests/org.eclipse.zest.tests/icons/zest2.gif
deleted file mode 100644
index 57030db..0000000
--- a/tests/org.eclipse.zest.tests/icons/zest2.gif
+++ /dev/null
Binary files differ
diff --git a/tests/org.eclipse.zest.tests/icons/zest_128x128.jpg b/tests/org.eclipse.zest.tests/icons/zest_128x128.jpg
deleted file mode 100644
index 5a6a362..0000000
--- a/tests/org.eclipse.zest.tests/icons/zest_128x128.jpg
+++ /dev/null
Binary files differ
diff --git a/tests/org.eclipse.zest.tests/icons/zest_large.jpg b/tests/org.eclipse.zest.tests/icons/zest_large.jpg
deleted file mode 100644
index 98c3057..0000000
--- a/tests/org.eclipse.zest.tests/icons/zest_large.jpg
+++ /dev/null
Binary files differ
diff --git a/tests/org.eclipse.zest.tests/plugin.properties b/tests/org.eclipse.zest.tests/plugin.properties
index ae26505..b583173 100644
--- a/tests/org.eclipse.zest.tests/plugin.properties
+++ b/tests/org.eclipse.zest.tests/plugin.properties
@@ -9,4 +9,4 @@
# IBM Corporation - initial API and implementation
###############################################################################
Plugin.name=Graphical Editing Framework Zest Tests
-Plugin.providerName=Eclipse.org
+Plugin.providerName=Eclipse GEF
diff --git a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/jface/GraphJFaceSnippet1.java b/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/jface/GraphJFaceSnippet1.java
deleted file mode 100644
index 130ba83..0000000
--- a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/jface/GraphJFaceSnippet1.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * Copyright 2005-2007, CHISEL Group, University of Victoria, Victoria, BC, Canada.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * The Chisel Group, University of Victoria
- *******************************************************************************/
-package org.eclipse.zest.tests.jface;
-
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.zest.layouts.LayoutStyles;
-import org.eclipse.zest.layouts.algorithms.SpringLayoutAlgorithm;
-import org.eclipse.zest.core.viewers.GraphViewer;
-import org.eclipse.zest.core.viewers.IGraphEntityContentProvider;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * This snippet shows how to use the IGraphEntityContentProvider to build a graph.
- * @author Ian Bull
- *
- */
-public class GraphJFaceSnippet1 {
-
- /**
- * The Content Provider
- * @author irbull
- *
- */
- static class MyContentProvider implements IGraphEntityContentProvider {
-
- public Object[] getConnectedTo(Object entity) {
- if (entity.equals("First")) {
- return new Object[] { "Second" };
- }
- if (entity.equals("Second")) {
- return new Object[] { "Third" };
- }
- if (entity.equals("Third")) {
- return new Object[] { "First" };
- }
- return null;
- }
-
- public Object[] getElements(Object inputElement) {
- return new String[] { "First", "Second", "Third" };
- }
-
- public double getWeight(Object entity1, Object entity2) {
- return 0;
- }
-
- public void dispose() {
-
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-
- }
- }
-
- static class MyLabelProvider extends LabelProvider {
- final Image image = Display.getDefault().getSystemImage(SWT.ICON_WARNING);
-
- public Image getImage(Object element) {
- if (element instanceof String) {
- return image;
- }
- return null;
- }
-
- public String getText(Object element) {
- if (element instanceof String) {
- return element.toString();
- }
- return null;
- }
-
- }
-
- static GraphViewer viewer = null;
-
- /**
- * @param args
- */
- public static void main(String[] args) {
- Display d = new Display();
- Shell shell = new Shell(d);
- shell.setLayout(new FillLayout(SWT.VERTICAL));
- shell.setSize(400, 400);
- Button button = new Button(shell, SWT.PUSH);
- button.setText("Reload");
- button.addSelectionListener(new SelectionAdapter() {
-
- public void widgetSelected(SelectionEvent e) {
- viewer.setInput(new Object());
- }
-
- });
- viewer = new GraphViewer(shell, SWT.NONE);
-
- viewer.setContentProvider(new MyContentProvider());
- viewer.setLabelProvider(new MyLabelProvider());
- viewer.setLayoutAlgorithm(new SpringLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING));
- viewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- System.out.println("Selection changed: " + (event.getSelection()));
- }
-
- });
- viewer.setInput(new Object());
-
- shell.open();
- while (!shell.isDisposed()) {
- while (!d.readAndDispatch()) {
- d.sleep();
- }
- }
-
- }
-}
diff --git a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/jface/GraphJFaceSnippet2.java b/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/jface/GraphJFaceSnippet2.java
deleted file mode 100644
index 73dd273..0000000
--- a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/jface/GraphJFaceSnippet2.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright 2005-2007, CHISEL Group, University of Victoria, Victoria, BC,
- * Canada. All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: The Chisel Group, University of Victoria
- ******************************************************************************/
-package org.eclipse.zest.tests.jface;
-
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.zest.layouts.LayoutStyles;
-import org.eclipse.zest.layouts.algorithms.SpringLayoutAlgorithm;
-import org.eclipse.zest.core.viewers.GraphViewer;
-import org.eclipse.zest.core.viewers.IGraphContentProvider;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * This snippet shows how to use the IGraphContentProvider to create a graph with Zest.
- * In this example, getElements returns 3 edges:
- * * Rock2Paper
- * * Paper2Scissors
- * * Scissors2Rock
- *
- * And for each of these, the source and destination are returned in getSource and getDestination.
- *
- * A label provider is also used to create the text and icons for the graph.
- *
- * @author Ian Bull
- *
- */
-public class GraphJFaceSnippet2 {
-
- static class MyContentProvider implements IGraphContentProvider {
-
- public Object getDestination(Object rel) {
- if ("Rock2Paper".equals(rel)) {
- return "Rock";
- } else if ("Paper2Scissors".equals(rel)) {
- return "Paper";
- } else if ("Scissors2Rock".equals(rel)) {
- return "Scissors";
- }
- return null;
- }
-
- public Object[] getElements(Object input) {
- return new Object[] { "Rock2Paper", "Paper2Scissors", "Scissors2Rock" };
- }
-
- public Object getSource(Object rel) {
- if ("Rock2Paper".equals(rel)) {
- return "Paper";
- } else if ("Paper2Scissors".equals(rel)) {
- return "Scissors";
- } else if ("Scissors2Rock".equals(rel)) {
- return "Rock";
- }
- return null;
- }
-
- public double getWeight(Object connection) {
- return 0;
- }
-
- public void dispose() {
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
-
- }
-
- static class MyLabelProvider extends LabelProvider {
- final Image image = Display.getDefault().getSystemImage(SWT.ICON_WARNING);
-
- public Image getImage(Object element) {
- if (element.equals("Rock") || element.equals("Paper") || element.equals("Scissors")) {
- return image;
- }
- return null;
- }
-
- public String getText(Object element) {
- return element.toString();
- }
-
- }
-
- static GraphViewer viewer = null;
-
- /**
- * @param args
- */
- public static void main(String[] args) {
- Display d = new Display();
- Shell shell = new Shell(d);
- shell.setText("GraphJFaceSnippet2");
- shell.setLayout(new FillLayout(SWT.VERTICAL));
- shell.setSize(400, 400);
- viewer = new GraphViewer(shell, SWT.NONE);
- viewer.setContentProvider(new MyContentProvider());
- viewer.setLabelProvider(new MyLabelProvider());
- viewer.setLayoutAlgorithm(new SpringLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING));
- viewer.setInput(new Object());
- shell.open();
- while (!shell.isDisposed()) {
- while (!d.readAndDispatch()) {
- d.sleep();
- }
- }
-
- }
-}
diff --git a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/jface/GraphJFaceSnippet4.java b/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/jface/GraphJFaceSnippet4.java
deleted file mode 100644
index 8fb2d08..0000000
--- a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/jface/GraphJFaceSnippet4.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * Copyright 2005-2007, CHISEL Group, University of Victoria, Victoria, BC,
- * Canada. All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: The Chisel Group, University of Victoria
- ******************************************************************************/
-package org.eclipse.zest.tests.jface;
-
-import java.util.Iterator;
-
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.zest.layouts.LayoutStyles;
-import org.eclipse.zest.layouts.algorithms.SpringLayoutAlgorithm;
-import org.eclipse.zest.core.viewers.GraphViewer;
-import org.eclipse.zest.core.viewers.IGraphContentProvider;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-public class GraphJFaceSnippet4 {
- static class MyContentProvider implements IGraphContentProvider {
-
- public Object getDestination(Object rel) {
- if ("Rock2Paper".equals(rel)) {
- return "Rock";
- } else if ("Paper2Scissors".equals(rel)) {
- return "Paper";
- } else if ("Scissors2Rock".equals(rel)) {
- return "Scissors";
- }
- return null;
- }
-
- public Object[] getElements(Object input) {
- return new Object[] { "Rock2Paper", "Paper2Scissors", "Scissors2Rock" };
- }
-
- public Object getSource(Object rel) {
- if ("Rock2Paper".equals(rel)) {
- return "Paper";
- } else if ("Paper2Scissors".equals(rel)) {
- return "Scissors";
- } else if ("Scissors2Rock".equals(rel)) {
- return "Rock";
- }
- return null;
- }
-
- public double getWeight(Object connection) {
- return 0;
- }
-
- public void dispose() {
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
-
- }
-
- static class MyLabelProvider extends LabelProvider {
- final Image image = Display.getDefault().getSystemImage(SWT.ICON_WARNING);
-
- public Image getImage(Object element) {
- if (element.equals("Rock") || element.equals("Paper") || element.equals("Scissors")) {
- return image;
- }
- return null;
- }
-
- public String getText(Object element) {
- return element.toString();
- }
-
- }
-
- static GraphViewer viewer = null;
-
- /**
- * @param args
- */
- public static void main(String[] args) {
- Display d = new Display();
- Shell shell = new Shell(d);
- shell.setText("GraphJFaceSnippet2");
- shell.setLayout(new FillLayout(SWT.VERTICAL));
- shell.setSize(400, 400);
- viewer = new GraphViewer(shell, SWT.NONE);
- viewer.setContentProvider(new MyContentProvider());
- viewer.setLabelProvider(new MyLabelProvider());
- viewer.setLayoutAlgorithm(new SpringLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING));
- viewer.setInput(new Object());
- viewer.addSelectionChangedListener(new ISelectionChangedListener() {
-
- public void selectionChanged(SelectionChangedEvent event) {
- System.out.println("Selection Changed: " + selectionToString((StructuredSelection) event.getSelection()));
- }
-
- private String selectionToString(StructuredSelection selection) {
- StringBuffer stringBuffer = new StringBuffer();
- Iterator iterator = selection.iterator();
- boolean first = true;
- while (iterator.hasNext()) {
- if (first) {
- first = false;
- } else {
- stringBuffer.append(" : ");
- }
- stringBuffer.append(iterator.next());
- }
- return stringBuffer.toString();
- }
-
- });
- shell.open();
- while (!shell.isDisposed()) {
- while (!d.readAndDispatch()) {
- d.sleep();
- }
- }
-
- }
-
-}
diff --git a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/jface/GraphJFaceSnippet5.java b/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/jface/GraphJFaceSnippet5.java
deleted file mode 100644
index 24c1110..0000000
--- a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/jface/GraphJFaceSnippet5.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*******************************************************************************
- * Copyright 2005-2007, CHISEL Group, University of Victoria, Victoria, BC,
- * Canada. All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: The Chisel Group, University of Victoria
- ******************************************************************************/
-package org.eclipse.zest.tests.jface;
-
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.zest.layouts.algorithms.SpringLayoutAlgorithm;
-import org.eclipse.zest.core.viewers.GraphViewer;
-import org.eclipse.zest.core.viewers.IGraphContentProvider;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * This snippet shows how the refresh works on a Zest viewer.
- */
-public class GraphJFaceSnippet5 {
-
- static class MyContentProvider implements IGraphContentProvider {
-
- Object[] elements = new Object[] { "Rock2Paper", "Paper2Scissors", "Scissors2Rock" };
-
- public Object getDestination(Object rel) {
- if ("Rock2Paper".equals(rel)) {
- return "Rock";
- } else if ("Paper2Scissors".equals(rel) || "Scissors2Paper".equals(rel)) {
- return "Paper";
- } else if ("Scissors2Rock".equals(rel)) {
- return "Scissors";
- }
- return null;
- }
-
- public Object[] getElements(Object input) {
- return elements;
- }
-
- public Object getSource(Object rel) {
- if ("Rock2Paper".equals(rel)) {
- return "Paper";
- } else if ("Paper2Scissors".equals(rel) || "Scissors2Paper".equals(rel)) {
- return "Scissors";
- } else if ("Scissors2Rock".equals(rel)) {
- return "Rock";
- }
- return null;
- }
-
- public void setElements(Object[] elements) {
- this.elements = elements;
- }
-
- public double getWeight(Object connection) {
- return 0;
- }
-
- public void dispose() {
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
-
- }
-
- static class MyLabelProvider extends LabelProvider {
- final Image image = Display.getDefault().getSystemImage(SWT.ICON_WARNING);
-
- public MyLabelProvider() {
-
- }
-
- public String getText(Object element) {
- return element.toString();
- }
-
- public Image getImage(Object element) {
- return image;
- }
- }
-
- static GraphViewer viewer = null;
- private static MyContentProvider contentProvider;
-
- /**
- * @param args
- */
- public static void main(String[] args) {
- Display d = new Display();
- Shell shell = new Shell(d);
- shell.setText("GraphJFaceSnippet2");
- shell.setLayout(new FillLayout(SWT.VERTICAL));
- shell.setSize(400, 400);
- Composite parent = new Composite(shell, SWT.NONE);
- parent.setLayout(new GridLayout(2, false));
- buildViewer(parent);
- buildButton(parent);
- shell.open();
- while (!shell.isDisposed()) {
- while (!d.readAndDispatch()) {
- d.sleep();
- }
- }
-
- }
-
- private static void buildButton(Composite parent) {
- Button button = new Button(parent, SWT.PUSH);
- button.setText("Refresh");
- button.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- contentProvider.setElements(new Object[] { "Rock2Paper", "Scissors2Paper", "Scissors2Rock" });
- viewer.refresh();
- }
- });
- }
-
- private static void buildViewer(Composite parent) {
- viewer = new GraphViewer(parent, SWT.NONE);
- viewer.getGraphControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- contentProvider = new MyContentProvider();
- viewer.setContentProvider(contentProvider);
- viewer.setLabelProvider(new MyLabelProvider());
- viewer.setLayoutAlgorithm(new SpringLayoutAlgorithm());
- viewer.setInput(new Object());
- }
-}
diff --git a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/jface/GraphJFaceSnippet6.java b/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/jface/GraphJFaceSnippet6.java
deleted file mode 100644
index 2532882..0000000
--- a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/jface/GraphJFaceSnippet6.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*******************************************************************************
- * Copyright 2005-2007, CHISEL Group, University of Victoria, Victoria, BC,
- * Canada. All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: The Chisel Group, University of Victoria
- ******************************************************************************/
-package org.eclipse.zest.tests.jface;
-
-
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.zest.core.viewers.EntityConnectionData;
-import org.eclipse.zest.core.viewers.GraphViewer;
-import org.eclipse.zest.core.viewers.IGraphEntityContentProvider;
-import org.eclipse.zest.core.viewers.INestedContentProvider;
-import org.eclipse.zest.layouts.LayoutStyles;
-import org.eclipse.zest.layouts.algorithms.SpringLayoutAlgorithm;
-
-/**
- * This snippet shows how to use the INestedGraphContentProvider to create a graph
- * with Zest. In this example, getElements returns 3 edges: * Rock2Paper *
- * Paper2Scissors * Scissors2Rock
- *
- * And for each of these, the source and destination are returned in getSource
- * and getDestination.
- *
- * A label provider is also used to create the text and icons for the graph.
- *
- * @author Ian Bull
- *
- */
-public class GraphJFaceSnippet6 {
-
- static class MyContentProvider implements IGraphEntityContentProvider, INestedContentProvider {
-
- public Object[] getConnectedTo(Object entity) {
- if (entity.equals("First")) {
- return new Object[] { "Second" };
- }
- if (entity.equals("Second")) {
- return new Object[] { "Third", "rock" };
- }
- if (entity.equals("Third")) {
- return new Object[] { "First" };
- }
- if ( entity.equals("rock")) {
- return new Object[] { "paper" };
- }
- return null;
- }
-
- public Object[] getElements(Object inputElement) {
- return new String[] { "First", "Second", "Third" };
- }
-
- public double getWeight(Object entity1, Object entity2) {
- return 0;
- }
-
- public void dispose() {
-
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-
- }
-
- public Object[] getChildren(Object element) {
- // TODO Auto-generated method stub
- return new Object[] {"rock", "paper", "scissors"};
- }
-
- public boolean hasChildren(Object element) {
- // TODO Auto-generated method stub
- if ( element.equals("First")) return true;
- return false;
- }
-
- }
-
- static class MyLabelProvider extends LabelProvider {
- final Image image = Display.getDefault().getSystemImage(SWT.ICON_WARNING);
-
- public Image getImage(Object element) {
- if (element.equals("Rock") || element.equals("Paper") || element.equals("Scissors")) {
- return image;
- }
- return null;
- }
-
- public String getText(Object element) {
- if ( element instanceof EntityConnectionData ) return "";
- return element.toString();
- }
-
- }
-
- static GraphViewer viewer = null;
-
- /**
- * @param args
- */
- public static void main(String[] args) {
- Display d = new Display();
- Shell shell = new Shell(d);
- shell.setText("GraphJFaceSnippet2");
- shell.setLayout(new FillLayout(SWT.VERTICAL));
- shell.setSize(400, 400);
- viewer = new GraphViewer(shell, SWT.NONE);
- viewer.setContentProvider(new MyContentProvider());
- viewer.setLabelProvider(new MyLabelProvider());
- viewer.setLayoutAlgorithm(new SpringLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING));
- viewer.setInput(new Object());
-
- Button button = new Button(shell, SWT.PUSH);
- button.setText("push");
- button.addSelectionListener(new SelectionListener() {
-
- public void widgetDefaultSelected(SelectionEvent e) {
- }
-
- public void widgetSelected(SelectionEvent e) {
- viewer.setInput(new Object());
- }
-
- });
- shell.open();
- while (!shell.isDisposed()) {
- while (!d.readAndDispatch()) {
- d.sleep();
- }
- }
-
- }
-
-}
diff --git a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/jface/GraphJFaceSnippet7.java b/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/jface/GraphJFaceSnippet7.java
deleted file mode 100644
index 526d551..0000000
--- a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/jface/GraphJFaceSnippet7.java
+++ /dev/null
@@ -1,182 +0,0 @@
-/*******************************************************************************
- * Copyright 2005-2007, CHISEL Group, University of Victoria, Victoria, BC,
- * Canada. All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: The Chisel Group, University of Victoria
- ******************************************************************************/
-package org.eclipse.zest.tests.jface;
-
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.zest.core.viewers.EntityConnectionData;
-import org.eclipse.zest.core.viewers.GraphViewer;
-import org.eclipse.zest.core.viewers.IFigureProvider;
-import org.eclipse.zest.core.viewers.IGraphEntityContentProvider;
-import org.eclipse.zest.core.viewers.INestedContentProvider;
-import org.eclipse.zest.layouts.LayoutStyles;
-import org.eclipse.zest.layouts.algorithms.SpringLayoutAlgorithm;
-import org.eclipse.zest.tests.uml.UMLClassFigure;
-
-/**
- * This snippet shows how to use the INestedGraphContentProvider to create a graph
- * with Zest. In this example, getElements returns 3 edges: * Rock2Paper *
- * Paper2Scissors * Scissors2Rock
- *
- * And for each of these, the source and destination are returned in getSource
- * and getDestination.
- *
- * A label provider is also used to create the text and icons for the graph.
- *
- * @author Ian Bull
- *
- */
-public class GraphJFaceSnippet7 {
-
- public static IFigure createClassFigure1(Font classFont, Image classImage, Image publicField, Image privateField) {
- Label classLabel1 = new Label("Table", classImage);
- classLabel1.setFont(classFont);
-
- UMLClassFigure classFigure = new UMLClassFigure(classLabel1);
- Label attribute1 = new Label("columns: Column[]", privateField);
-
- Label attribute2 = new Label("rows: Row[]", privateField);
-
- Label method1 = new Label("getColumns(): Column[]", publicField);
- Label method2 = new Label("getRows(): Row[]", publicField);
- classFigure.getAttributesCompartment().add(attribute1);
- classFigure.getAttributesCompartment().add(attribute2);
- classFigure.getMethodsCompartment().add(method1);
- classFigure.getMethodsCompartment().add(method2);
- classFigure.setSize(-1, -1);
-
- return classFigure;
- }
-
- static class MyContentProvider implements IGraphEntityContentProvider, INestedContentProvider {
-
- public Object[] getConnectedTo(Object entity) {
- if (entity.equals("First")) {
- return new Object[] { "Second" };
- }
- if (entity.equals("Second")) {
- return new Object[] { "Third", "rock" };
- }
- if (entity.equals("Third")) {
- return new Object[] { "First" };
- }
- if ( entity.equals("rock")) {
- return new Object[] { "paper" };
- }
- return null;
- }
-
- public Object[] getElements(Object inputElement) {
- return new String[] { "First", "Second", "Third" };
- }
-
- public double getWeight(Object entity1, Object entity2) {
- return 0;
- }
-
- public void dispose() {
-
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-
- }
-
- public Object[] getChildren(Object element) {
- // TODO Auto-generated method stub
- return new Object[] {"rock", "paper", "scissors"};
- }
-
- public boolean hasChildren(Object element) {
- // TODO Auto-generated method stub
- if ( element.equals("First")) return true;
- return false;
- }
-
- }
-
-
-
- static class MyLabelProvider extends LabelProvider implements IFigureProvider {
- final Image image = Display.getDefault().getSystemImage(SWT.ICON_WARNING);
-
- public Image getImage(Object element) {
- if (element.equals("Rock") || element.equals("Paper") || element.equals("Scissors")) {
- return image;
- }
- return null;
- }
-
- public String getText(Object element) {
- if ( element instanceof EntityConnectionData ) return "";
- return element.toString();
- }
-
- public IFigure getFigure(Object element) {
- Font classFont = new Font(null, "Arial", 12, SWT.BOLD);
- Image classImage = new Image(Display.getDefault(), UMLClassFigure.class.getResourceAsStream("class_obj.gif"));
- Image privateField = new Image(Display.getDefault(), UMLClassFigure.class.getResourceAsStream("field_private_obj.gif"));
- Image publicField= new Image(Display.getDefault(), UMLClassFigure.class.getResourceAsStream("methpub_obj.gif"));
- return createClassFigure1(classFont, classImage, publicField, privateField);
- }
-
- }
-
- static GraphViewer viewer = null;
-
- /**
- * @param args
- */
- public static void main(String[] args) {
- Display d = new Display();
- Shell shell = new Shell(d);
- shell.setText("GraphJFaceSnippet2");
- shell.setLayout(new FillLayout(SWT.VERTICAL));
- shell.setSize(400, 400);
- viewer = new GraphViewer(shell, SWT.NONE);
- viewer.setContentProvider(new MyContentProvider());
- viewer.setLabelProvider(new MyLabelProvider());
- viewer.setLayoutAlgorithm(new SpringLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING));
- viewer.setInput(new Object());
-
- Button button = new Button(shell, SWT.PUSH);
- button.setText("push");
- button.addSelectionListener(new SelectionListener() {
-
- public void widgetDefaultSelected(SelectionEvent e) {
- }
-
- public void widgetSelected(SelectionEvent e) {
- viewer.setInput(new Object());
- }
-
- });
- shell.open();
- while (!shell.isDisposed()) {
- while (!d.readAndDispatch()) {
- d.sleep();
- }
- }
-
- }
-
-}
diff --git a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/jface/GraphJFaceSnippet8.java b/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/jface/GraphJFaceSnippet8.java
deleted file mode 100644
index e79da01..0000000
--- a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/jface/GraphJFaceSnippet8.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Fabian Steeg. All rights reserved. This program and
- * the accompanying materials are made available under the terms of the Eclipse
- * Public License v1.0 which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * <p/>
- * Contributors: Fabian Steeg - initial implementation
- *******************************************************************************/
-package org.eclipse.zest.tests.jface;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.PolygonDecoration;
-import org.eclipse.draw2d.PolylineConnection;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.zest.core.viewers.GraphViewer;
-import org.eclipse.zest.core.viewers.IGraphEntityContentProvider;
-import org.eclipse.zest.core.viewers.ISelfStyleProvider;
-import org.eclipse.zest.core.widgets.GraphConnection;
-import org.eclipse.zest.core.widgets.GraphNode;
-import org.eclipse.zest.layouts.algorithms.RadialLayoutAlgorithm;
-
-/**
- * Shows curved edges.
- *
- * @author Fabian Steeg
- */
-public class GraphJFaceSnippet8 {
-
- static class MyContentProvider implements IGraphEntityContentProvider {
-
- public Object[] getConnectedTo(Object entity) {
- if (entity.equals("First")) {
- return new Object[] { "First", "Second" };
- }
- if (entity.equals("Second")) {
- return new Object[] { "Third" };
- }
- if (entity.equals("Third")) {
- return new Object[] { "Second" };
- }
- return null;
- }
-
- public Object[] getElements(Object inputElement) {
- return new String[] { "First", "Second", "Third" };
- }
-
- public double getWeight(Object entity1, Object entity2) {
- return 0;
- }
-
- public void dispose() {
-
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-
- }
- }
-
- static class MyLabelProvider extends LabelProvider implements
- ISelfStyleProvider {
-
- public Image getImage(Object element) {
- return null;
- }
-
- public String getText(Object element) {
- return element.toString();
- }
-
- public void selfStyleConnection(Object element,
- GraphConnection connection) {
- connection.setLineStyle(org.eclipse.draw2d.rap.swt.SWT.LINE_CUSTOM);
- PolylineConnection pc = (PolylineConnection) connection
- .getConnectionFigure();
- pc.setLineDash(new float[] { 4 });
- pc.setTargetDecoration(createDecoration(ColorConstants.white()));
- pc.setSourceDecoration(createDecoration(ColorConstants.green()));
- }
-
- private PolygonDecoration createDecoration(final Color color) {
- PolygonDecoration decoration = new PolygonDecoration() {
- protected void fillShape(Graphics g) {
- g.setBackgroundColor(color);
- super.fillShape(g);
- }
- };
- decoration.setScale(10, 5);
- decoration.setBackgroundColor(color);
- return decoration;
- }
-
- public void selfStyleNode(Object element, GraphNode node) {
- }
-
- }
-
- static GraphViewer viewer = null;
-
- public static void main(String[] args) {
- Display d = new Display();
- Shell shell = new Shell(d);
- shell.setLayout(new FillLayout(SWT.VERTICAL));
- shell.setSize(400, 400);
- viewer = new GraphViewer(shell, SWT.NONE);
- viewer.setContentProvider(new MyContentProvider());
- viewer.setLabelProvider(new MyLabelProvider());
- viewer.setLayoutAlgorithm(new RadialLayoutAlgorithm());
- viewer.setInput(new Object());
-
- shell.open();
- while (!shell.isDisposed()) {
- while (!d.readAndDispatch()) {
- d.sleep();
- }
- }
-
- }
-}
diff --git a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/jface/SimpleGraph.sgf b/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/jface/SimpleGraph.sgf
deleted file mode 100644
index dd70239..0000000
--- a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/jface/SimpleGraph.sgf
+++ /dev/null
@@ -1,29 +0,0 @@
-a likes b
-a likes c
-a likes d
-b likes e
-b likes f
-b likes g
-c likes h
-c likes i
-c likes j
-d likes k
-d likes l
-d likes m
-e likes n
-e likes o
-e likes p
-p likes aa
-p likes ab
-p likes ac
-p likes ad
-p likes ae
-p likes af
-p likes ag
-p likes ah
-p likes ai
-p likes aj
-p likes ak
-p likes al
-p likes am
-p likes an
diff --git a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/AnimationSnippet.java b/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/AnimationSnippet.java
deleted file mode 100644
index 412310d..0000000
--- a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/AnimationSnippet.java
+++ /dev/null
@@ -1,68 +0,0 @@
-package org.eclipse.zest.tests.swt;
-
-import org.eclipse.draw2d.Animation;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.zest.core.widgets.Graph;
-import org.eclipse.zest.core.widgets.GraphConnection;
-import org.eclipse.zest.core.widgets.GraphNode;
-
-/**
- * The following snippet shows how to setup animation in Zest. By using the Draw2D animation,
- * you can simply start the animation, set the node locations, and then run the animation (with a
- * set time).
- *
- * @author irbull
- *
- */
-public class AnimationSnippet {
-
- public static void main(String[] args) {
-
- Display d = new Display();
- final Shell shell = new Shell(d);
- shell.setText("Animation Example");
- shell.setLayout(new FillLayout(SWT.VERTICAL));
- shell.setSize(400, 400);
-
- Button b = new Button(shell, SWT.PUSH);
- b.setText("Animate");
-
- final Graph g = new Graph(shell, SWT.NONE);
-
- final GraphNode n = new GraphNode(g, SWT.NONE, "Paper");
- final GraphNode n2 = new GraphNode(g, SWT.NONE, "Rock");
-
- b.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- }
-
- public void widgetSelected(SelectionEvent e) {
- Animation.markBegin();
- n2.setLocation(0, 0);
- n.setLocation(g.getSize().x - n2.getSize().width-5, 0);
- Animation.run(1000);
- }
- });
-
- new GraphConnection(g, SWT.NONE, n, n2);
-
- int centerX = shell.getSize().x / 2;
- int centerY = shell.getSize().y / 4;
-
- n.setLocation(centerX, centerY);
- n2.setLocation(centerX, centerY);
-
- shell.open();
- while (!shell.isDisposed()) {
- while (!d.readAndDispatch()) {
- d.sleep();
- }
- }
- }
-}
diff --git a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/CustomLayout.java b/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/CustomLayout.java
deleted file mode 100644
index 865ce84..0000000
--- a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/CustomLayout.java
+++ /dev/null
@@ -1,99 +0,0 @@
-package org.eclipse.zest.tests.swt;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.zest.core.widgets.Graph;
-import org.eclipse.zest.core.widgets.GraphConnection;
-import org.eclipse.zest.core.widgets.GraphNode;
-import org.eclipse.zest.layouts.LayoutEntity;
-import org.eclipse.zest.layouts.algorithms.AbstractLayoutAlgorithm;
-import org.eclipse.zest.layouts.dataStructures.InternalNode;
-import org.eclipse.zest.layouts.dataStructures.InternalRelationship;
-
-/**
- * This snippet shows how to create a custom layout. This layout simply lays the nodes out vertically
- * on the same Y-Axis as they currently have. All the work is done in the applyLayoutInternal Method.
- *
- * @author irbull
- *
- */
-public class CustomLayout {
-
- public static void main(String[] args) {
- Display d = new Display();
- Shell shell = new Shell(d);
- shell.setText("Custom Layout Example");
- shell.setLayout(new FillLayout());
- shell.setSize(400, 400);
-
- Graph g = new Graph(shell, SWT.NONE);
-
- GraphNode n = new GraphNode(g, SWT.NONE, "Paper");
- GraphNode n2 = new GraphNode(g, SWT.NONE, "Rock");
- GraphNode n3 = new GraphNode(g, SWT.NONE, "Scissors");
- new GraphConnection(g, SWT.NONE, n, n2);
- new GraphConnection(g, SWT.NONE, n2, n3);
- new GraphConnection(g, SWT.NONE, n3, n);
- g.setLayoutAlgorithm(new AbstractLayoutAlgorithm(SWT.NONE) {
-
-
- private int totalSteps;
- private int currentStep;
-
- protected void applyLayoutInternal(InternalNode[] entitiesToLayout,
- InternalRelationship[] relationshipsToConsider, double boundsX, double boundsY, double boundsWidth,
- double boundsHeight) {
-
- totalSteps = entitiesToLayout.length;
- double distance = boundsWidth / totalSteps;
- int xLocation = 0;
-
- fireProgressStarted(totalSteps);
-
- for (currentStep = 0; currentStep < entitiesToLayout.length; currentStep++) {
- LayoutEntity layoutEntity = entitiesToLayout[currentStep].getLayoutEntity();
- layoutEntity.setLocationInLayout(xLocation, layoutEntity.getYInLayout());
- xLocation+= distance;
- fireProgressEvent(currentStep, totalSteps);
- }
- fireProgressEnded(totalSteps);
- }
-
- protected int getCurrentLayoutStep() {
- return 0;
- }
-
- protected int getTotalNumberOfLayoutSteps() {
- return totalSteps;
- }
-
- protected boolean isValidConfiguration(boolean asynchronous, boolean continuous) {
- return true;
- }
-
- protected void postLayoutAlgorithm(InternalNode[] entitiesToLayout,
- InternalRelationship[] relationshipsToConsider) {
- // Do nothing
- }
-
- protected void preLayoutAlgorithm(InternalNode[] entitiesToLayout,
- InternalRelationship[] relationshipsToConsider, double x, double y, double width, double height) {
- // do nothing
- }
-
- public void setLayoutArea(double x, double y, double width, double height) {
- // do nothing
- }
-
- }, true);
-
- shell.open();
- while (!shell.isDisposed()) {
- while (!d.readAndDispatch()) {
- d.sleep();
- }
- }
- }
-}
diff --git a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/GraphSnippet1.java b/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/GraphSnippet1.java
deleted file mode 100644
index 0b7364e..0000000
--- a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/GraphSnippet1.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright 2005-2007, CHISEL Group, University of Victoria, Victoria, BC,
- * Canada. All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: The Chisel Group, University of Victoria
- ******************************************************************************/
-package org.eclipse.zest.tests.swt;
-
-import org.eclipse.zest.core.widgets.Graph;
-import org.eclipse.zest.core.widgets.GraphConnection;
-import org.eclipse.zest.core.widgets.GraphNode;
-import org.eclipse.zest.layouts.LayoutStyles;
-import org.eclipse.zest.layouts.algorithms.SpringLayoutAlgorithm;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * This snippet creates a very simple graph where Rock is connected to Paper
- * which is connected to scissors which is connected to rock.
- *
- * The nodes a positioned using a SpringLayout Algorithm, and they can be moved
- * around.
- *
- *
- * @author Ian Bull
- *
- */
-public class GraphSnippet1 {
-
- public static void main(String[] args) {
- Display d = new Display();
- Shell shell = new Shell(d);
- shell.setText("GraphSnippet1");
- shell.setLayout(new FillLayout());
- shell.setSize(400, 400);
-
- Graph g = new Graph(shell, SWT.NONE);
-
- GraphNode n = new GraphNode(g, SWT.NONE, "Paper");
- GraphNode n2 = new GraphNode(g, SWT.NONE, "Rock");
- GraphNode n3 = new GraphNode(g, SWT.NONE, "Scissors");
- new GraphConnection(g, SWT.NONE, n, n2);
- new GraphConnection(g, SWT.NONE, n2, n3);
- new GraphConnection(g, SWT.NONE, n3, n);
- g.setLayoutAlgorithm(new SpringLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING), true);
-
- shell.open();
- while (!shell.isDisposed()) {
- while (!d.readAndDispatch()) {
- d.sleep();
- }
- }
- }
-
-}
diff --git a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/GraphSnippet10.java b/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/GraphSnippet10.java
deleted file mode 100644
index 8c59653..0000000
--- a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/GraphSnippet10.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright 2005-2007, CHISEL Group, University of Victoria, Victoria, BC,
- * Canada. All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: The Chisel Group, University of Victoria
- ******************************************************************************/
-package org.eclipse.zest.tests.swt;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.zest.core.widgets.Graph;
-import org.eclipse.zest.core.widgets.GraphConnection;
-import org.eclipse.zest.core.widgets.GraphNode;
-import org.eclipse.zest.layouts.LayoutStyles;
-import org.eclipse.zest.layouts.algorithms.SpringLayoutAlgorithm;
-
-/**
- *
- * This snippet shows how to create a curved connection using Zest. Each time
- * the Button is clicked, the curve changes.
- *
- * @author Ian Bull
- *
- */
-public class GraphSnippet10 {
-
- public static void main(String[] args) {
- Display d = new Display();
- Shell shell = new Shell(d);
- shell.setText("GraphSnippet1");
- shell.setLayout(new FillLayout());
- shell.setSize(400, 400);
-
- final Graph g = new Graph(shell, SWT.NONE);
-
- GraphNode n = new GraphNode(g, SWT.NONE, "Paper");
- n.setBorderColor(org.eclipse.draw2d.ColorConstants.yellow());
- n.setBorderWidth(3);
- GraphNode n2 = new GraphNode(g, SWT.NONE, "Rock");
- GraphNode n3 = new GraphNode(g, SWT.NONE, "Scissors");
- final GraphConnection connection = new GraphConnection(g, SWT.NONE, n,
- n2);
- connection.setLineWidth(3);
- new GraphConnection(g, SWT.NONE, n2, n3);
- new GraphConnection(g, SWT.NONE, n3, n);
- g.setLayoutAlgorithm(new SpringLayoutAlgorithm(
- LayoutStyles.NO_LAYOUT_NODE_RESIZING), true);
-
- Button button = new Button(shell, SWT.PUSH);
- button.setText("Change Curve");
- button.addSelectionListener(new SelectionAdapter() {
- int count = 0;
-
- public void widgetSelected(SelectionEvent e) {
- count = ++count % 16;
- if (count > 8) {
- connection.setCurveDepth((-16 + count) * 10);
- } else {
- connection.setCurveDepth(count * 10);
- }
- }
- });
-
- shell.open();
- while (!shell.isDisposed()) {
- while (!d.readAndDispatch()) {
- d.sleep();
- }
- }
- }
-
-}
diff --git a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/GraphSnippet11.java b/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/GraphSnippet11.java
deleted file mode 100644
index 538ee85..0000000
--- a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/GraphSnippet11.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright 2005-2007, CHISEL Group, University of Victoria, Victoria, BC,
- * Canada. All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: The Chisel Group, University of Victoria
- ******************************************************************************/
-package org.eclipse.zest.tests.swt;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.zest.core.widgets.Graph;
-import org.eclipse.zest.core.widgets.GraphConnection;
-import org.eclipse.zest.core.widgets.GraphNode;
-import org.eclipse.zest.layouts.LayoutStyles;
-import org.eclipse.zest.layouts.algorithms.SpringLayoutAlgorithm;
-
-/**
- *
- * This snippet shows how to create a curved connection using Zest.
- *
- * @author Ian Bull
- *
- */
-public class GraphSnippet11 {
-
- public static void createConnection(Graph g, GraphNode n1, GraphNode n2,
- Color color, int curve) {
- GraphConnection connection = new GraphConnection(g, SWT.NONE, n1, n2);
- connection.setLineColor(color);
- connection.setCurveDepth(curve);
- connection.setLineWidth(1);
- }
-
- public static void main(String[] args) {
- Display d = new Display();
- Shell shell = new Shell(d);
- shell.setText("GraphSnippet11");
- shell.setLayout(new FillLayout());
- shell.setSize(400, 400);
-
- final Graph g = new Graph(shell, SWT.NONE);
- GraphNode n = new GraphNode(g, SWT.NONE, "Node 1");
- GraphNode n2 = new GraphNode(g, SWT.NONE, "Node 2");
- createConnection(g, n, n2, ColorConstants.darkGreen(), 20);
- createConnection(g, n, n2, ColorConstants.darkGreen(), -20);
- createConnection(g, n, n2, ColorConstants.darkBlue(), 40);
- createConnection(g, n, n2, ColorConstants.darkBlue(), -40);
- createConnection(g, n, n2, ColorConstants.darkGray(), 60);
- createConnection(g, n, n2, ColorConstants.darkGray(), -60);
- createConnection(g, n, n2, ColorConstants.black(), 0);
- g.setLayoutAlgorithm(new SpringLayoutAlgorithm(
- LayoutStyles.NO_LAYOUT_NODE_RESIZING), true);
-
- shell.open();
- while (!shell.isDisposed()) {
- while (!d.readAndDispatch()) {
- d.sleep();
- }
- }
- }
-
-}
diff --git a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/GraphSnippet12.java b/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/GraphSnippet12.java
deleted file mode 100644
index 6cbaedb..0000000
--- a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/GraphSnippet12.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*******************************************************************************
- * Copyright 2005-2007, CHISEL Group, University of Victoria, Victoria, BC,
- * Canada. All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: The Chisel Group, University of Victoria
- ******************************************************************************/
-package org.eclipse.zest.tests.swt;
-
-import java.util.Iterator;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Ellipse;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.FreeformLayout;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.ImageFigure;
-import org.eclipse.draw2d.PolylineShape;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.zest.core.widgets.CGraphNode;
-import org.eclipse.zest.core.widgets.Graph;
-import org.eclipse.zest.core.widgets.GraphConnection;
-import org.eclipse.zest.core.widgets.GraphNode;
-import org.eclipse.zest.layouts.LayoutStyles;
-import org.eclipse.zest.layouts.algorithms.SpringLayoutAlgorithm;
-
-/**
- *
- * This snippet shows how to create a curved connection using Zest.
- *
- * @author Ian Bull
- *
- */
-public class GraphSnippet12 {
-
- public static IFigure createPersonFigure(Image headImage) {
- Figure person = new Figure();
- person.setLayoutManager(new FreeformLayout());
- IFigure head = null;
- if (headImage != null) {
- headImage = new Image(headImage.getDevice(), headImage
- .getImageData().scaledTo(40, 50));
- head = new ImageFigure(headImage);
- } else
- head = new Ellipse();
- head.setSize(40, 50);
-
- PolylineShape body = new PolylineShape();
- body.setLineWidth(1);
- body.setStart(new Point(20, 40));
- body.setEnd(new Point(20, 100));
- body.setBounds(new Rectangle(0, 0, 40, 100));
-
- PolylineShape leftLeg = new PolylineShape();
- leftLeg.setLineWidth(1);
- leftLeg.setStart(new Point(20, 100));
- leftLeg.setEnd(new Point(0, 130));
- leftLeg.setBounds(new Rectangle(0, 0, 40, 130));
-
- PolylineShape rightLeg = new PolylineShape();
- rightLeg.setLineWidth(1);
- rightLeg.setStart(new Point(20, 100));
- rightLeg.setEnd(new Point(40, 130));
- rightLeg.setBounds(new Rectangle(0, 0, 40, 130));
-
- PolylineShape leftArm = new PolylineShape();
- leftArm.setLineWidth(1);
- leftArm.setStart(new Point(20, 60));
- leftArm.setEnd(new Point(0, 50));
- leftArm.setBounds(new Rectangle(0, 0, 40, 130));
-
- PolylineShape rightArm = new PolylineShape();
- rightArm.setLineWidth(1);
- rightArm.setStart(new Point(20, 60));
- rightArm.setEnd(new Point(40, 50));
- rightArm.setBounds(new Rectangle(0, 0, 40, 130));
-
- person.add(head);
- person.add(body);
- person.add(leftLeg);
- person.add(rightLeg);
- person.add(leftArm);
- person.add(rightArm);
- person.setSize(40, 130);
- return person;
- }
-
- public static void main(String[] args) {
- final Display d = new Display();
- Shell shell = new Shell(d);
- shell.setText("GraphSnippet11");
- shell.setLayout(new FillLayout());
- shell.setSize(400, 400);
-
- final Graph g = new Graph(shell, SWT.NONE);
- g.addSelectionListener(new SelectionListener() {
-
- public void widgetSelected(SelectionEvent e) {
- Iterator iter = g.getSelection().iterator();
- while (iter.hasNext()) {
- Object o = iter.next();
- if (o instanceof CGraphNode) {
- IFigure figure = ((CGraphNode) o).getFigure();
- figure.setBackgroundColor(ColorConstants.blue());
- figure.setForegroundColor(ColorConstants.blue());
- }
- }
- iter = g.getNodes().iterator();
- while (iter.hasNext()) {
- Object o = iter.next();
- if (o instanceof CGraphNode) {
- if (!g.getSelection().contains(o)) {
- ((CGraphNode) o).getFigure().setBackgroundColor(
- ColorConstants.black());
- ((CGraphNode) o).getFigure().setForegroundColor(
- ColorConstants.black());
- }
- }
- }
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- // TODO Auto-generated method stub
-
- }
- });
-
- Image zx = new Image(d, "zx.png");
- Image ibull = new Image(d, "ibull.jpg");
- CGraphNode n = new CGraphNode(g, SWT.NONE, createPersonFigure(zx));
- CGraphNode n2 = new CGraphNode(g, SWT.NONE, createPersonFigure(ibull));
- GraphNode n3 = new GraphNode(g, SWT.NONE, "PDE");
- GraphNode n4 = new GraphNode(g, SWT.NONE, "Zest");
- GraphNode n5 = new GraphNode(g, SWT.NONE, "PDE Viz tool");
-
- new GraphConnection(g, SWT.NONE, n, n2);
- new GraphConnection(g, SWT.NONE, n, n3);
- new GraphConnection(g, SWT.NONE, n2, n4);
- new GraphConnection(g, SWT.NONE, n, n5);
- new GraphConnection(g, SWT.NONE, n2, n5);
- new GraphConnection(g, SWT.NONE, n3, n5);
- new GraphConnection(g, SWT.NONE, n4, n5);
- g.setLayoutAlgorithm(new SpringLayoutAlgorithm(
- LayoutStyles.NO_LAYOUT_NODE_RESIZING), true);
-
- shell.open();
- while (!shell.isDisposed()) {
- while (!d.readAndDispatch()) {
- d.sleep();
- }
- }
- zx.dispose();
- ibull.dispose();
- }
-
-}
diff --git a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/GraphSnippet13.java b/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/GraphSnippet13.java
deleted file mode 100644
index 24cd3f9..0000000
--- a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/GraphSnippet13.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*******************************************************************************
- * Copyright 2005-2007, CHISEL Group, University of Victoria, Victoria, BC,
- * Canada. All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: The Chisel Group, University of Victoria
- ******************************************************************************/
-package org.eclipse.zest.tests.swt;
-
-import java.util.Iterator;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Ellipse;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.FlowLayout;
-import org.eclipse.draw2d.FreeformLayout;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.ImageFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.draw2d.PolylineShape;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.zest.core.widgets.CGraphNode;
-import org.eclipse.zest.core.widgets.Graph;
-import org.eclipse.zest.core.widgets.GraphConnection;
-import org.eclipse.zest.core.widgets.GraphContainer;
-import org.eclipse.zest.core.widgets.GraphNode;
-import org.eclipse.zest.core.widgets.ZestStyles;
-import org.eclipse.zest.layouts.LayoutStyles;
-import org.eclipse.zest.layouts.algorithms.SpringLayoutAlgorithm;
-
-/**
- *
- * This snippet shows how to create a curved connection using Zest.
- *
- * @author Ian Bull
- *
- */
-public class GraphSnippet13 {
-
- public static IFigure createPersonFigure(Image headImage) {
- Figure person = new Figure();
- person.setLayoutManager(new FreeformLayout());
- IFigure head = null;
- if (headImage != null) {
- headImage = new Image(headImage.getDevice(), headImage
- .getImageData().scaledTo(40, 50));
- head = new ImageFigure(headImage);
- } else
- head = new Ellipse();
- head.setSize(40, 50);
-
- PolylineShape body = new PolylineShape();
- body.setLineWidth(1);
- body.setStart(new Point(20, 40));
- body.setEnd(new Point(20, 100));
- body.setBounds(new Rectangle(0, 0, 40, 100));
-
- PolylineShape leftLeg = new PolylineShape();
- leftLeg.setLineWidth(1);
- leftLeg.setStart(new Point(20, 100));
- leftLeg.setEnd(new Point(0, 130));
- leftLeg.setBounds(new Rectangle(0, 0, 40, 130));
-
- PolylineShape rightLeg = new PolylineShape();
- rightLeg.setLineWidth(1);
- rightLeg.setStart(new Point(20, 100));
- rightLeg.setEnd(new Point(40, 130));
- rightLeg.setBounds(new Rectangle(0, 0, 40, 130));
-
- PolylineShape leftArm = new PolylineShape();
- leftArm.setLineWidth(1);
- leftArm.setStart(new Point(20, 60));
- leftArm.setEnd(new Point(0, 50));
- leftArm.setBounds(new Rectangle(0, 0, 40, 130));
-
- PolylineShape rightArm = new PolylineShape();
- rightArm.setLineWidth(1);
- rightArm.setStart(new Point(20, 60));
- rightArm.setEnd(new Point(40, 50));
- rightArm.setBounds(new Rectangle(0, 0, 40, 130));
-
- person.add(head);
- person.add(body);
- person.add(leftLeg);
- person.add(rightLeg);
- person.add(leftArm);
- person.add(rightArm);
- person.setSize(40, 130);
- return person;
- }
-
- public static void main(String[] args) {
- final Display d = new Display();
- Shell shell = new Shell(d);
- shell.setText("GraphSnippet11");
- shell.setLayout(new FillLayout());
- shell.setSize(400, 400);
-
- final Graph g = new Graph(shell, SWT.NONE);
- g.addSelectionListener(new SelectionListener() {
-
- public void widgetSelected(SelectionEvent e) {
- Iterator iter = g.getSelection().iterator();
- while (iter.hasNext()) {
- Object o = iter.next();
- if (o instanceof CGraphNode) {
- IFigure figure = ((CGraphNode) o).getFigure();
- figure.setBackgroundColor(ColorConstants.blue());
- figure.setForegroundColor(ColorConstants.blue());
- }
- }
- iter = g.getNodes().iterator();
- while (iter.hasNext()) {
- Object o = iter.next();
- if (o instanceof CGraphNode) {
- if (!g.getSelection().contains(o)) {
- ((CGraphNode) o).getFigure().setBackgroundColor(
- ColorConstants.black());
- ((CGraphNode) o).getFigure().setForegroundColor(
- ColorConstants.black());
- }
- }
- }
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- // TODO Auto-generated method stub
-
- }
- });
-
- Image zx = new Image(d, "zxsnow.png");
- IFigure tooltip = new Figure();
- tooltip.setBorder(new MarginBorder(5, 5, 5, 5));
- FlowLayout layout = new FlowLayout(false);
- layout.setMajorSpacing(3);
- layout.setMinorAlignment(3);
- tooltip.setLayoutManager(new FlowLayout(false));
- tooltip.add(new ImageFigure(zx));
- tooltip.add(new Label("Name: " + "Chris Aniszczyk"));
- tooltip.add(new Label("Location: " + "Austin, Texas"));
-
- Image ibull = new Image(d, "ibull.jpg");
- GraphContainer c1 = new GraphContainer(g, SWT.NONE);
- c1.setText("Canada");
- GraphContainer c2 = new GraphContainer(g, SWT.NONE);
- c2.setText("USA");
-
- GraphNode n1 = new GraphNode(c1, SWT.NONE, "Ian B.");
- n1.setSize(200, 100);
- GraphNode n2 = new GraphNode(c2, SWT.NONE, "Chris A.");
- n2.setTooltip(tooltip);
-
- GraphConnection connection = new GraphConnection(g,
- ZestStyles.CONNECTIONS_DIRECTED, n1, n2);
- connection.setCurveDepth(-30);
- GraphConnection connection2 = new GraphConnection(g,
- ZestStyles.CONNECTIONS_DIRECTED, n2, n1);
- connection2.setCurveDepth(-30);
-
- g.setLayoutAlgorithm(new SpringLayoutAlgorithm(
- LayoutStyles.NO_LAYOUT_NODE_RESIZING), true);
-
- shell.open();
- while (!shell.isDisposed()) {
- while (!d.readAndDispatch()) {
- d.sleep();
- }
- }
- zx.dispose();
- ibull.dispose();
- }
-
-}
diff --git a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/GraphSnippet2.java b/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/GraphSnippet2.java
deleted file mode 100644
index 940ca86..0000000
--- a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/GraphSnippet2.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright 2005-2007, CHISEL Group, University of Victoria, Victoria, BC, Canada.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * The Chisel Group, University of Victoria
- *******************************************************************************/
-package org.eclipse.zest.tests.swt;
-
-import org.eclipse.zest.core.widgets.Graph;
-import org.eclipse.zest.core.widgets.GraphConnection;
-import org.eclipse.zest.core.widgets.GraphNode;
-import org.eclipse.zest.core.widgets.ZestStyles;
-import org.eclipse.zest.layouts.LayoutStyles;
-import org.eclipse.zest.layouts.algorithms.SpringLayoutAlgorithm;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * This snippet creates a very simple graph with an Icon and Label.
- *
- * This snippet shows how to use directed edges and self loops.
- *
- * @author Ian Bull
- *
- */
-public class GraphSnippet2 {
-
- public static void main(String[] args) {
- Display d = new Display();
- Shell shell = new Shell(d);
- Image image1 = Display.getDefault().getSystemImage(SWT.ICON_INFORMATION);
- Image image2 = Display.getDefault().getSystemImage(SWT.ICON_WARNING);
- Image image3 = Display.getDefault().getSystemImage(SWT.ICON_ERROR);
- shell.setLayout(new FillLayout());
- shell.setSize(400, 400);
-
- Graph g = new Graph(shell, SWT.NONE);
- g.setConnectionStyle(ZestStyles.CONNECTIONS_DIRECTED);
- GraphNode n1 = new GraphNode(g, SWT.NONE, "Information", image1);
- GraphNode n2 = new GraphNode(g, SWT.NONE, "Warning", image2);
- GraphNode n3 = new GraphNode(g, SWT.NONE, "Error", image3);
-
- new GraphConnection(g, SWT.NONE, n1, n2);
- new GraphConnection(g, SWT.NONE, n2, n3);
- new GraphConnection(g, SWT.NONE, n3, n3);
-
- g.setLayoutAlgorithm(new SpringLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING), true);
-
- shell.open();
- while (!shell.isDisposed()) {
- while (!d.readAndDispatch()) {
- d.sleep();
- }
- }
- image1.dispose();
- image2.dispose();
- image3.dispose();
- }
-}
diff --git a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/GraphSnippet3.java b/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/GraphSnippet3.java
deleted file mode 100644
index 110fc4c..0000000
--- a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/GraphSnippet3.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright 2005-2007, CHISEL Group, University of Victoria, Victoria, BC, Canada.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * The Chisel Group, University of Victoria
- *******************************************************************************/
-package org.eclipse.zest.tests.swt;
-
-import org.eclipse.zest.core.widgets.Graph;
-import org.eclipse.zest.core.widgets.GraphConnection;
-import org.eclipse.zest.core.widgets.GraphNode;
-import org.eclipse.zest.core.widgets.ZestStyles;
-import org.eclipse.zest.layouts.LayoutStyles;
-import org.eclipse.zest.layouts.algorithms.SpringLayoutAlgorithm;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * Adds a selection listener to the nodes to tell when a selection event has
- * happened.
- *
- * @author Ian Bull
- *
- */
-public class GraphSnippet3 {
-
- public static void main(String[] args) {
- Display d = new Display();
- Shell shell = new Shell(d);
- Image image1 = Display.getDefault().getSystemImage(SWT.ICON_INFORMATION);
- Image image2 = Display.getDefault().getSystemImage(SWT.ICON_WARNING);
- Image image3 = Display.getDefault().getSystemImage(SWT.ICON_ERROR);
- shell.setLayout(new FillLayout());
- shell.setSize(400, 400);
-
- Graph g = new Graph(shell, SWT.NONE);
- g.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- System.out.println(((Graph) e.widget).getSelection());
- }
- });
-
- g.setConnectionStyle(ZestStyles.CONNECTIONS_DIRECTED);
- GraphNode n1 = new GraphNode(g, SWT.NONE, "Information", image1);
- GraphNode n2 = new GraphNode(g, SWT.NONE, "Warning", image2);
- GraphNode n3 = new GraphNode(g, SWT.NONE, "Error", image3);
-
- new GraphConnection(g, SWT.NONE, n1, n2);
- new GraphConnection(g, SWT.NONE, n2, n3);
-
- g.setLayoutAlgorithm(new SpringLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING), true);
-
- shell.open();
- while (!shell.isDisposed()) {
- while (!d.readAndDispatch()) {
- d.sleep();
- }
- }
- image1.dispose();
- image2.dispose();
- image3.dispose();
-
- }
-}
diff --git a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/GraphSnippet4.java b/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/GraphSnippet4.java
deleted file mode 100644
index 961797e..0000000
--- a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/GraphSnippet4.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright 2005-2007, CHISEL Group, University of Victoria, Victoria, BC, Canada.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * The Chisel Group, University of Victoria
- *******************************************************************************/
-package org.eclipse.zest.tests.swt;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.zest.core.widgets.Graph;
-import org.eclipse.zest.core.widgets.GraphConnection;
-import org.eclipse.zest.core.widgets.GraphNode;
-import org.eclipse.zest.core.widgets.ZestStyles;
-
-/**
- * This snippet shows how a custom figure can be used as a ToolTip for
- * connections. Let your mouse hover over an edge to see the custom tooltip.
- *
- * @author Ian Bull
- *
- */
-public class GraphSnippet4 {
-
- /**
- * Merges 2 images so they appear beside each other
- *
- * You must dispose this image!
- *
- * @param image1
- * @param image2
- * @param result
- * @return
- */
- public static Image mergeImages(Image image1, Image image2) {
- Image mergedImage = new Image(Display.getDefault(),
- image1.getBounds().width + image2.getBounds().width,
- image1.getBounds().height);
- GC gc = new GC(mergedImage.getDevice());
- gc.drawImage(image1, 0, 0);
- gc.drawImage(image2, image1.getBounds().width, 0);
- gc.dispose();
- return mergedImage;
- }
-
- /**
- * @param args
- */
- public static void main(String[] args) {
- Display d = new Display();
- Shell shell = new Shell(d);
- shell.setText("Graph Snippet 4");
- Image image1 = Display.getDefault()
- .getSystemImage(SWT.ICON_INFORMATION);
- Image image2 = Display.getDefault().getSystemImage(SWT.ICON_WARNING);
- Image image3 = Display.getDefault().getSystemImage(SWT.ICON_ERROR);
- shell.setLayout(new FillLayout());
- shell.setSize(400, 400);
-
- Graph g = new Graph(shell, SWT.NONE);
- g.setConnectionStyle(ZestStyles.CONNECTIONS_DIRECTED);
- GraphNode n1 = new GraphNode(g, SWT.NONE, "Information", image1);
- GraphNode n2 = new GraphNode(g, SWT.NONE, "Warning", image2);
- GraphNode n3 = new GraphNode(g, SWT.NONE, "Error", image3);
-
- GraphConnection connection1 = new GraphConnection(g, SWT.NONE, n1, n2);
- GraphConnection connection2 = new GraphConnection(g, SWT.NONE, n2, n3);
-
- Image information2warningImage = mergeImages(image1, image2);
- Image warning2error = mergeImages(image2, image3);
- IFigure tooltip1 = new Label("Information to Warning",
- information2warningImage);
- IFigure tooltip2 = new Label("Warning to Error", warning2error);
- connection1.setTooltip(tooltip1);
- connection2.setTooltip(tooltip2);
-
- n1.setLocation(10, 10);
- n2.setLocation(200, 10);
- n3.setLocation(200, 200);
-
- shell.open();
- while (!shell.isDisposed()) {
- while (!d.readAndDispatch()) {
- d.sleep();
- }
- }
-
- image1.dispose();
- image2.dispose();
- image3.dispose();
-
- information2warningImage.dispose();
- warning2error.dispose();
-
- }
-}
diff --git a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/GraphSnippet6.java b/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/GraphSnippet6.java
deleted file mode 100644
index a5f4a1a..0000000
--- a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/GraphSnippet6.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright 2005-2007, CHISEL Group, University of Victoria, Victoria, BC, Canada.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * The Chisel Group, University of Victoria
- *******************************************************************************/
-package org.eclipse.zest.tests.swt;
-
-import org.eclipse.zest.core.widgets.Graph;
-import org.eclipse.zest.core.widgets.GraphConnection;
-import org.eclipse.zest.core.widgets.GraphNode;
-import org.eclipse.zest.core.widgets.ZestStyles;
-import org.eclipse.zest.layouts.LayoutStyles;
-import org.eclipse.zest.layouts.algorithms.GridLayoutAlgorithm;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * This snippet creates a graph with 80*3 nodes (240 nodes). Only the icons are shown for the nodes, but if
- * you mouse over the node you get the entire text.
- *
- * @author Ian Bull
- *
- */
-public class GraphSnippet6 {
-
- /**
- * @param args
- */
- public static void main(String[] args) {
- Display d = new Display();
- Shell shell = new Shell(d);
- shell.setText("GraphSnippet6");
- Image image1 = Display.getDefault().getSystemImage(SWT.ICON_INFORMATION);
- Image image2 = Display.getDefault().getSystemImage(SWT.ICON_WARNING);
- Image image3 = Display.getDefault().getSystemImage(SWT.ICON_ERROR);
- shell.setLayout(new FillLayout());
- shell.setSize(800, 800);
-
- Graph g = new Graph(shell, SWT.NONE);
- g.setConnectionStyle(ZestStyles.CONNECTIONS_DIRECTED);
- for (int i = 0; i < 80; i++) {
- GraphNode n1 = new GraphNode(g, ZestStyles.NODES_HIDE_TEXT | ZestStyles.NODES_FISHEYE, "Information", image1);
- GraphNode n2 = new GraphNode(g, ZestStyles.NODES_HIDE_TEXT | ZestStyles.NODES_FISHEYE, "Warning", image2);
- GraphNode n3 = new GraphNode(g, ZestStyles.NODES_HIDE_TEXT | ZestStyles.NODES_FISHEYE, "Error", image3);
- new GraphConnection(g, SWT.NONE, n1, n2);
- new GraphConnection(g, SWT.NONE, n2, n3);
- new GraphConnection(g, SWT.NONE, n3, n3);
- }
- g.setLayoutAlgorithm(new GridLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING), true);
-
- shell.open();
- while (!shell.isDisposed()) {
- while (!d.readAndDispatch()) {
- d.sleep();
- }
- }
- image1.dispose();
- image2.dispose();
- image3.dispose();
-
- }
-
-}
diff --git a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/GraphSnippet8.java b/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/GraphSnippet8.java
deleted file mode 100644
index cd184e3..0000000
--- a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/GraphSnippet8.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*******************************************************************************
- * Copyright 2005-2007, CHISEL Group, University of Victoria, Victoria, BC,
- * Canada. All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: The Chisel Group, University of Victoria
- ******************************************************************************/
-package org.eclipse.zest.tests.swt;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.zest.core.widgets.Graph;
-import org.eclipse.zest.core.widgets.GraphConnection;
-import org.eclipse.zest.core.widgets.GraphNode;
-import org.eclipse.zest.core.widgets.ZestStyles;
-import org.eclipse.zest.layouts.Filter;
-import org.eclipse.zest.layouts.LayoutItem;
-import org.eclipse.zest.layouts.LayoutStyles;
-import org.eclipse.zest.layouts.algorithms.TreeLayoutAlgorithm;
-
-/**
- * This snippet shows how to filter elements in the layout. The Data on the tree
- * connections are set to "False", meaning they won't be filtered.
- *
- * @author Ian Bull
- *
- */
-public class GraphSnippet8 {
-
- /**
- * @param args
- */
- public static void main(String[] args) {
- Display display = new Display();
- Shell shell = new Shell(display);
- shell.setText("GraphSnippet8");
- shell.setLayout(new FillLayout());
- shell.setSize(400, 400);
-
- final Graph graph = new Graph(shell, SWT.NONE);
-
- GraphNode a = new GraphNode(graph, SWT.NONE, "Root");
- GraphNode b = new GraphNode(graph, SWT.NONE, "B");
- GraphNode c = new GraphNode(graph, SWT.NONE, "C");
- GraphNode d = new GraphNode(graph, SWT.NONE, "D");
- GraphNode e = new GraphNode(graph, SWT.NONE, "E");
- GraphNode f = new GraphNode(graph, SWT.NONE, "F");
- GraphNode g = new GraphNode(graph, SWT.NONE, "G");
- GraphNode h = new GraphNode(graph, SWT.NONE, "H");
- GraphConnection connection = new GraphConnection(graph, SWT.NONE, a, b);
- connection.setData(Boolean.FALSE);
- connection = new GraphConnection(graph, SWT.NONE, a, c);
- connection.setData(Boolean.FALSE);
- connection = new GraphConnection(graph, SWT.NONE, a, c);
- connection.setData(Boolean.FALSE);
- connection = new GraphConnection(graph, SWT.NONE, a, d);
- connection.setData(Boolean.FALSE);
- connection = new GraphConnection(graph, SWT.NONE, b, e);
- connection.setData(Boolean.FALSE);
- connection = new GraphConnection(graph, SWT.NONE, b, f);
- connection.setData(Boolean.FALSE);
- connection = new GraphConnection(graph, SWT.NONE, c, g);
- connection.setData(Boolean.FALSE);
- connection = new GraphConnection(graph, SWT.NONE, d, h);
- connection.setData(Boolean.FALSE);
-
- connection = new GraphConnection(graph,
- ZestStyles.CONNECTIONS_DIRECTED, b, c);
- connection.setLineColor(ColorConstants.red());
- connection.setLineWidth(3);
- connection = new GraphConnection(graph,
- ZestStyles.CONNECTIONS_DIRECTED, c, d);
- connection.setLineColor(ColorConstants.red());
- connection.setLineWidth(3);
- connection = new GraphConnection(graph,
- ZestStyles.CONNECTIONS_DIRECTED, e, f);
- connection.setLineColor(ColorConstants.red());
- connection.setLineWidth(3);
- connection = new GraphConnection(graph,
- ZestStyles.CONNECTIONS_DIRECTED, f, g);
- connection.setLineColor(ColorConstants.red());
- connection.setLineWidth(3);
-
- connection = new GraphConnection(graph,
- ZestStyles.CONNECTIONS_DIRECTED, h, e);
- connection.setLineColor(ColorConstants.red());
- connection.setLineWidth(3);
-
- TreeLayoutAlgorithm treeLayoutAlgorithm = new TreeLayoutAlgorithm(
- LayoutStyles.NO_LAYOUT_NODE_RESIZING);
- Filter filter = new Filter() {
- public boolean isObjectFiltered(LayoutItem item) {
-
- // Get the "Connection" from the Layout Item
- // and use this connection to get the "Graph Data"
- Object object = item.getGraphData();
- if (object instanceof GraphConnection) {
- GraphConnection connection = (GraphConnection) object;
- if (connection.getData() != null
- && connection.getData() instanceof Boolean) {
- // If the data is false, don't filter, otherwise,
- // filter.
- return ((Boolean) connection.getData()).booleanValue();
- }
- return true;
- }
- return false;
- }
-
- };
- treeLayoutAlgorithm.setFilter(filter);
- graph.setLayoutAlgorithm(treeLayoutAlgorithm, true);
-
- shell.open();
- while (!shell.isDisposed()) {
- while (!display.readAndDispatch()) {
- display.sleep();
- }
- }
- }
-
-}
diff --git a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/GraphSnippet9.java b/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/GraphSnippet9.java
deleted file mode 100644
index 1ff0ce8..0000000
--- a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/GraphSnippet9.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright 2005-2007, CHISEL Group, University of Victoria, Victoria, BC,
- * Canada. All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: The Chisel Group, University of Victoria
- ******************************************************************************/
-package org.eclipse.zest.tests.swt;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.zest.core.widgets.Graph;
-import org.eclipse.zest.core.widgets.GraphConnection;
-import org.eclipse.zest.core.widgets.GraphNode;
-import org.eclipse.zest.core.widgets.ZestStyles;
-
-/**
- * This snippet demonstrates a self loop with a label.
- *
- * @author Ian Bull
- *
- */
-public class GraphSnippet9 {
-
- /**
- * @param args
- */
- public static void main(String[] args) {
- Display display = new Display();
- Shell shell = new Shell(display);
- shell.setText("GraphSnippet9");
- shell.setLayout(new FillLayout());
- shell.setSize(400, 400);
-
- final Graph graph = new Graph(shell, SWT.NONE);
-
- GraphNode a = new GraphNode(graph, ZestStyles.CONNECTIONS_DIRECTED, "Root");
- GraphConnection connection = new GraphConnection(graph, SWT.NONE, a, a);
- connection.setText("A to A");
- a.setLocation(100, 100);
-
- shell.open();
- while (!shell.isDisposed()) {
- while (!display.readAndDispatch()) {
- display.sleep();
- }
- }
- }
-
-}
diff --git a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/HelloWorld.java b/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/HelloWorld.java
deleted file mode 100644
index b28ee50..0000000
--- a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/HelloWorld.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright 2005-2007, CHISEL Group, University of Victoria, Victoria, BC,
- * Canada. All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: The Chisel Group, University of Victoria
- ******************************************************************************/
-package org.eclipse.zest.tests.swt;
-
-import org.eclipse.zest.core.widgets.Graph;
-import org.eclipse.zest.core.widgets.GraphConnection;
-import org.eclipse.zest.core.widgets.GraphNode;
-import org.eclipse.zest.layouts.LayoutStyles;
-import org.eclipse.zest.layouts.algorithms.SpringLayoutAlgorithm;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * Hello, World! Program
- *
- * @author irbull
- *
- */
-public class HelloWorld {
-
- /**
- * @param args
- */
- public static void main(String[] args) {
- Display d = new Display();
- Shell shell = new Shell(d);
- shell.setText("Hello, World");
- shell.setLayout(new FillLayout());
- shell.setSize(400, 400);
-
- Graph g = new Graph(shell, SWT.NONE);
- GraphNode hello = new GraphNode(g, SWT.NONE, "Hello");
- GraphNode world = new GraphNode(g, SWT.NONE, "World");
- new GraphConnection(g, SWT.NONE, hello, world);
- g.setLayoutAlgorithm(new SpringLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING), true);
-
- shell.open();
- while (!shell.isDisposed()) {
- while (!d.readAndDispatch()) {
- d.sleep();
- }
- }
- }
-
-}
diff --git a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/LayoutExample.java b/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/LayoutExample.java
deleted file mode 100644
index 70f0e42..0000000
--- a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/LayoutExample.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright 2005-2007, CHISEL Group, University of Victoria, Victoria, BC,
- * Canada. All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: The Chisel Group, University of Victoria
- ******************************************************************************/
-package org.eclipse.zest.tests.swt;
-
-import org.eclipse.zest.core.widgets.ConstraintAdapter;
-import org.eclipse.zest.core.widgets.Graph;
-import org.eclipse.zest.core.widgets.GraphConnection;
-import org.eclipse.zest.core.widgets.GraphNode;
-import org.eclipse.zest.layouts.LayoutStyles;
-import org.eclipse.zest.layouts.algorithms.SpringLayoutAlgorithm;
-import org.eclipse.zest.layouts.constraints.BasicEdgeConstraints;
-import org.eclipse.zest.layouts.constraints.LayoutConstraint;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * This snippet shows how to use the findFigureAt to get the figure under the
- * mouse
- *
- * @author Ian Bull
- *
- */
-public class LayoutExample {
-
- /**
- * @param args
- */
- public static void main(String[] args) {
- // Create the shell
- Display d = new Display();
- Shell shell = new Shell(d);
- shell.setText("GraphSnippet1");
- shell.setLayout(new FillLayout());
- shell.setSize(400, 400);
-
- final Graph g = new Graph(shell, SWT.NONE);
- GraphNode root = new GraphNode(g, SWT.NONE, "Root");
- for (int i = 0; i < 3; i++) {
- GraphNode n = new GraphNode(g, SWT.NONE, "1 - " + i);
- for (int j = 0; j < 3; j++) {
- GraphNode n2 = new GraphNode(g, SWT.NONE, "2 - " + j);
- new GraphConnection(g, SWT.NONE, n, n2);
- }
- new GraphConnection(g, SWT.NONE, root, n);
- }
-
- SpringLayoutAlgorithm springLayoutAlgorithm = new SpringLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING);
-
- ConstraintAdapter constraintAdapters = new ConstraintAdapter() {
-
- public void populateConstraint(Object object, LayoutConstraint constraint) {
- if (constraint instanceof BasicEdgeConstraints) {
- BasicEdgeConstraints basicEdgeConstraints = (BasicEdgeConstraints) constraint;
- GraphConnection connection = (GraphConnection) object;
- if (connection.getSource().getText().equals("Root")) {
- basicEdgeConstraints.weight = 1;
- }
- else {
- basicEdgeConstraints.weight = -1;
- }
- }
-
- }
- };
-
- g.addConstraintAdapter(constraintAdapters);
- g.setLayoutAlgorithm(springLayoutAlgorithm, true);
-
- shell.open();
- while (!shell.isDisposed()) {
- while (!d.readAndDispatch()) {
- d.sleep();
- }
- }
- }
-
-}
diff --git a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/NestedGraphSnippet.java b/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/NestedGraphSnippet.java
deleted file mode 100644
index f3e9587..0000000
--- a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/NestedGraphSnippet.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright 2005-2007, CHISEL Group, University of Victoria, Victoria, BC,
- * Canada. All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: The Chisel Group, University of Victoria
- ******************************************************************************/
-package org.eclipse.zest.tests.swt;
-
-import org.eclipse.zest.core.widgets.Graph;
-import org.eclipse.zest.core.widgets.GraphConnection;
-import org.eclipse.zest.core.widgets.GraphContainer;
-import org.eclipse.zest.core.widgets.GraphNode;
-import org.eclipse.zest.core.widgets.ZestStyles;
-import org.eclipse.zest.layouts.LayoutAlgorithm;
-import org.eclipse.zest.layouts.LayoutStyles;
-import org.eclipse.zest.layouts.algorithms.CompositeLayoutAlgorithm;
-import org.eclipse.zest.layouts.algorithms.GridLayoutAlgorithm;
-import org.eclipse.zest.layouts.algorithms.HorizontalShift;
-import org.eclipse.zest.layouts.algorithms.RadialLayoutAlgorithm;
-import org.eclipse.zest.layouts.algorithms.TreeLayoutAlgorithm;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-public class NestedGraphSnippet {
-
- private static Image image1;
- private static Image classImage;
-
- public static void createContainer(Graph g) {
- GraphContainer a = new GraphContainer(g, SWT.NONE, "SomeClass.java", classImage);
- int r = (int) ((Math.random() * 3) + 1);
- r = 2;
- populateContainer(a, g, r, true);
- for (int i = 0; i < 4; i++) {
- GraphContainer b = new GraphContainer(g, SWT.NONE, "SomeNestedClass.java", classImage);
- r = (int) ((Math.random() * 3) + 1);
- r = 2;
- populateContainer(b, g, r, false);
- new GraphConnection(g, SWT.NONE, a, b);
- for (int j = 0; j < 4; j++) {
- GraphContainer c = new GraphContainer(g, SWT.NONE, "DefaultAction.java", classImage);
- r = (int) ((Math.random() * 3) + 1);
- r = 2;
- populateContainer(c, g, r, true);
- new GraphConnection(g, SWT.NONE, b, c);
- }
- }
- }
-
- public static void populateContainer(GraphContainer c, Graph g, int number, boolean radial) {
- GraphNode a = new GraphNode(c, ZestStyles.NODES_FISHEYE | ZestStyles.NODES_HIDE_TEXT, "SomeClass.java", classImage);
- for (int i = 0; i < 4; i++) {
- GraphNode b = new GraphNode(c, ZestStyles.NODES_FISHEYE | ZestStyles.NODES_HIDE_TEXT, "SomeNestedClass.java", classImage);
- new GraphConnection(g, SWT.NONE, a, b);
- for (int j = 0; j < 4; j++) {
- GraphNode d = new GraphNode(c, ZestStyles.NODES_FISHEYE | ZestStyles.NODES_HIDE_TEXT, "DefaultAction.java", classImage);
- new GraphConnection(g, SWT.NONE, b, d);
- if (number > 2) {
- for (int k = 0; k < 4; k++) {
- GraphNode e = new GraphNode(c, ZestStyles.NODES_FISHEYE | ZestStyles.NODES_HIDE_TEXT, "LastAction(Hero).java", classImage);
- new GraphConnection(g, SWT.NONE, d, e);
- if (number > 3) {
- for (int l = 0; l < 4; l++) {
- GraphNode f = new GraphNode(c, ZestStyles.NODES_FISHEYE | ZestStyles.NODES_HIDE_TEXT, "LastAction(Hero).java", classImage);
- new GraphConnection(g, SWT.NONE, e, f);
- }
- }
- }
- }
- }
- }
- if (number == 1) {
- c.setScale(0.75);
- } else if (number == 2) {
- c.setScale(0.50);
- } else {
- c.setScale(0.25);
- }
- if (radial) {
- c.setLayoutAlgorithm(new RadialLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING), true);
- } else {
- c.setLayoutAlgorithm(new TreeLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING), true);
- }
- }
-
- /**
- * @param args
- */
- public static void main(String[] args) {
- // Create the shell
- Display d = new Display();
-
- image1 = new Image(Display.getDefault(), NestedGraphSnippet.class.getResourceAsStream("package_obj.gif"));
- classImage = new Image(Display.getDefault(), NestedGraphSnippet.class.getResourceAsStream("class_obj.gif"));
-
- Shell shell = new Shell(d);
- shell.setText("GraphSnippet1");
- shell.setLayout(new FillLayout());
- shell.setSize(500, 800);
-
- Graph g = new Graph(shell, SWT.NONE);
- createContainer(g);
-
- CompositeLayoutAlgorithm compositeLayoutAlgorithm = new CompositeLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING, new LayoutAlgorithm[] { new GridLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING), new HorizontalShift(LayoutStyles.NO_LAYOUT_NODE_RESIZING) });
- //g.setLayoutAlgorithm(new GridLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING), true);
- g.setLayoutAlgorithm(compositeLayoutAlgorithm, true);
-
- shell.open();
- while (!shell.isDisposed()) {
- while (!d.readAndDispatch()) {
- d.sleep();
- }
- }
- image1.dispose();
- }
-}
diff --git a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/NestedGraphSnippet2.java b/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/NestedGraphSnippet2.java
deleted file mode 100644
index 1922b19..0000000
--- a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/NestedGraphSnippet2.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright 2005-2007, CHISEL Group, University of Victoria, Victoria, BC,
- * Canada. All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: The Chisel Group, University of Victoria
- ******************************************************************************/
-package org.eclipse.zest.tests.swt;
-
-import org.eclipse.zest.core.widgets.Graph;
-import org.eclipse.zest.core.widgets.GraphConnection;
-import org.eclipse.zest.core.widgets.GraphContainer;
-import org.eclipse.zest.core.widgets.GraphNode;
-import org.eclipse.zest.core.widgets.ZestStyles;
-import org.eclipse.zest.layouts.LayoutStyles;
-import org.eclipse.zest.layouts.algorithms.GridLayoutAlgorithm;
-import org.eclipse.zest.layouts.algorithms.SpringLayoutAlgorithm;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-public class NestedGraphSnippet2 {
-
- public static void main(String[] args) {
- // Create the shell
- Display d = new Display();
- Shell shell = new Shell(d);
- shell.setText("GraphSnippet1");
- shell.setLayout(new FillLayout());
- shell.setSize(400, 400);
-
- Graph g = new Graph(shell, SWT.NONE);
-
- /* Machines */
- GraphContainer machine1 = new GraphContainer(g, SWT.NONE);
- machine1.setText("Machine 1 (prop:1)");
- GraphContainer machine2 = new GraphContainer(g, SWT.NONE);
- machine2.setText("Machine 2");
- GraphContainer machine3 = new GraphContainer(g, SWT.NONE);
- machine3.setText("Machine 3");
-
- /* Network */
- GraphConnection networkConnection = new GraphConnection(g, ZestStyles.CONNECTIONS_DIRECTED, machine1, machine2);
- networkConnection.setText("Network (bandwidth:1) ");
- new GraphConnection(g, SWT.NONE, machine2, machine3);
-
- /* Containers */
- GraphContainer container1 = new GraphContainer(machine1, SWT.NONE);
- container1.setText("Host 1");
- GraphContainer container2 = new GraphContainer(machine1, SWT.NONE);
- container2.setText("Host 2");
-
- GraphContainer container3 = new GraphContainer(machine2, SWT.NONE);
- container3.setText("Host 3");
- GraphContainer container4 = new GraphContainer(machine3, SWT.NONE);
- container4.setText("Host 4");
-
- /* Objects */
- GraphNode object1 = new GraphNode(container1, ZestStyles.NODES_FISHEYE, "JSP Object");
- GraphNode object2 = new GraphNode(container1, ZestStyles.NODES_FISHEYE, "JSP Object 2");
- GraphNode object3 = new GraphNode(container2, ZestStyles.NODES_FISHEYE, "JSP Object 3");
- GraphNode object4 = new GraphNode(container3, ZestStyles.NODES_FISHEYE, "JSP Object 4");
- GraphNode object5 = new GraphNode(container4, ZestStyles.NODES_FISHEYE, "JSP Object 5");
-
- /* Connections */
- new GraphConnection(g, ZestStyles.CONNECTIONS_DIRECTED, object1, object2);
- new GraphConnection(g, ZestStyles.CONNECTIONS_DIRECTED, object2, object3);
- new GraphConnection(g, ZestStyles.CONNECTIONS_DIRECTED, object3, object4);
- new GraphConnection(g, ZestStyles.CONNECTIONS_DIRECTED, object4, object5);
-
- container1.setLayoutAlgorithm(new GridLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING), true);
- container2.setLayoutAlgorithm(new GridLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING), true);
- container3.setLayoutAlgorithm(new GridLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING), true);
- container3.setLayoutAlgorithm(new GridLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING), true);
- g.setLayoutAlgorithm(new SpringLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING), true);
-
- shell.open();
- while (!shell.isDisposed()) {
- while (!d.readAndDispatch()) {
- d.sleep();
- }
- }
- }
-}
diff --git a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/ZoomSnippet.java b/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/ZoomSnippet.java
deleted file mode 100644
index 1a08e82..0000000
--- a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/ZoomSnippet.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*******************************************************************************
- * Copyright 2005-2007, CHISEL Group, University of Victoria, Victoria, BC,
- * Canada. All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: The Chisel Group, University of Victoria
- ******************************************************************************/
-package org.eclipse.zest.tests.swt;
-
-import org.eclipse.zest.core.widgets.Graph;
-import org.eclipse.zest.core.widgets.GraphConnection;
-import org.eclipse.zest.core.widgets.GraphContainer;
-import org.eclipse.zest.core.widgets.GraphItem;
-import org.eclipse.zest.core.widgets.GraphNode;
-import org.eclipse.zest.core.widgets.ZestStyles;
-import org.eclipse.zest.layouts.LayoutAlgorithm;
-import org.eclipse.zest.layouts.LayoutStyles;
-import org.eclipse.zest.layouts.algorithms.CompositeLayoutAlgorithm;
-import org.eclipse.zest.layouts.algorithms.GridLayoutAlgorithm;
-import org.eclipse.zest.layouts.algorithms.HorizontalShift;
-import org.eclipse.zest.layouts.algorithms.RadialLayoutAlgorithm;
-import org.eclipse.zest.layouts.algorithms.TreeLayoutAlgorithm;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.KeyListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-public class ZoomSnippet {
-
- private static Image image1;
- private static Image classImage;
-
- public static void createContainer(Graph g) {
- GraphContainer a = new GraphContainer(g, SWT.NONE, "SomeClass.java", classImage);
- int r = (int) ((Math.random() * 3) + 1);
- r = 2;
- populateContainer(a, g, r, true);
- for (int i = 0; i < 4; i++) {
- GraphContainer b = new GraphContainer(g, SWT.NONE, "SomeNestedClass.java", classImage);
- r = (int) ((Math.random() * 3) + 1);
- r = 2;
- populateContainer(b, g, r, false);
- new GraphConnection(g, SWT.NONE, a, b);
- for (int j = 0; j < 4; j++) {
- GraphContainer c = new GraphContainer(g, SWT.NONE, "DefaultAction.java", classImage);
- r = (int) ((Math.random() * 3) + 1);
- r = 2;
- populateContainer(c, g, r, true);
- new GraphConnection(g, SWT.NONE, b, c);
- }
- }
- }
-
- public static void populateContainer(GraphContainer c, Graph g, int number, boolean radial) {
- GraphNode a = new GraphNode(c, ZestStyles.NODES_FISHEYE | ZestStyles.NODES_HIDE_TEXT, "SomeClass.java", classImage);
- for (int i = 0; i < 4; i++) {
- GraphNode b = new GraphNode(c, ZestStyles.NODES_FISHEYE | ZestStyles.NODES_HIDE_TEXT, "SomeNestedClass.java", classImage);
- new GraphConnection(g, SWT.NONE, a, b);
- for (int j = 0; j < 4; j++) {
- GraphNode d = new GraphNode(c, ZestStyles.NODES_FISHEYE | ZestStyles.NODES_HIDE_TEXT, "DefaultAction.java", classImage);
- new GraphConnection(g, SWT.NONE, b, d);
- if (number > 2) {
- for (int k = 0; k < 4; k++) {
- GraphNode e = new GraphNode(c, ZestStyles.NODES_FISHEYE | ZestStyles.NODES_HIDE_TEXT, "LastAction(Hero).java", classImage);
- new GraphConnection(g, SWT.NONE, d, e);
- if (number > 3) {
- for (int l = 0; l < 4; l++) {
- GraphNode f = new GraphNode(c, ZestStyles.NODES_FISHEYE | ZestStyles.NODES_HIDE_TEXT, "LastAction(Hero).java", classImage);
- new GraphConnection(g, SWT.NONE, e, f);
- }
- }
- }
- }
- }
- }
- if (number == 1) {
- c.setScale(0.75);
- } else if (number == 2) {
- c.setScale(0.50);
- } else {
- c.setScale(0.25);
- }
- if (radial) {
- c.setLayoutAlgorithm(new RadialLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING), true);
- } else {
- c.setLayoutAlgorithm(new TreeLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING), true);
- }
- }
-
- /**
- * @param args
- */
- public static void main(String[] args) {
- // Create the shell
- Display d = new Display();
-
- image1 = new Image(Display.getDefault(), ZoomSnippet.class.getResourceAsStream("package_obj.gif"));
- classImage = new Image(Display.getDefault(), ZoomSnippet.class.getResourceAsStream("class_obj.gif"));
-
- Shell shell = new Shell(d);
- shell.setText("GraphSnippet1");
- shell.setLayout(new FillLayout());
- shell.setSize(500, 800);
-
- final Graph g = new Graph(shell, SWT.NONE);
- createContainer(g);
-
- CompositeLayoutAlgorithm compositeLayoutAlgorithm = new CompositeLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING, new LayoutAlgorithm[] { new GridLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING), new HorizontalShift(LayoutStyles.NO_LAYOUT_NODE_RESIZING) });
- //g.setLayoutAlgorithm(new GridLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING), true);
- g.setLayoutAlgorithm(compositeLayoutAlgorithm, true);
-
- g.addKeyListener(new KeyListener() {
- boolean flip = true;
-
- public void keyPressed(KeyEvent e) {
-
- if (g.getSelection().size() == 1) {
- GraphNode item = (GraphNode) g.getSelection().get(0);
- if (item.getItemType() == GraphItem.CONTAINER) {
- if (flip) {
- (item).setSize(500, 100);
- } else {
- (item).setSize(0, 0);
- }
- flip = !flip;
- }
- }
-
- }
-
- public void keyReleased(KeyEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- });
-
- shell.open();
- while (!shell.isDisposed()) {
- while (!d.readAndDispatch()) {
- d.sleep();
- }
- }
- image1.dispose();
- }
-}
diff --git a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/class_obj.gif b/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/class_obj.gif
deleted file mode 100644
index e4c2a83..0000000
--- a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/class_obj.gif
+++ /dev/null
Binary files differ
diff --git a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/package_obj.gif b/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/package_obj.gif
deleted file mode 100644
index 131c28d..0000000
--- a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/swt/package_obj.gif
+++ /dev/null
Binary files differ
diff --git a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/uml/CompartmentFigure.java b/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/uml/CompartmentFigure.java
deleted file mode 100644
index 6f625a8..0000000
--- a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/uml/CompartmentFigure.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright 2005-2007, CHISEL Group, University of Victoria, Victoria, BC,
- * Canada. All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: The Chisel Group, University of Victoria
- ******************************************************************************/
-package org.eclipse.zest.tests.uml;
-
-import org.eclipse.draw2d.AbstractBorder;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.draw2d.geometry.Insets;
-
-public class CompartmentFigure extends Figure {
-
- public CompartmentFigure() {
- ToolbarLayout layout = new ToolbarLayout();
- layout.setMinorAlignment(ToolbarLayout.ALIGN_TOPLEFT);
- layout.setStretchMinorAxis(false);
- layout.setSpacing(2);
- setLayoutManager(layout);
- setBorder(new CompartmentFigureBorder());
- }
-
- class CompartmentFigureBorder extends AbstractBorder {
- public Insets getInsets(IFigure figure) {
- return new Insets(1, 0, 0, 0);
- }
-
- public void paint(IFigure figure, Graphics graphics, Insets insets) {
- graphics.drawLine(getPaintRectangle(figure, insets).getTopLeft(), tempRect.getTopRight());
- }
- }
-}
diff --git a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/uml/UMLClassFigure.java b/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/uml/UMLClassFigure.java
deleted file mode 100644
index 5851162..0000000
--- a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/uml/UMLClassFigure.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright 2005-2007, CHISEL Group, University of Victoria, Victoria, BC,
- * Canada. All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: The Chisel Group, University of Victoria
- ******************************************************************************/
-package org.eclipse.zest.tests.uml;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.LineBorder;
-import org.eclipse.draw2d.ToolbarLayout;
-
-public class UMLClassFigure extends Figure {
-
- private CompartmentFigure attributeFigure = new CompartmentFigure();
- private CompartmentFigure methodFigure = new CompartmentFigure();
-
- public UMLClassFigure(Label name) {
- ToolbarLayout layout = new ToolbarLayout();
- setLayoutManager(layout);
- setBorder(new LineBorder(ColorConstants.black(), 1));
- setBackgroundColor(UMLExample.classColor);
- setOpaque(true);
-
- add(name);
- add(attributeFigure);
- add(methodFigure);
- }
-
- public CompartmentFigure getAttributesCompartment() {
- return attributeFigure;
- }
-
- public CompartmentFigure getMethodsCompartment() {
- return methodFigure;
- }
-}
diff --git a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/uml/UMLExample.java b/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/uml/UMLExample.java
deleted file mode 100644
index e659d00..0000000
--- a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/uml/UMLExample.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*******************************************************************************
- * Copyright 2005-2007, CHISEL Group, University of Victoria, Victoria, BC, Canada.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * The Chisel Group, University of Victoria
- *******************************************************************************/
-package org.eclipse.zest.tests.uml;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.zest.core.widgets.Graph;
-import org.eclipse.zest.core.widgets.GraphConnection;
-import org.eclipse.zest.core.widgets.GraphContainer;
-import org.eclipse.zest.core.widgets.GraphNode;
-import org.eclipse.zest.core.widgets.IContainer;
-import org.eclipse.zest.core.widgets.ZestStyles;
-import org.eclipse.zest.layouts.LayoutStyles;
-import org.eclipse.zest.layouts.algorithms.SpringLayoutAlgorithm;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * Adds a selection listener to the nodes to tell when a selection event has
- * happened.
- *
- * @author Ian Bull
- *
- */
-public class UMLExample {
- public static Color classColor = null;
-
- public static IFigure createClassFigure1(Font classFont, Image classImage, Image publicField, Image privateField) {
- Label classLabel1 = new Label("Table", classImage);
- classLabel1.setFont(classFont);
-
- UMLClassFigure classFigure = new UMLClassFigure(classLabel1);
- Label attribute1 = new Label("columns: Column[]", privateField);
-
- Label attribute2 = new Label("rows: Row[]", privateField);
-
- Label method1 = new Label("getColumns(): Column[]", publicField);
- Label method2 = new Label("getRows(): Row[]", publicField);
- classFigure.getAttributesCompartment().add(attribute1);
- classFigure.getAttributesCompartment().add(attribute2);
- classFigure.getMethodsCompartment().add(method1);
- classFigure.getMethodsCompartment().add(method2);
- classFigure.setSize(-1, -1);
-
- return classFigure;
- }
-
- public static IFigure createClassFigure2(Font classFont, Image classImage, Image publicField, Image privateField) {
- Label classLabel2 = new Label("Column", classImage);
- classLabel2.setFont(classFont);
-
- UMLClassFigure classFigure = new UMLClassFigure(classLabel2);
- Label attribute3 = new Label("columnID: int", privateField );
- Label attribute4 = new Label("items: List", privateField);
-
- Label method3 = new Label("getColumnID(): int", publicField);
- Label method4 = new Label("getItems(): List", publicField);
-
- classFigure.getAttributesCompartment().add(attribute3);
- classFigure.getAttributesCompartment().add(attribute4);
- classFigure.getMethodsCompartment().add(method3);
- classFigure.getMethodsCompartment().add(method4);
- classFigure.setSize(-1, -1);
-
- return classFigure;
- }
-
- static class UMLNode extends GraphNode {
-
- IFigure customFigure = null;
-
- public UMLNode(IContainer graphModel, int style, IFigure figure) {
- super(graphModel, style, figure);
- }
-
- protected IFigure createFigureForModel() {
- return (IFigure) this.getData();
- }
-
- }
-
- /**
- * @param args
- */
- public static void main(String[] args) {
- Display d = new Display();
- Shell shell = new Shell(d);
- shell.setLayout(new FillLayout());
- shell.setSize(400, 400);
- classColor = new Color(null, 255, 255, 206);
-
- Font classFont = new Font(null, "Arial", 12, SWT.BOLD);
- Image classImage = new Image(Display.getDefault(), UMLClassFigure.class.getResourceAsStream("class_obj.gif"));
- Image privateField = new Image(Display.getDefault(), UMLClassFigure.class.getResourceAsStream("field_private_obj.gif"));
- Image publicField= new Image(Display.getDefault(), UMLClassFigure.class.getResourceAsStream("methpub_obj.gif"));
-
- Graph g = new Graph(shell, SWT.NONE);
- g.setConnectionStyle(ZestStyles.CONNECTIONS_DIRECTED);
- GraphContainer c = new GraphContainer(g, SWT.NONE);
- c.setText("A UML Container");
- UMLNode n = new UMLNode(c, SWT.NONE, createClassFigure1(classFont, classImage, publicField, privateField));
-
- GraphNode n1 = new UMLNode(g, SWT.NONE, createClassFigure1(classFont, classImage, publicField, privateField));
- GraphNode n2 = new UMLNode(g, SWT.NONE, createClassFigure2(classFont, classImage, publicField, privateField));
-
- new GraphConnection(g, SWT.NONE, n1, n2);
- new GraphConnection(g, SWT.NONE, n, n1);
-
- c.setLayoutAlgorithm(new SpringLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING), true);
- g.setLayoutAlgorithm(new SpringLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING), true);
-
- shell.open();
- while (!shell.isDisposed()) {
- while (!d.readAndDispatch()) {
- d.sleep();
- }
- }
- classColor.dispose();
- classFont.dispose();
- classImage.dispose();
- publicField.dispose();
- privateField.dispose();
-
- }
-}
diff --git a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/uml/class_obj.gif b/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/uml/class_obj.gif
deleted file mode 100644
index cf33d93..0000000
--- a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/uml/class_obj.gif
+++ /dev/null
Binary files differ
diff --git a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/uml/field_private_obj.gif b/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/uml/field_private_obj.gif
deleted file mode 100644
index 864feee..0000000
--- a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/uml/field_private_obj.gif
+++ /dev/null
Binary files differ
diff --git a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/uml/methpub_obj.gif b/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/uml/methpub_obj.gif
deleted file mode 100644
index ecf40d2..0000000
--- a/tests/org.eclipse.zest.tests/src/org/eclipse/zest/tests/uml/methpub_obj.gif
+++ /dev/null
Binary files differ
diff --git a/tests/org.eclipse.zest.tests/test.xml b/tests/org.eclipse.zest.tests/test.xml
deleted file mode 100644
index f5ceabc..0000000
--- a/tests/org.eclipse.zest.tests/test.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-<?xml version="1.0"?>
-
-<project name="testsuite" default="junits" basedir=".">
- <property name="classname" value="org.eclipse.zest.test.ZestTestSuite" />
-
- <!-- The property ${eclipse-home} should be passed into this script -->
- <!-- Set a meaningful default value for when it is not. -->
- <property name="eclipse-home" value="${basedir}\..\.." />
-
- <!-- sets the properties eclipse-home, and library-file -->
- <property name="plugin-name" value="org.eclipse.zest.tests" />
- <property name="library-file" value="${eclipse-home}/dropins/eclipse/plugins/org.eclipse.test/library.xml" />
-
- <!-- This target holds all initialization code that needs to be done for -->
- <!-- all tests that are to be run. Initialization for individual tests -->
- <!-- should be done within the body of the suite target. -->
- <target name="init">
- <tstamp />
- <delete>
- <fileset dir="${eclipse-home}" includes="org*.xml" />
- </delete>
- </target>
-
- <!-- This target defines the tests that need to be run. -->
- <target name="suite">
- <property name="zest-folder" value="${eclipse-home}/zest_folder" />
- <delete dir="${zest-folder}" quiet="true" />
-
- <!-- TODO: create overall TestSuite & enable running Zest tests as part of build -->
- <echo message="Zest tests are currently disabled as there is no overall TestSuite."/>
- <!--
- <ant target="ui-test" antfile="${library-file}" dir="${eclipse-home}">
- <property name="data-dir" value="${zest-folder}" />
- <property name="plugin-name" value="${plugin-name}" />
- <property name="classname" value="${classname}" />
- </ant>
- -->
- </target>
-
- <!-- This target holds code to cleanup the testing environment after -->
- <!-- after all of the tests have been run. You can use this target to -->
- <!-- delete temporary files that have been created. -->
- <target name="cleanup">
- <mkdir dir="${results}/consolelogs" />
- <copy failonerror="false" file="${eclipse-home}/results/${classname}.txt" tofile="${results}/consolelogs/${classname}_${platform}.metadata.log.txt" />
- </target>
-
- <!-- This target runs the test suite. Any actions that need to happen -->
- <!-- after all the tests have been run should go here. -->
- <target name="junits" depends="init,suite,cleanup">
- <ant target="collect" antfile="${library-file}" dir="${eclipse-home}">
- <property name="includes" value="org*.xml" />
- <property name="output-file" value="${plugin-name}.xml" />
- </ant>
- </target>
-
-</project>
diff --git a/tests/org.eclipse.zest.tests/zx.png b/tests/org.eclipse.zest.tests/zx.png
deleted file mode 100644
index fb3bd00..0000000
--- a/tests/org.eclipse.zest.tests/zx.png
+++ /dev/null
Binary files differ
diff --git a/tests/org.eclipse.zest.tests/zxsnow.png b/tests/org.eclipse.zest.tests/zxsnow.png
deleted file mode 100644
index 582d706..0000000
--- a/tests/org.eclipse.zest.tests/zxsnow.png
+++ /dev/null
Binary files differ