當前位置: 首頁>>代碼示例>>Java>>正文


Java ScrollBar.setMin方法代碼示例

本文整理匯總了Java中javafx.scene.control.ScrollBar.setMin方法的典型用法代碼示例。如果您正苦於以下問題:Java ScrollBar.setMin方法的具體用法?Java ScrollBar.setMin怎麽用?Java ScrollBar.setMin使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javafx.scene.control.ScrollBar的用法示例。


在下文中一共展示了ScrollBar.setMin方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initxScrollbar

import javafx.scene.control.ScrollBar; //導入方法依賴的package包/類
/**
 * Ensures that the scrollbar below the xAxis can only be used within the range of the shown data
 * and that the scrollbar position and shown range are always synchronized.
 */
private void initxScrollbar() {
  ScrollBar scrollBar = view.getXscrollBar();
  NumberAxis globalxAxis = view.getXaxis();
  scrollBar.setMin(0);
  visibleRange.bind(globalxAxis.upperBoundProperty().subtract(globalxAxis.lowerBoundProperty()));
  scrollBar.maxProperty().bind(visibleRange.multiply(-1).add(totalCycleCount));

  globalxAxis.lowerBoundProperty().addListener(change -> {
    scrollBar.setValue(globalxAxis.getLowerBound());
  });

  // I don't know, why it need to be divided by 2 but it seems to work very good this way
  scrollBar.visibleAmountProperty().bind(visibleRange.divide(2));

  scrollBar.valueProperty().addListener(change -> {
    globalxAxis.setUpperBound(scrollBar.getValue() + visibleRange.get());
    globalxAxis.setLowerBound(scrollBar.getValue());
  });
}
 
開發者ID:VerifAPS,項目名稱:stvs,代碼行數:24,代碼來源:TimingDiagramCollectionController.java

示例2: getControlPane

import javafx.scene.control.ScrollBar; //導入方法依賴的package包/類
@Override
public HBox getControlPane() {
    HBox cPane = new HBox();
    VBox radiusBox = new VBox();

    radiusScroll = new ScrollBar();
    radiusScroll.setMin(0);
    radiusScroll.setMax(6);
    radiusScroll.setValue(sphere.getRadius());
    radiusScroll.valueProperty().bindBidirectional(sphere.radiusProperty());

    radiusBox.getChildren().addAll(new Label("Radius"), radiusScroll);

    cPane.getChildren().add(radiusBox);

    return cPane;
}
 
開發者ID:teamfx,項目名稱:openjfx-8u-dev-tests,代碼行數:18,代碼來源:SphereTestApp.java

示例3: getControlsForSubScene

import javafx.scene.control.ScrollBar; //導入方法依賴的package包/類
@Override
protected VBox getControlsForSubScene(SubScene ss) {
    GroupMover targetMover;
    if(ss.getRoot() == rootDLMV.getGroup()){
        targetMover = rootDLMV;
    }else if(ss.getRoot() == rootTLMV.getGroup()){
        targetMover = rootTLMV;
    }else if(ss.getRoot() == rootTRMV.getGroup()){
        targetMover = rootTRMV;
    }else{
        throw new IllegalArgumentException("SubScene does not applicable to this application");
    }
    ScrollBar rotYBar = new ScrollBar();
    VBox controls = new VBox(new HBox(new Label("Rotate"),rotYBar));

    rotYBar.setMin(-360);
    rotYBar.setMax(360);
    rotYBar.setValue(targetMover.rotateYProperty().get());
    rotYBar.valueProperty().bindBidirectional(targetMover.rotateYProperty());

    return controls;
}
 
開發者ID:teamfx,項目名稱:openjfx-8u-dev-tests,代碼行數:23,代碼來源:SubSceneDepthTestApp.java

示例4: createVScrollBar

