java类javafx.scene.control.Tooltip的实例源码

DesktopLayoutView.java 文件源码 项目:domino-todolist 阅读 34 收藏 0 点赞 0 评论 0
@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);
}
TransactionHistoryController.java 文件源码 项目:Money-Manager 阅读 44 收藏 0 点赞 0 评论 0
@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"));
}
NewUserRegistrationController.java 文件源码 项目:Money-Manager 阅读 42 收藏 0 点赞 0 评论 0
@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."));
}
CashCalculateController.java 文件源码 项目:Money-Manager 阅读 34 收藏 0 点赞 0 评论 0
@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"));
    }
RatiosManagerController.java 文件源码 项目:Squid 阅读 38 收藏 0 点赞 0 评论 0
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);
}
RatiosManagerController.java 文件源码 项目:Squid 阅读 42 收藏 0 点赞 0 评论 0
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);
}
StreamChart.java 文件源码 项目:charts 阅读 40 收藏 0 点赞 0 评论 0
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);
}
ViewSettingsTab.java 文件源码 项目:textmd 阅读 40 收藏 0 点赞 0 评论 0
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);
}
EditorExtAbbreviationItem.java 文件源码 项目:textmd 阅读 40 收藏 0 点赞 0 评论 0
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));
}
StateRectangle.java 文件源码 项目:lttng-scope 阅读 49 收藏 0 点赞 0 评论 0
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());
}
World.java 文件源码 项目:charts 阅读 51 收藏 0 点赞 0 评论 0
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);
}
FXUIUtils.java 文件源码 项目:marathonv5 阅读 52 收藏 0 点赞 0 评论 0
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;
}
ResourceView.java 文件源码 项目:marathonv5 阅读 36 收藏 0 点赞 0 评论 0
@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));
            }
        }
    }
}
TimelineDiffViewerRenderer.java 文件源码 项目:gemoc-studio-modeldebugging 阅读 36 收藏 0 点赞 0 评论 0
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);
}
HelpTooltip.java 文件源码 项目:jedai-ui 阅读 49 收藏 0 点赞 0 评论 0
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);
}
WizardStepBuilder.java 文件源码 项目:MineIDE 阅读 36 收藏 0 点赞 0 评论 0
/**
 * 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;
}
DeleteSelectedAnnotationsBC.java 文件源码 项目:vars-annotation 阅读 38 收藏 0 点赞 0 评论 0
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());
}
TimingDiagramView.java 文件源码 项目:stvs 阅读 46 收藏 0 点赞 0 评论 0
/**
 * <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();
  }
}
FxMapItem.java 文件源码 项目:FxTreeMap 阅读 31 收藏 0 点赞 0 评论 0
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();
}
SearchController.java 文件源码 项目:LIRE-Lab 阅读 42 收藏 0 点赞 0 评论 0
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;
}
ToolTipProvider.java 文件源码 项目:LIRE-Lab 阅读 38 收藏 0 点赞 0 评论 0
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);
}
GamepaneController.java 文件源码 项目:javaGMR 阅读 40 收藏 0 点赞 0 评论 0
/**
 * 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();

}
AssocButtonFactory.java 文件源码 项目:vars-annotation 阅读 36 收藏 0 点赞 0 评论 0
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;

    }
ClickableBitcoinAddress.java 文件源码 项目:creacoinj 阅读 33 收藏 0 点赞 0 评论 0
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);
    }
}
TypeTreeViewControllerProperty.java 文件源码 项目:uPMT 阅读 38 收藏 0 点赞 0 评论 0
@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();
}
BrowseRoomsScreenController.java 文件源码 项目:git-rekt 阅读 37 收藏 0 点赞 0 评论 0
/**
 * 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();
}
ChartCanvas.java 文件源码 项目:jfreechart-fx 阅读 47 收藏 0 点赞 0 评论 0
/**
 * 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;
    }
}
MainToolBarLayout.java 文件源码 项目:cayenne-modeler 阅读 38 收藏 0 点赞 0 评论 0
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."));
}
ClickableBitcoinAddress.java 文件源码 项目:legendary-guide 阅读 35 收藏 0 点赞 0 评论 0
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);
    }
}
ColumnHeader.java 文件源码 项目:stvs 阅读 54 收藏 0 点赞 0 评论 0
/**
 * <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);
}


问题


面经


文章

微信
公众号

扫码关注公众号