DefaultMutableTreeNode blank = new DefaultMutableTreeNode("The following signature fields are not signed");
while(signatureObjects.hasNext()){
FormObject formObj = (FormObject) signatureObjects.next();
PdfObject sigObject=formObj.getDictionary(PdfDictionary.V);
decode_pdf.getIO().checkResolved(formObj);
if(sigObject == null){
if(!blank.isNodeChild(root))
root.add(blank);
DefaultMutableTreeNode blankNode = new DefaultMutableTreeNode(formObj.getTextStreamValue(PdfDictionary.T)+ " on page " + formObj.getPageNumber());
blank.add(blankNode);
} else {
if(!signed.isNodeChild(root))
root.add(signed);
//String name = (String) OLDsigObject.get("Name");
String name=sigObject.getTextStreamValue(PdfDictionary.Name);
DefaultMutableTreeNode owner = new DefaultMutableTreeNode("Signed by " + name);
signed.add(owner);
DefaultMutableTreeNode type = new DefaultMutableTreeNode("Type");
owner.add(type);
String filter = null;//sigObject.getName(PdfDictionary.Filter);
//@simon -new version to test
PdfArrayIterator filters = sigObject.getMixedArray(PdfDictionary.Filter);
if(filters!=null && filters.hasMoreTokens())
filter=filters.getNextValueAsString(true);
DefaultMutableTreeNode filterNode = new DefaultMutableTreeNode("Filter: " + filter);
type.add(filterNode);
String subFilter = sigObject.getName(PdfDictionary.SubFilter);
DefaultMutableTreeNode subFilterNode = new DefaultMutableTreeNode("Sub Filter: " + subFilter);
type.add(subFilterNode);
DefaultMutableTreeNode details = new DefaultMutableTreeNode("Details");
owner.add(details);
//@simon - guess on my part....
String rawDate=sigObject.getTextStreamValue(PdfDictionary.M);
//if(rawDate!=null){
StringBuilder date = new StringBuilder(rawDate);
date.delete(0, 2);
date.insert(4, '/');
date.insert(7, '/');
date.insert(10, ' ');
date.insert(13, ':');
date.insert(16, ':');
date.insert(19, ' ');
DefaultMutableTreeNode time = new DefaultMutableTreeNode("Time: " +date);
details.add(time);
//}
String reason=sigObject.getTextStreamValue(PdfDictionary.Reason);
DefaultMutableTreeNode reasonNode = new DefaultMutableTreeNode("Reason: " + reason);
details.add(reasonNode);
String location=sigObject.getTextStreamValue(PdfDictionary.Location);
DefaultMutableTreeNode locationNode = new DefaultMutableTreeNode("Location: " + location);
details.add(locationNode);
DefaultMutableTreeNode field = new DefaultMutableTreeNode("Field: " + formObj.getTextStreamValue(PdfDictionary.T)+ " on page " + formObj.getPageNumber());
details.add(field);
}
}
if(signaturesTree==null){
signaturesTree = new JTree();