//# 0 errors, 36 messages
//#
/*
    //#ExtendedListModeCellRenderer.java:1:1: class: com.dmdirc.addons.ui_swing.components.renderers.ExtendedListModeCellRenderer
    //#ExtendedListModeCellRenderer.java:1:1: method: com.dmdirc.addons.ui_swing.components.renderers.ExtendedListModeCellRenderer.com.dmdirc.addons.ui_swing.components.renderers.ExtendedListModeCellRenderer__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.renderers;

import com.dmdirc.parser.irc.ChannelListModeItem;

import java.awt.Component;
import java.util.Date;

import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JSeparator;
import javax.swing.ListCellRenderer;

import net.miginfocom.swing.MigLayout;

/**
 * Extended list mode cell renderer.
 */
public class ExtendedListModeCellRenderer extends JPanel implements ListCellRenderer {
    //#ExtendedListModeCellRenderer.java:41: method: void com.dmdirc.addons.ui_swing.components.renderers.ExtendedListModeCellRenderer.com.dmdirc.addons.ui_swing.components.renderers.ExtendedListModeCellRenderer()
    //#input(void com.dmdirc.addons.ui_swing.components.renderers.ExtendedListModeCellRenderer()): this
    //#ExtendedListModeCellRenderer.java:41: end of method: void com.dmdirc.addons.ui_swing.components.renderers.ExtendedListModeCellRenderer.com.dmdirc.addons.ui_swing.components.renderers.ExtendedListModeCellRenderer()

