Java Code Examples for javafx.scene.control.Tooltip#setText()

The following examples show how to use javafx.scene.control.Tooltip#setText() . 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: ScrollBarRepresentation.java    From phoebus with Eclipse Public License 1.0 6 votes vote down vote up
private void nodeValueChanged(final ObservableValue<? extends Number> property, final Number old_value, final Number new_value)
{
    if (active)
        return;
    final Tooltip tip = jfx_node.getTooltip();
    if (model_widget.propShowValueTip().getValue())
    {
        final String text = Objects.toString(new_value);
        if (tip != null)
            tip.setText(text);
        else
            jfx_node.setTooltip(new Tooltip(text));
    }
    else if (tip != null)
        jfx_node.setTooltip(null);
    toolkit.fireWrite(model_widget, new_value);
}
 
Example 2
Source File: ValidatorBase.java    From JFoenix with Apache License 2.0 6 votes vote down vote up
/**
 * This method will update the source control after evaluating the validation condition (see {@link #eval()}).
 * <p>
 * If the validator isn't "passing" the {@link #PSEUDO_CLASS_ERROR :error} pseudoclass is applied to the
 * {@link #srcControl}.
 * <p>
 * Applies the {@link #PSEUDO_CLASS_ERROR :error} pseudo class and the errorTooltip to
 * the {@link #srcControl}.
 */
protected void onEval() {
    Node control = getSrcControl();
    boolean invalid = hasErrors.get();
    control.pseudoClassStateChanged(PSEUDO_CLASS_ERROR, invalid);
    Tooltip activeTooltip = getActiveTooltip(control);
    if (invalid) {
        Tooltip errorTooltip = errorTooltipSupplier.get();
        errorTooltip.getStyleClass().add(ERROR_TOOLTIP_STYLE_CLASS);
        errorTooltip.setText(getMessage());
        install(control, activeTooltip, errorTooltip);
    } else {
        Tooltip orgTooltip = (Tooltip) control.getProperties().remove(TEMP_TOOLTIP_KEY);
        install(control, activeTooltip, orgTooltip);
    }
}
 
Example 3
Source File: GUIUtil.java    From bisq with GNU Affero General Public License v3.0 6 votes vote down vote up
public static void updateConfidence(TransactionConfidence confidence,
                                    Tooltip tooltip,
                                    TxConfidenceIndicator txConfidenceIndicator) {
    if (confidence != null) {
        switch (confidence.getConfidenceType()) {
            case UNKNOWN:
                tooltip.setText(Res.get("confidence.unknown"));
                txConfidenceIndicator.setProgress(0);
                break;
            case PENDING:
                tooltip.setText(Res.get("confidence.seen", confidence.numBroadcastPeers()));
                txConfidenceIndicator.setProgress(-1.0);
                break;
            case BUILDING:
                tooltip.setText(Res.get("confidence.confirmed", confidence.getDepthInBlocks()));
                txConfidenceIndicator.setProgress(Math.min(1, (double) confidence.getDepthInBlocks() / 6.0));
                break;
            case DEAD:
                tooltip.setText(Res.get("confidence.invalid"));
                txConfidenceIndicator.setProgress(0);
                break;
        }

        txConfidenceIndicator.setPrefSize(24, 24);
    }
}
 
Example 4
Source File: EditDataSet.java    From chart-fx with Apache License 2.0 5 votes vote down vote up
@Override
protected void updateItem(ShiftConstraint shiftConstraint, boolean empty) {
    super.updateItem(shiftConstraint, empty);
    if (shiftConstraint == null || empty) {
        setGraphic(null);
        return;
    }
    Glyph result;
    Tooltip tooltip = new Tooltip();
    switch (shiftConstraint) {
    case SHIFTX:
        result = new Glyph(FONT_AWESOME, FontAwesome.Glyph.ARROWS_H).size(FONT_SIZE_COMBO);
        tooltip.setText("Allow to modify the x value of the points");
        setText("shift x");
        break;
    case SHIFTXY:
        result = new Glyph(FONT_AWESOME, FontAwesome.Glyph.ARROWS).size(FONT_SIZE_COMBO);
        tooltip.setText("Allow to modify the the points freely");
        setText("shift xy");
        break;
    case SHIFTY:
        result = new Glyph(FONT_AWESOME, FontAwesome.Glyph.ARROWS_V).size(FONT_SIZE_COMBO);
        tooltip.setText("Allow to modify the x value of the points");
        setText("shift y");
        break;
    default:
        result = new Glyph(FONT_AWESOME, FontAwesome.Glyph.QUESTION_CIRCLE).size(FONT_SIZE_COMBO);
        setText("-");
    }
    result.setTextFill(Color.DARKBLUE);
    result.setPadding(Insets.EMPTY);
    setGraphic(result);
}
 
