View Javadoc

1   /*
2    * @(#)$Id: AdminView.java 750 2009-08-18 18:30:55Z kurmannu $
3    *
4    * Author   : Ueli Kurmann, igesture@uelikurmann.ch
5    *                                   
6    *                                   
7    * Purpose  : 
8    *
9    * -----------------------------------------------------------------------
10   *
11   * Revision Information:
12   *
13   * Date       Who     Reason
14   *
15   * 23.03.2008 ukurmann  Initial Release
16   *
17   * -----------------------------------------------------------------------
18   *
19   * Copyright 1999-2009 ETH Zurich. All Rights Reserved.
20   *
21   * This software is the proprietary information of ETH Zurich.
22   * Use is subject to license terms.
23   * 
24   */
25  
26  package org.ximtec.igesture.tool.view.admin;
27  
28  import java.awt.Color;
29  
30  import javax.swing.BorderFactory;
31  import javax.swing.Icon;
32  import javax.swing.JComponent;
33  import javax.swing.JScrollPane;
34  
35  import org.ximtec.igesture.tool.GestureConstants;
36  import org.ximtec.igesture.tool.core.Controller;
37  import org.ximtec.igesture.tool.core.DefaultSplitPane;
38  import org.ximtec.igesture.tool.core.TabbedView;
39  import org.ximtec.igesture.tool.explorer.ExplorerTree;
40  import org.ximtec.igesture.tool.explorer.core.ExplorerTreeContainer;
41  
42  public class AdminView extends DefaultSplitPane implements TabbedView,
43  		ExplorerTreeContainer, IAdminView {
44  
45  	private JScrollPane scrollPaneLeft;
46  
47  	public AdminView(Controller controller) {
48  		super(controller);
49  		init();
50  	}
51  
52  	private void init() {
53  		setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
54  		scrollPaneLeft = new JScrollPane();
55  		scrollPaneLeft.setOpaque(true);
56  		scrollPaneLeft.setBackground(Color.blue);
57  		scrollPaneLeft.setForeground(Color.blue);
58  		setLeftComponent(scrollPaneLeft);
59  	}
60  
61  	@Override
62  	public Icon getIcon() {
63  		return null;
64  	}
65  
66  	@Override
67  	public String getTabName() {
68  		return getComponentFactory().getGuiBundle().getName(
69  				GestureConstants.GESTURE_SET_VIEW);
70  	}
71  
72  	@Override
73  	public JComponent getPane() {
74  		return this;
75  	}
76  
77  	@Override
78  	public void setTree(ExplorerTree tree) {
79  		tree.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
80  		scrollPaneLeft.setViewportView(tree);
81  	}
82  
83  	@Override
84  	public void setView(JComponent view) {
85  		setRightComponent(view);
86  		//TODO Cleanup
87  		setDividerLocation(getDividerLocation());
88  	}
89  
90  }