| /******************************************************************************* |
| * Copyright (c) 2006 Borland Software 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: |
| * Borland Software Corporation - initial API and implementation |
| *******************************************************************************/ |
| package org.eclipse.gmf.examples.mindmap.diagram.part; |
| |
| import org.eclipse.draw2d.DelegatingLayout; |
| import org.eclipse.draw2d.FreeformLayer; |
| import org.eclipse.draw2d.LayeredPane; |
| import org.eclipse.gef.LayerConstants; |
| import org.eclipse.gmf.examples.mindmap.diagram.edit.parts.MindmapEditPartFactory; |
| import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramRootEditPart; |
| import org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.editor.FileDiagramEditor; |
| import org.eclipse.ui.IEditorInput; |
| import org.eclipse.ui.ide.IGotoMarker; |
| |
| /** |
| * @generated |
| */ |
| public class MindmapDiagramEditor extends FileDiagramEditor implements IGotoMarker { |
| |
| /** |
| * @generated |
| */ |
| public static final String ID = "org.eclipse.gmf.examples.mindmap.diagram.part.MindmapDiagramEditorID"; |
| |
| /** |
| * @generated |
| */ |
| public MindmapDiagramEditor() { |
| super(true); |
| } |
| |
| /** |
| * @generated |
| */ |
| protected void setDocumentProvider(IEditorInput input) { |
| setDocumentProvider(new MindmapDocumentProvider()); |
| } |
| |
| /** |
| * @generated |
| */ |
| protected void configureGraphicalViewer() { |
| super.configureGraphicalViewer(); |
| DiagramRootEditPart root = (DiagramRootEditPart) getDiagramGraphicalViewer().getRootEditPart(); |
| LayeredPane printableLayers = (LayeredPane) root.getLayer(LayerConstants.PRINTABLE_LAYERS); |
| FreeformLayer extLabelsLayer = new FreeformLayer(); |
| extLabelsLayer.setLayoutManager(new DelegatingLayout()); |
| printableLayers.addLayerAfter(extLabelsLayer, MindmapEditPartFactory.EXTERNAL_NODE_LABELS_LAYER, LayerConstants.PRIMARY_LAYER); |
| LayeredPane scalableLayers = (LayeredPane) root.getLayer(LayerConstants.SCALABLE_LAYERS); |
| FreeformLayer scaledFeedbackLayer = new FreeformLayer(); |
| scaledFeedbackLayer.setEnabled(false); |
| scalableLayers.addLayerAfter(scaledFeedbackLayer, LayerConstants.SCALED_FEEDBACK_LAYER, DiagramRootEditPart.DECORATION_UNPRINTABLE_LAYER); |
| } |
| } |