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


Java VBox.setPrefHeight方法代码示例

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


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

示例1: draw

import javafx.scene.layout.VBox; //导入方法依赖的package包/类
@Override
public Node draw () {
    VBox container = new VBox(parseString(getString("HUDCushion")));
    container.setPrefWidth(parseString(getString("HUDWidth")));
    container.setPrefHeight(parseString(getString("HUDHeight")));
    addUser(container);
    addAttributes(container);
    return container;
}
 
开发者ID:tomrom95,项目名称:GameAuthoringEnvironment,代码行数:10,代码来源:HeadsUpDisplay.java

示例2: LevelCreatorHolder

import javafx.scene.layout.VBox; //导入方法依赖的package包/类
/**
 * Creates a holder with a reference to the modelData, the authoring Environment data. This data is necessary
 * to have because it contains the LevelData which can be created dynamically throughout
 * @param modelData
 * @param prefHeight Pref height of the pain
 * @param clazz Class of the extension of LevelCreator that you want this LevelCreator to have. 
 */
public LevelCreatorHolder(DeveloperData modelData, double prefHeight, Class<? extends LevelCreator> clazz){
	super();
	this.clazz = clazz;
	this.modelData = modelData;
	
	holder = new VBox();
	holder.setPrefHeight(prefHeight);
	
	this.setContent(holder);
	numLevels = 0;
	levels = new ArrayList<LevelCreator>();
	setUpBox();

}
 
开发者ID:LtubSalad,项目名称:voogasalad-ltub,代码行数:22,代码来源:LevelCreatorHolder.java

示例3: getActionPane

import javafx.scene.layout.VBox; //导入方法依赖的package包/类
private VBox getActionPane(){
 VBox hb = new VBox();
 Text cont= new Text("Contents Frame");
 cont.setFont(Font.font("Andalus", 19));
 
 VBox lcont= new VBox();
 lcont.getChildren().add(cont);
 lcont.setPadding(new Insets(20,0,20,0));
 
 hb.setAlignment(Pos.TOP_LEFT);
 hb.setPadding(new Insets(0,10,10,10));
 hb.setSpacing(10);
 hb.setPrefHeight(40);
 Button upBtn = new Button("The Main Page");
 upBtn.setOnAction(e ->{
timelineUp.play();

 });
 Button downBtn = new Button("Second Page");
 downBtn.setOnAction(e ->{
  timelineDown.play();
 });
 
 Button thirdBtn = new Button("third Page");
 thirdBtn.setOnAction(e ->{
  timelinethree.play();
 });
 
 Button fourthBtn = new Button("fourth Page");
 fourthBtn.setOnAction(e ->{
  timelinefour.play();
 });
 
 upBtn.setMinWidth(160);
 downBtn.setMinWidth(145);
 thirdBtn.setMinWidth(130);
 fourthBtn.setMinWidth(115);
 
 hb.getChildren().addAll(lcont,upBtn, downBtn, thirdBtn, fourthBtn);
 hb.setMinWidth(200);
 return hb;
}
 
开发者ID:mikemacharia39,项目名称:gatepass,代码行数:43,代码来源:Help.java

示例4: setRightBlock

