/** * Gets the divider locations. * * @return the divider locations. */ public int[] getDividerLocations() { int count = getPaneCount(); if (getPaneCount() == 0) { return new int[0]; } int[] locations = new int[count - 1]; for (int i = 0; i < count - 1; i++) { locations[i] = getDividerLocation(i); } return locations; }
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); } } });
/** * Inserts the specified pane to this container at the given position. Note: Divider is not counted. * * @param pane the pane to be added * @param constraint an object expressing layout constraints for this component * @param index the position at which to insert the component. * @return the component <code>pane</code> */ public Component insertPane(Component pane, Object constraint, int index) { if (index <= 0) { addImpl(pane, constraint, 0); } else if (index >= getPaneCount()) { addImpl(pane, constraint, -1); } else { addImpl(pane, constraint, (index << 1) - 1); } return pane; }
if (Arrays.equals(proportions, _proportions)) return; if (proportions != null && proportions.length != getPaneCount() - 1) throw new IllegalArgumentException( "Must provide one fewer proportions than there are panes: got " + proportions.length + ", expected " + (getPaneCount() - 1)); if (proportions != null) { double sum = 0.0;
int c = ((JideSplitPane) _target).getPaneCount(); double[] p = new double[c - 1]; for (int i = 0; i < p.length; ++i)
/** * 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; } }
int paneCount = _jideSplitPane.getPaneCount(); if (_jideSplitPane.isOneTouchExpandable()) { for (int i = 0; i < paneCount; i++) {
((JideSplitPaneDivider) comp).setJideSplitPane(null); remove(comp); if (_proportions != null && getPaneCount() == _proportions.length) removeProportion(i / 2); changed = true;