Package com.sun.pdfview.action

Examples of com.sun.pdfview.action.GoToAction


    pageEnd = pdfFile.getNumPages();
    OutlineNode on = pdfFile.getOutline();
    if (on != null) {
      for (int i = 0; i < on.getChildCount(); i++) {
        OutlineNode child = (OutlineNode) on.getChildAt(i);
        GoToAction act = (GoToAction) child.getAction();

        //Find the beginning of the chapter selected,
        //then take the page start and page end number
        if (child.toString().toLowerCase().startsWith(marker.getChapterPrefix().toLowerCase())) {
          currentOutline = child;
          pageStart = pdfFile.getPageNumber(act.getDestination()
              .getPage());
          if (i + 1 < on.getChildCount()) {
            OutlineNode childAfter = (OutlineNode) on
                .getChildAt(i + 1);
            GoToAction actAfter = (GoToAction) childAfter
                .getAction();
            pageEnd = pdfFile.getPageNumber(actAfter
                .getDestination().getPage());
          }// else if child is the last one, pageEnd is already set.
          break;
        }
      }
View Full Code Here


  @Override
  public void valueChanged(TreeSelectionEvent e) {

    TreePath path = e.getNewLeadSelectionPath();
    OutlineNode selectedNode = (OutlineNode) path.getLastPathComponent();
    GoToAction act = (GoToAction) selectedNode.getAction();

    try {
      int pageNode = pdfFile
          .getPageNumber(act.getDestination().getPage());
      bar.setValue(pageNode - pageStart);
      loadPage(pageNode - pageStart);
      updateCanvas();
    } catch (IOException e1) {
View Full Code Here

      PDFObject dest = annotObject.getDictRef("Dest");
      if(dest == null) {
        dest = annotObject.getDictRef("DEST");
      }
      if (dest != null) {
        this.action = new GoToAction(PDFDestination.getDestination(dest, annotObject.getRoot()));
      } else {
        throw new PDFParseException(
          "Could not parse link annotation (no Action or Destination found): "
            + annotObject.toString());
      }
View Full Code Here

                    if (destObj != null) {
                        try {
                            PDFDestination dest =
                                    PDFDestination.getDestination(destObj, getRoot());

                            action = new GoToAction(dest);
                        } catch (IOException ioe) {
                            // oh well
                        }
                    }
                }
View Full Code Here

TOP

Related Classes of com.sun.pdfview.action.GoToAction

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.