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


Java Pane.setPrefHeight方法代码示例

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


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

示例1: NotifyTab

import javafx.scene.layout.Pane; //导入方法依赖的package包/类
public NotifyTab()
{
    super();
    super.setText("Notification");
    super.setClosable(false);
    
    pane = new Pane();
    box = new VBox();        
    header = new Label();
    desc = new Label();
    
    okButton = new Button("Ok");
    okButton.setPrefWidth(50);
    okButton.setOnMouseClicked(new OkButtonHandler());
    
    box.getChildren().addAll(header, desc, okButton);
    box.setPadding(new Insets(15, 15, 15, 15));
    box.setSpacing(15);
    
    pane.setPrefHeight(AppTabPane.CONTENT_HEIGHT);
    pane.setPrefWidth(AppTabPane.CONTENT_WIDTH);
    pane.getChildren().add(box);
    
    super.setContent(pane);
}
 
开发者ID:BlueGoliath,项目名称:Goliath-Overclocking-Utility-FX,代码行数:26,代码来源:NotifyTab.java

示例2: start

import javafx.scene.layout.Pane; //导入方法依赖的package包/类
@Override
public void start(Stage primaryStage) throws Exception {
    if (primaryStage == null) {
        return;
    }

    /* Layers */
    Group backgroundLayer = new Group();
    Group statesLayer = new Group();
    Group selectionLayer = new Group();

    Pane paintingPane = new Pane(backgroundLayer, statesLayer, selectionLayer);
    paintingPane.setStyle(BACKGROUND_STYLE);

    /* Top-level */
    Pane contentPane = new Pane(paintingPane);
    contentPane.minWidthProperty().bind(contentPane.prefWidthProperty());
    contentPane.maxWidthProperty().bind(contentPane.prefWidthProperty());

    ScrollPane scrollPane = new ScrollPane(contentPane);
    scrollPane.setVbarPolicy(ScrollBarPolicy.ALWAYS);
    scrollPane.setHbarPolicy(ScrollBarPolicy.ALWAYS);
    scrollPane.setFitToHeight(true);
    scrollPane.setFitToWidth(true);
    scrollPane.setPannable(true);

    BorderPane borderPane = new BorderPane(scrollPane);

    primaryStage.setScene(new Scene(borderPane));
    primaryStage.show();
    primaryStage.setHeight(500);
    primaryStage.setWidth(500);

    contentPane.setPrefHeight(200);
    contentPane.setPrefWidth(PANE_WIDTH);

    /* Bind painting pane's height to the content pane */
    paintingPane.minHeightProperty().bind(contentPane.minHeightProperty());
    paintingPane.prefHeightProperty().bind(contentPane.prefHeightProperty());
    paintingPane.maxHeightProperty().bind(contentPane.maxHeightProperty());

    /* We set painting's pane width programmatically */
    paintingPane.minWidthProperty().bind(paintingPane.prefWidthProperty());
    paintingPane.maxWidthProperty().bind(paintingPane.prefWidthProperty());

    paintingPane.setPrefWidth(2000);
    double x = PANE_WIDTH - 2000;
    System.out.println(x);
    paintingPane.relocate(x, 0);

    drawBackground(backgroundLayer, paintingPane);
    drawRectangles(statesLayer);
    drawSelection(selectionLayer, paintingPane);
}
 
开发者ID:lttng,项目名称:lttng-scope,代码行数:55,代码来源:UiModelApp2.java

示例3: start

import javafx.scene.layout.Pane; //导入方法依赖的package包/类
@Override
public void start(Stage primaryStage) throws Exception {
    if (primaryStage == null) {
        return;
    }

    /* Layers */
    Group backgroundLayer = new Group();
    Group statesLayer = new Group();
    Group selectionLayer = new Group();

    /* Top-level */
    Pane contentPane = new Pane(backgroundLayer, statesLayer, selectionLayer);
    contentPane.minWidthProperty().bind(contentPane.prefWidthProperty());
    contentPane.maxWidthProperty().bind(contentPane.prefWidthProperty());
    contentPane.setStyle(BACKGROUND_STYLE);

    ScrollPane scrollPane = new ScrollPane(contentPane);
    scrollPane.setVbarPolicy(ScrollBarPolicy.ALWAYS);
    scrollPane.setHbarPolicy(ScrollBarPolicy.ALWAYS);
    scrollPane.setFitToHeight(true);
    scrollPane.setFitToWidth(true);
    scrollPane.setPannable(true);

    BorderPane borderPane = new BorderPane(scrollPane);

    primaryStage.setScene(new Scene(borderPane));
    primaryStage.show();
    primaryStage.setHeight(500);
    primaryStage.setWidth(500);

    contentPane.setPrefHeight(200);
    contentPane.setPrefWidth(PANE_WIDTH);

    drawBackground(backgroundLayer, contentPane);
    drawRectangles(statesLayer);
    drawSelection(selectionLayer, contentPane);
}
 
开发者ID:lttng,项目名称:lttng-scope,代码行数:39,代码来源:UiModelApp.java

示例4: PromptTab

import javafx.scene.layout.Pane; //导入方法依赖的package包/类
public PromptTab()
{
    super();
    super.setText("Confirmation Required");
    super.setClosable(false);
    
    pane = new Pane();
    contentBox = new VBox(); 
    buttonBox = new HBox();
    header = new Label();
    desc = new Label();
    
    yesButton = new Button("Yes");
    yesButton.setPrefWidth(50);
    
    noButton = new Button("No");
    noButton.setPrefWidth(50);
    
    buttonBox.getChildren().addAll(yesButton, noButton);
    buttonBox.setSpacing(10);
    
    contentBox.getChildren().addAll(header, desc, buttonBox);
    contentBox.setPadding(new Insets(15, 15, 15, 15));
    contentBox.setSpacing(15);
    
    pane.setPrefHeight(AppTabPane.CONTENT_HEIGHT);
    pane.setPrefWidth(AppTabPane.CONTENT_WIDTH);
    pane.getChildren().add(contentBox);
    
    super.setContent(pane);
}
 
