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


Java ColumnConstraints类代码示例

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


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

示例1: start

import javafx.scene.layout.ColumnConstraints; //导入依赖的package包/类
public void start(Stage primaryStage) {

        canvas = new GridPane();
        canvas.setPrefSize(800,800);
        canvas.setGridLinesVisible(true);
        final int numCols = 9 ;
        final int numRows = 8 ;
        for (int i = 0; i < numCols; i++) {
            ColumnConstraints colConst = new ColumnConstraints();
            colConst.setPercentWidth(100.0 / numCols);
            canvas.getColumnConstraints().add(colConst);
        }
        for (int i = 0; i < numRows; i++) {
            RowConstraints rowConst = new RowConstraints();
            rowConst.setPercentHeight(100.0 / numRows);
            canvas.getRowConstraints().add(rowConst);
        }


        scene = new Scene(canvas, 800, 800);
        primaryStage.setScene(scene);
        bubble = new Bubble(scene);
        primaryStage.show();

        scene.setFill(createGridPattern());


    }
 
开发者ID:schwabdidier,项目名称:GazePlay,代码行数:29,代码来源:Circles_handler2.java

示例2: loadGridData

import javafx.scene.layout.ColumnConstraints; //导入依赖的package包/类
public static void loadGridData(GridPane grid,Main main, DescriptionEntretien d){
	// Grid initialisation ( reset )
	grid.getColumnConstraints().clear();
	// Grid Creation
	// for each moment of the interview we add a collumn
	for (int j = 0; j < d.getNumberCols(); j++) {
		ColumnConstraints c = new ColumnConstraints();
		c.setMinWidth(180);
		c.setPrefWidth(Control.USE_COMPUTED_SIZE);
		c.setMaxWidth(Control.USE_COMPUTED_SIZE);
		grid.getColumnConstraints().add(c);
	}
	
	for (int i = 0; i < 1; i++) {
		for (int j = 0; j < d.getNumberCols(); j++) {
			// Creation of the Moment box			
			MomentExpVBox mp = new MomentExpVBox(main);
			addMomentExpBorderPaneListener(mp, main);
			
			MomentExperience mom;
			boolean hasMoment = false;
			if (main.getCurrentDescription() != null) {
				for (MomentExperience m : d.getMoments()) {
					if(m.getGridCol() == j){
						mom = m;
						mp.setMoment(mom);
						hasMoment = true;
					}
				}
			}
			if (hasMoment) {
				mp.showMoment();
				mp.LoadMomentData();
				loadTypes(mp, main);
				loadSousMoment(mp,main);
			}				
			grid.add(mp,j,i);
		}
	}
}
 
开发者ID:coco35700,项目名称:uPMT,代码行数:41,代码来源:MainViewTransformations.java

示例3: EventLogger

import javafx.scene.layout.ColumnConstraints; //导入依赖的package包/类
public EventLogger() {
    setVisible(false);
    setPrefHeight(30);
    setPrefWidth(612);

    ColumnConstraints column1 = new ColumnConstraints();
    column1.setPercentWidth(85);
    column1.setHgrow(Priority.SOMETIMES);

    ColumnConstraints column2 = new ColumnConstraints();
    column2.setPercentWidth(15);
    column2.setHgrow(Priority.SOMETIMES);

    getColumnConstraints().clear();
    getColumnConstraints().addAll(column1, column2);

    RowConstraints row = new RowConstraints(10, 40, 40);
    row.setVgrow(Priority.SOMETIMES);

    getRowConstraints().clear();
    getRowConstraints().add(row);

    eventLabel = buildEventLabel();
    setConstraints(eventLabel, 0, 0);
    GridPane.setMargin(eventLabel, new Insets(0, 10, 0, 10));

    serverLabel = new Label();
    setConstraints(serverLabel, 1, 0);
    GridPane.setMargin(serverLabel, new Insets(0, 10, 0, 10));
    getChildren().addAll(eventLabel, serverLabel);
}
 
