|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.cmu.sun.folds.LayoutComponent
public class LayoutComponent
A portion of a folded scroll interface. This Component does not do drawing, but instead simply represents the state of the component, and points to underlying models that the component will draw from and modify. A Component will typically represent only a portion of a ListModel. The exact portion of the list is determined by the range field. LayoutComponents can be either, TOP_FOLD, FOLD (middle), BOTTOM_FOLD. Additionally, folds can be of "UNSPECIFIED" type, but this shouldn't ever happen for long.
| Nested Class Summary | |
|---|---|
static class |
LayoutComponent.Type
|
| Field Summary | |
|---|---|
(package private) LayoutComponent |
matchedWithComponent
During the animation steps, components need to be matched with other components they will be transitioning into. |
(package private) ListModel |
model
The model that underlies this component. |
(package private) IndexRange |
nextRange
This field is used to animate transitions. |
(package private) Layout |
parentLayout
The layout object that contains this component. |
(package private) IndexRange |
range
The range of the ListModel that this component is to represent. |
(package private) LayoutComponent.Type |
type
The type of LayoutComponent: TOP_FOLD, FOLD, BOTTOM_FOLD, LIST, UNSPECIFIED |
| Constructor Summary | |
|---|---|
LayoutComponent(LayoutComponent comp)
Create a copy of a Layout Component. |
|
LayoutComponent(ListModel model,
IndexRange range)
Create a new LayoutComponent that is backed by a model, and represents a range. |
|
LayoutComponent(ListModel model,
IndexRange range,
LayoutComponent.Type type)
Create a new LayoutComponent that is backed by a model, and represents a range. |
|
| Method Summary | |
|---|---|
static float |
getFoldComponentHeight(int items)
This method returns the height of a fold component. |
float |
getHeight()
Gets the heigth of this component (in meters) as it would be displayed in the scenegraph. |
java.util.List<ItemModel> |
getIncludedItemModels()
Since this component only represents a portion of the items in a model, sometimes we will want to have acess to just the list Items that this component is responsible for. |
static float |
getListComponentHeight(int items)
This method returns the height of a list component. |
LayoutComponent |
getMatchedWithComponent()
The matchedWithComponent field is used during the animation process. |
ListModel |
getModel()
|
IndexRange |
getNextRange()
Returns the range that this compoennt will represent in the model after a call to updateToNextRange(). |
LayoutComponent |
getNextSibling()
|
Layout |
getParentLayout()
Returns the Layout that contains this component. |
LayoutComponent |
getPreviousSibling()
|
IndexRange |
getRange()
The range that this component represnts in the model. |
LayoutComponent.Type |
getType()
|
boolean |
isMatchedWith(LayoutComponent match)
Checks to see if this component currently matched with another |
boolean |
isMatchedWithComponent()
|
void |
setMatchedWithComponent(LayoutComponent match)
The matchedWithComponent field is used during the animation process. |
void |
setNextRange(IndexRange nextRange)
Sets the nextRange field. |
void |
setParentLayout(Layout parentLayout)
Sets the layout that contains this component. |
void |
setRange(IndexRange range)
Seths the range that this component represents in the underlying model. |
void |
setType(LayoutComponent.Type type)
Change the type of this component (For instance, to a top fold) |
java.lang.String |
toString()
Simply used for debugging. |
void |
updateToNextRange()
Changes the current range for this component to the value stored in nextRange. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
Layout parentLayout
IndexRange range
IndexRange nextRange
ListModel model
LayoutComponent.Type type
LayoutComponent matchedWithComponent
| Constructor Detail |
|---|
public LayoutComponent(ListModel model,
IndexRange range)
model - The ListModel that this component is based upon.range - The range of the list model that this component represents.
public LayoutComponent(ListModel model,
IndexRange range,
LayoutComponent.Type type)
model - The ListModel that this component is based upon.range - The range of the list model that this component represents.type - The initial Type for the component. (kind of component)public LayoutComponent(LayoutComponent comp)
comp - | Method Detail |
|---|
public IndexRange getRange()
public IndexRange getNextRange()
public void setRange(IndexRange range)
public LayoutComponent.Type getType()
public void setType(LayoutComponent.Type type)
type - public float getHeight()
public ListModel getModel()
public java.util.List<ItemModel> getIncludedItemModels()
public void updateToNextRange()
public void setNextRange(IndexRange nextRange)
nextRange - public LayoutComponent getMatchedWithComponent()
LayoutMatcherpublic void setMatchedWithComponent(LayoutComponent match)
LayoutMatcherpublic boolean isMatchedWithComponent()
LayoutMatcherpublic boolean isMatchedWith(LayoutComponent match)
match - Component to test against matched field
LayoutMatcherpublic java.lang.String toString()
toString in class java.lang.Objectpublic Layout getParentLayout()
public void setParentLayout(Layout parentLayout)
parentLayout - public LayoutComponent getPreviousSibling()
public LayoutComponent getNextSibling()
public static float getFoldComponentHeight(int items)
items - number of items the component needs to represent
public static float getListComponentHeight(int items)
items - number of items the component needs to represent
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||