Java 类javafx.scene.control.Tooltip 实例源码

项目:domino-todolist    文件:DesktopLayoutView.java   
@Override
public void addMenuItem(LayoutContext.LayoutMenuItem layoutMenuItem) {
    Image image = new Image(getClass().getResourceAsStream("/" + layoutMenuItem.icon() + ".png"));
    Button item = new Button("", new ImageView(image));
    item.setTooltip(new Tooltip(layoutMenuItem.text()));
    item.setCursor(Cursor.HAND);
    item.setBackground(Background.EMPTY);
    item.setMinWidth(menu.getMinWidth());
    item.setOnAction(event -> layoutMenuItem.selectHandler().onSelect());
    menu.getChildren().add(item);
}
项目:Money-Manager    文件:TransactionHistoryController.java   
@FXML
public void initialize() {
    lblUserFullName.setText(userFullName()+" ");
    showAllMonths();
    showAllFilter();
    datePicker.setConverter(formatManager);
    datePicker.setValue(date);
    webEngine = webview.getEngine();
    showHisoty();

    btnSignOut.setTooltip(new Tooltip("Sign Out from application"));
    btnGo.setTooltip(new Tooltip("Seach history by the selected date"));
    Tooltip.install(lblUserFullName, new Tooltip("User's Full Name"));
    Tooltip.install(cmboHistoryMonth, new Tooltip("Your all transactional month name"));
    Tooltip.install(cmboFilterList, new Tooltip("Select a filter to get specilazid search"));
    Tooltip.install(datePicker, new Tooltip("Select a date to get history on that day"));
    Tooltip.install(webview, new Tooltip("Your History"));
}
项目:Money-Manager    文件:NewUserRegistrationController.java   
@FXML
public void initialize() {
    loadSQuestion();

    btnCancel.setTooltip(new Tooltip("Cancel the registration process and take you to Sign In Window"));
    btnRegistration.setTooltip(new Tooltip("If all data typed correctly, \n"
            + "then you will register as a new user"));
    Tooltip.install(txtName, new Tooltip("Write your full name"));
    Tooltip.install(txtUsername, new Tooltip("Give a username, this will use at the time of login\n"
            + "This should not contain space"));
    Tooltip.install(passPassword, new Tooltip("Give a password, this should not contain space"));
    Tooltip.install(passReTypePassword, new Tooltip("Retype the password"));
    Tooltip.install(cmboSecurityQuestion, new Tooltip("Choose a security question"));
    Tooltip.install(txtAnswer, new Tooltip("Answer your question. Remember this answer.\n"
            + "If you forget your password, this will \n"
            + "help you to recover your account."));
}
项目:Money-Manager    文件:CashCalculateController.java   
@FXML
    public void initialize() {
        lblUserFullName.setText(userFullName()+" "); //show user full name on Menu
        lblWalletBalance.setText(addThousandSeparator(getWalletBalance())); //show current wallet balance
        CashCalculate(); //set all field initialize value to 0

//      add tooltip on mouse hover
        btnDashboard.setTooltip(new Tooltip("Will Take you to Dashboard"));
        btnMakeATransaction.setTooltip(new Tooltip("Will Take you to Expense"));
        btnSignOut.setTooltip(new Tooltip("Sign Out from Application"));
        Tooltip.install(lblWalletBalance, new Tooltip("Your wallet balance now"));
        Tooltip.install(lblUserFullName, new Tooltip("User's Full Name"));
        Tooltip.install(txt1000, new Tooltip("Number of 1000 Tk. Notes in your hand"));
        Tooltip.install(txt500, new Tooltip("Number of 500 Tk. Notes in your hand"));
        Tooltip.install(txt100, new Tooltip("Number of 100 Tk. Notes in your hand"));
        Tooltip.install(txt50, new Tooltip("Number of 50 Tk. Notes in your hand"));
        Tooltip.install(txt20, new Tooltip("Number of 20 Tk. Notes in your hand"));
        Tooltip.install(txt10, new Tooltip("Number of 10 Tk. Notes in your hand"));
        Tooltip.install(txt5, new Tooltip("Number of 5 Tk. Notes in your hand"));
        Tooltip.install(txt2, new Tooltip("Number of 2 Tk. Notes in your hand"));
        Tooltip.install(txt1, new Tooltip("Number of 1 Tk. Notes in your hand"));
    }
