View Javadoc

1   /*
2    * @(#)$Id: TestbenchView.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  
27  package org.ximtec.igesture.tool.view.testbench;
28  
29  import java.awt.Color;
30  
31  import javax.swing.BorderFactory;
32  import javax.swing.Icon;
33  import javax.swing.JComponent;
34  import javax.swing.JScrollPane;
35  
36  import org.ximtec.igesture.tool.GestureConstants;
37  import org.ximtec.igesture.tool.core.Controller;
38  import org.ximtec.igesture.tool.core.DefaultSplitPane;
39  import org.ximtec.igesture.tool.core.TabbedView;
40  import org.ximtec.igesture.tool.explorer.ExplorerTree;
41  import org.ximtec.igesture.tool.explorer.core.ExplorerTreeContainer;
42  
43  
44  public class TestbenchView extends DefaultSplitPane implements TabbedView,
45        ExplorerTreeContainer, ITestBenchView {
46  
47     private JScrollPane scrollPaneLeft;
48  
49  
50     public TestbenchView(Controller controller) {
51        super(controller);
52  
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        
62     }
63  
64  
65     @Override
66     public Icon getIcon() {
67  
68        return null;
69  
70     }
71  
72  
73     @Override
74     public String getTabName() {
75        return getComponentFactory().getGuiBundle().getName(
76              GestureConstants.TEST_BENCH_VIEW);
77     }
78  
79  
80     @Override
81     public JComponent getPane() {
82        return this;
83     }
84  
85  
86     @Override
87     public void setTree(ExplorerTree tree) {
88        tree.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
89        scrollPaneLeft.setViewportView(tree);
90     }
91  
92  
93     @Override
94     public void setView(JComponent view) {
95        setRightComponent(view);
96        //TODO Cleanup
97        setDividerLocation(getDividerLocation());
98     }
99  
100 }