private PDFAction getAction(AbstractAction action) throws IFException {
if (action == null) {
return null;
}
PDFAction pdfAction = (PDFAction)this.completeActions.get(action.getID());
if (pdfAction != null) {
return pdfAction;
} else if (action instanceof GoToXYAction) {
pdfAction = (PDFAction) incompleteActions.get(action.getID());
if (pdfAction != null) {
return pdfAction;
} else {
GoToXYAction a = (GoToXYAction)action;
PDFGoTo pdfGoTo = new PDFGoTo(null);
getPDFDoc().assignObjectNumber(pdfGoTo);
if (action.isComplete()) {
updateTargetLocation(pdfGoTo, a);
} else {
this.incompleteActions.put(action.getID(), pdfGoTo);
}
return pdfGoTo;
}
} else if (action instanceof URIAction) {
URIAction u = (URIAction)action;
assert u.isComplete();
String uri = u.getURI();
PDFFactory factory = getPDFDoc().getFactory();
pdfAction = factory.getExternalAction(uri, u.isNewWindow());
if (!pdfAction.hasObjectNumber()) {
//Some PDF actions are pooled
getPDFDoc().registerObject(pdfAction);
}
this.completeActions.put(action.getID(), pdfAction);
return pdfAction;