Package edu.mit.blocks.codeblocks

Examples of edu.mit.blocks.codeblocks.BlockLink.connect()


                            widget = workspace.getEnv().getRenderableBlock(link.getSocketBlockID()).getParentWidget();
                        }

                        // drop the block and connect its link
                        stopDragging(this, widget);
                        link.connect();
                        workspace.notifyListeners(new WorkspaceEvent(workspace, widget, link, WorkspaceEvent.BLOCKS_CONNECTED));
                        workspace.getEnv().getRenderableBlock(link.getSocketBlockID()).moveConnectedBlocks();
                    }

                    //set the locations for X and Y based on zoom at 1.0
View Full Code Here


                            workspace.getEnv().getBlock(parentID),
                            workspace.getEnv().getBlock(afterBlockID),
                            parentConnectorToBlock,
                            workspace.getEnv().getBlock(afterBlockID).getBeforeConnector());
                    if (link != null) {
                        link.connect();
                        workspace.notifyListeners(new WorkspaceEvent(
                                workspace,
                                workspace.getEnv().getRenderableBlock(link.getPlugBlockID()).getParentWidget(),
                                link, WorkspaceEvent.BLOCKS_CONNECTED));
                        workspace.getEnv().getRenderableBlock(link.getPlugBlockID()).repaintBlock();
View Full Code Here

                    dropBlock(childBlock);
                    childBlock.repaintBlock();
                    childBlock.repaint();
                } else {
                    // drop and link the new block
                    link.connect();
                    dropBlock(childBlock);

                    workspace.notifyListeners(new WorkspaceEvent(
                            workspace,
                            workspace.getEnv().getRenderableBlock(link.getPlugBlockID()).getParentWidget(),
View Full Code Here

            } else if (childBlock.hasBeforeConnector()) {
                link = BlockLinkChecker.canLink(workspace, block, childBlock, socket, childBlock.getBeforeConnector());
            } else {
                link = null;
            }//assume link is not null
            link.connect();
            workspace.notifyListeners(new WorkspaceEvent(workspace, workspace.getEnv().getRenderableBlock(link.getPlugBlockID()).getParentWidget(), link, WorkspaceEvent.BLOCKS_CONNECTED));

        }
        if (node.getAfterNode() != null) {
            BlockConnector socket = block.getAfterConnector(); //assume has after connector
View Full Code Here

            } else if (childBlock.hasBeforeConnector()) {
                link = BlockLinkChecker.canLink(workspace, block, childBlock, socket, childBlock.getBeforeConnector());
            } else {
                link = null;
            }//assume link is not null
            link.connect();
            workspace.notifyListeners(new WorkspaceEvent(workspace, workspace.getEnv().getRenderableBlock(link.getPlugBlockID()).getParentWidget(), link, WorkspaceEvent.BLOCKS_CONNECTED));

        }
        return renderable;
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.