Java Code Examples for javafx.scene.control.Button.setId()

The following are Jave code examples for showing how to use setId() of the javafx.scene.control.Button class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: LIRE-Lab   File: SearchController.java   Source Code and License Vote up 6 votes
private SearchOutput createSplittableSearchOutput(Collection collection, Feature feature) {
    SearchOutput output = new SearchOutput();
    output.setId("output");

    Button splitButton = new Button();
    splitButton.setGraphic(new TangoIconWrapper("actions:list-add"));
    splitButton.setTooltip(new Tooltip("split output"));
    splitButton.setId("split-output-button");

    splitButton.setOnAction(event -> {
        setupSecondOutput(collection, collection.totalFeatures() > 1 ? collection.getFeature(1) : feature);
        output.disableTitleGraphics();
    });
    output.addTitleGraphics(splitButton);

    return output;
}
 
Example 2
Project: LIRE-Lab   File: SearchController.java   Source Code and License Vote up 6 votes
private SearchOutput createRemovableSearchOutput() {
    SearchOutput output = new SearchOutput();
    output.setId("second-output");

    Button removeButton = new Button();
    removeButton.setGraphic(new TangoIconWrapper("actions:list-remove"));
    removeButton.setTooltip(new Tooltip("unsplit output"));
    removeButton.setId("unsplit-output-button");

    removeButton.setOnAction(event -> {
        Node removedOutput = centerBox.getChildren().remove(centerBox.getChildren().size()-1);
        outputs.remove(removedOutput);
        queryGrid.removeAllListenersButFirst();
        outputs.get(0).enableTitleGraphics();
    });
    output.addTitleGraphics(removeButton);

    return output;
}
 
Example 3
Project: gatepass   File: ErrorMessage.java   Source Code and License Vote up 6 votes
public static void display(String title, String message)
{
	Stage window= new Stage();
	window.initModality(Modality.APPLICATION_MODAL);
	//window.setAlwaysOnTop(true);
	window.getIcons().add(new Image("/pic/slogo.png"));
	window.setTitle(title);
	Label label= new Label();
	label.setText(message);
	label.setStyle("-fx-font-size:14px;");
	
	ImageView imageView = new ImageView(ICON);
	imageView.setFitWidth(40);
	imageView.setFitHeight(40);
       Label labelimage = new Label("",imageView);
	
	// two buttons
	Button okbtn= new Button("Ok");
	okbtn.setOnAction(e -> {
		answer= false;
		window.close();
	});
	okbtn.setId("red");
	HBox hbox= new HBox(10);
	hbox.setAlignment(Pos.CENTER_LEFT);
	hbox.setPadding(new Insets(10,5,10,5));
	hbox.getChildren().addAll(labelimage,label);
	VBox layout= new VBox(15);
	layout.setAlignment(Pos.CENTER_RIGHT);
	layout.setPadding(new Insets(10,5,10,5));
	layout.getChildren().addAll(hbox,okbtn);
	layout.setStyle("-fx-background-color: linear-gradient(#E4EAA2, #9CD672);");
	Scene scene= new Scene(layout);
	scene.getStylesheets().add(ErrorMessage.class.getResource("confirm.css").toExternalForm());
	window.setScene(scene);
	window.setResizable(false);
	window.showAndWait();
}
 
Example 4
Project: gatepass   File: SuccessMessage.java   Source Code and License Vote up 6 votes
public static void display(String title, String message)
{
	Stage window= new Stage();
	window.initModality(Modality.APPLICATION_MODAL);
	window.setAlwaysOnTop(true);
	window.getIcons().add(new Image("/pic/slogo.png"));
	window.setTitle(title);
	Label label= new Label();
	label.setText(message);
	label.setStyle("-fx-font-size:14px;");
	
	ImageView imageView = new ImageView(ICON);
	imageView.setFitWidth(40);
	imageView.setFitHeight(40);
       Label labelimage = new Label("",imageView);
	
	// two buttons
	Button okbtn= new Button("Ok");
	okbtn.setOnAction(e -> {
		answer= false;
		window.close();
	});
	okbtn.setId("blue");
	HBox hbox= new HBox(10);
	hbox.setAlignment(Pos.CENTER_LEFT);
	hbox.setPadding(new Insets(10,5,10,5));
	hbox.getChildren().addAll(labelimage,label);
	VBox layout= new VBox(15);
	layout.setAlignment(Pos.CENTER_RIGHT);
	layout.setPadding(new Insets(10,5,10,5));
	layout.getChildren().addAll(hbox,okbtn);
	layout.setStyle("-fx-background-color: linear-gradient(#E4EAA2, #9CD672);");
	Scene scene= new Scene(layout);
	window.setScene(scene);
	scene.getStylesheets().add(SuccessMessage.class.getResource("confirm.css").toExternalForm());
	window.setResizable(false);
	window.showAndWait();
}
 
