com.miginfocom.calendar.activity.view
Class ActivityViewInteractionBroker

java.lang.Object
  extended by com.miginfocom.ashape.interaction.AbstractInteractionBroker
      extended by com.miginfocom.calendar.activity.view.ActivityViewInteractionBroker
All Implemented Interfaces:
InteractionBroker

public class ActivityViewInteractionBroker
extends AbstractInteractionBroker

An interaction broker to interact with an ActivityView.

Contains commands that can are targeted at manipulating and affecting a specific ActivityView object.


Field Summary
protected  ActivityView activityView
          The activity view to interact with.
static PropertyKey CMD_ADD_CATEGORY_ID
          A command used for adding the Activity to a category; first in the list of category id:s.
static PropertyKey CMD_INSTALL_INTERACTION
          Installs the interaction by calling ActivityView.getModel().addInteraction(...) with the value.
static PropertyKey CMD_REMOVE_CATEGORY_ID
          A command used for removing the Activity from a category.
static PropertyKey CMD_REMOVE_PROPERTY
          A command used for removing a property on the Activity.
static PropertyKey CMD_SET_PROPERTY
          A command used for setting a property on the Activity.
static PropertyKey CMD_SET_STATE
          A command used for setting a state on the Activity.
static PropertyKey CMD_TOGGLE_CATEGORY_ID
          A command used for toggle the Activity on/off from a category.
 
Constructor Summary
ActivityViewInteractionBroker(ActivityView activityView)
          Constructor
 
Method Summary
 ActivityView getActivityView()
          Returns the activity view sent into the constructor.
 boolean handleCommand(Interactor interactor, Command cmd, java.awt.event.InputEvent e)
          Handels one command.
 
Methods inherited from class com.miginfocom.ashape.interaction.AbstractInteractionBroker
handleCommands
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CMD_SET_STATE

public static final PropertyKey CMD_SET_STATE
A command used for setting a state on the Activity.

name is the state to set, e.g. States.MOUSE_OVER and value is the Boolean/String value to set.

See Also:
States, MigUtil.isTrue(Object)

CMD_SET_PROPERTY

public static final PropertyKey CMD_SET_PROPERTY
A command used for setting a property on the Activity.

Note that if the property set was vetoed that is silently ignored and the property will not be set.

name is the property name and value is the value to set


CMD_REMOVE_PROPERTY

public static final PropertyKey CMD_REMOVE_PROPERTY
A command used for removing a property on the Activity.

name is the property name.


CMD_ADD_CATEGORY_ID

public static final PropertyKey CMD_ADD_CATEGORY_ID
A command used for adding the Activity to a category; first in the list of category id:s.

value is the category ID to add. target an integer (as a string) that denotes the index place to insert. Lenient in upper bounds, so a too high value will be added last and not throw an index bounds exception. null or "" is same a 0.


CMD_REMOVE_CATEGORY_ID

public static final PropertyKey CMD_REMOVE_CATEGORY_ID
A command used for removing the Activity from a category.

value is the category ID to remove.


CMD_TOGGLE_CATEGORY_ID

public static final PropertyKey CMD_TOGGLE_CATEGORY_ID
A command used for toggle the Activity on/off from a category.

value is the category ID to remove. target an integer (as a string) that denotes the index place to insert. Lenient in upper bounds, so a too high value will be added last and not throw an index bounds exception. null or "" is same a 0.


CMD_INSTALL_INTERACTION

public static final PropertyKey CMD_INSTALL_INTERACTION
Installs the interaction by calling ActivityView.getModel().addInteraction(...) with the value.

value is the Interaction to add/install.


activityView

protected final ActivityView activityView
The activity view to interact with. For instance setting/getting/removing properties to/from. Not null.

Constructor Detail

ActivityViewInteractionBroker

public ActivityViewInteractionBroker(ActivityView activityView)
Constructor

Parameters:
activityView - The activity view to interact with. For instance setting/getting/removing properties to/from. Not null.
Method Detail

handleCommand

public boolean handleCommand(Interactor interactor,
                             Command cmd,
                             java.awt.event.InputEvent e)
Description copied from class: AbstractInteractionBroker
Handels one command.

Specified by:
handleCommand in class AbstractInteractionBroker
Parameters:
interactor - The interactor the the interaction originated from
cmd - The command that is to be executed
e - The event that started the interaction, if any.
Returns:
IF the command was handled.

getActivityView

public ActivityView getActivityView()
Returns the activity view sent into the constructor.

Returns:
The activity view sent into the constructor. Never null.


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.