workspace
Class WorkspaceEvent

java.lang.Object
  extended by workspace.WorkspaceEvent

public class WorkspaceEvent
extends java.lang.Object


Field Summary
static int BLOCK_ADDED
           
static int BLOCK_COMMENT_ADDED
           
static int BLOCK_COMMENT_CHANGED
           
static int BLOCK_COMMENT_MOVED
           
static int BLOCK_COMMENT_REMOVED
           
static int BLOCK_COMMENT_RESIZED
           
static int BLOCK_COMMENT_VISBILITY_CHANGE
           
static int BLOCK_GENUS_CHANGED
           
static int BLOCK_MOVED
           
static int BLOCK_REMOVED
           
static int BLOCK_RENAMED
           
static int BLOCK_STACK_COMPILED
           
static int BLOCKS_CONNECTED
           
static int BLOCKS_DISCONNECTED
           
static int PAGE_ADDED
           
static int PAGE_REMOVED
           
static int PAGE_RENAMED
           
static int PAGE_RESIZED
           
static int WORKSPACE_FINISHED_LOADING
           
 
Constructor Summary
WorkspaceEvent(WorkspaceWidget widget, BlockLink link, int eventType)
          Constructs a new WorkspaceEvent.
WorkspaceEvent(WorkspaceWidget widget, BlockLink link, int eventType, boolean userSpawned)
           
WorkspaceEvent(WorkspaceWidget page, int eventType)
          Constructs a new WorkspaceEvent.
WorkspaceEvent(WorkspaceWidget page, int eventType, boolean userSpawned)
           
WorkspaceEvent(WorkspaceWidget widget, java.lang.Long blockID, int eventType)
          Constructs a new WorkspaceEvent.
WorkspaceEvent(WorkspaceWidget widget, java.lang.Long blockID, int eventType, boolean userSpawned)
           
WorkspaceEvent(WorkspaceWidget page, java.lang.String oldName, int eventType)
          Constructs a new WorkspaceEvent.
WorkspaceEvent(WorkspaceWidget page, java.lang.String oldName, int eventType, boolean userSpawned)
           
 
Method Summary
 int getEventType()
          Returns the int event type of this
 java.lang.String getOldNameOfSourceWidget()
          Returns the original name of the source widget; null if the source widget's name did not change.
 java.lang.Long getSourceBlockID()
          Returns the Long ID of the Block where this event occured.
 BlockLink getSourceLink()
          Returns the BlockLink where this event originated, or null if the event type of this is not block connected or disconnected.
 WorkspaceWidget getSourceWidget()
          Returns the WorkspaceWidget where this event occured.
 boolean isUserEvent()
          Tells if this event is a user spawned event or not
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PAGE_ADDED

public static final int PAGE_ADDED
See Also:
Constant Field Values

PAGE_REMOVED

public static final int PAGE_REMOVED
See Also:
Constant Field Values

BLOCK_ADDED

public static final int BLOCK_ADDED
See Also:
Constant Field Values

BLOCK_REMOVED

public static final int BLOCK_REMOVED
See Also:
Constant Field Values

BLOCKS_CONNECTED

public static final int BLOCKS_CONNECTED
See Also:
Constant Field Values

BLOCKS_DISCONNECTED

public static final int BLOCKS_DISCONNECTED
See Also:
Constant Field Values

BLOCK_STACK_COMPILED

public static final int BLOCK_STACK_COMPILED
See Also:
Constant Field Values

PAGE_RENAMED

public static final int PAGE_RENAMED
See Also:
Constant Field Values

PAGE_RESIZED

public static final int PAGE_RESIZED
See Also:
Constant Field Values

BLOCK_RENAMED

public static final int BLOCK_RENAMED
See Also:
Constant Field Values

BLOCK_MOVED

public static final int BLOCK_MOVED
See Also:
Constant Field Values

BLOCK_GENUS_CHANGED

public static final int BLOCK_GENUS_CHANGED
See Also:
Constant Field Values

