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


Java ScrollBar.setMax方法代碼示例

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


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

示例1: 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

示例2: 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

示例3: horizontalScrollBar

import javafx.scene.control.ScrollBar; //導入方法依賴的package包/類
private ScrollBar horizontalScrollBar(double minw, double minh, double prefw, double prefh, double maxw, double maxh) {
    final ScrollBar scrollBar = new ScrollBar();
    scrollBar.setMinSize(minw, minh);
    scrollBar.setPrefSize(prefw, prefh);
    scrollBar.setMaxSize(maxw, maxh);
    scrollBar.setVisibleAmount(50);
    scrollBar.setMax(xBarWidth-(2*circleRadius));
    return scrollBar;
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:10,代碼來源:ScrollBarSample.java

示例4: verticalScrollBar

import javafx.scene.control.ScrollBar; //導入方法依賴的package包/類
private ScrollBar verticalScrollBar(double minw, double minh, double prefw, double prefh, double maxw, double maxh) {
    final ScrollBar scrollBar = new ScrollBar();
    scrollBar.setMinSize(minw, minh);
    scrollBar.setPrefSize(prefw, prefh);
    scrollBar.setMaxSize(maxw, maxh);
    scrollBar.setVisibleAmount(50);
    scrollBar.setMax(yBarHeight-(2*circleRadius));
    return scrollBar;
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:10,代碼來源:ScrollBarSample.java

示例5: 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

示例6: 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

示例7: 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

示例8: 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

示例9: 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

示例10: 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

示例11: 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

示例12: start

import javafx.scene.control.ScrollBar; //導入方法依賴的package包/類
@Override // Override the start method in the Application class
public void start(Stage primaryStage) {
	MultipleBallPane ballPane = new MultipleBallPane();
	ballPane.setStyle("-fx-border-color: yellow");

	Button btAdd = new Button("+");
	Button btSubtract = new Button("-");
	HBox hBox = new HBox(10);
	hBox.getChildren().addAll(btAdd, btSubtract);
	hBox.setAlignment(Pos.CENTER);

	// Add or remove a ball
	btAdd.setOnAction(e -> ballPane.add());
	btSubtract.setOnAction(e -> ballPane.subtract());

	// Pause and resume animation
	ballPane.setOnMousePressed(e -> ballPane.pause());
	ballPane.setOnMouseReleased(e -> ballPane.play());

	// Use a scroll bar to control animation speed
	ScrollBar sbSpeed = new ScrollBar();
	sbSpeed.setMax(20);
	sbSpeed.setValue(10);
	ballPane.rateProperty().bind(sbSpeed.valueProperty());

	BorderPane pane = new BorderPane();
	pane.setCenter(ballPane);
	pane.setTop(sbSpeed);
	pane.setBottom(hBox);

	// Create a scene and place the in the stage
	Scene scene = new Scene(pane, 250, 150);
	primaryStage.setTitle("Exercise_20_09"); // Set the stage title
	primaryStage.setScene(scene); // Place the scene in the stage
	primaryStage.show(); // Display the stage
}
 
開發者ID:jsquared21,項目名稱:Intro-to-Java-Programming,代碼行數:37,代碼來源:Exercise_20_09.java

示例13: setScrollBarRange

import javafx.scene.control.ScrollBar; //導入方法依賴的package包/類
private void setScrollBarRange( ScrollBar scrollBar, double screenSize, double objectSize ) {
    double range = Math.max( 0, objectSize - screenSize );
    scrollBar.setValue( Math.min( scrollBar.getValue(), range ) );
    scrollBar.setMax( range );
    scrollBar.setBlockIncrement( range/100 );
    scrollBar.setVisibleAmount( range * (screenSize/objectSize) );
}
 
開發者ID:epigenome,項目名稱:iTagPlot,代碼行數:8,代碼來源:MainFormController.java

示例14: 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

示例15: 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


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