本文整理汇总了Java中javafx.scene.layout.Pane.setMaxSize方法的典型用法代码示例。如果您正苦于以下问题:Java Pane.setMaxSize方法的具体用法?Java Pane.setMaxSize怎么用?Java Pane.setMaxSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.layout.Pane
的用法示例。
在下文中一共展示了Pane.setMaxSize方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: aendereReihenfolge
import javafx.scene.layout.Pane; //导入方法依赖的package包/类
private void aendereReihenfolge(){
Stage stage = new Stage();
Label l = new Label("Reihenfolge festlegen:");
l.setStyle("-fx-text-fill: white");
l.setFont(Font.font(settingsFontSize));
l.setTranslateY(25);
l.setTranslateX(25);
TextField tf = new TextField(String.valueOf(orderId+1));
tf.setFont(Font.font(settingsFontSize-3));
tf.setTranslateX(25);
tf.setTranslateY(60);
Button b = new Button("Speichern");
b.setFont(Font.font(settingsFontSize));
b.setTranslateX(25);
b.setTranslateY(120);
b.setOnAction(e -> {
orderId = Integer.parseInt(tf.getText())-1;
stage.close();
Plugin_Gleisbelegung.sortiereGleiseListener();
});
Pane p = new Pane(l,tf,b);
p.setStyle("-fx-background-color: #303030");
p.setMinSize(500,200);
p.setMaxSize(500, 200);
Scene scene = new Scene(p, 300,200);
stage.setScene(scene);
stage.show();
stage.setAlwaysOnTop(true);
}
示例2: showQRCode
import javafx.scene.layout.Pane; //导入方法依赖的package包/类
@FXML
protected void showQRCode(MouseEvent event) {
// Serialize to PNG and back into an image. Pretty lame but it's the shortest code to write and I'm feeling
// lazy tonight.
final byte[] imageBytes = QRCode
.from(uri())
.withSize(320, 240)
.to(ImageType.PNG)
.stream()
.toByteArray();
Image qrImage = new Image(new ByteArrayInputStream(imageBytes));
ImageView view = new ImageView(qrImage);
view.setEffect(new DropShadow());
// Embed the image in a pane to ensure the drop-shadow interacts with the fade nicely, otherwise it looks weird.
// Then fix the width/height to stop it expanding to fill the parent, which would result in the image being
// non-centered on the screen. Finally fade/blur it in.
Pane pane = new Pane(view);
pane.setMaxSize(qrImage.getWidth(), qrImage.getHeight());
final Main.OverlayUI<ClickableBitcoinAddress> overlay = Main.instance.overlayUI(pane, this);
view.setOnMouseClicked(event1 -> overlay.done());
}
示例3: ControlsPaneController
import javafx.scene.layout.Pane; //导入方法依赖的package包/类
public ControlsPaneController(UIToolBox toolBox) {
this.toolBox = toolBox;
toolBox.getEventBus()
.toObserverable()
.ofType(MediaControlsChangedEvent.class)
.subscribe(e -> updateMediaControlPane(e.get()));
emptyControlsPane = new Pane();
emptyControlsPane.setPrefSize(440, 80);
emptyControlsPane.setMaxSize(440, 80);
emptyControlsPane.setMinSize(440, 80);
Runtime.getRuntime()
.addShutdownHook(new Thread(() -> saveDividerPositions(splitPaneKey, getRoot())));
}
示例4: openLogWindow
import javafx.scene.layout.Pane; //导入方法依赖的package包/类
private void openLogWindow(){
Stage stage = new Stage();
//Label l = new Label("Während deiner aktuellen Sitzung sind Fehler aufgetreten. Durch einen Klick auf Weiter werden deine Log-Datei und deine Anregungen anonym hochgeladen.");
Label l = new Label("Während deiner aktuellen Sitzung sind Fehler aufgetreten. Durch einen Klick auf Weiter wird deine Log-Datei anonym hochgeladen.");
l.setStyle("-fx-text-fill: white");
l.setFont(Font.font(settingsFontSize));
l.setWrapText(true);
l.setMaxWidth(450);
l.setTranslateY(25);
l.setTranslateX(25);
/*TextField ta = new TextField();
ta.setFont(Font.font(settingsFontSize-3));
ta.setTranslateX(25);
ta.setTranslateY(125);
ta.setPrefWidth(450);
ta.setPrefHeight(100);*/
Button bno = new Button("Abbrechen");
bno.setFont(Font.font(settingsFontSize));
bno.setOnAction(e -> stage.close());
bno.setTranslateX(250);
bno.setTranslateY(150);
Button byes = new Button("Weiter");
byes.setFont(Font.font(settingsFontSize));
byes.setTranslateX(150);
byes.setTranslateY(150);
byes.setOnAction(e -> {
byes.setDisable(true);
bno.setDisable(true);
Runnable r = () -> {
sendLogFile(l);
};
new Thread(r).start();
});
Pane p = new Pane(l, byes, bno);
p.setStyle("-fx-background-color: #303030");
p.setMinSize(500,200);
p.setMaxSize(500, 200);
Scene s = new Scene(p,500,200);
stage.setScene(s);
stage.setTitle("Log-Datei senden?");
stage.setAlwaysOnTop(true);
stage.show();
}
示例5: createEmptyTile
import javafx.scene.layout.Pane; //导入方法依赖的package包/类
private void createEmptyTile( final GridPane screenPane, final int x, final int y, final int nbColumns, final int nbRows ) {
final Pane tile = new Pane( );
tile.prefWidthProperty( ).bind( widthProperty( ).add( -( nbColumns + 1 ) * GAP_SPACE ).divide( nbColumns ) );
tile.prefHeightProperty( ).bind( heightProperty( ).add( -( nbRows + 1 ) * GAP_SPACE ).divide( nbRows ) );
tile.setMinSize( USE_PREF_SIZE, USE_PREF_SIZE );
tile.setMaxSize( USE_PREF_SIZE, USE_PREF_SIZE );
screenPane.add( tile, x, y );
}
示例6: createTileFromModel
import javafx.scene.layout.Pane; //导入方法依赖的package包/类
private void createTileFromModel( final GridPane screenPane, final Object model, final int x, final int y, final int nbColumns, final int nbRows ) {
final Pane tile = _nodeFromModelFactory.get( model.getClass( ) ).get( model );
tile.prefWidthProperty( ).bind( widthProperty( ).add( -( nbColumns + 1 ) * GAP_SPACE ).divide( nbColumns ) );
tile.prefHeightProperty( ).bind( heightProperty( ).add( -( nbRows + 1 ) * GAP_SPACE ).divide( nbRows ) );
tile.setMinSize( USE_PREF_SIZE, USE_PREF_SIZE );
tile.setMaxSize( USE_PREF_SIZE, USE_PREF_SIZE );
screenPane.add( tile, x, y );
}