|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.miginfocom.calendar.layout.ActivityLayout
public abstract class ActivityLayout
A interface describing how an activity layout class should be implemented. Activity layouts are used to layout ActivityViews
in a DateGrid.
| Constructor Summary | |
|---|---|
ActivityLayout()
|
|
| Method Summary | |
|---|---|
abstract java.lang.String[] |
getDefaultContexts()
Return the default contexts that this layout should react to. |
java.lang.String[] |
getLayoutContexts()
Returns the live array of the current contexts to look for. |
abstract int |
getLayoutPriority(ActivityView actView)
Returns in which degree this layout accepts responsibility for laying out this ActivityView. |
protected boolean |
isInContexts(java.lang.String layoutContext)
Returns if layoutContext equals one of the registered contexts. |
abstract TimeSpanList |
layout(DateGrid dateGrid,
TimeSpanList actViewList,
java.util.ArrayList occupiedRects,
ImmutableDateRange onlyRange)
Layout the activities within the bounds. |
void |
setLayoutContexts(java.lang.String[] contexts)
Sets the context to use for this layout. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ActivityLayout()
| Method Detail |
|---|
public abstract TimeSpanList layout(DateGrid dateGrid,
TimeSpanList actViewList,
java.util.ArrayList occupiedRects,
ImmutableDateRange onlyRange)
bounds. All activities that couldn't fit for some reason should have their bounds set to null.
dateGrid - The Grid to layout the activities withinactViewList - A number of ActivityView objects to layout. Will not be "changed". The individual views should
be sorted in the preferred order to paint the activities later.occupiedRects - The areas (Rectangle2D) that currently are not free. They may or may not be within the bounds. They
also may or may not be ignored, but if they are ignored, they will possibly be painted over or paint over something else. Not null.onlyRange - The layout range that actually need to be laid out. If null all in actViewList should be laid out. This argument
is mostly for optimizing. Since the container can't know which dates translates to what pixels this optimization is up to the atcivity layout.
DateRangeIs representing time spands that couldn't be laid out due to shortage of free space. Not null and it
should be a newly created list that can be overtaken by the caller of this method.public abstract int getLayoutPriority(ActivityView actView)
ActivityView. Activity.getLayoutContext() and the duration is normally used to determine this. The installed layout with the highest
priority will get the chance to layout the actView later on. TimeBoundsLayout will always return 0 so returning a negative value will make
sure that this layout won't be called to layout that actView (that is if TimeBoundsLayout is installed in the DateArea.
Should normally be < 10.
actView - The view that is to be laid out
ActivityView.public abstract java.lang.String[] getDefaultContexts()
null.protected boolean isInContexts(java.lang.String layoutContext)
layoutContext equals one of the registered contexts.
layoutContext - The context to look for. May be null but that will NEVER equal any contexts.
layoutContext equals one of the registered contexts.public java.lang.String[] getLayoutContexts()
public void setLayoutContexts(java.lang.String[] contexts)
{"FlexGrid"}. If an activity's layoutContext equals one of these
contexts this layout will report that it is very keep (20) to layout that activity. See getLayoutPriority(com.miginfocom.calendar.activity.view.ActivityView).
contexts - The contexts to set. If null reset to defaults (getDefaultContexts()). Will be overtaken. No null elements.public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||