public boolean focusNextBlock() {
        //return focus to canvas if no focusblock does not exist
        if (invalidBlock(focusBlock) || !workspace.getEnv().getRenderableBlock(focusBlock).isVisible()) {
            setFocus(canvasFocusPoint, Block.NULL);
            return false;
        }
        //give focus to any preceeding socket of current block
        Block currentBlock = getBlock(focusBlock);
        for (BlockConnector socket : currentBlock.getSockets()) {
            if (socket != null && !invalidBlock(socket.getBlockID())) {
                //give focus to socket block
                setFocus(socket.getBlockID());
                return true;
            }
        }
        //give focus to after block of current block
        Long afterBlock = currentBlock.getAfterBlockID();
        if (!invalidBlock(afterBlock)) {
            setFocus(afterBlock);
            return true;
        }
        //current block != null.....invariant checke in getNextNode()
        Block nextBlock = this.getNextNode(currentBlock);
        //check invariant
        if (nextBlock == null) {
            throw new RuntimeException("Invariant Violated: return value of getNextNode() may not be null");
        }
        //set focus
        setFocus(nextBlock.getBlockID());
        return true;
    }