/** * Is the split position reversed. By default the split position is measured * by the first region, but if split position is reversed the measuring is * done by the second region instead. * * @since 7.3.6 * @return {@code true} if reversed, {@code false} otherwise. * @see #setSplitPosition(float, boolean) */ public boolean isSplitPositionReversed() { return getSplitterState(false).positionReversed; }
/** * Returns the current minimum position of the splitter, in * {@link #getMinSplitPositionUnit()} units. * * @return the minimum position of the splitter */ public float getMinSplitPosition() { return getSplitterState(false).minPosition; }
/** * Lock the SplitPanels position, disabling the user from dragging the split * handle. * * @param locked * Set <code>true</code> if locked, <code>false</code> otherwise. */ public void setLocked(boolean locked) { getSplitterState().locked = locked; }
/** * Is the SplitPanel handle locked (user not allowed to change split * position by dragging). * * @return <code>true</code> if locked, <code>false</code> otherwise. */ public boolean isLocked() { return getSplitterState(false).locked; }
/** * Returns the current maximum position of the splitter, in * {@link #getMaxSplitPositionUnit()} units. * * @return the maximum position of the splitter */ public float getMaxSplitPosition() { return getSplitterState(false).maxPosition; }
/** * Returns the current position of the splitter, in * {@link #getSplitPositionUnit()} units. * * @return position of the splitter */ public float getSplitPosition() { return getSplitterState(false).position; }
/** * Sets the maximum split position to the given position and unit. If the * split position is reversed, maximum and minimum are also reversed. * * @param pos * the maximum position of the split * @param unit * the unit (from {@link Sizeable}) in which the size is given. * Allowed units are UNITS_PERCENTAGE and UNITS_PIXELS */ public void setMaxSplitPosition(float pos, Unit unit) { setSplitPositionLimits(getSplitterState(false).minPosition, posMinUnit, pos, unit); }
/** * Sets the minimum split position to the given position and unit. If the * split position is reversed, maximum and minimum are also reversed. * * @param pos * the minimum position of the split * @param unit * the unit (from {@link Sizeable}) in which the size is given. * Allowed units are UNITS_PERCENTAGE and UNITS_PIXELS */ public void setMinSplitPosition(float pos, Unit unit) { setSplitPositionLimits(pos, unit, getSplitterState(false).maxPosition, posMaxUnit); }
SplitterState state = getSplitterState();
Unit oldUnit = getSplitPositionUnit(); SplitterState splitterState = getSplitterState(); splitterState.position = pos; splitterState.positionUnit = unit.getSymbol();
+ getMaxSplitPositionUnit()); if (getSplitterState().positionReversed) { design.attr("reversed", true);