Example 5
Source File: TooltipFrame.java    From oim-fx with MIT License 5 votes vote down vote up
private void init() {

		this.setCenter(rootVBox);
		this.setTitle("登录");
		this.setWidth(380);
		this.setHeight(600);
		this.setRadius(10);

		rootVBox.getChildren().add(hBox1);
		rootVBox.getChildren().add(hBox2);
		rootVBox.getChildren().add(hBox3);
		rootVBox.getChildren().add(hBox4);

		Tooltip tooltip1 = new Tooltip();
		tooltip1.setText("账号");
		tooltip1.setHideOnEscape(true);

		TextField textField1 = new TextField();
		
		textField1.setTooltip(tooltip1);
		
		Button button1 = new Button();

		button1.setText("点击");
		button1.setOnAction(new EventHandler<ActionEvent>() {

			@Override
			public void handle(ActionEvent event) {
				tooltip1.show(TooltipFrame.this);
			}
		});
		hBox1.getChildren().add(textField1);
		hBox1.getChildren().add(button1);

	}
 
Example 6
Source File: TooltipCreator.java    From kafka-message-tool with MIT License 5 votes vote down vote up
public static Tooltip createFrom(String toolTipText) {
    if (StringUtils.isBlank(toolTipText)) {
        return null;
    }
    Tooltip tip = new Tooltip();
    tip.setText(toolTipText);
    tip.setContentDisplay(ContentDisplay.TEXT_ONLY);
    return tip;
}
 
Example 7
Source File: ScenarioEditorController.java    From mars-sim with GNU General Public License v3.0 5 votes vote down vote up
@Override
	public void initialize(URL arg0, ResourceBundle arg1) {
            
            loadScenarios();
            Tooltip tt = new Tooltip();
            tt.setText(facebookURL);
            carlfxHyperlink.setTooltip(tt);
                carlfxHyperlink.setOnAction(new EventHandler<ActionEvent>() {
                    public void handle(ActionEvent evt) {
                        
                        //webEngine.load(rssFeed.link);
                    }
                });
                createColumns(recipeTableView1);
                recipeTableView1.setItems(getChapterRecipes("1"));
                createLaunchAppEvent(recipeTableView1);
                
                createColumns(recipeTableView2);
                recipeTableView2.setItems(getChapterRecipes("2"));
                createLaunchAppEvent(recipeTableView2);
/*                
                createColumns(chap3RecipeTableView);
                chap3RecipeTableView.setItems(getChapterRecipes("3"));
                createLaunchAppEvent(chap3RecipeTableView);
                
                createColumns(chap4RecipeTableView);
                chap4RecipeTableView.setItems(getChapterRecipes("4"));
                createLaunchAppEvent(chap4RecipeTableView);
*/
	}
 
Example 8
Source File: CoursesTreeView.java    From iliasDownloaderTool with GNU General Public License v2.0 5 votes vote down vote up
private void createToolTip() {
	if (node instanceof IliasFile) {
		Tooltip tooltip = new Tooltip();
		String fileExtension = ((IliasFile) this.node).getExtension();
		String fileSizeLabel = ((IliasFile) this.node).getSizeLabel();
		tooltip.setText("Elementtyp: " + fileExtension + "\n" + "Größe: " + fileSizeLabel);
		this.setTooltip(tooltip);
	}
}
 
Example 9
Source File: Controller.java    From molecular-music-generator with MIT License 4 votes vote down vote up
private void attachTooltip( Control element, String tooltipText ) {
    final Tooltip tooltip = new Tooltip();
    tooltip.setText(tooltipText);
    element.setTooltip(tooltip);
}