[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[gef3d-commits] r586 - trunk/org.eclipse.gef3d.ext/src/java/org/eclipse/gef3d/ext/multieditor

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}.
+	 * <p>
+	 * 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);
+
 	}
 
 	/**