T
- Key typepublic class RectangleArranger<T> extends Object
Modifier and Type | Field and Description |
---|---|
private gnu.trove.list.array.TDoubleArrayList |
heights
Column heights
|
private static Logging |
LOG
Logging class
|
private Map<T,double[]> |
map
Data
|
private double |
ratio
Target height/width ratio
|
private double |
theight
Height
|
private double |
twidth
Width
|
private ArrayList<ArrayList<Object>> |
usage
Map indicating which cells are used.
|
private gnu.trove.list.array.TDoubleArrayList |
widths
Column widths
|
Constructor and Description |
---|
RectangleArranger(double ratio)
Constructor.
|
RectangleArranger(double width,
double height)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
private boolean |
assertConsistent() |
protected double |
computeIncreaseArea(double winc,
double hinc) |
Set<Map.Entry<T,double[]>> |
entrySet()
The items contained in the map.
|
double[] |
get(T object)
Get the position data of the object
|
double |
getHeight()
Get the total canvas height
|
double |
getWidth()
Get the total canvas width
|
Set<T> |
keySet()
The item keys contained in the map.
|
protected void |
logSizes()
Debug logging
|
static void |
main(String[] args)
Test method.
|
void |
put(double w,
double h,
T data)
Add a new recangle.
|
double |
relativeFill()
Compute the relative fill.
|
private void |
resize(double inc) |
protected void |
splitCol(int bestex,
double bestwi) |
protected void |
splitRow(int bestey,
double besthi) |
private static final Logging LOG
private double ratio
private double twidth
private double theight
private gnu.trove.list.array.TDoubleArrayList widths
private gnu.trove.list.array.TDoubleArrayList heights
public RectangleArranger(double ratio)
ratio
- public RectangleArranger(double width, double height)
width
- Canvas widthheight
- Canvas heightpublic void put(double w, double h, T data)
w
- Widthh
- Heightdata
- Data object to add (key)protected double computeIncreaseArea(double winc, double hinc)
protected void splitRow(int bestey, double besthi)
protected void splitCol(int bestex, double bestwi)
private void resize(double inc)
public double[] get(T object)
object
- Query objectprivate boolean assertConsistent()
protected void logSizes()
public double relativeFill()
public double getWidth()
public double getHeight()
public Set<Map.Entry<T,double[]>> entrySet()
public static void main(String[] args)
args
-