Example #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();
    }
  }
Example #2
0
 public void writeObject(MixedDataOutput outs) throws java.io.IOException {
   super.writeObject(outs); // BufForDrawable.writeObject( outs );
   if (childnode != null) {
     outs.writeInt(childnode.shadowbufs.size());
     Iterator belowbufs = childnode.shadowbufs.iterator();
     while (belowbufs.hasNext()) ((BufForShadows) belowbufs.next()).writeObject(outs);
     // Mark the ShadowBufs in the children node has been saved
     childnode.haveShadowBufsBeenSaved = true;
   } else // childnode == null
   outs.writeInt(0);
 }
Example #3
0
  public void empty() {
    if (childnode != null && childnode.haveShadowBufsBeenSaved) {
      Iterator belowbufs = childnode.shadowbufs.iterator();
      while (belowbufs.hasNext()) ((BufForShadows) belowbufs.next()).empty();
      // renewShadowBufs() for others to use
      childnode.shadowbufs.clear();
      childnode.haveShadowBufsBeenSaved = false;
    }

    // try to clear() on BufForDrawables.buf4drawables
    super.empty();
  }
Example #4
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);
   }
 }
Example #5
0
 public void setTreeNodeID(final TreeNodeID new_ID) {
   super.setTreeNodeID(new_ID);
   ensureNonNullShadowBuf();
   shadowbuf.setTreeNodeID(new_ID);
 }
Example #6
0
 public void setFileBlockPtr(long in_fptr, int in_size) {
   super.setFileBlockPtr(in_fptr, in_size);
   ensureNonNullShadowBuf();
   shadowbuf.setFileBlockPtr(in_fptr, in_size);
 }
Example #7
0
 // TreeNode.setEarliestTime() is invoked
 // right after TreeNode.empty()
 public void setEarliestTime(double in_time) {
   super.setEarliestTime(in_time);
   ensureNonNullShadowBuf();
   shadowbuf.setEarliestTime(in_time);
 }