本文整理匯總了Java中javafx.scene.layout.HBox.setHgrow方法的典型用法代碼示例。如果您正苦於以下問題:Java HBox.setHgrow方法的具體用法?Java HBox.setHgrow怎麽用?Java HBox.setHgrow使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javafx.scene.layout.HBox
的用法示例。
在下文中一共展示了HBox.setHgrow方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setAlignment
import javafx.scene.layout.HBox; //導入方法依賴的package包/類
private void setAlignment() {
label.setPrefWidth(200);
changeButton.setMinWidth(71);
unbindButton.setMinWidth(71);
hbox = new HBox(label, textField, changeButton, unbindButton);
hbox.setAlignment(Pos.CENTER_LEFT);
hbox.setPrefHeight(31);
label.setText(getPrettyName());
label.setAlignment(Pos.CENTER_LEFT);
Insets labelInset = new Insets(0, 0, 0, 10);
Insets buttonInset = new Insets(0, 10, 0, 0);
unbindButton.setMinHeight(31);
hbox.setMargin(label, labelInset);
hbox.setMargin(unbindButton, buttonInset);
textField.setEditable(false);
hbox.setHgrow(textField, Priority.ALWAYS);
}
示例2: TabDockingContainer
import javafx.scene.layout.HBox; //導入方法依賴的package包/類
public TabDockingContainer(DockingDesktop desktop, IDockingContainer parent, Dockable base, Dockable dockable, int order,
boolean select) {
this.desktop = desktop;
dockables.add(dockable);
dockables.add(base);
setMaxHeight(Double.MAX_VALUE);
setMaxWidth(Double.MAX_VALUE);
HBox.setHgrow(this, Priority.ALWAYS);
VBox.setVgrow(this, Priority.ALWAYS);
getProperties().put(DockingDesktop.DOCKING_CONTAINER, parent);
base.setContainer(this);
dockable.setContainer(this);
getTabs().add(newTab(base));
getTabs().add(newTab(dockable));
if (select) {
getSelectionModel().select(1);
}
getSelectionModel().selectedItemProperty().addListener(listener);
setTabClosingPolicy(TabClosingPolicy.ALL_TABS);
setSide(base.getDockKey().getSide());
}
示例3: setupInfoLabel
import javafx.scene.layout.HBox; //導入方法依賴的package包/類
private static void setupInfoLabel(final Label label) {
label.setMaxHeight(Double.MAX_VALUE);
label.setMaxWidth(Double.MAX_VALUE);
label.setTextAlignment(TextAlignment.CENTER);
HBox.setHgrow(label, Priority.ALWAYS);
}
示例4: launchSessionAudit
import javafx.scene.layout.HBox; //導入方法依賴的package包/類
private void launchSessionAudit() {
try {
sessionAuditUI = FXMLLoader.load(getClass().getResource("SessionAudit.fxml"));
sessionAuditUI.setId("SessionAudit");
VBox.setVgrow(sessionAuditUI, Priority.ALWAYS);
HBox.setHgrow(sessionAuditUI, Priority.ALWAYS);
mainPane.getChildren().add(sessionAuditUI);
sessionAuditUI.setVisible(false);
} catch (IOException | RuntimeException iOException) {
System.out.println("SessionAudit >>>> " + iOException.getMessage());
}
}
示例5: setupArchitectureManagementVisuals
import javafx.scene.layout.HBox; //導入方法依賴的package包/類
/**
* Create the different buttons for the architecture management and add the desired actions to them
*/
private void setupArchitectureManagementVisuals() {
HBox buttons = new HBox();
Button configButton = new Button("Config");
Button startButton = new Button("Start");
Button pauseButton = new Button("Pause");
Button resumeButton = new Button("Resume");
Button stopButton = new Button("Stop");
buttons.getChildren().addAll(configButton, startButton, pauseButton, resumeButton, stopButton);
BorderPane borderPane = new BorderPane();
borderPane.setPrefHeight(canvas.getScene().getHeight());
borderPane.setPrefWidth(canvas.getScene().getWidth());
Pane space = new Pane();
space.setMinSize(1, 1);
HBox.setHgrow(space, Priority.ALWAYS);
HBox container = new HBox();
container.setPrefWidth(canvas.getScene().getWidth());
container.getChildren().addAll(space, buttons);
borderPane.setBottom(container);
root.getChildren().add(borderPane);
configButton.setOnMouseClicked(new ArchitectureButtonEventHandler(SimulationAction.CONFIG, publisher));
startButton.setOnMouseClicked(new ArchitectureButtonEventHandler(SimulationAction.START, publisher));
stopButton.setOnMouseClicked(new ArchitectureButtonEventHandler(SimulationAction.STOP, publisher));
pauseButton.setOnMouseClicked(new ArchitectureButtonEventHandler(SimulationAction.PAUSE, publisher));
resumeButton.setOnMouseClicked(new ArchitectureButtonEventHandler(SimulationAction.RESUME, publisher));
}
示例6: createDemoPane
import javafx.scene.layout.HBox; //導入方法依賴的package包/類
private Node createDemoPane() {
HBox hbox = new HBox(6);
Node filteredTree = createFilteredTree();
HBox.setHgrow(filteredTree, Priority.ALWAYS);
hbox.getChildren().add(filteredTree);
return hbox;
}
示例7: addSeparator
import javafx.scene.layout.HBox; //導入方法依賴的package包/類
private Node addSeparator(String name) {
Separator separator = new Separator();
separator.setPadding(new Insets(8, 0, 0, 0));
HBox.setHgrow(separator, Priority.ALWAYS);
Text text = new Text(name);
text.setTextAlignment(TextAlignment.CENTER);
HBox hBox = new HBox(text, separator);
HBox.setHgrow(hBox, Priority.ALWAYS);
return hBox;
}
示例8: launchIsotopesManager
import javafx.scene.layout.HBox; //導入方法依賴的package包/類
private void launchIsotopesManager() {
try {
isotopesManagerUI = FXMLLoader.load(getClass().getResource("IsotopesManager.fxml"));
isotopesManagerUI.setId("IsotopesManager");
VBox.setVgrow(isotopesManagerUI, Priority.ALWAYS);
HBox.setHgrow(isotopesManagerUI, Priority.ALWAYS);
mainPane.getChildren().add(isotopesManagerUI);
isotopesManagerUI.setVisible(false);
} catch (IOException | RuntimeException iOException) {
System.out.println("IsotopesManager >>>> " + iOException.getMessage());
}
}
示例9: launchReductionManager
import javafx.scene.layout.HBox; //導入方法依賴的package包/類
private void launchReductionManager() {
try {
reductionManagerUI = FXMLLoader.load(getClass().getResource("dataReduction/ReductionManager.fxml"));
reductionManagerUI.setId("ReductionManager");
VBox.setVgrow(reductionManagerUI, Priority.ALWAYS);
HBox.setHgrow(reductionManagerUI, Priority.ALWAYS);
mainPane.getChildren().add(reductionManagerUI);
reductionManagerUI.setVisible(false);
} catch (IOException | RuntimeException iOException) {
System.out.println("ReductionManager >>>> " + iOException.getMessage());
}
}
示例10: GoogleEntryReminderItem
import javafx.scene.layout.HBox; //導入方法依賴的package包/類
private GoogleEntryReminderItem(GoogleEntryReminder reminder) {
this.reminder = requireNonNull(reminder);
methodCombo = new ComboBox<>();
methodCombo.getItems().setAll(RemindMethod.values());
methodCombo.disableProperty().bind(entry.getCalendar().readOnlyProperty());
methodCombo.valueProperty().bindBidirectional(reminder.methodProperty());
methodCombo.setConverter(new StringConverter<RemindMethod>() {
@Override
public String toString(RemindMethod object) {
return object.getName();
}
@Override
public RemindMethod fromString(String string) {
for (RemindMethod method : RemindMethod.values()) {
if (method.getName().equals(string)) {
return method;
}
}
return null;
}
});
Integer minutes = reminder.getMinutes();
TimeUnit unit = TimeUnit.MINUTES;
if (minutes != null) {
if (minutes % 1440 == 0) {
unit = TimeUnit.DAYS;
minutes = minutes / 1400;
} else if (minutes % 60 == 0) {
unit = TimeUnit.HOURS;
minutes = minutes / 60;
}
}
valueTxt = new TextField();
valueTxt.disableProperty().bind(entry.getCalendar().readOnlyProperty());
valueTxt.setPrefColumnCount(5);
valueTxt.setText(minutes == null ? "" : minutes.toString());
valueTxt.textProperty().addListener(obs -> updateMinutes());
unitCombo = new ComboBox<>();
unitCombo.getItems().setAll(TimeUnit.MINUTES, TimeUnit.HOURS, TimeUnit.DAYS);
unitCombo.disableProperty().bind(entry.getCalendar().readOnlyProperty());
unitCombo.setValue(unit);
unitCombo.valueProperty().addListener(obs -> updateMinutes());
removeIcon = new Label();
removeIcon.getStyleClass().add("button-icon");
removeIcon.setGraphic(new FontAwesome().create(FontAwesome.Glyph.TRASH_ALT));
removeIcon.setOnMouseClicked(evt -> removeReminder(reminder));
removeIcon.disableProperty().bind(entry.getCalendar().readOnlyProperty());
HBox.setHgrow(removeIcon, Priority.NEVER);
setAlignment(Pos.CENTER_LEFT);
getChildren().addAll(methodCombo, valueTxt, unitCombo, removeIcon);
getStyleClass().add("notification-item");
}
示例11: PasswordDialog
import javafx.scene.layout.HBox; //導入方法依賴的package包/類
public PasswordDialog(String whatFor) {
setTitle(whatFor+" Password");
setHeaderText("Please enter your "+whatFor+" password: ");
ButtonType passwordButtonType = new ButtonType("Login", ButtonData.OK_DONE);
getDialogPane().getButtonTypes().addAll(passwordButtonType, ButtonType.CANCEL);
passwordField = new PasswordField();
passwordField.setPromptText(whatFor+" password");
HBox hBox = new HBox();
hBox.getChildren().add(passwordField);
hBox.setPadding(new Insets(20));
HBox.setHgrow(passwordField, Priority.ALWAYS);
getDialogPane().setContent(hBox);
Platform.runLater(() -> passwordField.requestFocus());
setResultConverter(dialogButton -> {
if (dialogButton == passwordButtonType) {
return passwordField.getText();
}
return "";
});
}
示例12: config
import javafx.scene.layout.HBox; //導入方法依賴的package包/類
private void config() {
if (items.isEmpty()) return;
Item item = items.get(0);
bar.getChildren().clear();
label.textProperty().bind(item.label);
label.setMaxWidth(Double.MAX_VALUE);
HBox.setHgrow(label, Priority.ALWAYS);
bar.getChildren().add(label);
if (item.progress != null) {
progressBar.setMinWidth(200);
progressBar.progressProperty().bind(item.progress);
bar.getChildren().add(progressBar);
}
}
示例13: createNameField
import javafx.scene.layout.HBox; //導入方法依賴的package包/類
private VBox createNameField() {
VBox nameFieldBox = new VBox();
TextField nameField = new TextField();
nameField.textProperty().addListener((observable, oldValue, newValue) -> {
fireContentChanged();
checkList.setName(nameField.getText());
});
nameField.setEditable(mode.isSelectable());
nameFieldBox.getChildren().addAll(new Label("Name"), nameField);
HBox.setHgrow(nameField, Priority.ALWAYS);
VBox.setMargin(nameFieldBox, new Insets(5, 10, 0, 5));
nameField.setText(checkList.getName());
HBox.setHgrow(nameFieldBox, Priority.ALWAYS);
return nameFieldBox;
}
示例14: initialize
import javafx.scene.layout.HBox; //導入方法依賴的package包/類
private void initialize() {
hbox = new HBox();
addChild = createButton("+");
deleteSelf = createButton("x");
debugButton = createButton("D");
FXUtils.setTooltip(addChild, "Add a new sub-task");
FXUtils.setTooltip(deleteSelf, "Delete this task");
setOnMouseEntered(event -> {
if(item == null)
return;
deleteSelf.setVisible(true);
debugButton.setVisible(true);
if(item.getTask().getLevel() <= 2)
addChild.setVisible(true);
});
setOnMouseExited(event -> {
addChild.setVisible(false);
deleteSelf.setVisible(false);
debugButton.setVisible(false);
});
spacer = new Pane();
hbox.getChildren().addAll(addChild, deleteSelf, debugButton, spacer);
hbox.setSpacing(SPACING);
hbox.setVisible(true);
addChild.setVisible(false);
deleteSelf.setVisible(false);
debugButton.setVisible(false);
HBox.setHgrow(spacer, Priority.ALWAYS);
}
示例15: createSpacer
import javafx.scene.layout.HBox; //導入方法依賴的package包/類
private Node createSpacer()
{
Region spacer = new Region();
HBox.setHgrow(spacer, Priority.ALWAYS);
return spacer;
}