/** * Removes the pane, specified by <code>index</code>, from this container. * * @param pane the pane to be removed. */ public void removePane(Component pane) { removePane(indexOfPane(pane)); }
public void showDockablePanel(DockablePaneKey key, boolean show) { final DockablePane dockablePane = dockablePaneMap.get(key); if (multiSplitPane.indexOfPane(dockablePane) < 0 && show) { multiSplitPane.addPane(dockablePane); multiSplitPane.invalidate(); } dockablePane.setShown(show); }
/** * 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; }