项目:Squid    文件:RatiosManagerController.java   
public SquidRatioButton(int row, int col, String ratioName, boolean selected) {
    super(selected ? ratioName : "");

    Tooltip ratioToolTip = new Tooltip(ratioName);
    setTooltip(ratioToolTip);

    setOnAction(new SquidRatioButtonEventHandler(row, col, ratioName, selected));

    setPrefWidth(BUTTON_WIDTH - 2);
    setPrefHeight(BUTTON_HEIGHT - 2);
    setStyle("-fx-padding: 0 0 0 0;   \n"
            + "    -fx-border-width: 1;\n"
            + "    -fx-border-color: black;\n"
            + "    -fx-background-radius: 0;\n"
            + "    -fx-background-color: #00BFFF;\n"
            + "    -fx-font-family: \"Courier New\", \"Lucida Sans\", \"Segoe UI\", Helvetica, Arial, sans-serif;\n"
            + "    -fx-font-weight: bold;\n"
            + "    -fx-font-size: 8pt;\n"
            + "    -fx-text-fill: White;/*  #d8d8d8;*/\n"
    );
    setWrapText(true);
}
项目:Squid    文件:RatiosManagerController.java   
public SquidRowColButton(int row, int col, String ratioName) {
    super(ratioName);

    ratioToolTip = new Tooltip("Click to select entire " + (String) (row == -1 ? "column" : "row"));
    setTooltip(ratioToolTip);

    setOnAction(new SquidRowColButtonEventHandler(row, col));

    setPrefWidth(BUTTON_WIDTH - 2);
    setPrefHeight(BUTTON_HEIGHT - 2);
    setStyle("-fx-padding: 0 0 0 0;   \n"
            + "    -fx-border-width: 1;\n"
            + "    -fx-border-color: black;\n"
            + "    -fx-background-radius: 0;\n"
            + "    -fx-background-color: #ffa06d;\n"
            + "    -fx-font-family: \"Courier New\", \"Lucida Sans\", \"Segoe UI\", Helvetica, Arial, sans-serif;\n"
            + "    -fx-font-weight: bold;\n"
            + "    -fx-font-size: 9pt;\n"
            + "    -fx-text-fill: Black;/*  #d8d8d8;*/\n"
    );
    setWrapText(true);
}
项目:charts    文件:StreamChart.java   
private void initGraphics() {
    if (Double.compare(getPrefWidth(), 0.0) <= 0 || Double.compare(getPrefHeight(), 0.0) <= 0 || Double.compare(getWidth(), 0.0) <= 0 ||
        Double.compare(getHeight(), 0.0) <= 0) {
        if (getPrefWidth() > 0 && getPrefHeight() > 0) {
            setPrefSize(getPrefWidth(), getPrefHeight());
        } else {
            setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT);
        }
    }

    canvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT);
    ctx    = canvas.getGraphicsContext2D();

    tooltip = new Tooltip();
    tooltip.setAutoHide(true);

    getChildren().setAll(canvas);
}
项目:textmd    文件:ViewSettingsTab.java   
private void addRefreshRateBox(int col, int row) {
    HBox viewRefreshRateBox = new HBox();
    viewRefreshRateBox.setAlignment(CENTER);
    this.viewRefreshRateLabel.setTextFill(this.textColor);
    this.viewRefreshRateLabel.setAlignment(CENTER);
    this.viewRefreshRateField.setPrefSize(25, 15);
    viewRefreshRateBox.getChildren().addAll(
            this.viewRefreshRateLabel,
            this.viewRefreshRateField
    );
    this.viewRefreshRateField.setOnAction(e ->
            Settings.setViewRefreshRate(Integer.parseInt(this.viewRefreshRateField.getText()))
    );
    this.viewRefreshRateField.setTooltip(new Tooltip(dict.SETTINGS_VIEW_REFRESH_RATE_FIELD_TOOLTIP));
    this.viewRefreshRateLabel.setTooltip(new Tooltip(dict.SETTINGS_VIEW_REFRESH_RATE_LABEL_TOOLTIP));
    this.grid.add(viewRefreshRateBox, col,row);
}
项目:textmd    文件:EditorExtAbbreviationItem.java   
public EditorExtAbbreviationItem(Dictionary dictionary, MarkdownParser markdownParser, TabFactory tabFactory, boolean defaultValue) {
    super(dictionary.TOOLBAR_EDITOR_EXTENSIONS_ABBREVIATION_ITEM);
    abbreviationExtension = AbbreviationExtension.create();
    setSelected(defaultValue);
    if(defaultValue)
        markdownParser.addExtension(abbreviationExtension);
    setToolTip(new Tooltip(dictionary.TOOLBAR_EDITOR_EXTENSIONS_ABBREVIATION_TOOLTIP));
    setOnAction(event -> getClickAction(markdownParser, tabFactory));
}
项目:lttng-scope    文件:StateRectangle.java   
public void showTooltip(boolean beginning) {
    generateTooltip();
    Tooltip tt = requireNonNull(fTooltip);

    /*
     * Show the tooltip first, then move it to the correct location. It
     * needs to be shown for its getWidth() etc. to be populated.
     */
    tt.show(this, 0, 0);

    Point2D position;
    if (beginning) {
        /* Align to the bottom-left of the rectangle, left-aligned. */
        /* Yes, it needs to be getX() here (0), not getLayoutX(). */
        position = this.localToScreen(getX(), getY() + getHeight());
    } else {
        /* Align to the bottom-right of the rectangle, right-aligned */
        position = this.localToScreen(getX() + getWidth() - tt.getWidth(), getY() + getHeight());
    }

    tt.setAnchorX(position.getX());
    tt.setAnchorY(position.getY());
}
项目:charts    文件:World.java   
public void addLocation(final Location LOCATION) {
    double x = (LOCATION.getLongitude() + 180) * (PREFERRED_WIDTH / 360) + MAP_OFFSET_X;
    double y = (PREFERRED_HEIGHT / 2) - (PREFERRED_WIDTH * (Math.log(Math.tan((Math.PI / 4) + (Math.toRadians(LOCATION.getLatitude()) / 2)))) / (2 * Math.PI)) + MAP_OFFSET_Y;

    Circle locationIcon = new Circle(x, y, size * 0.01);
    locationIcon.setFill(null == LOCATION.getColor() ? getLocationColor() : LOCATION.getColor());

    StringBuilder tooltipBuilder = new StringBuilder();
    if (!LOCATION.getName().isEmpty()) tooltipBuilder.append(LOCATION.getName());
    if (!LOCATION.getInfo().isEmpty()) tooltipBuilder.append("\n").append(LOCATION.getInfo());
    String tooltipText = tooltipBuilder.toString();
    if (!tooltipText.isEmpty()) {
        Tooltip tooltip = new Tooltip(tooltipText);
        tooltip.setFont(Font.font(10));
        Tooltip.install(locationIcon, tooltip);
    }

    if (null != LOCATION.getMouseEnterHandler()) locationIcon.setOnMouseEntered(new WeakEventHandler<>(LOCATION.getMouseEnterHandler()));
    if (null != LOCATION.getMousePressHandler()) locationIcon.setOnMousePressed(new WeakEventHandler<>(LOCATION.getMousePressHandler()));
    if (null != LOCATION.getMouseReleaseHandler()) locationIcon.setOnMouseReleased(new WeakEventHandler<>(LOCATION.getMouseReleaseHandler()));
    if (null != LOCATION.getMouseExitHandler()) locationIcon.setOnMouseExited(new WeakEventHandler<>(LOCATION.getMouseExitHandler()));


    locations.put(LOCATION, locationIcon);
}
项目:marathonv5    文件:FXUIUtils.java   
public static ButtonBase _initButtonBase(String name, String toolTip, boolean enabled, String buttonText, ButtonBase button) {
    button.setId(name + "Button");
    button.setTooltip(new Tooltip(toolTip));
    Node enabledIcon = getImageFrom(name, "icons/", FromOptions.NULL_IF_NOT_EXISTS);
    if (enabledIcon != null) {
        button.setText(null);
        button.setGraphic(enabledIcon);
    }
    if (buttonText != null) {
        button.setText(buttonText);
    } else if (enabledIcon == null) {
        button.setText(name);
    }
    button.setDisable(!enabled);
    button.setMinWidth(Region.USE_PREF_SIZE);
    return button;
}
项目:marathonv5    文件:ResourceView.java   
@Override public void updateItem(Resource item, boolean empty) {
    super.updateItem(item, empty);

    if (empty) {
        setText(null);
        setGraphic(null);
    } else {
        if (isEditing()) {
            if (textField != null) {
                textField.setText(getString());
            }
            setText(null);
            setGraphic(textField);
        } else {
            setText(getString());
            setGraphic(getTreeItem().getGraphic());
            String d = getTreeItem().getValue().getDescription();
            if (d != null) {
                setTooltip(new Tooltip(d));
            }
        }
    }
}
项目:gemoc-studio-modeldebugging    文件:TimelineDiffViewerRenderer.java   
private void addState(State<?,?> state, HBox line, Color color, int stateIndex, String stateDescription) {
    final Rectangle rectangle = new Rectangle(WIDTH, WIDTH, color);
    rectangle.setArcHeight(WIDTH);
    rectangle.setArcWidth(WIDTH);
    rectangle.setUserData(state);
    Label text = new Label(computeStateLabel(stateIndex));
    text.setTextOverrun(OverrunStyle.ELLIPSIS);
    text.setAlignment(Pos.CENTER);
    text.setMouseTransparent(true);
    text.setTextFill(Color.WHITE);
    text.setFont(STATE_FONT);
    text.setMaxWidth(WIDTH);
    final Tooltip tooltip = new Tooltip(stateDescription);
    Tooltip.install(rectangle, tooltip);
    StackPane layout = new StackPane();
    StackPane.setMargin(rectangle, MARGIN_INSETS);
    layout.getChildren().addAll(rectangle, text);
    line.getChildren().add(layout);
}
项目:jedai-ui    文件:HelpTooltip.java   
public HelpTooltip(String tooltipText) {
    // Set text as question mark and general style
    this.setText("?");
    this.setPrefSize(35, 35);
    this.setMinSize(35, 35);
    this.setFont(Font.font("System", FontWeight.BOLD, 20));
    this.setAlignment(Pos.CENTER);
    this.setStyle("-fx-background-color: #9098ff; -fx-background-radius: 30px");

    // Create and add tooltip (need to set its font because otherwise it's inherited from the Label)
    Tooltip descriptionTooltip = new Tooltip(tooltipText);
    descriptionTooltip.setPrefWidth(250);
    descriptionTooltip.setWrapText(true);
    descriptionTooltip.setFont(new Font("System", 12));
    this.setTooltip(descriptionTooltip);
}
项目:MineIDE    文件:WizardStepBuilder.java   
/**
 * Add a yes/no choice to a wizard step.
 *
 * @param fieldName
 * @param defaultValue
 *            of the choice.
 * @param prompt
 *            the tooltip to show
 * @return
 */
