Search in sources :

Example 61 with JSplitPane

use of javax.swing.JSplitPane in project vcell by virtualcell.

the class MainView method initializeContentPane.

private void initializeContentPane() {
    JPanel contentPane = new JPanel();
    BorderLayout borderLayout = new BorderLayout();
    contentPane.setLayout(borderLayout);
    // Project label initialization
    lblProjectDescription = new JLabel(" ", SwingConstants.CENTER);
    Font font = lblProjectDescription.getFont();
    lblProjectDescription.setFont(new Font(font.getFontName(), Font.BOLD, 14));
    // Tabbed pane initialization
    Project project = model.getProject();
    if (project != null) {
        pnlData = new ListPanel<>(project.getData());
        pnlGeometry = new ListPanel<>(project.getGeometry());
        pnlModels = new ListPanel<>(project.getModels());
        pnlResults = new ListPanel<>(project.getResults());
    } else {
        pnlData = new ListPanel<>(new ArrayList<>());
        pnlGeometry = new ListPanel<>(new ArrayList<>());
        pnlModels = new ListPanel<>(new ArrayList<>());
        pnlResults = new ListPanel<>(new ArrayList<>());
    }
    tabbedPane = new JTabbedPane();
    tabbedPane.addTab("Data", pnlData);
    tabbedPane.addTab("Geometry", pnlGeometry);
    tabbedPane.addTab("Models", pnlModels);
    tabbedPane.addTab("Results", pnlResults);
    JPanel leftPanel = new JPanel(new BorderLayout());
    leftPanel.add(lblProjectDescription, BorderLayout.PAGE_START);
    leftPanel.add(tabbedPane, BorderLayout.CENTER);
    leftPanel.setPreferredSize(new Dimension(300, 400));
    rightPanel = new JPanel(new BorderLayout());
    rightPanel.setPreferredSize(new Dimension(400, 400));
    JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, leftPanel, rightPanel);
    splitPane.setBackground(Color.WHITE);
    splitPane.setBorder(null);
    contentPane.add(splitPane, BorderLayout.CENTER);
    setContentPane(contentPane);
}
Also used : JPanel(javax.swing.JPanel) BorderLayout(java.awt.BorderLayout) JTabbedPane(javax.swing.JTabbedPane) ArrayList(java.util.ArrayList) JLabel(javax.swing.JLabel) Dimension(java.awt.Dimension) JSplitPane(javax.swing.JSplitPane) Font(java.awt.Font)

Example 62 with JSplitPane

use of javax.swing.JSplitPane 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);
    }
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) AWTEventListener(java.awt.event.AWTEventListener) GeometryMetaDataPanel(cbit.vcell.desktop.GeometryMetaDataPanel) BioModelNode(cbit.vcell.desktop.BioModelNode) JTabbedPaneEnhanced(org.vcell.util.gui.JTabbedPaneEnhanced) BorderLayout(java.awt.BorderLayout) MathModelMetaDataPanel(cbit.vcell.desktop.MathModelMetaDataPanel) AWTEvent(java.awt.AWTEvent) JScrollPane(javax.swing.JScrollPane) BioModelMetaDataPanel(cbit.vcell.desktop.BioModelMetaDataPanel) JLabel(javax.swing.JLabel) JTree(javax.swing.JTree) SimulationContext(cbit.vcell.mapping.SimulationContext) Point(java.awt.Point) TreePath(javax.swing.tree.TreePath) DatabaseWindowPanel(cbit.vcell.client.desktop.DatabaseWindowPanel) JSplitPane(javax.swing.JSplitPane)

Example 63 with JSplitPane

use of javax.swing.JSplitPane in project vcell by virtualcell.

the class VirtualFrapBatchRunFrame method getMainSplitPane.

public JSplitPane getMainSplitPane() {
    if (mainSplitPane == null) {
        mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, getBatchRunDetailsPanel(), getBatchRunDisplayPanel());
        mainSplitPane.setDividerLocation(300);
        mainSplitPane.setDividerSize(2);
    }
    return mainSplitPane;
}
Also used : JSplitPane(javax.swing.JSplitPane)

Example 64 with JSplitPane

use of javax.swing.JSplitPane in project vcell by virtualcell.

the class VCDocumentDbTreePanel method initialize.

