javafx.scene.control.Label#setRotate ( )源码实例Demo

下面列出了javafx.scene.control.Label#setRotate ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: bisq   文件: AddressWithIconAndDirection.java
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);
}
 
源代码2 项目: constellation   文件: TimelinePanel.java
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;
}
 
源代码3 项目: milkman   文件: ScriptingAspectEditor.java
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;
}
 
源代码4 项目: milkman   文件: OptionsDialog.java
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();
}