javafx.scene.control.Tooltip#setText ( )源码实例Demo

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

源代码1 项目: phoebus   文件: ScrollBarRepresentation.java
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);
}
 
源代码2 项目: JFoenix   文件: ValidatorBase.java
/**
 * 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);
    }
}
 
源代码3 项目: bisq   文件: GUIUtil.java
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);
    }
}
 
源代码4 项目: chart-fx   文件: EditDataSet.java
@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);
}
 
源代码5 项目: oim-fx   文件: TooltipFrame.java
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);

	}
 
源代码6 项目: kafka-message-tool   文件: TooltipCreator.java
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;
}
 
源代码7 项目: mars-sim   文件: ScenarioEditorController.java
@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);
*/
	}
 
源代码8 项目: iliasDownloaderTool   文件: CoursesTreeView.java
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);
	}
}
 
源代码9 项目: molecular-music-generator   文件: Controller.java
private void attachTooltip( Control element, String tooltipText ) {
    final Tooltip tooltip = new Tooltip();
    tooltip.setText(tooltipText);
    element.setTooltip(tooltip);
}