JDK-8101516 : SplitPane divider should support an absolute position
  • Type: Enhancement
  • Component: javafx
  • Sub-Component: controls
  • Affected Version: fx2.0
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2012-01-05
  • Updated: 2015-06-16
  • Resolved: 2012-01-23
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
fx2.1Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
Today, the SplitPane dividers have a relative (percentage) position (between 0 and 1).
It is fine e.g. when one have a single divider at the middle of a window. When the window is resized, the divider is still at the middle.

But with several dividers, we may need an absolute position mode.
For instance, in SB, we have 2 panels (left and right) and a stage view at the middle (see attached test case).
Right and left panels have a min/max sizes, and one can grow/shrink the panels, following the min/max sizes. Fine.
But if one grow the window, we don't want the right and left panels to be resized. We need a way to enable an "absolute position mode" instead of a relative one.
Moreover, we need to be able to have an absolute positioning from either the left or right (vertical divider), top or bottom (horizontal divider).

SplitPane could have a setPositionMode() which can be ABSOLUTE_XXX/RELATIVE enum, and the get/setPosition() would return either a relative position (0..1) or an absolute one.
ABSOLUTE_XXX could be : ABSOLUTE_LEFT, ABSOLUTE_RIGHT, ABSOLUTE_TOP, ABSOLUTE_BOTTOM
Comments
Closed, as API is in 2.1.0b13.
20-02-2012

@Alexander this sounds like a new bug can you file a new jira for this and attach your testcase.
13-02-2012

Solution ignores defined divider position and the prefSize value. Divider is always on on the minSize of the 1st node at the splitpane. splitPane.setDividerPositions(0.4); leftPane.setMinWidth(160); leftPane.setPrefWidth(320); SplitPane.setResizableWithParent(leftPane, false); Stage is maximized, divider position is at 160, expected at 320;
13-02-2012

What is the correct behavior if all panels is not resizable?
30-01-2012

Implements A360 Feature http://oracleplan.oracle.com/goto?ra_=entity&entityType=FEATURE&entityId=794638
24-01-2012

I renamed resizableWithParent() to setResizableWithParent()
23-01-2012

The new API call works, but cannot be persisted this in FXML (see exception below). It should be called setResizableWithParent instead of resizableWithParent. Can't load FXML file, error: com.sun.javafx.fxml.PropertyNotFoundException: Static property "resizableWithParent" does not exist or is read-only. com.sun.javafx.fxml.PropertyNotFoundException: Static property "resizableWithParent" does not exist or is read-only. com.oracle.javafx.authoring.persist.FXMLDocument$InitializeException: FXML Controller class exception in initialize at com.oracle.javafx.authoring.persist.FXMLDocument.load(FXMLDocument.java:114) at com.oracle.javafx.authoring.persist.LoadFxml$2.call(LoadFxml.java:71) at com.oracle.javafx.authoring.persist.LoadFxml.loadElement(LoadFxml.java:142) at com.oracle.javafx.authoring.persist.LoadFxml.loadScreenData(LoadFxml.java:184) at com.oracle.javafx.authoring.Project.forFxml(Project.java:445) at com.oracle.javafx.authoring.Project.forFxml(Project.java:433) at com.oracle.javafx.authoring.DesignerTool.loadFXMLLayout(DesignerTool.java:218) at com.oracle.javafx.authoring.DesignerTool.openExistingFxml(DesignerTool.java:340) at com.oracle.javafx.authoring.VTPopup$17$1.run(VTPopup.java:548) at com.oracle.javafx.authoring.VTPopup$7.run(VTPopup.java:339) at com.oracle.javafx.authoring.util.Utils$2.handle(Utils.java:427) at com.sun.scenario.animation.AbstractMasterTimer.timePulseImpl(AbstractMasterTimer.java:367) at com.sun.scenario.animation.AbstractMasterTimer$MainLoop.run(AbstractMasterTimer.java:280) at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:455) at com.sun.javafx.tk.quantum.QuantumToolkit$8.run(QuantumToolkit.java:326)
23-01-2012

OK / RM OK / Dev - signing off on behalf of Nandini
20-01-2012

OK / SQE
20-01-2012

Good to go. OK / Arch
19-01-2012

This feature and some unit test has already been implemented.
19-01-2012

TDC will be Jan 27th This should not affect the ATR date
18-01-2012

On 1/18/2012 3:01 PM, Mikhail Kondratyev wrote: > Hi Pete, > > We are ok to this CCR. This will cost us 1 day of test development > > thanks, Mikhail
18-01-2012

One of the first things any user is likely to do after launching the Scene Builder is to resize the tool window to best adjust to content size and screen estate. The tool window is based on a SplitPane and has 3 panels (Library/Hierarchy on the left, Content in the middle, Inspector on the right). When resizing the window, the user does not want to resize the left and right panels, but only the Content panel in the middle. (Similarly, when resizing an IDE window, you do not expect the left, right or bottom panels to resize) With the current SplitPane API, there is _no_ way to implement the expected behavior. Instead, all 3 panels will always resize. The current behavior produces a poor impression on the user. It is hence critical to get this RFE in 2.1 for the Beta of SB.
18-01-2012

OK / SQE
18-01-2012

To make sure the feature is ok, please do the following: - From the test case attached, call the new resizableWithParent() with "true" - launch the modified test case - Move the dividers so that the left and right panels have their minimum sizes. Now grow the window width : the panels size should'nt change.
16-01-2012

OK, this should fit our needs, thanks. Any chance this is implemented before the feature freeze ?
11-01-2012

After talking to Jasper he suggested the following api should be added to SplitPane to support this feature. public static void resizableWithParent(Node node, Boolean value); public static Boolean isResizableWithParent(Node node); resizableWithParent() will set a boolean property on the node. If the boolean value is false the panel will not be resized when the SplitPane is resize. By default all panels in a SplitPane are resizable.
11-01-2012

We have a little less than 2 weeks until feature freeze and this feature requires an api approval there may not be enough time to do this for 2.1.
06-01-2012

I have a fix for RT18805 which I am still testing that should fix the window resizing problem.
06-01-2012

This feature is critical for SB.
05-01-2012