Java 类javafx.scene.control.SplitPane.Divider 实例源码

项目:JttDesktop    文件:SplitPaneDividerPositionListener.java   
/**
 * Constructs a new {@link SplitPaneDividerPositionListener}.
 * @param subject the {@link SplitPane} subject to monitor.
 * @param callBack the {@link DividerPositionsChangedCallBack} to trigger.
 */
public SplitPaneDividerPositionListener( SplitPane subject, DividerPositionsChangedCallBack callBack ) {
   this.subject = subject;
   this.positionDividers = new HashSet<>();
   this.commonListener = ( source, old, updated ) -> callBack.dividerPositionsChanged();

   this.subject.getDividers().addListener( ( Change< ? extends Divider > change ) -> updateDividerRegistrations() );
   updateDividerRegistrations();
}
项目:JttDesktop    文件:SplitPaneDividerPositionListenerTest.java   
@Test public void shouldNotCallBackWhenRemovedDividerPositionIsChanged() {
   Divider divider = subject.getDividers().get( 0 );
   subject.getItems().clear();

   divider.setPosition( 0.1 );
   verify( callBack, never() ).dividerPositionsChanged();
}
项目:qupath    文件:QuPathGUI.java   
void addColumn(final int position) {
    SplitPane firstRow = splitPaneRows.get(0);
    double lastDividerPosition = position == 0 ? 0 : firstRow.getDividers().get(position-1).getPosition();
    double nextDividerPosition = position >= firstRow.getItems().size()-1 ? 1 : firstRow.getDividers().get(position).getPosition();

    firstRow.getItems().add(position+1, createViewer().getView());
    Divider firstDivider = firstRow.getDividers().get(position);
    firstDivider.setPosition((lastDividerPosition + nextDividerPosition)/2);
    for (int i = 1; i < splitPaneRows.size(); i++) {
        SplitPane splitRow = splitPaneRows.get(i);
        splitRow.getItems().add(position+1, createViewer().getView());
    }

    refreshDividerBindings();
}
项目:erlyberly    文件:ErlyBerly.java   
private void hideProcsPane(){
    Divider div = splitPane.getDividers().get(0);

    entopDivPosition = div.getPosition();

    div.setPosition(0d);
    splitPane.getItems().remove(0);
}
项目:erlyberly    文件:ErlyBerly.java   
private void showProcsPane(){
    splitPane.getItems().add(0, entopPane);

    Divider div = splitPane.getDividers().get(0);
    div.setPosition(entopDivPosition);
}