com.miginfocom.beans
Class ActivityGridLayoutBean

java.lang.Object
  extended by com.miginfocom.beans.AbstractBean
      extended by com.miginfocom.beans.ActivityGridLayoutBean
All Implemented Interfaces:
DateAreaConnection, GridLayoutProvider, java.io.Serializable

public final class ActivityGridLayoutBean
extends AbstractBean
implements GridLayoutProvider, DateAreaConnection

A bean that calculate size in the secondary dimension of a date area depending on how many overlapping activites there are in that date area. A normal layout to have in a top "whole day activities" date area.

Note that it is necessary to connect the DefaultDateArea using setConnectedDateArea(com.miginfocom.calendar.datearea.DefaultDateArea).

Note! This layout does not work when there are sub rows, such as when the date area are divided into filtered rows for categories.

Since:
6.5
See Also:
Serialized Form

Constructor Summary
ActivityGridLayoutBean()
          Constructor.
 
Method Summary
 GridDimensionLayout createLayout(Grid grid, int dimIx)
          Returns the layout that this bean represents.
 int getActivitySize()
          The size of all but the first activity.
 int getActivitySizeFirst()
          The size of the first activity in pixels.
 DefaultDateArea getConnectedDateArea()
          Returns the conneced date area or null if none.
 int getMaximumRowSize()
          This will be reported as the maximum size of the rows, no matter how many activities are overlapping.
 int getMinimumRowSize()
          This will be reported as the minimum size of the rows, no matter how many activities are overlapping.
 boolean getPerRowMaximumSize()
          If the rows should be sized individually.
 boolean getPerRowMinimumSize()
          If the rows should be sized individually.
 boolean getPerRowPreferredSize()
          If the rows should be sized individually.
 java.lang.Integer getRoundActivityTo()
          When counting how many activities that are overlapping they can first be rounded to a date boundary.
 int getRowPadding()
          The row padding that will always be added to the size, no matter how many overlapping activities there are.
 void setActivitySize(int pixels)
          The size of all but the first activity.
 void setActivitySizeFirst(int pixels)
          The size of the first activity in pixels.
 void setConnectedDateArea(DefaultDateArea dateArea)
          Sets the connected date area.
 void setMaximumRowSize(int pixels)
          This will be reported as the maximum size of the rows, no matter how many activities are overlapping.
 void setMinimumRowSize(int pixels)
          This will be reported as the minimum size of the rows, no matter how many activities are overlapping.
 void setPerRowMaximumSize(boolean b)
          If the rows should be sized individually.
 void setPerRowMinimumSize(boolean b)
          If the rows should be sized individually.
 void setPerRowPreferredSize(boolean b)
          If the rows should be sized individually.
 void setRoundActivityTo(java.lang.Integer rangeType)
          When counting how many activities that are overlapping they can first be rounded to a date boundary.
 void setRowPadding(int pixels)
          The row padding that will always be added to the size, no matter how many overlapping activities there are.
 
Methods inherited from class com.miginfocom.beans.AbstractBean
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChangeEvent, removePropertyChangeListener, setIgnorePropertyChangeEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActivityGridLayoutBean

public ActivityGridLayoutBean()
Constructor.

Method Detail

createLayout

public GridDimensionLayout createLayout(Grid grid,
                                        int dimIx)
Returns the layout that this bean represents.

Specified by:
createLayout in interface GridLayoutProvider
Parameters:
grid - The grid used to get information.
dimIx - The dimension. Either Grid.PRIMARY_DIMENSION or Grid.SECONDARY_DIMENSION
Returns:
The layout that this bean represents.

getConnectedDateArea

public DefaultDateArea getConnectedDateArea()
Description copied from interface: DateAreaConnection
Returns the conneced date area or null if none.

The date area is kept in a WeakReference so it might also return null if there is only weak references to the date area. This is to avoid memory leaks is uncontrolled environments such as IDEs,

Specified by:
getConnectedDateArea in interface DateAreaConnection
Returns:
The date area or null.

setConnectedDateArea

