当前位置: 首页>>代码示例>>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;未经允许,请勿转载。