public int getCursor(MouseEvent me) {
        Component c = me.getComponent();
        boolean isEditable = false;
        boolean isLinkAnnot = false;

        // get render flags from component.
        if (c instanceof AnnotationComponentImpl){
            AnnotationComponentImpl annot = (AnnotationComponentImpl) c;
            isEditable = annot.isEditable();
            isLinkAnnot = annot.isLinkAnnot();
        }

        int w = c.getWidth();
        int h = c.getHeight();

        // show resize cursors for link annotations
        if ((isEditable && isLinkAnnot)){
            for (int i = 0; i < locations.length; i++) {
                Rectangle rect = getRectangle(0, 0, w, h, locations[i]);
                if (rect.contains(me.getPoint()))
                    return cursors[i];
            }
        }
        // other wise just show the move. 
        return Cursor.MOVE_CURSOR;
    }