public void setConnectedDateArea(DefaultDateArea dateArea)
Description copied from interface: DateAreaConnection
Sets the connected date area.

The date area is kept in a WeakReference so it might also return null if there is only weak references to the date area. This is to avoid memory leaks is uncontrolled environments such as IDEs,

Specified by:
setConnectedDateArea in interface DateAreaConnection
Parameters:
dateArea - The new date area. May be null.

getRoundActivityTo

public java.lang.Integer getRoundActivityTo()
When counting how many activities that are overlapping they can first be rounded to a date boundary. This should for instance be if one have a top day type date area set to DateRangeI.RANGE_TYPE_DAY.

Returns:
The current value. null is default.

setRoundActivityTo

public void setRoundActivityTo(java.lang.Integer rangeType)
When counting how many activities that are overlapping they can first be rounded to a date boundary. This should for instance be if one have a top day type date area set to DateRangeI.RANGE_TYPE_DAY.

Parameters:
rangeType - The new value. null is default.

getActivitySizeFirst

public int getActivitySizeFirst()
The size of the first activity in pixels.

Returns:
The current value. Default is 16.

setActivitySizeFirst

public void setActivitySizeFirst(int pixels)
The size of the first activity in pixels.

Parameters:
pixels - The new value. Default is 16.

getActivitySize

public int getActivitySize()
The size of all but the first activity. This should normally include any gaps between activities.

Returns:
The current value. Default is 16.

setActivitySize

public void setActivitySize(int pixels)
The size of all but the first activity. This should normally include any gaps between activities.

Parameters:
pixels - The new value. Default is 16.

getRowPadding

public int getRowPadding()
The row padding that will always be added to the size, no matter how many overlapping activities there are.

Returns:
The current value. Default is 0.

setRowPadding

public void setRowPadding(int pixels)
The row padding that will always be added to the size, no matter how many overlapping activities there are.

Parameters:
pixels - The new value. Default is 0.

getMinimumRowSize

public int getMinimumRowSize()
This will be reported as the minimum size of the rows, no matter how many activities are overlapping.

Returns:
The current value. Default is 0.

setMinimumRowSize

public void setMinimumRowSize(int pixels)
This will be reported as the minimum size of the rows, no matter how many activities are overlapping.

Parameters:
pixels - The new value. Default is 0.

getMaximumRowSize

public int getMaximumRowSize()
This will be reported as the maximum size of the rows, no matter how many activities are overlapping.

Returns:
The current value. Default is a very large number.

setMaximumRowSize

public void setMaximumRowSize(int pixels)
This will be reported as the maximum size of the rows, no matter how many activities are overlapping.

Parameters:
pixels - The new value. Default is a very large number.

getPerRowMinimumSize

public boolean getPerRowMinimumSize()
If the rows should be sized individually. If not, every row will get the size of the biggest one, which normally mean the one with most overlapping activities.

Returns:
The current value. Default is false.

setPerRowMinimumSize

public void setPerRowMinimumSize(boolean b)
If the rows should be sized individually. If not, every row will get the size of the biggest one, which normally mean the one with most overlapping activities.

Parameters:
b - The new value. Default is false.

getPerRowPreferredSize

public boolean getPerRowPreferredSize()
If the rows should be sized individually. If not, every row will get the size of the biggest one, which normally mean the one with most overlapping activities.

Returns:
The current value. Default is false.

setPerRowPreferredSize

public void setPerRowPreferredSize(boolean b)
If the rows should be sized individually. If not, every row will get the size of the biggest one, which normally mean the one with most overlapping activities.

Parameters:
b - The new value. Default is false.

getPerRowMaximumSize

public boolean getPerRowMaximumSize()
If the rows should be sized individually. If not, every row will get the size of the biggest one, which normally mean the one with most overlapping activities.

Returns:
The current value. Default is false.

setPerRowMaximumSize

public void setPerRowMaximumSize(boolean b)
If the rows should be sized individually. If not, every row will get the size of the biggest one, which normally mean the one with most overlapping activities.

Parameters:
b - The new value. Default is false.


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.