本文整理汇总了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);
}
示例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);
});
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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");
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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();
}
示例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);
}
示例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);
}
示例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);
}