ini.trakem2.display
Class Bucket

java.lang.Object
  extended by ini.trakem2.display.Bucket

public class Bucket
extends java.lang.Object

A Bucket is a subarea of the Layer area, which contains either other Buckets or a map of stack_index vs. Displayable instances. VERY IMPORTANT: either children is null, or map is null, but both cannot be null at the same time neither not null at the same time.


Field Summary
static int MIN_BUCKET_SIZE
           
 
Constructor Summary
Bucket(int x, int y, int w, int h, int bucket_side)
           
 
Method Summary
 void debug()
           
static int getBucketSide(Bucketable container, Layer la)
           
 boolean isBetter(java.awt.Rectangle r, Bucketable container)
          Determine whether the rectangle is smaller than the layer dimensions padded in by one bucket_side -- if not, makes little sense to use buckets, and it's better to do linear search without the TreeMap overhead.
 void paint(java.awt.Graphics2D g, java.awt.Rectangle srcRect, double mag, java.awt.Color color)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MIN_BUCKET_SIZE

public static final int MIN_BUCKET_SIZE
See Also:
Constant Field Values
Constructor Detail

Bucket

public Bucket(int x,
              int y,
              int w,
              int h,
              int bucket_side)
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

paint

public void paint(java.awt.Graphics2D g,
                  java.awt.Rectangle srcRect,
                  double mag,
                  java.awt.Color color)

isBetter

public final boolean isBetter(java.awt.Rectangle r,
                              Bucketable container)
Determine whether the rectangle is smaller than the layer dimensions padded in by one bucket_side -- if not, makes little sense to use buckets, and it's better to do linear search without the TreeMap overhead.


debug

public void debug()

getBucketSide

public static int getBucketSide(Bucketable container,
                                Layer la)