Examples of LayoutRelationship


Examples of org.eclipse.zest.layouts.LayoutRelationship

    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

Examples of org.eclipse.zest.layouts.LayoutRelationship

      List internalRelsList = new ArrayList(Arrays.asList(relationships));

      // remove relationships
      if (relationshipsToRemove.size() > 0) {
        for (Iterator iter = relationshipsToRemove.iterator(); iter.hasNext();) {
          LayoutRelationship relation = (LayoutRelationship) iter.next();
          if (relation.getLayoutInformation() != null) {
            internalRelsList.remove(relation.getLayoutInformation());
          }
        }
      }

      // Also remove from _internalRelationships
      ArrayList updatedRelationships = new ArrayList(internalRelationships.length - relationshipsToRemove.size() + relationshipsToAdd.size());
      for (int i = 0; i < internalRelationships.length; i++) {
        InternalRelationship relation = internalRelationships[i];
        if (relationshipsToRemove.contains(relation.getLayoutRelationship())) {
          relationshipsToRemove.remove(relation.getLayoutRelationship());
        } else {
          updatedRelationships.add(relation);
        }
      }
      relationshipsToRemove.clear();
View Full Code Here

Examples of org.eclipse.zest.layouts.LayoutRelationship

  /**
   * Clear out all old bend points before doing a layout
   */
  private void clearBendPoints(LayoutRelationship[] relationships) {
    for (int i = 0; i < relationships.length; i++) {
      LayoutRelationship rel = relationships[i];
      rel.clearBendPoints();
    }
  }
View Full Code Here

Examples of org.eclipse.zest.layouts.LayoutRelationship

   * @return List of internal relationships
   */
  private InternalRelationship[] createInternalRelationships(LayoutRelationship[] rels) {
    ArrayList listOfInternalRelationships = new ArrayList(rels.length);
    for (int i = 0; i < rels.length; i++) {
      LayoutRelationship relation = rels[i];
      InternalNode src = (InternalNode) relation.getSourceInLayout().getLayoutInformation();
      InternalNode dest = (InternalNode) relation.getDestinationInLayout().getLayoutInformation();
      if ((src != null) && (dest != null)) {
        InternalRelationship internalRelationship = new InternalRelationship(relation, src, dest);
        listOfInternalRelationships.add(internalRelationship);
      } else {
        throw new RuntimeException("Error creating internal relationship, one of the nodes is null: src=" + src + ", dest=" + dest);
View Full Code Here

Examples of org.eclipse.zest.layouts.LayoutRelationship

   * Allows other classes in this package to use this method to verify the input
   */
  public static boolean verifyInput(LayoutEntity[] entitiesToLayout, LayoutRelationship[] relationshipsToConsider) {
    boolean stillValid = true;
    for (int i = 0; i < relationshipsToConsider.length; i++) {
      LayoutRelationship relationship = relationshipsToConsider[i];
      LayoutEntity source = relationship.getSourceInLayout();
      LayoutEntity destination = relationship.getDestinationInLayout();
      boolean containsSrc = false;
      boolean containsDest = false;
      int j = 0;
      while (j < entitiesToLayout.length && !(containsSrc && containsDest)) {
        if (entitiesToLayout[j].equals(source)) {
View Full Code Here

Examples of org.eclipse.zest.layouts.LayoutRelationship

    Hashtable endPoints = new Hashtable();

    // Initialize the relation(transitive) vector.
        for (int i = 0; i < relationships.length; i++) {
            LayoutRelationship rel = relationships[i];

      //Add the relationship to the source endpoint
      Object subject = rel.getSourceInLayout();
      List rels = (List) endPoints.get(subject);
      if (rels == null) {
        rels = new ArrayList();
        endPoints.put(subject, rels);
      }
View Full Code Here

Examples of org.eclipse.zest.layouts.LayoutRelationship

    }
    return null;
  }

  protected LayoutRelationship createLayoutRelation(final Flow flow) {
    return new LayoutRelationship() {

      /*
       * (non-Javadoc)
       *
       * @see
 
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.