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

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


    moveBendpoints();
    node.getModelPart().setNodeBounds(rectangle.x, rectangle.y, rectangle.width, rectangle.height);
  }
 
  private void moveBendpoints() {
    DiagramNodeBounds bounds = node.getModelPart().getNodeBounds();
    int deltaX = this.rectangle.x - bounds.getX();
    int deltaY = this.rectangle.y - bounds.getY();
    if (deltaX != 0 || deltaY != 0) {
      SapphireDiagramEditor editor = node.getDiagramModel().getSapphireDiagramEditor();
      List<DiagramConnectionModel> srcConnections = node.getSourceConnections();
      for (GraphicalEditPart part : editor.getSelectedEditParts()) {
        if (part instanceof DiagramNodeEditPart) {
View Full Code Here


    for (Component component : components)
    {
      DiagramNodePart nodePart = context( SapphireDiagramEditorPagePart.class ).getDiagramNodePart(component);
      if (nodePart != null)
      {
        DiagramNodeBounds bounds = null;
        bounds = new DiagramNodeBounds(component.getPosition().getX().content(),
            component.getPosition().getY().content(), -1, -1,
            false, false);
        nodePart.setNodeBounds(bounds);         
       
        // load the embedded connection layout
View Full Code Here

  }
 
  private void handleNodeLayoutChange(Component component)
  {
    DiagramNodePart nodePart = context( SapphireDiagramEditorPagePart.class ).getDiagramNodePart(component);
    DiagramNodeBounds nodeBounds = new DiagramNodeBounds(component.getPosition().getX().content(),
        component.getPosition().getY().content());
    nodePart.setNodeBounds(nodeBounds);
  }
View Full Code Here

      {
        refreshDirtyState()
      }
      else if (event instanceof DiagramNodeMoveEvent)
      {
      DiagramNodeBounds nodeBounds = nodePart.getNodeBounds();
     
      if (nodeBounds.isAutoLayout())
      {
        // need to add the node bounds to the persistence cache so that "revert" could work
        addNodeToPersistenceCache(nodePart);
        refreshDirtyState();
      }
      else if (!nodeBounds.isDefaultPosition())
      {
        write((DiagramNodePart)event.part());
      }
      }
  }
View Full Code Here

    this.architecture.attach(this.componentDependencyListener, "/Components/Dependencies/ConnectionBendpoints/*");
  }
 
    private boolean isNodeLayoutChanged(DiagramNodePart nodePart)
    {
    DiagramNodeBounds newBounds = nodePart.getNodeBounds();
    boolean changed = false;
    String nodeId = (nodePart).getId();
    if (this.nodeBounds.containsKey(nodeId))
    {
      DiagramNodeBounds oldBounds = this.nodeBounds.get(nodeId);
      if (!newBounds.equals(oldBounds))
      {
        changed = true;
      }
    }
View Full Code Here

      int width = node.getWidth().content();
      int height = node.getHeight().content();
     
      if (nodePart != null)
      {
        nodePart.setNodeBounds(new DiagramNodeBounds(x, y, width, height, false, false));
      }
     
      ElementList<DiagramConnectionLayout> connList = node.getEmbeddedConnectionsLayout();
      for (DiagramConnectionLayout connLayout : connList)
      {
View Full Code Here

      for (DiagramNodePart nodePart : nodeTemplate.getDiagramNodes())
      {
        String nodeId = nodePart.getId();
        DiagramNodeLayout diagramNode = this.layoutModel.getDiagramNodesLayout().insert();
        diagramNode.setNodeId(nodeId);
        DiagramNodeBounds bounds = nodePart.getNodeBounds();
        diagramNode.setX(bounds.getX());
        diagramNode.setY(bounds.getY());
        if (nodePart.canResizeShape())
        {
          IDiagramNodeDef nodeDef = (IDiagramNodeDef)nodePart.definition();
          if (bounds.getHeight() != -1 &&
              ((nodeDef.getHeight().content() != null && nodeDef.getHeight().content() != bounds.getHeight()) ||
                  nodeDef.getHeight().content() == null))
          {
            diagramNode.setHeight(bounds.getHeight());
          }
          if (bounds.getWidth() != -1 &&
              ((nodeDef.getWidth().content() != null && nodeDef.getWidth().content() != bounds.getWidth()) ||
                  nodeDef.getWidth().content() == null))
          {
            diagramNode.setWidth(bounds.getWidth());
          }
        }
        // save the embedded connection bendpoints
        diagramNode.getEmbeddedConnectionsLayout().clear();
        if (nodePart.getDiagramNodeTemplate().getEmbeddedConnectionTemplate() != null)
View Full Code Here

      }
      else if (event instanceof DiagramNodeDeleteEvent) {
        refreshDirtyState();
      }
      else if (event instanceof DiagramNodeMoveEvent) {
      DiagramNodeBounds nodeBounds = nodePart.getNodeBounds();
      if (nodeBounds.isAutoLayout())
      {
        // need to add the node bounds to the persistence cache so that "revert" could work
        addNodeToPersistenceCache(nodePart);
        refreshDirtyState();
      }
      else if (!nodeBounds.isDefaultPosition())
      {
        write((DiagramNodePart)event.part());
      }
      }
  }
View Full Code Here

      }
  }

  private boolean isNodeLayoutChanged(DiagramNodePart nodePart)
    {
    DiagramNodeBounds newBounds = nodePart.getNodeBounds();
    boolean changed = false;
    String nodeId = nodePart.getId();
    if (this.nodeBounds.containsKey(nodeId))
    {
      DiagramNodeBounds oldBounds = this.nodeBounds.get(nodeId);
      if (!newBounds.equals(oldBounds))
      {
        changed = true;
      }
    }
View Full Code Here

TOP

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

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.