Examples of LayoutEntity


Examples of org.eclipse.zest.layouts.LayoutEntity

      public int compare(Object arg0, Object arg1) {
        // TODO Auto-generated method stub
        List a0 = (List) arg0;
        List a1 = (List) arg1;
        LayoutEntity node0 = ((InternalNode)a0.get(0)).getLayoutEntity();
        LayoutEntity node1 = ((InternalNode)a1.get(0)).getLayoutEntity();
        return (int) (node0.getYInLayout() - (node1.getYInLayout()));
      }
     
    });

    Iterator iterator = row.iterator();
View Full Code Here

Examples of org.eclipse.zest.layouts.LayoutEntity

   * @param maxChildren Max number of children for each node in the tree
   * @param randomNumChildren Whether or not to pick random number of levels (from 1 to maxLevels) and
   * random number of children (from 1 to maxChildren)
   */
  private void createTreeGraph(int minChildren, int maxChildren, int minLevels, int maxLevels, boolean randomNumChildren, boolean randomLevels, boolean addNonTreeRels) {
    LayoutEntity currentParent = createSimpleNode(getNextID());
    entities.add(currentParent);
    createTreeGraphRecursive(currentParent, minChildren, maxChildren, minLevels, maxLevels, 1, randomNumChildren, randomLevels, addNonTreeRels);
  }
View Full Code Here

Examples of org.eclipse.zest.layouts.LayoutEntity

        }
      }
    }
    int numChildren = randomNumChildren ? Math.max(minChildren, (int) (Math.random() * maxChildren + 1)) : maxChildren;
    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);
View Full Code Here

Examples of org.eclipse.zest.layouts.LayoutEntity

    if ((entitiesToRemove.size() > 0) || (entitiesToAdd.size() > 0)) {
      List internalNodesList = new ArrayList(Arrays.asList(entities));

      // remove nodes
      for (Iterator iter = entitiesToRemove.iterator(); iter.hasNext();) {
        LayoutEntity entity = (LayoutEntity) iter.next();
        if (entity.getLayoutInformation() != null) {
          internalNodesList.remove(entity.getLayoutInformation());
        }
      }

      // Also remove from _internalNodes
      ArrayList updatedEntities = new ArrayList(internalNodes.length - entitiesToRemove.size() + entitiesToAdd.size());
View Full Code Here

Examples of org.eclipse.zest.layouts.LayoutEntity

  private InternalNode[] createInternalNodes(LayoutEntity[] nodes) {
    InternalNode[] internalNodes = new InternalNode[nodes.length];
    BasicEntityConstraint basicEntityConstraint = new BasicEntityConstraint();
    for (int i = 0; i < nodes.length; i++) {
      basicEntityConstraint.clear();
      LayoutEntity externalNode = nodes[i];
      InternalNode internalNode = new InternalNode(externalNode);
      externalNode.populateLayoutConstraint(basicEntityConstraint);
      internalNode.setInternalLocation(externalNode.getXInLayout(), externalNode.getYInLayout());
      internalNodes[i] = internalNode;
    } // end of for
    return internalNodes;
  }
View Full Code Here

Examples of org.eclipse.zest.layouts.LayoutEntity

   */
  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.LayoutEntity

    Set<Flow> flows = new HashSet<Flow>();
    entities = new LayoutEntity[nodes.size()];
    int idx = 0;
    for (AbstractNode node : nodes) {
      LayoutEntity entity = createLayoutEntity(node);
      map.put(node, entity);
      entities[idx++] = entity;
      flows.addAll(node.getAllConnections());
    }
    relations = new LayoutRelationship[flows.size()];
View Full Code Here

Examples of org.eclipse.zest.layouts.LayoutEntity

      public int compare(Object arg0, Object arg1) {
        // TODO Auto-generated method stub
        List a0 = (List) arg0;
        List a1 = (List) arg1;
        LayoutEntity node0 = ((InternalNode) a0.get(0)).getLayoutEntity();
        LayoutEntity node1 = ((InternalNode) a1.get(0)).getLayoutEntity();
        return (int) (node0.getYInLayout() - (node1.getYInLayout()));
      }

    });

    Iterator iterator = row.iterator();
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.