Example 5
Project: Lernkartei_2017   File: RenameView.java   Source Code and License Vote up 5 votes
@Override
public void refreshView ()
{
	renameLayout.getChildren().clear();
	doorname="";
	if(getFXController().getLastViewName().matches("views.StackView.*"))
	{
		doorname = getMyModel().getDataList("").get(getMyModel().getDataList("").size()-1);
	}
	
		oldValue = getMyModel().getString("");
		TextField front = new TextField(getMyModel().getString(""));
		front.setPromptText("Eingabe erforderlich");

		Button saveBtn = new Button("Speichern"); // \u270d \u2055 \u2699 \u270E
		saveBtn.setId("small");
		saveBtn.setOnAction(e ->
		{		
			saveNameAndExit(oldValue, front.getText(), doorname);
		});
		saveBtn.setOnKeyReleased(e ->
		{
			if (e.getCode() == KeyCode.ENTER)
				saveNameAndExit(oldValue, front.getText(), doorname);
		});
		
		front.setOnKeyReleased(e ->
		{
			if (e.getCode() == KeyCode.ENTER)
			{
				saveNameAndExit(oldValue, front.getText(), doorname);
			}		
		});

		renameLayout.getChildren().addAll(front, saveBtn);
	
	scroller.setContent(renameLayout);
}
 
Example 6
Project: GameAuthoringEnvironment   File: MainUserInterface.java   Source Code and License Vote up 5 votes
private Node createLogin () {
    HBox box = new HBox(Integer.parseInt(mySpecs.getString(SPACING_KEY)));
    box.setAlignment(Pos.CENTER);
    Button fbButton =
            createButton(myLabels.getString("splashloginfb"), e -> loginWithFacebook());
    fbButton.setId(mySpecs.getString("fbbutton"));
    box.getChildren()
            .add(fbButton);
    return box;
}
 
Example 7
Project: LIRE-Lab   File: CommandComboBox.java   Source Code and License Vote up 5 votes
private Node updateButton() {
    Button button = factory.createButton(commandProperty.getValue(), () -> comboBox.getValue());
    button.setId("toolbar-search-collection");
    setupButtonDisableProperty(button);

    return getChildren().set(1, button);
}
 
Example 8
Project: LIRE-Lab   File: ToolBarController.java   Source Code and License Vote up 5 votes
private void initLeftToolBar() {
    leftToolBar.getChildren().clear();
    List<Command<Void>> leftToolBarCommands = applicationCommands.getLeftToolBarCommands();
    for (Command<Void> command : leftToolBarCommands) {
        Button button = commandTriggerFactory.createButton(command, () -> null);
        button.setId("toolbar-" + command.getNodeId());
        leftToolBar.getChildren().add(button);
    }

}
 
Example 9
Project: LIRE-Lab   File: ToolBarController.java   Source Code and License Vote up 5 votes
private void initRightTooBar() {
    rightToolBar.getChildren().clear();
    List<Command<Void>> commands = applicationCommands.getRightToolBarCommands();
    for (Command<Void> command : commands) {
        Button button = commandTriggerFactory.createButton(command, () -> null);
        button.setId("toolbar-" + command.getNodeId());
        rightToolBar.getChildren().add(button);
    }
    rightToolBar.getChildren().add(searchCollectionComboBox);
}
 
Example 10
Project: LIRE-Lab   File: CollectionDetail.java   Source Code and License Vote up 5 votes
private void setupToolBar(Collection collection, List<Command<Collection>> commands) {
    for (Command<Collection> command : commands) {
        Button button = commandTriggerFactory.createButton(command, () -> collection);
        button.setId("collection-detail-" + command.getNodeId());
        topLine.getChildren().add(button);
    }
}
 
Example 11
Project: ExtremeGuiMakeover   File: FeaturesPane.java   Source Code and License Vote up 5 votes
public FeaturesPane() {
    super();

    getStylesheets().add(FeaturesPane.class.getResource("/options-pane.css").toExternalForm());

    getStyleClass().add("options-pane");

    Button all = new Button("All");
    all.setOnAction(evt -> features.forEach(f -> f.setActive(true)));
    all.setMaxWidth(Double.MAX_VALUE);
    all.setId("all-button");
    Util.installWindowDragListener(all);

    Button reset = new Button("Reset");
    reset.setOnAction(evt -> features.forEach(f -> f.setActive(false)));
    reset.setMaxWidth(Double.MAX_VALUE);
    reset.setId("reset-button");
    Util.installWindowDragListener(reset);

    HBox top = new HBox(all, reset);
    top.getStyleClass().add("toolbar");
    top.setFillHeight(true);
    HBox.setHgrow(all, Priority.ALWAYS);
    HBox.setHgrow(reset, Priority.ALWAYS);

    getChildren().add(top);
}
 
Example 12
Project: voogasalad-ltub   File: BackgroundSettingMenuHandler.java   Source Code and License Vote up 5 votes
private Button createButton(Pane root, ColorPicker colorPicker) {
	Button okayButton = new Button(myResources.getString("OkayButton"));
	okayButton.setLayoutX(200);
	okayButton.setLayoutY(100);
	okayButton.setId("btnLogin");
	okayButton.setOnAction(e -> {
		root.setBackground(new Background(new BackgroundFill(colorPicker.getValue(), CornerRadii.EMPTY, Insets.EMPTY)));
		stage.close();
	});
	return okayButton;
}
 
