Ejemplo n.º 1
0
 private void addToHistory(BucketStringRenderer.Slot slot)
 {
     this.m_history.Add(slot);
     if (this.m_history.Count != this.m_historyCount)
     {
         return;
     }
     this.retireSlot(this.m_history[0]);
     this.m_history.RemoveAt(0);
 }
Ejemplo n.º 2
0
 private void retireSlot(BucketStringRenderer.Slot slot)
 {
     if (slot.m_bucket == null)
     {
         slot = (BucketStringRenderer.Slot)null;
     }
     else
     {
         slot.m_used = false;
     }
 }
Ejemplo n.º 3
0
 private BucketStringRenderer.Slot getSlotForBucket(
     BucketStringRenderer.Bucket bucket)
 {
     for (int index = 0; index < bucket.m_slots.Count; ++index)
     {
         if (!bucket.m_slots[index].m_used)
         {
             bucket.m_slots[index].m_used = true;
             return(bucket.m_slots[index]);
         }
     }
     BucketStringRenderer.Slot slot = new BucketStringRenderer.Slot();
     slot.m_bucket = bucket;
     slot.m_used   = true;
     slot.m_image  = Image.createImage(bucket.m_width, this.m_fontHeight);
     bucket.m_slots.Add(slot);
     return(slot);
 }
Ejemplo n.º 4
0
 private BucketStringRenderer.Slot locateStringInHistory(string str)
 {
     for (int index1 = 0; index1 < this.m_history.Count; ++index1)
     {
         if (this.m_history[index1].m_string.Equals(str))
         {
             BucketStringRenderer.Slot slot = this.m_history[index1];
             if (index1 != this.m_history.Count)
             {
                 for (int index2 = index1; index2 < this.m_history.Count - index1 - 1; ++index1)
                 {
                     this.m_history[index2] = this.m_history[index2 + 1];
                 }
                 this.m_history[this.m_history.Count - 1] = slot;
             }
             return(slot);
         }
     }
     return((BucketStringRenderer.Slot)null);
 }
Ejemplo n.º 5
0
    private BucketStringRenderer.Slot getSlot(int width)
    {
        if (width < this.m_bucketMaximumWidth)
        {
            for (int index = 0; index < this.m_bucketCount; ++index)
            {
                if (this.m_buckets[index].m_width >= width)
                {
                    return(this.getSlotForBucket(this.m_buckets[index]));
                }
            }
        }
        BucketStringRenderer.Slot slot = new BucketStringRenderer.Slot();
        slot.m_bucket = (BucketStringRenderer.Bucket)null;
        slot.m_used   = true;
        int width1 = 1;

        while (width > width1)
        {
            width1 *= 2;
        }
        slot.m_image = Image.createImage(width1, this.m_fontHeight);
        return(slot);
    }