com.miginfocom.calendar.activity.view
Interface ActivityView

All Superinterfaces:
Categorizable, java.lang.Comparable, PropertyProvider, TimeSpan
All Known Implementing Classes:
AbstractActivityView, DefaultActivityView

public interface ActivityView
extends TimeSpan, java.lang.Comparable, Categorizable, PropertyProvider

A view of an activity. If an Activity is painted in more that one container (JComponent), there are a view for every container, but only one Activity.
If the Activity is recurrent, there also is a view for every recurrence within some viewable date-range. In this (recurrency) scenario this view holds the date range that should be represented, otherwise the Activity's date range is referenced from the view.


Method Summary
 void dispose()
          Disposes of any resourses the view has tied.
 java.awt.Rectangle[] getBounds()
          Return all bounds the this view currently occupy.
 java.awt.Rectangle getBoundsUnion()
          Returns the union of all bounds for this view
 javax.swing.JComponent getContainer()
          Returns the container component.
 InteractionListener getInteractionListener()
          Returns the interaction listener or null.
 Interactor[] getInteractors()
          Returns the interactors for this view.
 Activity getModel()
          Returns the 'model', which is the Activity
 java.awt.Rectangle getPaddedBoundsUnion()
          Returnes the union of all bounds for this view with padding added
 java.awt.Insets getPadding()
          Returns the external padding (e.g.
 java.lang.Object getPaintObject()
          Returns the object that this view will be painted with.
 ImmutableDateRange getViewDateRange()
          Returns the date range that this view should represent.
 void invalidate()
          Removes all cached paint optimizations for this view so that they will be recreated next paint run.
 void repaint()
          Repaints ths view in the context it's in, if it can.
 void setBounds(java.awt.Rectangle[] b)
          Sets all bounds for this view.
 void setInteractionListener(InteractionListener iListener)
          Sets the interaction listener.
 void setInteractors(Interactor[] interactors)
          Sets the interactors for this view.
 void setPadding(java.awt.Insets i)
          Sets the padding for this view.
 void setPaintObject(java.lang.Object object)
          Sets the object that will be used to paint this view.
 
Methods inherited from interface com.miginfocom.util.dates.TimeSpan
getDateRangeClone, getDateRangeForReading, getWritableDateRange
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface com.miginfocom.calendar.category.Categorizable
addCategoryID, getCategoryIDs, isCategory, removeCategoryID, setCategoryIDs
 
Methods inherited from interface com.miginfocom.util.PropertyProvider
containsProperty, getProperty
 

Method Detail

dispose

void dispose()
Disposes of any resourses the view has tied. The view can not be used after this.


invalidate

void invalidate()
Removes all cached paint optimizations for this view so that they will be recreated next paint run.


getViewDateRange

ImmutableDateRange getViewDateRange()
Returns the date range that this view should represent. If the Activity that this view represents isn't recurrent this date range is the Activity's own base date range.

Returns:
The date range that this view should represent. Returns the live MutableDateRange object to avoid unnecessary copying. Don't change this object other than temporary.

getModel

Activity getModel()
Returns the 'model', which is the Activity

Returns:
The 'model', which is the Activity. Never null.

getPaddedBoundsUnion

java.awt.Rectangle getPaddedBoundsUnion()
Returnes the union of all bounds for this view with padding added

Returns:
null if not laid out yet or bounds set to null.

getPadding

java.awt.Insets getPadding()
Returns the external padding (e.g. shadow). Will never be null. Default is (1, 1, 1, 1) to accomodate for anti aliasing.

Returns:
The external padding for this view. Returns the live object to avoid unnecessary copying. MUST NOT BE CHANGED since it can be shared.

setPadding

void setPadding(java.awt.Insets i)
Sets the padding for this view. This class never changes the object so it is encurraged to use a shared Insets object if possible which will reduce memory footprint when there are many views.
This padding is used to know the region to repaint.
Returns fast if same as already set.
Doesn't call repaint, that has do be done manually from the caller.

Parameters:
i - The padding, can be null.

setBounds

void setBounds(java.awt.Rectangle[] b)
Sets all bounds for this view.

Parameters:
b - null hides the view. Object will be overtaken. null elements should be ignored internally in the class and will be returned by getBounds().

getBounds

java.awt.Rectangle[] getBounds()
Return all bounds the this view currently occupy.

Returns:
null if not laid out yet or bounds set to null. Elements may be null!!.

getBoundsUnion

java.awt.Rectangle getBoundsUnion()
Returns the union of all bounds for this view

Returns:
null if not laid out yet or bounds set to null.

repaint

void repaint()
Repaints ths view in the context it's in, if it can.


getContainer

javax.swing.JComponent getContainer()
Returns the container component.

Returns:
The container component. Migtht be null at any time since it's kept in a WeakReference.

getInteractionListener

InteractionListener getInteractionListener()
Returns the interaction listener or null.

Returns:
The interaction listener or null.
See Also:
InteractionListener

setInteractionListener

void setInteractionListener(InteractionListener iListener)
Sets the interaction listener.

Parameters:
iListener - The interaction listener or null.
See Also:
InteractionListener

setInteractors

void setInteractors(Interactor[] interactors)
Sets the interactors for this view. Not used internally.

Parameters:
interactors - The interactors for this view or null if there aren't any.

getInteractors

Interactor[] getInteractors()
Returns the interactors for this view. Don't clone, returns live array.

Returns:
The interactors for this view or null if there aren't any.

setPaintObject

void setPaintObject(java.lang.Object object)
Sets the object that will be used to paint this view. The type can be anything that the controller decide it should be. Not used internally.

Parameters:
object - The object. Can be null.

getPaintObject

java.lang.Object getPaintObject()
Returns the object that this view will be painted with.

Returns:
The object that this view will be painted with. Can be null.


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.