Examples of InternalNode


Examples of com.bazaarvoice.jless.ast.node.InternalNode

@Test
public class NodeTest {

    public void testChildIterators() {
        InternalNode p = new PlaceholderNode();
        p.addChild(new SimpleNode("c1"));
        p.addChild(new SimpleNode("c2"));
        p.addChild(new SimpleNode("c3"));
        p.addChild(new SimpleNode("c4"));

        RandomAccessListIterator i1 = p.pushChildIterator();
        i1.next();
        RandomAccessListIterator i2 = p.pushChildIterator();
        i2.next();
        i2.next();
        RandomAccessListIterator i3 = p.pushChildIterator();
        i3.next();
        i3.next();
        i3.next();

        Assert.assertEquals(i1.nextIndex(), 1);
        Assert.assertEquals(i2.nextIndex(), 2);
        Assert.assertEquals(i3.nextIndex(), 3);
       
        p.addChild(2, new SimpleNode("c2a"));

        Assert.assertEquals(i1.nextIndex(), 1);
        Assert.assertEquals(i2.nextIndex(), 3);
        Assert.assertEquals(i3.nextIndex(), 4);
    }
View Full Code Here

Examples of edu.isi.karma.rep.alignment.InternalNode

      } else {
        nodeId = nodeUri + "1 (add)";
      }


      InternalNode node = new InternalNode(nodeId, nodeLabel);
      nodeSet.add(node);


      // Populate the graph nodes also
      if (alignment != null) {
View Full Code Here

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

        double minX = Double.MAX_VALUE;
        double maxX = Double.MIN_VALUE;
        double minY = Double.MAX_VALUE;
        double maxY = Double.MIN_VALUE;
        for (int i = 0; i < entitiesToLayout.length; i++) {
            InternalNode layoutEntity = entitiesToLayout[i];
            minX = Math.min(minX, layoutEntity.getInternalX());
            minY = Math.min(minY, layoutEntity.getInternalY());
            maxX = Math.max(maxX, layoutEntity.getInternalX());
            maxY = Math.max(maxY, layoutEntity.getInternalY());
        }

        double spanX = maxX - minX;
        double spanY = maxY - minY;
        double maxSpan = Math.max(spanX, spanY);

        if (maxSpan > EPSILON) {
            for (int i = 0; i < entitiesToLayout.length; i++) {
                InternalNode layoutEntity = entitiesToLayout[i];
                double x = (layoutEntity.getInternalX() - minX) / spanX;
                double y = (layoutEntity.getInternalY() - minY) / spanY;
                tempLocationsX[i] = x;
                tempLocationsY[i] = y;
            }
        } else {
            placeRandomly(entitiesToLayout);
View Full Code Here

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

      int i = 0;
      int width = (int) ((boundsWidth / 2) - currentRow.size() * 75);
     
      heightSoFar += ((InternalNode)currentRow.get(0)).getLayoutEntity().getHeightInLayout() + VSPACING*8 ;
      while(iterator2.hasNext()) {
        InternalNode currentNode = (InternalNode) iterator2.next();
       
        double location = width + 10*++i;
        currentNode.setLocation(location , heightSoFar);
        width += currentNode.getLayoutEntity().getWidthInLayout();
      }
    }
  }
View Full Code Here

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

  private void addToRowList( InternalNode node, ArrayList list) {
    double  layoutY = node.getLayoutEntity().getYInLayout();
   
    for ( int i = 0; i < list.size(); i++ ) {
      List currentRow = (List) list.get(i);
      InternalNode currentRowNode = (InternalNode) currentRow.get(0);
      double currentRowY = currentRowNode.getLayoutEntity().getYInLayout();
      //double currentRowHeight = currentRowNode.getLayoutEntity().getHeightInLayout();
      if ( layoutY >= (currentRowY-DELTA) && layoutY <= currentRowY + DELTA ) {
        currentRow.add(node);
        //list.add(i, currentRow);
        return;
View Full Code Here

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

      for( int j = 0; j < cols; j++ ) {
        if( (i*cols + j) < numChildren ) {
          // find new position for child
          double xmove = boundsX + j * colWidth + offsetX;
          double ymove = boundsY + i * rowHeight + offsetY;
          InternalNode sn = entitiesToLayout[index++];
          sn.setInternalLocation( xmove, ymove );
          sn.setInternalSize( Math.max(w, MIN_ENTITY_SIZE), Math.max(h, MIN_ENTITY_SIZE) );
        }
      }
      fireProgressEvent (2 + i, totalProgress);
   
    updateLayoutLocations(entitiesToLayout);
View Full Code Here

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

        // weight between them
        srcDestToNumRels = new int[entitiesToLayout.length][entitiesToLayout.length];
        srcDestToRelsAvgWeight = new double[entitiesToLayout.length][entitiesToLayout.length];

        for (int i = 0; i < entitiesToLayout.length - 1; i++) {
            InternalNode layoutEntity1 = entitiesToLayout[i];
            for (int j = i + 1; j < entitiesToLayout.length; j++) {
                InternalNode layoutEntity2 = entitiesToLayout[j];
                srcDestToNumRels[i][j] = numRelations(layoutEntity1, layoutEntity2);
                srcDestToNumRels[i][j] += numRelations(layoutEntity2, layoutEntity1);
                srcDestToRelsAvgWeight[i][j] = avgWeight(layoutEntity1, layoutEntity2);
            }
        }
View Full Code Here

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

        double borderWidth = Math.min(realBounds.width, realBounds.height) / 10.0;
        DisplayIndependentRectangle screenBounds = new DisplayIndependentRectangle(realBounds.x + borderWidth / 2.0, realBounds.y + borderWidth / 2.0, realBounds.width - borderWidth, realBounds.height - borderWidth);

        DisplayIndependentRectangle layoutBounds = getLayoutBoundsTemp(entitiesToLayout, false);
        for (int i = 0; i < entitiesToLayout.length; i++) {
            InternalNode layoutEntity = entitiesToLayout[i];
            if (layoutEntity.hasPreferredLocation()) {
                convertNodePositionsBack(i, layoutEntity, layoutEntity.getPreferredX(), layoutEntity.getPreferredY(), screenBounds.width, screenBounds.height, layoutBounds);
            }
        }
    }
View Full Code Here

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

        computeForces(entitiesToLayout);
        largestMovement = Double.MAX_VALUE;
        computePositions(entitiesToLayout);
       
        for (int i = 0; i < entitiesToLayout.length; i++) {
            InternalNode layoutEntity = entitiesToLayout[i];
            layoutEntity.setInternalLocation(tempLocationsX[i], tempLocationsY[i]);
        }       
       
        defaultFitWithinBounds(entitiesToLayout, bounds);

        iteration++;
View Full Code Here

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

        }

        // TODO: Again really really slow!

        for (int i = 0; i < entitiesToLayout.length - 1; i++) {
            InternalNode sourceEntity = entitiesToLayout[i];
           
            double srcLocationX = tempLocationsX[i];
            double srcLocationY = tempLocationsY[i];
            double fx = forcesX[i]; // force in x direction
            double fy = forcesY[i]; // force in y direction
           

            for (int j = i + 1; j < entitiesToLayout.length; j++) {
                InternalNode destinationEntity = entitiesToLayout[j];

                if (!destinationEntity.equals(sourceEntity)) {
                    double destLocationX = tempLocationsX[j];
                    double destLocationY = tempLocationsY[j];
                    double dx = srcLocationX - destLocationX;
                    double dy = srcLocationY- destLocationY;
                    double distance = Math.sqrt(dx * dx + dy * dy);
 
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.