BlocklyEvent.MoveEvent

public static final class BlocklyEvent.MoveEvent extends BlocklyEvent

Event fired when a block is moved on the workspace, or its parent connection is changed.

This event must be created before the block is moved to capture the original position. After the move has been completed in the workspace, capture the updated position or parent using recordNew(Block). All of this is managed by BlocklyController, before BlocklyController.EventsCallbacks receive the event.

Inherited Constant Summary

Inherited Field Summary

Public Constructor Summary

BlocklyEvent.MoveEvent(Block block)
Constructs a BlocklyEvent.MoveEvent signifying the movement of a block on the workspace.
BlocklyEvent.MoveEvent(JSONObject json)
Constructs a MoveEvent from the JSON serialized representation.

Public Method Summary

String
String
boolean
String
String
boolean
boolean
boolean
void
recordNew(Block block)

Protected Method Summary

void
writeJsonAttributes(JSONStringer out)

Inherited Method Summary

Public Constructors

public BlocklyEvent.MoveEvent (Block block)

Constructs a BlocklyEvent.MoveEvent signifying the movement of a block on the workspace.

Parameters
block The root block of the move, while it is still in its original position.

public BlocklyEvent.MoveEvent (JSONObject json)

Constructs a MoveEvent from the JSON serialized representation.

Parameters
json The serialized MoveEvent.
Throws
JSONException

Public Methods

public String getNewInputName ()

public String getNewParentId ()

public boolean getNewWorkspacePosition (WorkspacePoint output)

Parameters
output

public String getOldInputName ()

public String getOldParentId ()

public boolean getOldWorkspacePosition (WorkspacePoint output)

Parameters
output

public boolean hasNewPosition ()

public boolean hasOldPosition ()

public void recordNew (Block block)

Parameters
block

Protected Methods

protected void writeJsonAttributes (JSONStringer out)

Parameters
out
Throws
JSONException