开发者ID:Kindrat,项目名称:cassandra-client,代码行数:32,代码来源:EventLogger.java

示例4: WebViewPane

import javafx.scene.layout.ColumnConstraints; //导入依赖的package包/类
public WebViewPane() {
    VBox.setVgrow(this, Priority.ALWAYS);
    setMaxWidth(Double.MAX_VALUE);
    setMaxHeight(Double.MAX_VALUE);

    WebView view = new WebView();
    view.setMinSize(500, 400);
    view.setPrefSize(500, 400);
    final WebEngine eng = view.getEngine();
    eng.load("http://www.oracle.com/us/index.html");
    final TextField locationField = new TextField("http://www.oracle.com/us/index.html");
    locationField.setMaxHeight(Double.MAX_VALUE);
    Button goButton = new Button("Go");
    goButton.setDefaultButton(true);
    EventHandler<ActionEvent> goAction = new EventHandler<ActionEvent>() {
        @Override public void handle(ActionEvent event) {
            eng.load(locationField.getText().startsWith("http://") ? locationField.getText() :
                    "http://" + locationField.getText());
        }
    };
    goButton.setOnAction(goAction);
    locationField.setOnAction(goAction);
    eng.locationProperty().addListener(new ChangeListener<String>() {
        @Override public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) {
            locationField.setText(newValue);
        }
    });
    GridPane grid = new GridPane();
    grid.setVgap(5);
    grid.setHgap(5);
    GridPane.setConstraints(locationField, 0, 0, 1, 1, HPos.CENTER, VPos.CENTER, Priority.ALWAYS, Priority.SOMETIMES);
    GridPane.setConstraints(goButton,1,0);
    GridPane.setConstraints(view, 0, 1, 2, 1, HPos.CENTER, VPos.CENTER, Priority.ALWAYS, Priority.ALWAYS);
    grid.getColumnConstraints().addAll(
            new ColumnConstraints(100, 100, Double.MAX_VALUE, Priority.ALWAYS, HPos.CENTER, true),
            new ColumnConstraints(40, 40, 40, Priority.NEVER, HPos.CENTER, true)
    );
    grid.getChildren().addAll(locationField, goButton, view);
    getChildren().add(grid);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:41,代码来源:WebViewBrowser.java

示例5: createGrid

import javafx.scene.layout.ColumnConstraints; //导入依赖的package包/类
private GridPane createGrid() {
	//-------------------------------------------------------------------- Grid
	GRID.setHgap(GRID_GAP);
	GRID.setVgap(GRID_GAP);
	GRID.setPadding(new Insets(GRID_GAP));
	GRID.setGridLinesVisible(false);
	//-------------------------------------------------------------------- Constraints
	for (int i = 0; i < 2; i++) {
		final ColumnConstraints column = new ColumnConstraints();
		column.setFillWidth(true);
		column.setHgrow(Priority.NEVER);
		GRID.getColumnConstraints().add(column);
	}
	GRID.getColumnConstraints().get(1).setHgrow(Priority.SOMETIMES);
	//-------------------------------------------------------------------- End
	return GRID;
}
 
开发者ID:mikelaud,项目名称:fx-dialogs,代码行数:18,代码来源:FxDialog.java

示例6: loadSousMoment

import javafx.scene.layout.ColumnConstraints; //导入依赖的package包/类
public static void loadSousMoment(MomentExpVBox mev,Main main){
	if(mev.getChildren().size() == 1){
		mev.getChildren().add(mev.getSousMomentPane());
	}
	for (MomentExperience m: mev.getMoment().getSousMoments()) {
		MomentExpVBox tmp = new MomentExpVBox(main);
		tmp.setMoment(m);
		tmp.showMoment();
		tmp.LoadMomentData();


		ColumnConstraints c = new ColumnConstraints();
		mev.getSousMomentPane().getColumnConstraints().add(c);
		mev.getSousMomentPane().add(tmp,mev.getSousMomentPane().getColumnConstraints().size()-1,0);
		MainViewTransformations.addMomentExpBorderPaneListener(tmp, main);
		loadTypes(tmp,main);
		loadSousMoment(tmp, main);
	}		
}
 
