class PagesTable extends JTable implements JTableAutoModelInterface, Observer {

    /**
     * A serial version UID.
     */
    private static final long serialVersionUID = -6523261089453886508L;
    /**
     * A list with page nodes.
     */
    protected ArrayList<PdfPageTreeNode> list = new ArrayList<>();
    /**
     * Nodes in the FormTree correspond with nodes in the main PdfTree.
     */
    protected PdfReaderController controller;
    /***/
    protected PageSelectionListener listener;

    /**
     * Constructs a PagesTable.
     *
     * @param listener   the page navigation listener.
     * @param controller The renderer that will render an object when selected in the table.
     */
    public PagesTable(PdfReaderController controller, PageSelectionListener listener) {
        this.controller = controller;
        this.listener = listener;
    }

    /**
     * @see java.util.Observer#update(java.util.Observable, java.lang.Object)
     */
    public void update(Observable observable, Object obj) {<FILL_FUNCTION_BODY>}

    /**
     * @see javax.swing.JTable#getColumnCount()
     */
    public int getColumnCount() {
        return 2;
    }

    /**
     * @see javax.swing.JTable#getRowCount()
     */
    public int getRowCount() {
        return list.size();
    }

    /**
     * @see javax.swing.JTable#getValueAt(int, int)
     */
    public Object getValueAt(int rowIndex, int columnIndex) {
        if (getRowCount() == 0) {
            return null;
        }
        switch (columnIndex) {
            case 0:
                return "Object " + list.get(rowIndex).getNumber();
            case 1:
                return list.get(rowIndex);
        }
        return null;
    }

    /**
     * @see javax.swing.JTable#getColumnName(int)
     */
    public String getColumnName(int columnIndex) {
        switch (columnIndex) {
            case 0:
                return "Object";
            case 1:
                return "Page";
            default:
                return null;
        }
    }

    /**
     * @see javax.swing.JTable#valueChanged(javax.swing.event.ListSelectionEvent)
     */
    @Override
    public void valueChanged(ListSelectionEvent evt) {
        if (evt != null) {
            super.valueChanged(evt);
        }
        if (controller == null) {
            return;
        }
        if (getRowCount() > 0) {
            controller.selectNode(list.get(getSelectedRow()));
            if (listener != null) {
                listener.gotoPage(getSelectedRow() + 1);
            }
        }
    }

}

        if (obj == null) {
            list = new ArrayList<>();
            repaint();
            return;
        }
        if (obj instanceof ObjectLoader) {
            ObjectLoader loader = (ObjectLoader) obj;
            String[] pagelabels = PdfPageLabels.getPageLabels(loader.getReader());
            int i = 0;
            TreeNodeFactory factory = loader.getNodes();
            PdfTrailerTreeNode trailer = controller.getPdfTree().getRoot();
            PdfObjectTreeNode catalog = factory.getChildNode(trailer, PdfName.ROOT);
            PdfPagesTreeNode pages = (PdfPagesTreeNode) factory.getChildNode(catalog, PdfName.PAGES);
            if (pages == null) {
                return;
            }
            Enumeration p = pages.depthFirstEnumeration();
            PdfObjectTreeNode child;
            StringBuffer buf;
            while (p.hasMoreElements()) {
                child = (PdfObjectTreeNode) p.nextElement();
                if (child instanceof PdfPageTreeNode) {
                    buf = new StringBuffer("Page ");
                    buf.append(++i);
                    if (pagelabels != null) {
                        buf.append(" ( ");
                        buf.append(pagelabels[i - 1]);
                        buf.append(" )");
                    }
                    child.setUserObject(buf.toString());
                    list.add((PdfPageTreeNode) child);
                }
            }
        }
        setModel(new JTableAutoModel(this));
    
