Package org.eclipse.gef

Examples of org.eclipse.gef.RootEditPart


  @Override
  public void run() {
    LayoutProgressListenerUIJobProxy job = new LayoutProgressListenerUIJobProxy("Computing layout", this.algorithm) {
      @Override
      public void run(ProgressListener ProgressListener) {
        RootEditPart adapter = (RootEditPart) getWorkbenchPart().getAdapter(EditPart.class);
        if (adapter != null && adapter.getContents() != null) {
          LayoutGraph model = (LayoutGraph) adapter.getContents().getModel();
          doLayout(model, this.algorithm);
        }
      }

    };
View Full Code Here


        return super.getAdapter(adapter);
    }

    public OutlineViewer getOutlineViewer() {
        if (outlineViewer == null && getGraphicalViewer() != null) {
            RootEditPart rootEditPart = getGraphicalViewer().getRootEditPart();
            if (rootEditPart instanceof ScalableFreeformRootEditPart) {
                outlineViewer = new OutlineViewer(this);
            }
        }
        return outlineViewer;
View Full Code Here

    protected void initializeOutlineViewer() {
      setContents(getMusicDiagram());
    }

    protected void initializeOverview() {
      RootEditPart rep = getGraphicalViewer().getRootEditPart();
      if (rep instanceof ScalableFreeformRootEditPart) {
        getEditorFigureCanvas().addDisposeListener(disposeListener);
      }
    }
View Full Code Here

  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);
View Full Code Here

    private SapphireDiagramOutline getDiagramOutline()
  {
    if (this.diagramOutline == null && getGraphicalViewer() != null)
    {
      RootEditPart rootEditPart = getGraphicalViewer().getRootEditPart();
      if (rootEditPart instanceof ScalableFreeformRootEditPart)
      {
        this.diagramOutline = new SapphireDiagramOutline((ScalableFreeformRootEditPart)rootEditPart);
      }
    }
View Full Code Here

    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();
View Full Code Here

      part.setModel(model);
      Widget widget = null;
      if (context != null) {
        EditPartViewer viewer = context.getViewer();
        if (viewer == null) {
          RootEditPart root = context.getRoot();
          if (root != null) {
            viewer = root.getViewer();
          }
        }
        if (viewer != null) {
          widget = viewer.getControl();
        }
View Full Code Here

   * Finds the given node by walking the edit part tree looking for the correct one
   */
  @SuppressWarnings("unchecked")
  public static EditPart findEditPart(AbstractNode node, EditPart part) {
    if (part instanceof RootEditPart) {
      RootEditPart root = (RootEditPart) part;
      EditPart contents = root.getContents();
      if (contents != null) {
        return findEditPart(node, contents);
      }
    }
    if (part instanceof EditPart) {
View Full Code Here

    } else if (type == ZoomManager.class) {
      GraphicalViewer graphicalViewer = getGraphicalViewer();
      if (graphicalViewer == null)
        return null;
     
      RootEditPart root = graphicalViewer.getRootEditPart();
      if (root instanceof ScalableRootEditPartAnimated) {
        ScalableRootEditPartAnimated scalableRoot = (ScalableRootEditPartAnimated) root;
        return scalableRoot.getZoomManager();
      } else if (root instanceof ScalableRootEditPart) {
        return ((ScalableRootEditPart) root).getZoomManager();
View Full Code Here

    setContents(getLogicDiagram());
  }
 
  protected void initializeOverview() {
    LightweightSystem lws = new LightweightSystem(overview);
    RootEditPart rep = getGraphicalViewer().getRootEditPart();
    if (rep instanceof ScalableFreeformRootEditPart) {
      ScalableFreeformRootEditPart root = (ScalableFreeformRootEditPart)rep;
      thumbnail = new ScrollableThumbnail((Viewport)root.getFigure());
      thumbnail.setBorder(new MarginBorder(3));
      thumbnail.setSource(root.getLayer(LayerConstants.PRINTABLE_LAYERS));
View Full Code Here

TOP

Related Classes of org.eclipse.gef.RootEditPart

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.