Package org.eclipse.sapphire.ui.diagram.editor

Examples of org.eclipse.sapphire.ui.diagram.editor.SapphireDiagramEditorPagePart


    }

    private void deleteNodeConnections(DiagramNodePart nodePart)
    {
      Element nodeElement = nodePart.getLocalModelElement();
      SapphireDiagramEditorPagePart diagramPart = nodePart.getDiagramNodeTemplate().getDiagramEditorPart();
      ConnectionService connService = diagramPart.service(ConnectionService.class);
      for (DiagramConnectionPart connPart : connService.list())
      {
       if (connPart.removable() &&
           ((connPart.getEndpoint1() != null && connPart.getEndpoint1() == nodeElement) ||
               connPart.getEndpoint2() != null && connPart.getEndpoint2() == nodeElement))
View Full Code Here


    }
  }
 
  public static ConnectionHashKey createKey(final DiagramConnectionPart connPart)
  {
    SapphireDiagramEditorPagePart diagramPart = connPart.nearest(SapphireDiagramEditorPagePart.class);
    String connId = connPart.getId();
    String nodeId = null;
    if (connPart instanceof StandardEmbeddedConnectionPart)
    {
      Element srcElement = connPart.getEndpoint1();
      DiagramNodePart nodePart = diagramPart.getDiagramNodePart(srcElement);
      nodeId = nodePart.getId();
    }
    ConnectionHashKey hashKey = new ConnectionHashKey(nodeId, connId);
    return hashKey;   
  }
View Full Code Here

    }
   
  @Override
  protected Object run(Presentation context)
  {
      SapphireDiagramEditorPagePart diagramPart =
          (SapphireDiagramEditorPagePart)this.nodeTemplate.parent();

    DiagramNodePart nodePart = this.nodeTemplate.createNewDiagramNode();
    Point pt = diagramPart.getMouseLocation();
    nodePart.setNodeBounds(pt.getX(), pt.getY());
   
    // Select the new node and put it in direct-edit mode
    diagramPart.selectAndDirectEdit(nodePart);
    return nodePart;
 
View Full Code Here

        refreshEnablement();
    }
   
    private void refreshEnablement()
    {
        final SapphireDiagramEditorPagePart diagramEditorPagePart = getPart().nearest( SapphireDiagramEditorPagePart.class );
        setEnabled( diagramEditorPagePart.getZoomLevel() > diagramEditorPagePart.getMinZoomLevel() );
    }
View Full Code Here

    }
   
    @Override
    protected Object run( final Presentation context )
    {
        final SapphireDiagramEditorPagePart diagramEditorPagePart = getPart().nearest( SapphireDiagramEditorPagePart.class );
        diagramEditorPagePart.setZoomLevel( diagramEditorPagePart.getZoomLevel() - 25 );

        return null;
    }
View Full Code Here

{

  @Override
  protected Object run(Presentation context)
  {   
    SapphireDiagramEditorPagePart editorPart = context.part().nearest(SapphireDiagramEditorPagePart.class);
    editorPart.selectAllNodes();
    return null;
  }
View Full Code Here

                      final ActionHandlerDef def )
    {
      super.init(action, def);
      if (action.getType() == SapphireActionType.TOGGLE)
      {
        SapphireDiagramEditorPagePart diagramPart = (SapphireDiagramEditorPagePart)this.getPart();
        setChecked(diagramPart.isGridVisible());
      }
    }
View Full Code Here

    }
       
  @Override
  protected Object run(Presentation context)
  {
    SapphireDiagramEditorPagePart diagramPart = (SapphireDiagramEditorPagePart)this.getPart();
    boolean visible = !diagramPart.isGridVisible();
    diagramPart.setGridVisible(visible);
    return null;
  }
View Full Code Here

                      final ActionHandlerDef def )
    {
        super.init( action, def );
       
        final ISapphirePart part = getPart();
        SapphireDiagramEditorPagePart editorPart = part.nearest(SapphireDiagramEditorPagePart.class);
        editorPart.attach
        (
            new FilteredListener<SelectionChangedEvent>()
            {
                @Override
                protected void handleTypedEvent( final SelectionChangedEvent event )
View Full Code Here

        final ISapphirePart part = getPart();
      ShapeFactoryPart shapeFactory = (ShapeFactoryPart)part.parent();
      Element element = part.getLocalModelElement();
      ElementList<?> list = shapeFactory.getModelElementList();
    list.moveUp(element);
    SapphireDiagramEditorPagePart editorPart = part.nearest(SapphireDiagramEditorPagePart.class);
    editorPart.setSelections(Collections.singletonList(part), true);
    refreshEnablement();
    return null;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.sapphire.ui.diagram.editor.SapphireDiagramEditorPagePart

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.