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


Java Pos类代码示例

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


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

示例1: ActionTextPane

import javafx.geometry.Pos; //导入依赖的package包/类
public ActionTextPane() {

        actionText = new Label("Test");
        graphic = new ImageView(new Image("assets/icons/editor_action_info_icon.png"));
        actionText.setGraphic(graphic);
        actionText.setTextFill(Utils.getDefaultTextColor());
        actionText.setAlignment(Pos.CENTER);
        actionText.setPadding(new Insets(0, 0, 0, 5));
        getChildren().add(actionText);
        setAlignment(Pos.CENTER);

        ft = new FadeTransition(Duration.millis(500), graphic);
        ft.setFromValue(1.0);
        ft.setToValue(0.0);
        ft.setAutoReverse(true);
        ft.setCycleCount(4);

    }
 
开发者ID:jdesive,项目名称:textmd,代码行数:19,代码来源:ActionTextPane.java

示例2: addYourMessges

import javafx.geometry.Pos; //导入依赖的package包/类
/**
 * 将自己的对话添加到对话列表中
 * @param content
 */
public void addYourMessges(String content){

	Platform.runLater(() ->{
		//寻找用户的头像名
		Image image = new Image("images/" + userPic);
           ImageView profileImage = new ImageView(image);
           profileImage.setFitHeight(32);
           profileImage.setFitWidth(32);
           BubbledTextFlow yourBubbled = new BubbledTextFlow(EmojiDisplayer.createEmojiAndTextNode(content));
           yourBubbled.setBackground(new Background(new BackgroundFill(Color.LIGHTGREEN,
                   null, null)));
           HBox x = new HBox();
           x.setMaxWidth(chatPaneListView.getWidth() - 20);
           x.setAlignment(Pos.TOP_RIGHT);
           yourBubbled.setBubbleSpec(BubbleSpec.FACE_RIGHT_CENTER);
           x.getChildren().addAll(yourBubbled, profileImage);
           chatPaneListView.getItems().add(x);
	});
}
 
开发者ID:Laity000,项目名称:ChatRoom-JavaFX,代码行数:24,代码来源:ChatController.java

示例3: createIconContent

