//# 6 errors, 226 messages
//#
/*
    //#PackingTable.java:1:1: class: com.dmdirc.addons.ui_swing.components.PackingTable
    //#PackingTable.java:1:1: method: com.dmdirc.addons.ui_swing.components.PackingTable.com.dmdirc.addons.ui_swing.components.PackingTable__static_init
 * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

package com.dmdirc.addons.ui_swing.components;

import java.awt.Graphics;

import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableColumn;
import javax.swing.table.TableColumnModel;
import javax.swing.table.TableModel;
import net.miginfocom.layout.PlatformDefaults;

/**
 * Creates a new table that automatically sizes its columns to the size of its
 * data.
 */
public class PackingTable extends JTable {

    /**
     * A version number for this class. It should be changed whenever the class
     * structure is changed (or anything else that would prevent serialized
     * objects being unserialized with the new class).
     */
    private static final long serialVersionUID = 1;
    /** Whether the table should be editable. */
    private final boolean editable;
    /** Scrollpane. */
    private final JScrollPane scrollPane;
    /** Should the last column fit text (true), or fit viewport (false). */
    private boolean lastColumnFit;
    /** Border padding. */
    private final int padding = (int) PlatformDefaults.getUnitValueX("related").
    //#PackingTable.java:54: Warning: method not available - call not analyzed
    //#    call on UnitValue net.miginfocom.layout.PlatformDefaults:getUnitValueX(String)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.PackingTable
    //#    method: void com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane, bool)
    //#    unanalyzed callee: UnitValue net.miginfocom.layout.PlatformDefaults:getUnitValueX(String)
    //#PackingTable.java:54: Warning: method not available - call not analyzed
    //#    call on float net.miginfocom.layout.UnitValue:getValue()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.PackingTable
    //#    method: void com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane, bool)
    //#    unanalyzed callee: float net.miginfocom.layout.UnitValue:getValue()
            getValue();
    
