//# 0 errors, 80 messages
//#
/*
    //#PasteDialogFocusTraversalPolicy.java:1:1: class: com.dmdirc.addons.ui_swing.dialogs.paste.PasteDialogFocusTraversalPolicy
    //#PasteDialogFocusTraversalPolicy.java:1:1: method: com.dmdirc.addons.ui_swing.dialogs.paste.PasteDialogFocusTraversalPolicy.com.dmdirc.addons.ui_swing.dialogs.paste.PasteDialogFocusTraversalPolicy__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.dialogs.paste;

import java.awt.Component;
import java.awt.Container;
import java.awt.FocusTraversalPolicy;

import javax.swing.JButton;

/**
 * Focus traversal policy for the paste dialog.
 */
public final class PasteDialogFocusTraversalPolicy extends FocusTraversalPolicy {
    
    /** Cancel button. */
    private final JButton cancelButton;
    /** Edit button. */
    private final JButton editButton;
    /** Send button. */
    private final JButton sendButton;
    
    /** 
     * Creates a new instance of PasteDialogFocusTraversalPolicy. 
     *
     * @param cancelButton Cancel button
     * @param editButton Edit button
     * @param sendButton Send button
     */
    public PasteDialogFocusTraversalPolicy(final JButton cancelButton,
            final JButton editButton, final JButton sendButton) {
        super();
    //#PasteDialogFocusTraversalPolicy.java:52: method: void com.dmdirc.addons.ui_swing.dialogs.paste.PasteDialogFocusTraversalPolicy.com.dmdirc.addons.ui_swing.dialogs.paste.PasteDialogFocusTraversalPolicy(JButton, JButton, JButton)
    //#input(void com.dmdirc.addons.ui_swing.dialogs.paste.PasteDialogFocusTraversalPolicy(JButton, JButton, JButton)): cancelButton
    //#input(void com.dmdirc.addons.ui_swing.dialogs.paste.PasteDialogFocusTraversalPolicy(JButton, JButton, JButton)): editButton
    //#input(void com.dmdirc.addons.ui_swing.dialogs.paste.PasteDialogFocusTraversalPolicy(JButton, JButton, JButton)): sendButton
    //#input(void com.dmdirc.addons.ui_swing.dialogs.paste.PasteDialogFocusTraversalPolicy(JButton, JButton, JButton)): this
    //#output(void com.dmdirc.addons.ui_swing.dialogs.paste.PasteDialogFocusTraversalPolicy(JButton, JButton, JButton)): this.cancelButton
    //#output(void com.dmdirc.addons.ui_swing.dialogs.paste.PasteDialogFocusTraversalPolicy(JButton, JButton, JButton)): this.editButton
    //#output(void com.dmdirc.addons.ui_swing.dialogs.paste.PasteDialogFocusTraversalPolicy(JButton, JButton, JButton)): this.sendButton
    //#post(void com.dmdirc.addons.ui_swing.dialogs.paste.PasteDialogFocusTraversalPolicy(JButton, JButton, JButton)): this.cancelButton == cancelButton
    //#post(void com.dmdirc.addons.ui_swing.dialogs.paste.PasteDialogFocusTraversalPolicy(JButton, JButton, JButton)): init'ed(this.cancelButton)
    //#post(void com.dmdirc.addons.ui_swing.dialogs.paste.PasteDialogFocusTraversalPolicy(JButton, JButton, JButton)): this.editButton == editButton
    //#post(void com.dmdirc.addons.ui_swing.dialogs.paste.PasteDialogFocusTraversalPolicy(JButton, JButton, JButton)): init'ed(this.editButton)
    //#post(void com.dmdirc.addons.ui_swing.dialogs.paste.PasteDialogFocusTraversalPolicy(JButton, JButton, JButton)): this.sendButton == sendButton
    //#post(void com.dmdirc.addons.ui_swing.dialogs.paste.PasteDialogFocusTraversalPolicy(JButton, JButton, JButton)): init'ed(this.sendButton)
        
        this.cancelButton = cancelButton;
        this.editButton = editButton;
        this.sendButton = sendButton;
    }
    //#PasteDialogFocusTraversalPolicy.java:57: end of method: void com.dmdirc.addons.ui_swing.dialogs.paste.PasteDialogFocusTraversalPolicy.com.dmdirc.addons.ui_swing.dialogs.paste.PasteDialogFocusTraversalPolicy(JButton, JButton, JButton)
    
