use of cbit.vcell.client.desktop.DatabaseWindowPanel in project vcell by virtualcell.
the class DocumentEditor method initialize.
/**
* Initialize the class.
*/
private void initialize() {
try {
setLayout(new BorderLayout());
getToolkit().addAWTEventListener(new AWTEventListener() {
public void eventDispatched(AWTEvent event) {
try {
switch(event.getID()) {
case KeyEvent.KEY_RELEASED:
documentEditor_eventDispatched(event);
break;
case MouseEvent.MOUSE_RELEASED:
documentEditor_eventDispatched(event);
break;
}
} catch (Exception e) {
e.printStackTrace();
// consume any exception ... don't screw up the swing event queue.
}
}
}, AWTEvent.KEY_EVENT_MASK | AWTEvent.MOUSE_EVENT_MASK);
documentEditorTree = new javax.swing.JTree() {
@Override
public boolean isPathEditable(TreePath path) {
Object object = path.getLastPathComponent();
return (object instanceof BioModelNode) && (((BioModelNode) object).getUserObject() instanceof SimulationContext);
}
};
documentEditorTree.setEditable(true);
documentEditorTree.setLargeModel(true);
documentEditorTreeCellEditor = new DocumentEditorTreeCellEditor(documentEditorTree);
documentEditorTree.setCellEditor(documentEditorTreeCellEditor);
documentEditorTree.setName("bioModelEditorTree");
ToolTipManager.sharedInstance().registerComponent(documentEditorTree);
int rowHeight = documentEditorTree.getRowHeight();
if (rowHeight < 10) {
rowHeight = 20;
}
documentEditorTree.setRowHeight(rowHeight + 2);
documentEditorTree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
JSplitPane leftSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
databaseWindowPanel = new DatabaseWindowPanel(false, false);
leftBottomTabbedPane = new JTabbedPaneEnhanced();
leftBottomTabbedPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
leftBottomTabbedPane.addTab("VCell DB", databaseWindowPanel);
JScrollPane treePanel = new javax.swing.JScrollPane(documentEditorTree);
leftSplitPane.setTopComponent(treePanel);
leftBottomTabbedPane.setMinimumSize(new java.awt.Dimension(198, 148));
leftSplitPane.setBottomComponent(leftBottomTabbedPane);
leftSplitPane.setResizeWeight(0.5);
leftSplitPane.setDividerLocation(300);
leftSplitPane.setDividerSize(8);
leftSplitPane.setOneTouchExpandable(true);
rightSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
rightSplitPane.setResizeWeight(0.7);
rightSplitPane.setDividerLocation(400);
rightSplitPane.setDividerSize(8);
rightSplitPane.setOneTouchExpandable(true);
rightBottomEmptyPanel = new JPanel(new GridBagLayout());
rightBottomEmptyPanel.setBackground(Color.white);
treeNodeDescriptionLabel = new JLabel(generalTreeNodeDescription);
GridBagConstraints gbc = new GridBagConstraints();
gbc.gridx = 0;
gbc.insets = new Insets(10, 10, 4, 4);
gbc.gridy = 0;
gbc.weighty = 1.0;
gbc.weightx = 1.0;
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.anchor = GridBagConstraints.PAGE_START;
rightBottomEmptyPanel.add(treeNodeDescriptionLabel, gbc);
issuePanel = new IssuePanel();
rightBottomTabbedPane = new JTabbedPaneEnhanced();
rightBottomTabbedPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
rightBottomEmptyPanel.setBorder(GuiConstants.TAB_PANEL_BORDER);
issuePanel.setBorder(GuiConstants.TAB_PANEL_BORDER);
rightBottomTabbedPane.addTab(TAB_TITLE_OBJECT_PROPERTIES, rightBottomEmptyPanel);
rightBottomTabbedPane.addTab(TAB_TITLE_PROBLEMS, issuePanel);
rightBottomTabbedPane.setMinimumSize(new java.awt.Dimension(198, 148));
rightSplitPane.setBottomComponent(rightBottomTabbedPane);
JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
splitPane.setDividerLocation(270);
splitPane.setOneTouchExpandable(true);
splitPane.setResizeWeight(0.3);
splitPane.setDividerSize(8);
splitPane.setLeftComponent(leftSplitPane);
splitPane.setRightComponent(rightSplitPane);
add(splitPane, BorderLayout.CENTER);
issueManager.addIssueEventListener(eventHandler);
selectionManager.addPropertyChangeListener(eventHandler);
databaseWindowPanel.setSelectionManager(selectionManager);
documentEditorTree.addTreeSelectionListener(eventHandler);
documentEditorTree.addMouseListener(eventHandler);
bioModelMetaDataPanel = new BioModelMetaDataPanel();
bioModelMetaDataPanel.setSelectionManager(selectionManager);
mathModelMetaDataPanel = new MathModelMetaDataPanel();
mathModelMetaDataPanel.setSelectionManager(selectionManager);
geometryMetaDataPanel = new GeometryMetaDataPanel();
geometryMetaDataPanel.setSelectionManager(selectionManager);
issuePanel.setSelectionManager(selectionManager);
issuePanel.setIssueManager(issueManager);
} catch (java.lang.Throwable ivjExc) {
handleException(ivjExc);
}
}
Aggregations