//# 2 errors, 294 messages
//#
/*
    //#NickColourPanel.java:1:1: class: com.dmdirc.addons.nickcolours.NickColourPanel$1
    //#NickColourPanel.java:1:1: method: com.dmdirc.addons.nickcolours.NickColourPanel$1.com.dmdirc.addons.nickcolours.NickColourPanel$1__static_init
    //#NickColourPanel.java:1:1: class: com.dmdirc.addons.nickcolours.NickColourPanel
 * 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.nickcolours;

import com.dmdirc.addons.ui_swing.dialogs.prefs.SwingPreferencesDialog;
import com.dmdirc.config.IdentityManager;
import com.dmdirc.config.prefs.PreferencesInterface;

import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
import java.util.Vector;
import javax.swing.JButton;

import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableCellRenderer;
import net.miginfocom.swing.MigLayout;

/**
 * Panel used for the custom nick colour settings component in the plugin's
 * config dialog.
 *
 * @author Chris
 */
public class NickColourPanel extends JPanel implements ActionListener,
        PreferencesInterface {

    /**
     * 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;
    /** The table used for displaying the options. */
    private final JTable table;
    /** The plugin we're associated with. */
    private final transient NickColourPlugin plugin;
    /** The table headings. */
    private static final String[] headers = {"Network", "Nickname",
    //#NickColourPanel.java:64: method: com.dmdirc.addons.nickcolours.NickColourPanel.com.dmdirc.addons.nickcolours.NickColourPanel__static_init
    //#output(com.dmdirc.addons.nickcolours.NickColourPanel__static_init): __Descendant_Table[com/dmdirc/addons/nickcolours/NickColourPanel]
    //#output(com.dmdirc.addons.nickcolours.NickColourPanel__static_init): __Dispatch_Table.actionPerformed(Ljava/awt/event/ActionEvent;)V
    //#output(com.dmdirc.addons.nickcolours.NickColourPanel__static_init): __Dispatch_Table.addRow(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
    //#output(com.dmdirc.addons.nickcolours.NickColourPanel__static_init): __Dispatch_Table.getData()Ljava/util/List;
    //#output(com.dmdirc.addons.nickcolours.NickColourPanel__static_init): __Dispatch_Table.removeRow(I)V
    //#output(com.dmdirc.addons.nickcolours.NickColourPanel__static_init): __Dispatch_Table.save()V
    //#output(com.dmdirc.addons.nickcolours.NickColourPanel__static_init): headers
    //#output(com.dmdirc.addons.nickcolours.NickColourPanel__static_init): new String[](NickColourPanel__static_init#1) num objects
    //#output(com.dmdirc.addons.nickcolours.NickColourPanel__static_init): headers.length
    //#output(com.dmdirc.addons.nickcolours.NickColourPanel__static_init): headers[0]
    //#output(com.dmdirc.addons.nickcolours.NickColourPanel__static_init): headers[1]
    //#output(com.dmdirc.addons.nickcolours.NickColourPanel__static_init): headers[2]
    //#output(com.dmdirc.addons.nickcolours.NickColourPanel__static_init): headers[3]
    //#new obj(com.dmdirc.addons.nickcolours.NickColourPanel__static_init): new String[](NickColourPanel__static_init#1)
    //#post(com.dmdirc.addons.nickcolours.NickColourPanel__static_init): __Descendant_Table[com/dmdirc/addons/nickcolours/NickColourPanel] == &__Dispatch_Table
    //#post(com.dmdirc.addons.nickcolours.NickColourPanel__static_init): __Dispatch_Table.actionPerformed(Ljava/awt/event/ActionEvent;)V == &actionPerformed
    //#post(com.dmdirc.addons.nickcolours.NickColourPanel__static_init): __Dispatch_Table.addRow(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V == &addRow
    //#post(com.dmdirc.addons.nickcolours.NickColourPanel__static_init): __Dispatch_Table.getData()Ljava/util/List; == &getData
    //#post(com.dmdirc.addons.nickcolours.NickColourPanel__static_init): __Dispatch_Table.removeRow(I)V == &removeRow
    //#post(com.dmdirc.addons.nickcolours.NickColourPanel__static_init): __Dispatch_Table.save()V == &save
    //#post(com.dmdirc.addons.nickcolours.NickColourPanel__static_init): headers == &new String[](NickColourPanel__static_init#1)
    //#post(com.dmdirc.addons.nickcolours.NickColourPanel__static_init): new String[](NickColourPanel__static_init#1) num objects == 1
    //#post(com.dmdirc.addons.nickcolours.NickColourPanel__static_init): headers.length == 4
    //#post(com.dmdirc.addons.nickcolours.NickColourPanel__static_init): headers[0] == &"Network"
    //#post(com.dmdirc.addons.nickcolours.NickColourPanel__static_init): headers[1] == &"Nickname"
    //#post(com.dmdirc.addons.nickcolours.NickColourPanel__static_init): headers[2] == &"Text colour"
    //#post(com.dmdirc.addons.nickcolours.NickColourPanel__static_init): headers[3] == &"Nicklist colour"
    //#NickColourPanel.java:64: end of method: com.dmdirc.addons.nickcolours.NickColourPanel.com.dmdirc.addons.nickcolours.NickColourPanel__static_init
        "Text colour", "Nicklist colour"};

    /**
     * Creates a new instance of NickColourPanel.
     * 
     * @param plugin The plugin that owns this panel
     */
    public NickColourPanel(final NickColourPlugin plugin) {
        super();
    //#NickColourPanel.java:73: method: void com.dmdirc.addons.nickcolours.NickColourPanel.com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)
    //#input(void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)): "ins 0, fill, h "._tainted
    //#input(void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)): com.dmdirc.addons.ui_swing.dialogs.prefs.SwingPreferencesDialog.CLIENT_HEIGHT
    //#input(void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)): headers
    //#input(void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)): plugin
    //#input(void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)): this
    //#output(void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)): new ColourRenderer(NickColourPanel$1#1) num objects
    //#output(void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)): new ColourRenderer(NickColourPanel$1#1).__Tag
    //#output(void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)): new NickColourPanel$1(NickColourPanel#1) num objects
    //#output(void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)): this.table.__Tag
    //#output(void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)): this.table.colourRenderer
    //#output(void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)): this.table.this$0
    //#output(void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)): this.plugin
    //#output(void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)): this.table
    //#new obj(void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)): new ColourRenderer(NickColourPanel$1#1)
    //#new obj(void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)): new NickColourPanel$1(NickColourPanel#1)
    //#pre[1] (void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)): plugin != null
    //#presumption(void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)): init'ed(com.dmdirc.addons.ui_swing.dialogs.prefs.SwingPreferencesDialog.CLIENT_HEIGHT)
    //#post(void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)): this.plugin == plugin
    //#post(void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)): this.plugin != null
    //#post(void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)): this.table == &new NickColourPanel$1(NickColourPanel#1)
    //#post(void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)): new ColourRenderer(NickColourPanel$1#1) num objects == 1
    //#post(void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)): new NickColourPanel$1(NickColourPanel#1) num objects == 1
    //#post(void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)): new ColourRenderer(NickColourPanel$1#1).__Tag == com/dmdirc/addons/nickcolours/ColourRenderer
    //#post(void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)): this.table.__Tag == com/dmdirc/addons/nickcolours/NickColourPanel$1
    //#post(void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)): this.table.colourRenderer == &new ColourRenderer(NickColourPanel$1#1)
    //#post(void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)): this.table.this$0 == this
    //#post(void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)): this.table.this$0 != null
    //#unanalyzed(void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)): Effects-of-calling:com.dmdirc.config.IdentityManager:getGlobalConfig
    //#unanalyzed(void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)): Effects-of-calling:com.dmdirc.addons.nickcolours.NickColourPlugin:getDomain
    //#unanalyzed(void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)): Effects-of-calling:com.dmdirc.config.ConfigManager:getOption
    //#unanalyzed(void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)): Effects-of-calling:java.lang.String:split
    //#unanalyzed(void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)): Effects-of-calling:java.util.List:iterator
    //#unanalyzed(void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)): Effects-of-calling:java.util.Iterator:hasNext
    //#unanalyzed(void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)): Effects-of-calling:java.util.Iterator:next
    //#unanalyzed(void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)): Effects-of-calling:java.util.ArrayList
    //#unanalyzed(void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)): Effects-of-calling:com.dmdirc.config.ConfigManager:getOptions
    //#unanalyzed(void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)): Effects-of-calling:java.util.Map:keySet
    //#unanalyzed(void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)): Effects-of-calling:java.util.Set:iterator
    //#unanalyzed(void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)): Effects-of-calling:java.lang.String:startsWith
    //#unanalyzed(void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)): Effects-of-calling:java.lang.String:indexOf
    //#unanalyzed(void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)): Effects-of-calling:java.lang.String:substring
    //#unanalyzed(void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)): Effects-of-calling:java.util.List:add
    //#unanalyzed(void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)): Effects-of-calling:java.util.List:size
    //#unanalyzed(void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)): Effects-of-calling:javax.swing.JTable
    //#unanalyzed(void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)): Effects-of-calling:javax.swing.table.DefaultTableCellRenderer
    //#unanalyzed(void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)): Effects-of-calling:com.dmdirc.addons.nickcolours.ColourRenderer:setOpaque

        this.plugin = plugin;

        final Object[][] data = plugin.getData();

        table = new JTable(new DefaultTableModel(data, headers)) {
    //#NickColourPanel.java:79: method: void com.dmdirc.addons.nickcolours.NickColourPanel$1.com.dmdirc.addons.nickcolours.NickColourPanel$1(NickColourPanel, TableModel)
    //#input(void com.dmdirc.addons.nickcolours.NickColourPanel$1(NickColourPanel, TableModel)): Param_1
    //#input(void com.dmdirc.addons.nickcolours.NickColourPanel$1(NickColourPanel, TableModel)): this
    //#input(void com.dmdirc.addons.nickcolours.NickColourPanel$1(NickColourPanel, TableModel)): x0
    //#output(void com.dmdirc.addons.nickcolours.NickColourPanel$1(NickColourPanel, TableModel)): new ColourRenderer(NickColourPanel$1#1) num objects
    //#output(void com.dmdirc.addons.nickcolours.NickColourPanel$1(NickColourPanel, TableModel)): this.colourRenderer.__Tag
    //#output(void com.dmdirc.addons.nickcolours.NickColourPanel$1(NickColourPanel, TableModel)): this.colourRenderer
    //#output(void com.dmdirc.addons.nickcolours.NickColourPanel$1(NickColourPanel, TableModel)): this.this$0
    //#new obj(void com.dmdirc.addons.nickcolours.NickColourPanel$1(NickColourPanel, TableModel)): new ColourRenderer(NickColourPanel$1#1)
    //#post(void com.dmdirc.addons.nickcolours.NickColourPanel$1(NickColourPanel, TableModel)): this.colourRenderer == &new ColourRenderer(NickColourPanel$1#1)
    //#post(void com.dmdirc.addons.nickcolours.NickColourPanel$1(NickColourPanel, TableModel)): this.this$0 == Param_1
    //#post(void com.dmdirc.addons.nickcolours.NickColourPanel$1(NickColourPanel, TableModel)): init'ed(this.this$0)
    //#post(void com.dmdirc.addons.nickcolours.NickColourPanel$1(NickColourPanel, TableModel)): new ColourRenderer(NickColourPanel$1#1) num objects == 1
    //#post(void com.dmdirc.addons.nickcolours.NickColourPanel$1(NickColourPanel, TableModel)): this.colourRenderer.__Tag == com/dmdirc/addons/nickcolours/ColourRenderer
    //#unanalyzed(void com.dmdirc.addons.nickcolours.NickColourPanel$1(NickColourPanel, TableModel)): Effects-of-calling:javax.swing.table.DefaultTableCellRenderer
    //#unanalyzed(void com.dmdirc.addons.nickcolours.NickColourPanel$1(NickColourPanel, TableModel)): Effects-of-calling:com.dmdirc.addons.nickcolours.ColourRenderer:setOpaque

            /**
             * 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;
            /** The colour renderer we're using for colour cells. */
            private final ColourRenderer colourRenderer = new ColourRenderer();
    //#NickColourPanel.java:88: end of method: void com.dmdirc.addons.nickcolours.NickColourPanel$1.com.dmdirc.addons.nickcolours.NickColourPanel$1(NickColourPanel, TableModel)

            /** {@inheritDoc} */
            @Override
            public TableCellRenderer getCellRenderer(final int row,
                    final int column) {
                if (column == 2 || column == 3) {
    //#NickColourPanel.java:94: method: TableCellRenderer com.dmdirc.addons.nickcolours.NickColourPanel$1.getCellRenderer(int, int)
    //#input(TableCellRenderer getCellRenderer(int, int)): column
    //#input(TableCellRenderer getCellRenderer(int, int)): row
    //#input(TableCellRenderer getCellRenderer(int, int)): this
    //#input(TableCellRenderer getCellRenderer(int, int)): this.colourRenderer
    //#output(TableCellRenderer getCellRenderer(int, int)): return_value
    //#post(TableCellRenderer getCellRenderer(int, int)): init'ed(return_value)
    //#test_vector(TableCellRenderer getCellRenderer(int, int)): column: {2}, {-2_147_483_648..1, 4..4_294_967_295}, {3}
                    return colourRenderer;
                } else {
                    return super.getCellRenderer(row, column);
    //#NickColourPanel.java:97: end of method: TableCellRenderer com.dmdirc.addons.nickcolours.NickColourPanel$1.getCellRenderer(int, int)
                }
            }

            /** {@inheritDoc} */
            @Override
            public boolean isCellEditable(final int row, final int column) {
                return false;
    //#NickColourPanel.java:104: method: bool com.dmdirc.addons.nickcolours.NickColourPanel$1.isCellEditable(int, int)
    //#output(bool isCellEditable(int, int)): return_value
    //#post(bool isCellEditable(int, int)): return_value == 0
    //#NickColourPanel.java:104: end of method: bool com.dmdirc.addons.nickcolours.NickColourPanel$1.isCellEditable(int, int)
            }
        };

        final JScrollPane scrollPane = new JScrollPane(table);

        table.setFillsViewportHeight(true);
        table.setDefaultRenderer(Color.class, new ColourRenderer());

        setLayout(new MigLayout("ins 0, fill, h " +
    //#NickColourPanel.java:113: Warning: method not available - call not analyzed
    //#    call on void net.miginfocom.swing.MigLayout(String)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.nickcolours.NickColourPanel
    //#    method: void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)
    //#    unanalyzed callee: void net.miginfocom.swing.MigLayout(String)
    //#NickColourPanel.java:113: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.nickcolours.NickColourPanel:setLayout(LayoutManager)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.nickcolours.NickColourPanel
    //#    method: void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)
    //#    unanalyzed callee: void com.dmdirc.addons.nickcolours.NickColourPanel:setLayout(LayoutManager)
                SwingPreferencesDialog.CLIENT_HEIGHT));
        add(scrollPane, "grow, wrap, spanx, hmax 100%");
    //#NickColourPanel.java:115: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.nickcolours.NickColourPanel:add(Component, Object)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.nickcolours.NickColourPanel
    //#    method: void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)
    //#    unanalyzed callee: void com.dmdirc.addons.nickcolours.NickColourPanel:add(Component, Object)

        JButton button;
        button = new JButton("Add");
        button.addActionListener(this);
        add(button, "sg button, growx, pushx");
    //#NickColourPanel.java:120: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.nickcolours.NickColourPanel:add(Component, Object)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.nickcolours.NickColourPanel
    //#    method: void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)
    //#    unanalyzed callee: void com.dmdirc.addons.nickcolours.NickColourPanel:add(Component, Object)
        button = new JButton("Edit");
        button.addActionListener(this);
        add(button, "sg button, growx, pushx");
    //#NickColourPanel.java:123: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.nickcolours.NickColourPanel:add(Component, Object)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.nickcolours.NickColourPanel
    //#    method: void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)
    //#    unanalyzed callee: void com.dmdirc.addons.nickcolours.NickColourPanel:add(Component, Object)
        button = new JButton("Delete");
        button.addActionListener(this);
        add(button, "sg button, growx, pushx");
    //#NickColourPanel.java:126: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.nickcolours.NickColourPanel:add(Component, Object)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.nickcolours.NickColourPanel
    //#    method: void com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)
    //#    unanalyzed callee: void com.dmdirc.addons.nickcolours.NickColourPanel:add(Component, Object)
    }
    //#NickColourPanel.java:127: end of method: void com.dmdirc.addons.nickcolours.NickColourPanel.com.dmdirc.addons.nickcolours.NickColourPanel(NickColourPlugin)

    /** 
     * {@inheritDoc}
     * 
     * @param e Action event
     */
    @Override
    public void actionPerformed(final ActionEvent e) {
        final DefaultTableModel model = ((DefaultTableModel) table.getModel());
    //#NickColourPanel.java:136: method: void com.dmdirc.addons.nickcolours.NickColourPanel.actionPerformed(ActionEvent)
    //#input(void actionPerformed(ActionEvent)): com/dmdirc/addons/nickcolours/NickColourInputDialog.__Dispatch_Table.setCancelButton(Ljavax/swing/JButton;)V
    //#input(void actionPerformed(ActionEvent)): com/dmdirc/addons/nickcolours/NickColourInputDialog.__Dispatch_Table.setOkButton(Ljavax/swing/JButton;)V
    //#input(void actionPerformed(ActionEvent)): com/dmdirc/addons/ui_swing/MainFrame.__Descendant_Table[com/dmdirc/addons/ui_swing/MainFrame]
    //#input(void actionPerformed(ActionEvent)): com/dmdirc/addons/ui_swing/MainFrame.__Descendant_Table[others]
    //#input(void actionPerformed(ActionEvent)): com/dmdirc/addons/ui_swing/components/ColourChooser.java.awt.Color.DARK_GRAY
    //#input(void actionPerformed(ActionEvent)): com/dmdirc/addons/ui_swing/components/ColourPickerDialog.__Dispatch_Table.setCancelButton(Ljavax/swing/JButton;)V
    //#input(void actionPerformed(ActionEvent)): com/dmdirc/addons/ui_swing/components/ColourPickerDialog.__Dispatch_Table.setOkButton(Ljavax/swing/JButton;)V
    //#input(void actionPerformed(ActionEvent)): com/dmdirc/addons/ui_swing/components/MenuBar$1.__Dispatch_Table.setCancelButton(Ljavax/swing/JButton;)V
    //#input(void actionPerformed(ActionEvent)): com/dmdirc/addons/ui_swing/components/MenuBar$1.__Dispatch_Table.setOkButton(Ljavax/swing/JButton;)V
    //#input(void actionPerformed(ActionEvent)): com/dmdirc/addons/ui_swing/components/StandardDialog.__Descendant_Table[com/dmdirc/addons/nickcolours/NickColourInputDialog]
    //#input(void actionPerformed(ActionEvent)): com/dmdirc/addons/ui_swing/components/StandardDialog.__Descendant_Table[com/dmdirc/addons/ui_swing/components/ColourPickerDialog]
    //#input(void actionPerformed(ActionEvent)): com/dmdirc/addons/ui_swing/components/StandardDialog.__Descendant_Table[com/dmdirc/addons/ui_swing/components/MenuBar$1]
    //#input(void actionPerformed(ActionEvent)): com/dmdirc/addons/ui_swing/components/StandardDialog.__Descendant_Table[com/dmdirc/addons/ui_swing/components/StandardDialog]
    //#input(void actionPerformed(ActionEvent)): com/dmdirc/addons/ui_swing/components/StandardDialog.__Descendant_Table[com/dmdirc/addons/ui_swing/components/StandardInputDialog]
    //#input(void actionPerformed(ActionEvent)): com/dmdirc/addons/ui_swing/components/StandardDialog.__Descendant_Table[com/dmdirc/addons/ui_swing/components/durationeditor/DurationEditor]
    //#input(void actionPerformed(ActionEvent)): com/dmdirc/addons/ui_swing/components/StandardDialog.__Descendant_Table[others]
    //#input(void actionPerformed(ActionEvent)): com/dmdirc/addons/ui_swing/components/StandardDialog.__Dispatch_Table.setCancelButton(Ljavax/swing/JButton;)V
    //#input(void actionPerformed(ActionEvent)): com/dmdirc/addons/ui_swing/components/StandardDialog.__Dispatch_Table.setOkButton(Ljavax/swing/JButton;)V
    //#input(void actionPerformed(ActionEvent)): com/dmdirc/addons/ui_swing/components/StandardInputDialog.__Dispatch_Table.setCancelButton(Ljavax/swing/JButton;)V
    //#input(void actionPerformed(ActionEvent)): com/dmdirc/addons/ui_swing/components/StandardInputDialog.__Dispatch_Table.setOkButton(Ljavax/swing/JButton;)V
    //#input(void actionPerformed(ActionEvent)): com/dmdirc/addons/ui_swing/components/durationeditor/DurationEditor.__Dispatch_Table.setCancelButton(Ljavax/swing/JButton;)V
    //#input(void actionPerformed(ActionEvent)): com/dmdirc/addons/ui_swing/components/durationeditor/DurationEditor.__Dispatch_Table.setOkButton(Ljavax/swing/JButton;)V
    //#input(void actionPerformed(ActionEvent)): e
    //#input(void actionPerformed(ActionEvent)): this
    //#input(void actionPerformed(ActionEvent)): this.table
    //#pre[1] (void actionPerformed(ActionEvent)): e != null
    //#pre[3] (void actionPerformed(ActionEvent)): this.table != null
    //#presumption(void actionPerformed(ActionEvent)): java.awt.event.ActionEvent:getActionCommand(...)@138 != null
    //#presumption(void actionPerformed(ActionEvent)): java.awt.event.ActionEvent:getActionCommand(...)@140 != null
    //#presumption(void actionPerformed(ActionEvent)): java.awt.event.ActionEvent:getActionCommand(...)@159 != null
    //#presumption(void actionPerformed(ActionEvent)): javax.swing.JTable:getModel(...)@136 != null
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:javax.swing.JButton
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:orderButtons
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:javax.swing.JTextField
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:java.lang.String:isEmpty
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:com.dmdirc.ui.messages.ColourManager:getColour
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:javax.swing.JPanel:setBackground
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:javax.swing.JPanel:setToolTipText
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:com.dmdirc.ui.messages.ColourManager:parseColour
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:javax.swing.JPanel
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:javax.swing.event.EventListenerList
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:isWindowsUI
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:java.awt.Insets
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:javax.swing.JButton:setMargin
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:javax.swing.JButton:addActionListener
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:java.awt.Dimension
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:javax.swing.JPanel:setPreferredSize
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:javax.swing.BorderFactory:createLineBorder
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:javax.swing.JPanel:setBorder
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:net.miginfocom.swing.MigLayout
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:com.dmdirc.addons.ui_swing.components.ColourChooser:setLayout
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:com.dmdirc.addons.ui_swing.components.ColourChooser:add
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:getOkButton
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:getCancelButton
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:com.dmdirc.addons.nickcolours.NickColourInputDialog:setLayout
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:javax.swing.JLabel
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:com.dmdirc.addons.nickcolours.NickColourInputDialog:add
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:getLeftButton
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:getRightButton
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:com.dmdirc.addons.nickcolours.NickColourInputDialog:pack
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:com.dmdirc.Main:getUI
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:com.dmdirc.ui.interfaces.UIController:getMainWindow
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:com.dmdirc.addons.ui_swing.components.StandardDialog
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:com.dmdirc.addons.nickcolours.NickColourInputDialog:setDefaultCloseOperation
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:com.dmdirc.addons.nickcolours.NickColourInputDialog:setTitle
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:com.dmdirc.addons.nickcolours.NickColourInputDialog:setLocationRelativeTo
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:com.dmdirc.addons.nickcolours.NickColourInputDialog:setVisible
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:javax.swing.JButton:setText
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:javax.swing.JButton:setDefaultCapable
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:java.lang.System:getProperty
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:java.lang.String:toLowerCase
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:java.lang.String:startsWith
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:javax.swing.JButton:setPreferredSize
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:javax.swing.JButton:setMinimumSize
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:javax.swing.UIManager:getLookAndFeel
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:java.lang.Object:getClass
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:java.lang.Class:getName
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:java.lang.String:equals
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:javax.swing.JDialog
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:java.awt.Frame:getIconImages
    //#unanalyzed(void actionPerformed(ActionEvent)): Effects-of-calling:com.dmdirc.addons.ui_swing.components.StandardDialog:setIconImages
    //#test_vector(void actionPerformed(ActionEvent)): java.lang.String:equals(...)@138: {0}, {1}
    //#test_vector(void actionPerformed(ActionEvent)): java.lang.String:equals(...)@140: {0}, {1}
    //#test_vector(void actionPerformed(ActionEvent)): java.lang.String:equals(...)@159: {0}, {1}
    //#test_vector(void actionPerformed(ActionEvent)): javax.swing.JTable:getSelectedRow(...)@160: {-2_147_483_648..-1}, {0..4_294_967_295}
    //#test_vector(void actionPerformed(ActionEvent)): javax.swing.table.DefaultTableModel:getValueAt(...)@146: Inverse{null}, Addr_Set{null}
    //#test_vector(void actionPerformed(ActionEvent)): javax.swing.table.DefaultTableModel:getValueAt(...)@147: Inverse{null}, Addr_Set{null}

        if (e.getActionCommand().equals("Add")) {
            new NickColourInputDialog(this);
        } else if (e.getActionCommand().equals("Edit")) {
            final int row = table.getSelectedRow();

            final String network = (String) model.getValueAt(row, 0);
            final String nickname = (String) model.getValueAt(row, 1);

            String textcolour = (String) model.getValueAt(row, 2);
            String nickcolour = (String) model.getValueAt(row, 3);

            if (textcolour == null) {
                textcolour = "";
            }

            if (nickcolour == null) {
                nickcolour = "";
            }

            new NickColourInputDialog(this, row, nickname, network, textcolour,
                    nickcolour);
        } else if (e.getActionCommand().equals("Delete")) {
            final int row = table.getSelectedRow();

            if (row > -1) {
                model.removeRow(row);
            }
        }
    }
    //#NickColourPanel.java:166: end of method: void com.dmdirc.addons.nickcolours.NickColourPanel.actionPerformed(ActionEvent)

    /**
     * Removes a row from the table.
     * 
     * @param row The row to be removed
     */
    void removeRow(final int row) {
        ((DefaultTableModel) table.getModel()).removeRow(row);
    //#NickColourPanel.java:174: method: void com.dmdirc.addons.nickcolours.NickColourPanel.removeRow(int)
    //#input(void removeRow(int)): row
    //#input(void removeRow(int)): this
    //#input(void removeRow(int)): this.table
    //#pre[3] (void removeRow(int)): this.table != null
    //#presumption(void removeRow(int)): javax.swing.JTable:getModel(...)@174 != null
    }
    //#NickColourPanel.java:175: end of method: void com.dmdirc.addons.nickcolours.NickColourPanel.removeRow(int)

    /**
     * Adds a row to the table.
     * 
     * @param network The network setting
     * @param nickname The nickname setting
     * @param textcolour The textpane colour setting
     * @param nickcolour The nick list colour setting
     */
    void addRow(final String network, final String nickname,
            final String textcolour, final String nickcolour) {
        final DefaultTableModel model = ((DefaultTableModel) table.getModel());
    //#NickColourPanel.java:187: method: void com.dmdirc.addons.nickcolours.NickColourPanel.addRow(String, String, String, String)
    //#input(void addRow(String, String, String, String)): network
    //#input(void addRow(String, String, String, String)): nickcolour
    //#input(void addRow(String, String, String, String)): nickname
    //#input(void addRow(String, String, String, String)): textcolour
    //#input(void addRow(String, String, String, String)): this
    //#input(void addRow(String, String, String, String)): this.table
    //#pre[6] (void addRow(String, String, String, String)): this.table != null
    //#presumption(void addRow(String, String, String, String)): javax.swing.JTable:getModel(...)@187 != null
        model.addRow(new Object[]{network, nickname, textcolour, nickcolour});
    }
    //#NickColourPanel.java:189: end of method: void com.dmdirc.addons.nickcolours.NickColourPanel.addRow(String, String, String, String)

    /**
     * Retrieves the current data in use by this panel.
     * 
     * @return This panel's current data.
     */
    List<Object[]> getData() {
        final List<Object[]> res = new ArrayList<Object[]>();
    //#NickColourPanel.java:197: method: List com.dmdirc.addons.nickcolours.NickColourPanel.getData()
    //#input(List getData()): this
    //#input(List getData()): this.table
    //#output(List getData()): new ArrayList(getData#1) num objects
    //#output(List getData()): return_value
    //#new obj(List getData()): new ArrayList(getData#1)
    //#pre[2] (List getData()): this.table != null
    //#presumption(List getData()): java.util.Iterator:next(...)@200 != null
    //#presumption(List getData()): javax.swing.JTable:getModel(...)@198 != null
    //#presumption(List getData()): javax.swing.table.DefaultTableModel:getDataVector(...)@200 != null
    //#post(List getData()): return_value == &new ArrayList(getData#1)
    //#post(List getData()): new ArrayList(getData#1) num objects == 1
    //#test_vector(List getData()): java.util.Iterator:hasNext(...)@200: {0}, {1}
        final DefaultTableModel model = ((DefaultTableModel) table.getModel());

        for (Object row : model.getDataVector()) {
            final Vector vrow = (Vector) row;

            res.add(new Object[]{vrow.elementAt(0), vrow.elementAt(1), vrow.
                        elementAt(2), vrow.elementAt(3)});
        }

        return res;
    //#NickColourPanel.java:207: end of method: List com.dmdirc.addons.nickcolours.NickColourPanel.getData()
    }

    /** {@inheritDoc} */
    @Override
    public void save() {
        // Remove all old config entries
        for (Object[] parts : plugin.getData()) {
    //#NickColourPanel.java:214: method: void com.dmdirc.addons.nickcolours.NickColourPanel.save()
    //#NickColourPanel.java:214: ?use of default init
    //#    init'ed(arr$[i$])
    //#    severity: SUPPRESSED
    //#    class: com.dmdirc.addons.nickcolours.NickColourPanel
    //#    method: void save()
    //#    basic block: bb_3
    //#    assertion: init'ed(arr$[i$])
    //#    VN: arr$[i$]
    //#    Expected: Univ-VN-Set
    //#    Bad: {Invalid}
    //#    Attribs:  Ptr  Bad only invalid
    //#input(void save()): ":"._tainted
    //#input(void save()): "color:"._tainted
    //#input(void save()): __Descendant_Table[com/dmdirc/addons/nickcolours/NickColourPanel]
    //#input(void save()): __Descendant_Table[others]
    //#input(void save()): __Dispatch_Table.getData()Ljava/util/List;
    //#input(void save()): this
    //#input(void save()): this.__Tag
    //#input(void save()): this.plugin
    //#input(void save()): this.table
    //#pre[2] (void save()): this.__Tag == com/dmdirc/addons/nickcolours/NickColourPanel
    //#pre[3] (void save()): this.plugin != null
    //#pre[4] (void save()): this.table != null
    //#presumption(void save()): arr$[i$] != null
    //#presumption(void save()): com.dmdirc.config.IdentityManager:getConfigIdentity(...)@215 != null
    //#presumption(void save()): com.dmdirc.config.IdentityManager:getConfigIdentity(...)@221 != null
    //#presumption(void save()): java.util.Iterator:next(...)@220 != null
    //#presumption(void save()): parts.length >= 2
    //#presumption(void save()): row.length@220 >= 4
    //#unanalyzed(void save()): Effects-of-calling:com.dmdirc.config.IdentityManager:getGlobalConfig
    //#unanalyzed(void save()): Effects-of-calling:com.dmdirc.addons.nickcolours.NickColourPlugin:getDomain
    //#unanalyzed(void save()): Effects-of-calling:com.dmdirc.config.ConfigManager:getOption
    //#unanalyzed(void save()): Effects-of-calling:java.lang.String:split
    //#unanalyzed(void save()): Effects-of-calling:java.util.List:iterator
    //#unanalyzed(void save()): Effects-of-calling:java.util.Iterator:hasNext
    //#unanalyzed(void save()): Effects-of-calling:java.util.Iterator:next
    //#unanalyzed(void save()): Effects-of-calling:java.util.ArrayList
    //#unanalyzed(void save()): Effects-of-calling:com.dmdirc.config.ConfigManager:getOptions
    //#unanalyzed(void save()): Effects-of-calling:java.util.Map:keySet
    //#unanalyzed(void save()): Effects-of-calling:java.util.Set:iterator
    //#unanalyzed(void save()): Effects-of-calling:java.lang.String:startsWith
    //#unanalyzed(void save()): Effects-of-calling:java.lang.String:indexOf
    //#unanalyzed(void save()): Effects-of-calling:java.lang.String:substring
    //#unanalyzed(void save()): Effects-of-calling:java.util.List:add
    //#unanalyzed(void save()): Effects-of-calling:java.util.List:size
    //#unanalyzed(void save()): Effects-of-calling:javax.swing.JTable:getModel
    //#unanalyzed(void save()): Effects-of-calling:javax.swing.table.DefaultTableModel:getDataVector
    //#unanalyzed(void save()): Effects-of-calling:java.util.Vector:iterator
    //#unanalyzed(void save()): Effects-of-calling:java.util.Vector:elementAt
    //#test_vector(void save()): java.util.Iterator:hasNext(...)@220: {0}, {1}
            IdentityManager.getConfigIdentity().unsetOption(
    //#NickColourPanel.java:215: Warning: method not available - call not analyzed
    //#    call on Identity com.dmdirc.config.IdentityManager:getConfigIdentity()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.nickcolours.NickColourPanel
    //#    method: void save()
    //#    unanalyzed callee: Identity com.dmdirc.config.IdentityManager:getConfigIdentity()
    //#NickColourPanel.java:215: Warning: method not available - call not analyzed
    //#    call on String com.dmdirc.addons.nickcolours.NickColourPlugin:getDomain()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.nickcolours.NickColourPanel
    //#    method: void save()
    //#    unanalyzed callee: String com.dmdirc.addons.nickcolours.NickColourPlugin:getDomain()
    //#NickColourPanel.java:215: ?null dereference
    //#    parts != null
    //#    severity: MEDIUM
    //#    class: com.dmdirc.addons.nickcolours.NickColourPanel
    //#    method: void save()
    //#    basic block: bb_3
    //#    assertion: parts != null
    //#    VN: arr$[i$]
    //#    Expected: Inverse{null}
    //#    Bad: Addr_Set{null}
    //#    Attribs:  Ptr  null in Bad
    //#NickColourPanel.java:215: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.config.Identity:unsetOption(String, String)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.nickcolours.NickColourPanel
    //#    method: void save()
    //#    unanalyzed callee: void com.dmdirc.config.Identity:unsetOption(String, String)
                    plugin.getDomain(), "color:" + parts[0] + ":" + parts[1]);
        }

        // And write the new ones
        for (Object[] row : getData()) {
            IdentityManager.getConfigIdentity().setOption(plugin.getDomain(),
    //#NickColourPanel.java:221: Warning: method not available - call not analyzed
    //#    call on Identity com.dmdirc.config.IdentityManager:getConfigIdentity()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.nickcolours.NickColourPanel
    //#    method: void save()
    //#    unanalyzed callee: Identity com.dmdirc.config.IdentityManager:getConfigIdentity()
    //#NickColourPanel.java:221: Warning: method not available - call not analyzed
    //#    call on String com.dmdirc.addons.nickcolours.NickColourPlugin:getDomain()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.nickcolours.NickColourPanel
    //#    method: void save()
    //#    unanalyzed callee: String com.dmdirc.addons.nickcolours.NickColourPlugin:getDomain()
    //#NickColourPanel.java:221: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.config.Identity:setOption(String, String, String)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.nickcolours.NickColourPanel
    //#    method: void save()
    //#    unanalyzed callee: void com.dmdirc.config.Identity:setOption(String, String, String)
                    "color:" + row[0] + ":" + row[1], row[2] + ":" + row[3]);
        }
    }
    //#NickColourPanel.java:224: end of method: void com.dmdirc.addons.nickcolours.NickColourPanel.save()
}
    //#output(com.dmdirc.addons.nickcolours.NickColourPanel$1__static_init): __Descendant_Table[com/dmdirc/addons/nickcolours/NickColourPanel$1]
    //#output(com.dmdirc.addons.nickcolours.NickColourPanel$1__static_init): __Dispatch_Table.getCellRenderer(II)Ljavax/swing/table/TableCellRenderer;
    //#output(com.dmdirc.addons.nickcolours.NickColourPanel$1__static_init): __Dispatch_Table.isCellEditable(II)Z
    //#post(com.dmdirc.addons.nickcolours.NickColourPanel$1__static_init): __Descendant_Table[com/dmdirc/addons/nickcolours/NickColourPanel$1] == &__Dispatch_Table
    //#post(com.dmdirc.addons.nickcolours.NickColourPanel$1__static_init): __Dispatch_Table.getCellRenderer(II)Ljavax/swing/table/TableCellRenderer; == &getCellRenderer
    //#post(com.dmdirc.addons.nickcolours.NickColourPanel$1__static_init): __Dispatch_Table.isCellEditable(II)Z == &isCellEditable
    //#NickColourPanel.java:: end of method: com.dmdirc.addons.nickcolours.NickColourPanel$1.com.dmdirc.addons.nickcolours.NickColourPanel$1__static_init
    //#NickColourPanel.java:: end of class: com.dmdirc.addons.nickcolours.NickColourPanel$1
    //#NickColourPanel.java:: end of class: com.dmdirc.addons.nickcolours.NickColourPanel
