Class IPlanExpandHandler

  extended by ix.ip2.ItemHandler
      extended by ix.ip2.ActivityHandler
          extended by ix.ip2.ExpandHandler
              extended by ix.iplan.IPlanExpandHandler
All Implemented Interfaces:
DomainListener, java.util.EventListener

public class IPlanExpandHandler
extends ExpandHandler

Adds expansion actions to activities based on refinements in the agent's domain.

Nested Class Summary
Nested classes/interfaces inherited from class ix.ip2.ExpandHandler
Field Summary
protected  IPlan iplan
Fields inherited from class ix.ip2.ExpandHandler
actAgenda, ip2, modelManager
Fields inherited from class ix.ip2.ItemHandler
Constructor Summary
IPlanExpandHandler(IPlan iplan)
Method Summary
 void addHandlerActions(AgendaItem item)
          Called to add any HandlerActions that this handler regards as appropriate for the specified AgendaItem.
 HandlerAction makeManualExpandAction(AgendaItem item, Refinement r)
 void refinementAdded(RefinementEvent event)
 void reviseHandlerActions(AgendaItem item, java.lang.Object reason)
          Called after something has happened that may require new HandlerActions to be added to an item.
Methods inherited from class ix.ip2.ExpandHandler
appliesTo, makeExpandAction, matchRefinement
Methods inherited from class ix.ip2.ActivityHandler
Methods inherited from class ix.ip2.ItemHandler
getActionDescription, getSyntaxList, handle, isAutomatic, makeHandler
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail


protected IPlan iplan
Constructor Detail


public IPlanExpandHandler(IPlan iplan)
Method Detail


public void addHandlerActions(AgendaItem item)
Description copied from class: ItemHandler
Called to add any HandlerActions that this handler regards as appropriate for the specified AgendaItem.

This method is called only if both this handler's ItemHandler.appliesTo(AgendaItem) and the specified item's AgendaItem.wantsActionsFrom(ItemHandler) methods return true.

The method provided by the ItemHandler class just adds an action that calls this handler's ItemHandler.handle(AgendaItem) method. This allows suitably simple handlers to avoid working directly with HandlerActions.

Note that actions are added by calling an item's AgendaItem.addAction(HandlerAction) method.

addHandlerActions in class ExpandHandler


public void refinementAdded(RefinementEvent event)
Specified by:
refinementAdded in interface DomainListener
refinementAdded in class ExpandHandler


public void reviseHandlerActions(AgendaItem item,
                                 java.lang.Object reason)
Description copied from class: ItemHandler
Called after something has happened that may require new HandlerActions to be added to an item. Typically, this method is called as a consequnce of an ItemHandler -- usually this ItemHandler -- calling the controller's reconsiderHandler method. In other words, the usual case is when an ItemHandler causes its own reviseHandlerActions method to be called; and consequencetly the handler may be able to agree with itself (so to speak) about what various "reason" objects mean.

The reviseHandlerActions method is very similar to the ItemHandler.addHandlerActions(AgendaItem) method in terms of its function and the applicability conditions on when it is called. The main difference is that it is called to look at AgendaItems that are not having actions added for the first time and that may already have an appropriate action, so that no new one needs to be added.

Note that the usual way for an ItemHandler to get HandlerActions removed is for it to call the controller's checkActionValidity method. That results in calls to HandlerAction.isStillValid() methods.

reviseHandlerActions in class ExpandHandler
See Also:
PanelController.reconsiderHandler(ItemHandler handler, Object reason), PanelController.checkActionValidity(ItemHandler handler, Object reason)


public HandlerAction makeManualExpandAction(AgendaItem item,
                                            Refinement r)
makeManualExpandAction in class ExpandHandler