Bug 363449:
* Fix a build.properties
* Minor improvements
diff --git a/plugins/org.eclipse.gmf.graphdef.edit/build.properties b/plugins/org.eclipse.gmf.graphdef.edit/build.properties
index 28fbdd6..cf0cbf2 100644
--- a/plugins/org.eclipse.gmf.graphdef.edit/build.properties
+++ b/plugins/org.eclipse.gmf.graphdef.edit/build.properties
@@ -16,5 +16,6 @@
                about.html,\
                messages.properties
 jars.compile.order = .
-source.. = src/
+source.. = src/,\
+           src-extras/
 output.. = bin/
diff --git a/plugins/org.eclipse.gmf.graphdef.edit/src-extras/org/eclipse/gmf/graphdef/edit/PreviewRenderedFigureOutlinePage.java b/plugins/org.eclipse.gmf.graphdef.edit/src-extras/org/eclipse/gmf/graphdef/edit/PreviewRenderedFigureOutlinePage.java
index 7f730b6..fc5ab83 100644
--- a/plugins/org.eclipse.gmf.graphdef.edit/src-extras/org/eclipse/gmf/graphdef/edit/PreviewRenderedFigureOutlinePage.java
+++ b/plugins/org.eclipse.gmf.graphdef.edit/src-extras/org/eclipse/gmf/graphdef/edit/PreviewRenderedFigureOutlinePage.java
@@ -37,6 +37,7 @@
 
 	private RectangleFigure background;
 	private Control control;
+	private ISelection selection;
 
 	@Override
 	public void createControl(Composite parent) {
@@ -77,21 +78,22 @@
 		getControl().setFocus();
 	}
 
-	@Override
 	public void addSelectionChangedListener(ISelectionChangedListener listener) {
 	}
 
-	@Override
 	public ISelection getSelection() {
-		return new StructuredSelection();
+		if (selection != null) {
+			return new StructuredSelection();
+		} else {
+			return selection;
+		}
 	}
 
-	@Override
 	public void removeSelectionChangedListener(ISelectionChangedListener listener) {
 	}
 
-	@Override
 	public void setSelection(ISelection selection) {
+		this.selection = selection;
 		handleSelectionChanged(selection);
 	}
 
@@ -115,12 +117,20 @@
 			
 			if (modelFigure != null) {
 				GMFGraphRenderedFigure draw2figure = new GMFGraphRenderedFigure(modelFigure);
-				background.add(draw2figure, new GridData(SWT.FILL, SWT.FILL, false, false));
+				try {
+					draw2figure.validate();
+					background.add(draw2figure, new GridData(SWT.FILL, SWT.FILL, false, false));
+				} catch (Exception ex) {
+					org.eclipse.draw2d.Label exceptionLabel = new org.eclipse.draw2d.Label();
+					exceptionLabel.setForegroundColor(ColorConstants.black);
+					exceptionLabel.setText(ex.getLocalizedMessage());
+					background.add(exceptionLabel, new GridData(SWT.FILL, SWT.FILL, true, true));
+				}
+				
 			}
 		}
 	}
 
-	@Override
 	public void selectionChanged(SelectionChangedEvent event) {
 		handleSelectionChanged(event.getSelection());
 	}
diff --git a/plugins/org.eclipse.gmf.graphdef.runtime/src/org/eclipse/gmf/runtime/graphdef/GMFGraphRenderedFigure.java b/plugins/org.eclipse.gmf.graphdef.runtime/src/org/eclipse/gmf/runtime/graphdef/GMFGraphRenderedFigure.java
index 478142d..da9c025 100644
--- a/plugins/org.eclipse.gmf.graphdef.runtime/src/org/eclipse/gmf/runtime/graphdef/GMFGraphRenderedFigure.java
+++ b/plugins/org.eclipse.gmf.graphdef.runtime/src/org/eclipse/gmf/runtime/graphdef/GMFGraphRenderedFigure.java
@@ -22,6 +22,7 @@
 import org.eclipse.draw2d.GridData;
 import org.eclipse.draw2d.GridLayout;
 import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
 import org.eclipse.draw2d.LayoutManager;
 import org.eclipse.draw2d.PolylineDecoration;
 import org.eclipse.draw2d.PolylineShape;
@@ -46,6 +47,7 @@
 import org.eclipse.gmf.gmfgraph.RGBColor;
 import org.eclipse.gmf.gmfgraph.RealFigure;
 import org.eclipse.gmf.gmfgraph.RoundedRectangle;
+import org.eclipse.gmf.gmfgraph.SVGFigure;
 import org.eclipse.gmf.gmfgraph.ScalablePolygon;
 import org.eclipse.gmf.gmfgraph.Shape;
 import org.eclipse.gmf.gmfgraph.StackLayout;
@@ -79,11 +81,20 @@
 	
 	public GMFGraphRenderedFigure(org.eclipse.gmf.gmfgraph.Figure figureDef) {
 		GridLayout manager = new GridLayout();
-		setForegroundColor(ColorConstants.black);
 		setLayoutManager(manager);
 		ConvertedFigure res = toDraw2d(figureDef); 
 		mainFigure = res.figure;
-		add(mainFigure, new GridData(SWT.FILL, SWT.FILL, false, false));
+		if (mainFigure == null) {
+			Label label = new Label();
+			if (getFont() == null) {
+				setFont(Display.getDefault().getSystemFont());
+			}
+			label.setText("Rendering not supported (yet?)");
+			label.setForegroundColor(ColorConstants.black);
+			add(label, new GridData(SWT.FILL, SWT.FILL, true, true));
+		} else {
+			add(mainFigure, new GridData(SWT.FILL, SWT.FILL, false, false));
+		}
 	}
 	
 	@Override
@@ -126,13 +137,16 @@
 		} else {
 			// TODO connections, label, decoration, custom...
 			// all other concrete types for a Figure
+			// TODO also: pluggability for figureDef, generator and previewer
 		}
 		
 		if (figureDef.getLayoutData() != null) {
 			layoutData = toDraw2d(figureDef.getLayoutData());
 		}
 		
-		populate(figureDef, figure);
+		if (figure != null) {
+			populate(figureDef, figure);
+		}
 		
 		ConvertedFigure res = new ConvertedFigure();
 		res.figure = figure;
@@ -328,8 +342,12 @@
 		if (layoutData instanceof XYLayoutData) {
 			XYLayoutData xyLayoutData = (XYLayoutData)layoutData;
 			Rectangle res = new Rectangle();
-			res.setSize(toDraw2d(xyLayoutData.getSize()));
-			res.setLocation(toDraw2d(xyLayoutData.getTopLeft()));
+			if (xyLayoutData.getSize() != null) {
+				res.setSize(toDraw2d(xyLayoutData.getSize()));
+			}
+			if (xyLayoutData.getTopLeft() != null) {
+				res.setLocation(toDraw2d(xyLayoutData.getTopLeft()));
+			}
 			return res;
 		} else if (layoutData instanceof GridLayoutData) {
 			GridLayoutData gridLayoutData = (GridLayoutData) layoutData;