<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:wfw="http://wellformedweb.org/CommentAPI/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
>
<!-- MHonArc v2.6.10 -->
	<channel>
		<title>gef3d-commits</title>
		<link>http://dev.eclipse.org/mhonarc/lists/gef3d-commits/maillist.html</link>
		<description>gef3d-commits</description>
		<language>en-us</language>
		<pubDate>Fri, 03 May 2013 17:50:43 GMT</pubDate>
		<lastBuildDate>Fri, 03 May 2013 17:50:43 GMT</lastBuildDate>
		<docs>http://blogs.law.harvard.edu/tech/rss</docs>
		<generator>MHonArc RSS 2.0 RCFile</generator>
		<managingEditor>webmaster@eclipse.org (Webmaster)</managingEditor>
		<webMaster>webmaster@eclipse.org (Webmaster)</webMaster>
		<image>
			<title>gef3d-commits</title>
			<url>http://www.eclipse.org/eclipse.org-common/themes/Phoenix/images/eclipse_home_header.jpg</url>
			<link>http://dev.eclipse.org/mhonarc/lists/gef3d-commits/maillist.html</link>
		</image>
 

	<item>
		<title>[gef3d-commits] r594 - tags</title>
		<link>http://dev.eclipse.org/mhonarc/lists/gef3d-commits/msg00439.html</link>
		<description>Author: jvonpilgrim Date: 2011-12-16 05:34:18 -0500 (Fri, 16 Dec 2011) New Revision: 594 Added: tags/last_SVN_version/ Log: Created tag for last SVN version before moving to GIT. </description>
		<content:encoded><![CDATA[<pre>Author: jvonpilgrim
Date: 2011-12-16 05:34:18 -0500 (Fri, 16 Dec 2011)
New Revision: 594

Added:
   tags/last_SVN_version/
Log:
Created tag for last SVN version before moving to GIT.



</pre>]]></content:encoded>
		<pubDate>Fri, 16 Dec 2011 10:34:18 GMT</pubDate>
		<guid isPermaLink="true">http://dev.eclipse.org/mhonarc/lists/gef3d-commits/msg00439.html</guid>
		<author>genie@xxxxxxx (genie)</author>
	</item>


	<item>
		<title>[gef3d-commits] r593 -	trunk/org.eclipse.draw3d/src/java/org/eclipse/draw3d</title>
		<link>http://dev.eclipse.org/mhonarc/lists/gef3d-commits/msg00438.html</link>
		<description>Author: jvonpilgrim Date: 2011-06-28 10:12:23 -0400 (Tue, 28 Jun 2011) New Revision: 593 Modified: trunk/org.eclipse.draw3d/src/java/org/eclipse/draw3d/Figure3D.java trunk/org.eclipse.draw3d/src/java/org/eclipse/draw3d/Figure3DHelper.java Log: Slightly ref...</description>
		<content:encoded><![CDATA[<pre>Author: jvonpilgrim
Date: 2011-06-28 10:12:23 -0400 (Tue, 28 Jun 2011)
New Revision: 593

Modified:
   trunk/org.eclipse.draw3d/src/java/org/eclipse/draw3d/Figure3D.java
   trunk/org.eclipse.draw3d/src/java/org/eclipse/draw3d/Figure3DHelper.java
Log:
Slightly refactored painting of 2D content for enabling special purposes figures, e.g., LOD aware figures.

Modified: trunk/org.eclipse.draw3d/src/java/org/eclipse/draw3d/Figure3D.java
===================================================================
--- trunk/org.eclipse.draw3d/src/java/org/eclipse/draw3d/Figure3D.java	2011-06-28 14:08:52 UTC (rev 592)
+++ trunk/org.eclipse.draw3d/src/java/org/eclipse/draw3d/Figure3D.java	2011-06-28 14:12:23 UTC (rev 593)
@@ -116,7 +116,8 @@
 	protected SyncedVector3f preferredSize3D;
 
 	/**
-	 * In
+	 * Used to determine whether 2D content is to be rendered again.
+	 * {@link #isRepaint2DComponents()}
 	 */
 	protected boolean repaint2DComponents = true;
 
@@ -154,17 +155,43 @@
 				return Figure3D.this.getLocalFont();
 			}
 
+			/** 
+			 * {@inheritDoc}
+			 * @see org.eclipse.draw3d.Figure3DFriend#is2DContentDirty()
+			 */
 			@Override
 			public boolean is2DContentDirty() {
-
-				return repaint2DComponents;
+				return Figure3D.this.isRepaint2DComponents();
 			}
 		};
 
-		helper = new Figure3DHelper(friend);
+		helper = createFigure3DHelper(friend);
+		
 		// setClippingStrategy(new ClippingStrategyFigure3D());
 	}
+	
+	
 
+	/**
+	 * @return
+	 */
+	protected boolean isRepaint2DComponents() {
+		return repaint2DComponents;
+	}
+
+
+
+	/**
+	 * Called exactly once by constructor, override by sub class if
+	 * a different {@link Figure3DHelper} is required.
+	 * @return
+	 */
+	protected Figure3DHelper createFigure3DHelper(Figure3DFriend friend) {
+		return new Figure3DHelper(friend);
+	}
+
+
+
 	@Override
 	public void add(IFigure i_figure, Object i_constraint, int i_index) {
 
@@ -598,7 +625,8 @@
 	}
 
 	/**
-	 * {@inheritDoc}
+	 * Calls helper's {@link Figure3DHelper#paintChildren(Graphics)} and
+	 * sets {@link #repaint2DComponents} to false.
 	 * 
 	 * @see org.eclipse.draw2d.Figure#paintChildren(org.eclipse.draw2d.Graphics)
 	 */

Modified: trunk/org.eclipse.draw3d/src/java/org/eclipse/draw3d/Figure3DHelper.java
===================================================================
--- trunk/org.eclipse.draw3d/src/java/org/eclipse/draw3d/Figure3DHelper.java	2011-06-28 14:08:52 UTC (rev 592)
+++ trunk/org.eclipse.draw3d/src/java/org/eclipse/draw3d/Figure3DHelper.java	2011-06-28 14:12:23 UTC (rev 593)
@@ -20,6 +20,7 @@
 
 import org.eclipse.draw2d.Connection;
 import org.eclipse.draw2d.ConnectionLayer;
+import org.eclipse.draw2d.Figure;
 import org.eclipse.draw2d.Graphics;
 import org.eclipse.draw2d.IFigure;
 import org.eclipse.draw2d.TreeSearch;
@@ -186,8 +187,8 @@
 	 * Logger for this class
 	 */
 	@SuppressWarnings(&quot;unused&quot;)
-	private static final Logger log =
-		Logger.getLogger(Figure3DHelper.class.getName());
+	private static final Logger log = Logger.getLogger(Figure3DHelper.class
+		.getName());
 
 	/**
 	 * Converts 2D bounds to 3D bounds.
@@ -380,7 +381,6 @@
 			i_graphics.setFont(font);
 	}
 
-	@SuppressWarnings(&quot;unchecked&quot;)
 	private void doGetDescendants3D(List&lt;IFigure3D&gt; o_list, IFigure i_fig) {
 
 		for (Iterator iter = i_fig.getChildren().iterator(); iter.hasNext();) {
@@ -393,22 +393,19 @@
 	}
 
 	/**
-	 * @param children2D
-	 * @param host
-	 * @param graphics
+	 * Paints 2D children and 2D connections on the surface of this 3D figure.
+	 * 
+	 * @param children2D the 2D children to be painted
+	 * @param host the 3D ancestor (parent) of the children
+	 * @param graphics the graphics object used for rendering
 	 */
