|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.cmu.sun.folds.LayoutCreator
public class LayoutCreator
Creates new Layouts from a set of constraints.
When a folded scroll window needs to be shown, it must decide
where to place the folds. This class takes a height constraint,
and creates a layout that shows as many items as possible. The layout
represents where the folds and lists will be positioned.
This class helps with Fulid Negotiation between other lists.
For more information on this concept, see:
A Negotiation Architecture for Fluid Documents
Bay-Wei Chang, Jock D. Mackinlay, Polle T. Zellweger, Takeo Igarashi
Xeroc PARC
Layout, LayoutComponent| Field Summary | |
|---|---|
(package private) ListModel |
listModel
The underlying List model (From the WindowModel) that this object will create Layouts for. |
static int |
MAX_ITEMS_IN_LIST
the maximum number of items that any Layout may have. |
(package private) float |
maxHeight
The maximum height of the final Layout that this object will create. |
static int |
MIN_ITEMS_IN_LIST
The minimum number of items that any layout may have. |
(package private) WindowModel |
winModel
The window model that this object will do layout for. |
| Constructor Summary | |
|---|---|
LayoutCreator(WindowModel winModel)
Create a new LayoutCreator for the WindowModel |
|
| Method Summary | |
|---|---|
private Layout |
calculateLayout(int numPrimaryItems)
Returns a valid layout for the model if the primary view is showing the item with the primary index and has the provided number of items in it. |
private Layout |
calculateLayout(int minPrimaryItems,
int maxPrimaryItems)
This function will try to find the layout that has the most number of items in it's primary list, without exceeding the maxSize restriction. |
Layout |
generateLayout()
Create a new layout for the window's ListModel that has a height no greater than the maxHeigt set for this LayoutCreator. |
float |
getMinHeight()
The Minimum possible height that the window's ListModel could be displayed in. |
float |
getPerferedHeight()
The prefered height of the window's ListModel. |
private IndexRange |
primaryRange(int numItems)
Returns an index range to match the window's model. |
void |
setMaxHeight(float maxHeight)
Set the maximum height allowed in generated layouts. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int MAX_ITEMS_IN_LIST
public static final int MIN_ITEMS_IN_LIST
WindowModel winModel
ListModel listModel
float maxHeight
| Constructor Detail |
|---|
public LayoutCreator(WindowModel winModel)
winModel - the underlying WindowModel (and thus ListModel) for all Layouts| Method Detail |
|---|
public float getMinHeight()
public float getPerferedHeight()
public void setMaxHeight(float maxHeight)
maxHeight - maximum height in meterspublic Layout generateLayout()
private Layout calculateLayout(int minPrimaryItems,
int maxPrimaryItems)
private Layout calculateLayout(int numPrimaryItems)
private IndexRange primaryRange(int numItems)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||