import javafx.scene.control.ScrollBar; //導入方法依賴的package包/類
protected ScrollBar createVScrollBar()
{
	ScrollBar s = new ScrollBar();
	s.setOrientation(Orientation.VERTICAL);
	s.setManaged(true);
	s.setMin(0.0);
	s.setMax(1.0);
	s.valueProperty().addListener((src,old,val) -> setAbsolutePositionVertical(val.doubleValue()));
	s.addEventFilter(ScrollEvent.ANY, (ev) -> ev.consume());
	return s;
}
 
開發者ID:andy-goryachev,項目名稱:FxEditor,代碼行數:12,代碼來源:FxEditor.java

示例5: createHScrollBar

import javafx.scene.control.ScrollBar; //導入方法依賴的package包/類
protected ScrollBar createHScrollBar()
{
	ScrollBar s = new ScrollBar();
	s.setOrientation(Orientation.HORIZONTAL);
	s.setManaged(true);
	s.setMin(0.0);
	s.setMax(1.0);
	s.valueProperty().addListener((src,old,val) -> setAbsolutePositionHorizontal(val.doubleValue()));
	s.addEventFilter(ScrollEvent.ANY, (ev) -> ev.consume());
	return s;
}
 
開發者ID:andy-goryachev,項目名稱:FxEditor,代碼行數:12,代碼來源:FxEditor.java

示例6: createScroll

import javafx.scene.control.ScrollBar; //導入方法依賴的package包/類
protected ScrollBar createScroll(double min, double max, boolean vertical) {
    ScrollBar scroll = new ScrollBar();
    scroll.setOrientation(vertical ? Orientation.VERTICAL : Orientation.HORIZONTAL);
    scroll.setMin(min);
    scroll.setMax(max);
    return scroll;
}
 
開發者ID:teamfx,項目名稱:openjfx-8u-dev-tests,代碼行數:8,代碼來源:ScrollBarApp.java

示例7: minGreatedThenMaxTest

import javafx.scene.control.ScrollBar; //導入方法依賴的package包/類
@Smoke
@Test(timeout = 300000)
public void minGreatedThenMaxTest() {
    ScrollBar sb = new ScrollBar();
    sb.setMin(100);
    sb.setMax(0);

    sb.setValue(50);

    assertEquals(sb.getMin(), 100, ASSERT_CMP_PRECISION);
    assertEquals(sb.getMax(), 0, ASSERT_CMP_PRECISION);
}
 
開發者ID:teamfx,項目名稱:openjfx-8u-dev-tests,代碼行數:13,代碼來源:ScrollBarTest.java

示例8: getControlPane

import javafx.scene.control.ScrollBar; //導入方法依賴的package包/類
@Override
public HBox getControlPane() {
    HBox cPane = new HBox();
    VBox radiusBox = new VBox();
    VBox heightBox = new VBox();

    radiusScroll = new ScrollBar();
    radiusScroll.setMin(0.1);
    radiusScroll.setMax(6);
    radiusScroll.setValue(cylinder.getRadius());
    radiusScroll.valueProperty().bindBidirectional(cylinder.radiusProperty());

    radiusBox.getChildren().addAll(new Label("Radius"), radiusScroll);


    heightScroll = new ScrollBar();
    heightScroll.setMin(0.1);
    heightScroll.setMax(10);
    heightScroll.setValue(cylinder.getHeight());
    heightScroll.valueProperty().bindBidirectional(cylinder.heightProperty());

    heightBox.getChildren().addAll(new Label("Height"), heightScroll);


    cPane.getChildren().addAll(radiusBox, heightBox);

    return cPane;
}
 
開發者ID:teamfx,項目名稱:openjfx-8u-dev-tests,代碼行數:29,代碼來源:CylinderTestApp.java

示例9: getControlPane

