use of javafx.scene.layout.GridPane in project TNCY-English-Project by mrngg.
the class DbRulesController method editRules.
public void editRules() throws IOException {
if (availableRules.getSelectionModel().getSelectedItem() != null) {
GridPane grid = new GridPane();
grid.setAlignment(Pos.CENTER);
grid.setHgap(10);
grid.setVgap(10);
grid.setPadding(new Insets(25, 25, 25, 25));
Label name = new Label("Name :");
TextField nameTF = new TextField();
nameTF.setText(availableRules.getSelectionModel().getSelectedItem().toString());
grid.add(nameTF, 1, 1);
grid.add(name, 0, 1);
Label hint = new Label("Hint :");
TextField hintTF = new TextField();
String hintR = "";
for (Rules r : rules) {
if (r.getName().equals(availableRules.getSelectionModel().getSelectedItem().toString())) {
hintR = r.getHint();
}
}
hintTF.setText(hintR);
grid.add(hintTF, 1, 2);
grid.add(hint, 0, 2);
Button btn = new Button("Edit");
grid.add(btn, 0, 3);
Scene secondScene = new Scene(grid, 300, 150);
Stage newWindow = new Stage();
newWindow.setTitle("Edit a rule");
newWindow.setScene(secondScene);
newWindow.show();
btn.setOnAction((event) -> {
if (nameTF.getText() != null && hintTF.getText() != null) {
for (Rules r : rules) {
if (r.getName().equals(availableRules.getSelectionModel().getSelectedItem().toString())) {
r.setName(nameTF.getText());
r.setHint(hintTF.getText());
}
}
ObservableList<String> items = FXCollections.observableArrayList();
for (int i = 0; i < rules.size(); i++) {
items.add(rules.get(i).getName());
}
availableRules.setItems(items);
newWindow.close();
rulesName.setText(nameTF.getText());
rulesHint.setText(hintTF.getText());
try {
new Database().save();
} catch (IOException e) {
e.printStackTrace();
}
}
});
}
}
use of javafx.scene.layout.GridPane in project TNCY-English-Project by mrngg.
the class DbTestsController method newTest.
@FXML
public void newTest() {
GridPane grid = new GridPane();
grid.setAlignment(Pos.CENTER);
grid.setHgap(10);
grid.setVgap(10);
grid.setPadding(new Insets(25, 25, 25, 25));
Label name = new Label("Name :");
TextField nameTF = new TextField();
grid.add(nameTF, 1, 1);
grid.add(name, 0, 1);
Button btn = new Button("Create");
grid.add(btn, 0, 3);
Scene secondScene = new Scene(grid, 300, 150);
Stage newWindow = new Stage();
newWindow.setTitle("Create a test");
newWindow.setScene(secondScene);
newWindow.show();
btn.setOnAction((event) -> {
if (nameTF.getText() != null) {
new Tests(nameTF.getText());
ObservableList<String> items = FXCollections.observableArrayList();
for (int i = 0; i < tests.size(); i++) {
items.add(tests.get(i).getName());
}
testsListView.setItems(items);
newWindow.close();
try {
new Database().save();
} catch (IOException e) {
e.printStackTrace();
}
}
});
}
use of javafx.scene.layout.GridPane in project phoenicis by PhoenicisOrg.
the class GitRepositoryDetailsPanel method populate.
/**
* Populates the repository details step for the git repository
*/
private void populate() {
this.urlField = new TextField();
this.branchField = new TextField("master");
Label urlLabel = new Label(tr("Git-Url:"));
urlLabel.setLabelFor(urlField);
Label branchLabel = new Label(tr("Branch:"));
branchLabel.setLabelFor(branchField);
GridPane grid = new GridPane();
grid.getStyleClass().add("grid");
grid.add(urlLabel, 0, 0);
grid.add(urlField, 1, 0);
grid.add(branchLabel, 0, 1);
grid.add(branchField, 1, 1);
this.setCenter(grid);
}
use of javafx.scene.layout.GridPane in project phoenicis by PhoenicisOrg.
the class WinePrefixContainerDisplayTab method populate.
private void populate() {
final VBox displayPane = new VBox();
final Text title = new TextWithStyle(tr("Display settings"), TITLE_CSS_CLASS);
displayPane.getStyleClass().add(CONFIGURATION_PANE_CSS_CLASS);
displayPane.getChildren().add(title);
final GridPane displayContentPane = new GridPane();
displayContentPane.getStyleClass().add("grid");
final ComboBox<UseGLSL> glslComboBox = new ComboBox<>();
glslComboBox.setMaxWidth(Double.MAX_VALUE);
glslComboBox.setValue(container.getUseGlslValue());
glslComboBox.valueProperty().addListener((observable, oldValue, newValue) -> this.changeSettings(newValue));
addItems(glslComboBox, UseGLSL.class);
displayContentPane.add(new TextWithStyle(tr("GLSL support"), CAPTION_TITLE_CSS_CLASS), 0, 0);
displayContentPane.add(glslComboBox, 1, 0);
final ComboBox<DirectDrawRenderer> directDrawRendererComboBox = new ComboBox<>();
directDrawRendererComboBox.setMaxWidth(Double.MAX_VALUE);
directDrawRendererComboBox.setValue(container.getDirectDrawRenderer());
directDrawRendererComboBox.valueProperty().addListener((observable, oldValue, newValue) -> this.changeSettings(newValue));
addItems(directDrawRendererComboBox, DirectDrawRenderer.class);
displayContentPane.add(new TextWithStyle(tr("Direct Draw Renderer"), CAPTION_TITLE_CSS_CLASS), 0, 1);
displayContentPane.add(directDrawRendererComboBox, 1, 1);
final ComboBox<VideoMemorySize> videoMemorySizeComboBox = new ComboBox<>();
videoMemorySizeComboBox.setMaxWidth(Double.MAX_VALUE);
videoMemorySizeComboBox.setValue(container.getVideoMemorySize());
videoMemorySizeComboBox.valueProperty().addListener((observable, oldValue, newValue) -> this.changeSettings(newValue));
addItemsVideoMemorySize(videoMemorySizeComboBox);
displayContentPane.add(new TextWithStyle(tr("Video memory size"), CAPTION_TITLE_CSS_CLASS), 0, 2);
displayContentPane.add(videoMemorySizeComboBox, 1, 2);
final ComboBox<OffscreenRenderingMode> offscreenRenderingModeComboBox = new ComboBox<>();
offscreenRenderingModeComboBox.setMaxWidth(Double.MAX_VALUE);
offscreenRenderingModeComboBox.setValue(container.getOffscreenRenderingMode());
offscreenRenderingModeComboBox.valueProperty().addListener((observable, oldValue, newValue) -> this.changeSettings(newValue));
addItems(offscreenRenderingModeComboBox, OffscreenRenderingMode.class);
displayContentPane.add(new TextWithStyle(tr("Offscreen rendering mode"), CAPTION_TITLE_CSS_CLASS), 0, 3);
displayContentPane.add(offscreenRenderingModeComboBox, 1, 3);
final ComboBox<RenderTargetModeLock> renderTargetModeLockComboBox = new ComboBox<>();
renderTargetModeLockComboBox.setMaxWidth(Double.MAX_VALUE);
renderTargetModeLockComboBox.setValue(container.getRenderTargetModeLock());
renderTargetModeLockComboBox.valueProperty().addListener((observable, oldValue, newValue) -> this.changeSettings(newValue));
addItems(renderTargetModeLockComboBox, RenderTargetModeLock.class);
displayContentPane.add(new TextWithStyle(tr("Render target lock mode"), CAPTION_TITLE_CSS_CLASS), 0, 4);
displayContentPane.add(renderTargetModeLockComboBox, 1, 4);
final ComboBox<Multisampling> multisamplingComboBox = new ComboBox<>();
multisamplingComboBox.setMaxWidth(Double.MAX_VALUE);
multisamplingComboBox.setValue(container.getMultisampling());
multisamplingComboBox.valueProperty().addListener((observable, oldValue, newValue) -> this.changeSettings(newValue));
addItems(multisamplingComboBox, Multisampling.class);
displayContentPane.add(new TextWithStyle(tr("Multisampling"), CAPTION_TITLE_CSS_CLASS), 0, 5);
displayContentPane.add(multisamplingComboBox, 1, 5);
final ComboBox<StrictDrawOrdering> strictDrawOrderingComboBox = new ComboBox<>();
strictDrawOrderingComboBox.setMaxWidth(Double.MAX_VALUE);
strictDrawOrderingComboBox.setValue(container.getStrictDrawOrdering());
strictDrawOrderingComboBox.valueProperty().addListener((observable, oldValue, newValue) -> this.changeSettings(newValue));
addItems(strictDrawOrderingComboBox, StrictDrawOrdering.class);
displayContentPane.add(new TextWithStyle(tr("Strict Draw Ordering"), CAPTION_TITLE_CSS_CLASS), 0, 6);
displayContentPane.add(strictDrawOrderingComboBox, 1, 6);
final ComboBox<AlwaysOffscreen> alwaysOffscreenComboBox = new ComboBox<>();
alwaysOffscreenComboBox.setMaxWidth(Double.MAX_VALUE);
alwaysOffscreenComboBox.setValue(container.getAlwaysOffscreen());
alwaysOffscreenComboBox.valueProperty().addListener((observable, oldValue, newValue) -> this.changeSettings(newValue));
addItems(alwaysOffscreenComboBox, AlwaysOffscreen.class);
displayContentPane.add(new TextWithStyle(tr("Always Offscreen"), CAPTION_TITLE_CSS_CLASS), 0, 7);
displayContentPane.add(alwaysOffscreenComboBox, 1, 7);
Region spacer = new Region();
GridPane.setHgrow(spacer, Priority.ALWAYS);
displayContentPane.add(spacer, 2, 0);
displayPane.getChildren().addAll(displayContentPane);
this.setContent(displayPane);
lockableElements.addAll(Arrays.asList(glslComboBox, directDrawRendererComboBox, offscreenRenderingModeComboBox, renderTargetModeLockComboBox, multisamplingComboBox, strictDrawOrderingComboBox, alwaysOffscreenComboBox, videoMemorySizeComboBox));
}
use of javafx.scene.layout.GridPane in project phoenicis by PhoenicisOrg.
the class WinePrefixContainerInputTab method populate.
private void populate() {
final VBox inputPane = new VBox();
final Text title = new TextWithStyle(tr("Input settings"), TITLE_CSS_CLASS);
inputPane.getStyleClass().add(CONFIGURATION_PANE_CSS_CLASS);
inputPane.getChildren().add(title);
final GridPane inputContentPane = new GridPane();
inputContentPane.getStyleClass().add("grid");
final ComboBox<MouseWarpOverride> mouseWarpOverrideComboBox = new ComboBox<>();
mouseWarpOverrideComboBox.setValue(container.getMouseWarpOverride());
addItems(mouseWarpOverrideComboBox, MouseWarpOverride.class);
inputContentPane.add(new TextWithStyle(tr("Mouse Warp Override"), CAPTION_TITLE_CSS_CLASS), 0, 0);
inputContentPane.add(mouseWarpOverrideComboBox, 1, 0);
inputContentPane.getColumnConstraints().addAll(new ColumnConstraintsWithPercentage(30), new ColumnConstraintsWithPercentage(70));
inputPane.getChildren().addAll(inputContentPane);
this.setContent(inputPane);
lockableElements.add(mouseWarpOverrideComboBox);
}
Aggregations