import javafx.scene.layout.VBox; //导入方法依赖的package包/类
public VBox setRightBlock(){
	VBox jobb = new VBox(10);
	jobb.setSpacing(10);
    jobb.setPrefWidth(200);
    jobb.setPrefHeight(500);

    jobb.setLayoutX(WIDTH-200);
    Button gomb = new Button("Játék újrakezdése");
    gomb.setPrefWidth(150);
    gomb.setPadding(new Insets(10, 10, 10, 10));
    gomb.setTranslateX((jobb.getPrefWidth()-gomb.getPrefWidth())/2);
    gomb.setTranslateY(50);
    jobb.setStyle("-fx-background-color: #c2c2d6;");
    jobb.getChildren().add(gomb);
    
    Text manualTitle = new Text("Irányítás:");
    manualTitle.setTranslateX(50);
    manualTitle.setFont(Font.font("Tahoma", FontWeight.NORMAL, 20));
    manualTitle.setTranslateY(100);
    jobb.getChildren().add(manualTitle);
    
    GridPane moveHolder = new GridPane();
    moveHolder.setAlignment(Pos.CENTER);
    moveHolder.setHgap(10);
    moveHolder.setVgap(10);
    moveHolder.setPrefWidth(200);
    moveHolder.setPrefHeight(400);
    
    Text moveUp = new Text("↑ - Felfele lépés");
    moveUp.setTextAlignment(TextAlignment.CENTER);
    moveUp.setFont(Font.font("Tahoma", FontWeight.NORMAL, 20));
    moveHolder.add(moveUp, 0, 0, 2, 1);
    
    Text moveDown = new Text("↓ - Lefele lépés");
    moveDown.setTextAlignment(TextAlignment.CENTER);
    moveDown.setFont(Font.font("Tahoma", FontWeight.NORMAL, 20));
    moveHolder.add(moveDown, 0, 1, 2, 1);
    
    Text moveLeft = new Text("← - Balra lépés");
    moveLeft.setTextAlignment(TextAlignment.CENTER);
    moveLeft.setFont(Font.font("Tahoma", FontWeight.NORMAL, 20));
    moveHolder.add(moveLeft, 0, 2, 2, 1);
    
    Text moveRight = new Text("→ - Jobbra lépés");
    moveRight.setTextAlignment(TextAlignment.CENTER);
    moveRight.setFont(Font.font("Tahoma", FontWeight.NORMAL, 20));
    moveHolder.add(moveRight, 0, 3, 2, 1);
    
    jobb.getChildren().add(moveHolder);
    
    gomb.setOnAction(new EventHandler<ActionEvent>() {
        @Override public void handle(ActionEvent e) {
        	playGround.lepes = 0;
        	playGround.celban = 0;
        	playGround.getDatum(); 

        	playGround.resetPlayGround();
        	
            updatePlayGround();
            
            playGround.nyertes = 0;
            playGround.kezdes = 1;
            
            
                         
        }
    });
    
    return jobb;
}
 
开发者ID:kacshuffle,项目名称:SokobanGame,代码行数:71,代码来源:ViewController.java

示例5: createCells

import javafx.scene.layout.VBox; //导入方法依赖的package包/类
/**
 * Crea le celle per visualizzare i due vettori e le inizializza.
 * @param array array che contiene le informazioni sui nodi visitati e padri.
 */
private static void createCells(Object[] array) {
	Singleton s = Singleton.getInstance();
	ScrollPane sp = null;
	VBox vBox = s.mainViewController.vBoxVisited;
	
	// ho passato il vettore visited
	if (array instanceof Boolean[]) {
		sp = s.mainViewController.scrollPaneVisited;
		vBox = s.mainViewController.vBoxVisited;
	} else {
		// ho passato il vettore dei padri
		sp = s.mainViewController.scrollPaneParents;
		vBox = s.mainViewController.vBoxParents;
	}
	
	vBox.getChildren().clear();
	
	final double width = sp.getWidth();
	final double cellHeight = sp.getHeight() / 10;
	
	for (Integer i = 0; i < array.length; i++) {
    	
    	HBox cell = new HBox();
    	cell.getStyleClass().add("scrollPaneCell");
    	
    	// se quello che sto esaminando è il nodo sorgente allora lo evidenzio
    	if (s.animPrefs.getRoot().getElement().getIndex() == i) {
    		cell.getStyleClass().add("rootNodeCell");
    	}
		
		// incremento l'altezza del VBox
		vBox.setPrefHeight(vBox.getHeight() + cellHeight);
		
		// creo la cella e la aggiungo al VBox
    	cell.setPrefSize(width, cellHeight);
    	cell.getChildren().add(new Text(i.toString()));
    	cell.getChildren().add(new Text(array[i] != null ? array[i].toString() : "null"));
    	cell.setAlignment(Pos.CENTER_LEFT);
    	
    	vBox.getChildren().add(cell);
	}
}
 
开发者ID:steppp,项目名称:Breadth-First-Search,代码行数:47,代码来源:MainController.java


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