import javafx.scene.control.ScrollBar; //導入方法依賴的package包/類
@Override
public HBox getControlPane() {
    HBox cPane = new HBox();
    VBox widthBox = new VBox();
    VBox heightBox = new VBox();
    VBox depthBox = new VBox();

    depthScroll = new ScrollBar();
    depthScroll.setMin(0);
    depthScroll.setMax(10);
    depthScroll.setValue(box.getDepth());
    depthScroll.valueProperty().bindBidirectional(box.depthProperty());

    depthBox.getChildren().addAll(new Label("depth"), depthScroll);

    heightScroll = new ScrollBar();
    heightScroll.setMin(0);
    heightScroll.setMax(10);
    heightScroll.setValue(box.getHeight());
    heightScroll.valueProperty().bindBidirectional(box.heightProperty());

    heightBox.getChildren().addAll(new Label("height"), heightScroll);

    widthScroll = new ScrollBar();
    widthScroll.setMin(0);
    widthScroll.setMax(10);
    widthScroll.setValue(box.getWidth());
    widthScroll.valueProperty().bindBidirectional(box.widthProperty());

    widthBox.getChildren().addAll(new Label("width"), widthScroll);

    cPane.getChildren().addAll(depthBox, heightBox, widthBox);

    return cPane;
}
 
開發者ID:teamfx,項目名稱:openjfx-8u-dev-tests,代碼行數:36,代碼來源:BoxTestApp.java

示例10: getPage

import javafx.scene.control.ScrollBar; //導入方法依賴的package包/類
@Override
protected void getPage() {
    items = new HashMap<Text, Rectangle>();
    rectHeight = new ScrollBar();
    rectWidth = new ScrollBar();
    rectHeight.setMin(0);
    rectWidth.setMin(0);
    rectHeight.setMax(paneHeight);
    rectWidth.setMax(paneWidth);
    getChildren().addAll(new Label("Height"), rectHeight, new Label("Width"), rectWidth);
}
 
開發者ID:teamfx,項目名稱:openjfx-8u-dev-tests,代碼行數:12,代碼來源:RichTextPropertiesApp.java

示例11: ServiceScroller

import javafx.scene.control.ScrollBar; //導入方法依賴的package包/類
public ServiceScroller() {
  setMaxWidth(Mephisto3.WIDTH);
  sc = new ScrollBar();
  sc.setOrientation(Orientation.HORIZONTAL);
  //this will hide the already invisible scroll buttons
  sc.setPadding(new Insets(0, -20, 0, -20));
  sc.setId("scroller");
  sc.setMin(0);

  sc.setVisibleAmount(0.9);
  setCenter(sc);
}
 
開發者ID:syd711,項目名稱:mephisto_iii,代碼行數:13,代碼來源:ServiceScroller.java

示例12: getSimpleBar

import javafx.scene.control.ScrollBar; //導入方法依賴的package包/類
public static Node getSimpleBar(){
	ScrollBar sb = new ScrollBar();
	sb.setMin(0);
	sb.setMax(100);
	sb.setValue(20);
	sb.setOrientation(Orientation.VERTICAL);
	return sb;
}
 
開發者ID:SaiPradeepDandem,項目名稱:javafx-demos,代碼行數:9,代碼來源:ScrollBarElement.java

示例13: getAppScrollBar

import javafx.scene.control.ScrollBar; //導入方法依賴的package包/類
public static Node getAppScrollBar(Scene scene,final TilePane tp){
	ScrollBar sc = new ScrollBar();
	sc.setLayoutX(scene.getWidth()-sc.getWidth());
       sc.setMin(0);
       sc.setOrientation(Orientation.VERTICAL);
       sc.setPrefHeight(180);
       sc.setMax(550);
       
       sc.valueProperty().addListener(new ChangeListener<Number>() {
           public void changed(ObservableValue<? extends Number> ov,
               Number old_val, Number new_val) {
           		tp.setLayoutY(-new_val.doubleValue());
           }
       });
       
       sc.setStyle(
               "-fx-base: lemonchiffon;"
               + "-fx-border-color: darkgreen; "
               + "-fx-border-insets: -5; "
               + "-fx-border-radius: 10;"
               + "-fx-border-style: dotted;"
               + "-fx-border-width: 2;"
               + "-fx-background-color: #b6e7c9;"
               + "-fx-background-radius: 10;"
          );
       return sc;
}
 
