Package org.eclipse.sapphire.ui.swt.gef

Examples of org.eclipse.sapphire.ui.swt.gef.DiagramConfigurationManager


      final SapphireDiagramEditor diagramEditor, final boolean autoLayout)
  {
    // add bend points generated by the graph layout
    EdgeList myEdges = new EdgeList();
    myEdges.addAll(graph.edges);
    DiagramConfigurationManager configManager = diagramEditor.getConfigurationManager();
   
    for (Object object : myEdges)
    {
      Edge edge = (Edge)object;
      if (!(edge.data instanceof DiagramConnectionModel))
      {
        continue;
      }
      DiagramConnectionModel conn = (DiagramConnectionModel)edge.data;
      NodeList nodes = edge.vNodes;
      DiagramConnectionPart connPart = conn.getModelPart();
      ArrayList<org.eclipse.sapphire.ui.Point> connBendPoints = new ArrayList<org.eclipse.sapphire.ui.Point>();
      if (nodes != null)
      {
        //int bpIndex = 0;
        for (int i = 0; i < nodes.size(); i++)
        {
          Node vn = nodes.getNode(i);
          int x = vn.x;
          int y = vn.y;
          if (getGraphDirection() == PositionConstants.EAST)
          {
            if (edge.isFeedback())
            {
              connBendPoints.add(new org.eclipse.sapphire.ui.Point(x + vn.width, y));
              connBendPoints.add(new org.eclipse.sapphire.ui.Point(x, y));
            }
            else
            {
              connBendPoints.add(new org.eclipse.sapphire.ui.Point(x, y));
              connBendPoints.add(new org.eclipse.sapphire.ui.Point(x + vn.width, y));
            }
          }
          else
          {
            if (edge.isFeedback())
            {
              connBendPoints.add(new org.eclipse.sapphire.ui.Point(x, y + vn.height));
              connBendPoints.add(new org.eclipse.sapphire.ui.Point(x, y));
            }
            else
            {
              connBendPoints.add(new org.eclipse.sapphire.ui.Point(x, y));
              connBendPoints.add(new org.eclipse.sapphire.ui.Point(x, y + vn.height));
            }
          }
        }
      }
      else
      {
            Point bendPoint = configManager.getConnectionRouter().route(conn);
            if (bendPoint != null)
            {
              connBendPoints.add(new org.eclipse.sapphire.ui.Point(bendPoint.x, bendPoint.y));
            }       
      }
View Full Code Here

TOP

Related Classes of org.eclipse.sapphire.ui.swt.gef.DiagramConfigurationManager

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.