-	private void doPaintChildren2D(Collection&lt;IFigure&gt; children2D,
-		IFigure3D host, Graphics graphics) {
+	private void doPaintChildrenAndConnections2D(IFigure3D host,
+		Collection&lt;IFigure&gt; children2D, Graphics graphics) {
 		graphics.pushState();
 		try {
-			for (IFigure child2D : children2D) {
-				graphics.clipRect(child2D.getBounds());
-				child2D.paint(graphics);
-				graphics.restoreState();
-			}
+			doPaintChildren2D(host, children2D, graphics);
 
 			ConnectionLayer connectionLayer = host.getConnectionLayer(null);
-
 			// paint the connections
 			if (connectionLayer != null) {
 				connectionLayer.paint(graphics);
@@ -422,6 +419,34 @@
 	}
 
 	/**
+	 * Paints 2D children, this method is rather similar to
+	 * {@link Figure#paintChildren(Graphics)}. However, it is still using the
+	 * GEF 3.5 version's clipping strategy.
+	 * 
+	 * @param host the 3D ancestor (parent) of the children
+	 * @param children2D
+	 * @param graphics
+	 */
+	protected void doPaintChildren2D(IFigure3D host,
+		Collection&lt;IFigure&gt; children2D, Graphics graphics) {
+
+		for (IFigure child : children2D) {
+			if (child.isVisible()) {
+				// determine clipping areas for child
+				Rectangle clipping = child.getBounds();
+
+				// child may now paint inside the clipping areas
+				if (clipping.intersects(graphics.getClip(Rectangle.SINGLETON))) {
+					graphics.clipRect(clipping);
+					child.paint(graphics);
+					graphics.restoreState();
+				}
+
+			}
+		}
+	}
+
+	/**
 	 * Finds the figure at the given surface coordinates, while excluding
 	 * figures in the given tree search structure. The search is delegated to
 	 * the surface of this figure, if any.
@@ -548,6 +573,13 @@
 		paintChildren2D(i_graphics);
 		paintChildren3D(i_graphics);
 	}
+	
+	public void disposeImage() {
+		if (m_image != null) {
+			m_image.dispose();
+			m_image = null;
+		}
+	}
 
 	/**
 	 * Paints the given 2D figures. This method was extracted from
@@ -583,7 +615,8 @@
 			Graphics3D g3d = renderContext.getGraphics3D();
 
 			if (surface != null &amp;&amp; surface.is2DHost()) {
-				if ((renderContext.isRedraw2DContent() || m_figuresFriend.is2DContentDirty())) {
+				if ((renderContext.isRedraw2DContent() || m_figuresFriend
+					.is2DContentDirty())) {
 
 					if (m_image != null) {
 						m_image.dispose();
@@ -598,7 +631,8 @@
 					try {
 						graphics.setFont(i_graphics.getFont());
 						configureGraphics(graphics);
-						doPaintChildren2D(children2D, figure, graphics);
+						doPaintChildrenAndConnections2D(figure, children2D,
+							graphics);
 					} finally {
 						m_image = g3d.deactivateGraphics2D();
 						m_image.initialize(g3d);
@@ -616,7 +650,7 @@
 				Graphics graphics = i_graphics;
 				graphics.setFont(i_graphics.getFont());
 				configureGraphics(graphics);
-				doPaintChildren2D(children2D, figure, i_graphics);
+				doPaintChildrenAndConnections2D(figure, children2D, i_graphics);
 			}
 		}
 	}


</pre>]]></content:encoded>
		<pubDate>Tue, 28 Jun 2011 14:12:23 GMT</pubDate>
		<guid isPermaLink="true">http://dev.eclipse.org/mhonarc/lists/gef3d-commits/msg00438.html</guid>
		<author>genie@xxxxxxx (genie)</author>
	</item>
	<item>
		<title>[gef3d-commits] r592 - in trunk:	org.eclipse.draw3d/src/java/org/eclipse/draw3d/camera	org.eclipse.draw3d.ui/src/org/eclipse/draw3d/ui/camera</title>
		<link>http://dev.eclipse.org/mhonarc/lists/gef3d-commits/msg00437.html</link>
		<description>Author: jvonpilgrim Date: 2011-06-28 10:08:52 -0400 (Tue, 28 Jun 2011) New Revision: 592 Modified: trunk/org.eclipse.draw3d.ui/src/org/eclipse/draw3d/ui/camera/CameraInputHandler.java trunk/org.eclipse.draw3d/src/java/org/eclipse/draw3d/camera/CameraLodHel...</description>
		<content:encoded><![CDATA[<pre>Author: jvonpilgrim
Date: 2011-06-28 10:08:52 -0400 (Tue, 28 Jun 2011)
New Revision: 592

Modified:
   trunk/org.eclipse.draw3d.ui/src/org/eclipse/draw3d/ui/camera/CameraInputHandler.java
   trunk/org.eclipse.draw3d/src/java/org/eclipse/draw3d/camera/CameraLodHelper.java
   trunk/org.eclipse.draw3d/src/java/org/eclipse/draw3d/camera/FirstPersonCamera.java
   trunk/org.eclipse.draw3d/src/java/org/eclipse/draw3d/camera/ICamera.java
Log:
Moved timer used for camera tracks from handler to camera in order to enabling sharing of this timer between different handlers and tools.

Modified: trunk/org.eclipse.draw3d/src/java/org/eclipse/draw3d/camera/CameraLodHelper.java
===================================================================
--- trunk/org.eclipse.draw3d/src/java/org/eclipse/draw3d/camera/CameraLodHelper.java	2011-06-28 14:07:24 UTC (rev 591)
+++ trunk/org.eclipse.draw3d/src/java/org/eclipse/draw3d/camera/CameraLodHelper.java	2011-06-28 14:08:52 UTC (rev 592)
@@ -79,21 +79,26 @@
 		Vector3f v = Draw3DCache.getVector3f();
 		Vector3f vDir = Draw3DCache.getVector3f();
 		try {
-			v.setX(i_position.getX() + i_size.getX() / 2);
-			v.setY(i_position.getY() + i_size.getY() / 2);
+			// v is center of the figure we are looking to
+			v.setX(i_position.getX() + i_size.getX() / 2f);
+			v.setY(i_position.getY() + i_size.getY() / 2f);
 			v.setZ(i_position.getZ());
 
-			m_camera.getViewDirection(vDir);
 			m_camera.getPosition(cPos);
 			Math3D.sub(v, cPos, v);
+			// distance between camera and center of figure
+			float distance = v.length();
 
-			float d = v.length();
+//			if (distance&lt;1500)
+				return distance;
+			
+//			m_camera.getViewDirection(vDir);
+//			double cosa = Math3D.dot(vDir, i_normal);
+//			
+//			if (cosa == 0)
+//				return Float.MAX_VALUE;
 
-			float cosa = Math3D.dot(vDir, i_normal);
-			if (cosa == 0)
-				return Float.MAX_VALUE;
-
-			return d / Math.abs(cosa);
+//			return (float) (distance / Math.abs(cosa));
 		} finally {
 			Draw3DCache.returnVector3f(cPos, v, vDir);
 		}

Modified: trunk/org.eclipse.draw3d/src/java/org/eclipse/draw3d/camera/FirstPersonCamera.java
===================================================================
--- trunk/org.eclipse.draw3d/src/java/org/eclipse/draw3d/camera/FirstPersonCamera.java	2011-06-28 14:07:24 UTC (rev 591)
+++ trunk/org.eclipse.draw3d/src/java/org/eclipse/draw3d/camera/FirstPersonCamera.java	2011-06-28 14:08:52 UTC (rev 592)
@@ -12,12 +12,14 @@
 package org.eclipse.draw3d.camera;
 
 import java.nio.FloatBuffer;
+import java.util.Timer;
 import java.util.logging.Logger;
 
 import org.eclipse.draw2d.geometry.Dimension;
 import org.eclipse.draw2d.geometry.Point;
 import org.eclipse.draw2d.geometry.Rectangle;
 import org.eclipse.draw3d.RenderContext;
+import org.eclipse.draw3d.camera.tracking.TrackingShot;
 import org.eclipse.draw3d.geometry.IMatrix4f;
 import org.eclipse.draw3d.geometry.IVector3f;
 import org.eclipse.draw3d.geometry.Math3D;
@@ -251,15 +253,16 @@
 	 * The current viewport.
 	 */
 	protected final Rectangle m_viewport = new Rectangle();
+	
+	protected Timer timer;
 
 	/**
 	 * Creates and initializes a first person camera.
 	 */
 	public FirstPersonCamera() {
-
 		reset();
 	}
-
+	
 	private IMatrix4f calculateInversionMatrix(IMatrix4f i_modelMatrix,
 		Matrix4f io_result) {
 
@@ -739,6 +742,37 @@
 		o_result.setViewDirection(m_viewDir);
 		return o_result;
 	}
+
+	/** 
+	 * {@inheritDoc}
+	 * @see org.eclipse.draw3d.camera.ICamera#scheduleTrackingShot(org.eclipse.draw3d.camera.tracking.TrackingShot, long, long)
+	 */
+	public void scheduleTrackingShot(TrackingShot i_shot) {
+		
+		if (timer!=null) {
+			cancelTrackingShot();
+		}
+		
+		timer = new Timer();
+		timer.scheduleAtFixedRate(i_shot, 0, 50);
+		
+	}
 	
+	/** 
+	 * {@inheritDoc}
+	 * @see org.eclipse.draw3d.camera.ICamera#cancelTrackingShot()
+	 */
+	public void cancelTrackingShot() {
+		if (timer!=null) {
+			try {
+				timer.cancel();
+			} catch (Exception ex) {
+				// TODO: handle exception
+			}
+			timer = null;
+		}
+		
+	}
 	
+	
 }

Modified: trunk/org.eclipse.draw3d/src/java/org/eclipse/draw3d/camera/ICamera.java
===================================================================
--- trunk/org.eclipse.draw3d/src/java/org/eclipse/draw3d/camera/ICamera.java	2011-06-28 14:07:24 UTC (rev 591)
+++ trunk/org.eclipse.draw3d/src/java/org/eclipse/draw3d/camera/ICamera.java	2011-06-28 14:08:52 UTC (rev 592)
@@ -11,10 +11,12 @@
 
 package org.eclipse.draw3d.camera;
 
+import java.util.Timer;
+
 import org.eclipse.draw2d.geometry.Dimension;
 import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
 import org.eclipse.draw3d.RenderContext;
+import org.eclipse.draw3d.camera.tracking.TrackingShot;
 import org.eclipse.draw3d.geometry.IMatrix4f;
 import org.eclipse.draw3d.geometry.IVector3f;
 import org.eclipse.draw3d.geometry.Vector3f;
@@ -250,9 +252,10 @@
 	 * @param i_height the height of the viewport
 	 */
 	public void setViewport(int i_x, int i_y, int i_width, int i_height);
-	
+
 	/**
-	 * Returns the dimension of the view port. 
+	 * Returns the dimension of the view port.
+	 * 
 	 * @return
 	 */
 	public Dimension getViewPortSize();
@@ -284,4 +287,17 @@
 	 */
 	public Vector3f unProject(int i_mx, int i_my, float i_d,
 		IMatrix4f i_modelMatrix, Vector3f io_result);
+
+	/**
+	 * Schedules a new tracking shot, possibly running tracking shots are
+	 * canceled. While camera tracks could be run using a separated
+	 * {@link Timer}, it is recommended to use the camera's timer in order to
+	 * enable canceling of tracking shots via {@link #cancelTrackingShot()}.
+	 */
+	public void scheduleTrackingShot(TrackingShot shot);
+
+	/**
+	 * Cancels a possibly running tracking shot.
+	 */
+	public void cancelTrackingShot();
 }

Modified: trunk/org.eclipse.draw3d.ui/src/org/eclipse/draw3d/ui/camera/CameraInputHandler.java
===================================================================
--- trunk/org.eclipse.draw3d.ui/src/org/eclipse/draw3d/ui/camera/CameraInputHandler.java	2011-06-28 14:07:24 UTC (rev 591)
+++ trunk/org.eclipse.draw3d.ui/src/org/eclipse/draw3d/ui/camera/CameraInputHandler.java	2011-06-28 14:08:52 UTC (rev 592)
@@ -10,11 +10,9 @@
  ******************************************************************************/
 package org.eclipse.draw3d.ui.camera;
 
-import java.util.logging.Level;
-
 import java.util.ArrayList;
 import java.util.List;
-import java.util.Timer;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import org.eclipse.draw2d.IFigure;
@@ -186,12 +184,8 @@
 
 	private float m_wheelSpeed = 20;
 
+	
 	/**
-	 * The timer used for camera trackings
-	 */
-	Timer timer = null;
-
-	/**
 	 * Handles a mouse button down event.
 	 * 
 	 * @param i_button the mouse button
@@ -204,14 +198,14 @@
 		int modifiers = getModifiers(i_stateMask);
 		doButtonDown(i_button, modifiers, i_x, i_y);
 	}
+	
+	
 
 	/**
 	 * 
 	 */
 	protected void stopCameraTracking() {
-		if (timer != null)
-			timer.cancel();
-		timer = null;
+		getCamera().cancelTrackingShot();
 	}
 
 	/**
@@ -267,6 +261,7 @@
 
 		return camera;
 	}
+	
 
 	/**
 	 * Return the key strokes represented by the given SWT key event.
@@ -517,7 +512,8 @@
 
 		}
 		if (cameraPos != null) {
-
+			getCamera().cancelTrackingShot();
+			
 			LinearMove move = new LinearMove();
 			move.init(getCamera().getCameraPosition(null), cameraPos);
 
@@ -537,8 +533,8 @@
 				duration = 100;
 
 			TrackingShot shot = new TrackingShot(duration, getCamera(), move);
-			timer=new Timer();
-			timer.schedule(shot, 0, 50);
+			
+			getCamera().scheduleTrackingShot(shot);
 
 		}
 


</pre>]]></content:encoded>
		<pubDate>Tue, 28 Jun 2011 14:08:52 GMT</pubDate>
		<guid isPermaLink="true">http://dev.eclipse.org/mhonarc/lists/gef3d-commits/msg00437.html</guid>
		<author>genie@xxxxxxx (genie)</author>
	</item>
	<item>
		<title>[gef3d-commits] r591 - in trunk:	org.eclipse.draw3d/src/java/org/eclipse/draw3d/geometryext	org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry	org.eclipse.gef3d/src/java/org/eclipse/gef3d/editparts	org.eclipse.gef3d/src/java/org/eclipse/gef3d/factories	org.eclipse.gef3d/src/java/org/eclipse/gef3d/ui/parts	org.eclipse.gef3d.examples.graph/src/java/org/eclipse/gef3d/examples/graph/editor	org.eclipse.gef3d.examples.graph/src/java/org/eclipse/gef3d/examples/graph/editor/figures	org.eclipse.gef3d.gmf/src/java/org/eclipse/gef3d/gmf/runtime/diagram/ui/parts</title>
		<link>http://dev.eclipse.org/mhonarc/lists/gef3d-commits/msg00436.html</link>
		<description>Author: jvonpilgrim Date: 2011-06-28 10:07:24 -0400 (Tue, 28 Jun 2011) New Revision: 591 Modified: trunk/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/IHost3D.java trunk/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/IP...</description>
		<content:encoded><![CDATA[<pre>Author: jvonpilgrim
Date: 2011-06-28 10:07:24 -0400 (Tue, 28 Jun 2011)
New Revision: 591

Modified:
   trunk/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/IHost3D.java
   trunk/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/IPosition3D.java
   trunk/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/Position3D.java
   trunk/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/Position3DImpl.java
   trunk/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/package-info.java
   trunk/org.eclipse.draw3d/src/java/org/eclipse/draw3d/geometryext/SyncHost3D.java
   trunk/org.eclipse.draw3d/src/java/org/eclipse/draw3d/geometryext/SynchronizedPosition3DImpl.java
   trunk/org.eclipse.gef3d.examples.graph/src/java/org/eclipse/gef3d/examples/graph/editor/GraphEditor3D.java
   trunk/org.eclipse.gef3d.examples.graph/src/java/org/eclipse/gef3d/examples/graph/editor/figures/GraphFigureFactory.java
   trunk/org.eclipse.gef3d.examples.graph/src/java/org/eclipse/gef3d/examples/graph/editor/figures/VertexFigure2D.java
   trunk/org.eclipse.gef3d.gmf/src/java/org/eclipse/gef3d/gmf/runtime/diagram/ui/parts/DiagramGraphicalViewer3D.java
   trunk/org.eclipse.gef3d/src/java/org/eclipse/gef3d/editparts/AbstractGraphicalEditPartEx.java
   trunk/org.eclipse.gef3d/src/java/org/eclipse/gef3d/factories/IFigureFactory.java
   trunk/org.eclipse.gef3d/src/java/org/eclipse/gef3d/ui/parts/GraphicalViewer3DImpl.java
Log:
added or improved JavaDoc

Modified: trunk/org.eclipse.draw3d/src/java/org/eclipse/draw3d/geometryext/SyncHost3D.java
===================================================================
--- trunk/org.eclipse.draw3d/src/java/org/eclipse/draw3d/geometryext/SyncHost3D.java	2011-06-28 14:00:38 UTC (rev 590)
+++ trunk/org.eclipse.draw3d/src/java/org/eclipse/draw3d/geometryext/SyncHost3D.java	2011-06-28 14:07:24 UTC (rev 591)
@@ -12,23 +12,32 @@
 
 import org.eclipse.draw2d.geometry.Rectangle;
 import org.eclipse.draw3d.geometry.IHost3D;
+import org.eclipse.draw3d.geometry.Position3D;
 
 /**
- * SyncHost3D
- * There should really be more documentation here.
- *
- * @author 	Jens von Pilgrim
- * @version	$Revision$
- * @since 	Jan 21, 2009
+ * Host of a {@link SynchronizedPosition3DImpl} providing the 2D bounds
+ * information.
+ * &lt;p&gt;
+ * Note that
+ * {@link #positionChanged(java.util.EnumSet, org.eclipse.draw3d.geometry.IVector3f)}
+ * is only called if the {@link SynchronizedPosition3DImpl} had been changed by
+ * calling a setter defined in {@link Position3D}, and not by changing the
+ * backing 2D {@link Rectangle} object.
+ * &lt;/p&gt;
+ * 
+ * @author Jens von Pilgrim
+ * @version $Revision$
+ * @since Jan 21, 2009
  */
 public interface SyncHost3D extends IHost3D {
-	
+
 	/**
 	 * Returns rectangle representing the bounds of a 2D figure.
+	 * 
 	 * @return
 	 */
 	public Rectangle getBounds();
-	
+
 	/**
 	 * Sets the bounds of this host.
 	 */

Modified: trunk/org.eclipse.draw3d/src/java/org/eclipse/draw3d/geometryext/SynchronizedPosition3DImpl.java
===================================================================
--- trunk/org.eclipse.draw3d/src/java/org/eclipse/draw3d/geometryext/SynchronizedPosition3DImpl.java	2011-06-28 14:00:38 UTC (rev 590)
+++ trunk/org.eclipse.draw3d/src/java/org/eclipse/draw3d/geometryext/SynchronizedPosition3DImpl.java	2011-06-28 14:07:24 UTC (rev 591)
@@ -23,6 +23,13 @@
  * Mutable implementation of {@link Position3D}, based on a synchronized bounds
  * object. That is the properties of this 3D position object is synchronized via
  * {@link SyncedBounds3D} with a 2D object.
+ * &lt;p&gt;
+ * Note hat
+ * {@link IHost3D#positionChanged(java.util.EnumSet, org.eclipse.draw3d.geometry.IVector3f)}
+ * is only called this object had been changed by calling a setter defined in
+ * {@link Position3D}, and not by changing the backing 2D {@link Rectangle}
+ * object.
+ * &lt;/p&gt;
  * 
  * @author Jens von Pilgrim
  * @version $Revision$
@@ -59,6 +66,7 @@
 
 	/**
 	 * {@inheritDoc}
+	 * This will always return an {@link SyncHost3D}.
 	 * 
 	 * @see org.eclipse.draw3d.geometry.IPosition3D#getHost()
 	 */
@@ -103,7 +111,7 @@
 
 		if (delta.x != 0 || delta.y != 0)
 			host.setBounds(newBounds);
-		
+
 		// This forces the synced bounds update the location vector.
 		// While this has no direct effect here, a client may has cached
 		// the location vector.
@@ -145,7 +153,7 @@
 		// While this has no direct effect here, a client may has cached
 		// the size vector.
 		getLocation3D();
-		
+
 		invalidate();
 
 		firePositionChanged(PositionHint.SIZE, delta);

Modified: trunk/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/IHost3D.java
===================================================================
--- trunk/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/IHost3D.java	2011-06-28 14:00:38 UTC (rev 590)
+++ trunk/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/IHost3D.java	2011-06-28 14:07:24 UTC (rev 591)
@@ -15,34 +15,42 @@
 import org.eclipse.draw3d.geometry.IPosition3D.PositionHint;
 
 /**
- * Host (or context) of a position. The {@link IPosition3D} is a kind of 
- * policy, the {@link IHost3D} is its context. Also, the host observes its
- * position and is notified when it changes.
- *
- * @author 	Jens von Pilgrim
- * @version	$Revision$
- * @since 	Jan 21, 2009
+ * Host (or context) of a position. The {@link IPosition3D} is a kind of policy,
+ * the {@link IHost3D} is its context. Also, the host observes its position and
+ * is notified when it changes.
+ * 
+ * @author Jens von Pilgrim
+ * @version $Revision$
+ * @since Jan 21, 2009
  */
 public interface IHost3D {
-	
+
 	/**
-	 * Returns the position of this 3D object. This may return null.
+	 * Returns the position of this 3D object. This may return null. If it is
+	 * not null,
+	 * &lt;code&gt;{@link #getPosition3D()}.{@link IPosition3D#getHost()}==this&lt;/code&gt;
+	 * must be true.
+	 * 
 	 * @return
+	 * @see IPosition3D#getHost()
 	 */
 	public Position3D getPosition3D();
-	
+
 	/**
-	 * Returns the parent of this object, that is the parent according to
-	 * a scene graph. This is usually the parent figure.
-	 * @return
+	 * Returns the parent of this object, that is the parent according to a
+	 * scene graph. This is usually the parent figure.
+	 * 
+	 * @return parent host or null, if no such parent is available
 	 */
 	public IHost3D getParentHost3D();
 
 	/**
-	 * Called by host's position when upated.
-	 * @param hint
+	 * Called by host's position when updated.
+	 * 
+	 * @param hint flags indicating what components (location, rotation, size)
+	 *            had been changed
 	 * @param delta the delta of the changed property (new-old)
 	 */
-    public void positionChanged(EnumSet&lt;PositionHint&gt; hint, IVector3f delta);
-	
+	public void positionChanged(EnumSet&lt;PositionHint&gt; hint, IVector3f delta);
+
 }

Modified: trunk/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/IPosition3D.java
===================================================================
--- trunk/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/IPosition3D.java	2011-06-28 14:00:38 UTC (rev 590)
+++ trunk/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/IPosition3D.java	2011-06-28 14:07:24 UTC (rev 591)
@@ -14,7 +14,7 @@
  * Stores location, size, and rotation of an 3D object. Immutable triple of
  * position properties for 3D objects, that is location, size (scale), and
  * rotation. These three properties can be combined in a so called
- * transformation matrix, which can then be passed to OpenGL or renderes able to
+ * transformation matrix, which can then be passed to OpenGL or renderer able to
  * handle these kind of information.
  * &lt;p&gt;
  * This interface and its subinterfaces and implementations were created in
@@ -36,13 +36,15 @@
 public interface IPosition3D {
 
 	/**
-	 * Hint passed in events, see Host3D#positionChanged
+	 * Hint passed in events indicating which component (location, rotatoin,
+	 * size) of the position had been changed.
 	 * 
 	 * @author Jens von Pilgrim
 	 * @version $Revision$
 	 * @since Jan 21, 2009
+	 * @see Host3D#positionChanged
 	 */
-	public enum PositionHint {
+	public static enum PositionHint {
 		/**
 		 * Location has changed.
 		 */
@@ -112,9 +114,12 @@
 	public IVector3f getCenter3D();
 
 	/**
-	 * Returns the host (or context) of this position
+	 * Returns the host (or context) of this position.
+	 * &lt;code&gt;{@link #getHost()}.{@link IHost3D#getPosition3D()}==this&lt;/code&gt;
+	 * must always be true.
 	 * 
 	 * @return returns the host, must not be null
+	 * @see IHost3D#getPosition3D()
 	 */
 	public IHost3D getHost();
 

Modified: trunk/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/Position3D.java
===================================================================
--- trunk/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/Position3D.java	2011-06-28 14:00:38 UTC (rev 590)
+++ trunk/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/Position3D.java	2011-06-28 14:07:24 UTC (rev 591)
@@ -12,6 +12,10 @@
 
 /**
  * Mutable position, i.e. triple of location, size (scale), and rotation.
+ * Whenever the location, size or rotation of this position were actually
+ * changed by calling one if the setters defined in this interface, the host is
+ * notified by a call to
+ * {@link IHost3D#positionChanged(java.util.EnumSet, IVector3f)}.
  * 
  * @author Jens von Pilgrim
  * @version $Revision$
@@ -20,9 +24,11 @@
 public interface Position3D extends IPosition3D {
 
 	/**
-	 * Expands this position by the given value in every direction.
+	 * Expands this position by the given value in every direction and notifies
+	 * the host.
 	 * 
 	 * @param i_delta the value by which to expand this position
+	 * @see IHost3D#positionChanged(java.util.EnumSet, IVector3f)
 	 */
 	public void expand(float i_delta);
 
@@ -35,16 +41,18 @@
 
 	/**
 	 * Modifies the location of this position so that its center is at the given
-	 * coordinates.
+	 * coordinates. If the position had been changed, the host is notified.
 	 * 
 	 * @param i_center the center of this position
+	 * @see IHost3D#positionChanged(java.util.EnumSet, IVector3f)
 	 */
 	public void setCenter3D(IVector3f i_center);
 
 	/**
-	 * Sets the location of this position.
+	 * Sets the location of this position and notifies the host.
 	 * 
 	 * @param i_location the new location, must not be &lt;code&gt;null&lt;/code&gt;
+	 * @see IHost3D#positionChanged(java.util.EnumSet, IVector3f)
 	 */
 	public void setLocation3D(IVector3f i_location);
 
@@ -53,27 +61,33 @@
 	 * position's absolute location, size and rotation is the same as this
 	 * position's absolute location, size and rotation. In other words, the two
 	 * positions will have the same spacial configuration regardless of whether
-	 * they are absolute or relative, respectively.
+	 * they are absolute or relative, respectively. If the position had been
+	 * changed, the host is notified.
 	 * 
 	 * @param i_position3D the position to set
+	 * @see IHost3D#positionChanged(java.util.EnumSet, IVector3f)
 	 */
 	public void setPosition(IPosition3D i_position3D);
 
 	/**
 	 * Sets rotation of figure, i.e. angles for X, Y and Z axis. Rotations are
-	 * applied in the following order: Y first (heading), then Z
-	 * (elevation) and finally X (bank). Rotation is clockwise.
+	 * applied in the following order: Y first (heading), then Z (elevation) and
+	 * finally X (bank). Rotation is clockwise. If the position had been
+	 * changed, the host is notified.
 	 * 
 	 * @param i_rotation must not be &lt;code&gt;null&lt;/code&gt;
+	 * @see IHost3D#positionChanged(java.util.EnumSet, IVector3f)
 	 */
 	public void setRotation3D(IVector3f i_rotation);
 
 	/**
 	 * Sets the size of this position. Even though the size is applied to the
 	 * transformation matrix as a scaling, it is not applied to the any position
-	 * that is relative to this one, as opposed to location and rotation.
+	 * that is relative to this one, as opposed to location and rotation. If the
+	 * position had been changed, the host is notified.
 	 * 
 	 * @param i_size must not be &lt;code&gt;null&lt;/code&gt;
+	 * @see IHost3D#positionChanged(java.util.EnumSet, IVector3f)
 	 */
 	public void setSize3D(IVector3f i_size);
 

Modified: trunk/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/Position3DImpl.java
===================================================================
--- trunk/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/Position3DImpl.java	2011-06-28 14:00:38 UTC (rev 590)
+++ trunk/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/Position3DImpl.java	2011-06-28 14:07:24 UTC (rev 591)
@@ -10,13 +10,14 @@
  ******************************************************************************/
 package org.eclipse.draw3d.geometry;
 
-
 /**
- * Implementation of {@link Position3D} with a backing bound object.
+ * Implementation of {@link Position3D} with a backing {@link BoundingBox}
+ * object.
  * 
  * @author Jens von Pilgrim
  * @version $Revision$
  * @since Jan 21, 2009
+ * @see BoundingBox
  */
 public class Position3DImpl extends AbstractPosition3D {
 
@@ -30,29 +31,29 @@
 	public Position3DImpl(IHost3D i_host) {
 		if (i_host == null) // parameter precondition
 			throw new NullPointerException(
-					&quot;i_host must not be null, use empty constructor instead&quot;);
+				&quot;i_host must not be null, use empty constructor instead&quot;);
 
 		host = i_host;
 		bounds3D = new BoundingBoxImpl();
 	}
-	
+
 	/**
 	 * Host class used for absolute positions.
-	 *
-	 * @author 	Jens von Pilgrim (developer@xxxxxxxxx)
-	 * @version	$Revision$
-	 * @since 	Apr 26, 2011
-	 */	
+	 * 
+	 * @author Jens von Pilgrim (developer@xxxxxxxxx)
+	 * @version $Revision$
+	 * @since Apr 26, 2011
+	 */
 	protected class NoHost extends AbstractHost3D {
 
 		public NoHost() {
 			super(null);
 		}
-		
+
 		public Position3D getPosition3D() {
 			return Position3DImpl.this;
 		}
-		
+
 		/**
 		 * {@inheritDoc}
 		 * 
@@ -62,14 +63,14 @@
 		public String toString() {
 			return &quot;no host&quot;;
 		}
-		
+
 	}
 
 	/**
 	 * Creates a position with a dummy host, i.e. {@link #getHost()} will no
 	 * return null. &lt;strong&gt;It is recommend to use
-	 * {@link Position3DUtil#createAbsolutePosition()} which creates an
-	 * instance of this class, since this makes the purpose clear.&lt;/strong&gt;
+	 * {@link Position3DUtil#createAbsolutePosition()} which creates an instance
+	 * of this class, since this makes the purpose clear.&lt;/strong&gt;
 	 */
 	public Position3DImpl() {
 		bounds3D = new BoundingBoxImpl();
@@ -143,10 +144,11 @@
 	public void setSize3D(IVector3f i_size) {
 		if (i_size == null) // parameter precondition
 			throw new NullPointerException(&quot;i_size must not be null&quot;);
-//		if (i_size.getX() &lt; 0 || i_size.getY() &lt; 0 || i_size.getZ() &lt; 0) // parameter
-//			// precondition
-//			throw new IllegalArgumentException(
-//					&quot;no value of given vector must be less 0, , was &quot; + i_size);
+		// if (i_size.getX() &lt; 0 || i_size.getY() &lt; 0 || i_size.getZ() &lt; 0) //
+		// parameter
+		// // precondition
+		// throw new IllegalArgumentException(
+		// &quot;no value of given vector must be less 0, , was &quot; + i_size);
 
 		IVector3f size3D = getSize3D();
 

Modified: trunk/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/package-info.java
===================================================================
--- trunk/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/package-info.java	2011-06-28 14:00:38 UTC (rev 590)
+++ trunk/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/package-info.java	2011-06-28 14:07:24 UTC (rev 591)
@@ -14,6 +14,10 @@
  * These classes are used with GEF3D, their functionality is very similar
  * to Java3D's vecmath package or LWJGL's vector package&lt;sup&gt;1)&lt;/sup&gt;.
  * 
+ * This package/plugin does not depend from any other non-JDK package, in
+ * particular it does not depend from any Eclipse (SWT, GEF, Draw2D) plugins.
+ * This it can be used standalone as well. 
+ * 
  * &lt;h3&gt;Contained Classes&lt;/h3&gt;
  * This package contains 3D geometry classes such as
  * &lt;ul&gt;
@@ -49,15 +53,15 @@
  * Point.negate() negates the values of the object itself, while Point.getNegated()
  * returns a new instance with negated values. In Draw3D we simply provide a single
  * operation, that is Math3D.abs(IVector3f, Vector3f) 
- * (or Math3D.negate(IVector3f, Vector3f) resp.), see below for further details.
+ * (or Math3D.negate(IVector3f, Vector3f) respectively), see below for further details.
  * &lt;/small&gt;
  * &lt;/p&gt;
  * 
  * Especially for use within Draw3D, the following classes are defined:
  * &lt;ul&gt;
- * 	&lt;li&gt;SyncedVector3f -- a vector3f based on a {@ling org.eclpise.draw2d.geometry.Vector2f}&lt;/li&gt;
+ * 	&lt;li&gt;SyncedVector3f -- a vector3f based on a {@link org.eclpise.draw2d.geometry.Vector2f}&lt;/li&gt;
  *  &lt;li&gt;BoundingBox (with immutable and mutable interfaces)&lt;/li&gt;
- *  &lt;li&gt;SyncedBounds3D -- a bounding box based on {@ling org.eclpise.draw2d.geometry.Rectangle}&lt;/li&gt;
+ *  &lt;li&gt;SyncedBounds3D -- a bounding box based on {@link org.eclpise.draw2d.geometry.Rectangle}&lt;/li&gt;
  * &lt;/ul&gt;
  * The synchronized classes only stores the delta of a 3D vector and a 2D vector,
  * that is the floating values of the x and y attributes and the z value. 
@@ -68,7 +72,10 @@
  * 2D object (which would cause no problem), but the reference (of the
  * attribute) is also changed (see {@link org.eclipse.draw3d.Figure3D#getPreferredSize3D()}
  * and its implementation, especially  {@link org.eclipse.draw2d.Figure#getPreferredSize(int, int)}
- * Thus, the synced classes cannot implement the mutable interface!
+ * Thus, the synced classes cannot implement the mutable interface! Since 
+ * the draw3d.geometry package is not intended to have dependencies from
+ * any other Eclipse plugins, these synchronization classes are implemented
+ * in plugin draw3D.
  * &lt;/p&gt;
  * 
  * 

Modified: trunk/org.eclipse.gef3d/src/java/org/eclipse/gef3d/editparts/AbstractGraphicalEditPartEx.java
===================================================================
--- trunk/org.eclipse.gef3d/src/java/org/eclipse/gef3d/editparts/AbstractGraphicalEditPartEx.java	2011-06-28 14:00:38 UTC (rev 590)
+++ trunk/org.eclipse.gef3d/src/java/org/eclipse/gef3d/editparts/AbstractGraphicalEditPartEx.java	2011-06-28 14:07:24 UTC (rev 591)
@@ -12,14 +12,13 @@
 
 import org.eclipse.draw2d.IFigure;
 import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.gef3d.factories.IConnectionAnchorFactory;
 import org.eclipse.gef3d.factories.IFigureFactory;
 import org.eclipse.gef3d.factories.IFigureFactoryProvider;
 
-
 /**
  * Extensible graphical edit part, i.e. this edit part uses a
- * {@link IFigureFactory}.
+ * {@link IFigureFactory}. See {@link IFigureFactory} for how to make the
+ * factory available to the edit part via the graphical viewer.
  * 
  * @author Jens von Pilgrim
  * @version $Revision$
@@ -27,7 +26,7 @@
  */
 public abstract class AbstractGraphicalEditPartEx extends
 		AbstractGraphicalEditPart {
-	
+
 	/**
 	 * Creates a figure for this edit part using a figure factory. The figure
 	 * factory is retrieved from the graphical viewer, which must implement
@@ -40,14 +39,19 @@
 	@Override
 	protected IFigure createFigure() {
 		if (getViewer() instanceof IFigureFactoryProvider) {
-			return ((IFigureFactoryProvider) getViewer()).getFigureFactory()
-					.createFigure(this, null);
+			IFigureFactory figureFactory =
+				((IFigureFactoryProvider) getViewer()).getFigureFactory();
+			if (figureFactory == null) {
+				throw new IllegalStateException(
+					&quot;No figure factory registered at graphical viewer, &quot;
+						+ &quot;see IFigureFactory Javadoc for help&quot;);
+			}
+			return figureFactory.createFigure(this, null);
 		}
 
 		throw new IllegalStateException(
-				&quot;No figure factory available, viewer is no IFigureFactoryProvider, viewer=&quot; + getViewer());
+			&quot;No figure factory available, viewer is no IFigureFactoryProvider, viewer=&quot;
+				+ getViewer()+ &quot;, see IFigureFactory Javadoc for help&quot;);
 	}
-	
-	
 
 }

Modified: trunk/org.eclipse.gef3d/src/java/org/eclipse/gef3d/factories/IFigureFactory.java
===================================================================
--- trunk/org.eclipse.gef3d/src/java/org/eclipse/gef3d/factories/IFigureFactory.java	2011-06-28 14:00:38 UTC (rev 590)
+++ trunk/org.eclipse.gef3d/src/java/org/eclipse/gef3d/factories/IFigureFactory.java	2011-06-28 14:07:24 UTC (rev 591)
@@ -12,8 +12,12 @@
 
 import org.eclipse.draw2d.IFigure;
 import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPartFactory;
 import org.eclipse.gef.GraphicalEditPart;
 import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
+import org.eclipse.gef.ui.parts.GraphicalEditor;
+import org.eclipse.gef3d.ui.parts.GraphicalViewer3D;
+import org.eclipse.gef3d.ui.parts.GraphicalViewer3DImpl;
 
 /**
  * Interface of figure factories for creating figures. In the original GEF,
@@ -21,10 +25,31 @@
  * {@link AbstractGraphicalEditPart#createFigure()}. GEF3D provides different
  * display modes (2D, 2.5D, and 3D), hence sometimes different figures are to be
  * used.
+ * &lt;p&gt;
+ * Note that the viewer is required to be an {@link IFigureFactoryProvider},
+ * which is usually the case if a {@link GraphicalViewer3D} is used, as the edit
+ * part must be able to retrieve the factory from the viewer. Of course, the
+ * factory needs to be registered at the viewer. Since the viewer is available
+ * to the edit part, let your viewer implement {@link IFigureFactoryProvider}.
+ * GEF3D's default 3D viewer implementations implement this interface. The
+ * figure factory is best registered where the {@link EditPartFactory} is
+ * registered, i.e. in {@link GraphicalEditor#configureGraphicalViewer}. The
+ * {@link GraphicalViewer3DImpl} provides a special method
+ * {@link GraphicalViewer3DImpl#setFigureFactory(IFigureFactory)}. The following
+ * code snippet can serve as a template to be used in your
+ * {@link GraphicalEditor#configureGraphicalViewer()} implementation:
  * 
+ * &lt;pre&gt;
+ * ((IFigureFactoryProvider.Mutable) getGraphicalViewer())
+ * 	.setFigureFactory(new MY_FIGURE_FACTORY(DisplayMode.Projected));
+ * &lt;/pre&gt;
+ * 
+ * (replace MY_FIGURE_FACTORY with your figure factory implementation).
+ * 
  * @author Jens von Pilgrim
  * @version $Revision$
  * @since Apr 22, 2008
+ * @see IFigureFactoryProvider
  */
 public interface IFigureFactory extends IDisplayModeSensitive {
 

Modified: trunk/org.eclipse.gef3d/src/java/org/eclipse/gef3d/ui/parts/GraphicalViewer3DImpl.java
===================================================================
--- trunk/org.eclipse.gef3d/src/java/org/eclipse/gef3d/ui/parts/GraphicalViewer3DImpl.java	2011-06-28 14:00:38 UTC (rev 590)
+++ trunk/org.eclipse.gef3d/src/java/org/eclipse/gef3d/ui/parts/GraphicalViewer3DImpl.java	2011-06-28 14:07:24 UTC (rev 591)
@@ -38,8 +38,8 @@
 		GraphicalViewer3D, IFigureFactoryProvider.Mutable {
 
 	@SuppressWarnings(&quot;unused&quot;)
-	private static final Logger log =
-		Logger.getLogger(GraphicalViewer3DImpl.class.getName());
+	private static final Logger log = Logger
+		.getLogger(GraphicalViewer3DImpl.class.getName());
 
 	protected IFigureFactory m_FigureFactory = null;
 
@@ -53,7 +53,7 @@
 	 * 
 	 */
 	public GraphicalViewer3DImpl() {
-		if (m_ViewerHelper==null) {
+		if (m_ViewerHelper == null) {
 			m_ViewerHelper = new GraphicalViewer3DHelper(this);
 		}
 	}
@@ -97,7 +97,7 @@
 	 */
 	@Override
 	protected LightweightSystem createLightweightSystem() {
-		if (m_ViewerHelper==null) {
+		if (m_ViewerHelper == null) {
 			m_ViewerHelper = new GraphicalViewer3DHelper(this);
 		}
 		return m_ViewerHelper.createLightweightSystem();
@@ -127,15 +127,6 @@
 	}
 
 	/**
-	 * {@inheritDoc}
-	 * 
-	 * @see org.eclipse.gef3d.factories.IFigureFactoryProvider#getFigureFactory()
-	 */
-	public IFigureFactory getFigureFactory() {
-		return m_FigureFactory;
-	}
-
-	/**
 	 * Returns the 3D lightweight system.
 	 * 
 	 * @return the 3D lightweightsystem or &lt;code&gt;null&lt;/code&gt; if the lightweight
@@ -172,16 +163,24 @@
 
 		}
 	}
-	
 
 	/**
-	 * Sets the figure factory of this viewer.
+	 * {@inheritDoc}
 	 * 
-	 * @param i_factory
+	 * @see org.eclipse.gef3d.factories.IFigureFactoryProvider.Mutable#setFigureFactory(org.eclipse.gef3d.factories.IFigureFactory)
 	 */
 	public void setFigureFactory(IFigureFactory i_factory) {
 
 		m_FigureFactory = i_factory;
 	}
 
+	/**
+	 * {@inheritDoc}
+	 * 
+	 * @see org.eclipse.gef3d.factories.IFigureFactoryProvider#getFigureFactory()
+	 */
+	public IFigureFactory getFigureFactory() {
+		return m_FigureFactory;
+	}
+
 }

Modified: trunk/org.eclipse.gef3d.examples.graph/src/java/org/eclipse/gef3d/examples/graph/editor/GraphEditor3D.java
===================================================================
--- trunk/org.eclipse.gef3d.examples.graph/src/java/org/eclipse/gef3d/examples/graph/editor/GraphEditor3D.java	2011-06-28 14:00:38 UTC (rev 590)
+++ trunk/org.eclipse.gef3d.examples.graph/src/java/org/eclipse/gef3d/examples/graph/editor/GraphEditor3D.java	2011-06-28 14:07:24 UTC (rev 591)
@@ -185,6 +185,10 @@
 		return root;
 	}
 
+	/** 
+	 * {@inheritDoc}
+	 * @see org.eclipse.gef.ui.parts.GraphicalEditor#configureGraphicalViewer()
+	 */
 	@Override
 	protected void configureGraphicalViewer() {
 		super.configureGraphicalViewer();

Modified: trunk/org.eclipse.gef3d.examples.graph/src/java/org/eclipse/gef3d/examples/graph/editor/figures/GraphFigureFactory.java
===================================================================
--- trunk/org.eclipse.gef3d.examples.graph/src/java/org/eclipse/gef3d/examples/graph/editor/figures/GraphFigureFactory.java	2011-06-28 14:00:38 UTC (rev 590)
+++ trunk/org.eclipse.gef3d.examples.graph/src/java/org/eclipse/gef3d/examples/graph/editor/figures/GraphFigureFactory.java	2011-06-28 14:07:24 UTC (rev 591)
@@ -16,37 +16,41 @@
 import org.eclipse.draw2d.IFigure;
 import org.eclipse.draw2d.ScrollPane;
 import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef3d.editparts.AbstractGraphicalEditPartEx;
 import org.eclipse.gef3d.examples.graph.editor.editparts.EdgePart;
 import org.eclipse.gef3d.examples.graph.editor.editparts.GraphPartGeneric;
 import org.eclipse.gef3d.examples.graph.editor.editparts.VertexPart;
 import org.eclipse.gef3d.factories.DisplayMode;
+import org.eclipse.gef3d.factories.IFigureFactoryProvider;
 import org.eclipse.gef3d.factories.MappedFigureFactory;
+import org.eclipse.gef3d.ui.parts.GraphicalViewer3D;
 
-
 /**
- * GraphFigureFactory
- * There should really be more documentation here.
- *
- * @author 	Jens von Pilgrim
- * @version	$Revision$
- * @since 	Apr 22, 2008
+ * Used by graph related {@link AbstractGraphicalEditPartEx} implementations for
+ * creating the figures. This factory decouples the edit parts from the figures.
+ * Depending on the display mode, 2D or 3D figures are created. Note that the
+ * viewer is required to be an {@link IFigureFactoryProvider}, which is usually the
+ * case if a {@link GraphicalViewer3D} is used, and this factory needs to be
+ * registered at the viewer. 
+ * 
+ * @author Jens von Pilgrim
+ * @version $Revision$
+ * @since Apr 22, 2008
  */
 public class GraphFigureFactory extends MappedFigureFactory {
 
 	/**
 	 * @param i_mode must not be null
-	 * @param i_map
 	 */
 	public GraphFigureFactory(DisplayMode i_mode) {
 		super(i_mode);
-		
+
 		if (i_mode == null) // parameter precondition
 			throw new NullPointerException(&quot;i_mode must not be null&quot;);
-		
-		
-		Map&lt;Class&lt;? extends GraphicalEditPart&gt;, Class&lt;? extends IFigure&gt;&gt; map
-		 = new HashMap&lt;Class&lt;? extends GraphicalEditPart&gt;, Class&lt;? extends IFigure&gt;&gt;();
-		
+
+		Map&lt;Class&lt;? extends GraphicalEditPart&gt;, Class&lt;? extends IFigure&gt;&gt; map =
+			new HashMap&lt;Class&lt;? extends GraphicalEditPart&gt;, Class&lt;? extends IFigure&gt;&gt;();
+
 		// Diagram figure
 		switch (getMode()) {
 		case TwoDimensional:
@@ -56,7 +60,7 @@
 		case ThreeDimensional:
 			map.put(GraphPartGeneric.class, GraphFigure3D.class);
 		}
-		
+
 		// Content figures
 		switch (getMode()) {
 		case TwoDimensional:
@@ -69,10 +73,9 @@
 			map.put(EdgePart.class, EdgeFigure3D.class);
 			break;
 		}
-		
+
 		setMap(map);
-		
+
 	}
-	
-	
+
 }

Modified: trunk/org.eclipse.gef3d.examples.graph/src/java/org/eclipse/gef3d/examples/graph/editor/figures/VertexFigure2D.java
===================================================================
--- trunk/org.eclipse.gef3d.examples.graph/src/java/org/eclipse/gef3d/examples/graph/editor/figures/VertexFigure2D.java	2011-06-28 14:00:38 UTC (rev 590)
+++ trunk/org.eclipse.gef3d.examples.graph/src/java/org/eclipse/gef3d/examples/graph/editor/figures/VertexFigure2D.java	2011-06-28 14:07:24 UTC (rev 591)
@@ -88,7 +88,14 @@
 //	}
 	
 	
+	/** 
+	 * {@inheritDoc}
+	 * @see java.lang.Object#toString()
+	 */
+	@Override
+	public String toString() {
+		return super.toString() + &quot; label=&quot; + ((Label)(getChildren().get(0))).getText();
+	}
 	
-	
 
 }

Modified: trunk/org.eclipse.gef3d.gmf/src/java/org/eclipse/gef3d/gmf/runtime/diagram/ui/parts/DiagramGraphicalViewer3D.java
===================================================================
--- trunk/org.eclipse.gef3d.gmf/src/java/org/eclipse/gef3d/gmf/runtime/diagram/ui/parts/DiagramGraphicalViewer3D.java	2011-06-28 14:00:38 UTC (rev 590)
+++ trunk/org.eclipse.gef3d.gmf/src/java/org/eclipse/gef3d/gmf/runtime/diagram/ui/parts/DiagramGraphicalViewer3D.java	2011-06-28 14:07:24 UTC (rev 591)
@@ -10,60 +10,52 @@
  ******************************************************************************/
 package org.eclipse.gef3d.gmf.runtime.diagram.ui.parts;
 
-import java.util.ArrayList;
 import java.util.Collection;
-import java.util.List;
 
-import org.eclipse.draw2d.ExclusionSearch;
 import org.eclipse.draw2d.FigureCanvas;
 import org.eclipse.draw2d.IFigure;
 import org.eclipse.draw2d.LightweightSystem;
-import org.eclipse.draw2d.TreeSearch;
 import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw3d.Draw3DCanvas;
-import org.eclipse.draw3d.IFigure3D;
-import org.eclipse.draw3d.ISurface;
 import org.eclipse.draw3d.LightweightSystem3D;
-import org.eclipse.draw3d.geometry.Math3D;
-import org.eclipse.draw3d.geometry.Math3DCache;
-import org.eclipse.draw3d.geometry.Vector3f;
-import org.eclipse.draw3d.picking.Hit;
-import org.eclipse.draw3d.picking.Picker;
-import org.eclipse.draw3d.util.Draw3DCache;
 import org.eclipse.emf.ecore.EObject;
 import org.eclipse.gef.EditPart;
 import org.eclipse.gef.Handle;
-import org.eclipse.gef.LayerConstants;
-import org.eclipse.gef.EditPartViewer.Conditional;
-import org.eclipse.gef.editparts.LayerManager;
+import org.eclipse.gef3d.factories.IFigureFactory;
+import org.eclipse.gef3d.factories.IFigureFactoryProvider;
 import org.eclipse.gef3d.gmf.runtime.core.service.IProviderAcceptorProvider;
 import org.eclipse.gef3d.gmf.runtime.core.service.ProviderAcceptor;
 import org.eclipse.gef3d.ui.parts.GraphicalViewer3D;
 import org.eclipse.gef3d.ui.parts.GraphicalViewer3DHelper;
 import org.eclipse.gmf.runtime.common.ui.services.editor.IEditorProvider;
 import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramGraphicalViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.opengl.GLCanvas;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 
 /**
- * 3D diagram graphical viewer.
+ * 3D diagram graphical viewer. It also implements
+ * {@link org.eclipse.gef3d.factories.IFigureFactoryProvider.Mutable} for
+ * convenience reasons.
  * 
  * @author Kristian Duske
  * @version $Revision$
  * @since Apr 7, 2009
  */
 public class DiagramGraphicalViewer3D extends DiagramGraphicalViewer implements
-		GraphicalViewer3D, IProviderAcceptorProvider {
+		GraphicalViewer3D, IProviderAcceptorProvider,
+		IFigureFactoryProvider.Mutable {
 
 	/**
 	 * Helper, implementing most methods needed in this implementation. The
 	 * methods in this class delegate to the helper methods.
 	 */
 	protected GraphicalViewer3DHelper m_ViewerHelper;
-	
+
 	/**
+	 * The figure factory.
+	 */
+	protected IFigureFactory m_FigureFactory = null;
+
+	/**
 	 * Creates this viewer and adds a {@link ProviderAcceptor} to its
 	 * properties. This provider selector is also attached as viewer to the
 	 * diagram, in order to be accessible via {@link IEditorProvider}, see
@@ -81,7 +73,7 @@
 	 * @param providerAcceptor
 	 */
 	public DiagramGraphicalViewer3D(ProviderAcceptor providerAcceptor) {
-		if (m_ViewerHelper==null) {
+		if (m_ViewerHelper == null) {
 			m_ViewerHelper = new GraphicalViewer3DHelper(this);
 		}
 		setProperty(ProviderAcceptor.PROVIDER_ACCEPTOR_PROPERTY_KEY,
@@ -120,7 +112,7 @@
 	 */
 	@Override
 	protected LightweightSystem createLightweightSystem() {
-		if (m_ViewerHelper==null) {
+		if (m_ViewerHelper == null) {
 			m_ViewerHelper = new GraphicalViewer3DHelper(this);
 		}
 		return m_ViewerHelper.createLightweightSystem();
@@ -198,8 +190,6 @@
 
 		return (ProviderAcceptor) getProperty(ProviderAcceptor.PROVIDER_ACCEPTOR_PROPERTY_KEY);
 	}
-	
-	
 
 	/**
 	 * {@inheritDoc}
@@ -241,4 +231,22 @@
 		getLightweightSystem().setContents(i_figure);
 	}
 
+	/**
+	 * {@inheritDoc}
+	 * 
+	 * @see org.eclipse.gef3d.factories.IFigureFactoryProvider.Mutable#setFigureFactory(org.eclipse.gef3d.factories.IFigureFactory)
+	 */
+	public void setFigureFactory(IFigureFactory i_factory) {
+		m_FigureFactory = i_factory;
+	}
+
+	/**
+	 * {@inheritDoc}
+	 * 
+	 * @see org.eclipse.gef3d.factories.IFigureFactoryProvider#getFigureFactory()
+	 */
+	public IFigureFactory getFigureFactory() {
+		return m_FigureFactory;
+	}
+
 }


</pre>]]></content:encoded>
		<pubDate>Tue, 28 Jun 2011 14:07:24 GMT</pubDate>
		<guid isPermaLink="true">http://dev.eclipse.org/mhonarc/lists/gef3d-commits/msg00436.html</guid>
		<author>genie@xxxxxxx (genie)</author>
	</item>
	<item>
		<title>[gef3d-commits] r590 -	trunk/org.eclipse.gef3d.ext/src/java/org/eclipse/gef3d/ext/multieditor</title>
		<link>http://dev.eclipse.org/mhonarc/lists/gef3d-commits/msg00435.html</link>
		<description>Author: jvonpilgrim Date: 2011-06-28 10:00:38 -0400 (Tue, 28 Jun 2011) New Revision: 590 Added: trunk/org.eclipse.gef3d.ext/src/java/org/eclipse/gef3d/ext/multieditor/MultiEditorFigureFactory.java Modified: trunk/org.eclipse.gef3d.ext/src/java/org/eclipse/...</description>
		<content:encoded><![CDATA[<pre>Author: jvonpilgrim
Date: 2011-06-28 10:00:38 -0400 (Tue, 28 Jun 2011)
New Revision: 590

Added:
   trunk/org.eclipse.gef3d.ext/src/java/org/eclipse/gef3d/ext/multieditor/MultiEditorFigureFactory.java
Modified:
   trunk/org.eclipse.gef3d.ext/src/java/org/eclipse/gef3d/ext/multieditor/MultiEditorPartFactory.java
Log:
Added MultiEditorFigureFactory to enable figure factories in combination with multi editors.

Added: trunk/org.eclipse.gef3d.ext/src/java/org/eclipse/gef3d/ext/multieditor/MultiEditorFigureFactory.java
===================================================================
--- trunk/org.eclipse.gef3d.ext/src/java/org/eclipse/gef3d/ext/multieditor/MultiEditorFigureFactory.java	                        (rev 0)
+++ trunk/org.eclipse.gef3d.ext/src/java/org/eclipse/gef3d/ext/multieditor/MultiEditorFigureFactory.java	2011-06-28 14:00:38 UTC (rev 590)
@@ -0,0 +1,167 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Jens von Pilgrim 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
+ * <a  href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
+ *
+ * Contributors:
+ *    Jens von Pilgrim - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.gef3d.ext.multieditor;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.gef.ConnectionEditPart;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.GraphicalViewer;
+import org.eclipse.gef.ui.parts.GraphicalEditor;
+import org.eclipse.gef3d.factories.DisplayMode;
+import org.eclipse.gef3d.factories.IFigureFactory;
+import org.eclipse.gef3d.factories.IFigureFactoryProvider;
+
+/**
+ * Multi figure factory used by multi editors. Similar to the
+ * {@link MultiEditorPartFactory}, it nests {@link IFigureFactory} registered by
+ * nested editors in
+ * {@link INestableEditor#initializeAsNested(org.eclipse.gef.GraphicalViewer, MultiEditorPartFactory, MultiEditorModelContainer)}
+ * . Instead of registering the {@link IFigureFactory} in
+ * {@link GraphicalEditor#configureGraphicalViewer()}, it is to be registered in
+ * {@link INestableEditor#initializeAsNested(org.eclipse.gef.GraphicalViewer, MultiEditorPartFactory, MultiEditorModelContainer)}
+ * .
+ * {@link #prepareNestedFigureFactory(GraphicalViewer, Object, IFigureFactory)}
+ * can be used there to simplify the registration.
+ * 
+ * @author Jens von Pilgrim (developer@xxxxxxxxx)
+ * @version $Revision$
+ * @since Jun 13, 2011
+ */
+public class MultiEditorFigureFactory implements IFigureFactory {
+
+	private DisplayMode mode;
+
+	protected Map&lt;EditPart, IFigureFactory&gt; nestedFigureFactories;
+
+	protected Map&lt;Object, IFigureFactory&gt; preparedFigureFactories;
+
+	/**
+	 * 
+	 */
+	public MultiEditorFigureFactory(DisplayMode i_mode) {
+		nestedFigureFactories = new HashMap&lt;EditPart, IFigureFactory&gt;();
+		preparedFigureFactories = new HashMap&lt;Object, IFigureFactory&gt;();
+		mode = i_mode;
+	}
+
+	/**
+	 * To be called in
+	 * {@link INestableEditor#initializeAsNested(GraphicalViewer, MultiEditorPartFactory, MultiEditorModelContainer)}
+	 * .
+	 * 
+	 * @param i_graphicalViewer the viewer, must be an instance of
+	 *            {@link IFigureFactoryProvider}
+	 * @param model the (root) model of the nested editor, usually the diagram
+	 * @param nestedFigureFactory the nested figure factory
+	 * @throws IllegalArgumentException if viewer provides no
+	 *             {@link MultiEditorFigureFactory}.
+	 */
+	public static void prepareNestedFigureFactory(
+		GraphicalViewer i_graphicalViewer, Object model,
+		IFigureFactory nestedFigureFactory) {
+
+		if (i_graphicalViewer instanceof IFigureFactoryProvider) {
+			IFigureFactory figureFactory =
+				((IFigureFactoryProvider) i_graphicalViewer).getFigureFactory();
+			if (figureFactory instanceof MultiEditorFigureFactory) {
+				((MultiEditorFigureFactory) figureFactory)
+					.prepareNestedFigureFactory(model, nestedFigureFactory);
+			} else {
+				throw new IllegalArgumentException(
+					&quot;Viewer's figure factory must be a MultiEditorFigureFactory, was &quot;
+						+ figureFactory);
+			}
+		} else {
+			throw new IllegalArgumentException(
+				&quot;Viewer must be an IFigureFactoryProvider&quot;);
+		}
+
+	}
+
+	/**
+	 * {@inheritDoc}
+	 * 
+	 * @see org.eclipse.gef3d.factories.IDisplayModeSensitive#getMode()
+	 */
+	public DisplayMode getMode() {
+		return mode;
+	}
+
+	/**
+	 * Adds a new figure factory. Similar to {@link MultiEditorPartFactory}, the
+	 * edit part to be used as key for retrieving the figure factory has not
+	 * been created when initializing the factory. Thus, its model element is
+	 * used to prepare the factory.
+	 * 
+	 * @param model usually the model of the diagram
+	 * @param nestedFigureFactory
+	 */
+	public void prepareNestedFigureFactory(Object model,
+		IFigureFactory nestedFigureFactory) {
+		preparedFigureFactories.put(model, nestedFigureFactory);
+	}
+
+	/**
+	 * Removes a figure factory.
+	 * 
+	 * @param rootEditPart
+	 */
+	public void removeNestedFigureFactory(EditPart rootEditPart) {
+		nestedFigureFactories.remove(rootEditPart);
+	}
+
+	/**
+	 * {@inheritDoc}.
+	 * 
+	 * @see org.eclipse.gef3d.factories.IFigureFactory#createFigure(org.eclipse.gef.GraphicalEditPart,
+	 *      java.lang.Object)
+	 */
+	public IFigure createFigure(GraphicalEditPart i_controller, Object i_hint) {
+		IFigureFactory figureFactory = null;
+		EditPart ep = i_controller;
+		while (figureFactory == null &amp;&amp; ep != null) {
+			figureFactory = nestedFigureFactories.get(ep);
+			ep = ep.getParent();
+		}
+		if (figureFactory == null) {
+			Object model = i_controller.getModel();
+			figureFactory = preparedFigureFactories.get(model);
+			if (figureFactory != null) {
+				nestedFigureFactories.put(i_controller, figureFactory);
+				preparedFigureFactories.remove(model);
+			}
+		}
+		if (figureFactory == null &amp;&amp; i_controller instanceof ConnectionEditPart) {
+			ep = ((ConnectionEditPart)i_controller).getSource();
+			while (figureFactory == null &amp;&amp; ep != null) {
+				figureFactory = nestedFigureFactories.get(ep);
+				ep = ep.getParent();
+			}
+			if (figureFactory==null) {
+				ep = ((ConnectionEditPart)i_controller).getTarget();
+				while (figureFactory == null &amp;&amp; ep != null) {
+					figureFactory = nestedFigureFactories.get(ep);
+					ep = ep.getParent();
+				}	
+			}
+		}
+		if (figureFactory == null) {
+			throw new IllegalStateException(
+				&quot;No nested figure factory found for &quot; + i_controller);
+		}
+		return figureFactory.createFigure(i_controller, i_hint);
+	}
+
+}


Property changes on: trunk/org.eclipse.gef3d.ext/src/java/org/eclipse/gef3d/ext/multieditor/MultiEditorFigureFactory.java
___________________________________________________________________
Added: svn:keywords
   + Date Revision Author HeadURL Id

Modified: trunk/org.eclipse.gef3d.ext/src/java/org/eclipse/gef3d/ext/multieditor/MultiEditorPartFactory.java
===================================================================
--- trunk/org.eclipse.gef3d.ext/src/java/org/eclipse/gef3d/ext/multieditor/MultiEditorPartFactory.java	2011-06-28 10:48:28 UTC (rev 589)
+++ trunk/org.eclipse.gef3d.ext/src/java/org/eclipse/gef3d/ext/multieditor/MultiEditorPartFactory.java	2011-06-28 14:00:38 UTC (rev 590)
@@ -59,15 +59,18 @@
  * {@link #createMultiContainerEditPart()}. If you need other another edit part
  * to be created for the container, set the type of the edit part created for
  * the container in setMultiEditorContainerEditPartType() (sorry for that long
- * method name). This usually is the case if you need to define a different
- * layout for the container, which is set in the container's edit part.
+ * method name) at the end of {@link GraphicalEditor#configureGraphicalViewer()}
+ * (after calling super method which registers this factory). This usually is
+ * the case if you need to define a different layout for the container, which is
+ * set in the container's edit part.
  * &lt;/p&gt;
  * 
  * @author Jens von Pilgrim
  * @version $Revision$
  * @since 14.01.2008
  */
-public class MultiEditorPartFactory implements EditPartFactory, IMultiEditorPartFactory {
+public class MultiEditorPartFactory implements EditPartFactory,
+		IMultiEditorPartFactory {
 
 	/**
 	 * The factory indicator strategy defines how the factory to be used for
@@ -90,7 +93,6 @@
 		FIND_BY_PARENT, POLICY_AT_CONNECTIONS, POLICY
 	}
 
-
 	// protected EditPartFactory lastUsedFactory;
 
 	private static class WeightedFactory implements Comparable&lt;WeightedFactory&gt; {
@@ -163,8 +165,8 @@
 	/**
 	 * Logger for this class
 	 */
-	private static final Logger log =
-		Logger.getLogger(MultiEditorPartFactory.class.getName());
+	private static final Logger log = Logger
+		.getLogger(MultiEditorPartFactory.class.getName());
 
 	Map&lt;EditPart, FactorySet&gt; m_delegatedFactories;
 
@@ -250,17 +252,21 @@
 
 	}
 
-	/** 
+	/**
 	 * {@inheritDoc}
-	 * @see org.eclipse.gef3d.ext.multieditor.IMultiEditorPartFactory#prepare(java.lang.Object, org.eclipse.gef.EditPartFactory)
+	 * 
+	 * @see org.eclipse.gef3d.ext.multieditor.IMultiEditorPartFactory#prepare(java.lang.Object,
+	 *      org.eclipse.gef.EditPartFactory)
 	 */
 	public void prepare(Object model, EditPartFactory i_factory) {
 		prepare(model, i_factory, LOWEST_PRIORITY);
 	}
 
-	/** 
+	/**
 	 * {@inheritDoc}
-	 * @see org.eclipse.gef3d.ext.multieditor.IMultiEditorPartFactory#prepare(java.lang.Object, org.eclipse.gef.EditPartFactory, int)
+	 * 
+	 * @see org.eclipse.gef3d.ext.multieditor.IMultiEditorPartFactory#prepare(java.lang.Object,
+	 *      org.eclipse.gef.EditPartFactory, int)
 	 */
 	public void prepare(Object model, EditPartFactory i_factory, int i_weight) {
 		if (i_factory == null) {
@@ -326,6 +332,7 @@
 			return part;
 		}
 
+		FactorySet contextFactorySet = null;
 		FactorySet fs = null;
 		EditPart part = null;
 		FactoryIndicationEditPolicy factoryIndicationEditPolicy = null;
@@ -342,8 +349,8 @@
 					factoryIndicationEditPolicy.getFactory().createEditPart(
 						i_context, i_model);
 				if (part != null) {
-					installFactoryIndicator(part, factoryIndicationEditPolicy
-						.getFactory());
+					installFactoryIndicator(part,
+						factoryIndicationEditPolicy.getFactory());
 				}
 
 				if (log.isLoggable(Level.INFO)) {
@@ -351,10 +358,10 @@
 				}
 			} else {
 				// no factory indicator, so we have to find the factory set:
-				fs = findFactoriesByContext(i_context);
+				contextFactorySet = findFactoriesByContext(i_context);
 
-				if (fs != null) {
-					part = fs.createEditPart(i_context, i_model);
+				if (contextFactorySet != null) {
+					part = contextFactorySet.createEditPart(i_context, i_model);
 					// if (log.isLoggable(Level.INFO)) {
 					// log.info(&quot;create part by context&quot;); //$NON-NLS-1$
 					// }
@@ -374,6 +381,7 @@
 			// for that:
 			// this is usually the case with modelContainer, i.e. the real root
 			// models
+
 			fs = m_preparedFactories.get(i_model);
 			if (fs != null) {
 				part = fs.createEditPart(i_context, i_model);
@@ -397,14 +405,18 @@
 					// }
 
 				}
-
 			}
 		}
 
-		if (fs == null &amp;&amp; factoryIndicationEditPolicy == null) {
-			throw new IllegalStateException(&quot;No root context or &quot;
-				+ &quot;factory found for model &quot; + i_model + &quot;; context &quot;
-				+ i_context);
+		if (part == null) {
+			if (fs == null &amp;&amp; contextFactorySet == null
+				&amp;&amp; factoryIndicationEditPolicy == null) {
+				throw new IllegalStateException(&quot;No root context or &quot;
+					+ &quot;factory found for model &quot; + i_model + &quot;; context &quot;
+					+ i_context);
+			}
+
+			log.warning(&quot;Cannot create edit part for &quot; + i_model + &quot;(&quot; + i_model.getClass() + &quot;)&quot;); //$NON-NLS-1$
 		}
 
 		// if (part == null) {
@@ -421,7 +433,10 @@
 	 * Creates the edit part for the multi editor container, this method is only
 	 * called by {@link #createEditPart(EditPart, Object)}. This is a
 	 * {@link MultiEditorModelContainerEditPart} by default, if you need another
-	 * editpart class, set the new type in
+	 * editpart class, set the new type via
+	 * {@link #setMultiEditorContainerEditPartType(Class)} at the end of
+	 * {@link GraphicalEditor#configureGraphicalViewer()} (after calling super
+	 * method which registers this factory).
 	 * 
 	 * @return the edit part for the multi container
 	 */


</pre>]]></content:encoded>
		<pubDate>Tue, 28 Jun 2011 14:00:38 GMT</pubDate>
		<guid isPermaLink="true">http://dev.eclipse.org/mhonarc/lists/gef3d-commits/msg00435.html</guid>
		<author>genie@xxxxxxx (genie)</author>
	</item>
	<item>
		<title>[gef3d-commits] r589 - tags/archive trunk</title>
		<link>http://dev.eclipse.org/mhonarc/lists/gef3d-commits/msg00434.html</link>
		<description>Author: jvonpilgrim Date: 2011-06-28 06:48:28 -0400 (Tue, 28 Jun 2011) New Revision: 589 Added: tags/archive/org.eclipse.draw3d.x3d/ Removed: trunk/org.eclipse.draw3d.x3d/ Log: x3d is no longer maintained </description>
		<content:encoded><![CDATA[<pre>Author: jvonpilgrim
Date: 2011-06-28 06:48:28 -0400 (Tue, 28 Jun 2011)
New Revision: 589

Added:
   tags/archive/org.eclipse.draw3d.x3d/
Removed:
   trunk/org.eclipse.draw3d.x3d/
Log:
x3d is no longer maintained


</pre>]]></content:encoded>
		<pubDate>Tue, 28 Jun 2011 10:48:28 GMT</pubDate>
		<guid isPermaLink="true">http://dev.eclipse.org/mhonarc/lists/gef3d-commits/msg00434.html</guid>
		<author>genie@xxxxxxx (genie)</author>
	</item>
	<item>
		<title>[gef3d-commits] r588 - tags</title>
		<link>http://dev.eclipse.org/mhonarc/lists/gef3d-commits/msg00433.html</link>
		<description>Author: jvonpilgrim Date: 2011-06-28 06:47:06 -0400 (Tue, 28 Jun 2011) New Revision: 588 Added: tags/archive/ Log: created archive folder for deprecated subprojects </description>
		<content:encoded><![CDATA[<pre>Author: jvonpilgrim
Date: 2011-06-28 06:47:06 -0400 (Tue, 28 Jun 2011)
New Revision: 588

Added:
   tags/archive/
Log:
created archive folder for deprecated subprojects


</pre>]]></content:encoded>
		<pubDate>Tue, 28 Jun 2011 10:47:06 GMT</pubDate>
		<guid isPermaLink="true">http://dev.eclipse.org/mhonarc/lists/gef3d-commits/msg00433.html</guid>
		<author>genie@xxxxxxx (genie)</author>
	</item>
	<item>
		<title>[gef3d-commits] r587 -	trunk/org.eclipse.gef3d.ext/src/java/org/eclipse/gef3d/ext/multieditor/dnd</title>
		<link>http://dev.eclipse.org/mhonarc/lists/gef3d-commits/msg00432.html</link>
		<description>Author: jvonpilgrim Date: 2011-06-28 06:39:14 -0400 (Tue, 28 Jun 2011) New Revision: 587 Modified: trunk/org.eclipse.gef3d.ext/src/java/org/eclipse/gef3d/ext/multieditor/dnd/EditorInputTransferDropTargetListener.java Log: Fixed bug in editor input drop mec...</description>
		<content:encoded><![CDATA[<pre>Author: jvonpilgrim
Date: 2011-06-28 06:39:14 -0400 (Tue, 28 Jun 2011)
New Revision: 587

Modified:
   trunk/org.eclipse.gef3d.ext/src/java/org/eclipse/gef3d/ext/multieditor/dnd/EditorInputTransferDropTargetListener.java
Log:
Fixed bug in editor input drop mechanism, introduced by DND refactoring.

Modified: trunk/org.eclipse.gef3d.ext/src/java/org/eclipse/gef3d/ext/multieditor/dnd/EditorInputTransferDropTargetListener.java
===================================================================
--- trunk/org.eclipse.gef3d.ext/src/java/org/eclipse/gef3d/ext/multieditor/dnd/EditorInputTransferDropTargetListener.java	2011-06-28 10:38:30 UTC (rev 586)
+++ trunk/org.eclipse.gef3d.ext/src/java/org/eclipse/gef3d/ext/multieditor/dnd/EditorInputTransferDropTargetListener.java	2011-06-28 10:39:14 UTC (rev 587)
@@ -85,12 +85,18 @@
 			for (EditorInputTransfer.EditorInputData data : editorInputsData)
 				if (!getMultiEditor().acceptsInput(data.input)) {
 					return DND.DROP_NONE;
+				} else {
+					return DND.DROP_COPY;
 				}
+		}
+
+		if (EditorInputTransfer.getInstance().isSupportedType(
+			i_event.currentDataType)) {
+			return DND.DROP_COPY;
 		} else {
 			return DND.DROP_NONE;
 		}
 
-		return DND.DROP_COPY;
 	}
 
 	/**


</pre>]]></content:encoded>
		<pubDate>Tue, 28 Jun 2011 10:39:14 GMT</pubDate>
		<guid isPermaLink="true">http://dev.eclipse.org/mhonarc/lists/gef3d-commits/msg00432.html</guid>
		<author>genie@xxxxxxx (genie)</author>
	</item>
	<item>
		<title>[gef3d-commits] r586 -	trunk/org.eclipse.gef3d.ext/src/java/org/eclipse/gef3d/ext/multieditor</title>
		<link>http://dev.eclipse.org/mhonarc/lists/gef3d-commits/msg00431.html</link>
		<description>Author: jvonpilgrim Date: 2011-06-28 06:38:30 -0400 (Tue, 28 Jun 2011) New Revision: 586 Modified: trunk/org.eclipse.gef3d.ext/src/java/org/eclipse/gef3d/ext/multieditor/AbstractMultiEditor3D.java Log: Added check before type cast. No check should cause no...</description>
		<content:encoded><![CDATA[<pre>Author: jvonpilgrim
Date: 2011-06-28 06:38:30 -0400 (Tue, 28 Jun 2011)
New Revision: 586

Modified:
   trunk/org.eclipse.gef3d.ext/src/java/org/eclipse/gef3d/ext/multieditor/AbstractMultiEditor3D.java
Log:
Added check before type cast. No check should cause no problems, but checking the type before casting is better style.

Modified: trunk/org.eclipse.gef3d.ext/src/java/org/eclipse/gef3d/ext/multieditor/AbstractMultiEditor3D.java
===================================================================
--- trunk/org.eclipse.gef3d.ext/src/java/org/eclipse/gef3d/ext/multieditor/AbstractMultiEditor3D.java	2011-06-24 09:58:08 UTC (rev 585)
+++ trunk/org.eclipse.gef3d.ext/src/java/org/eclipse/gef3d/ext/multieditor/AbstractMultiEditor3D.java	2011-06-28 10:38:30 UTC (rev 586)
@@ -41,6 +41,8 @@
 import org.eclipse.gef3d.ext.multieditor.NestedEditorInfo.NestedEditorInfoList;
 import org.eclipse.gef3d.ext.multieditor.dnd.EditorInputDropPolicy;
 import org.eclipse.gef3d.ext.multieditor.dnd.EditorInputTransferDropTargetListener;
+import org.eclipse.gef3d.factories.DisplayMode;
+import org.eclipse.gef3d.factories.IFigureFactoryProvider;
 import org.eclipse.gef3d.tools.CameraTool;
 import org.eclipse.gef3d.ui.parts.GraphicalEditor3DWithFlyoutPalette;
 import org.eclipse.ui.IEditorInput;
@@ -206,7 +208,10 @@
 	}
 
 	/**
-	 * {@inheritDoc}
+	 * {@inheritDoc}.
+	 * &lt;p&gt;
+	 * A {@link MultiEditorPartFactory} and a {@link MultiEditorFigureFactory}
+	 * are registered to the graphical viewer.
 	 * 
 	 * @see org.eclipse.gef3d.examples.graph.editor.GraphEditor3D#configureGraphicalViewer()
 	 */
@@ -219,8 +224,15 @@
 		RootEditPart root = createRootEditPart();
 		getGraphicalViewer().setRootEditPart(root);
 
+		if (getGraphicalViewer() instanceof IFigureFactoryProvider.Mutable) {
+			((IFigureFactoryProvider.Mutable) getGraphicalViewer())
+				.setFigureFactory(new MultiEditorFigureFactory(
+					DisplayMode.Projected));
+		}
+
 		m_multiFactory = createMultiFactory();
 		getGraphicalViewer().setEditPartFactory(m_multiFactory);
+
 	}
 
 	/**


</pre>]]></content:encoded>
		<pubDate>Tue, 28 Jun 2011 10:38:30 GMT</pubDate>
		<guid isPermaLink="true">http://dev.eclipse.org/mhonarc/lists/gef3d-commits/msg00431.html</guid>
		<author>genie@xxxxxxx (genie)</author>
	</item>


	<item>
		<title>[gef3d-commits] r585 -	trunk/org.eclipse.draw3d/src/java/org/eclipse/draw3d/graphics/optimizer</title>
		<link>http://dev.eclipse.org/mhonarc/lists/gef3d-commits/msg00430.html</link>
		<description>Author: jvonpilgrim Date: 2011-06-24 05:58:08 -0400 (Fri, 24 Jun 2011) New Revision: 585 Modified: trunk/org.eclipse.draw3d/src/java/org/eclipse/draw3d/graphics/optimizer/RecordingGraphics.java Log: removed access to platform specific fields of graphics.Pa...</description>
		<content:encoded><![CDATA[<pre>Author: jvonpilgrim
Date: 2011-06-24 05:58:08 -0400 (Fri, 24 Jun 2011)
New Revision: 585

Modified:
   trunk/org.eclipse.draw3d/src/java/org/eclipse/draw3d/graphics/optimizer/RecordingGraphics.java
Log:
removed access to platform specific fields of graphics.Path

Modified: trunk/org.eclipse.draw3d/src/java/org/eclipse/draw3d/graphics/optimizer/RecordingGraphics.java
===================================================================
--- trunk/org.eclipse.draw3d/src/java/org/eclipse/draw3d/graphics/optimizer/RecordingGraphics.java	2011-06-17 15:20:18 UTC (rev 584)
+++ trunk/org.eclipse.draw3d/src/java/org/eclipse/draw3d/graphics/optimizer/RecordingGraphics.java	2011-06-24 09:58:08 UTC (rev 585)
@@ -476,9 +476,7 @@
 	public void fillPath(Path i_path) {
 		if (i_path == null) // parameter precondition
 			throw new NullPointerException(&quot;i_path must not be null&quot;);
-		if (i_path.handle == null) // parameter precondition
-			throw new NullPointerException(&quot;i_path.handle must not be null&quot;);
-
+		
 		// TODO improve that, this is just a quick hack to avoid exceptions
 		PointList pointList = pathToPointList(i_path);
 		fillPolygon(pointList);
@@ -512,8 +510,6 @@
 	public void clipPath(Path i_path) {
 		if (i_path == null) // parameter precondition
 			throw new NullPointerException(&quot;i_path must not be null&quot;);
-		if (i_path.handle == null) // parameter precondition
-			throw new NullPointerException(&quot;i_path.handle must not be null&quot;);
 
 		// TODO improve that, this is just a quick hack to avoid exceptions
 		PointList pointList = pathToPointList(i_path);
@@ -543,9 +539,7 @@
 	public void drawPath(Path i_path) {
 		if (i_path == null) // parameter precondition
 			throw new NullPointerException(&quot;i_path must not be null&quot;);
-		if (i_path.handle == null) // parameter precondition
-			throw new NullPointerException(&quot;i_path.handle must not be null&quot;);
-
+		
 		// TODO improve that, this is just a quick hack to avoid exceptions
 		PointList pointList = pathToPointList(i_path);
 		drawPolygon(pointList);


</pre>]]></content:encoded>
		<pubDate>Fri, 24 Jun 2011 09:58:08 GMT</pubDate>
		<guid isPermaLink="true">http://dev.eclipse.org/mhonarc/lists/gef3d-commits/msg00430.html</guid>
		<author>genie@xxxxxxx (genie)</author>
	</item>

 
	</channel>
	</rss>
<!-- MHonArc v2.6.10 -->