@SuppressWarnings("unchecked")
public WizardStepBuilder addBoolean(final String fieldName, final boolean defaultValue, final String prompt)
{
    final JFXCheckBox box = new JFXCheckBox();
    box.setTooltip(new Tooltip(prompt));
    box.setSelected(defaultValue);

    this.current.getData().put(fieldName, new SimpleBooleanProperty());
    this.current.getData().get(fieldName).bind(box.selectedProperty());

    final Label label = new Label(fieldName);
    GridPane.setHalignment(label, HPos.RIGHT);
    GridPane.setHalignment(box, HPos.LEFT);
    this.current.add(label, 0, this.current.getData().size() - 1);
    this.current.add(box, 1, this.current.getData().size() - 1);
    return this;
}
项目:vars-annotation    文件:DeleteSelectedAnnotationsBC.java   
public void init() {
    button.setTooltip(new Tooltip(toolBox.getI18nBundle().getString("buttons.delete")));
    MaterialIconFactory iconFactory = MaterialIconFactory.get();
    Text deleteIcon = iconFactory.createIcon(MaterialIcon.DELETE, "30px");
    button.setText(null);
    button.setGraphic(deleteIcon);
    button.setDisable(true);

    toolBox.getEventBus()
            .toObserverable()
            .ofType(AnnotationsSelectedEvent.class)
            .subscribe(e -> {
                User user = toolBox.getData().getUser();
                boolean enabled = (user != null) && e.get().size() > 0;
                button.setDisable(!enabled);
            });

    toolBox.getEventBus()
            .toObserverable()
            .ofType(DeleteAnnotationsMsg.class)
            .subscribe(m -> apply());

    button.setOnAction(e -> apply());
}
项目:stvs    文件:TimingDiagramView.java   
/**
 * <b>copied from super and modified</b>
 *
 * <p>Called when a data item has been added to a series. This is where implementations of XYChart
 * can create/add new nodes to getPlotChildren to represent this data item.
 *
 * <p>The following nodes are created here:
 * <ul>
 * <li>Horizontal lines for values</li>
 * <li>Vertical lines to connect values</li>
 * <li>Rectangles to perform selections and highlighting</li>
 * <li>Tooltips to show the value of a specific item</li>
 * </ul>
 *
 * @param series The series the data item was added to
 * @param itemIndex The index of the new item within the series
 * @param item The new data item that was added
 */
