Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
UndockedView.java
1 
16 package net.squiz.matrix.assetmap;
17 
18 import javax.swing.*;
19 import java.awt.event.*;
20 import net.squiz.matrix.matrixtree.*;
21 
22 public class UndockedView extends JFrame implements View {
23 
24  private View view;
25  private int index;
26 
27  public UndockedView(View view, int index) {
28  this.view = view;
29  this.index = index;
30 
31  setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
32  setTitle(view.getName());
33  getContentPane().add(view.getViewComponent());
34 
35  JSplitPane splitPane = ((BasicView)view).getSplitPane();
36  splitPane.setDividerLocation(Integer.MAX_VALUE);
37  }
38 
39  public MatrixTree getTree() {
40  return view.getTree();
41  }
42 
43  public View getInnerView() {
44  return view;
45  }
46 
47  public int getIndex() {
48  return index;
49  }
50 
51  public String getName() {
52  return view.getName();
53  }
54 
55  public void setName(String name) {
56  view.setName(name);
57  }
58 
59  public JComponent getViewComponent() {
60  return view.getViewComponent();
61  }
62 }