View Javadoc

1   /*
2    * @(#)$Id: TestSetView.java 760 2009-08-25 20:10:41Z 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   * 07.10.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.testset;
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 TestSetView extends DefaultSplitPane implements TabbedView, ExplorerTreeContainer, ITestSetView {
43  
44    private JScrollPane scrollPaneLeft;
45  
46    public TestSetView(Controller controller) {
47      super(controller);
48  
49      setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
50      scrollPaneLeft = new JScrollPane();
51      scrollPaneLeft.setOpaque(true);
52      scrollPaneLeft.setBackground(Color.blue);
53      scrollPaneLeft.setForeground(Color.blue);
54      setLeftComponent(scrollPaneLeft);
55    }
56  
57    @Override
58    public Icon getIcon() {
59      return null;
60    }
61  
62    @Override
63    public String getTabName() {
64      return getComponentFactory().getGuiBundle().getName(GestureConstants.TEST_SET_VIEW);
65    }
66  
67    @Override
68    public JComponent getPane() {
69      return this;
70    }
71  
72    @Override
73    public void setTree(ExplorerTree tree) {
74      tree.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
75      scrollPaneLeft.setViewportView(tree);
76    }
77  
78    @Override
79    public void setView(JComponent view) {
80      setRightComponent(view);
81      setDividerLocation(getDividerLocation());
82    }
83  
84  }