@Override
protected void dataItemAdded(Series<Number, A> series, int itemIndex, Data<Number, A> item) {
  Line horizontalLine = new Line();
  horizontalLine.getStyleClass().add("valueLine");
  dataPane.getChildren().add(horizontalLine);
  dataPane.setMouseTransparent(true);
  durationLinesPane.setMouseTransparent(true);
  horizontalLines.add(horizontalLine);
  Rectangle cycleSelectionRectangle = new Rectangle();
  Tooltip tooltip = new Tooltip(item.getYValue().toString());
  Tooltip.install(cycleSelectionRectangle, tooltip);
  cycleSelectionRectangle.getStyleClass().add("cycleSelectionRectangle");
  cycleSelectionRectangle.setOpacity(0);
  cycleSelectionRectangles.add(cycleSelectionRectangle);
  cycleSelectionPane.getChildren().add(cycleSelectionRectangle);
  if (itemIndex > 0) {
    Line verticalLine = new Line();
    verticalLine.getStyleClass().add("valueLine");
    dataPane.getChildren().add(verticalLine);
    verticalLines.add(verticalLine);
    // updateYRange();
  }
}
项目:FxTreeMap    文件:FxMapItem.java   
public FxMapItem(FxMapModel model, MapData data) {
    mapModel = model;
    itemData = data;
    rect = new Rect();
    rectangle = new Rectangle();
    label = new Label(itemData.getName());
    tooltip = new Tooltip(itemData.getName());
    tooltip.setFont(new Font(DEFAULT_TOOLTIP_FONT_SIZE));
    mainNode = new Group(rectangle, label);
    Tooltip.install(label, tooltip);
    applyStyle(model.getStyle());
    if (data.hasChildrenData()) {
        rectangle.setEffect(new Glow());
    }
    propertyChangeSupport = new PropertyChangeSupport(FxMapItem.this);
    propertyChangeSupport.addPropertyChangeListener(model);
    initInteractivity();
}
项目:LIRE-Lab    文件:SearchController.java   
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;
}
项目:LIRE-Lab    文件:ToolTipProvider.java   
public void setToolTip(ImageView imageView, Image image) {
    String msg = "";
    msg += "image: " + image.getImageName() + "\n";

    if(image.getPosition() != -1)
        msg += "position: " + image.getPosition() + "\n";

    if(image.getScore() != -1)
        msg += "score: " + image.getScore() + "\n";

    Tooltip tooltip = new Tooltip(msg);
    tooltip.setFont(new Font("Arial", 16));
    tooltip.setStyle("-fx-background-color: aquamarine; -fx-text-fill: black");

    Tooltip.install(imageView, tooltip);
}
项目:javaGMR    文件:GamepaneController.java   
/**
 * Initializes the controller class.
 */
