View Javadoc

1   /*
2    * $Id: OverviewsPanel.java,v 1.5 2007/07/04 19:42:51 edankert Exp $
3    *
4    * The contents of this file are subject to the Mozilla Public License 
5    * Version 1.1 (the "License"); you may not use this file except in 
6    * compliance with the License. You may obtain a copy of the License at 
7    * http://www.mozilla.org/MPL/ 
8    *
9    * Software distributed under the License is distributed on an "AS IS" basis, 
10   * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 
11   * for the specific language governing rights and limitations under the License.
12   *
13   * The Original Code is XML Hammer code. (org.xmlhammer.*)
14   *
15   * The Initial Developer of the Original Code is Edwin Dankert. Portions created 
16   * by the Initial Developer are Copyright (C) 2005 - 2006 the Initial Developer. 
17   * All Rights Reserved.
18   *
19   * Contributor(s): Edwin Dankert <edankert@gmail.com>
20   */
21  
22  package org.xmlhammer.gui.overview;
23  
24  import java.awt.BorderLayout;
25  import java.awt.Font;
26  
27  import javax.swing.ImageIcon;
28  import javax.swing.JTabbedPane;
29  
30  import org.bounce.CardPanel;
31  import org.bounce.image.ImageLoader;
32  import org.xmlhammer.gui.ProjectView;
33  import org.xmlhammer.gui.util.SelectablePanel;
34  
35  /***
36   * Input Panel.
37   * 
38   * Allows to select either one URI, multiple URIs or 
39   * a range of files.
40   * 
41   * @version $Revision: 1.5 $, $Date: 2007/07/04 19:42:51 $
42   * @author Edwin Dankert <edankert@gmail.com>
43   */
44  
45  public class OverviewsPanel extends SelectablePanel {
46  	private static final long serialVersionUID = -7486036209301795423L;
47  
48      private CardPanel<OverviewPanel> overviewPanel = null;
49  	private static final ImageIcon ICON = ImageLoader.get().getImage( "/org/xmlhammer/gui/icons/eview16/outline_co.gif");
50  
51  	private JTabbedPane tabs = null;
52  
53  	/***
54  	 * Constructs a new Input Panel.
55  	 */
56  	public OverviewsPanel() {		
57  		super( new BorderLayout());
58  		tabs = new JTabbedPane();
59  		tabs.setFont( tabs.getFont().deriveFont( Font.PLAIN));
60  		
61  		overviewPanel = new CardPanel<OverviewPanel>();
62  		
63  		tabs.addTab( "Overview", ICON, overviewPanel);
64  		
65  		add( tabs, BorderLayout.CENTER);
66  	}
67  	
68  	public void showView( ProjectView view) {
69  		overviewPanel.show( view.getOverviewPanel());
70  	}
71  	
72  	public void addView( ProjectView view){
73  		overviewPanel.add( view.getOverviewPanel());
74  	}
75  
76  	public void removeView( ProjectView view){
77  		overviewPanel.remove( view.getOverviewPanel());
78  	}
79  }