/** * Add divider if there are two panes side by side without a divider in between. */ protected void addExtraDividers() { int extra = 0; for (int i = 0; i < getComponentCount(); i++) { Component comp = getComponent(i); if (!(comp instanceof JideSplitPaneDivider)) { extra++; if (extra == 2) { add(createSplitPaneDivider(), JideSplitPaneLayout.FIX, i); if (_proportions != null && getPaneCount() == _proportions.length + 2) addProportion((i + 1) / 2); extra = 0; } } else extra = 0; } }
private JPanel createCentrePanel() { final JideSplitPane splitPane1V = new JideSplitPane(JideSplitPane.VERTICAL_SPLIT); aoiTable = new JTable(); aoiTable.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS); aoiTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); aoiTable.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(final MouseEvent e) { final int clickCount = e.getClickCount(); if (clickCount == 2) { performOpenAction(); } else if (clickCount == 1) { performSelectAction(); } } }); splitPane1V.add(new JScrollPane(aoiTable)); worldMapUI = new WorldMapUI(); splitPane1V.add(worldMapUI.getWorlMapPane()); return splitPane1V; }
private JComponent createAggregatorsAndVariablesPanel() { JideSplitPane splitPane = new JideSplitPane(JideSplitPane.VERTICAL_SPLIT); splitPane.add(createAggregatorsPanel()); splitPane.add(createVariablesPanel()); splitPane.setShowGripper(true); splitPane.setProportionalLayout(true); splitPane.setProportions(new double[]{0.6}); return splitPane; }
private JComponent createAggregatorsAndVariablesPanel() { JideSplitPane splitPane = new JideSplitPane(JideSplitPane.VERTICAL_SPLIT); splitPane.add(createAggregatorsPanel()); splitPane.add(createVariablesPanel()); splitPane.setShowGripper(true); splitPane.setProportionalLayout(true); splitPane.setProportions(new double[]{0.6}); return splitPane; }
int divLoc = 0; for (String name : names) { centerSplitPane.add(panes.get(name)); if (idx < dividerLocations.length) { divLoc += panelHeights.get(name);
myBottomSplitPane.add(myTableScrollPane, java.awt.BorderLayout.CENTER);
panel.add(pane2); pane1.add(treePanel); pane2.add(listPanel); pane1.add(createTitledPanel(new JLabel("Searchable JTable (Configured to search for all columns.)"), 'T', new JScrollPane(table))); pane2.add(createTitledPanel(new JLabel("Searchable JTextArea (CTRL+F to start searching)"), 'S', new JScrollPane(textArea)));
/** * Add a new data panel set */ public synchronized TrackPanelScrollPane addDataPanel(String name) { final TrackPanel trackPanel = new TrackPanel(name, this); final TrackPanelScrollPane sp = new TrackPanelScrollPane(); Runnable runnable = () -> { sp.setViewportView(trackPanel); for (TrackPanel tp : getTrackPanels()) { tp.getScrollPane().minimizeHeight(); } // Insert the new panel just before the feature panel, or at the end if there is no feature panel. int featurePaneIdx = centerSplitPane.indexOfPane(featureTrackScrollPane); if (featurePaneIdx > 0) { centerSplitPane.insertPane(sp, featurePaneIdx); } else { centerSplitPane.add(sp); } if (!PreferencesManager.getPreferences().getAsBoolean(SHOW_SINGLE_TRACK_PANE_KEY)) { if (sp.getTrackPanel().getTracks().size() == 0) { //If the igv window is too small the divider won't exist and this causes an exception //We solved by setting a minimum size centerSplitPane.setDividerLocation(0, 3); } } }; UIUtilities.invokeAndWaitOnEventThread(runnable); return sp; }