开发者ID:coco35700,项目名称:uPMT,代码行数:20,代码来源:MainViewTransformations.java

示例7: execute

import javafx.scene.layout.ColumnConstraints; //导入依赖的package包/类
@Override
public void execute() {
	momentExpPane.showMoment();
	main.getCurrentDescription().addMomentExp(momentExpPane.getMoment());
	
	if(momentExpPane.getCol() == main.getCurrentDescription().getNumberCols()-1){
		MomentExpVBox mb = new MomentExpVBox(main, true);
		MainViewTransformations.addMomentExpBorderPaneListener(mb, main);
		ColumnConstraints c = new ColumnConstraints();
		c.setMinWidth(180);
		c.setPrefWidth(Control.USE_COMPUTED_SIZE);
		c.setMaxWidth(Control.USE_COMPUTED_SIZE);
		// add a new col and the borderPane
		main.getGrid().getColumnConstraints().add(c);
		main.getGrid().add(mb,main.getCurrentDescription().getNumberCols(), 0);
		// increase the number of col by one
		main.getCurrentDescription().setNumberCols(main.getCurrentDescription().getNumberCols()+1);
	}
	main.needToSave();
}
 
开发者ID:coco35700,项目名称:uPMT,代码行数:21,代码来源:AddMomentCommand.java

示例8: createBody

import javafx.scene.layout.ColumnConstraints; //导入依赖的package包/类
/**
 * Creates the node used for the body part of each cell.
 *
 * In this default implementation the body consists of a grid pane with
 * three columns. The middle column is used for showing the title of
 * calendar entries. This column will get whatever space is left after
 * the icon and the time column have used what they need. This means
 * that a very long title will automatically be truncated.
 *
 * @return the body node
 */
