當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。