if(showMethods)
System.out.println("DefaultActionHandler.A() ");
// new version
PdfObject aData = null;
if(eventType==MOUSERELEASED ){
//get the A action if we have activated the form (released)
aData = formObj.getDictionary(PdfDictionary.A);
}
if(aData==null){
aData = formObj.getDictionary(PdfDictionary.AA);
if(aData!=null){
if(eventType == MOUSEENTERED){
aData = aData.getDictionary(PdfDictionary.E);
}else if(eventType == MOUSEEXITED){
aData = aData.getDictionary(PdfDictionary.X);
}else if(eventType == MOUSEPRESSED){
aData = aData.getDictionary(PdfDictionary.D);
}else if(eventType == MOUSERELEASED){
aData = aData.getDictionary(PdfDictionary.U);
}
}
}
//change cursor for each event
actionFactory.setCursor(eventType);
gotoDest(formObj,eventType,PdfDictionary.Dest);
int subtype=formObj.getParameterConstant(PdfDictionary.Subtype);
int popupFlag = formObj.getActionFlag();
if (subtype == PdfDictionary.Sig) {
additionalAction_Signature(formObj, eventType);
} else if (eventType==MOUSECLICKED && (popupFlag == FormObject.POPUP || subtype==PdfDictionary.Text)){
actionFactory.popup(raw,formObj,currentPdfFile);
} else {
// can get empty values
if (aData == null)
return;
int command = aData.getNameAsConstant(PdfDictionary.S);
// S is Name of action
if (command != PdfDictionary.Unknown) {
if (command == PdfDictionary.Named) {
additionalAction_Named(eventType, aData);
}else if(command==PdfDictionary.Goto || command==PdfDictionary.GoToR){
if (aData != null) {
gotoDest(aData, eventType,command);
}
} else if (command == PdfDictionary.ResetForm) {
additionalAction_ResetForm();
} else if (command == PdfDictionary.SubmitForm) {
additionalAction_SubmitForm(aData);
} else if (command == PdfDictionary.JavaScript) {
//javascript called above.
} else if (command == PdfDictionary.Hide) {
additionalAction_Hide(eventType, aData);
} else if (command == PdfDictionary.URI) {
additionalAction_URI(eventType, aData.getTextStreamValue(PdfDictionary.URI));
} else if (command == PdfDictionary.Launch) {
//<start-thin><start-adobe>
try {
//get the F dictionary
PdfObject dict=aData.getDictionary(PdfDictionary.F);
//System.out.println("dict="+dict+" "+dict.getObjectRefAsString());
//then get the submit URL to use
if(dict!=null){
String target = dict.getTextStreamValue(PdfDictionary.F);
InputStream sourceFile = getClass().getResourceAsStream("/org/jpedal/res/"+target);
if(sourceFile==null){
JOptionPane.showMessageDialog(decode_pdf,"Unable to locate "+target);