import javafx.geometry.Pos; //导入依赖的package包/类
public static Node createIconContent() {
    StackPane sp = new StackPane();
    VBox vbox = new VBox(3);
    vbox.setAlignment(Pos.CENTER);
    vbox.setPadding(new Insets(5, 5, 5, 5));

    Rectangle rectangle = new Rectangle(32, 62, Color.LIGHTGREY);
    rectangle.setStroke(Color.BLACK);
    vbox.setPrefSize(rectangle.getWidth(), rectangle.getHeight());
    Rectangle r1 = new Rectangle(18, 14, Color.web("#1c89f4"));
    Rectangle r2 = new Rectangle(18, 14, Color.web("#349b00"));
    Rectangle r3 = new Rectangle(18, 20, Color.web("#349b00"));

    vbox.getChildren().addAll(r1, r2, r3);
    sp.getChildren().addAll(rectangle, vbox);
    return new Group(sp);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:18,代码来源:VBoxSample.java

示例4: initProgressBarUI

import javafx.geometry.Pos; //导入依赖的package包/类
private void initProgressBarUI() {
    Label runLabel = new Label("Runs: ");
    runLabel.setMinWidth(Region.USE_PREF_SIZE);
    nRuns = new Text((int) progress + "/" + maxTestCount);

    Label errorLabel = new Label("Errors: ");
    errorLabel.setMinWidth(Region.USE_PREF_SIZE);
    errorLabel.setGraphic(FXUIUtils.getIcon("error"));
    errorLabel.setPadding(new Insets(0, 0, 0, 80));
    errorText = new Text(errors + "");

    Label failureLabel = new Label("Failures: ");
    failureLabel.setMinWidth(Region.USE_PREF_SIZE);
    failureLabel.setGraphic(FXUIUtils.getIcon("failure"));
    failureLabel.setPadding(new Insets(0, 0, 0, 80));
    failureText = new Text(failures + "");

    progressBarString.setAlignment(Pos.CENTER);
    progressBarString.setPadding(new Insets(5, 0, 5, 0));
    progressBarString.getChildren().addAll(runLabel, nRuns, errorLabel, errorText, failureLabel, failureText);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:22,代码来源:ProgressIndicatorBar.java

示例5: constructContainer

import javafx.geometry.Pos; //导入依赖的package包/类
@Override
public Parent constructContainer ()
{
	headLbl = new Label("Umbenennen");
	headLbl.setId("bold");

	AppButton backBtn = new AppButton("_Zur�ck");
	backBtn.setOnAction(e -> getFXController().showView("doorview"));

	BorderPane headLayout = new BorderPane(headLbl);
	headLayout.setPadding(new Insets(0, 0, 25, 0));

	renameLayout.setPadding(new Insets(10));
	renameLayout.setAlignment(Pos.TOP_CENTER);
	
	scroller.setMaxWidth(600);
	scroller.setFitToWidth(true);
	scroller.setPadding(new Insets(25));

	MainLayout maLay = new MainLayout(scroller, headLayout, new ControlLayout(backBtn));
	getFXController().getModel("stack").registerView(this);
	return maLay;
}
 
开发者ID:CoffeeCodeSwitzerland,项目名称:Lernkartei_2017,代码行数:24,代码来源:RenameView.java

示例6: createIconContent

import javafx.geometry.Pos; //导入依赖的package包/类
public static Node createIconContent() {
    StackPane sp = new StackPane();
    TilePane iconTilePane = new TilePane();
    iconTilePane.setAlignment(Pos.CENTER);

    Rectangle rectangle = new Rectangle(62, 62, Color.LIGHTGREY);
    rectangle.setStroke(Color.BLACK);
    iconTilePane.setPrefSize(rectangle.getWidth(), rectangle.getHeight());

    Rectangle[] rec = new Rectangle[9];
    for (int i = 0; i < rec.length; i++) {
        rec[i] = new Rectangle(14, 14, Color.web("#349b00"));
        TilePane.setMargin(rec[i], new Insets(2, 2, 2, 2));
    }
    iconTilePane.getChildren().addAll(rec);
    sp.getChildren().addAll(rectangle, iconTilePane);
    return new Group(sp);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:19,代码来源:TilePaneSample.java

示例7: initView

import javafx.geometry.Pos; //导入依赖的package包/类
@Override
protected void initView () {
    double spacing = getParser().parseDouble(getMyNumbers().getString("HBoxSpacing"));
    HBox header =
            getMyUIFactory().makeHBox(spacing, Pos.CENTER, myRemove.draw(),
                                      getSubTitleDisplay());
    HBox angles =
            getMyUIFactory().makeHBox(spacing, Pos.CENTER, myDecrease.draw(), myIncrease.draw(),
                                      myFire.draw());
    HBox fireParams =
            getMyUIFactory().makeHBox(spacing, Pos.CENTER, myMissileSelectionView.draw(),
                                      myAngle.draw(), myAngleStep.draw());
    HBox rangeParams =
            getMyUIFactory().makeHBox(spacing, Pos.CENTER, myWaitTime.draw(),
                                      myIsRanged.draw(), myRangeValue.draw());
    myPane =
            getMyUIFactory().makeVBox(spacing, Pos.CENTER, header, angles, fireParams,
                                      rangeParams);
    getMyUIFactory().addStyling(myPane, "Firer");
}
 
开发者ID:tomrom95,项目名称:GameAuthoringEnvironment,代码行数:21,代码来源:UserFireSFV.java

示例8: setupSignUpAndSubmitButtons

import javafx.geometry.Pos; //导入依赖的package包/类
private static HBox setupSignUpAndSubmitButtons() {
	HBox signUpAndSubmitButtons = new HBox(10);
	
	submitButton.setOnAction(e -> {
		Home.display();
		window.close();
	});
	signUpButton.setOnAction(e -> {
		Home.display();
		window.close();
	});

	signUpAndSubmitButtons.getChildren().addAll(submitButton, signUpButton);
	signUpAndSubmitButtons.setAlignment(Pos.CENTER);

	return signUpAndSubmitButtons;
}
 
开发者ID:MorrisB--,项目名称:MasterHash,代码行数:18,代码来源:Welcome.java

示例9: buildBoxHorarios

import javafx.geometry.Pos; //导入依赖的package包/类
private StackPane buildBoxHorarios(List<Horario> horarios) {
	VBox vbox = new VBox(7);
	vbox.setAlignment(Pos.CENTER);

	Rectangle rect = new Rectangle(150, 100);
	rect.setStroke(Color.BLACK);
	rect.setStrokeWidth(2);
	rect.setFill(Color.TRANSPARENT);

	for (Horario horario : horarios) {
		vbox.getChildren().add(new Text(horario.getEstampa()));
	}

	StackPane caixa = new StackPane(rect, vbox);
	return caixa;
}
 
开发者ID:dev-andremonteiro,项目名称:AlphaLab,代码行数:17,代码来源:FrmPedidosReserva.java

示例10: createGammaCorrectionControl

import javafx.geometry.Pos; //导入依赖的package包/类
/**
 * Create gamma correction control.
 */
@FXThread
private void createGammaCorrectionControl(@NotNull final VBox root) {

    final HBox container = new HBox();
    container.setAlignment(Pos.CENTER_LEFT);

    final Label gammaCorrectionLabel = new Label(Messages.SETTINGS_DIALOG_GAMMA_CORRECTION + ":");

    gammaCorrectionCheckBox = new CheckBox();
    gammaCorrectionCheckBox.selectedProperty().addListener((observable, oldValue, newValue) -> validate());

    FXUtils.addToPane(gammaCorrectionLabel, container);
    FXUtils.addToPane(gammaCorrectionCheckBox, container);
    FXUtils.addToPane(container, root);

    FXUtils.addClassTo(gammaCorrectionLabel, CSSClasses.SETTINGS_DIALOG_LABEL);
    FXUtils.addClassTo(gammaCorrectionCheckBox, CSSClasses.SETTINGS_DIALOG_FIELD);
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:22,代码来源:SettingsDialog.java

示例11: createContainer

import javafx.geometry.Pos; //导入依赖的package包/类
/**
 * Creates the Horizontal box container that will contains the NodeBox
 * icon.
 * @return Horizontal box container.
 */
public HBox createContainer(){
    this.container = new HBox();
    this.container.setAlignment(Pos.CENTER);
    this.container.setMinSize(getMinWidth(),getMinHeight());

    this.getActionIcon().setSmooth(true);

    this.actionBtn = new Button();

    this.actionBtn.setGraphic(getActionIcon());
    this.actionBtn.setMinSize(getActionIcon().getFitWidth(), getActionIcon().getFitHeight());
    this.actionBtn.setBackground(new Background(new BackgroundFill(Color.TRANSPARENT,null,null)));

    this.container.getChildren().add(actionBtn);
    return container;
}
 
开发者ID:Theldus,项目名称:PSE,代码行数:22,代码来源:NodeBox.java

示例12: start

import javafx.geometry.Pos; //导入依赖的package包/类
@Override
public void start(Stage stage) {
    VBox vbox = new VBox();
    Scene scene = new Scene(vbox);
    stage.setTitle("Hyperlink Sample");
    stage.setWidth(570);
    stage.setHeight(550);

    selectedImage.setLayoutX(100);
    selectedImage.setLayoutY(10);
    
    final WebView browser = new WebView();
    final WebEngine webEngine = browser.getEngine();

    for (int i = 0; i < captions.length; i++) {
        final Hyperlink hpl = hpls[i] = new Hyperlink(captions[i]);
        final Image image = images[i] =
            new Image(getClass().getResourceAsStream(imageFiles[i]));
        hpl.setGraphic(new ImageView (image));
        hpl.setFont(Font.font("Arial", 14));
        final String url = urls[i];

        hpl.setOnAction((ActionEvent e) -> {
            webEngine.load(url);
        });
    }
          
    HBox hbox = new HBox();
    hbox.setAlignment(Pos.BASELINE_CENTER);
    hbox.getChildren().addAll(hpls);
    vbox.getChildren().addAll(hbox, browser);
    VBox.setVgrow(browser, Priority.ALWAYS);
    
    stage.setScene(scene);
    stage.show();
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:37,代码来源:HyperlinkWebViewSample.java

示例13: createAnisotropyControl

import javafx.geometry.Pos; //导入依赖的package包/类
/**
 * Create the anisotropy control
 */
@FXThread
private void createAnisotropyControl(@NotNull final VBox root) {

    final HBox container = new HBox();
    container.setAlignment(Pos.CENTER_LEFT);

    final Label label = new Label(Messages.SETTINGS_DIALOG_ANISOTROPY + ":");

    anisotropyComboBox = new ComboBox<>();
    anisotropyComboBox.prefWidthProperty().bind(root.widthProperty());
    anisotropyComboBox.getSelectionModel()
            .selectedItemProperty()
            .addListener((observable, oldValue, newValue) -> validate());

    FXUtils.addToPane(label, container);
    FXUtils.addToPane(anisotropyComboBox, container);
    FXUtils.addToPane(container, root);

    FXUtils.addClassTo(label, CSSClasses.SETTINGS_DIALOG_LABEL);
    FXUtils.addClassTo(anisotropyComboBox, CSSClasses.SETTINGS_DIALOG_FIELD);

    final ObservableList<Integer> items = anisotropyComboBox.getItems();
    items.addAll(ANISOTROPYCS);
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:28,代码来源:SettingsDialog.java

示例14: displayAuxObjects

import javafx.geometry.Pos; //导入依赖的package包/类
private void displayAuxObjects() {
    // Format btnTitleScreen
    btnTitleScreen.setPrefSize(WIDTH / 4, HEIGHT / 10);
    btnTitleScreen.setAlignment(Pos.CENTER);

    // Format txtSelectClass
    txtSelectClass.setFill(Color.rgb(234, 234, 234));
    txtSelectClass.setFont(Font.font("Verdana", FontWeight.BOLD, 50));

    // Modify vbTopObjects
    vbTopObjects = new VBox(WIDTH / 100);
    vbTopObjects.getChildren().addAll(btnTitleScreen, txtSelectClass);
    vbTopObjects.setAlignment(Pos.CENTER);

    this.setTop(vbTopObjects);
}
 
开发者ID:spencerhendon,项目名称:projectintern,代码行数:17,代码来源:NewGame.java

示例15: CheckBoxControl

import javafx.geometry.Pos; //导入依赖的package包/类
public CheckBoxControl(String name) {
	super(name, FlashboardSendableType.CHECKBOX);
	
	checkBox = new CheckBox(name);
	checkBox.selectedProperty().addListener((obs, o, n)->{
		if(localChange)
			return;
		synchronized (valueMutex) {
			lChanged = true;
			value = n.booleanValue();
			send[0] = (byte) (value? 1: 0);
		}
	});
	
	root = new VBox();
	root.setAlignment(Pos.CENTER);
	root.getChildren().add(checkBox);
}
 
开发者ID:Flash3388,项目名称:FlashLib,代码行数:19,代码来源:CheckBoxControl.java


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