/** * Sets the divider locations. * * @param locations the new divider locations. */ public void setDividerLocations(int[] locations) { for (int i = 0; i < locations.length; i++) { int location = locations[i]; setDividerLocation(i, location); } }
/** * Set the divider location. * * @param divider the divider * @param location new location */ public void setDividerLocation(JideSplitPaneDivider divider, int location) { setDividerLocation(indexOfDivider(divider), location); }
/** * Finishes dragging. If it's not continuous layout, clear up the shadow component. * * @param divider the divider * @param location new location */ protected void finishDraggingTo(JideSplitPaneDivider divider, int location) { if (isContinuousLayout() || _nonContinuousLayoutDividerWrapper != null) { stopDragging(); setDividerLocation(divider, location); } }
public void run() { // TODO Resize the data panel to make as much space as possible int h = centerSplitPane.getHeight(); int nPanes = centerSplitPane.getPaneCount(); double prefHeight = 0; for (int i = 0; i < nPanes; i++) { prefHeight += centerSplitPane.getPaneAt(i).getPreferredSize().getHeight(); } double ratio = h / prefHeight; int pos = 0; for (int i = 0; i < nPanes - 1; i++) { pos += (int) (ratio * centerSplitPane.getPaneAt(i).getPreferredSize().getHeight()); centerSplitPane.setDividerLocation(i, pos); } } });
_jideSplitPane.setDividerLocation(JideSplitPaneDivider.this, _lastPosition); _currentState = DEFAULT_STATE; _lastPosition = _jideSplitPane.getDividerLocation(indexOfDivider); int loc = getPreviousDividerLocation(true, false); _jideSplitPane.setDividerLocation(JideSplitPaneDivider.this, loc); _currentState = COLLAPSED_STATE; _jideSplitPane.setDividerLocation(JideSplitPaneDivider.this, _lastPosition); _currentState = DEFAULT_STATE; _lastPosition = _jideSplitPane.getDividerLocation(indexOfDivider); int loc = getNextDividerLocation(true, false); _jideSplitPane.setDividerLocation(JideSplitPaneDivider.this, loc); _currentState = EXPANDED_STATE;
setDividerLocation(divider, location);
y += dh; centerSplitPane.setDividerLocation(i, y); i++;
/** * 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; }