Java Code Examples for javafx.scene.control.Label#setOpacity()

The following examples show how to use javafx.scene.control.Label#setOpacity() . 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: MosaicPaneRefImpl.java    From Mosaic with Apache License 2.0 5 votes vote down vote up
public Label getLabel(String color, String id) {
	Label label = new Label();
	label.textProperty().set(id);
	label.textAlignmentProperty().set(TextAlignment.CENTER);
	label.alignmentProperty().set(Pos.CENTER);
	label.setOpacity(1.0);
	label.setTextFill(Color.WHITE);
	label.setFont(Font.font("Arial", FontWeight.BOLD, 16d));
	label.setStyle("-fx-background-color: " + color.toString() + 
		";-fx-alignment:center;-fx-text-alignment:center;");
	label.setManaged(false);
	
	return label;
}
 
Example 2
Source File: HyperlinkWithIcon.java    From bisq with GNU Affero General Public License v3.0 5 votes vote down vote up
public HyperlinkWithIcon(String text, AwesomeIcon awesomeIcon) {
    super(text);

    Label icon = new Label();
    AwesomeDude.setIcon(icon, awesomeIcon);
    icon.setMinWidth(20);
    icon.setOpacity(0.7);
    icon.getStyleClass().addAll("hyperlink", "no-underline");
    setPadding(new Insets(0));
    icon.setPadding(new Insets(0));

    setIcon(icon);
}
 
Example 3
Source File: InfoTextField.java    From bisq with GNU Affero General Public License v3.0 5 votes vote down vote up
public void setContent(MaterialDesignIcon icon, String info, String style, double opacity) {
    hideIcons();

    currentIcon = new Label();
    Text textIcon = getRegularIconForLabel(icon, currentIcon);

    setActionHandlers(new Label(info));

    currentIcon.setLayoutY(5);
    textIcon.getStyleClass().addAll("icon", style);
    currentIcon.setOpacity(opacity);
    AnchorPane.setRightAnchor(currentIcon, 7.0);

    getChildren().add(currentIcon);
}
 
Example 4
Source File: AutoTooltipTableColumn.java    From bisq with GNU Affero General Public License v3.0 5 votes vote down vote up
public void setTitleWithHelpText(String title, String help) {
    helpIcon = new Label();
    AwesomeDude.setIcon(helpIcon, AwesomeIcon.QUESTION_SIGN, "1em");
    helpIcon.setOpacity(0.4);
    helpIcon.setOnMouseEntered(e -> popoverWrapper.showPopOver(() -> createInfoPopOver(help)));
    helpIcon.setOnMouseExited(e -> popoverWrapper.hidePopOver());

    final AutoTooltipLabel label = new AutoTooltipLabel(title);
    final HBox hBox = new HBox(label, helpIcon);
    hBox.setStyle("-fx-alignment: center-left");
    hBox.setSpacing(4);
    setGraphic(hBox);
}
 