    /**
     * Creates a new packing table.
     *
     * @param rows Row data
     * @param cols Column data
     * @param editable Whether the table should be editable or not
     * @param scrollPane Scrollpane parent
     */
    public PackingTable(final Object[][] rows, final Object[] cols,
            final boolean editable, final JScrollPane scrollPane) {
        this(new DefaultTableModel(rows, cols), editable, scrollPane, true);
    //#PackingTable.java:67: method: void com.dmdirc.addons.ui_swing.components.PackingTable.com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane)
    //#input(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane)): cols
    //#input(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane)): editable
    //#input(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane)): rows
    //#input(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane)): scrollPane
    //#input(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane)): this
    //#output(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane)): this.editable
    //#output(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane)): this.lastColumnFit
    //#output(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane)): this.padding
    //#output(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane)): this.scrollPane
    //#presumption(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane)): (int) (net.miginfocom.layout.UnitValue:getValue(...)@54) in {-2_147_483_648..4_294_967_295}
    //#post(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane)): this.editable == editable
    //#post(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane)): init'ed(this.editable)
    //#post(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane)): this.lastColumnFit == 1
    //#post(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane)): init'ed(this.padding)
    //#post(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane)): this.scrollPane == scrollPane
    //#post(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane)): init'ed(this.scrollPane)
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane)): Effects-of-calling:javax.swing.JTable
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane)): Effects-of-calling:net.miginfocom.layout.PlatformDefaults:getUnitValueX
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane)): Effects-of-calling:net.miginfocom.layout.UnitValue:getValue
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane)): Effects-of-calling:javax.swing.JTable:setAutoResizeMode
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane)): Effects-of-calling:javax.swing.JTable:getTableHeader
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane)): Effects-of-calling:javax.swing.table.JTableHeader:setResizingAllowed
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane)): Effects-of-calling:javax.swing.table.JTableHeader:setReorderingAllowed
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane)): Effects-of-calling:javax.swing.JTable:setDragEnabled
    }
    //#PackingTable.java:68: end of method: void com.dmdirc.addons.ui_swing.components.PackingTable.com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane)

    /**
     * Creates a new packing table.
     *
     * @param rows Row data
     * @param cols Column data
     * @param editable Whether the table should be editable or not
     * @param scrollPane Scrollpane parent
     * @param lastColumnFit Should the last column fit text (true), or fit viewport (false).
     */
    public PackingTable(final Object[][] rows, final Object[] cols,
            final boolean editable, final JScrollPane scrollPane,
            final boolean lastColumnFit) {
        this(new DefaultTableModel(rows, cols), editable, scrollPane,
    //#PackingTable.java:82: method: void com.dmdirc.addons.ui_swing.components.PackingTable.com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane, bool)
    //#input(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane, bool)): cols
    //#input(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane, bool)): editable
    //#input(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane, bool)): lastColumnFit
    //#input(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane, bool)): rows
    //#input(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane, bool)): scrollPane
    //#input(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane, bool)): this
    //#output(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane, bool)): this.editable
    //#output(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane, bool)): this.lastColumnFit
    //#output(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane, bool)): this.padding
    //#output(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane, bool)): this.scrollPane
    //#presumption(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane, bool)): (int) (net.miginfocom.layout.UnitValue:getValue(...)@54) in {-2_147_483_648..4_294_967_295}
    //#post(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane, bool)): this.editable == editable
    //#post(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane, bool)): init'ed(this.editable)
    //#post(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane, bool)): this.lastColumnFit == lastColumnFit
    //#post(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane, bool)): init'ed(this.lastColumnFit)
    //#post(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane, bool)): init'ed(this.padding)
    //#post(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane, bool)): this.scrollPane == scrollPane
    //#post(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane, bool)): init'ed(this.scrollPane)
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane, bool)): Effects-of-calling:javax.swing.JTable
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane, bool)): Effects-of-calling:net.miginfocom.layout.PlatformDefaults:getUnitValueX
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane, bool)): Effects-of-calling:net.miginfocom.layout.UnitValue:getValue
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane, bool)): Effects-of-calling:javax.swing.JTable:setAutoResizeMode
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane, bool)): Effects-of-calling:javax.swing.JTable:getTableHeader
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane, bool)): Effects-of-calling:javax.swing.table.JTableHeader:setResizingAllowed
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane, bool)): Effects-of-calling:javax.swing.table.JTableHeader:setReorderingAllowed
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane, bool)): Effects-of-calling:javax.swing.JTable:setDragEnabled
                lastColumnFit);
    }
    //#PackingTable.java:84: end of method: void com.dmdirc.addons.ui_swing.components.PackingTable.com.dmdirc.addons.ui_swing.components.PackingTable(Object[][], Object[], bool, JScrollPane, bool)
    
    /**
     * Creates a new packing table.
     *
     * @param tableModel Table data model
     * @param editable Whether the table should be editable or not
     * @param scrollPane Scrollpane parent
     */
    public PackingTable(final TableModel tableModel, final boolean editable,
            final JScrollPane scrollPane) {
        this(tableModel, editable, scrollPane, true);
    //#PackingTable.java:95: method: void com.dmdirc.addons.ui_swing.components.PackingTable.com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane)
    //#input(void com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane)): editable
    //#input(void com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane)): scrollPane
    //#input(void com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane)): tableModel
    //#input(void com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane)): this
    //#output(void com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane)): this.editable
    //#output(void com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane)): this.lastColumnFit
    //#output(void com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane)): this.padding
    //#output(void com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane)): this.scrollPane
    //#presumption(void com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane)): (int) (net.miginfocom.layout.UnitValue:getValue(...)@54) in {-2_147_483_648..4_294_967_295}
    //#post(void com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane)): this.editable == editable
    //#post(void com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane)): init'ed(this.editable)
    //#post(void com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane)): this.lastColumnFit == 1
    //#post(void com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane)): init'ed(this.padding)
    //#post(void com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane)): this.scrollPane == scrollPane
    //#post(void com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane)): init'ed(this.scrollPane)
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane)): Effects-of-calling:javax.swing.JTable
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane)): Effects-of-calling:net.miginfocom.layout.PlatformDefaults:getUnitValueX
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane)): Effects-of-calling:net.miginfocom.layout.UnitValue:getValue
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane)): Effects-of-calling:javax.swing.JTable:setAutoResizeMode
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane)): Effects-of-calling:javax.swing.JTable:getTableHeader
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane)): Effects-of-calling:javax.swing.table.JTableHeader:setResizingAllowed
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane)): Effects-of-calling:javax.swing.table.JTableHeader:setReorderingAllowed
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane)): Effects-of-calling:javax.swing.JTable:setDragEnabled
    }
    //#PackingTable.java:96: end of method: void com.dmdirc.addons.ui_swing.components.PackingTable.com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane)

    /**
     * Creates a new packing table.
     *
     * @param tableModel Table data model
     * @param editable Whether the table should be editable or not
     * @param scrollPane Scrollpane parent
     * @param lastColumnFit Should the last column fit text (true), or fit viewport (false).
     */
    public PackingTable(final TableModel tableModel, final boolean editable,
            final JScrollPane scrollPane, final boolean lastColumnFit) {
        super(tableModel);
    //#PackingTable.java:108: method: void com.dmdirc.addons.ui_swing.components.PackingTable.com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane, bool)
    //#input(void com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane, bool)): editable
    //#input(void com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane, bool)): lastColumnFit
    //#input(void com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane, bool)): scrollPane
    //#input(void com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane, bool)): tableModel
    //#input(void com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane, bool)): this
    //#output(void com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane, bool)): this.editable
    //#output(void com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane, bool)): this.lastColumnFit
    //#output(void com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane, bool)): this.padding
    //#output(void com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane, bool)): this.scrollPane
    //#presumption(void com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane, bool)): (int) (net.miginfocom.layout.UnitValue:getValue(...)@54) in {-2_147_483_648..4_294_967_295}
    //#presumption(void com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane, bool)): javax.swing.JTable:getTableHeader(...)@115 != null
    //#presumption(void com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane, bool)): javax.swing.JTable:getTableHeader(...)@116 != null
    //#presumption(void com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane, bool)): net.miginfocom.layout.PlatformDefaults:getUnitValueX(...)@54 != null
    //#post(void com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane, bool)): this.editable == editable
    //#post(void com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane, bool)): init'ed(this.editable)
    //#post(void com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane, bool)): this.lastColumnFit == lastColumnFit
    //#post(void com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane, bool)): init'ed(this.lastColumnFit)
    //#post(void com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane, bool)): init'ed(this.padding)
    //#post(void com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane, bool)): this.scrollPane == scrollPane
    //#post(void com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane, bool)): init'ed(this.scrollPane)

        this.editable = editable;
        this.scrollPane = scrollPane;
        this.lastColumnFit = lastColumnFit;

        super.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
        super.getTableHeader().setResizingAllowed(false);
        super.getTableHeader().setReorderingAllowed(false);
        super.setDragEnabled(false);
    }
    //#PackingTable.java:118: end of method: void com.dmdirc.addons.ui_swing.components.PackingTable.com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane, bool)

    /** {@inheritDoc} */
    @Override
    public void setAutoResizeMode(final int mode) {
    //Ignore
    }
    //#PackingTable.java:124: method: void com.dmdirc.addons.ui_swing.components.PackingTable.setAutoResizeMode(int)
    //#PackingTable.java:124: end of method: void com.dmdirc.addons.ui_swing.components.PackingTable.setAutoResizeMode(int)

    /** {@inheritDoc} */
    @Override
    public final boolean getScrollableTracksViewportHeight() {
        return getPreferredSize().height < getParent().getHeight();
    //#PackingTable.java:129: method: bool com.dmdirc.addons.ui_swing.components.PackingTable.getScrollableTracksViewportHeight()
    //#PackingTable.java:129: Warning: method not available - call not analyzed
    //#    call on Dimension com.dmdirc.addons.ui_swing.components.PackingTable:getPreferredSize()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.PackingTable
    //#    method: bool getScrollableTracksViewportHeight()
    //#    unanalyzed callee: Dimension com.dmdirc.addons.ui_swing.components.PackingTable:getPreferredSize()
    //#PackingTable.java:129: Warning: method not available - call not analyzed
    //#    call on Container com.dmdirc.addons.ui_swing.components.PackingTable:getParent()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.PackingTable
    //#    method: bool getScrollableTracksViewportHeight()
    //#    unanalyzed callee: Container com.dmdirc.addons.ui_swing.components.PackingTable:getParent()
    //#input(bool getScrollableTracksViewportHeight()): this
    //#output(bool getScrollableTracksViewportHeight()): return_value
    //#presumption(bool getScrollableTracksViewportHeight()): com.dmdirc.addons.ui_swing.components.PackingTable:getParent(...)@129 != null
    //#presumption(bool getScrollableTracksViewportHeight()): com.dmdirc.addons.ui_swing.components.PackingTable:getPreferredSize(...)@129 != null
    //#post(bool getScrollableTracksViewportHeight()): init'ed(return_value)
    //#PackingTable.java:129: end of method: bool com.dmdirc.addons.ui_swing.components.PackingTable.getScrollableTracksViewportHeight()
    }

    /** {@inheritDoc} */
    @Override
    public final void paint(final Graphics g) {
        packColumns();
    //#PackingTable.java:135: method: void com.dmdirc.addons.ui_swing.components.PackingTable.paint(Graphics)
    //#input(void paint(Graphics)): g
    //#input(void paint(Graphics)): this
    //#input(void paint(Graphics)): this.lastColumnFit
    //#input(void paint(Graphics)): this.padding
    //#input(void paint(Graphics)): this.scrollPane
    //#pre[3] (void paint(Graphics)): (soft) init'ed(this.lastColumnFit)
    //#pre[5] (void paint(Graphics)): (soft) this.scrollPane != null
    //#unanalyzed(void paint(Graphics)): Effects-of-calling:com.dmdirc.addons.ui_swing.components.PackingTable:getColumnCount
    //#unanalyzed(void paint(Graphics)): Effects-of-calling:com.dmdirc.addons.ui_swing.components.PackingTable:getColumnModel
    //#unanalyzed(void paint(Graphics)): Effects-of-calling:javax.swing.table.TableColumnModel:getColumn
    //#unanalyzed(void paint(Graphics)): Effects-of-calling:com.dmdirc.addons.ui_swing.components.PackingTable:getTableHeader
    //#unanalyzed(void paint(Graphics)): Effects-of-calling:javax.swing.table.JTableHeader:getDefaultRenderer
    //#unanalyzed(void paint(Graphics)): Effects-of-calling:javax.swing.table.TableColumn:getIdentifier
    //#unanalyzed(void paint(Graphics)): Effects-of-calling:javax.swing.table.TableCellRenderer:getTableCellRendererComponent
    //#unanalyzed(void paint(Graphics)): Effects-of-calling:java.awt.Component:getPreferredSize
    //#unanalyzed(void paint(Graphics)): Effects-of-calling:java.awt.Dimension:getWidth
    //#unanalyzed(void paint(Graphics)): Effects-of-calling:com.dmdirc.addons.ui_swing.components.PackingTable:getRowCount
    //#unanalyzed(void paint(Graphics)): Effects-of-calling:com.dmdirc.addons.ui_swing.components.PackingTable:getCellRenderer
    //#unanalyzed(void paint(Graphics)): Effects-of-calling:com.dmdirc.addons.ui_swing.components.PackingTable:getValueAt
    //#unanalyzed(void paint(Graphics)): Effects-of-calling:java.lang.Math:max
    //#unanalyzed(void paint(Graphics)): Effects-of-calling:com.dmdirc.addons.ui_swing.components.PackingTable:isShowing
    //#unanalyzed(void paint(Graphics)): Effects-of-calling:javax.swing.table.JTableHeader:getColumnModel
    //#unanalyzed(void paint(Graphics)): Effects-of-calling:javax.swing.table.TableColumnModel:getColumnCount
    //#unanalyzed(void paint(Graphics)): Effects-of-calling:javax.swing.JScrollPane:getViewportBorderBounds
    //#unanalyzed(void paint(Graphics)): Effects-of-calling:javax.swing.table.TableColumn:setPreferredWidth
        super.paint(g);
    }
    //#PackingTable.java:137: end of method: void com.dmdirc.addons.ui_swing.components.PackingTable.paint(Graphics)

    /** Packs the columns to their width. */
    public final void packColumns() {
        if (!isShowing()) {
    //#PackingTable.java:141: method: void com.dmdirc.addons.ui_swing.components.PackingTable.packColumns()
    //#PackingTable.java:141: Warning: method not available - call not analyzed
    //#    call on bool com.dmdirc.addons.ui_swing.components.PackingTable:isShowing()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.PackingTable
    //#    method: void packColumns()
    //#    unanalyzed callee: bool com.dmdirc.addons.ui_swing.components.PackingTable:isShowing()
    //#input(void packColumns()): this
    //#input(void packColumns()): this.lastColumnFit
    //#input(void packColumns()): this.padding
    //#input(void packColumns()): this.scrollPane
    //#pre[2] (void packColumns()): (soft) init'ed(this.lastColumnFit)
    //#pre[4] (void packColumns()): (soft) this.scrollPane != null
    //#presumption(void packColumns()): com.dmdirc.addons.ui_swing.components.PackingTable:getTableHeader(...)@149 != null
    //#presumption(void packColumns()): javax.swing.JScrollPane:getViewportBorderBounds(...)@151 != null
    //#presumption(void packColumns()): javax.swing.table.JTableHeader:getColumnModel(...)@149 != null
    //#presumption(void packColumns()): javax.swing.table.TableColumnModel:getColumn(...)@170 != null
    //#presumption(void packColumns()): javax.swing.table.TableColumnModel:getColumnCount(...)@150 >= 1
    //#unanalyzed(void packColumns()): Effects-of-calling:com.dmdirc.addons.ui_swing.components.PackingTable:getColumnCount
    //#unanalyzed(void packColumns()): Effects-of-calling:com.dmdirc.addons.ui_swing.components.PackingTable:getColumnModel
    //#unanalyzed(void packColumns()): Effects-of-calling:javax.swing.table.TableColumnModel:getColumn
    //#unanalyzed(void packColumns()): Effects-of-calling:com.dmdirc.addons.ui_swing.components.PackingTable:getTableHeader
    //#unanalyzed(void packColumns()): Effects-of-calling:javax.swing.table.JTableHeader:getDefaultRenderer
    //#unanalyzed(void packColumns()): Effects-of-calling:javax.swing.table.TableColumn:getIdentifier
    //#unanalyzed(void packColumns()): Effects-of-calling:javax.swing.table.TableCellRenderer:getTableCellRendererComponent
    //#unanalyzed(void packColumns()): Effects-of-calling:java.awt.Component:getPreferredSize
    //#unanalyzed(void packColumns()): Effects-of-calling:java.awt.Dimension:getWidth
    //#unanalyzed(void packColumns()): Effects-of-calling:com.dmdirc.addons.ui_swing.components.PackingTable:getRowCount
    //#unanalyzed(void packColumns()): Effects-of-calling:com.dmdirc.addons.ui_swing.components.PackingTable:getCellRenderer
    //#unanalyzed(void packColumns()): Effects-of-calling:com.dmdirc.addons.ui_swing.components.PackingTable:getValueAt
    //#unanalyzed(void packColumns()): Effects-of-calling:java.lang.Math:max
    //#test_vector(void packColumns()): this.lastColumnFit: {1}, {0}
    //#test_vector(void packColumns()): com.dmdirc.addons.ui_swing.components.PackingTable:getColumnCount(...)@145: {-2_147_483_648..-1, 1..4_294_967_295}, {0}
    //#test_vector(void packColumns()): com.dmdirc.addons.ui_swing.components.PackingTable:isShowing(...)@141: {1}, {0}
            return;
        }

        if (getColumnCount() == 0) {
    //#PackingTable.java:145: Warning: method not available - call not analyzed
    //#    call on int com.dmdirc.addons.ui_swing.components.PackingTable:getColumnCount()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.PackingTable
    //#    method: void packColumns()
    //#    unanalyzed callee: int com.dmdirc.addons.ui_swing.components.PackingTable:getColumnCount()
            return;
        }

        final TableColumnModel myColumnModel = getTableHeader().getColumnModel();
    //#PackingTable.java:149: Warning: method not available - call not analyzed
    //#    call on JTableHeader com.dmdirc.addons.ui_swing.components.PackingTable:getTableHeader()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.PackingTable
    //#    method: void packColumns()
    //#    unanalyzed callee: JTableHeader com.dmdirc.addons.ui_swing.components.PackingTable:getTableHeader()
        final int numCols = myColumnModel.getColumnCount();
        final int totalSize = scrollPane.getViewportBorderBounds().width;
        final int[] widths = new int[numCols];
        int widthsTotal = 0;

        int checkNumCols = numCols;
        if (!lastColumnFit) {
            checkNumCols--;
        }
        for (int i = 0; i < checkNumCols; i++) { //NOPMD im not copying a damn array fgs
            widths[i] = getWidth(i);
            widthsTotal += widths[i];
    //#PackingTable.java:161: ?overflow
    //#    widthsTotal + widths[i] in {-2_147_483_648..4_294_967_295}
    //#    severity: SUPPRESSED
    //#    class: com.dmdirc.addons.ui_swing.components.PackingTable
    //#    method: void packColumns()
    //#    basic block: bb_9
    //#    assertion: widthsTotal + widths[i] in {-2_147_483_648..4_294_967_295}
    //#    VN: getWidth(...) + widthsTotal
    //#    Expected: {-2_147_483_648..4_294_967_295, Invalid}
    //#    Bad: {-4_294_967_296..-2_147_483_649, 4_294_967_296..8_589_934_590}
    //#    Attribs:  Int  Bad < Exp  Bad > Exp
        }

        final int extra = totalSize - widthsTotal;
    //#PackingTable.java:164: ?overflow
    //#    totalSize - widthsTotal in {-2_147_483_648..4_294_967_295}
    //#    severity: SUPPRESSED
    //#    class: com.dmdirc.addons.ui_swing.components.PackingTable
    //#    method: void packColumns()
    //#    basic block: bb_10
    //#    assertion: totalSize - widthsTotal in {-2_147_483_648..4_294_967_295}
    //#    VN: -(widthsTotal - javax.swing.JScrollPane:getViewportBorderBounds(...).width@151)
    //#    Expected: {-2_147_483_648..4_294_967_295, Invalid}
    //#    Bad: {-6_442_450_943..-2_147_483_649, 4_294_967_296..6_442_450_943}
    //#    Attribs:  Int  Bad < Exp  Bad > Exp
        if (extra > 0) {
            widths[numCols - 1] += extra;
    //#PackingTable.java:166: ?use of default init
    //#    init'ed(widths[(numCols - 1)])
    //#    severity: LOW
    //#    class: com.dmdirc.addons.ui_swing.components.PackingTable
    //#    method: void packColumns()
    //#    basic block: bb_11
    //#    assertion: init'ed(widths[(numCols - 1)])
    //#    VN: widths[numCols - 1]
    //#    Expected: {-Inf..+Inf}
    //#    Bad: {Invalid}
    //#    Attribs:  Int  Bad only invalid
    //#PackingTable.java:166: ?overflow
    //#    widths[(numCols - 1)] + extra in {-2_147_483_648..4_294_967_295}
    //#    severity: SUPPRESSED
    //#    class: com.dmdirc.addons.ui_swing.components.PackingTable
    //#    method: void packColumns()
    //#    basic block: bb_11
    //#    assertion: widths[(numCols - 1)] + extra in {-2_147_483_648..4_294_967_295}
    //#    VN: widths[numCols - 1] - (widthsTotal - javax.swing.JScrollPane:getViewportBorderBounds(...).width@151)
    //#    Expected: {-2_147_483_648..4_294_967_295, Invalid}
    //#    Bad: {4_294_967_296..8_589_934_590}
    //#    Attribs:  Int  Bad > Exp
        }

        for (int i = 0; i < numCols; i++) {
            final TableColumn col = myColumnModel.getColumn(i);
            col.setPreferredWidth(widths[i]);
    //#PackingTable.java:171: ?use of default init
    //#    init'ed(widths[i])
    //#    severity: LOW
    //#    class: com.dmdirc.addons.ui_swing.components.PackingTable
    //#    method: void packColumns()
    //#    basic block: bb_14
    //#    assertion: init'ed(widths[i])
    //#    VN: widths[i]
    //#    Expected: {-Inf..+Inf}
    //#    Bad: {Invalid}
    //#    Attribs:  Int  Bad only invalid
        }

    }
    //#PackingTable.java:174: end of method: void com.dmdirc.addons.ui_swing.components.PackingTable.packColumns()

    /**
     * Returns the width of a column.
     *
     * @param col Column to retrieve width for
     *
     * @return Width of the specified column
     */
    private int getWidth(final int col) {
        if (getColumnCount() == 0) {
    //#PackingTable.java:184: method: int com.dmdirc.addons.ui_swing.components.PackingTable.getWidth(int)
    //#PackingTable.java:184: Warning: method not available - call not analyzed
    //#    call on int com.dmdirc.addons.ui_swing.components.PackingTable:getColumnCount()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.PackingTable
    //#    method: int getWidth(int)
    //#    unanalyzed callee: int com.dmdirc.addons.ui_swing.components.PackingTable:getColumnCount()
    //#input(int getWidth(int)): col
    //#input(int getWidth(int)): this
    //#input(int getWidth(int)): this.padding
    //#output(int getWidth(int)): return_value
    //#presumption(int getWidth(int)): (int) (java.awt.Dimension:getWidth(...)@192) in {-2_147_483_648..4_294_967_295}
    //#presumption(int getWidth(int)): (int) (java.awt.Dimension:getWidth(...)@202) in {-2_147_483_648..4_294_967_295}
    //#presumption(int getWidth(int)): com.dmdirc.addons.ui_swing.components.PackingTable:getCellRenderer(...)@202 != null
    //#presumption(int getWidth(int)): com.dmdirc.addons.ui_swing.components.PackingTable:getColumnModel(...)@191 != null
    //#presumption(int getWidth(int)): com.dmdirc.addons.ui_swing.components.PackingTable:getTableHeader(...)@192 != null
    //#presumption(int getWidth(int)): java.awt.Component:getPreferredSize(...)@192 != null
    //#presumption(int getWidth(int)): java.awt.Component:getPreferredSize(...)@202 != null
    //#presumption(int getWidth(int)): javax.swing.table.JTableHeader:getDefaultRenderer(...)@192 != null
    //#presumption(int getWidth(int)): javax.swing.table.TableCellRenderer:getTableCellRendererComponent(...)@192 != null
    //#presumption(int getWidth(int)): javax.swing.table.TableCellRenderer:getTableCellRendererComponent(...)@202 != null
    //#presumption(int getWidth(int)): javax.swing.table.TableColumnModel:getColumn(...)@191 != null
    //#presumption(int getWidth(int)): this.padding + (int) (java.awt.Dimension:getWidth(...)@192) in {-2_147_483_648..4_294_967_295}
    //#post(int getWidth(int)): init'ed(return_value)
    //#test_vector(int getWidth(int)): com.dmdirc.addons.ui_swing.components.PackingTable:getCellRenderer(...)@201: Addr_Set{null}, Inverse{null}
    //#test_vector(int getWidth(int)): com.dmdirc.addons.ui_swing.components.PackingTable:getColumnCount(...)@184: {-2_147_483_648..-1, 1..4_294_967_295}, {0}
    //#test_vector(int getWidth(int)): com.dmdirc.addons.ui_swing.components.PackingTable:getRowCount(...)@196: {-2_147_483_648..-1, 1..4_294_967_295}, {0}
            return 0;
        }
        if (getColumnCount() <= col) {
    //#PackingTable.java:187: Warning: method not available - call not analyzed
    //#    call on int com.dmdirc.addons.ui_swing.components.PackingTable:getColumnCount()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.PackingTable
    //#    method: int getWidth(int)
    //#    unanalyzed callee: int com.dmdirc.addons.ui_swing.components.PackingTable:getColumnCount()
            return 0;
        }

        final TableColumn column = getColumnModel().getColumn(col);
    //#PackingTable.java:191: Warning: method not available - call not analyzed
    //#    call on TableColumnModel com.dmdirc.addons.ui_swing.components.PackingTable:getColumnModel()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.PackingTable
    //#    method: int getWidth(int)
    //#    unanalyzed callee: TableColumnModel com.dmdirc.addons.ui_swing.components.PackingTable:getColumnModel()
        int width = (int) getTableHeader().getDefaultRenderer().
    //#PackingTable.java:192: Warning: method not available - call not analyzed
    //#    call on JTableHeader com.dmdirc.addons.ui_swing.components.PackingTable:getTableHeader()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.PackingTable
    //#    method: int getWidth(int)
    //#    unanalyzed callee: JTableHeader com.dmdirc.addons.ui_swing.components.PackingTable:getTableHeader()
                getTableCellRendererComponent(this, column.getIdentifier(),
                false, false, -1, col).getPreferredSize().getWidth();

        if (getRowCount() == 0) {
    //#PackingTable.java:196: Warning: method not available - call not analyzed
    //#    call on int com.dmdirc.addons.ui_swing.components.PackingTable:getRowCount()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.PackingTable
    //#    method: int getWidth(int)
    //#    unanalyzed callee: int com.dmdirc.addons.ui_swing.components.PackingTable:getRowCount()
            return width + padding;
        }

        for (int row = 0; row < getRowCount(); row++) {
    //#PackingTable.java:200: Warning: method not available - call not analyzed
    //#    call on int com.dmdirc.addons.ui_swing.components.PackingTable:getRowCount()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.PackingTable
    //#    method: int getWidth(int)
    //#    unanalyzed callee: int com.dmdirc.addons.ui_swing.components.PackingTable:getRowCount()
            if (getCellRenderer(row, col) != null) {
    //#PackingTable.java:201: Warning: method not available - call not analyzed
    //#    call on TableCellRenderer com.dmdirc.addons.ui_swing.components.PackingTable:getCellRenderer(int, int)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.PackingTable
    //#    method: int getWidth(int)
    //#    unanalyzed callee: TableCellRenderer com.dmdirc.addons.ui_swing.components.PackingTable:getCellRenderer(int, int)
                width = Math.max(width, (int) getCellRenderer(row, col).
    //#PackingTable.java:202: Warning: method not available - call not analyzed
    //#    call on TableCellRenderer com.dmdirc.addons.ui_swing.components.PackingTable:getCellRenderer(int, int)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.PackingTable
    //#    method: int getWidth(int)
    //#    unanalyzed callee: TableCellRenderer com.dmdirc.addons.ui_swing.components.PackingTable:getCellRenderer(int, int)
    //#PackingTable.java:202: Warning: method not available - call not analyzed
    //#    call on Object com.dmdirc.addons.ui_swing.components.PackingTable:getValueAt(int, int)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.PackingTable
    //#    method: int getWidth(int)
    //#    unanalyzed callee: Object com.dmdirc.addons.ui_swing.components.PackingTable:getValueAt(int, int)
                        getTableCellRendererComponent(this, getValueAt(row,
                        col), false, false, row, col).getPreferredSize().
                        getWidth());
            }
        }

        return width + padding;
    //#PackingTable.java:209: ?overflow
    //#    width + this.padding in {-2_147_483_648..4_294_967_295}
    //#    severity: SUPPRESSED
    //#    class: com.dmdirc.addons.ui_swing.components.PackingTable
    //#    method: int getWidth(int)
    //#    basic block: bb_12
    //#    assertion: width + this.padding in {-2_147_483_648..4_294_967_295}
    //#    VN: this.padding + width
    //#    Expected: {-2_147_483_648..4_294_967_295, Invalid}
    //#    Bad: {-4_294_967_296..-2_147_483_649, 4_294_967_296..8_589_934_590}
    //#    Attribs:  Int  Bad < Exp  Bad > Exp
    //#PackingTable.java:209: end of method: int com.dmdirc.addons.ui_swing.components.PackingTable.getWidth(int)
    }
}
    //#output(com.dmdirc.addons.ui_swing.components.PackingTable__static_init): __Descendant_Table[com/dmdirc/addons/ui_swing/components/PackingTable]
    //#output(com.dmdirc.addons.ui_swing.components.PackingTable__static_init): __Dispatch_Table.getScrollableTracksViewportHeight()Z
    //#output(com.dmdirc.addons.ui_swing.components.PackingTable__static_init): __Dispatch_Table.getWidth(I)I
    //#output(com.dmdirc.addons.ui_swing.components.PackingTable__static_init): __Dispatch_Table.packColumns()V
    //#output(com.dmdirc.addons.ui_swing.components.PackingTable__static_init): __Dispatch_Table.paint(Ljava/awt/Graphics;)V
    //#output(com.dmdirc.addons.ui_swing.components.PackingTable__static_init): __Dispatch_Table.setAutoResizeMode(I)V
    //#post(com.dmdirc.addons.ui_swing.components.PackingTable__static_init): __Descendant_Table[com/dmdirc/addons/ui_swing/components/PackingTable] == &__Dispatch_Table
    //#post(com.dmdirc.addons.ui_swing.components.PackingTable__static_init): __Dispatch_Table.getScrollableTracksViewportHeight()Z == &getScrollableTracksViewportHeight
    //#post(com.dmdirc.addons.ui_swing.components.PackingTable__static_init): __Dispatch_Table.getWidth(I)I == &getWidth
    //#post(com.dmdirc.addons.ui_swing.components.PackingTable__static_init): __Dispatch_Table.packColumns()V == &packColumns
    //#post(com.dmdirc.addons.ui_swing.components.PackingTable__static_init): __Dispatch_Table.paint(Ljava/awt/Graphics;)V == &paint
    //#post(com.dmdirc.addons.ui_swing.components.PackingTable__static_init): __Dispatch_Table.setAutoResizeMode(I)V == &setAutoResizeMode
    //#PackingTable.java:: end of method: com.dmdirc.addons.ui_swing.components.PackingTable.com.dmdirc.addons.ui_swing.components.PackingTable__static_init
    //#PackingTable.java:: end of class: com.dmdirc.addons.ui_swing.components.PackingTable