    /** {@inheritDoc} */
    public Component getComponentAfter(final Container aContainer,
            final Component aComponent) {
        if (aComponent.equals(cancelButton)) {
    //#PasteDialogFocusTraversalPolicy.java:62: method: Component com.dmdirc.addons.ui_swing.dialogs.paste.PasteDialogFocusTraversalPolicy.getComponentAfter(Container, Component)
    //#input(Component getComponentAfter(Container, Component)): aComponent
    //#input(Component getComponentAfter(Container, Component)): this
    //#input(Component getComponentAfter(Container, Component)): this.cancelButton
    //#input(Component getComponentAfter(Container, Component)): this.editButton
    //#input(Component getComponentAfter(Container, Component)): this.sendButton
    //#output(Component getComponentAfter(Container, Component)): return_value
    //#pre[1] (Component getComponentAfter(Container, Component)): aComponent != null
    //#post(Component getComponentAfter(Container, Component)): return_value == One-of{this.editButton, this.sendButton, this.cancelButton}
    //#post(Component getComponentAfter(Container, Component)): init'ed(return_value)
    //#test_vector(Component getComponentAfter(Container, Component)): java.lang.Object:equals(...)@62: {0}, {1}
    //#test_vector(Component getComponentAfter(Container, Component)): java.lang.Object:equals(...)@64: {0}, {1}
    //#test_vector(Component getComponentAfter(Container, Component)): java.lang.Object:equals(...)@66: {0}, {1}
            return editButton;
        } else if (aComponent.equals(editButton)) {
            return sendButton;
        } else if (aComponent.equals(sendButton)) {
            return cancelButton;
        } else {
            return cancelButton;
    //#PasteDialogFocusTraversalPolicy.java:69: end of method: Component com.dmdirc.addons.ui_swing.dialogs.paste.PasteDialogFocusTraversalPolicy.getComponentAfter(Container, Component)
        }
    }
    
    /** {@inheritDoc} */
    public Component getComponentBefore(final Container aContainer,
            final Component aComponent) {
        if (aComponent.equals(cancelButton)) {
    //#PasteDialogFocusTraversalPolicy.java:76: method: Component com.dmdirc.addons.ui_swing.dialogs.paste.PasteDialogFocusTraversalPolicy.getComponentBefore(Container, Component)
    //#input(Component getComponentBefore(Container, Component)): aComponent
    //#input(Component getComponentBefore(Container, Component)): this
    //#input(Component getComponentBefore(Container, Component)): this.cancelButton
    //#input(Component getComponentBefore(Container, Component)): this.editButton
    //#input(Component getComponentBefore(Container, Component)): this.sendButton
    //#output(Component getComponentBefore(Container, Component)): return_value
    //#pre[1] (Component getComponentBefore(Container, Component)): aComponent != null
    //#post(Component getComponentBefore(Container, Component)): return_value == One-of{this.sendButton, this.cancelButton, this.editButton}
    //#post(Component getComponentBefore(Container, Component)): init'ed(return_value)
    //#test_vector(Component getComponentBefore(Container, Component)): java.lang.Object:equals(...)@76: {0}, {1}
    //#test_vector(Component getComponentBefore(Container, Component)): java.lang.Object:equals(...)@78: {0}, {1}
    //#test_vector(Component getComponentBefore(Container, Component)): java.lang.Object:equals(...)@80: {0}, {1}
            return sendButton;
        } else if (aComponent.equals(editButton)) {
            return cancelButton;
        } else if (aComponent.equals(sendButton)) {
            return editButton;
        } else {
            return sendButton;
    //#PasteDialogFocusTraversalPolicy.java:83: end of method: Component com.dmdirc.addons.ui_swing.dialogs.paste.PasteDialogFocusTraversalPolicy.getComponentBefore(Container, Component)
        }
    }
    
    /** {@inheritDoc} */
    public Component getFirstComponent(final Container aContainer) {
        return cancelButton;
    //#PasteDialogFocusTraversalPolicy.java:89: method: Component com.dmdirc.addons.ui_swing.dialogs.paste.PasteDialogFocusTraversalPolicy.getFirstComponent(Container)
    //#input(Component getFirstComponent(Container)): this
    //#input(Component getFirstComponent(Container)): this.cancelButton
    //#output(Component getFirstComponent(Container)): return_value
    //#post(Component getFirstComponent(Container)): return_value == this.cancelButton
    //#post(Component getFirstComponent(Container)): init'ed(return_value)
    //#PasteDialogFocusTraversalPolicy.java:89: end of method: Component com.dmdirc.addons.ui_swing.dialogs.paste.PasteDialogFocusTraversalPolicy.getFirstComponent(Container)
    }
    
    /** {@inheritDoc} */
    public Component getLastComponent(final Container aContainer) {
        return sendButton;
    //#PasteDialogFocusTraversalPolicy.java:94: method: Component com.dmdirc.addons.ui_swing.dialogs.paste.PasteDialogFocusTraversalPolicy.getLastComponent(Container)
    //#input(Component getLastComponent(Container)): this
    //#input(Component getLastComponent(Container)): this.sendButton
    //#output(Component getLastComponent(Container)): return_value
    //#post(Component getLastComponent(Container)): return_value == this.sendButton
    //#post(Component getLastComponent(Container)): init'ed(return_value)
    //#PasteDialogFocusTraversalPolicy.java:94: end of method: Component com.dmdirc.addons.ui_swing.dialogs.paste.PasteDialogFocusTraversalPolicy.getLastComponent(Container)
    }
    
