use of javafx.scene.control.ScrollPane in project graphysica by Graphysica.
the class Inspecteur method panneauDeroulantVertical.
/**
* Construit un panneau déroulant strictement vertical.
*
* @return le panneau construit.
*/
private static ScrollPane panneauDeroulantVertical() {
final ScrollPane panneau = new ScrollPane();
panneau.setFitToWidth(true);
return panneau;
}
use of javafx.scene.control.ScrollPane in project TeachingInSimulation by ScOrPiOzzy.
the class ResourceViewer method createImageViewer.
/**
* 创建图片浏览
*/
public void createImageViewer() {
HTTPUtils utils = SpringUtil.getBean(HTTPUtils.class);
// Image image = new Image("http://192.168.1.19:8082/Test/1516772514400.png");
String url = utils.getFullPath(ResourceConsts.FTP_RES_PATH + resource.getPath());
if (url == null) {
return;
}
Image image = new Image(url);
ImageView imageView = new ImageView(image);
HBox box = new HBox(imageView);
box.setAlignment(Pos.CENTER);
ScrollPane scrollPane = new ScrollPane(box);
scrollPane.setFitToWidth(true);
scrollPane.setFitToHeight(true);
scrollPane.setPannable(true);
double width = image.getWidth();
double height = image.getHeight();
DoubleProperty zoomProperty = new SimpleDoubleProperty(1);
zoomProperty.addListener(observable -> {
if (height * zoomProperty.get() > viewer.getHeight()) {
return;
}
imageView.setFitWidth(width * zoomProperty.get());
imageView.setFitHeight(height * zoomProperty.get());
});
scrollPane.addEventFilter(ScrollEvent.ANY, new EventHandler<ScrollEvent>() {
@Override
public void handle(ScrollEvent event) {
double delta = event.getDeltaY() / 100;
double zoom = zoomProperty.get();
double zoomDelta = zoom + delta;
if (zoomDelta < 0.5) {
zoomProperty.set(0.5);
} else if (zoomDelta > 2) {
zoomProperty.set(2);
} else {
zoomProperty.set(zoomDelta);
}
}
});
viewer.getChildren().add(scrollPane);
}
use of javafx.scene.control.ScrollPane in project phoenicis by PhoenicisOrg.
the class StepRepresentationMessage method drawStepContent.
@Override
protected void drawStepContent() {
Text textWidget = new Text(textToShow);
textWidget.setId("stepText");
ScrollPane scrollPane = new ScrollPane();
scrollPane.setId("stepScrollPane");
scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
scrollPane.setFitToWidth(true);
scrollPane.setContent(new TextFlow(textWidget));
this.addToContentPane(scrollPane);
VBox.setVgrow(scrollPane, Priority.ALWAYS);
}
use of javafx.scene.control.ScrollPane in project phoenicis by PhoenicisOrg.
the class StepRepresentationPresentation method drawStepContent.
@Override
protected void drawStepContent() {
final String title = this.getParentWizardTitle();
VBox contentPane = new VBox();
contentPane.setId("presentationBackground");
Label titleWidget = new Label(title + "\n\n");
titleWidget.setId("presentationTextTitle");
Text textWidget = new Text(textToShow);
textWidget.setId("presentationText");
TextFlow flow = new TextFlow();
flow.getChildren().add(textWidget);
ScrollPane scrollPane = new ScrollPane();
scrollPane.setId("presentationScrollPane");
scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
scrollPane.setFitToWidth(true);
scrollPane.setContent(flow);
VBox.setVgrow(scrollPane, Priority.ALWAYS);
contentPane.getChildren().add(scrollPane);
getParent().getRoot().setCenter(contentPane);
}
use of javafx.scene.control.ScrollPane in project phoenicis by PhoenicisOrg.
the class ApplicationPanel method populateCenter.
private void populateCenter() {
this.appDescription = new WebView();
this.appDescription.getEngine().loadContent("<body>" + application.getDescription() + "</body>");
themeManager.bindWebEngineStylesheet(appDescription.getEngine().userStyleSheetLocationProperty());
this.installers = new Label(tr("Installers"));
this.installers.getStyleClass().add("descriptionTitle");
this.scriptGrid = new GridPane();
filteredScripts.addListener((InvalidationListener) change -> this.refreshScripts());
this.refreshScripts();
this.miniaturesPane = new HBox();
this.miniaturesPane.getStyleClass().add("appPanelMiniaturesPane");
this.miniaturesPaneWrapper = new ScrollPane(miniaturesPane);
this.miniaturesPaneWrapper.getStyleClass().add("appPanelMiniaturesPaneWrapper");
for (URI miniatureUri : application.getMiniatures()) {
Region image = new Region();
image.getStyleClass().add("appMiniature");
image.setStyle(String.format("-fx-background-image: url(\"%s\");", miniatureUri.toString()));
image.prefHeightProperty().bind(miniaturesPaneWrapper.heightProperty().multiply(0.8));
image.prefWidthProperty().bind(image.prefHeightProperty().multiply(1.5));
miniaturesPane.getChildren().add(image);
}
this.center = new VBox(appDescription, installers, scriptGrid, miniaturesPaneWrapper);
VBox.setVgrow(appDescription, Priority.ALWAYS);
this.setCenter(center);
}
Aggregations