protected Node createBody() {
    // icon column
    ColumnConstraints iconColumn = new ColumnConstraints();

    // title column
    ColumnConstraints descriptionColumn = new ColumnConstraints();
    descriptionColumn.setFillWidth(true);
    descriptionColumn.setHgrow(Priority.SOMETIMES);
    descriptionColumn.setMinWidth(0);
    descriptionColumn.setPrefWidth(0);

    // time column
    ColumnConstraints timeColumn = new ColumnConstraints();
    timeColumn.setHalignment(HPos.RIGHT);

    gridPane = new GridPane();
    gridPane.setGridLinesVisible(true);
    gridPane.setMinWidth(0);
    gridPane.setPrefWidth(0);
    gridPane.getStyleClass().add(AGENDA_VIEW_BODY);
    gridPane.getColumnConstraints().addAll(iconColumn, descriptionColumn, timeColumn);

    return gridPane;
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:36,代码来源:AgendaView.java

示例9: initializeGrid

import javafx.scene.layout.ColumnConstraints; //导入依赖的package包/类
private void initializeGrid() {
	grid = new GridPane();
	//grid.setAlignment(Pos.CENTER);
	grid.setHgap(10);
	grid.setVgap(10);
	grid.setPadding(new Insets(25, 25, 25, 25));
	grid.setMaxSize(Region.USE_COMPUTED_SIZE, Region.USE_COMPUTED_SIZE);
	ColumnConstraints c1 = new ColumnConstraints();
	c1.setFillWidth(true);
	c1.setHgrow(Priority.ALWAYS);
	grid.getColumnConstraints().addAll(new ColumnConstraints(), c1, new ColumnConstraints());
	RowConstraints r2 = new RowConstraints();
	r2.setFillHeight(true);
	r2.setVgrow(Priority.ALWAYS);
}
 
开发者ID:joakimkistowski,项目名称:HTTP-Load-Generator,代码行数:16,代码来源:ScriptTestWindow.java

示例10: getDemoPane

import javafx.scene.layout.ColumnConstraints; //导入依赖的package包/类
public GridPane getDemoPane() {
    GridPane pane = new GridPane();
    pane.add(framedGauge1, 0, 0);
    pane.add(framedGauge2, 1, 0);
    pane.add(gauge3, 2, 0);
    pane.add(gauge4, 3, 0);
    pane.add(gauge5, 4, 0);
    pane.add(clock1, 5, 0);
    pane.add(clock5, 6, 0);
    pane.add(gauge22, 7, 0);
    pane.add(gauge29, 8, 0);

    pane.add(gauge6, 0, 1);
    pane.add(gauge7, 1, 1);
    pane.add(gauge8, 2, 1);
    pane.add(gauge9, 3, 1);
    pane.add(gauge10, 4, 1);
    pane.add(clock2, 5, 1);
    pane.add(gauge21, 6, 1);
    pane.add(gauge23, 7, 1);
    pane.add(gauge30, 8, 1);

    pane.add(gauge11, 0, 2);
    pane.add(gauge12, 1, 2);
    pane.add(gauge13, 2, 2);
    pane.add(gauge14, 3, 2);
    pane.add(gauge15, 4, 2);
    pane.add(clock3, 5, 2);
    pane.add(clock6, 6, 2);
    pane.add(clock8, 7, 2);
    pane.add(gauge31, 8, 2);

    pane.add(gauge16, 0, 3);
    pane.add(gauge17, 1, 3);
    pane.add(gauge18, 2, 3);
    pane.add(gauge19, 3, 3);
    pane.add(gauge20, 4, 3);
    pane.add(clock4, 5, 3);
    pane.add(clock7, 6, 3);
    pane.add(gauge24, 7, 3);
    pane.add(clock12, 8, 3);

    pane.add(gauge25, 0, 4);
    pane.add(gauge26, 1, 4);
    pane.add(gauge27, 2, 4);
    pane.add(gauge28, 4, 4);
    pane.add(clock9, 5, 4);
    pane.add(clock10, 6, 4);
    pane.add(clock11, 7, 4);
    pane.setHgap(10);
    pane.setVgap(10);
    pane.setPadding(new Insets(10));
    for (int i = 0 ; i < 9 ; i++) {
        pane.getColumnConstraints().add(new ColumnConstraints(MIN_CELL_SIZE, PREF_CELL_SIZE, MAX_CELL_SIZE));
    }
    for (int i = 0 ; i < 5 ; i++) {
        pane.getRowConstraints().add(new RowConstraints(MIN_CELL_SIZE, PREF_CELL_SIZE, MAX_CELL_SIZE));
    }
    pane.setBackground(new Background(new BackgroundFill(Color.rgb(90, 90, 90), CornerRadii.EMPTY, Insets.EMPTY)));
    return pane;
}
 
开发者ID:BITPlan,项目名称:can4eve,代码行数:62,代码来源:OverviewDemo.java

示例11: makeGrid

import javafx.scene.layout.ColumnConstraints; //导入依赖的package包/类
private void makeGrid() {
	myGrid = new GridPane();
	myGrid.setMaxHeight(getScreenHeight());
	myGrid.setMaxWidth(getScreenWidth());
	for (int i = 0; i < getNumRows(); i++) {
		RowConstraints row = new RowConstraints(getScreenHeight()/getNumRows());
		myGrid.getRowConstraints().add(row);
	}
	for (int j = 0; j < getNumCols(); j++) {
		ColumnConstraints col = new ColumnConstraints(getScreenWidth()/getNumCols());
		myGrid.getColumnConstraints().add(col);
	}
	for (int i = 0; i < getNumRows(); i++) {
		for (int j = 0; j < getNumCols(); j++) {
			myGrid.add(new Rectangle(CELL_SIZE, CELL_SIZE, Color.WHITESMOKE), j, i);
		}
	}
	this.getChildren().clear();
	this.getChildren().add(myGrid);
}
 
开发者ID:LtubSalad,项目名称:voogasalad-ltub,代码行数:21,代码来源:ScreenMap.java

示例12: CannotReadPrompt

import javafx.scene.layout.ColumnConstraints; //导入依赖的package包/类
public CannotReadPrompt(Consumer<String> directoryOpener, Runnable focusTrigger) {
	super();

	this.directoryOpener = directoryOpener;
	this.focusTrigger = focusTrigger;

	// if invisible, also remove from layout
	this.managedProperty().bind(this.visibleProperty());
	this.setVisible(false);

	this.setVgap(SPACING / 2);
	this.setHgap(SPACING / 2);

	ColumnConstraints colConstraints = new ColumnConstraints();
	colConstraints.setPercentWidth(50);
	this.getColumnConstraints().addAll(colConstraints, colConstraints);

	initUI();
}
 
开发者ID:CedricReichenbach,项目名称:audiomerge,代码行数:20,代码来源:CannotReadPrompt.java

示例13: sector

import javafx.scene.layout.ColumnConstraints; //导入依赖的package包/类
/**
 * Sets constraints of the columns and rows of the grid pane.
 */
private void sector () {
	gameDisplayProperties = VoogaBundles.GameDisplayProperties;
	ColumnConstraints leftColumn = new ColumnConstraints();
	leftColumn.setPercentWidth(getConstraint("leftColConstraints"));
	ColumnConstraints rightColumn = new ColumnConstraints();
	rightColumn.setPercentWidth(getConstraint("rightColConstraints"));
	RowConstraints topRow = new RowConstraints();
	topRow.setPercentHeight(getConstraint("topRowConstraints"));
	RowConstraints middleRow = new RowConstraints();
	middleRow.setPercentHeight(getConstraint("middleRowConstraints"));
	RowConstraints bottomRow = new RowConstraints();
	bottomRow.setPercentHeight(getConstraint("bottomRowConstraints"));
	this.getColumnConstraints().addAll(leftColumn, rightColumn);
	this.getRowConstraints().addAll(topRow, middleRow, bottomRow);
}
 
开发者ID:sjain28,项目名称:Game-Engine-Vooga,代码行数:19,代码来源:UIGrid.java

示例14: initGridPane

import javafx.scene.layout.ColumnConstraints; //导入依赖的package包/类
private void initGridPane() {
  List<NodeDescriptor> nodes = puzzle.getNodeDescriptors();

  int gridRows = nodes.stream()
                      .mapToInt(NodeDescriptor::getRow)
                      .max().getAsInt(),
      gridCols = nodes.stream()
                      .mapToInt(NodeDescriptor::getColumn)
                      .max().getAsInt();

  for (int i = 0; i < gridRows; ++i) {
    sourceCodeGridPane.getRowConstraints().add(new RowConstraints(300));
  }

  for (int i = 0; i < gridCols; ++i) {
    sourceCodeGridPane.getColumnConstraints().add(new ColumnConstraints(300));
  }
}
 
开发者ID:battila7,项目名称:cd2t-100,代码行数:19,代码来源:NodeController.java

示例15: BuildWallConfigurationPanelImpl

import javafx.scene.layout.ColumnConstraints; //导入依赖的package包/类
/**
 * Constructs a new {@link BuildWallConfigurationPanelImpl}.
 * @param configuration the {@link BuildWallConfiguration} to configure.
 * @param title the title of the panel.
 */
public BuildWallConfigurationPanelImpl( String title, BuildWallConfiguration configuration ) {
   this.configuration = configuration;
   this.styling = new JavaFxStyle();
   
   constructTitle( title );
   constructDimensions();
   constructJobPoliciesPane();
   constructFontItemPane();
   constructColourItemPane();
   
   ColumnConstraints width = new ColumnConstraints();
   width.setPercentWidth( 100 );
   width.setHgrow( Priority.ALWAYS );
   getColumnConstraints().addAll( width );
}
 
开发者ID:DanGrew,项目名称:JttDesktop,代码行数:21,代码来源:BuildWallConfigurationPanelImpl.java


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