001/*
002 * Copyright 2010-2015 Institut Pasteur.
003 * 
004 * This file is part of Icy.
005 * 
006 * Icy is free software: you can redistribute it and/or modify
007 * it under the terms of the GNU General Public License as published by
008 * the Free Software Foundation, either version 3 of the License, or
009 * (at your option) any later version.
010 * 
011 * Icy is distributed in the hope that it will be useful,
012 * but WITHOUT ANY WARRANTY; without even the implied warranty of
013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
014 * GNU General Public License for more details.
015 * 
016 * You should have received a copy of the GNU General Public License
017 * along with Icy. If not, see <http://www.gnu.org/licenses/>.
018 */
019package icy.gui.frame;
020
021import icy.gui.component.IcyLogo;
022
023import java.awt.BorderLayout;
024import java.awt.Dimension;
025
026import javax.swing.JPanel;
027
028/**
029 * @author Stephane
030 */
031public class TitledFrame extends IcyFrame
032{
033    protected final JPanel mainPanel;
034    /**
035     * @deprecated logo is now disabled (waste of space)
036     */
037    @Deprecated
038    protected final IcyLogo logo;
039
040    public TitledFrame(String title)
041    {
042        this(title, null, false, false, false, false);
043    }
044
045    public TitledFrame(String title, boolean resizable)
046    {
047        this(title, null, resizable, false, false, false);
048    }
049
050    public TitledFrame(String title, boolean resizable, boolean closable)
051    {
052        this(title, null, resizable, closable, false, false);
053    }
054
055    public TitledFrame(String title, boolean resizable, boolean closable, boolean maximizable)
056    {
057        this(title, null, resizable, closable, maximizable, false);
058    }
059
060    public TitledFrame(String title, boolean resizable, boolean closable, boolean maximizable, boolean iconifiable)
061    {
062        this(title, null, resizable, closable, maximizable, iconifiable);
063    }
064
065    @SuppressWarnings("deprecation")
066    public TitledFrame(String title, Dimension dim, boolean resizable, boolean closable, boolean maximizable,
067            boolean iconifiable)
068    {
069        super(title, resizable, closable, maximizable, iconifiable);
070
071        mainPanel = new JPanel();
072        mainPanel.setLayout(new BorderLayout());
073
074        setLayout(new BorderLayout());
075
076        logo = new IcyLogo(title, dim);
077
078        add(mainPanel, BorderLayout.CENTER);
079    }
080
081    /**
082     * @return the mainPanel
083     */
084    public JPanel getMainPanel()
085    {
086        return mainPanel;
087    }
088
089    /**
090     * @deprecated Title always hidden now
091     */
092    @Deprecated
093    public void setTitleVisible(boolean value)
094    {
095        // ignore
096    }
097
098    /**
099     * @deprecated Title always hidden now
100     */
101    @Deprecated
102    public boolean isTitleVisible()
103    {
104        return false;
105    }
106}