BlockView

public interface BlockView
Known Indirect Subclasses

Draws a block and handles laying out all its inputs/fields.

Implementations of BlockView must extend ViewGroup or one of its subclasses. The class should also disable activated/focused/pressed/selected state propegation, as implemented in NonPropagatingViewGroup.

Public Method Summary

abstract Block
abstract ConnectionManager
abstract InputView
getInputView(int n)
abstract int
abstract int
abstract ViewParent
abstract BlockGroup
abstract BlockTouchHandler
abstract void
getTouchLocationOnScreen(MotionEvent event, int[] locationOut)
Gets the screen location of a touch, assuming that the view transforms will be in the WorkspaceView that contains this view.
abstract int
abstract WorkspaceView
abstract float
getX()
abstract float
getY()
abstract void
setHighlightedConnection(Connection connection)
Sets the connection of this block that should display with a pending connection (e.g., during a drag) highlight.
abstract void
setTouchHandler(BlockTouchHandler touchHandler)
Sets the BlockTouchHandler to use on this and all subviews.
abstract void
unlinkModel()
Recursively disconnects this view from the model and all subviews / model subcomponents.
abstract void
updateConnectorLocations()
Updates the locations of the connections based on their offsets within the BlockView, based upon the view's position within the WorkspaceView.

Public Methods

public abstract Block getBlock ()

Returns
  • The block represented by this view.

public abstract ConnectionManager getConnectionManager ()

public abstract InputView getInputView (int n)

Parameters
n
Returns

public abstract int getNextBlockVerticalOffset ()

Returns
  • Vertical offset for positioning the "Next" block (if one exists). This is relative to the top of this view's area.

public abstract int getOutputConnectorMargin ()

Returns
  • Layout margin on the start side of the block (for optional Output connector).

public abstract ViewParent getParent ()

See Also

public abstract BlockGroup getParentBlockGroup ()

Returns
  • The closest view tree ancestor that is a BlockGroup.

public abstract BlockTouchHandler getTouchHandler ()

public abstract void getTouchLocationOnScreen (MotionEvent event, int[] locationOut)

Gets the screen location of a touch, assuming that the view transforms will be in the WorkspaceView that contains this view.

Parameters
event The touch event in question
locationOut The array to store the results.

public abstract int getWidth ()

See Also

public abstract WorkspaceView getWorkspaceView ()

Returns
  • The WorkspaceView this block view is attached to, or null if it is not in a WorkspaceView..

public abstract float getX ()

See Also

public abstract float getY ()

See Also

public abstract void setHighlightedConnection (Connection connection)

Sets the connection of this block that should display with a pending connection (e.g., during a drag) highlight.

Parameters
connection The block connection to highlight.

public abstract void setTouchHandler (BlockTouchHandler touchHandler)

Sets the BlockTouchHandler to use on this and all subviews.

public abstract void unlinkModel ()

Recursively disconnects this view from the model and all subviews / model subcomponents. Implementations must also call unregisterView(BlockView) to make sure the view is not returned by getView(Block).

public abstract void updateConnectorLocations ()

Updates the locations of the connections based on their offsets within the BlockView, based upon the view's position within the WorkspaceView. Often used when the block has moved but not changed shape, such as after a drag.