T
- Key typepublic class RectangleArranger<T> extends Object
Modifier and Type | Field and Description |
---|---|
private ArrayList<Double> |
heights
Column heights
|
private static Logging |
logger
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
Bit sets to store usage.
|
private ArrayList<Double> |
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
|
void |
logSizes() |
static void |
main(String[] args)
Test method.
|
void |
put(double w,
double h,
T data)
Add a new recangle.
|
private void |
resize(double inc) |
protected void |
splitCol(int bestex,
double bestwi) |
protected void |
splitRow(int bestey,
double besthi) |
private static final Logging logger
private double ratio
private double twidth
private double theight
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()
public void logSizes()
public double getWidth()
public double getHeight()
public Set<Map.Entry<T,double[]>> entrySet()
public static void main(String[] args)
args
-