onModelChange();
editor.getSelectionSyncer().addViewer(getViewer());
// Creation de la miniature.
Canvas canvas = new Canvas(sash, SWT.BORDER);
LightweightSystem lws = new LightweightSystem(canvas);
GraphicalViewer graphicalViewer = editor.getGraphicalViewer();
if (graphicalViewer == null)
return;
RootEditPart rootEditPart = graphicalViewer.getRootEditPart();
// TODO Graphiti - not a ScalableRootEditPart but some kind of DiagramEditPart
if (rootEditPart instanceof ScalableRootEditPartAnimated) {
ScalableRootEditPartAnimated diagramEditPart = (ScalableRootEditPartAnimated) rootEditPart;
IFigure figure = diagramEditPart.getFigure();
thumbnail = new ScrollableThumbnail( (Viewport) figure);
IFigure source = diagramEditPart.getLayer(LayerConstants.PRINTABLE_LAYERS);
thumbnail.setSource(source);
lws.setContents(thumbnail);
} else if (rootEditPart instanceof ScalableRootEditPart) {
thumbnail = new ScrollableThumbnail( (Viewport) ((ScalableRootEditPart) rootEditPart).getFigure());
thumbnail.setSource(((ScalableRootEditPart) rootEditPart).getLayer(LayerConstants.PRINTABLE_LAYERS));
lws.setContents(thumbnail);
}
disposeListener = new DisposeListener() {
/*
* (non-Javadoc)
* @see org.eclipse.swt.events.DisposeListener#widgetDisposed(org.eclipse.swt.events.DisposeEvent)