public void deleteAnnotation(Annotation annot) {

        // make sure the page annotations have been initialized.
        if (!isInited) {
            try {
                initPageAnnotations();
            } catch (InterruptedException e) {
                logger.warning("Annotation Initialization interupted");
            }
        }

        StateManager stateManager = library.getStateManager();

        Object annots = getObject(ANNOTS_KEY);
        boolean isAnnotAReference =
                library.isReference(entries, ANNOTS_KEY.getName());

        // mark the item as deleted so the state manager can clean up the reference.
        annot.setDeleted(true);

        // check to see if this is an existing annotations, if the annotations
        // is existing then we have to mark either the page or annot ref as chagned.
        if (!annot.isNew() && !isAnnotAReference) {
            // add the page as state change
            stateManager.addChange(
                    new PObject(this, this.getPObjectReference()));
        }
        // if not new and annot is a ref, we have to add annot ref as changed.
        else if (!annot.isNew() && isAnnotAReference) {
            stateManager.addChange(
                    new PObject(annots, library.getObjectReference(
                            entries, ANNOTS_KEY.getName())));
        }
        // removed the annotations from the annots vector
        if (annots instanceof Vector) {
            // update annots dictionary with new annotations reference,
            Vector v = (Vector) annots;
            v.remove(annot.getPObjectReference());
        }

        // remove the annotations form the annotation cache in the page object
        if (annotations != null) {
            annotations.remove(annot);
        }

        // finally remove it from the library, probably not necessary....
//        library.removeObject(annot.getPObjectReference());

    }