開發者ID:SaiPradeepDandem,項目名稱:javafx-demos,代碼行數:28,代碼來源:ScrollBarElement.java

示例14: restoreState

import javafx.scene.control.ScrollBar; //導入方法依賴的package包/類
public void restoreState(ScrollBar scrollBar) {
    if (value > 0) {
        updateState(scrollBar);
        scrollBar.setMin(getMin());
        scrollBar.setMax(getMax());
        scrollBar.setUnitIncrement(getUnitIncrement());
        scrollBar.setBlockIncrement(getBlockIncrement());
        scrollBar.setValue(value);
    }
}
 
開發者ID:asciidocfx,項目名稱:AsciidocFX,代碼行數:11,代碼來源:ScrollState.java

示例15: setupStatesPane

import javafx.scene.control.ScrollBar; //導入方法依賴的package包/類
private Pane setupStatesPane() {
	final Label titleLabel = new Label("All execution states (0)");
	nbStates.addListener((v, o, n) -> {
		String s = "All execution states (" + n.intValue() + ")";
		Platform.runLater(() -> {
			titleLabel.setText(s);
			titleLabel.setContentDisplay(ContentDisplay.RIGHT);
			final ImageView nodeGraphic = new ImageView();
			nodeGraphic.setImage(playGraphic);
			titleLabel.setGraphic(nodeGraphic);
			isInReplayMode.addListener((val, old, neu) -> {
				if (old != neu) {
					if (neu) {
						nodeGraphic.setImage(replayGraphic);
					} else {
						nodeGraphic.setImage(playGraphic);
					}
				}
			});
		});
	});
	titleLabel.setFont(statesFont);
	VBox.setMargin(titleLabel, HALF_MARGIN_INSETS);
	titleLabel.setAlignment(Pos.CENTER);
	final ScrollBar scrollBar = new ScrollBar();
	scrollBar.setVisibleAmount(1);
	scrollBar.setBlockIncrement(10);
	scrollBar.setMin(0);
	final IntegerBinding statesRange = visibleStatesRange.subtract(1);
	scrollBar.disableProperty().bind(statesRange.lessThanOrEqualTo(0));
	scrollBar.maxProperty().bind(statesRange);
	scrollBar.valueProperty().addListener((v, o, n) -> {
		if (o.intValue() != n.intValue() && n.intValue() != currentState.intValue()) {
			currentState.set(n.intValue());
		}
	});
	currentState.addListener((v, o, n) -> {
		if (o.intValue() != n.intValue() && n.intValue() != scrollBar.valueProperty().intValue()) {
			scrollBar.setValue(n.intValue());
		}
	});
	final HBox hBox = new HBox();
	final Polygon arrow = new Polygon(2.5, 10, 10, 5, 2.5, 0);
	HBox.setMargin(arrow, HALF_MARGIN_INSETS);
	final Label toggleValuesLabel = new Label("Timeline for dynamic information	");
	toggleValuesLabel.setFont(statesFont);
	hBox.setAlignment(Pos.CENTER_LEFT);
	hBox.getChildren().addAll(arrow, toggleValuesLabel);
	hBox.setCursor(Cursor.HAND);
	hBox.setOnMouseClicked((e) -> {
		if (bodyScrollPane.isVisible()) {
			bodyScrollPane.setVisible(false);
			arrow.setRotate(0);
		} else {
			bodyScrollPane.setVisible(true);
			arrow.setRotate(90);
		}
	});
	VBox.setMargin(hBox, HALF_MARGIN_INSETS);
	headerPane.getChildren().addAll(scrollBar, titleLabel, statesPane, hBox);
	VBox.setMargin(statesPane, MARGIN_INSETS);

	return headerPane;
}
 
開發者ID:eclipse,項目名稱:gemoc-studio-modeldebugging,代碼行數:65,代碼來源:MultidimensionalTimelineRenderer.java


注:本文中的javafx.scene.control.ScrollBar.setMin方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。