Package org.eclipse.gef.editparts

Examples of org.eclipse.gef.editparts.ScalableFreeformRootEditPart


  public void createControl(Composite parent) {
    canvas = new Canvas(parent, SWT.BORDER);
    LightweightSystem lws = new LightweightSystem(canvas);

    RootEditPart root = editor.getGraphicalViewer().getRootEditPart();
    ScalableFreeformRootEditPart scalable = (ScalableFreeformRootEditPart) root;
    thumbnail = new ScrollableThumbnail((Viewport) scalable.getFigure());
    thumbnail.setSource(scalable.getLayer(LayerConstants.PRINTABLE_LAYERS));

    lws.setContents(thumbnail);

    disposeListener = new DisposeListener() {
      @Override
View Full Code Here


    protected void configureGraphicalViewer() {
        super.configureGraphicalViewer();

        GraphicalViewer viewer = getGraphicalViewer();
        viewer.setEditPartFactory(new ShapesEditPartFactory());
        viewer.setRootEditPart(new ScalableFreeformRootEditPart());
        viewer.setKeyHandler(new GraphicalViewerKeyHandler(viewer));

        // configure the context menu provider
        ContextMenuProvider cmProvider = new ShapesEditorContextMenuProvider(viewer, getActionRegistry());
        viewer.setContextMenu(cmProvider);
View Full Code Here

   * active).
   */
  public void hideContextButtonsInstantly() {
    if (getActiveContextButtonPad() != null) {
      synchronized (this) {
        ScalableFreeformRootEditPart rootEditPart = (ScalableFreeformRootEditPart) getEditor().getGraphicalViewer()
            .getRootEditPart();
        IFigure feedbackLayer = rootEditPart.getLayer(LayerConstants.HANDLE_LAYER);
        feedbackLayer.remove(getActiveContextButtonPad());
        setActiveContextButtonPad(null);
      }
    }
  }
View Full Code Here

    {
      return;
    }
   
    // determine zoom level
    ScalableFreeformRootEditPart rootEditPart = (ScalableFreeformRootEditPart) getEditor().getGraphicalViewer().getRootEditPart();
    double zoom = rootEditPart.getZoomManager().getZoom();
    if (zoom < MINIMUM_ZOOM_LEVEL) {
      return;
    }

    ContextButtonPadData contextButtonPadData = getContextButtonPad(getEditor().getSelectedEditParts());
   
   
    if (contextButtonPadData.getRightContextButtons().size() == 0
        && contextButtonPadData.getTopContextButtons().size() == 0) {         
      return; // no context buttons to show
    }

    IContextButtonPadDeclaration declaration = new StandardContextButtonPadDeclaration(contextButtonPadData);

    // create context button pad and add to handle layer
    ContextButtonPad contextButtonPad = new ContextButtonPad(declaration, zoom, getEditor(), getEditor().getSelectedEditParts());
    setActiveContextButtonPad(contextButtonPad);
    IFigure feedbackLayer = rootEditPart.getLayer(LayerConstants.HANDLE_LAYER);
    feedbackLayer.add(contextButtonPad);
  }
View Full Code Here

        this.diagramPresentation = new DiagramPagePresentation(this.part, this.configManager, viewer.getControl().getShell());
        this.diagramModel = new DiagramModel(this.diagramPresentation);   
           
    viewer.setEditPartFactory(new SapphireDiagramEditorEditPartFactory(getConfigurationManager()));
   
    viewer.setRootEditPart(new ScalableFreeformRootEditPart()
    {
      @Override
      protected GridLayer createGridLayer()
      {
        return new SapphireDiagramGridLayer(diagramModel);
View Full Code Here

                return null;
            }

            GraphicalViewer graphicalViewer = (GraphicalViewer) diagramEditor.getAdapter( GraphicalViewer.class );

            ScalableFreeformRootEditPart rootEditPart
                = (ScalableFreeformRootEditPart) graphicalViewer.getRootEditPart();

            IFigure figure = rootEditPart.getLayer( LayerConstants.PRINTABLE_LAYERS );

            Rectangle rectangle = figure.getBounds();

            Image image = new Image( diagramPresentation.display(), rectangle.width, rectangle.height );
View Full Code Here

    RiderDesignEditor editor = Activator.getDiagramEditor();
    if (editor != null) {
      GraphicalViewer graphicalViewer = editor.getGraphicalViewer();
      if (graphicalViewer != null
          && graphicalViewer.getEditPartRegistry() != null) {
        ScalableFreeformRootEditPart rootEditPart = (ScalableFreeformRootEditPart) graphicalViewer.getEditPartRegistry().get(LayerManager.ID);
        IFigure gridFigure = ((LayerManager) rootEditPart).getLayer(LayerConstants.GRID_LAYER);
        gridFigure.setVisible(visible);
        editor.getDiagramBehavior().refreshContent();
      }
    }
View Full Code Here

  /**
   * Creates the graphical Thumbnail viewer.
   */
  protected void createThumbnailViewer() {
    LightweightSystem lws = new LightweightSystem(_overview);
    ScalableFreeformRootEditPart rootEditPart = (ScalableFreeformRootEditPart) _graphicalViewer
        .getRootEditPart();
    _thumbnail = new FixedScrollableThumbnail(
        (Viewport) rootEditPart.getFigure());
    _thumbnail.setBorder(new MarginBorder(3));
    _thumbnail.setSource(rootEditPart
        .getLayer(LayerConstants.PRINTABLE_LAYERS));
    lws.setContents(_thumbnail);
  }
View Full Code Here

  protected void doExecute() {
    if (designEditor != null) {
      GraphicalViewer graphicalViewer = designEditor.getGraphicalViewer();
      if (graphicalViewer != null
          && graphicalViewer.getEditPartRegistry() != null) {
        ScalableFreeformRootEditPart rootEditPart = (ScalableFreeformRootEditPart) graphicalViewer.getEditPartRegistry().get(LayerManager.ID);
        IFigure gridFigure = ((LayerManager) rootEditPart).getLayer(LayerConstants.GRID_LAYER);
        IColorConstant cc = StyleUtil.getColorConstant(PreferenceManager.getInstance().loadPreferenceAsString(PreferencesConstants.EDITOR_GRID_COLOR));
        Diagram diagram = designEditor.getDiagram();
        if (cc != null && diagram != null) {
          GraphicsAlgorithm ga = diagram.getGraphicsAlgorithm();
View Full Code Here

  int style = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().getStyle();
  Shell shell = new Shell((style & SWT.MIRRORED) != 0 ? SWT.RIGHT_TO_LEFT : SWT.NONE);
  GraphicalViewer viewer = new ScrollingGraphicalViewer();
  viewer.createControl(shell);
  viewer.setEditDomain(new DefaultEditDomain(null));
  viewer.setRootEditPart(new ScalableFreeformRootEditPart());
  viewer.setEditPartFactory(new GraphicalPartFactory());
  viewer.setContents(getContents());
  viewer.flush();
 
  int printMode = new PrintModeDialog(shell).open();
View Full Code Here

TOP

Related Classes of org.eclipse.gef.editparts.ScalableFreeformRootEditPart

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.