Examples of InternalNode


Examples of org.eclipse.zest.layouts.dataStructures.InternalNode

    }

    int totalLeafCount = 0;
    double maxWeight = 0;
    for (int i = 0; i < roots.size(); i++) {
      InternalNode rootEntity = (InternalNode) roots.get(i);
            int rootEntityIndex = indexOfInternalNode(entities, rootEntity);
      totalLeafCount = totalLeafCount + getNumberOfLeaves(rootEntity, rootEntityIndex, entities);
      maxWeight = Math.max(maxWeight, getMaxiumWeightRecursive(rootEntity, rootEntityIndex, new HashSet(), entities) + 1.0);
    }
   
    double width = 1.0 / totalLeafCount;
    double height = 1.0 / maxWeight;

    int leafCountSoFar = 0;
   
    //TODO: SLOW!
    for (int i = 0; i < roots.size(); i++) {
      InternalNode rootEntity = (InternalNode) roots.get(i);
            int rootEntityIndex = indexOfInternalNode(entities, rootEntity);
      computePositionRecursively(rootEntity, rootEntityIndex, leafCountSoFar, width, height, new HashSet(), entities);
      leafCountSoFar = leafCountSoFar + getNumberOfLeaves(rootEntity, rootEntityIndex, entities);
    }
  }
View Full Code Here

Examples of org.eclipse.zest.layouts.dataStructures.InternalNode

    int relativeCount = 0;
    List children = childrenLists[i];
    //TODO: Slow
        for (Iterator iter = children.iterator(); iter.hasNext();) {
            InternalNode childEntity = (InternalNode) iter.next();
            int childEntityIndex = indexOfInternalNode(entities, childEntity);
      computePositionRecursively(childEntity, childEntityIndex, relativePosition + relativeCount, width, height, seenAlready, entities);
      relativeCount = relativeCount + getNumberOfLeaves(childEntity, childEntityIndex, entities);
    }
  }
View Full Code Here

Examples of org.eclipse.zest.layouts.dataStructures.InternalNode

        if (children.size() == 0) {
            numLeaves = 1;
        } else {
      //TODO: SLOW!
            for (Iterator iter = children.iterator(); iter.hasNext();) {
                InternalNode childEntity = (InternalNode) iter.next();
              if (!seen.contains(childEntity)) {
                seen.add (childEntity);
                    int childEntityIndex = indexOfInternalNode(entities, childEntity);
                numLeaves += getNumberOfLeavesRecursive(childEntity, childEntityIndex, seen, entities);
              } else {
View Full Code Here

Examples of org.eclipse.zest.layouts.dataStructures.InternalNode

        }
        seen.add(layoutEntity);
    List parents = parentLists[i];
    int maxParentLevel = 0;
    for (Iterator iter = parents.iterator(); iter.hasNext();) {
      InternalNode parentEntity = (InternalNode) iter.next();
            int parentEntityIndex = indexOfInternalNode(entities, parentEntity);
            int parentLevel = getLevelRecursive(parentEntity, parentEntityIndex, seen, entities) + 1;
            maxParentLevel = Math.max(maxParentLevel, parentLevel);
    }
        return maxParentLevel;
View Full Code Here

Examples of org.eclipse.zest.layouts.dataStructures.InternalNode

     * @param nodeToFind
     * @return
     */
    private int indexOfInternalNode (InternalNode [] nodes, InternalNode nodeToFind) {
        for (int i = 0; i < nodes.length; i++) {
            InternalNode node = nodes[i];
            if (node.equals(nodeToFind)) {
                return i;
            }
        }
        throw new RuntimeException("Couldn't find index of internal node: " + nodeToFind);
    }
View Full Code Here

Examples of org.eclipse.zest.layouts.dataStructures.InternalNode

  protected void computeRadialPositions (InternalNode[] entities, DisplayIndependentRectangle bounds2) { //TODO TODO TODO
    DisplayIndependentRectangle bounds = new DisplayIndependentRectangle(getLayoutBounds(entities, true));
    bounds.height = bounds2.height;
    bounds.y = bounds2.y;
        for (int i = 0; i < entities.length; i++) {
            InternalNode entity = entities[i];
      double percentTheta = (entity.getInternalX() - bounds.x) / bounds.width;
      double distance = (entity.getInternalY() - bounds.y) / bounds.height;
      double theta = startDegree + Math.abs(endDegree - startDegree) * percentTheta;
      double newX = distance * Math.cos (theta);
      double newY = distance * Math.sin (theta);
     
      entity.setInternalLocation( newX, newY );
    }
  }
View Full Code Here

Examples of org.elasticsearch.node.internal.InternalNode

import org.elasticsearch.node.internal.InternalNode;

public class GenericStatsLeak {

    public static void main(String[] args) {
        InternalNode node = (InternalNode) NodeBuilder.nodeBuilder().settings(ImmutableSettings.settingsBuilder()
                .put("monitor.os.refresh_interval", 0)
                .put("monitor.process.refresh_interval", 0)
                .put("monitor.network.refresh_interval", 0)
        ).node();

        JvmService jvmService = node.injector().getInstance(JvmService.class);
        OsService osService = node.injector().getInstance(OsService.class);
        ProcessService processService = node.injector().getInstance(ProcessService.class);
        NetworkService networkService = node.injector().getInstance(NetworkService.class);

        while (true) {
            jvmService.stats();
            osService.stats();
            processService.stats();
View Full Code Here

Examples of org.jboss.cache.InternalNode

   // TODO: What is this rubbish?!??
   private void integrateRetainedNode(Fqn ancFqn, Fqn descFqn)
   {
      prepareContextOptions();
      InternalNode ancestor = cache.getNode(ancFqn).getDelegationTarget();
      Object name = descFqn.get(ancFqn.size());
      InternalNode child = ancestor.getChild(name);
      if (ancFqn.size() == descFqn.size() + 1)
      {
         if (child == null)
         {
            prepareContextOptions();
            InternalNode descendant = cache.getNode(descFqn).getDelegationTarget();
            prepareContextOptions();
            ancestor.addChild(name, descendant);
         }
         else
         {
View Full Code Here

Examples of org.jboss.cache.InternalNode

            wrapNodeForWriting(context, fqn.getParent(), true, true, includeInvalidNodes, false, force);
         }
      } else {
         // else, fetch from dataContainer.
         InternalNode[] nodes = dataContainer.peekInternalNodeAndDirectParent(fqn, includeInvalidNodes);
         InternalNode in = nodes[0];
         if (in != null) {
            // exists in cache!  Just acquire lock if needed, and wrap.
            // do we need a lock?
            boolean needToCopy = false;
            if (lockForWriting && acquireLock(context, fqn)) {
View Full Code Here

Examples of org.jboss.cache.InternalNode

    * @param ctx    invocation context
    * @return true if parent lock is needed, false otherwise.
    */
   private boolean isParentLockNeeded(Fqn parent, InvocationContext ctx) {
      ReadCommittedNode parentNodeTmp = (ReadCommittedNode) ctx.lookUpNode(parent);
      InternalNode in = parentNodeTmp == null ? dataContainer.peekInternalNode(parent, true) : parentNodeTmp.getDelegationTarget();
      return isParentLockNeeded(in);
   }
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.