|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.miginfocom.calendar.activity.view.AbstractActivityView
public abstract class AbstractActivityView
Implements some basic functionality from the ActivityView
interface.
Mainly Category
, DateRange
, AShape
and
Interactor
s handling. This view is also connected to a JComponent
.
Constructor Summary | |
---|---|
protected |
AbstractActivityView(javax.swing.JComponent container,
Activity model,
InteractionListener iListener)
Contructor |
protected |
AbstractActivityView(javax.swing.JComponent container,
Activity model,
InteractionListener iListener,
ImmutableDateRange viewRange)
Contructor |
Method Summary | |
---|---|
void |
addCategoryID(java.lang.Object catID,
int index)
Adds a category to the category list. |
int |
compareTo(java.lang.Object o)
If they overlaps, the longest is first. |
boolean |
containsProperty(PropertyKey property)
Return if the provider contains the property. |
void |
dispose()
Disposes of any resourses the view has tied. |
java.lang.Object[] |
getCategoryIDs()
Returns the categories that this object is linked to. |
javax.swing.JComponent |
getContainer()
Returns the container component. |
MutableDateRange |
getDateRangeClone()
Returns the date range that the object spans as a clone which is safe to change without chaning the original time span. |
DateRangeI |
getDateRangeForReading()
Returns the date range that the object spans. |
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.lang.Object |
getPaintObject()
Returns the object that this view will be painted with. |
java.lang.Object |
getProperty(PropertyKey property)
Returns the property for a name. |
ImmutableDateRange |
getViewDateRange()
Returns the date range that this view should represent. |
MutableDateRange |
getWritableDateRange()
Returns the contained date range for editing. |
void |
invalidate()
Removes all cached paint optimizations for this view so that they will be recreated next paint run. |
boolean |
isCategory(java.lang.Object id)
Returns if id is one of the id:s that this categorizable has. |
void |
removeCategoryID(java.lang.Object catID)
Removes a category from the category list. |
void |
setCategoryIDs(java.lang.Object[] catIDs)
Sets the IDs of the categories that this activity should belong to or an empty array if none. |
void |
setInteractionListener(InteractionListener iListener)
Sets the interaction listener. |
void |
setInteractors(Interactor[] interactors)
Sets the interactors for this view. |
void |
setPaintObject(java.lang.Object object)
Sets the object that will be used to paint this view. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.miginfocom.calendar.activity.view.ActivityView |
---|
getBounds, getBoundsUnion, getPaddedBoundsUnion, getPadding, repaint, setBounds, setPadding |
Constructor Detail |
---|
protected AbstractActivityView(javax.swing.JComponent container, Activity model, InteractionListener iListener)
container
- The component to show this view. Will be kept in a WeakReference
model
- The Activity
to create a view foriListener
- Optional listener to InteractionEvent
sprotected AbstractActivityView(javax.swing.JComponent container, Activity model, InteractionListener iListener, ImmutableDateRange viewRange)
container
- The component to show this view. Will be kept in a WeakReference
model
- The Activity
to create a view foriListener
- Optional listener to InteractionEvent
sviewRange
- The view date range. Only should be non-null if the view is representing a different date range than the model. This usually only happens
if the model is recurrent and the view represents one of the recurrencies.Method Detail |
---|
public void dispose()
ActivityView
dispose
in interface ActivityView
public void invalidate()
ActivityView
invalidate
in interface ActivityView
public ImmutableDateRange getViewDateRange()
ActivityView
Activity
that this view represents isn't
recurrent this date range is the Activity
's own base date range.
getViewDateRange
in interface ActivityView
MutableDateRange
object to avoid unnecessary
copying. Don't change this object other than temporary.public Activity getModel()
ActivityView
Activity
getModel
in interface ActivityView
Activity
. Never null
.public MutableDateRange getDateRangeClone()
TimeSpan
TimeSpan.getDateRangeForReading()
instead to avoid unnecessary object cloning.
getDateRangeClone
in interface TimeSpan
public DateRangeI getDateRangeForReading()
TimeSpan
DateRangeI.getImmutable()
on the returned range. The contract is to not change the returned date range.
getDateRangeForReading
in interface TimeSpan
public MutableDateRange getWritableDateRange()
TimeSpan
UnsupportedOperationException
should be thrown.
getWritableDateRange
in interface TimeSpan
public javax.swing.JComponent getContainer()
ActivityView
getContainer
in interface ActivityView
null
at any time since it's kept in a WeakReference
.public java.lang.Object getProperty(PropertyKey property)
PropertyProvider
getProperty
in interface PropertyProvider
property
- The property key for the property to return. Not null
.
null
.public boolean containsProperty(PropertyKey property)
PropertyProvider
containsProperty
in interface PropertyProvider
property
- The property key. Not null
.
public InteractionListener getInteractionListener()
ActivityView
null
.
getInteractionListener
in interface ActivityView
null
.InteractionListener
public void setInteractionListener(InteractionListener iListener)
ActivityView
setInteractionListener
in interface ActivityView
iListener
- The interaction listener or null
.InteractionListener
public void setInteractors(Interactor[] interactors)
ActivityView
setInteractors
in interface ActivityView
interactors
- The interactors for this view or null
if there aren't any.public Interactor[] getInteractors()
ActivityView
getInteractors
in interface ActivityView
null
if there aren't any.public void setPaintObject(java.lang.Object object)
ActivityView
setPaintObject
in interface ActivityView
object
- The object. Can be null
.public java.lang.Object getPaintObject()
ActivityView
getPaintObject
in interface ActivityView
null
.public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
o
- The other Activity
to compare to
public java.lang.Object[] getCategoryIDs()
Categorizable
getCategoryIDs
in interface Categorizable
null
and with length 0.public void setCategoryIDs(java.lang.Object[] catIDs)
Categorizable
null
.
setCategoryIDs
in interface Categorizable
catIDs
- The IDs of the categories that this activity should belong to or an empty array if none. May be null
and with length 0.public boolean isCategory(java.lang.Object id)
Categorizable
id
is one of the id:s that this categorizable has.
isCategory
in interface Categorizable
id
- The id to check.
id
is one of the id:s that this categorizable has.public void addCategoryID(java.lang.Object catID, int index)
Categorizable
catID
already exists for this object, nothing is changed.
addCategoryID
in interface Categorizable
catID
- The ID of the categories that this activity should also belong to. Not null
.index
- The index at which to add the category id. It might be important since category IDs earlier in the array will sometimes
hide latter ones, such as for category overrides.
index
is lenient in the upper range. It is legal to set a very high value (e.g. MigUtil.BIG_INT
to be sure it will be added last. 0 will add it first. It should not be negative though.
public void removeCategoryID(java.lang.Object catID)
Categorizable
catID
don't exist for this object, nothing is changed.
Will normally remake a new array every time. I.e. optimized for retrieval of the categories, not removal.
removeCategoryID
in interface Categorizable
catID
- The ID of the categories that this activity should no longer belong to. Not null
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |