// Path: src/main/java/bdsup2sub/gui/support/RequestFocusListener.java
// public class RequestFocusListener implements AncestorListener
// {
//     private boolean removeListener;
// 
//     /*
//      *  Convenience constructor. The listener is only used once and then it is
//      *  removed from the component.
//      */
//     public RequestFocusListener() {
//         this(true);
//     }
// 
//     /*
//      *  Constructor that controls whether this listen can be used once or
//      *  multiple times.
//      *
//      *  @param removeListener when true this listener is only invoked once
//      *                        otherwise it can be invoked multiple times.
//      */
//     public RequestFocusListener(boolean removeListener) {
//         this.removeListener = removeListener;
//     }
// 
//     @Override
//     public void ancestorAdded(AncestorEvent e) {
//         JComponent component = e.getComponent();
//         component.requestFocusInWindow();
//         if (removeListener) {
//             component.removeAncestorListener(this);
//         }
//     }
// 
//     @Override
//     public void ancestorMoved(AncestorEvent e) {
//     }
// 
//     @Override
//     public void ancestorRemoved(AncestorEvent e) {
//     }
// }
// 
// Path: src/main/java/bdsup2sub/gui/support/GuiUtils.java
// public static void centerRelativeToOwner(Window window) {
//     Window owner = window.getOwner();
//     Point p = owner.getLocation();
//     window.setLocation(p.x + owner.getWidth() / 2 - window.getWidth() / 2, p.y + owner.getHeight() / 2 - window.getHeight() / 2);
// }


import bdsup2sub.gui.support.RequestFocusListener;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionListener;
import java.awt.event.MouseListener;
import java.awt.image.BufferedImage;
import static bdsup2sub.gui.support.GuiUtils.centerRelativeToOwner;
/*
 * Copyright 2014 Miklos Juhasz (mjuhasz)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package bdsup2sub.gui.palette;




class DvdPaletteDialogView extends JDialog {

    private JPanel jContentPane;
    private JScrollPane jScrollPane;
    private JList jListColor;
    private JButton jButtonOk;
    private JButton jButtonCancel;
    private JButton jButtonDefault;
    private JButton jButtonColor;
    private JButton jButtonSave;
    private JButton jButtonLoad;

    private final DvdPaletteDialogModel model;

    public DvdPaletteDialogView(DvdPaletteDialogModel model, Frame frame) {
        super(frame, "Choose Colors", true);
        this.model = model;
        initialize();
    }

    private void initialize() {
        setContentPane(getJContentPane());
        setSize(372, 231);
        setResizable(false);
// Path: src/main/java/bdsup2sub/gui/support/RequestFocusListener.java
// public class RequestFocusListener implements AncestorListener
// {
//     private boolean removeListener;
// 
//     /*
//      *  Convenience constructor. The listener is only used once and then it is
//      *  removed from the component.
//      */
//     public RequestFocusListener() {
//         this(true);
//     }
// 
//     /*
//      *  Constructor that controls whether this listen can be used once or
//      *  multiple times.
//      *
//      *  @param removeListener when true this listener is only invoked once
//      *                        otherwise it can be invoked multiple times.
//      */
//     public RequestFocusListener(boolean removeListener) {
//         this.removeListener = removeListener;
//     }
// 
//     @Override
//     public void ancestorAdded(AncestorEvent e) {
//         JComponent component = e.getComponent();
//         component.requestFocusInWindow();
//         if (removeListener) {
//             component.removeAncestorListener(this);
//         }
//     }
// 
//     @Override
//     public void ancestorMoved(AncestorEvent e) {
//     }
// 
//     @Override
//     public void ancestorRemoved(AncestorEvent e) {
//     }
// }
// 
// Path: src/main/java/bdsup2sub/gui/support/GuiUtils.java
// public static void centerRelativeToOwner(Window window) {
//     Window owner = window.getOwner();
//     Point p = owner.getLocation();
//     window.setLocation(p.x + owner.getWidth() / 2 - window.getWidth() / 2, p.y + owner.getHeight() / 2 - window.getHeight() / 2);
// }


// Path: src/main/java/bdsup2sub/gui/palette/DvdPaletteDialogView.java
import bdsup2sub.gui.support.RequestFocusListener;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionListener;
import java.awt.event.MouseListener;
import java.awt.image.BufferedImage;
import static bdsup2sub.gui.support.GuiUtils.centerRelativeToOwner;

/*
 * Copyright 2014 Miklos Juhasz (mjuhasz)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package bdsup2sub.gui.palette;




class DvdPaletteDialogView extends JDialog {

    private JPanel jContentPane;
    private JScrollPane jScrollPane;
    private JList jListColor;
    private JButton jButtonOk;
    private JButton jButtonCancel;
    private JButton jButtonDefault;
    private JButton jButtonColor;
    private JButton jButtonSave;
    private JButton jButtonLoad;

    private final DvdPaletteDialogModel model;

    public DvdPaletteDialogView(DvdPaletteDialogModel model, Frame frame) {
        super(frame, "Choose Colors", true);
        this.model = model;
        initialize();
    }

    private void initialize() {
        setContentPane(getJContentPane());
        setSize(372, 231);
        setResizable(false);
        centerRelativeToOwner(this);