    private ReferencePoint getGripPoint (Drawing drawing) {
        ReferencePoint position = null;
        Collection<ReferencePoint> closePoints = new ArrayList<ReferencePoint>();
        Workspace workspace = br.org.archimedes.Utils.getWorkspace();
        Rectangle modelDrawingArea = workspace.getCurrentViewportArea();
        Rectangle mouseArea = getMouseArea(workspace);
        try {
            Set<Element> closeElements = getViewableElements(drawing,
                    modelDrawingArea);
            for (Element element : closeElements) {
                Collection<ReferencePoint> basicReferences = getBasicReferences(
                        modelDrawingArea, mouseArea, element);
                Collection<XPoint> intersectionReferences = getIntersectionReferences(
                        mouseArea, closeElements, element);
                closePoints.addAll(basicReferences);
                closePoints.addAll(intersectionReferences);
                OrthogonalPoint ortho = getOrthogonalPoint(mouseArea, element);
                if (ortho != null) {
                    closePoints.add(ortho);
                }
            }
            position = getClosestPoint(closePoints, mousePosition);
        }
        catch (NullArgumentException e) {
        }
        return position;
    }

    private ReferencePoint getGripPoint (Drawing drawing) {
        ReferencePoint position = null;
        Collection<ReferencePoint> closePoints = new ArrayList<ReferencePoint>();
        Workspace workspace = br.org.archimedes.Utils.getWorkspace();
        Rectangle modelDrawingArea = workspace.getCurrentViewportArea();
        Rectangle mouseArea = getMouseArea(workspace);
        try {
            Set<Element> closeElements = getViewableElements(drawing,
                    modelDrawingArea);
            for (Element element : closeElements) {
                Collection<ReferencePoint> basicReferences = getBasicReferences(
                        modelDrawingArea, mouseArea, element);
                Collection<XPoint> intersectionReferences = getIntersectionReferences(
                        mouseArea, closeElements, element);
                closePoints.addAll(basicReferences);
                closePoints.addAll(intersectionReferences);
                OrthogonalPoint ortho = getOrthogonalPoint(mouseArea, element);
                if (ortho != null) {
                    closePoints.add(ortho);
                }
            }
            position = getClosestPoint(closePoints, mousePosition);
        }
        catch (NullArgumentException e) {
            e.printStackTrace();
        }
        return position;
    }
