Java Code Examples for javafx.scene.control.Label#setRotate()

The following examples show how to use javafx.scene.control.Label#setRotate() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AddressWithIconAndDirection.java    From bisq with GNU Affero General Public License v3.0 8 votes vote down vote up
public AddressWithIconAndDirection(String text, String address, boolean received) {
    Label directionIcon = new Label();
    directionIcon.getStyleClass().add("icon");
    directionIcon.getStyleClass().add(received ? "received-funds-icon" : "sent-funds-icon");
    AwesomeDude.setIcon(directionIcon, received ? AwesomeIcon.SIGNIN : AwesomeIcon.SIGNOUT);
    if (received)
        directionIcon.setRotate(180);
    directionIcon.setMouseTransparent(true);

    setAlignment(Pos.CENTER_LEFT);
    Label label = new AutoTooltipLabel(text);
    label.setMouseTransparent(true);
    HBox.setMargin(directionIcon, new Insets(0, 3, 0, 0));
    HBox.setHgrow(label, Priority.ALWAYS);

    hyperlink = new ExternalHyperlink(address);
    HBox.setMargin(hyperlink, new Insets(0));
    HBox.setHgrow(hyperlink, Priority.SOMETIMES);
    // You need to set max width to Double.MAX_VALUE to make HBox.setHgrow working like expected!
    // also pref width needs to be not default (-1)
    hyperlink.setMaxWidth(Double.MAX_VALUE);
    hyperlink.setPrefWidth(0);

    getChildren().addAll(directionIcon, label, hyperlink);
}
 
Example 2
Source File: TimelinePanel.java    From constellation with Apache License 2.0 6 votes vote down vote up
private Label createExtentLabel() {
    final Label newLabel = new Label();

    // Align the text vertically:
    newLabel.setRotate(270d);
    // Fix the dimensions to prevent jittery motion on value changes:
    newLabel.setMinWidth(150d);
    newLabel.setPrefWidth(150d);
    newLabel.setMaxWidth(150d);
    newLabel.setMinHeight(30d);
    newLabel.setPrefHeight(30d);
    newLabel.setMaxHeight(30d);
    newLabel.setAlignment(Pos.CENTER);

    return newLabel;
}
 
Example 3
Source File: ScriptingAspectEditor.java    From milkman with MIT License 6 votes vote down vote up
private Tab getTab(Supplier<String> getter, Consumer<String> setter, String title) {
	ContentEditor postEditor = new ContentEditor();
	postEditor.setEditable(true);
	postEditor.setContent(getter, setter);
	postEditor.setContentTypePlugins(Collections.singletonList(new JavascriptContentType()));
	postEditor.setContentType("application/javascript");
	postEditor.setHeaderVisibility(false);

	Tab postTab = new Tab("", postEditor);
	Label label = new Label(title);
	label.setRotate(90);
	label.setMinWidth(150);
	label.setMaxWidth(150);
	label.setMinHeight(40);
	label.setMaxHeight(40);
	label.setPadding(new Insets(0));
	postTab.setGraphic(label);
	return postTab;
}
 
Example 4
Source File: OptionsDialog.java    From milkman with MIT License 6 votes vote down vote up
public void showAndWait(List<OptionPageProvider> optionPageProviders) {
	JFXDialogLayout content = new OptionsDialogFxml(this);
	content.setPrefWidth(600);
	for(OptionPageProvider<?> p : optionPageProviders) {
		OptionDialogPane pane = p.getOptionsDialog(new OptionDialogBuilder());
		Tab tab = new Tab("", pane);
		Label label = new Label(pane.getName());
		label.setRotate(90);
		label.setMinWidth(100);
		label.setMaxWidth(100);
		label.setMinHeight(40);
		label.setMaxHeight(40);
		tab.setGraphic(label);
		tabs.getTabs().add(tab);
		
	}

	dialog = FxmlUtil.createDialog(content);
	
	dialog.showAndWait();
}