    /** {@inheritDoc} */
    public Component getDefaultComponent(final Container aContainer) {
        return sendButton;
    //#PasteDialogFocusTraversalPolicy.java:99: method: Component com.dmdirc.addons.ui_swing.dialogs.paste.PasteDialogFocusTraversalPolicy.getDefaultComponent(Container)
    //#input(Component getDefaultComponent(Container)): this
    //#input(Component getDefaultComponent(Container)): this.sendButton
    //#output(Component getDefaultComponent(Container)): return_value
    //#post(Component getDefaultComponent(Container)): return_value == this.sendButton
    //#post(Component getDefaultComponent(Container)): init'ed(return_value)
    //#PasteDialogFocusTraversalPolicy.java:99: end of method: Component com.dmdirc.addons.ui_swing.dialogs.paste.PasteDialogFocusTraversalPolicy.getDefaultComponent(Container)
    }
    
}
    //#output(com.dmdirc.addons.ui_swing.dialogs.paste.PasteDialogFocusTraversalPolicy__static_init): __Descendant_Table[com/dmdirc/addons/ui_swing/dialogs/paste/PasteDialogFocusTraversalPolicy]
    //#output(com.dmdirc.addons.ui_swing.dialogs.paste.PasteDialogFocusTraversalPolicy__static_init): __Dispatch_Table.getComponentAfter(Ljava/awt/Container;Ljava/awt/Component;)Ljava/awt/Component;
    //#output(com.dmdirc.addons.ui_swing.dialogs.paste.PasteDialogFocusTraversalPolicy__static_init): __Dispatch_Table.getComponentBefore(Ljava/awt/Container;Ljava/awt/Component;)Ljava/awt/Component;
    //#output(com.dmdirc.addons.ui_swing.dialogs.paste.PasteDialogFocusTraversalPolicy__static_init): __Dispatch_Table.getDefaultComponent(Ljava/awt/Container;)Ljava/awt/Component;
    //#output(com.dmdirc.addons.ui_swing.dialogs.paste.PasteDialogFocusTraversalPolicy__static_init): __Dispatch_Table.getFirstComponent(Ljava/awt/Container;)Ljava/awt/Component;
    //#output(com.dmdirc.addons.ui_swing.dialogs.paste.PasteDialogFocusTraversalPolicy__static_init): __Dispatch_Table.getLastComponent(Ljava/awt/Container;)Ljava/awt/Component;
    //#post(com.dmdirc.addons.ui_swing.dialogs.paste.PasteDialogFocusTraversalPolicy__static_init): __Descendant_Table[com/dmdirc/addons/ui_swing/dialogs/paste/PasteDialogFocusTraversalPolicy] == &__Dispatch_Table
    //#post(com.dmdirc.addons.ui_swing.dialogs.paste.PasteDialogFocusTraversalPolicy__static_init): __Dispatch_Table.getComponentAfter(Ljava/awt/Container;Ljava/awt/Component;)Ljava/awt/Component; == &getComponentAfter
    //#post(com.dmdirc.addons.ui_swing.dialogs.paste.PasteDialogFocusTraversalPolicy__static_init): __Dispatch_Table.getComponentBefore(Ljava/awt/Container;Ljava/awt/Component;)Ljava/awt/Component; == &getComponentBefore
    //#post(com.dmdirc.addons.ui_swing.dialogs.paste.PasteDialogFocusTraversalPolicy__static_init): __Dispatch_Table.getDefaultComponent(Ljava/awt/Container;)Ljava/awt/Component; == &getDefaultComponent
    //#post(com.dmdirc.addons.ui_swing.dialogs.paste.PasteDialogFocusTraversalPolicy__static_init): __Dispatch_Table.getFirstComponent(Ljava/awt/Container;)Ljava/awt/Component; == &getFirstComponent
    //#post(com.dmdirc.addons.ui_swing.dialogs.paste.PasteDialogFocusTraversalPolicy__static_init): __Dispatch_Table.getLastComponent(Ljava/awt/Container;)Ljava/awt/Component; == &getLastComponent
    //#PasteDialogFocusTraversalPolicy.java:: end of method: com.dmdirc.addons.ui_swing.dialogs.paste.PasteDialogFocusTraversalPolicy.com.dmdirc.addons.ui_swing.dialogs.paste.PasteDialogFocusTraversalPolicy__static_init
    //#PasteDialogFocusTraversalPolicy.java:: end of class: com.dmdirc.addons.ui_swing.dialogs.paste.PasteDialogFocusTraversalPolicy
