Search in sources :

Example 16 with WorkspaceEvent

use of edu.mit.blocks.workspace.WorkspaceEvent in project openblocks by mikaelhg.

the class BlockLabel method genusChanged.

protected void genusChanged(String genus) {
    if (widget.hasSiblings()) {
        Block oldBlock = workspace.getEnv().getBlock(blockID);
        oldBlock.changeGenusTo(genus);
        RenderableBlock rb = workspace.getEnv().getRenderableBlock(blockID);
        rb.repaintBlock();
        workspace.notifyListeners(new WorkspaceEvent(workspace, rb.getParentWidget(), blockID, WorkspaceEvent.BLOCK_GENUS_CHANGED));
    }
}
Also used : WorkspaceEvent(edu.mit.blocks.workspace.WorkspaceEvent) Block(edu.mit.blocks.codeblocks.Block)

Aggregations

WorkspaceEvent (edu.mit.blocks.workspace.WorkspaceEvent)16 BlockConnector (edu.mit.blocks.codeblocks.BlockConnector)8 BlockLink (edu.mit.blocks.codeblocks.BlockLink)6 RenderableBlock (edu.mit.blocks.renderable.RenderableBlock)6 Block (edu.mit.blocks.codeblocks.Block)5 WorkspaceWidget (edu.mit.blocks.workspace.WorkspaceWidget)4 Point (java.awt.Point)3 TextualFactoryBlock (edu.mit.blocks.renderable.TextualFactoryBlock)2 Container (java.awt.Container)2 MiniMap (edu.mit.blocks.workspace.MiniMap)1 Workspace (edu.mit.blocks.workspace.Workspace)1 Dimension (java.awt.Dimension)1 PopupMenu (java.awt.PopupMenu)1 Point2D (java.awt.geom.Point2D)1 ArrayList (java.util.ArrayList)1