Example #1
0
  public void resetViewer() {
    // create main preview pane
    JInternalFrame rootContainer = new JInternalFrame("Preview Pane");

    // Setup the viewer
    viewer = new Viewer(rootContainer, null);
    // load properties from jar
    viewer.loadProperties("jar:/.properties.xml");
    viewer.setupViewer();
    viewer
        .getSwingGUI()
        .addPageChangeListener(
            new DocumentListener() {
              @Override
              public void insertUpdate(DocumentEvent e) {
                // new page inserted in view, load tags
                loadTags();
              }

              @Override
              public void removeUpdate(DocumentEvent e) {}

              @Override
              public void changedUpdate(DocumentEvent e) {}
            });

    // Add the viewer to the frame
    frame.add(rootContainer, BorderLayout.CENTER);

    // Require for internalFrame to be displayed
    rootContainer.setVisible(true);

    // shouldn't do this here, but need it for now
    if (this.tagFilenames != null && this.tagFilenames.length > 0) {
      viewer.executeCommand(Commands.OPENFILE, new File[] {new File(TMP_FILE)});
    }
  }
Example #2
0
 public void showPreviousPage() {
   // previous page (page change event will load tags)
   viewer.executeCommand(Commands.BACKPAGE, null);
 }
Example #3
0
 public void showNextPage() {
   // next page (page change event will load tags)
   viewer.executeCommand(Commands.FORWARDPAGE, null);
 }