<methods>public void <init>() ,public void <init>(javax.swing.table.TableModel) ,public void <init>(javax.swing.table.TableModel, javax.swing.table.TableColumnModel) ,public void <init>(int, int) ,public void <init>(Vector<? extends Vector#RAW>, Vector<?>) ,public void <init>(java.lang.Object[][], java.lang.Object[]) ,public void <init>(javax.swing.table.TableModel, javax.swing.table.TableColumnModel, javax.swing.ListSelectionModel) ,public void addColumn(javax.swing.table.TableColumn) ,public void addColumnSelectionInterval(int, int) ,public void addNotify() ,public void addRowSelectionInterval(int, int) ,public void changeSelection(int, int, boolean, boolean) ,public void clearSelection() ,public void columnAdded(javax.swing.event.TableColumnModelEvent) ,public int columnAtPoint(java.awt.Point) ,public void columnMarginChanged(javax.swing.event.ChangeEvent) ,public void columnMoved(javax.swing.event.TableColumnModelEvent) ,public void columnRemoved(javax.swing.event.TableColumnModelEvent) ,public void columnSelectionChanged(javax.swing.event.ListSelectionEvent) ,public int convertColumnIndexToModel(int) ,public int convertColumnIndexToView(int) ,public int convertRowIndexToModel(int) ,public int convertRowIndexToView(int) ,public void createDefaultColumnsFromModel() ,public static javax.swing.JScrollPane createScrollPaneForTable(javax.swing.JTable) ,public void doLayout() ,public boolean editCellAt(int, int) ,public boolean editCellAt(int, int, java.util.EventObject) ,public void editingCanceled(javax.swing.event.ChangeEvent) ,public void editingStopped(javax.swing.event.ChangeEvent) ,public javax.accessibility.AccessibleContext getAccessibleContext() ,public boolean getAutoCreateColumnsFromModel() ,public boolean getAutoCreateRowSorter() ,public int getAutoResizeMode() ,public javax.swing.table.TableCellEditor getCellEditor() ,public javax.swing.table.TableCellEditor getCellEditor(int, int) ,public java.awt.Rectangle getCellRect(int, int, boolean) ,public javax.swing.table.TableCellRenderer getCellRenderer(int, int) ,public boolean getCellSelectionEnabled() ,public javax.swing.table.TableColumn getColumn(java.lang.Object) ,public Class<?> getColumnClass(int) ,public int getColumnCount() ,public javax.swing.table.TableColumnModel getColumnModel() ,public java.lang.String getColumnName(int) ,public boolean getColumnSelectionAllowed() ,public javax.swing.table.TableCellEditor getDefaultEditor(Class<?>) ,public javax.swing.table.TableCellRenderer getDefaultRenderer(Class<?>) ,public boolean getDragEnabled() ,public final javax.swing.JTable.DropLocation getDropLocation() ,public final javax.swing.DropMode getDropMode() ,public int getEditingColumn() ,public int getEditingRow() ,public java.awt.Component getEditorComponent() ,public boolean getFillsViewportHeight() ,public java.awt.Color getGridColor() ,public java.awt.Dimension getIntercellSpacing() ,public javax.swing.table.TableModel getModel() ,public java.awt.Dimension getPreferredScrollableViewportSize() ,public java.awt.print.Printable getPrintable(javax.swing.JTable.PrintMode, java.text.MessageFormat, java.text.MessageFormat) ,public int getRowCount() ,public int getRowHeight() ,public int getRowHeight(int) ,public int getRowMargin() ,public boolean getRowSelectionAllowed() ,public RowSorter<? extends javax.swing.table.TableModel> getRowSorter() ,public int getScrollableBlockIncrement(java.awt.Rectangle, int, int) ,public boolean getScrollableTracksViewportHeight() ,public boolean getScrollableTracksViewportWidth() ,public int getScrollableUnitIncrement(java.awt.Rectangle, int, int) ,public int getSelectedColumn() ,public int getSelectedColumnCount() ,public int[] getSelectedColumns() ,public int getSelectedRow() ,public int getSelectedRowCount() ,public int[] getSelectedRows() ,public java.awt.Color getSelectionBackground() ,public java.awt.Color getSelectionForeground() ,public javax.swing.ListSelectionModel getSelectionModel() ,public boolean getShowHorizontalLines() ,public boolean getShowVerticalLines() ,public boolean getSurrendersFocusOnKeystroke() ,public javax.swing.table.JTableHeader getTableHeader() ,public java.lang.String getToolTipText(java.awt.event.MouseEvent) ,public javax.swing.plaf.TableUI getUI() ,public java.lang.String getUIClassID() ,public boolean getUpdateSelectionOnSort() ,public java.lang.Object getValueAt(int, int) ,public boolean isCellEditable(int, int) ,public boolean isCellSelected(int, int) ,public boolean isColumnSelected(int) ,public boolean isEditing() ,public boolean isRowSelected(int) ,public void moveColumn(int, int) ,public java.awt.Component prepareEditor(javax.swing.table.TableCellEditor, int, int) ,public java.awt.Component prepareRenderer(javax.swing.table.TableCellRenderer, int, int) ,public boolean print() throws java.awt.print.PrinterException,public boolean print(javax.swing.JTable.PrintMode) throws java.awt.print.PrinterException,public boolean print(javax.swing.JTable.PrintMode, java.text.MessageFormat, java.text.MessageFormat) throws java.awt.print.PrinterException,public boolean print(javax.swing.JTable.PrintMode, java.text.MessageFormat, java.text.MessageFormat, boolean, javax.print.attribute.PrintRequestAttributeSet, boolean) throws java.awt.print.PrinterException, java.awt.HeadlessException,public boolean print(javax.swing.JTable.PrintMode, java.text.MessageFormat, java.text.MessageFormat, boolean, javax.print.attribute.PrintRequestAttributeSet, boolean, javax.print.PrintService) throws java.awt.print.PrinterException, java.awt.HeadlessException,public void removeColumn(javax.swing.table.TableColumn) ,public void removeColumnSelectionInterval(int, int) ,public void removeEditor() ,public void removeNotify() ,public void removeRowSelectionInterval(int, int) ,public int rowAtPoint(java.awt.Point) ,public void selectAll() ,public void setAutoCreateColumnsFromModel(boolean) ,public void setAutoCreateRowSorter(boolean) ,public void setAutoResizeMode(int) ,public void setCellEditor(javax.swing.table.TableCellEditor) ,public void setCellSelectionEnabled(boolean) ,public void setColumnModel(javax.swing.table.TableColumnModel) ,public void setColumnSelectionAllowed(boolean) ,public void setColumnSelectionInterval(int, int) ,public void setDefaultEditor(Class<?>, javax.swing.table.TableCellEditor) ,public void setDefaultRenderer(Class<?>, javax.swing.table.TableCellRenderer) ,public void setDragEnabled(boolean) ,public final void setDropMode(javax.swing.DropMode) ,public void setEditingColumn(int) ,public void setEditingRow(int) ,public void setFillsViewportHeight(boolean) ,public void setGridColor(java.awt.Color) ,public void setIntercellSpacing(java.awt.Dimension) ,public void setModel(javax.swing.table.TableModel) ,public void setPreferredScrollableViewportSize(java.awt.Dimension) ,public void setRowHeight(int) ,public void setRowHeight(int, int) ,public void setRowMargin(int) ,public void setRowSelectionAllowed(boolean) ,public void setRowSelectionInterval(int, int) ,public void setRowSorter(RowSorter<? extends javax.swing.table.TableModel>) ,public void setSelectionBackground(java.awt.Color) ,public void setSelectionForeground(java.awt.Color) ,public void setSelectionMode(int) ,public void setSelectionModel(javax.swing.ListSelectionModel) ,public void setShowGrid(boolean) ,public void setShowHorizontalLines(boolean) ,public void setShowVerticalLines(boolean) ,public void setSurrendersFocusOnKeystroke(boolean) ,public void setTableHeader(javax.swing.table.JTableHeader) ,public void setUI(javax.swing.plaf.TableUI) ,public void setUpdateSelectionOnSort(boolean) ,public void setValueAt(java.lang.Object, int, int) ,public void sizeColumnsToFit(boolean) ,public void sizeColumnsToFit(int) ,public void sorterChanged(javax.swing.event.RowSorterEvent) ,public void tableChanged(javax.swing.event.TableModelEvent) ,public void updateUI() ,public void valueChanged(javax.swing.event.ListSelectionEvent) <variables>static final boolean $assertionsDisabled,public static final int AUTO_RESIZE_ALL_COLUMNS,public static final int AUTO_RESIZE_LAST_COLUMN,public static final int AUTO_RESIZE_NEXT_COLUMN,public static final int AUTO_RESIZE_OFF,public static final int AUTO_RESIZE_SUBSEQUENT_COLUMNS,protected boolean autoCreateColumnsFromModel,private boolean autoCreateRowSorter,protected int autoResizeMode,protected transient javax.swing.table.TableCellEditor cellEditor,protected boolean cellSelectionEnabled,protected javax.swing.table.TableColumnModel columnModel,private boolean columnSelectionAdjusting,protected javax.swing.table.TableModel dataModel,protected transient Hashtable<java.lang.Object,java.lang.Object> defaultEditorsByColumnClass,protected transient Hashtable<java.lang.Object,java.lang.Object> defaultRenderersByColumnClass,private boolean dragEnabled,private transient javax.swing.JTable.DropLocation dropLocation,private javax.swing.DropMode dropMode,protected transient int editingColumn,protected transient int editingRow,protected transient java.awt.Component editorComp,private java.beans.PropertyChangeListener editorRemover,private boolean fillsViewportHeight,protected java.awt.Color gridColor,private boolean ignoreSortChange,private boolean isRowHeightSet,protected java.awt.Dimension preferredViewportSize,private java.lang.Throwable printError,protected int rowHeight,protected int rowMargin,private javax.swing.SizeSequence rowModel,private boolean rowSelectionAdjusting,protected boolean rowSelectionAllowed,protected java.awt.Color selectionBackground,protected java.awt.Color selectionForeground,protected javax.swing.ListSelectionModel selectionModel,protected boolean showHorizontalLines,protected boolean showVerticalLines,private transient javax.swing.JTable.SortManager sortManager,private boolean sorterChanged,private boolean surrendersFocusOnKeystroke,protected javax.swing.table.JTableHeader tableHeader,private static final java.lang.String uiClassID,private transient boolean updateInProgress,private boolean updateSelectionOnSort