Example 13
Project: voogasalad-ltub   File: LevelManager.java   Source Code and License Vote up 5 votes
private Button createButton() {
	Button starting = new Button("Start A Game of Random Level");				
	starting.setLayoutX(500);
	starting.setLayoutY(600);
	starting.setId("starting");
	starting.setMinWidth(100);
	starting.setMinHeight(100);
	return starting;
}
 
Example 14
Project: gatepass   File: ComplexConfirm.java   Source Code and License Vote up 4 votes
public static boolean display(String title, String message)
{
	Stage window= new Stage();
	window.initModality(Modality.APPLICATION_MODAL);
	window.getIcons().add(new Image("/pic/slogo.png"));
	window.setTitle(title);
	Label label= new Label();
	label.setText(message);
	label.setStyle("-fx-font-size:14px;");
	
	ImageView imageView = new ImageView(ICON);
	imageView.setFitWidth(50);
	imageView.setFitHeight(50);
       Label labelimage = new Label("",imageView);
	// two buttons
	Button yesbtn= new Button("Yes");
	yesbtn.setId("red");
	Button nobtn= new Button("No");
	nobtn.setId("blue");
	Button ynbtn= new Button("Backup");
	ynbtn.setId("green");
	yesbtn.setOnAction(e -> {
		answer= true;
		SuccessMessage.display("Success", "Your tables have been cleared");
		window.close();
	});
	
	nobtn.setOnAction(e -> {
		answer= false;
		window.close();
	});
	
	ynbtn.setOnAction(e -> {
		try {
			window.close();
			new Back().start(new Stage());
		} catch (Exception e1) {
			ErrorMessage.display("Launch Error", e1.getMessage()+" /nError occured during launching application");
			e1.printStackTrace();
		}
	});
	
	HBox hbox= new HBox(10);
	hbox.setAlignment(Pos.CENTER_RIGHT);
	hbox.setPadding(new Insets(0,5,0,5));
	hbox.getChildren().addAll(yesbtn, ynbtn ,nobtn);
	
	HBox layout= new HBox(5);
	layout.setPadding(new Insets(10,5,10,5));
	layout.getChildren().addAll(labelimage,label);
	
	VBox layout2= new VBox(10);
	layout2.setPadding(new Insets(10,5,10,5));
	layout2.getChildren().addAll(layout, hbox);
	layout2.setStyle("-fx-background-color: linear-gradient(#E4EAA2, #9CD672);");
	Scene scene= new Scene(layout2);
	window.setScene(scene);
	window.setResizable(false);
	scene.getStylesheets().add(ComplexConfirm.class.getResource("confirm.css").toExternalForm());
	window.showAndWait();
	
	return answer;
}
 
Example 15
Project: gatepass   File: Confirmation.java   Source Code and License Vote up 4 votes
public static boolean display(String title, String message)
{
	Stage window= new Stage();
	window.initModality(Modality.APPLICATION_MODAL);
	window.getIcons().add(new Image("/pic/slogo.png"));
	window.setTitle(title);
	//window.setAlwaysOnTop(true);
	Label label= new Label();
	label.setText(message);
	label.setStyle("-fx-font-size:14px;");
	label.setAlignment(Pos.CENTER_LEFT);
	
	ImageView imageView = new ImageView(ICON);
	imageView.setFitWidth(35);
	imageView.setFitHeight(35);
       Label labelimage = new Label("",imageView);
	// two buttons
	Button yesbtn= new Button("Yes");
	yesbtn.setId("red");
	Button nobtn= new Button("No");
	nobtn.setId("green");
	
	yesbtn.setOnAction(e -> {
		answer= true;
		window.close();
	});
	
	nobtn.setOnAction(e -> {
		answer= false;
		window.close();
	});
	
	HBox hbox= new HBox(10);
	hbox.setAlignment(Pos.CENTER_RIGHT);
	hbox.setPadding(new Insets(0,5,0,5));
	hbox.getChildren().addAll(yesbtn, nobtn);
	
	HBox layout= new HBox(5);
	layout.setPadding(new Insets(10,5,10,5));
	layout.getChildren().addAll(labelimage,label);
	
	VBox layout2= new VBox(10);
	layout2.setPadding(new Insets(10,10,10,10));
	layout2.getChildren().addAll(layout, hbox);
	layout2.setStyle("-fx-background-color: linear-gradient(#E4EAA2, #9CD672);");
	Scene scene= new Scene(layout2);
	scene.getStylesheets().add(Confirmation.class.getResource("confirm.css").toExternalForm());
	window.setScene(scene);
	window.setResizable(false);
	window.showAndWait();
	
	return answer;
}
 
Example 16
Project: voogasalad-ltub   File: PasswordManager.java   Source Code and License Vote up 4 votes
private Button createButton(String name, String id){
	Button button = new Button(name);
	button.setMaxWidth(Double.MAX_VALUE);
	button.setId(id);
	return button;
}