workspace
Interface WorkspaceWidget

All Known Implementing Classes:
FactoryManager, MiniMap, Page, TrashCan

public interface WorkspaceWidget

WorkspaceWidgets are components within the workspace other than blocks that include bars, buttons, factory drawers, and single instance widgets such as the MiniMap and the TrashCan.


Method Summary
 void addBlock(RenderableBlock block)
          Adds the specified block to this widget interally and graphically.
 void addBlocks(java.util.Collection<RenderableBlock> blocks)
          Adds a collection of blocks to this widget internally and graphically.
 void blockDragged(RenderableBlock block)
          Called by RenderableBlocks as they are dragged over this Widget.
 void blockDropped(RenderableBlock block)
          Called by RenderableBlocks that get "dropped" onto this Widget
 void blockEntered(RenderableBlock block)
          Called when a RenderableBlock is being dragged and goes from being outside this Widget to being inside the Widget.
 void blockExited(RenderableBlock block)
          Called when a RenderableBlock that was being dragged over this Widget goes from being inside this Widget to being outside the Widget.
 boolean contains(int x, int y)
          Widgets must be able to report whether a given point is inside them
 java.lang.Iterable<RenderableBlock> getBlocks()
          Returns the set of blocks that abstract "lives" inside this widget.
 javax.swing.JComponent getJComponent()
          Very Java Swing dependent method
 void removeBlock(RenderableBlock block)
          Used by RenderableBlocks to tell their originating Widgets that they're moving somewhere else and so should be removed.
 

Method Detail

blockDropped

void blockDropped(RenderableBlock block)
Called by RenderableBlocks that get "dropped" onto this Widget

Parameters:
block - the RenderableBlock that is "dropped" onto this Widget

blockDragged

void blockDragged(RenderableBlock block)
Called by RenderableBlocks as they are dragged over this Widget.

Parameters:
block - the RenderableBlock being dragged

blockEntered

void blockEntered(RenderableBlock block)
Called when a RenderableBlock is being dragged and goes from being outside this Widget to being inside the Widget.

Parameters:
block - the RenderableBlock being dragged

blockExited

void blockExited(RenderableBlock block)
Called when a RenderableBlock that was being dragged over this Widget goes from being inside this Widget to being outside the Widget.

Parameters:
block - the RenderableBlock being dragged

removeBlock

void removeBlock(RenderableBlock block)
Used by RenderableBlocks to tell their originating Widgets that they're moving somewhere else and so should be removed.

Parameters:
block - the RenderableBlock

addBlock

void addBlock(RenderableBlock block)
Adds the specified block to this widget interally and graphically. The difference between this method and blockDropped is that blockDropped is activated by user actions, such as mouse drag and drop or typeblocking. Use this method only for single blocks, as it may cause repainting! For adding several blocks at once use addBlocks, which delays graphical updates until after the blocks have all been added.

Parameters:
block - the desired RenderableBlock to add to this

addBlocks

void addBlocks(java.util.Collection<RenderableBlock> blocks)
Adds a collection of blocks to this widget internally and graphically. This method adds blocks internally first, and only updates graphically once all of the blocks have been added. It is therefore preferable to use this method rather than addBlock whenever multiple blocks will be added.

Parameters:
blocks - the Collection of RenderableBlocks to add

contains

boolean contains(int x,
                 int y)
Widgets must be able to report whether a given point is inside them

Parameters:
x -
y -

getJComponent

javax.swing.JComponent getJComponent()
Very Java Swing dependent method

Returns:
the JComponent-ized cast of this widget.

getBlocks

java.lang.Iterable<RenderableBlock> getBlocks()
Returns the set of blocks that abstract "lives" inside this widget. Does not return all the blocks that exists in thsi component, or return all the blocks that are handled by this widget. Rather, the set of blocks returned all the blocks that "lives" in this widget.