本文整理汇总了Java中javafx.scene.control.ScrollPane.ScrollBarPolicy类的典型用法代码示例。如果您正苦于以下问题:Java ScrollBarPolicy类的具体用法?Java ScrollBarPolicy怎么用?Java ScrollBarPolicy使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ScrollBarPolicy类属于javafx.scene.control.ScrollPane包,在下文中一共展示了ScrollBarPolicy类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createTextArea
import javafx.scene.control.ScrollPane.ScrollBarPolicy; //导入依赖的package包/类
private Node createTextArea(boolean selectable, boolean editable) {
textArea = new TextArea();
textArea.setPrefRowCount(4);
textArea.setEditable(editable);
textArea.textProperty().addListener((observable, oldValue, newValue) -> {
text = textArea.getText();
});
textArea.setText(text);
ScrollPane scrollPane = new ScrollPane(textArea);
scrollPane.setFitToWidth(true);
scrollPane.setFitToHeight(true);
scrollPane.setHbarPolicy(ScrollBarPolicy.NEVER);
scrollPane.setVbarPolicy(ScrollBarPolicy.ALWAYS);
HBox.setHgrow(scrollPane, Priority.ALWAYS);
return scrollPane;
}
示例2: MonthBarChart
import javafx.scene.control.ScrollPane.ScrollBarPolicy; //导入依赖的package包/类
public MonthBarChart(ArrayList<MonthInOutSum> monthInOutSums, String currency)
{
if(monthInOutSums == null)
{
this.monthInOutSums = new ArrayList<>();
}
else
{
this.monthInOutSums = monthInOutSums;
}
this.currency = currency;
ScrollPane scrollPane = new ScrollPane();
scrollPane.setVbarPolicy(ScrollBarPolicy.NEVER);
scrollPane.setFocusTraversable(false);
scrollPane.setStyle("-fx-background-color: transparent; -fx-background-insets: 0; -fx-border-color: transparent; -fx-border-width: 0; -fx-border-insets: 0;");
scrollPane.setPadding(new Insets(0, 0, 10, 0));
HBox generatedChart = generate();
scrollPane.setContent(generatedChart);
generatedChart.prefHeightProperty().bind(scrollPane.heightProperty().subtract(30));
this.getChildren().add(scrollPane);
VBox.setVgrow(scrollPane, Priority.ALWAYS);
this.getChildren().add(generateLegend());
}
示例3: showOutput
import javafx.scene.control.ScrollPane.ScrollBarPolicy; //导入依赖的package包/类
/**
* Prints the content of the tracking log into a new Stage.
*/
public void showOutput() {
Text show = new Text(output());
ScrollPane window = new ScrollPane();
window.setContent(show);
window.setHbarPolicy(ScrollBarPolicy.AS_NEEDED);
window.setVbarPolicy(ScrollBarPolicy.AS_NEEDED);
Scene scene = new Scene(window, 400, 600);
Stage stage = new Stage();
stage.setTitle("Tracking history");
stage.setScene(scene);
stage.show();
}
开发者ID:ProPra16,项目名称:programmierpraktikum-abschlussprojekt-nimmdochirgendeinennamen,代码行数:19,代码来源:Tracker.java
示例4: generateMoveTreePane
import javafx.scene.control.ScrollPane.ScrollBarPolicy; //导入依赖的package包/类
private ScrollPane generateMoveTreePane() {
movePane = new GridPane();
movePane.setPadding(new Insets(0, 0, 0, 0));
movePane.setStyle("-fx-background-color: white");
treePaneScrollPane = new ScrollPane(movePane);
treePaneScrollPane.setPrefHeight(150);
treePaneScrollPane.setHbarPolicy(ScrollBarPolicy.AS_NEEDED);
treePaneScrollPane.setVbarPolicy(ScrollBarPolicy.AS_NEEDED);
movePane.setMinWidth(640);
movePane.setMaxWidth(Control.USE_PREF_SIZE);
return treePaneScrollPane;
}
示例5: updateCameraTabs
import javafx.scene.control.ScrollPane.ScrollBarPolicy; //导入依赖的package包/类
private void updateCameraTabs() {
cameraTabPane.getTabs().clear();
cameraGroups.clear();
eventSelectionsPerTab.clear();
for (final String cameraName : currentSession.getEvents().keySet()) {
final Group canvas = new Group();
final ScrollPane scrollPane = new ScrollPane(canvas);
scrollPane.setPrefSize(cameraTabPane.getPrefWidth(), cameraTabPane.getPrefHeight());
scrollPane.setHbarPolicy(ScrollBarPolicy.AS_NEEDED);
scrollPane.setVbarPolicy(ScrollBarPolicy.AS_NEEDED);
cameraGroups.put(cameraName, new SessionCanvasManager(canvas, config));
final Tab cameraTab = new Tab(cameraName);
cameraTab.setContent(scrollPane);
cameraTabPane.getTabs().add(cameraTab);
}
}
示例6: start
import javafx.scene.control.ScrollPane.ScrollBarPolicy; //导入依赖的package包/类
@Override
public void start(final Stage stage)
{
final SplitPane split = new SplitPane();
Label label = new Label("Left");
label.setMaxWidth(Double.MAX_VALUE);
label.setStyle(DEBUG_STYLE);
final StackPane left = new StackPane(label);
label = new Label("Some long text in the right panel");
label.setStyle(DEBUG_STYLE);
label.setMaxWidth(Double.MAX_VALUE);
label.setPrefWidth(Double.MAX_VALUE);
final ScrollPane scroll = new ScrollPane(label);
scroll.setHbarPolicy(ScrollBarPolicy.NEVER);
scroll.setVbarPolicy(ScrollBarPolicy.ALWAYS);
final StackPane right = new StackPane(scroll);
split.getItems().addAll(left, right);
split.setDividerPositions(0.5);
final Scene scene = new Scene(split, 800, 700);
stage.setScene(scene);
stage.show();
}
示例7: buildUISettingsOptionsView
import javafx.scene.control.ScrollPane.ScrollBarPolicy; //导入依赖的package包/类
private Node buildUISettingsOptionsView() {
final TitledBorderPane displayOptions = new TitledBorderPane(
"Display Options", buildDisplayOptionsPane(), BorderStyle.COMPACT,
TitledBorderPane.SECONDARY_BORDER_COLOR_STYLE);
final TitledBorderPane systemTrayOptions = new TitledBorderPane(
"System Tray", buildSystemTrayOptionsPane(), BorderStyle.COMPACT,
TitledBorderPane.SECONDARY_BORDER_COLOR_STYLE);
final TitledBorderPane torrentAdditionOptions = new TitledBorderPane(
"When Adding Torrents", buildOnTorrentAdditionOptionsPane(), BorderStyle.COMPACT,
TitledBorderPane.SECONDARY_BORDER_COLOR_STYLE);
final TitledBorderPane doubleClickActionsOptions = new TitledBorderPane(
"Actions for Double Click", buildDoubleClickActionsOptionPane(), BorderStyle.COMPACT,
TitledBorderPane.SECONDARY_BORDER_COLOR_STYLE);
final VBox content = new VBox();
content.getStyleClass().add(GuiProperties.VERTICAL_LAYOUT_SPACING);
content.getChildren().addAll(displayOptions, systemTrayOptions, torrentAdditionOptions,
doubleClickActionsOptions);
final ScrollPane contentScroll = new ScrollPane(content);
contentScroll.setHbarPolicy(ScrollBarPolicy.NEVER);
contentScroll.setVbarPolicy(ScrollBarPolicy.AS_NEEDED);
contentScroll.setFitToWidth(true);
return contentScroll;
}
示例8: buildOptionsView
import javafx.scene.control.ScrollPane.ScrollBarPolicy; //导入依赖的package包/类
private Node buildOptionsView() {
final TitledBorderPane basicOptions = new TitledBorderPane(
"Basic BitTorrent Features", buildBasicOptionsPane(), BorderStyle.COMPACT,
TitledBorderPane.SECONDARY_BORDER_COLOR_STYLE);
final TitledBorderPane trackerOptions = new TitledBorderPane(
"Tracker Features", buildTrackerOptionsPane(), BorderStyle.COMPACT,
TitledBorderPane.SECONDARY_BORDER_COLOR_STYLE);
final TitledBorderPane encryptionOptions = new TitledBorderPane(
"Protocol Encryption", buildEncryptionOptionsPane(), BorderStyle.COMPACT,
TitledBorderPane.SECONDARY_BORDER_COLOR_STYLE);
final VBox content = new VBox();
content.getStyleClass().add(GuiProperties.VERTICAL_LAYOUT_SPACING);
content.getChildren().addAll(basicOptions, trackerOptions, encryptionOptions);
final ScrollPane contentScroll = new ScrollPane(content);
contentScroll.setHbarPolicy(ScrollBarPolicy.NEVER);
contentScroll.setVbarPolicy(ScrollBarPolicy.AS_NEEDED);
contentScroll.setFitToWidth(true);
return contentScroll;
}
示例9: buildUiExtrasOptionsView
import javafx.scene.control.ScrollPane.ScrollBarPolicy; //导入依赖的package包/类
private Node buildUiExtrasOptionsView() {
final TitledBorderPane themeOptions = new TitledBorderPane(
"Theme Options", buildThemeOptionsPane(), BorderStyle.COMPACT,
TitledBorderPane.SECONDARY_BORDER_COLOR_STYLE);
final VBox content = new VBox();
content.getStyleClass().add(GuiProperties.VERTICAL_LAYOUT_SPACING);
content.getChildren().addAll(themeOptions);
final ScrollPane contentScroll = new ScrollPane(content);
contentScroll.setHbarPolicy(ScrollBarPolicy.NEVER);
contentScroll.setVbarPolicy(ScrollBarPolicy.AS_NEEDED);
contentScroll.setFitToWidth(true);
return contentScroll;
}
示例10: build
import javafx.scene.control.ScrollPane.ScrollBarPolicy; //导入依赖的package包/类
@Override
protected Node build() {
final VBox content = new VBox();
content.getStyleClass().add(GuiProperties.VERTICAL_LAYOUT_SPACING);
content.getChildren().addAll(
new TitledBorderPane("Listening Port", buildPortSettingsPane(), BorderStyle.COMPACT,
TitledBorderPane.SECONDARY_BORDER_COLOR_STYLE),
new TitledBorderPane("Network Interface", buildNetworkInterfaceSettingsPane(), BorderStyle.COMPACT,
TitledBorderPane.SECONDARY_BORDER_COLOR_STYLE));
final ScrollPane contentScroll = new ScrollPane(content);
contentScroll.setHbarPolicy(ScrollBarPolicy.NEVER);
contentScroll.setVbarPolicy(ScrollBarPolicy.AS_NEEDED);
contentScroll.setFitToWidth(true);
return contentScroll;
}
示例11: showManageJobLayout
import javafx.scene.control.ScrollPane.ScrollBarPolicy; //导入依赖的package包/类
private void showManageJobLayout() {
clearAllLayout();
try {
FXMLLoader loader = new FXMLLoader();
loader.setLocation(CviaApp.class.getResource("/JobDescriptionList.fxml"));
jdPane = (ScrollPane) loader.load();
JobDescriptionListController jdListController = loader.getController();
jdPane.setLayoutX(200);
jdPane.setLayoutY(0);
jdPane.setVbarPolicy(ScrollBarPolicy.AS_NEEDED);
jdPane.setHbarPolicy(ScrollBarPolicy.AS_NEEDED);
rootPane.getChildren().add(jdPane);
} catch (IOException e) {
e.printStackTrace();
}
}
示例12: showTable
import javafx.scene.control.ScrollPane.ScrollBarPolicy; //导入依赖的package包/类
private void showTable(DecisionTable dt) {
Stage stage = new Stage();
stage.setWidth(dimension);
stage.setHeight(dimension);
stage.setResizable(false);
stage.initStyle(StageStyle.UTILITY);
Group root = new Group();
ScrollPane sp = new ScrollPane();
sp.setContent(dt);
sp.setPannable(true);
sp.setMaxHeight(maxDimensionSize);
sp.setMaxWidth(maxDimensionSize);
sp.setPrefSize(dimension-barOffset, dimension-barOffset);
sp.setVbarPolicy(ScrollBarPolicy.ALWAYS);
sp.setHbarPolicy(ScrollBarPolicy.ALWAYS);
Scene s = new Scene(root);
root.getChildren().add(sp);
stage.setScene(s);
stage.show();
return;
}
示例13: buildContent
import javafx.scene.control.ScrollPane.ScrollBarPolicy; //导入依赖的package包/类
private ScrollPane buildContent() {
final ScrollPane scrollPane = new ScrollPane();
scrollPane.setHbarPolicy(ScrollBarPolicy.NEVER);
scrollPane.setVbarPolicy(ScrollBarPolicy.ALWAYS);
scrollPane.setFitToHeight(true);
scrollPane.setFitToWidth(true);
final TilePane pane = new TilePane();
pane.setOnScroll(scrollEvent -> {
final double deltaY = scrollEvent.getDeltaY() * 2.0D;
final double height = BrowserTab.this.getCustomContent().getBoundsInLocal().getHeight();
final double vValue = BrowserTab.this.getCustomContent().getVvalue();
BrowserTab.this.getCustomContent().setVvalue(vValue - deltaY / height);
});
pane.setPrefColumns(PREFERED_COLUMNS);
pane.setVgap(ITEM_GAP);
pane.setHgap(ITEM_GAP);
pane.setPadding(new Insets(ITEM_GAP));
this.activeItemsProperty().addListener((ListChangeListener.Change<? extends ITwitchItem> c) -> pane
.getChildren().setAll(convertToNodeList(this.activeItemsProperty().get())));
scrollPane.setContent(pane);
return scrollPane;
}
示例14: WorkArea
import javafx.scene.control.ScrollPane.ScrollBarPolicy; //导入依赖的package包/类
@Inject
public WorkArea(List<Module> modules, QuickbarModuleButtonsPane modulesButtons) {
getStyleClass().addAll(Style.CONTAINER.css());
setId("work-area");
for (Module module : modules) {
this.modules.put(module.id(), module);
}
fade.setFromValue(0);
fade.setToValue(1);
center.setHbarPolicy(ScrollBarPolicy.NEVER);
center.setFitToWidth(true);
center.setFitToHeight(true);
setCenter(center);
setLeft(new QuickbarPane(modulesButtons));
eventStudio().addAnnotatedListeners(this);
}
示例15: NewsPanel
import javafx.scene.control.ScrollPane.ScrollBarPolicy; //导入依赖的package包/类
public NewsPanel() {
getStyleClass().add("news-panel");
getStyleClass().addAll(Style.CONTAINER.css());
Button closeButton = GlyphsDude.createIconButton(FontAwesomeIcon.TIMES);
closeButton.getStyleClass().addAll("close-button");
closeButton.setOnAction(e -> eventStudio().broadcast(HideNewsPanelRequest.INSTANCE));
Label titleLabel = new Label(DefaultI18nContext.getInstance().i18n("What's new"));
titleLabel.setPrefWidth(Integer.MAX_VALUE);
titleLabel.getStyleClass().add("news-panel-title");
StackPane top = new StackPane(titleLabel, closeButton);
top.setAlignment(Pos.TOP_RIGHT);
scroll.getStyleClass().add("scrollable-news");
scroll.setHbarPolicy(ScrollBarPolicy.NEVER);
scroll.setFitToHeight(true);
scroll.setFitToWidth(true);
getChildren().addAll(top, scroll);
eventStudio().addAnnotatedListeners(this);
}