    /**
     * 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;

    /** {@inheritDoc} */
    @Override
    public Component getListCellRendererComponent(JList list, Object value,
            int index, boolean isSelected, boolean cellHasFocus) {
        final ChannelListModeItem listMode = (ChannelListModeItem) value;
    //#ExtendedListModeCellRenderer.java:54: method: Component com.dmdirc.addons.ui_swing.components.renderers.ExtendedListModeCellRenderer.getListCellRendererComponent(JList, Object, int, bool, bool)
    //#input(Component getListCellRendererComponent(JList, Object, int, bool, bool)): isSelected
    //#input(Component getListCellRendererComponent(JList, Object, int, bool, bool)): list
    //#input(Component getListCellRendererComponent(JList, Object, int, bool, bool)): this
    //#input(Component getListCellRendererComponent(JList, Object, int, bool, bool)): value
    //#output(Component getListCellRendererComponent(JList, Object, int, bool, bool)): return_value
    //#pre[2] (Component getListCellRendererComponent(JList, Object, int, bool, bool)): list != null
    //#pre[4] (Component getListCellRendererComponent(JList, Object, int, bool, bool)): value != null
    //#presumption(Component getListCellRendererComponent(JList, Object, int, bool, bool)): com.dmdirc.parser.irc.ChannelListModeItem:getTime(...)@66 in {-9_223_372_036_854_775..18_446_744_073_709_551}
    //#post(Component getListCellRendererComponent(JList, Object, int, bool, bool)): return_value == this
    //#post(Component getListCellRendererComponent(JList, Object, int, bool, bool)): return_value != null
    //#test_vector(Component getListCellRendererComponent(JList, Object, int, bool, bool)): isSelected: {0}, {1}
        
        removeAll();
    //#ExtendedListModeCellRenderer.java:56: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.components.renderers.ExtendedListModeCellRenderer:removeAll()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.renderers.ExtendedListModeCellRenderer
    //#    method: Component getListCellRendererComponent(JList, Object, int, bool, bool)
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.components.renderers.ExtendedListModeCellRenderer:removeAll()
        setLayout(new MigLayout("fill, ins 0"));
    //#ExtendedListModeCellRenderer.java:57: Warning: method not available - call not analyzed
    //#    call on void net.miginfocom.swing.MigLayout(String)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.renderers.ExtendedListModeCellRenderer
    //#    method: Component getListCellRendererComponent(JList, Object, int, bool, bool)
    //#    unanalyzed callee: void net.miginfocom.swing.MigLayout(String)
    //#ExtendedListModeCellRenderer.java:57: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.components.renderers.ExtendedListModeCellRenderer:setLayout(LayoutManager)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.renderers.ExtendedListModeCellRenderer
    //#    method: Component getListCellRendererComponent(JList, Object, int, bool, bool)
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.components.renderers.ExtendedListModeCellRenderer:setLayout(LayoutManager)
        
        if (isSelected) {
            setBackground(list.getSelectionBackground());
    //#ExtendedListModeCellRenderer.java:60: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.components.renderers.ExtendedListModeCellRenderer:setBackground(Color)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.renderers.ExtendedListModeCellRenderer
    //#    method: Component getListCellRendererComponent(JList, Object, int, bool, bool)
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.components.renderers.ExtendedListModeCellRenderer:setBackground(Color)
        } else {
            setBackground(list.getBackground());
    //#ExtendedListModeCellRenderer.java:62: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.components.renderers.ExtendedListModeCellRenderer:setBackground(Color)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.renderers.ExtendedListModeCellRenderer
    //#    method: Component getListCellRendererComponent(JList, Object, int, bool, bool)
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.components.renderers.ExtendedListModeCellRenderer:setBackground(Color)
        }
        
        add(new JLabel(listMode.getItem()), "split 2, growx, pushx, gapleft 3");
    //#ExtendedListModeCellRenderer.java:65: Warning: method not available - call not analyzed
    //#    call on String com.dmdirc.parser.irc.ChannelListModeItem:getItem()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.renderers.ExtendedListModeCellRenderer
    //#    method: Component getListCellRendererComponent(JList, Object, int, bool, bool)
    //#    unanalyzed callee: String com.dmdirc.parser.irc.ChannelListModeItem:getItem()
    //#ExtendedListModeCellRenderer.java:65: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.components.renderers.ExtendedListModeCellRenderer:add(Component, Object)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.renderers.ExtendedListModeCellRenderer
    //#    method: Component getListCellRendererComponent(JList, Object, int, bool, bool)
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.components.renderers.ExtendedListModeCellRenderer:add(Component, Object)
        add(new JLabel(new Date(listMode.getTime() * 1000).toString()),
    //#ExtendedListModeCellRenderer.java:66: Warning: method not available - call not analyzed
    //#    call on long com.dmdirc.parser.irc.ChannelListModeItem:getTime()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.renderers.ExtendedListModeCellRenderer
    //#    method: Component getListCellRendererComponent(JList, Object, int, bool, bool)
    //#    unanalyzed callee: long com.dmdirc.parser.irc.ChannelListModeItem:getTime()
    //#ExtendedListModeCellRenderer.java:66: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.components.renderers.ExtendedListModeCellRenderer:add(Component, Object)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.renderers.ExtendedListModeCellRenderer
    //#    method: Component getListCellRendererComponent(JList, Object, int, bool, bool)
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.components.renderers.ExtendedListModeCellRenderer:add(Component, Object)
                "right, wrap, gapright 3");
        add(new JLabel(listMode.getOwner()), "growx, pushx, wrap, gapleft 3");
    //#ExtendedListModeCellRenderer.java:68: Warning: method not available - call not analyzed
    //#    call on String com.dmdirc.parser.irc.ChannelListModeItem:getOwner()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.renderers.ExtendedListModeCellRenderer
    //#    method: Component getListCellRendererComponent(JList, Object, int, bool, bool)
    //#    unanalyzed callee: String com.dmdirc.parser.irc.ChannelListModeItem:getOwner()
    //#ExtendedListModeCellRenderer.java:68: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.components.renderers.ExtendedListModeCellRenderer:add(Component, Object)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.renderers.ExtendedListModeCellRenderer
    //#    method: Component getListCellRendererComponent(JList, Object, int, bool, bool)
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.components.renderers.ExtendedListModeCellRenderer:add(Component, Object)
        add(new JSeparator(), "growx, pushx");
    //#ExtendedListModeCellRenderer.java:69: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.components.renderers.ExtendedListModeCellRenderer:add(Component, Object)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.renderers.ExtendedListModeCellRenderer
    //#    method: Component getListCellRendererComponent(JList, Object, int, bool, bool)
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.components.renderers.ExtendedListModeCellRenderer:add(Component, Object)
        
        return this;
    //#ExtendedListModeCellRenderer.java:71: end of method: Component com.dmdirc.addons.ui_swing.components.renderers.ExtendedListModeCellRenderer.getListCellRendererComponent(JList, Object, int, bool, bool)
    }
}
    //#output(com.dmdirc.addons.ui_swing.components.renderers.ExtendedListModeCellRenderer__static_init): __Descendant_Table[com/dmdirc/addons/ui_swing/components/renderers/ExtendedListModeCellRenderer]
    //#output(com.dmdirc.addons.ui_swing.components.renderers.ExtendedListModeCellRenderer__static_init): __Dispatch_Table.getListCellRendererComponent(Ljavax/swing/JList;Ljava/lang/Object;IZZ)Ljava/awt/Component;
    //#post(com.dmdirc.addons.ui_swing.components.renderers.ExtendedListModeCellRenderer__static_init): __Descendant_Table[com/dmdirc/addons/ui_swing/components/renderers/ExtendedListModeCellRenderer] == &__Dispatch_Table
    //#post(com.dmdirc.addons.ui_swing.components.renderers.ExtendedListModeCellRenderer__static_init): __Dispatch_Table.getListCellRendererComponent(Ljavax/swing/JList;Ljava/lang/Object;IZZ)Ljava/awt/Component; == &getListCellRendererComponent
    //#ExtendedListModeCellRenderer.java:: end of method: com.dmdirc.addons.ui_swing.components.renderers.ExtendedListModeCellRenderer.com.dmdirc.addons.ui_swing.components.renderers.ExtendedListModeCellRenderer__static_init
    //#ExtendedListModeCellRenderer.java:: end of class: com.dmdirc.addons.ui_swing.components.renderers.ExtendedListModeCellRenderer
