Button tbBack = new Button();
AquaFx.createButtonStyler().setIcon(MacOSDefaultIcons.LEFT).setType(ButtonType.LEFT_PILL).style(tbBack);
Button tbForward = new Button();
tbForward.setDisable(true);
AquaFx.createButtonStyler().setIcon(MacOSDefaultIcons.RIGHT).setType(ButtonType.RIGHT_PILL).style(tbForward);
HBox separator = new HBox();
separator.setPrefSize(15, 1);
Button btnAll = new Button("Alle einblenden");
HBox separator2 = new HBox();
separator2.setPrefSize(279, 1);
TextField search = new TextField();
AquaFx.createTextFieldStyler().setType(TextFieldType.SEARCH).style(search);
toolBar.getItems().addAll(tbBack, tbForward, separator, btnAll, separator2, search);
mainBox.getChildren().add(toolBar);
/*
* The top content
*/
HBox header = new HBox();
header.setSpacing(5);
header.setPadding(new Insets(20, 0, 5, 0));
header.setAlignment(Pos.CENTER);
Label labelSurrounding = new Label("Umgebung:");
ChoiceBox<Object> choices = new ChoiceBox<Object>();
choices.setItems(FXCollections.observableArrayList("Automatisch", new Separator(), "Umgebungen bearbeiten ..."));
choices.getSelectionModel().selectFirst();
header.getChildren().addAll(labelSurrounding, choices);
mainBox.getChildren().add(header);
/*
* The left-side content
*/
HBox content = new HBox();
content.setPadding(new Insets(10, 15, 10, 20));
content.setSpacing(10);
ListView<String> list = new ListView<String>();
ObservableList<String> listItems = FXCollections.observableArrayList("WLAN", "Bluetooth-PAN");
list.setItems(listItems);
list.setPrefWidth(200);
// Create a CellFactory for ListCells
list.setCellFactory(new Callback<ListView<String>, ListCell<String>>() {
@Override public ListCell<String> call(ListView<String> list) {
return new NetworkCell();
}
});
content.getChildren().add(list);
/*
* The right-side content
*/
GridPane grid = new GridPane();
// grid.setGridLinesVisible(true);
grid.setHgap(10);
grid.setVgap(10);
grid.setPadding(new Insets(18, 5, 8, 15));
AquaFx.setGroupBox(grid);
Label labelStatus = new Label("Status:");
GridPane.setHalignment(labelStatus, HPos.RIGHT);
grid.add(labelStatus, 0, 0, 2, 1);
Label labelConnected = new Label("Verbunden");
labelConnected.setStyle("-fx-font-weight: bold;");
grid.add(labelConnected, 2, 0);
Button btnDisableWlan = new Button("WLAN deaktivieren");
GridPane.setHalignment(btnDisableWlan, HPos.RIGHT);
grid.add(btnDisableWlan, 3, 0);
Label labelCurrent = new Label("\"WLAN\" ist mit \"PrettyFlyForAWiFi\" verbunden und \n hat die IP-Adresse 192.168.0.104.");
labelCurrent.setStyle("-fx-font-size: 11");
grid.add(labelCurrent, 2, 2, 3, 1);
Label labelNetworkName = new Label("Netzwerkname:");
GridPane.setHalignment(labelNetworkName, HPos.RIGHT);
grid.add(labelNetworkName, 0, 3);
ChoiceBox<Object> choicesNetwork = new ChoiceBox<Object>();
choicesNetwork.setItems(FXCollections.observableArrayList("PrettyFlyForAWiFi", new Separator(),
"Mit anderem Netzwerk verbinden ...", "Netzwerk anlegen"));
choicesNetwork.getSelectionModel().select(2);
GridPane.setHalignment(choicesNetwork, HPos.RIGHT);
GridPane.getHgrow(choicesNetwork);
grid.add(choicesNetwork, 1, 3, 3, 1);
CheckBox checkShowNew = new CheckBox("Auf neue Netzwerke hinweisen");
checkShowNew.setSelected(true);
grid.add(checkShowNew, 1, 4, 3, 1);
Label labelExplanation = new Label("Bekannte Netzwerke wewrden automatisch verbunden. \n" + "Falls kein bekanntes Netzwerk vorhanden ist, werden \n" + "Sie vor dem Verbinden mit einem neuen Netzwerk \n" + "gefragt.");
labelExplanation.setStyle("-fx-font-size: 10");
grid.add(labelExplanation, 1, 5, 3, 1);
VBox spacer = new VBox();
spacer.setPrefHeight(140);
spacer.setPrefWidth(200);
grid.add(spacer, 3, 6);
CheckBox chekShowState = new CheckBox("WLAN-Status in der \n" + "Men\u00FCleiste anzeigen");
chekShowState.setSelected(true);
GridPane.setValignment(chekShowState, VPos.TOP);
grid.add(chekShowState, 0, 7, 2, 1);
Button btmMore = new Button("Weitere Optionen ...");
GridPane.setHalignment(btmMore, HPos.RIGHT);
GridPane.setValignment(btmMore, VPos.BOTTOM);
grid.add(btmMore, 2, 7, 2, 1);
Button helpBtn = new Button("?");
AquaFx.createButtonStyler().setType(ButtonType.HELP).style(helpBtn);
GridPane.setValignment(helpBtn, VPos.BOTTOM);
GridPane.setHalignment(helpBtn, HPos.RIGHT);
grid.add(helpBtn, 4, 7);
content.getChildren().add(grid);
mainBox.getChildren().add(content);
/*
* Footer
*/
HBox footerBox = new HBox();
footerBox.setSpacing(5);
footerBox.setAlignment(Pos.BOTTOM_LEFT);
footerBox.setPadding(new Insets(0, 0, 5, 15));
Image image = new Image(AquaFx.class.getResource("demo/images/lock_open.png").toExternalForm());
ImageView lockView = new ImageView(image);
lockView.setPreserveRatio(true);
lockView.setFitHeight(36);
footerBox.getChildren().add(lockView);
Label info = new Label("Zum Sch\u00FCtzen auf das Schloss klicken.");
info.setStyle("-fx-font-size: 12");
info.setPadding(new Insets(0, 0, 3, 0));
footerBox.getChildren().add(info);
mainBox.getChildren().add(footerBox);
HBox anchorButtons = new HBox();
anchorButtons.setPadding(new Insets(0, 15, 0, 0));
anchorButtons.setSpacing(15);
anchorButtons.setAlignment(Pos.BOTTOM_RIGHT);
Button btnAssis = new Button("Assistent ...");
anchorButtons.getChildren().add(btnAssis);
Button btnRev = new Button("Zur\u00FCcksetzen");
btnRev.setDisable(true);
anchorButtons.getChildren().add(btnRev);
Button btnUse = new Button("Anwenden");
btnUse.setDisable(true);
anchorButtons.getChildren().add(btnUse);
mainBox.getChildren().add(anchorButtons);
/*
* MenuBar
*/