开发者ID:BlueGoliath,项目名称:Goliath-Overclocking-Utility-FX,代码行数:32,代码来源:PromptTab.java

示例5: createTraceWidget

import javafx.scene.layout.Pane; //导入方法依赖的package包/类
private Pane createTraceWidget(ITraceExtractor<Step<?>, State<?,?>, TracedObject<?>, Dimension<?>, Value<?>> extractor, String label, ReadOnlyDoubleProperty width) {
	final Pane pane = new Pane();
	pane.setBackground(TRANSPARENT_BACKGROUND);
	final Rectangle rectangle = new Rectangle(0, 0, 0, 12);
	rectangle.setFill(Color.LIGHTGRAY);
	rectangle.widthProperty().bind(width.subtract(10));
	rectangle.setArcHeight(12);
	rectangle.setArcWidth(12);
	Label text = new Label(label);
	text.setTextOverrun(OverrunStyle.ELLIPSIS);
	text.setAlignment(Pos.CENTER);
	text.setMouseTransparent(true);
	text.setTextFill(Color.WHITE);
	text.setFont(FONT);
	text.setMaxWidth(0);
	text.maxWidthProperty().bind(rectangle.widthProperty());
	StackPane layout = new StackPane();
	layout.getChildren().addAll(rectangle, text);
	pane.getChildren().add(layout);
	layout.setTranslateY(13);
	layout.setTranslateX(5);
	pane.setPrefHeight(25);
	pane.setMinHeight(25);
	pane.setMaxHeight(25);

	final Shape arrow1 = createCursor();
	final Shape arrow2 = createCursor();
	arrow1.setTranslateX(5);
	arrow1.setTranslateY(4);
	arrow2.translateXProperty().bind(rectangle.widthProperty().add(5));
	arrow2.setTranslateY(4);
	pane.getChildren().add(arrow1);
	pane.getChildren().add(arrow2);
	
	return pane;
}
 
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:37,代码来源:TraceSectionsDialog.java

示例6: trocarCena

import javafx.scene.layout.Pane; //导入方法依赖的package包/类
public static void trocarCena(Pane novaCena) throws IOException {
	novaCena.setPrefHeight(560);
	novaCena.setPrefWidth(600);
	pane.setCenter(novaCena);
	pane.setCenterShape(false);
	menu.setScene(new Scene(pane));
	menu.setResizable(false);		 
}
 
开发者ID:omniplatypus,项目名称:Projeto-IP2,代码行数:9,代码来源:SubmenuProfessor.java

示例7: trocarCena

import javafx.scene.layout.Pane; //导入方法依赖的package包/类
public static void trocarCena(Pane novaCena) throws IOException {
	
	novaCena.setPrefHeight(560);
	novaCena.setPrefWidth(600);
	pane.setCenter(novaCena);
	pane.setCenterShape(false);
	menu.setScene(new Scene(pane));
	menu.setResizable(false);		 
}
 
开发者ID:omniplatypus,项目名称:Projeto-IP2,代码行数:10,代码来源:Menu.java

示例8: renderAccountCard

import javafx.scene.layout.Pane; //导入方法依赖的package包/类
private void renderAccountCard(Account account) {
	Pane pane = new AnchorPane();
	addCssClass(pane, "account-card");
	pane.setPrefHeight(70.0);
	pane.setMinHeight(70.0);
	pane.setMaxHeight(70.0);
	List<Node> children = pane.getChildren();

	Label domainLabel = new Label(account.getDomain());
	children.add(domainLabel);
	addCssClass(domainLabel, "domain-label");
	UiCommons.assignAnchors(domainLabel, 5.0, 100.0, null, 5.0);

	Label usernameLabel = new Label(account.getUsername());
	children.add(usernameLabel);
	addCssClass(usernameLabel, "username-label");
	UiCommons.assignAnchors(usernameLabel, 10.0, 100.0, 15.0, 10.0);

	Button showButton = new Button("Show");
	children.add(showButton);
	addCssClass(showButton, "control");
	showButton.setFocusTraversable(false);
	showButton.setOnAction(event -> showModal(new PasswordRevealModal(), account));
	UiCommons.assignAnchors(showButton, 5.0, 10.0, null, null);

	MenuButton accountMenu = new MenuButton("\u2699");
	children.add(accountMenu);
	addCssClass(accountMenu, "control");
	accountMenu.setFocusTraversable(false);
	UiCommons.assignAnchors(accountMenu, null, 10.0, 5.0, null);

	List<MenuItem> menuItems = accountMenu.getItems();
	MenuItem updateMenuItem = new MenuItem("Update");
	menuItems.add(updateMenuItem);
	updateMenuItem.setOnAction(event -> showModalWithReload(new SaveAccountModal(), Optional.of(account)));

	MenuItem deleteMenuItem = new MenuItem("Delete");
	menuItems.add(deleteMenuItem);
	deleteMenuItem.setOnAction(event -> showModalWithReload(new DeleteAccountModal(), account));

	viewPane.getChildren()
			.add(pane);
}
 
开发者ID:kana0011,项目名称:symmetrical-memory,代码行数:44,代码来源:MainFormController.java


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