@Override
public void initialize(URL url, ResourceBundle rb) {
    vbGamePane.getChildren().remove(pbDownload);
    pbDownload.getStyleClass().add("success");
    pbDownload.applyCss();

    btDownload.setTooltip(new Tooltip("Download game"));
    btUpload.setTooltip(new Tooltip("Upload game"));
    btNoteEditor.setTooltip(new Tooltip("Open notes editor"));
    btGamePage.setTooltip(new Tooltip("Go to the GMR page of this game"));
    //GlyphFont fontAwesome = GlyphFontRegistry.font("FontAwesome");
    // FontAwesome.Glyph.
    //btDownload.setGraphic(fontAwesome.create(FontAwesome.Glyph.DOWNLOAD));
    //btDownload.setText(.getText());
    //Text fontAwesomeIcon = FontAwesomeIconFactory.get();

}
项目:vars-annotation    文件:AssocButtonFactory.java   
public Button build(String name, Association association) {

        EventBus eventBus = toolBox.getEventBus();

        Button button = new JFXButton(name);
        button.setUserData(association);
        button.getStyleClass().add("abpanel-button");
        button.setOnAction(event -> {
            ArrayList<Annotation> annotations = new ArrayList<>(toolBox.getData().getSelectedAnnotations());
            eventBus.send(new CreateAssociationsCmd(association, annotations));
        });
        button.setTooltip(new Tooltip(association.toString()));

        ContextMenu contextMenu = new ContextMenu();
        MenuItem deleteButton = new MenuItem(toolBox.getI18nBundle().getString("cbpanel.conceptbutton.delete"));
        deleteButton.setOnAction(event ->
                ((Pane) button.getParent()).getChildren().remove(button));
        contextMenu.getItems().addAll(deleteButton);
        button.setContextMenu(contextMenu);

        return button;

    }