Example 5
Source File: HeatTabController.java    From marathonv5 with Apache License 2.0 4 votes vote down vote up
private void createStateLabels() {
    Group overlay = map.getOverlayGroup();
    for(String state: Region.ALL_STATES) {
        Node stateNode = map.lookup("#"+state);
        if (stateNode != null) {
            Label label = new Label("+10");
            label.getStyleClass().add("heatmap-label");
            label.setTextAlignment(TextAlignment.CENTER);
            label.setAlignment(Pos.CENTER);
            label.setManaged(false);
            label.setOpacity(0);
            label.setVisible(false);
            Bounds stateBounds = stateNode.getBoundsInParent();
            if ("DE".equals(state)) {
                label.resizeRelocate(stateBounds.getMinX()-25, stateBounds.getMinY(), 
                        stateBounds.getWidth()+50, stateBounds.getHeight());
            } else if ("VT".equals(state)) {
                label.resizeRelocate(stateBounds.getMinX(), stateBounds.getMinY()-25, 
                        stateBounds.getWidth(), stateBounds.getHeight());
            } else if ("NH".equals(state)) {
                label.resizeRelocate(stateBounds.getMinX(), stateBounds.getMinY()+30, 
                        stateBounds.getWidth(), stateBounds.getHeight());
            } else if ("MA".equals(state)) {
                label.resizeRelocate(stateBounds.getMinX()-20, stateBounds.getMinY()-18, 
                        stateBounds.getWidth(), stateBounds.getHeight());
            } else if ("RI".equals(state)) {
                label.resizeRelocate(stateBounds.getMinX(), stateBounds.getMinY(), 
                        stateBounds.getWidth()+40, stateBounds.getHeight());
            } else if ("ID".equals(state)) {
                label.resizeRelocate(stateBounds.getMinX(), stateBounds.getMinY()+60, 
                        stateBounds.getWidth(), stateBounds.getHeight());
            } else if ("MI".equals(state)) {
                label.resizeRelocate(stateBounds.getMinX()+60, stateBounds.getMinY(), 
                        stateBounds.getWidth(), stateBounds.getHeight());
            } else if ("FL".equals(state)) {
                label.resizeRelocate(stateBounds.getMinX()+95, stateBounds.getMinY(), 
                        stateBounds.getWidth(), stateBounds.getHeight());
            } else if ("LA".equals(state)) {
                label.resizeRelocate(stateBounds.getMinX()-50, stateBounds.getMinY(), 
                        stateBounds.getWidth(), stateBounds.getHeight());
            } else {
                label.resizeRelocate(stateBounds.getMinX(), stateBounds.getMinY(), 
                        stateBounds.getWidth(), stateBounds.getHeight());
            }
            stateLabelMap.put(state, label);
            overlay.getChildren().add(label);
        }
    }
}
 
Example 6
Source File: HeatTabController.java    From marathonv5 with Apache License 2.0 4 votes vote down vote up
private void createStateLabels() {
    Group overlay = map.getOverlayGroup();
    for(String state: Region.ALL_STATES) {
        Node stateNode = map.lookup("#"+state);
        if (stateNode != null) {
            Label label = new Label("+10");
            label.getStyleClass().add("heatmap-label");
            label.setTextAlignment(TextAlignment.CENTER);
            label.setAlignment(Pos.CENTER);
            label.setManaged(false);
            label.setOpacity(0);
            label.setVisible(false);
            Bounds stateBounds = stateNode.getBoundsInParent();
            if ("DE".equals(state)) {
                label.resizeRelocate(stateBounds.getMinX()-25, stateBounds.getMinY(), 
                        stateBounds.getWidth()+50, stateBounds.getHeight());
            } else if ("VT".equals(state)) {
                label.resizeRelocate(stateBounds.getMinX(), stateBounds.getMinY()-25, 
                        stateBounds.getWidth(), stateBounds.getHeight());
            } else if ("NH".equals(state)) {
                label.resizeRelocate(stateBounds.getMinX(), stateBounds.getMinY()+30, 
                        stateBounds.getWidth(), stateBounds.getHeight());
            } else if ("MA".equals(state)) {
                label.resizeRelocate(stateBounds.getMinX()-20, stateBounds.getMinY()-18, 
                        stateBounds.getWidth(), stateBounds.getHeight());
            } else if ("RI".equals(state)) {
                label.resizeRelocate(stateBounds.getMinX(), stateBounds.getMinY(), 
                        stateBounds.getWidth()+40, stateBounds.getHeight());
            } else if ("ID".equals(state)) {
                label.resizeRelocate(stateBounds.getMinX(), stateBounds.getMinY()+60, 
                        stateBounds.getWidth(), stateBounds.getHeight());
            } else if ("MI".equals(state)) {
                label.resizeRelocate(stateBounds.getMinX()+60, stateBounds.getMinY(), 
                        stateBounds.getWidth(), stateBounds.getHeight());
            } else if ("FL".equals(state)) {
                label.resizeRelocate(stateBounds.getMinX()+95, stateBounds.getMinY(), 
                        stateBounds.getWidth(), stateBounds.getHeight());
            } else if ("LA".equals(state)) {
                label.resizeRelocate(stateBounds.getMinX()-50, stateBounds.getMinY(), 
                        stateBounds.getWidth(), stateBounds.getHeight());
            } else {
                label.resizeRelocate(stateBounds.getMinX(), stateBounds.getMinY(), 
                        stateBounds.getWidth(), stateBounds.getHeight());
            }
            stateLabelMap.put(state, label);
            overlay.getChildren().add(label);
        }
    }
}