Exemplo n.º 1
0
  /*
     finalizeLatestTime() should be invoked BEFORE
     mergeVerticalShadowBufs() and shiftHorizontalShadowBuf() are called
  */
  public void finalizeLatestTime(final Drawable last_drawable_added) {
    if (childnode == null) // i.e. if ( super.isLeaf() )
    super.setLatestTime(last_drawable_added.getLatestTime());
    else // if ( childnode != null )
    super.setLatestTime(childnode.getLatestTime());

    if (shadowbuf != null) {
      // After setting the LatestTime, seal the shadows' category weights
      shadowbuf.setLatestTime(super.getLatestTime());
      shadowbuf.initializeMapOfCategoryWeights();
    }
  }
Exemplo n.º 2
0
 public LineIDMap getIdentityLineIDMap() {
   BufForShadows belowbuf;
   LineIDMap lineIDmap = super.getIdentityLineIDMap();
   if (childnode != null) {
     Iterator belowbufs = childnode.shadowbufs.iterator();
     while (belowbufs.hasNext()) {
       belowbuf = (BufForShadows) belowbufs.next();
       lineIDmap.putAll(belowbuf.getIdentityLineIDMap());
     }
   }
   lineIDmap.setTitle("Identity Map");
   lineIDmap.setColumnLabels(new String[] {"LineID"});
   return lineIDmap;
 }
Exemplo n.º 3
0
  public int getNodeByteSize() {
    int total_bytesize; // bytesize for the disk footprint
    BufForShadows buf;

    total_bytesize = super.getByteSize() + 4 /* childnode.shadowbufs.size() */;
    // System.err.println( "TreeNode.NodeByteSize = " + total_bytesize );
    if (childnode != null) {
      Iterator belowbufs = childnode.shadowbufs.iterator();
      while (belowbufs.hasNext()) {
        buf = (BufForShadows) belowbufs.next();
        total_bytesize += buf.getByteSize();
      }
    }
    return total_bytesize;
  }
Exemplo n.º 4
0
 /*
    shiftHorizontalShadowBuf() should be called AFTER both
    mergeVerticalShadowBufs() and finalizeLatestTime().
 */
 public void shiftHorizontalShadowBuf() {
   if (shadowbuf != null) {
     shadowbuf.finalizeMapOfCategoryWeights();
     shadowbufs.add(shadowbuf);
     shadowbuf = null;
   }
 }
Exemplo n.º 5
0
  /*
     mergeVerticalShadowBufs() should be called AFTER finalizeLatestTime()
     but BEFORE shiftHorizontalShadowBuf(), because the current shadowbuf
     needs to be updated with the childnode's shadowbufs[] before finalization
  */
  public void mergeVerticalShadowBufs() {
    BufForShadows buf;
    if (childnode != null) {
      Iterator belowbufs = childnode.shadowbufs.iterator();
      while (belowbufs.hasNext()) {
        buf = (BufForShadows) belowbufs.next();
        shadowbuf.mergeWith(buf); // shadowbuf += buf
        shadowbuf.affectTimeBounds(buf);

        /*
        System.out.println( "BufForShadows("
                          + shadowbuf.getTreeNodeID() + ") += "
                          + "BufForShadows("
                          + buf.getTreeNodeID() + ")" );
        */
      }
    }
  }
Exemplo n.º 6
0
 public void add(final Drawable dobj) {
   if (dobj instanceof Composite) {
     Composite cmplx = (Composite) dobj;
     Primitive[] primes = null;
     if (cmplx.getCategory() != null) {
       super.add(cmplx); // BufForDrawables.add(Composite)
       ensureNonNullShadowBuf();
       primes = cmplx.getPrimitives();
       for (int idx = 0; idx < primes.length; idx++) shadowbuf.add(primes[idx]);
     } else {
       ensureNonNullShadowBuf();
       primes = cmplx.getPrimitives();
       for (int idx = 0; idx < primes.length; idx++) {
         super.add(primes[idx]); // BufForDrawables.add(Primitive)
         shadowbuf.add(primes[idx]);
       }
     }
   } else { // if ( dobj instanceof Primitive )
     Primitive prime = (Primitive) dobj;
     super.add(prime); // BufForDrawables.add(Primitive)
     ensureNonNullShadowBuf();
     shadowbuf.add(prime);
   }
 }
Exemplo n.º 7
0
  //  This is only applicable to the ROOT treenode.
  public void summarizeCategories() {
    // Assume shiftHorizontalShadowBuf() has just been called,
    // so shadowbuf == null, otherwise this function needs to call
    // this.shiftHorizontalShadowBuf()
    if (shadowbuf != null) {
      throw new RuntimeException("UnexpectedError: " + "shadowbuf is NOT NULL! Aborting...");
    }

    if (shadowbufs.size() != 1) {
      throw new RuntimeException(
          "UnexpectedError: " + "shadowbufs[]'s size is " + shadowbufs.size() + "! Aborting...");
    }

    shadowbuf = (BufForShadows) shadowbufs.get(0);
    shadowbuf.summarizeCategories();
  }
Exemplo n.º 8
0
 public void setTreeNodeID(final TreeNodeID new_ID) {
   super.setTreeNodeID(new_ID);
   ensureNonNullShadowBuf();
   shadowbuf.setTreeNodeID(new_ID);
 }
Exemplo n.º 9
0
 private void ensureNonNullShadowBuf() {
   if (shadowbuf == null) {
     shadowbuf = new BufForShadows(true);
     shadowbuf.setMapOfTopologyToShadowDef(shadowdefs_map);
   }
 }
Exemplo n.º 10
0
 public void setFileBlockPtr(long in_fptr, int in_size) {
   super.setFileBlockPtr(in_fptr, in_size);
   ensureNonNullShadowBuf();
   shadowbuf.setFileBlockPtr(in_fptr, in_size);
 }
Exemplo n.º 11
0
 // TreeNode.setEarliestTime() is invoked
 // right after TreeNode.empty()
 public void setEarliestTime(double in_time) {
   super.setEarliestTime(in_time);
   ensureNonNullShadowBuf();
   shadowbuf.setEarliestTime(in_time);
 }