T
- Key typepublic class RectangleArranger<T>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private DoubleArray |
heights
Column heights
|
private static Logging |
LOG
Logging class
|
private java.util.Map<T,double[]> |
map
Data
|
private double |
ratio
Target height/width ratio
|
private double |
theight
Height
|
private double |
twidth
Width
|
private java.util.ArrayList<java.util.ArrayList<java.lang.Object>> |
usage
Map indicating which cells are used.
|
private DoubleArray |
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) |
java.util.Set<java.util.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
|
java.util.Set<T> |
keySet()
The item keys contained in the map.
|
protected void |
logSizes()
Debug logging
|
static void |
main(java.lang.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 DoubleArray widths
private DoubleArray heights
private java.util.ArrayList<java.util.ArrayList<java.lang.Object>> usage
private java.util.Map<T,double[]> map
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 java.util.Set<java.util.Map.Entry<T,double[]>> entrySet()
public java.util.Set<T> keySet()
public static void main(java.lang.String[] args)
args
- Copyright © 2019 ELKI Development Team. License information.