com.miginfocom.calendar.datearea
Class ActivityMoveEvent

java.lang.Object
  extended by java.util.EventObject
      extended by com.miginfocom.calendar.datearea.ActivityMoveEvent
All Implemented Interfaces:
java.io.Serializable

public class ActivityMoveEvent
extends java.util.EventObject

An event that normally is used to notify of upcoming activity moves.

Code that can be used to get the target GridRow if e is a MouseEvent:
((DefaultDateArea) e.getSource()).getDateGrid().getRowAt(Grid.SECONDARY_DIMENSION, ((MouseEvent) e.getEvent()).getPoint(), 1000, true);

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
ActivityMoveEvent(java.lang.Object source, Activity activity, MutableDateRange newRange, java.awt.event.InputEvent e)
          Constructor.
 
Method Summary
 Activity getActivity()
          Returns the activity which is to be (or has been) moved.
 java.awt.event.InputEvent getEvent()
          Returns the event that started the move.
 MutableDateRange getNewRange()
          Returns the new suggested range or just set one.
 java.lang.String toString()
           
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ActivityMoveEvent

public ActivityMoveEvent(java.lang.Object source,
                         Activity activity,
                         MutableDateRange newRange,
                         java.awt.event.InputEvent e)
Constructor.

Parameters:
source - The source.
activity - The activity that is going to be moved.
newRange - The suggested new range. May be altered by the listener.
e - The possible event that started the move. Might be a KeyEvent or a MouseEvent.

Code that can be used to get the target GridRow:
((DefaultDateArea) e.getSource()).getDateGrid().getRowAt(Grid.SECONDARY_DIMENSION, ((MouseEvent) e.getEvent()).getPoint(), 1000, true);

Method Detail

getActivity

public final Activity getActivity()
Returns the activity which is to be (or has been) moved.

Returns:
The activity which is to be (or has been) moved.

getNewRange

public final MutableDateRange getNewRange()
Returns the new suggested range or just set one. If this is a pre-notify of a move this event can be changed to reflect what should actually be the target date range.

For instance e.getNewRange().setToRange(e.getActivity().getBaseDateRange()) would always reset the date range to that if the current one in the activity and the activity would be "frozen" in time and thus unmovable. The range can be set to anything to reflect custom move/resize logic.

Returns:
The new suggested range or just set one.

getEvent

public final java.awt.event.InputEvent getEvent()
Returns the event that started the move. Might be a KeyEvent or a MouseEvent.

Code that can be used to get the target GridRow:
((DefaultDateArea) e.getSource()).getDateGrid().getRowAt(Grid.SECONDARY_DIMENSION, ((MouseEvent) e.getEvent()).getPoint(), 1000, true);

Returns:
The event that started the move. Might be a KeyEvent or a MouseEvent.

toString

public java.lang.String toString()
Overrides:
toString in class java.util.EventObject


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.