项目:creacoinj    文件:ClickableBitcoinAddress.java   
public ClickableBitcoinAddress() {
    try {
        FXMLLoader loader = new FXMLLoader(getClass().getResource("bitcoin_address.fxml"));
        loader.setRoot(this);
        loader.setController(this);
        // The following line is supposed to help Scene Builder, although it doesn't seem to be needed for me.
        loader.setClassLoader(getClass().getClassLoader());
        loader.load();

        AwesomeDude.setIcon(copyWidget, AwesomeIcon.COPY);
        Tooltip.install(copyWidget, new Tooltip("Copy address to clipboard"));

        AwesomeDude.setIcon(qrCode, AwesomeIcon.QRCODE);
        Tooltip.install(qrCode, new Tooltip("Show a barcode scannable with a mobile phone for this address"));

        addressStr = convert(address);
        addressLabel.textProperty().bind(addressStr);
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
}
项目:uPMT    文件:TypeTreeViewControllerProperty.java   
@Override
public void initialize(URL location, ResourceBundle resources) {
    nomType.setText(type.getType().getName());

    File image = new File("./img/property.png");
    Image icon = new Image(image.toURI().toString());
    this.propertyIcon.setImage(icon);

    File imageRename = new File("./img/rename.png");
    Node iconRename = new ImageView(new Image(imageRename.toURI().toString()));
    this.rename.setGraphic(iconRename);

    File delete = new File("./img/delete.gif");
    Node iconDelete = new ImageView(new Image(delete.toURI().toString()));
    this.deleteProperty.setGraphic(iconDelete);

    Tooltip deletePropertyTip = new Tooltip("Suppression de la propriet�");
    deleteProperty.setTooltip(deletePropertyTip);
    Tooltip renameTip = new Tooltip("Renommer la propriet�");
    rename.setTooltip(renameTip);
    initNumber();
}
项目:git-rekt    文件:BrowseRoomsScreenController.java   
/**
 * Validates the checkout date to ensure that it is at least one day after the checkin date.
 *
 * If it isn't, disables the room search button until it is.
 */
@FXML
private void onCheckOutDateSelected() {
    LocalDate checkOutDate = checkOutDatePicker.getValue();
    LocalDate checkInDate = checkInDatePicker.getValue();
    if(checkOutDate.isBefore(checkInDate) || checkOutDate.isEqual(checkInDate)) {
        checkOutDatePicker.getStyleClass().add("invalidField");
        checkOutDatePicker.setTooltip(
            new Tooltip("Checkout date cannot be on or before checkin date!")
        );
        findAvailableRoomsButton.setDisable(true);
    } else {
        checkOutDatePicker.getStyleClass().remove("invalidField");
        checkOutDatePicker.setTooltip(null);
        findAvailableRoomsButton.setDisable(false);
    }
    roomSearchResults.clear();
}
项目:jfreechart-fx    文件:ChartCanvas.java   
/**
 * Sets the tooltip text, with the (x, y) location being used for the
 * anchor.  If the text is {@code null}, no tooltip will be displayed.
 * This method is intended for calling by the {@link TooltipHandlerFX}
 * class, you won't normally call it directly.
 * 
 * @param text  the text ({@code null} permitted).
 * @param x  the x-coordinate of the mouse pointer.
 * @param y  the y-coordinate of the mouse pointer.
 */
public void setTooltip(String text, double x, double y) {
    if (text != null) {
        if (this.tooltip == null) {
            this.tooltip = new Tooltip(text);
            Tooltip.install(this, this.tooltip);
        } else {
            this.tooltip.setText(text);           
            this.tooltip.setAnchorX(x);
            this.tooltip.setAnchorY(y);
        }                   
    } else {
        Tooltip.uninstall(this, this.tooltip);
        this.tooltip = null;
    }
}
项目:cayenne-modeler    文件:MainToolBarLayout.java   
private void setToolTips()
{
    newButton.setTooltip(new Tooltip("Create a new Cayenne Model project."));
    openButton.setTooltip(new Tooltip("Open an existing Cayenne Model project."));
    saveButton.setTooltip(new Tooltip("Save this Cayenne Model project."));

    removeButton.setTooltip(new Tooltip("Remove this item.")); // FIXME: Should be dynamic.

    cutButton.setTooltip(new Tooltip("Cut this item to the clipboard.")); // FIXME: Should be dynamic.
    copyButton.setTooltip(new Tooltip("Copy this item to the clipboard.")); // FIXME: Should be dynamic.
    pasteButton.setTooltip(new Tooltip("Paste this item from the clipboard.")); // FIXME: Should be dynamic.

    undoButton.setTooltip(new Tooltip("Undo.")); // FIXME: Should be dynamic.
    redoButton.setTooltip(new Tooltip("Redo.")); // FIXME: Should be dynamic.

    dataMapButton.setTooltip(new Tooltip("Create a new Data Map to hold Java and Database definitions."));
    dataNodeButton.setTooltip(new Tooltip("Create a new Data Node to hold database connection settings."));
}
项目:legendary-guide    文件:ClickableBitcoinAddress.java   
public ClickableBitcoinAddress() {
    try {
        FXMLLoader loader = new FXMLLoader(getClass().getResource("bitcoin_address.fxml"));
        loader.setRoot(this);
        loader.setController(this);
        // The following line is supposed to help Scene Builder, although it doesn't seem to be needed for me.
        loader.setClassLoader(getClass().getClassLoader());
        loader.load();

        AwesomeDude.setIcon(copyWidget, AwesomeIcon.COPY);
        Tooltip.install(copyWidget, new Tooltip("Copy address to clipboard"));

        AwesomeDude.setIcon(qrCode, AwesomeIcon.QRCODE);
        Tooltip.install(qrCode, new Tooltip("Show a barcode scannable with a mobile phone for this address"));

        addressStr = convert(address);
        addressLabel.textProperty().bind(addressStr);
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
}
项目:stvs    文件:ColumnHeader.java   
/**
 * <p>
 * Creates the view for the given {@link SpecIoVariable} as model.
 * </p>
 *
 * @param specIoVariable the model for this view.
 */
public ColumnHeader(SpecIoVariable specIoVariable) {
  this.categoryLabel = new Label(specIoVariable.getCategory().toString());
  this.columnNameLabel = new Label(specIoVariable.getName());
  this.columnTypeLabel = new Label(specIoVariable.getType());
  this.typeOfLabel = new Label(" : ");
  this.problemTooltip = new Tooltip("");
  ViewUtils.setupClass(this);

  categoryLabel.textProperty().bind(Bindings.convert(specIoVariable.categoryProperty()));
  columnNameLabel.textProperty().bind(specIoVariable.nameProperty());
  columnTypeLabel.textProperty().bind(specIoVariable.typeProperty());

  String inout = specIoVariable.getCategory().toString().toLowerCase();

  categoryLabel.getStyleClass().addAll("spec-column-header", "category-label", inout);
  columnNameLabel.getStyleClass().addAll("spec-column-header", "name-label");
  columnTypeLabel.getStyleClass().addAll("spec-column-header", "type-label");
  typeOfLabel.getStyleClass().addAll("spec-column-header", "type-of-label");
  problemTooltip.getStyleClass().addAll("spec-column-header", "problem-tooltip");

  specIoVariable.categoryProperty().addListener(this::updateInOutClass);

  this.getStyleClass().addAll("spec-column-header", inout);
  this.setAlignment(Pos.CENTER);

  this.varDescriptionHbox = new HBox(columnNameLabel, typeOfLabel, columnTypeLabel);
  this.varDescriptionHbox.setAlignment(Pos.CENTER);

  this.getChildren().addAll(categoryLabel, varDescriptionHbox);
}
项目:Money-Manager    文件:SignInController.java   
@FXML
public void initialize() {
    lblUserFullName.setText(getOwnerName());
    try {
        if(!checkUserPresence()) {
            txtUsername.setDisable(true);
            passPassword.setDisable(true);
            btnSignIn.setDisable(true);
            lblForgetPassword.setDisable(true);
        } else if(!openingDateUpdate()) {
            lblOutdateMsg.setText("Your computer date is outdated, please update it and restart the program");
            txtUsername.setDisable(true);
            passPassword.setDisable(true);
            btnSignIn.setDisable(true);
            lblForgetPassword.setDisable(true);
            lblNewUser.setDisable(true);
        }
    } catch (Exception e) {}

    if (!isDBConnected()) {
        lblWrongAuthentication.setText("Database not found");
    }

    btnSignIn.setTooltip(new Tooltip("If Username and Password will \n"
            + "correct you will be signed in"));
    btnCancel.setTooltip(new Tooltip("Cancel the action"));
    btnOk.setTooltip(new Tooltip("If your answer is matches, you will take to reset password window"));
    Tooltip.install(txtUsername, new Tooltip("Type your Username"));
    Tooltip.install(passPassword, new Tooltip("Enter password"));
    Tooltip.install(lblForgetPassword, new Tooltip("Press if you forget password"));
    Tooltip.install(lblNewUser, new Tooltip("Press if you are a new user or\n"
            + "want to remove existing user and create new one"));
    Tooltip.install(cmboSecurityQuetion, new Tooltip("Choose your security question"));
    Tooltip.install(txtSQAnswer, new Tooltip("Answer what was your security question answer"));
}
项目:Money-Manager    文件:RegistrationIssueController.java   
@FXML
public void initialize() {
    lodingStatus = new TabAccess().getreRegistrationLodingStatus();
    if (lodingStatus.equals("deleteUser")) {
        lblHeading.setText("Provide Existing User Information");
        lblReTypePassword.setVisible(false);
        passReTypePassword.setVisible(false);
        loadSQuestion();
        btnSave.setManaged(false);
    } else if(lodingStatus.equals("forgotPassword")) {
        lblHeading.setText("Change Password and S.Q.");
        txtUsername.setText(getUsername());
        txtUsername.setDisable(true);
        loadSQuestion();
        btnDelete.setManaged(false);
    }

    btnCancel.setTooltip(new Tooltip("Cancel the process and take you to Sign In window"));
    btnSave.setTooltip(new Tooltip("Save your new password and security question"));
    btnDelete.setTooltip(new Tooltip("If all information is given correctly \n"
            + "then this user will be deleted"));
    Tooltip.install(txtUsername, new Tooltip("Your Username"));
    Tooltip.install(passPassword, new Tooltip("Give a password, this should not contain space"));
    Tooltip.install(passReTypePassword, new Tooltip("Retype the password"));
    Tooltip.install(cmboSecurityQuestion, new Tooltip("Choose a security question"));
    Tooltip.install(txtAnswer, new Tooltip("Answer your question. Remember this answer.\n"
            + "If you forget your password, this will \n"
            + "help you to recover your account."));
}
项目:Mod-Tools    文件:Progress.java   
public ProgressSet(int pos) {
    super();
    this.setVisible(true);
    prefix = new Label(null == stepLabels.get(pos) ? "Step " + (pos + 1) : stepLabels.get(pos));
    super.getChildren().add(bar);
    super.getChildren().add(text);
    super.getChildren().add(prefix);
    this.bar.setVisible(true);
    this.text.setVisible(true);
    this.prefix.setVisible(true);
    this.bar.setLayoutX(160);
    this.text.setLayoutX(275);
    this.text.setText("Not started yet");
    this.bar.setTooltip(new Tooltip("Not started yet"));
}
项目:horizon    文件:HorizonChart.java   
public HorizonChart(final int BANDS, final Series<T> SERIES, final boolean SMOOTHED) {
    series        = SERIES;
    scaleX        = 1;
    scaleY        = 1;
    smoothed      = SMOOTHED;
    referenceZero = true;
    noOfBands     = clamp(1, MAX_NO_OF_BANDS, BANDS);
    noOfItems     = SERIES.getNoOfItems();
    minY          = SERIES.getItems().stream().mapToDouble(Data::getY).min().getAsDouble();
    maxY          = SERIES.getItems().stream().mapToDouble(Data::getY).max().getAsDouble();
    bandWidth     = (maxY - minY) / noOfBands;
    tooltip       = new Tooltip();
    tooltip.setAnchorLocation(AnchorLocation.CONTENT_BOTTOM_LEFT);

    adjustColors();

    // Create list of points
    points = new ArrayList<>(noOfItems);
    prepareData();

    mouseListener           = mouseEvent -> {
        final EventType<? extends MouseEvent> TYPE = mouseEvent.getEventType();
        if (MouseEvent.MOUSE_CLICKED == TYPE) {
            Data<T> data = selectDataAt(mouseEvent.getX());
            tooltip.setText(createTooltipText(data));
            tooltip.setX(mouseEvent.getScreenX());
            tooltip.setY(mouseEvent.getScreenY());
            tooltip.show(getScene().getWindow());
            getSeries().fireSeriesEvent(new SeriesEvent(getSeries(), data, SeriesEventType.SELECT_DATA));
        } else if (MouseEvent.MOUSE_MOVED == TYPE) {
            tooltip.hide();
        } else if (MouseEvent.MOUSE_EXITED == TYPE) {
            tooltip.hide();
        }
    };
    seriesListener          = seriesEvent -> redraw();

    initGraphics();
    registerListeners();
}
项目:SunburstChart    文件:SunburstChart.java   
private Path createSegment(final double START_ANGLE, final double END_ANGLE, final double INNER_RADIUS, final double OUTER_RADIUS, final Color FILL, final Color STROKE, final TreeNode NODE) {
    double  startAngleRad = Math.toRadians(START_ANGLE + 90);
    double  endAngleRad   = Math.toRadians(END_ANGLE + 90);
    boolean largeAngle    = Math.abs(END_ANGLE - START_ANGLE) > 180.0;

    double x1 = centerX + INNER_RADIUS * Math.sin(startAngleRad);
    double y1 = centerY - INNER_RADIUS * Math.cos(startAngleRad);

    double x2 = centerX + OUTER_RADIUS * Math.sin(startAngleRad);
    double y2 = centerY - OUTER_RADIUS * Math.cos(startAngleRad);

    double x3 = centerX + OUTER_RADIUS * Math.sin(endAngleRad);
    double y3 = centerY - OUTER_RADIUS * Math.cos(endAngleRad);

    double x4 = centerX + INNER_RADIUS * Math.sin(endAngleRad);
    double y4 = centerY - INNER_RADIUS * Math.cos(endAngleRad);

    MoveTo moveTo1 = new MoveTo(x1, y1);
    LineTo lineTo2 = new LineTo(x2, y2);
    ArcTo  arcTo3  = new ArcTo(OUTER_RADIUS, OUTER_RADIUS, 0, x3, y3, largeAngle, true);
    LineTo lineTo4 = new LineTo(x4, y4);
    ArcTo  arcTo1  = new ArcTo(INNER_RADIUS, INNER_RADIUS, 0, x1, y1, largeAngle, false);

    Path path = new Path(moveTo1, lineTo2, arcTo3, lineTo4, arcTo1);

    path.setFill(FILL);
    path.setStroke(STROKE);

    String tooltipText = new StringBuilder(NODE.getData().getName()).append("\n").append(String.format(Locale.US, formatString, NODE.getData().getValue())).toString();
    Tooltip.install(path, new Tooltip(tooltipText));

    path.setOnMousePressed(new WeakEventHandler<>(e -> NODE.getTreeRoot().fireTreeNodeEvent(new TreeNodeEvent(NODE, EventType.NODE_SELECTED))));

    return path;
}
项目:textmd    文件:ViewSettingsTab.java   
private void addPrettifyCodeCheckBox(int col, int row) {
    this.alwaysPrettifyCode.setTooltip(new Tooltip(dict.SETTINGS_VIEW_PRETTIFY_CODE_LABEL_TOOLTIP));
    this.alwaysPrettifyCode.setTextFill(this.textColor);

    this.alwaysPrettifyCode.setOnAction(e ->
            Settings.setAlwaysPrettifyCodeView(this.alwaysPrettifyCode.isSelected())
    );
    this.grid.add(this.alwaysPrettifyCode, col,row);
}
项目:H-Uppaal    文件:Issue.java   
public IconNode generateIconNode() {
    final IconNode iconNode = new IconNode();

    final Tooltip tooltip = new Tooltip(message);
    Tooltip.install(iconNode, tooltip);

    // Set the style of the icon
    iconNode.setFill(Color.GRAY);
    iconNode.iconCodeProperty().set(getIcon());

    // The icon should only be visible when it is present
    iconNode.visibleProperty().bind(presentProperty);

    return iconNode;
}
项目:DeskChan    文件:ControlsPane.java   
Hint(String text){
    setText(" ❔ ");
    setBorder(new Border(new BorderStroke(Color.BLACK, BorderStrokeStyle.SOLID, CornerRadii.EMPTY, BorderWidths.DEFAULT)));
    Tooltip tooltip = new Tooltip(text);
    tooltip.setAutoHide(true);
    setTooltip(tooltip);
    setOnMouseClicked(event -> {
        Point2D p = localToScene(0.0, 0.0);
        getTooltip().show(this, p.getX()
                + getScene().getX() + getScene().getWindow().getX(), p.getY()
                + getScene().getY() + getScene().getWindow().getY());
    });
}
项目:CORNETTO    文件:MyVertexView.java   
/**
 * Adds ToolTip from ToolTop library on Mouse Hover
 */
private void addToolTip() {
    tooltip = new Tooltip(myVertex.getTaxonNode().getName() + "\nID: " + myVertex.getTaxonNode().getTaxonId()
            + "\nRelative Frequency: " + String.format("%.3f", AnalysisData.getMaximumRelativeFrequencies().get(myVertex.getTaxonNode())));
    tooltip.setFont(Font.font(14));
    Tooltip.install(this,tooltip);
}
项目:textmd    文件:EditorExtTaskListItem.java   
public EditorExtTaskListItem(Dictionary dictionary, MarkdownParser markdownParser, TabFactory tabFactory, boolean defaultValue) {
    super(dictionary.TOOLBAR_EDITOR_EXTENSIONS_TASK_LIST_ITEM);
    taskLinkExtension = TaskListExtension.create();
    setSelected(defaultValue);
    if(defaultValue)
        markdownParser.addExtension(taskLinkExtension);
    setToolTip(new Tooltip(dictionary.TOOLBAR_EDITOR_EXTENSIONS_TASK_LIST_TOOLTIP));
    setOnAction(event -> getClickAction(markdownParser, tabFactory));
}