Package org.eclipse.zest.core.widgets

Examples of org.eclipse.zest.core.widgets.GraphNode


    for (GraphNode node : layerLinesGraphNodeList){
      node.setVisible(false);
    }
   
    for ( int i = 0; i< totalLevelOffset.size(); i++){
      GraphNode captionNode = layerLabelGraphNodeList.get(i);
     
      captionNode.setVisible(true);
     
      int height =sublevelCount.get(i) * (longestY+yOffset)-15;
      int width = captionNode.getSize().width;
      captionNode.setSize(width, height);
     
   
      int x = 5;
      int y = totalLevelOffset.get(i)*(longestY+yOffset)+5;
      captionNode.setLocation(x, y);
      if (i>0){
        //don't draw a line at the top
      GraphNode lineNode = layerLinesGraphNodeList.get(i-1);
      lineNode.setSize((longestX+xOffset)*highestNumberOfNodes, 1);
      lineNode.setLocation(x, y-8);
      lineNode.setVisible(true);
      }
    } 
   
    repairCaptions();
  }
View Full Code Here


        Iterator nodes = viewer.getGraphControl().getNodes().iterator();
        Graph graph = viewer.getGraphControl();
        Dimension centre = new Dimension(graph.getBounds().width / 2, graph.getBounds().height / 2);
        while (nodes.hasNext()) {
            GraphNode graphNode = (GraphNode) nodes.next();
            if (graphNode.getLocation().x <= 1 && graphNode.getLocation().y <= 1) {
                graphNode.setLocation(centre.width, centre.height);
            }
        }

        currentRoot = focus;
View Full Code Here

    if (stream == null) {
      System.err.println("ERROR: " + imgpath);
    }
    Image img = new Image(d, stream);
   
    GraphNode node = new GraphNode(g.getGraphControl(), SWT.NONE, lbl, img, cur);
   
    node.setTooltip(new Label(tmp));
   
    if (cur.status == State.FORWARD) {
//      node.setText("");
//      node.setNodeStyle(ZestStyles.NODES_HIDE_TEXT);
    }
    if (cur.status == State.INVALID) {
      node.setBackgroundColor(d.getSystemColor(SWT.COLOR_RED));
      node.setHighlightColor(d.getSystemColor(SWT.COLOR_DARK_RED));
      node.setForegroundColor(d.getSystemColor(SWT.COLOR_WHITE));
    }
    else if (cur.status == State.MATCH) {
      node.setBackgroundColor(d.getSystemColor(SWT.COLOR_GREEN));
      node.setHighlightColor(d.getSystemColor(SWT.COLOR_DARK_GREEN));
    }
    else if (cur.status == State.SKIP) {
      node.setBackgroundColor(d.getSystemColor(SWT.COLOR_YELLOW));
      node.setHighlightColor(d.getSystemColor(SWT.COLOR_DARK_YELLOW));
    }
    else if (cur.status == State.PROPOSE) {
      node.setBackgroundColor(d.getSystemColor(SWT.COLOR_BLUE));
      node.setHighlightColor(d.getSystemColor(SWT.COLOR_DARK_BLUE));
      node.setForegroundColor(d.getSystemColor(SWT.COLOR_WHITE));
    }
    else {
      node.setBackgroundColor(d.getSystemColor(SWT.COLOR_GRAY));
      node.setHighlightColor(d.getSystemColor(SWT.COLOR_DARK_GRAY));
    }
   
    nodes.add(node);
   
    for (ResultNode n : cur.next) {
      GraphNode child = dbg(n, cur, g);
      new GraphConnection(g.getGraphControl(), ZestStyles.CONNECTIONS_DIRECTED, node, child);
    }
   
    return node;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.zest.core.widgets.GraphNode

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.