Package edu.mit.blocks.workspace

Examples of edu.mit.blocks.workspace.WorkspaceWidget


                dragHandler.mouseReleased(e);

                //if the block was dragged before...then
                if (dragging) {
                    BlockLink link = getNearbyLink(); //look for nearby link opportunities
                    WorkspaceWidget widget = null;

                    // if a suitable link wasn't found, just drop the block
                    if (link == null) {
                        widget = lastDragWidget;
                        stopDragging(this, widget);
View Full Code Here


                dragHandler.mouseDragged(e);

                // Find the widget under the mouse
                dragHandler.myLoc.move(getX() + dragHandler.mPressedX, getY() + dragHandler.mPressedY);
                Point p = SwingUtilities.convertPoint(this.getParent(), dragHandler.myLoc, workspace);
                WorkspaceWidget widget = workspace.getWidgetAt(p);
                if (widget == null) {
                    // not on a workspace widget, cancel dragging
                    return;
                }
View Full Code Here

        }
        Block block = workspace.getEnv().getBlock(focusManager.getFocusBlockID());
        RenderableBlock renderable = workspace.getEnv().getRenderableBlock(block.getBlockID());

        //get workspace widget associated with current focus
        WorkspaceWidget widget = renderable.getParentWidget();
        //do not delete block instances in null widgets
        if (widget == null) {
            throw new RuntimeException("TypeBlockManager: do not delete blocks with no parent widget.");
            //return;
        }
View Full Code Here

//    ====================focus coming in>>>>>>>>>> TODO
//    ====================>>>>>>>>>>>>>>>>>>>>>>>>>
        if (node == null) {
            return;
        }
        WorkspaceWidget widget = null;
        Iterable<WorkspaceWidget> widgets = null;
        Point spot = null;
        if (invalidBlockID(focusManager.getFocusBlockID())) {
            //canvas has focus
            Point location = SwingUtilities.convertPoint(
                    this.blockCanvas.getCanvas(),
                    this.focusManager.getCanvasPoint(),
                    workspace);
            widget = workspace.getWidgetAt(location);
            spot = SwingUtilities.convertPoint(
                    this.blockCanvas.getCanvas(),
                    this.focusManager.getCanvasPoint(),
                    widget.getJComponent());
        } else {
            RenderableBlock focusRenderable = workspace.getEnv().getRenderableBlock(focusManager.getFocusBlockID());
            widget = focusRenderable.getParentWidget();
            spot = focusRenderable.getLocation();
        }
View Full Code Here

    }

    public static void deleteBlock(RenderableBlock block) {
        block.setLocation(0, 0);

        WorkspaceWidget widget = block.getParentWidget();
        if (widget != null) {
            widget.removeBlock(block);
        }

        Container parent = block.getParent();
        if (parent != null) {
            parent.remove(block);
View Full Code Here

TOP

Related Classes of edu.mit.blocks.workspace.WorkspaceWidget

Copyright © 2018 www.massapicom. 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.