1 | package fr.mael.jiwigo.ui; |
---|
2 | |
---|
3 | /* |
---|
4 | * $Id: CollapsiblePaneDemo.java 1164 2009-11-03 04:22:00Z kschaefe $ |
---|
5 | * |
---|
6 | * Copyright 2009 Sun Microsystems, Inc., 4150 Network Circle, |
---|
7 | * Santa Clara, California 95054, U.S.A. All rights reserved. |
---|
8 | * |
---|
9 | * This library is free software; you can redistribute it and/or |
---|
10 | * modify it under the terms of the GNU Lesser General Public |
---|
11 | * License as published by the Free Software Foundation; either |
---|
12 | * version 2.1 of the License, or (at your option) any later version. |
---|
13 | * |
---|
14 | * This library is distributed in the hope that it will be useful, |
---|
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
17 | * Lesser General Public License for more details. |
---|
18 | * |
---|
19 | * You should have received a copy of the GNU Lesser General Public |
---|
20 | * License along with this library; if not, write to the Free Software |
---|
21 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
---|
22 | */ |
---|
23 | |
---|
24 | import java.awt.BorderLayout; |
---|
25 | |
---|
26 | import javax.swing.JButton; |
---|
27 | import javax.swing.JPanel; |
---|
28 | import javax.swing.JSplitPane; |
---|
29 | import javax.swing.JTabbedPane; |
---|
30 | |
---|
31 | import org.jdesktop.swingx.JXCollapsiblePane; |
---|
32 | |
---|
33 | import fr.mael.jiwigo.ui.browser.BrowserPanel; |
---|
34 | |
---|
35 | /** |
---|
36 | Copyright (c) 2010, Mael |
---|
37 | All rights reserved. |
---|
38 | |
---|
39 | Redistribution and use in source and binary forms, with or without |
---|
40 | modification, are permitted provided that the following conditions are met: |
---|
41 | * Redistributions of source code must retain the above copyright |
---|
42 | notice, this list of conditions and the following disclaimer. |
---|
43 | * Redistributions in binary form must reproduce the above copyright |
---|
44 | notice, this list of conditions and the following disclaimer in the |
---|
45 | documentation and/or other materials provided with the distribution. |
---|
46 | * Neither the name of jiwigo nor the |
---|
47 | names of its contributors may be used to endorse or promote products |
---|
48 | derived from this software without specific prior written permission. |
---|
49 | |
---|
50 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
---|
51 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
---|
52 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
---|
53 | DISCLAIMED. IN NO EVENT SHALL Mael BE LIABLE FOR ANY |
---|
54 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
---|
55 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
---|
56 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
---|
57 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
---|
58 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
---|
59 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
---|
60 | * |
---|
61 | * @author Karl George Schaefer |
---|
62 | */ |
---|
63 | @SuppressWarnings("serial") |
---|
64 | public class MyCollapsiblePanel extends JPanel { |
---|
65 | private JXCollapsiblePane collapsiblePane; |
---|
66 | private JButton collapsingButton; |
---|
67 | private BrowserPanel browserFrame = BrowserPanel.getInstance(); |
---|
68 | private JSplitPane splitPane; |
---|
69 | |
---|
70 | // /** |
---|
71 | // * main method allows us to run as a standalone demo. |
---|
72 | // */ |
---|
73 | // public static void main(String[] args) { |
---|
74 | // SwingUtilities.invokeLater(new Runnable() { |
---|
75 | // public void run() { |
---|
76 | // JFrame frame = new JFrame(); |
---|
77 | // |
---|
78 | // frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
---|
79 | // frame.getContentPane().add(new TEst()); |
---|
80 | // frame.setPreferredSize(new Dimension(800, 600)); |
---|
81 | // frame.pack(); |
---|
82 | // frame.setLocationRelativeTo(null); |
---|
83 | // frame.setVisible(true); |
---|
84 | // } |
---|
85 | // }); |
---|
86 | // } |
---|
87 | |
---|
88 | public MyCollapsiblePanel(JTabbedPane tabbedPane) { |
---|
89 | setLayout(new BorderLayout()); |
---|
90 | splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT); |
---|
91 | splitPane.setTopComponent(browserFrame); |
---|
92 | splitPane.setBottomComponent(tabbedPane); |
---|
93 | splitPane.setResizeWeight(0.5); |
---|
94 | add(splitPane, BorderLayout.CENTER); |
---|
95 | |
---|
96 | } |
---|
97 | |
---|
98 | @Override |
---|
99 | public void revalidate() { |
---|
100 | // TODO Auto-generated method stub |
---|
101 | super.revalidate(); |
---|
102 | |
---|
103 | } |
---|
104 | |
---|
105 | // public void changeSize(Dimension dimension) { |
---|
106 | // Dimension dim = new Dimension(dimension.width, dimension.height - 400); |
---|
107 | // |
---|
108 | // } |
---|
109 | |
---|
110 | } |
---|