本文整理汇总了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());
});
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
}
示例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;
}