Package org.eclipse.zest.layouts.exampleStructures

Examples of org.eclipse.zest.layouts.exampleStructures.SimpleRelationship


    SimpleNode currentParent = createSimpleNode(getNextID());
    entities.add(currentParent);

    // ccallendar - adding relationships from the parent to the 2 roots
    SimpleRelationship rel = new SimpleRelationship(root, currentParent, false);
    root.addRelationship(rel);
    currentParent.addRelationship(rel);
    relationships.add(rel);
    rel = new SimpleRelationship(root2, currentParent, false);
    root2.addRelationship(rel);
    currentParent.addRelationship(rel);
    relationships.add(rel);
    // end
View Full Code Here


    int numChildren = random ? (int) (Math.random() * maxChildren + 1) : maxChildren;
    for (int child = 0; child < numChildren; child++) {
      SimpleNode childNode = createSimpleNode(getNextID());
      entities.add(childNode);
      SimpleRelationship rel = new SimpleRelationship(currentParentNode, childNode, false);
      childNode.addRelationship(rel);
      currentParentNode.addRelationship(rel);
      relationships.add(rel);
      SimpleRelationship.setDefaultSize(2);
      createTreeGraphRecursive(childNode, maxChildren, maxLevel, level + 1, random);
View Full Code Here

      GC gcBuffer = new GC(imageBuffer);

      // paint the relationships
      for (Iterator iter = relationships.iterator(); iter.hasNext();) {
        SimpleRelationship rel = (SimpleRelationship) iter.next();
        SimpleNode src = (SimpleNode) rel.getSourceInLayout();
        SimpleNode dest = (SimpleNode) rel.getDestinationInLayout();

        // highlight the adjacent nodes if one of the nodes is selected
        if (src.equals(selectedEntity)) {
          dest.setAdjacent();
          rel.setSelected();
        } else if (dest.equals(selectedEntity)) {
          src.setAdjacent();
          rel.setSelected();
        } else {
          rel.setUnSelected();
        }

        // Add bend points if required
        if ((rel).getBendPoints() != null && (rel).getBendPoints().length > 0) {
          src = drawBendPoints(rel, gcBuffer); // change source to last bendpoint
View Full Code Here

    for (int i = 0; i < numChildren; i++) {
      LayoutEntity newNode = createSimpleNode(getNextID());
      entities.add(newNode);
      if (addNonTreeRels && entities.size() % 5 == 0) {
        int index = (int) (Math.random() * entities.size());
        LayoutRelationship rel = new SimpleRelationship((LayoutEntity) entities.get(index), newNode, false);
        relationships.add(rel);
      }
      LayoutRelationship rel = new SimpleRelationship(currentParentNode, newNode, false);
      relationships.add(rel);
      createTreeGraphRecursive(newNode, minChildren, maxChildren, minLevel, maxLevel, level + 1, randomNumChildren, randomLevels, addNonTreeRels);
    }
  }
View Full Code Here

    nodesChecked.add(nodeToCheck);

    List relations = (List) endPoints.get(nodeToCheck);
    if (relations != null) {
      for (Iterator iter = relations.iterator(); iter.hasNext();) {
        SimpleRelationship rel = (SimpleRelationship) iter.next();

        if (cameFrom == null || !rel.equals(cameFrom)) {
          Object currentNode = null;
          currentNode = rel.getDestinationInLayout();
          if (hasCycle(currentNode, nodePathSoFar, rel, endPoints, nodesChecked, cycle)) {
            return true;
          }
        }
View Full Code Here

TOP

Related Classes of org.eclipse.zest.layouts.exampleStructures.SimpleRelationship

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.