Package com.lowagie.rups.view.itext.treenodes

Examples of com.lowagie.rups.view.itext.treenodes.FormTreeNode


   */
  public FormTree(PdfReaderController controller) {
    super();
    this.controller = controller;
    setCellRenderer(new IconTreeCellRenderer());
    setModel(new DefaultTreeModel(new FormTreeNode()));
    addTreeSelectionListener(this);
    xfaTree = new XfaTree();
    xfaTextArea = new XfaTextArea();
  }
View Full Code Here


   * @param  observable  the observable object
   * @param  obj      the object
   */
  public void update(Observable observable, Object obj) {
    if (obj == null) {
      setModel(new DefaultTreeModel(new FormTreeNode()));
      xfaFile = null;
      xfaTree.clear();
      xfaTextArea.clear();
      repaint();
      return;
    }
    if (obj instanceof ObjectLoader) {
      ObjectLoader loader = (ObjectLoader)obj;
      TreeNodeFactory factory = loader.getNodes();
      PdfTrailerTreeNode trailer = controller.getPdfTree().getRoot();
      PdfObjectTreeNode catalog = factory.getChildNode(trailer, PdfName.ROOT);
      PdfObjectTreeNode form = factory.getChildNode(catalog, PdfName.ACROFORM);
      if (form == null) {
        return;
      }
      PdfObjectTreeNode fields = factory.getChildNode(form, PdfName.FIELDS);
      FormTreeNode root = new FormTreeNode();
      if (fields != null) {
        FormTreeNode node = new FormTreeNode(fields);
        node.setUserObject("Fields");
        loadFields(factory, node, fields);
        root.add(node);
      }
      PdfObjectTreeNode xfa = factory.getChildNode(form, PdfName.XFA);
      if (xfa != null) {
        XfaTreeNode node = new XfaTreeNode(xfa);
        node.setUserObject("XFA");
        loadXfa(factory, node, xfa);
        root.add(node);
        try {
          xfaFile = new XfaFile(node);
          xfaTree.load(xfaFile);
View Full Code Here

      while (children.hasMoreElements()) {
        loadFields(factory, form_node, (PdfObjectTreeNode)children.nextElement());
      }
    }
    else if (object_node.isDictionary()) {
      FormTreeNode leaf = new FormTreeNode(object_node);
      form_node.add(leaf);
      PdfObjectTreeNode kids = factory.getChildNode(object_node, PdfName.KIDS);
      loadFields(factory, leaf, kids);
    }
  }
View Full Code Here

   * @see javax.swing.event.TreeSelectionListener#valueChanged(javax.swing.event.TreeSelectionEvent)
   */
  public void valueChanged(TreeSelectionEvent evt) {
    if (controller == null)
      return;
    FormTreeNode selectednode = (FormTreeNode)this.getLastSelectedPathComponent();
    if (selectednode == null)
      return;
    PdfObjectTreeNode node = selectednode.getCorrespondingPdfObjectNode();
    if (node != null)
      controller.selectNode(node);
  }
View Full Code Here

TOP

Related Classes of com.lowagie.rups.view.itext.treenodes.FormTreeNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.