BLOCK_COMMENT_ADDED

public static final int BLOCK_COMMENT_ADDED
See Also:
Constant Field Values

BLOCK_COMMENT_REMOVED

public static final int BLOCK_COMMENT_REMOVED
See Also:
Constant Field Values

BLOCK_COMMENT_MOVED

public static final int BLOCK_COMMENT_MOVED
See Also:
Constant Field Values

BLOCK_COMMENT_RESIZED

public static final int BLOCK_COMMENT_RESIZED
See Also:
Constant Field Values

BLOCK_COMMENT_VISBILITY_CHANGE

public static final int BLOCK_COMMENT_VISBILITY_CHANGE
See Also:
Constant Field Values

BLOCK_COMMENT_CHANGED

public static final int BLOCK_COMMENT_CHANGED
See Also:
Constant Field Values

WORKSPACE_FINISHED_LOADING

public static final int WORKSPACE_FINISHED_LOADING
See Also:
Constant Field Values
Constructor Detail

WorkspaceEvent

public WorkspaceEvent(WorkspaceWidget page,
                      int eventType)
Constructs a new WorkspaceEvent. This constructor should be used to report page added, removed events. The WorkspaceWidget page parameter should be an instance of Page.

Parameters:
page -
eventType -

WorkspaceEvent

public WorkspaceEvent(WorkspaceWidget page,
                      int eventType,
                      boolean userSpawned)

WorkspaceEvent

public WorkspaceEvent(WorkspaceWidget page,
                      java.lang.String oldName,
                      int eventType)
Constructs a new WorkspaceEvent. This constructor should be used to report page renamed events. The WorkspaceWidget page parameter should be an instance of Page.

Parameters:
page -
oldName - the old String name of this page
eventType -

WorkspaceEvent

public WorkspaceEvent(WorkspaceWidget page,
                      java.lang.String oldName,
                      int eventType,
                      boolean userSpawned)

WorkspaceEvent

public WorkspaceEvent(WorkspaceWidget widget,
                      java.lang.Long blockID,
                      int eventType)
Constructs a new WorkspaceEvent. This constructor should be used to report the following: block added, removed, renamed, compiled, moved.

Parameters:
widget -
blockID -
eventType -

WorkspaceEvent

public WorkspaceEvent(WorkspaceWidget widget,
                      java.lang.Long blockID,
                      int eventType,
                      boolean userSpawned)

WorkspaceEvent

public WorkspaceEvent(WorkspaceWidget widget,
                      BlockLink link,
                      int eventType)
Constructs a new WorkspaceEvent. This constructor should be used to report block connected/disconnected events. The specified link contains the connection information.

Parameters:
widget -
link -
eventType -

WorkspaceEvent

public WorkspaceEvent(WorkspaceWidget widget,
                      BlockLink link,
                      int eventType,
                      boolean userSpawned)
Method Detail

isUserEvent

public boolean isUserEvent()
Tells if this event is a user spawned event or not

Returns:
true if this event was spawned by a user

getSourceWidget

public WorkspaceWidget getSourceWidget()
Returns the WorkspaceWidget where this event occured.

Returns:
the WorkspaceWidget where this event occured.

getSourceBlockID

public java.lang.Long getSourceBlockID()
Returns the Long ID of the Block where this event occured. For block connection events, this id is Block.NULL since the event occurred from two blocks.


getEventType

public int getEventType()
Returns the int event type of this

Returns:
the int event type of this

getSourceLink

public BlockLink getSourceLink()
Returns the BlockLink where this event originated, or null if the event type of this is not block connected or disconnected.

Returns:
the BlockLink where this event originated, or null if the event type of this is not block connected or disconnected.

getOldNameOfSourceWidget

public java.lang.String getOldNameOfSourceWidget()
Returns the original name of the source widget; null if the source widget's name did not change.

Returns:
the original name of the source widget; null if the source widget's name did not change.

toString

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