kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/content/ContentPanelController.java
public void scrollToSelection() {
    // Walk through the selected objects and computes the enclosing bounds.
    final BoundsUnion union = new BoundsUnion();
    final Selection selection = getEditorController().getSelection();
    if (selection.getGroup() instanceof ObjectSelectionGroup) {
      final ObjectSelectionGroup osg = (ObjectSelectionGroup) selection.getGroup();
      for (FXOMObject i : osg.getItems()) {
        final DesignHierarchyMask mask = new DesignHierarchyMask(i);
        final FXOMObject nodeFxomObject = mask.getClosestFxNode();
        if (nodeFxomObject != null) {
          final Node node = (Node) nodeFxomObject.getSceneGraphObject();
          assert node.getLayoutBounds() != null;
          final Bounds nodeBounds = node.localToScene(node.getLayoutBounds(), true /* rootScene */);
          assert nodeBounds != null;
          union.add(nodeBounds);
        }
      }
    }

    if (union.getResult() != null) {
      final Node content = scrollPane.getContent();
      final Bounds sceneEnclosing = union.getResult();
      assert sceneEnclosing.getMinZ() == 0.0; // Side effect of SubScene
      assert sceneEnclosing.getMaxZ() == 0.0;
      final Bounds localEnclosing = content.sceneToLocal(sceneEnclosing, true /* rootScene */);
      assert localEnclosing != null;
      final ScrollPaneBooster spb = new ScrollPaneBooster(scrollPane);
      spb.scrollTo(localEnclosing);
    }
  }
/** Scrolls this content panel so that the selected objects are visible. */
Scrolls this content panel so that the selected objects are visible.
Scrolls this content panel so that the selected objects are visible .
public void scrollToSelection() {
    final BoundsUnion union = new BoundsUnion();
    final Selection selection = getEditorController().getSelection();
    if (selection.getGroup() instanceof ObjectSelectionGroup) {
      final ObjectSelectionGroup osg = (ObjectSelectionGroup) selection.getGroup();
      for (FXOMObject i : osg.getItems()) {
        final DesignHierarchyMask mask = new DesignHierarchyMask(i);
        final FXOMObject nodeFxomObject = mask.getClosestFxNode();
        if (nodeFxomObject != null) {
          final Node node = (Node) nodeFxomObject.getSceneGraphObject();
          assert node.getLayoutBounds() != null;
          final Bounds nodeBounds = node.localToScene(node.getLayoutBounds(), true /* rootScene */);
          assert nodeBounds != null;
          union.add(nodeBounds);
        }
      }
    }
    if (union.getResult() != null) {
      final Node content = scrollPane.getContent();
      final Bounds sceneEnclosing = union.getResult();
      assert sceneEnclosing.getMinZ() == 0.0; 
      assert sceneEnclosing.getMaxZ() == 0.0;
      final Bounds localEnclosing = content.sceneToLocal(sceneEnclosing, true /* rootScene */);
      assert localEnclosing != null;
      final ScrollPaneBooster spb = new ScrollPaneBooster(scrollPane);
      spb.scrollTo(localEnclosing);
    }
  }
public void scrollToSelection ( ) { final BoundsUnion union = new BoundsUnion ( ) ; final Selection selection = getEditorController ( ) . getSelection ( ) ; if ( selection . getGroup ( ) instanceof ObjectSelectionGroup ) { final ObjectSelectionGroup osg = ( ObjectSelectionGroup ) selection . getGroup ( ) ; for ( FXOMObject i : osg . getItems ( ) ) { final DesignHierarchyMask mask = new DesignHierarchyMask ( i ) ; final FXOMObject nodeFxomObject = mask . getClosestFxNode ( ) ; if ( nodeFxomObject != null ) { final Node node = ( Node ) nodeFxomObject . getSceneGraphObject ( ) ; assert node . getLayoutBounds ( ) != null ; final Bounds nodeBounds = node . localToScene ( node . getLayoutBounds ( ) , true /* rootScene */ ) ; assert nodeBounds != null ; union . add ( nodeBounds ) ; } } } if ( union . getResult ( ) != null ) { final Node content = scrollPane . getContent ( ) ; final Bounds sceneEnclosing = union . getResult ( ) ; assert sceneEnclosing . getMinZ ( ) == 0.0 ; assert sceneEnclosing . getMaxZ ( ) == 0.0 ; final Bounds localEnclosing = content . sceneToLocal ( sceneEnclosing , true /* rootScene */ ) ; assert localEnclosing != null ; final ScrollPaneBooster spb = new ScrollPaneBooster ( scrollPane ) ; spb . scrollTo ( localEnclosing ) ; } }
Scrolls this content panel so that the selected objects are visible.
Scrolls this content panel so that the selected objects are visible .
// Walk through the selected objects and computes the enclosing bounds. // Side effect of SubScene