Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
BasicView.java
1 
16 package net.squiz.matrix.assetmap;
17 
18 import javax.swing.*;
19 import net.squiz.matrix.matrixtree.*;
20 import java.awt.*;
21 import java.awt.event.*;
22 import net.squiz.matrix.core.*;
23 import net.squiz.matrix.ui.*;
24 import javax.swing.plaf.*;
25 import net.squiz.matrix.plaf.*;
26 
27 public class BasicView extends JPanel implements View {
28 
29  protected MatrixTree tree;
30  private JSplitPane splitPane;
31 
32  public BasicView() {
33  construct();
34  }
35 
36  private void construct() {
37  splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
38  splitPane.setUI(new MatrixSplitPaneUI());
39 
40  JScrollPane scrollPane = new JScrollPane(constructTree());
41  scrollPane.setBorder(BorderFactory.createEmptyBorder());
42 
43  StatusKey statusKey = new StatusKey();
44 
45  splitPane.setTopComponent(scrollPane);
46  splitPane.setBottomComponent(statusKey);
47  splitPane.setOneTouchExpandable(true);
48  splitPane.setDividerLocation(Integer.MAX_VALUE);
49 
50  setLayout(new BorderLayout());
51  JPanel tabUnderlay = new JPanel();
52  tabUnderlay.setBackground(MatrixLookAndFeel.PANEL_COLOUR);
53  add(tabUnderlay, BorderLayout.WEST);
54  add(new AssetMapMenuPanel(tree, true), BorderLayout.NORTH);
55 
56  add(MatrixStatusBar.createStatusBar(), BorderLayout.SOUTH);
57  add(splitPane);
58 
59  }
60 
61  protected MatrixTree constructTree() {
62  tree = MatrixTreeBus.createTree(new LoadingNode());
63  return tree;
64  }
65 
66  protected MatrixTree createFinderTree() {
67  tree = MatrixTreeBus.createFinderTree(new LoadingNode());
68  return tree;
69  }
70 
71  public MatrixTree getTree() {
72  return tree;
73  }
74 
75  public String getName() {
76  return getAccessibleContext().getAccessibleName();
77  }
78 
79  public void setName(String name) {
80  getAccessibleContext().setAccessibleName(name);
81  }
82 
83  public JComponent getViewComponent() {
84  return this;
85  }
86 
87  public JSplitPane getSplitPane() {
88  return splitPane;
89  }
90 }