当前位置: 首页>>代码示例>>Java>>正文


Java ScrollBar.setVisibleAmount方法代码示例

本文整理汇总了Java中javafx.scene.control.ScrollBar.setVisibleAmount方法的典型用法代码示例。如果您正苦于以下问题:Java ScrollBar.setVisibleAmount方法的具体用法?Java ScrollBar.setVisibleAmount怎么用?Java ScrollBar.setVisibleAmount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.scene.control.ScrollBar的用法示例。


在下文中一共展示了ScrollBar.setVisibleAmount方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setTextAreaHeight

import javafx.scene.control.ScrollBar; //导入方法依赖的package包/类
@Deprecated
private void setTextAreaHeight() {
    // elements
    Region content = (Region) messageText.lookup(".content");
    ScrollBar scrollBarv = (ScrollBar) messageText.lookup(".scroll-bar:vertical");
    // get the height of content
    double height = MINIMUM_HEIGHT;
    if (messageText.getText().length() > 10) {
        Insets padding = messageText.getPadding();
        height = content.getHeight() + padding.getTop() + padding.getBottom();
    }
    // set height
    height = Math.max(MINIMUM_HEIGHT, height);
    height = Math.min(MAXIMUM_HEIGHT, height);
    messageText.setMinHeight(height);
    messageText.setPrefHeight(height);
    // enable or the scroll bar
    scrollBarv.setVisibleAmount(MAXIMUM_HEIGHT);
}
 
开发者ID:dipu-bd,项目名称:Tuntuni,代码行数:20,代码来源:MessagingController.java

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

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

示例4: drawNode

import javafx.scene.control.ScrollBar; //导入方法依赖的package包/类
@Override
public Node drawNode() {
    ScrollBar scroll = createScroll(0, 100, vertical);
    scroll.setVisibleAmount(amount);
    if (Double.compare(scroll.getVisibleAmount(), amount) != 0) {
        reportGetterFailure("Slider.getVisibleAmount()");
    }
    return scroll;
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:10,代码来源:ScrollBarApp.java

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

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

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

示例8: ContextMenu

import javafx.scene.control.ScrollBar; //导入方法依赖的package包/类
/**
 * Constructor for the ContextMenu.
 *
 * @param height Height
 * @param width  Width
 */
public ContextMenu(final double height, final double width) {

    this.setMinHeight(height);
    this.setMinWidth(width);
    this.setPrefHeight(height);
    this.setPrefWidth(width);


    fullscreenBtn = new FloatingButton(new SVGIcon(MaterialIcon.FULLSCREEN, Constants.MIDDLE_ICON, true));

    settingsBtn = new FloatingButton(new SVGIcon(MaterialDesignIcon.SETTINGS, Constants.MIDDLE_ICON, true));

    HBox floatingButtons = new HBox(20.0, settingsBtn, fullscreenBtn);
    floatingButtons.setAlignment(Pos.TOP_LEFT);
    floatingButtons.translateYProperty().set(Constants.FLOATING_BUTTON_OFFSET_Y);
    floatingButtons.translateXProperty().set(Constants.FLOATING_BUTTON_OFFSET_X);


    roomInfo = new Label("Select a Room");
    roomInfo.setAlignment(Pos.TOP_CENTER);
    roomInfo.getStyleClass().clear();
    roomInfo.getStyleClass().add("headline");

    verticalScrollPane = new ScrollPane();
    verticalScrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
    verticalScrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);

    final ScrollBar scrollBar = new ScrollBar();
    scrollBar.setOrientation(Orientation.VERTICAL);
    final HiddenSidesPane hiddenSidesPane = new HiddenSidesPane();
    hiddenSidesPane.setContent(verticalScrollPane);
    hiddenSidesPane.setRight(scrollBar);
    hiddenSidesPane.setTriggerDistance(Constants.TRIGGER_DISTANCE);
    hiddenSidesPane.getStyleClass().add("hidden-sides-pane");

    scrollBar.maxProperty().bind(verticalScrollPane.vmaxProperty());
    scrollBar.minProperty().bind(verticalScrollPane.vminProperty());

    verticalScrollPane.vvalueProperty().bindBidirectional(scrollBar.valueProperty());

    //TODO: Delete completely - at the moment it is just not added to the rest
    contextSortingPane = new ContextSortingPane(width + Constants.INSETS);
    contextSortingPane.setMaxWidth(Double.MAX_VALUE);

    titledPaneContainer = new TitledUnitPaneContainer();

    verticalScrollPane.setFitToWidth(true);
    verticalScrollPane.setContent(titledPaneContainer);
    //TODO: Find a nicer way to scale the size of the scroll bar thumb
    scrollBar.setVisibleAmount(0.25);

    this.getChildren().addAll(floatingButtons, roomInfo, hiddenSidesPane);
    //VBox.setVgrow(contextSortingPane, Priority.ALWAYS);

    this.getStyleClass().addAll("detail-menu");
}
 
开发者ID:openbase,项目名称:bco.bcozy,代码行数:63,代码来源:ContextMenu.java


注:本文中的javafx.scene.control.ScrollBar.setVisibleAmount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。