|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.lmu.ifi.dbs.elki.visualization.gui.overview.RectangleArranger<T>
T - Key typepublic class RectangleArranger<T>

This is a rather naive rectangle arrangement class. It will try to place rectangles on a canvas while maintaining the canvas size ratio as good as possible. It does not do an exhaustive search for optimizing the layout, but a greedy placement strategy, extending the canvas as little as possible.
| Field Summary | |
|---|---|
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 Summary | |
|---|---|
RectangleArranger(double ratio)
Constructor. |
|
RectangleArranger(double width,
double height)
Constructor. |
|
| Method Summary | |
|---|---|
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)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final Logging logger
private double ratio
private double twidth
private double theight
private ArrayList<Double> widths
private ArrayList<Double> heights
private ArrayList<ArrayList<Object>> usage
private Map<T,double[]> map
| Constructor Detail |
|---|
public RectangleArranger(double ratio)
ratio -
public RectangleArranger(double width,
double height)
width - Canvas widthheight - Canvas height| Method Detail |
|---|
public 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 object
private 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 -
|
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||