/**
 * Initialize the class.
 */
/* WARNING: THIS METHOD WILL BE REGENERATED. */
protected void initialize() {
    try {
        initializeNotCalled = false;
        // user code begin {1}
        // user code end
        setName("BioModelTreePanel");
        setLayout(new BorderLayout());
        getDatabaseSearchPanel().addActionListener(ivjEventHandler);
        getDatabaseSearchPanel().addCollapsiblePropertyChangeListener(new PropertyChangeListener() {

            @Override
            public void propertyChange(PropertyChangeEvent evt) {
                if (evt.getSource() == getDatabaseSearchPanel() && evt.getPropertyName().equals(CollapsiblePanel.SEARCHPPANEL_EXPANDED)) {
                    boolean bSearchPanelExpanded = (Boolean) evt.getNewValue();
                    if (!bSearchPanelExpanded) {
                        search(true);
                    }
                }
            }
        });
        treeCellRenderer = createTreeCellRenderer();
        treeModel = createTreeModel();
        getJTree1().setModel(getTreeModel());
        getJTree1().setCellRenderer(treeCellRenderer);
        getTreeModel().addTreeModelListener(ivjEventHandler);
        getJTree1().getSelectionModel().addTreeSelectionListener(ivjEventHandler);
        getJTree1().addMouseListener(ivjEventHandler);
        add(getDatabaseSearchPanel(), BorderLayout.NORTH);
        JComponent topPanel = new JScrollPane(getJTree1());
        JComponent centerPanel = topPanel;
        if (bShowMetadata) {
            JSplitPane splitPane = new javax.swing.JSplitPane(javax.swing.JSplitPane.VERTICAL_SPLIT);
            splitPane.setDividerLocation(150);
            splitPane.setResizeWeight(0.7);
            getBottomPanel().setMinimumSize(new Dimension(150, 150));
            topPanel.setMinimumSize(new Dimension(150, 150));
            splitPane.setTopComponent(topPanel);
            splitPane.setBottomComponent(getBottomPanel());
            centerPanel = splitPane;
        }
        add(centerPanel, BorderLayout.CENTER);
    } catch (java.lang.Throwable ivjExc) {
        handleException(ivjExc);
    }
}
Also used : JScrollPane(javax.swing.JScrollPane) PropertyChangeEvent(java.beans.PropertyChangeEvent) BorderLayout(java.awt.BorderLayout) PropertyChangeListener(java.beans.PropertyChangeListener) JComponent(javax.swing.JComponent) Dimension(java.awt.Dimension) JSplitPane(javax.swing.JSplitPane)

Example 65 with JSplitPane

use of javax.swing.JSplitPane in project vcell by virtualcell.

the class MathDebuggerPanel method getJSplitPane.

/**
 * This method initializes jSplitPane
 *
 * @return javax.swing.JSplitPane
 */
private JSplitPane getJSplitPane() {
    if (jSplitPane == null) {
        jSplitPane = new JSplitPane();
        jSplitPane.setResizeWeight(1.0D);
        jSplitPane.setDividerLocation(500);
        jSplitPane.setLeftComponent(getMath1Panel());
        jSplitPane.setRightComponent(getMath2Panel());
    }
    return jSplitPane;
}
Also used : JSplitPane(javax.swing.JSplitPane)

Aggregations

JSplitPane (javax.swing.JSplitPane)109 BorderLayout (java.awt.BorderLayout)69 JPanel (javax.swing.JPanel)64 JScrollPane (javax.swing.JScrollPane)54 Dimension (java.awt.Dimension)40 JLabel (javax.swing.JLabel)31 JButton (javax.swing.JButton)17 JTextArea (javax.swing.JTextArea)16 FlowLayout (java.awt.FlowLayout)15 Insets (java.awt.Insets)15 GridBagLayout (java.awt.GridBagLayout)14 GridBagConstraints (java.awt.GridBagConstraints)13 JTable (javax.swing.JTable)13 Container (java.awt.Container)10 GridLayout (java.awt.GridLayout)10 ArrayList (java.util.ArrayList)10 BoxLayout (javax.swing.BoxLayout)10 JComponent (javax.swing.JComponent)10 JTabbedPane (javax.swing.JTabbedPane)10 EmptyBorder (javax.swing.border.EmptyBorder)10