本文整理汇总了Java中org.kordamp.ikonli.javafx.FontIcon.setIconColor方法的典型用法代码示例。如果您正苦于以下问题:Java FontIcon.setIconColor方法的具体用法?Java FontIcon.setIconColor怎么用?Java FontIcon.setIconColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kordamp.ikonli.javafx.FontIcon
的用法示例。
在下文中一共展示了FontIcon.setIconColor方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initializeActionButton
import org.kordamp.ikonli.javafx.FontIcon; //导入方法依赖的package包/类
private void initializeActionButton() {
// Find the action icon
actionButton = (JFXRippler) lookup("#actionButton");
final FontIcon actionButtonIcon = (FontIcon) lookup("#actionButtonIcon");
actionButtonIcon.setIconColor(Color.GREY.getColor(Color.Intensity.I900));
actionButton.setCursor(Cursor.HAND);
actionButton.setRipplerFill(Color.GREY.getColor(Color.Intensity.I500));
// Delegate that based on the query state updated the action icon
final Consumer<QueryState> updateIcon = (queryState) -> {
if (queryState.equals(QueryState.RUNNING)) {
actionButtonIcon.setIconLiteral("gmi-stop");
actionButtonIcon.setIconSize(24);
} else {
actionButtonIcon.setIconLiteral("gmi-play-arrow");
actionButtonIcon.setIconSize(24);
}
};
// Update the icon initially
updateIcon.accept(query.getQueryState());
// Update the icon when ever the query state is updated
query.queryStateProperty().addListener((observable, oldValue, newValue) -> updateIcon.accept(newValue));
actionButton.setMaskType(JFXRippler.RipplerMask.CIRCLE);
actionButton.getChildren().get(0).setOnMousePressed(event -> {
query.setQueryState(QueryState.UNKNOWN);
if (query.getQueryState().equals(QueryState.RUNNING)) {
query.cancel();
} else {
query.run();
}
});
}
示例2: addLocation
import org.kordamp.ikonli.javafx.FontIcon; //导入方法依赖的package包/类
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;
FontIcon locationIcon = new FontIcon(null == LOCATION.getIconCode() ? locationIconCode : LOCATION.getIconCode());
locationIcon.setIconSize(LOCATION.getIconSize());
locationIcon.setTextOrigin(VPos.CENTER);
locationIcon.setIconColor(null == LOCATION.getColor() ? getLocationColor() : LOCATION.getColor());
locationIcon.setX(x - LOCATION.getIconSize() * 0.5);
locationIcon.setY(y);
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);
}
示例3: initGraphics
import org.kordamp.ikonli.javafx.FontIcon; //导入方法依赖的package包/类
private void initGraphics() {
icon = new FontIcon(Material.MENU);
icon.setIconSize(24);
icon.setIconColor(Color.WHITE);
icon.toFront();
getChildren().add(icon);
StackPane.setAlignment(icon, Pos.TOP_LEFT);
StackPane.setMargin(icon, new Insets(5));
}
示例4: initGraphics
import org.kordamp.ikonli.javafx.FontIcon; //导入方法依赖的package包/类
private void initGraphics(final String TEXT) {
frame = new Rectangle(PREFERRED_WIDTH, PREFERRED_HEIGHT, frameColor.get());
frame.setArcWidth(PREFERRED_HEIGHT);
frame.setArcHeight(PREFERRED_HEIGHT);
buttonArea = new Rectangle(5, 5, PREFERRED_WIDTH - 10, PREFERRED_HEIGHT - 10);
buttonArea.setFill(buttonColor.get());
buttonArea.setArcWidth(PREFERRED_HEIGHT);
buttonArea.setArcHeight(PREFERRED_HEIGHT);
text = new Text(TEXT);
text.setFont(Fonts.robotoMedium(48));
text.setFill(textColor.get());
text.setMouseTransparent(true);
progressBar = new Arc(PREFERRED_WIDTH * 0.5, PREFERRED_HEIGHT * 0.5, PREFERRED_HEIGHT * 0.5, PREFERRED_HEIGHT * 0.5, 90, 0);
progressBar.setType(ArcType.OPEN);
progressBar.setFill(Color.TRANSPARENT);
progressBar.setStroke(progressBarColor.get());
progressPane = new Pane(progressBar);
progressPane.setMouseTransparent(true);
icon = new FontIcon(FontAwesome.CHECK);
icon.setTextOrigin(VPos.CENTER);
icon.setIconColor(iconColor.get());
icon.setOpacity(0);
iconPane = new StackPane(icon);
iconPane.setMouseTransparent(true);
pane = new StackPane(frame, buttonArea, text, progressPane, iconPane);
pane.setBackground(new Background(new BackgroundFill(backgroundPaint, CornerRadii.EMPTY, Insets.EMPTY)));
pane.setBorder(new Border(new BorderStroke(borderPaint, BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(borderWidth))));
getChildren().setAll(pane);
}
示例5: initializeDetailsButton
import org.kordamp.ikonli.javafx.FontIcon; //导入方法依赖的package包/类
private void initializeDetailsButton() {
final JFXRippler detailsButton = (JFXRippler) lookup("#detailsButton");
final FontIcon detailsButtonIcon = (FontIcon) lookup("#detailsButtonIcon");
detailsButtonIcon.setIconColor(Color.GREY.getColor(Color.Intensity.I900));
detailsButton.setCursor(Cursor.HAND);
detailsButton.setRipplerFill(Color.GREY.getColor(Color.Intensity.I500));
detailsButton.setMaskType(JFXRippler.RipplerMask.CIRCLE);
final DropDownMenu dropDownMenu = new DropDownMenu((Pane) getParent(), detailsButton, 230, true);
dropDownMenu.addTogglableListElement("Run periodically", query.isPeriodicProperty(), event -> {
// Toggle the property
query.setIsPeriodic(!query.isPeriodic());
});
dropDownMenu.addSpacerElement();
dropDownMenu.addClickableListElement("Clear Status", event -> {
// Clear the state
query.setQueryState(QueryState.UNKNOWN);
// Close the menu
dropDownMenu.close();
});
dropDownMenu.addSpacerElement();
dropDownMenu.addClickableListElement("Delete", event -> {
// Remove the query
HUPPAAL.getProject().getQueries().remove(query);
// Close the menu
dropDownMenu.close();
});
detailsButton.getChildren().get(0).setOnMousePressed(event -> {
// Show the popup
dropDownMenu.show(JFXPopup.PopupVPosition.TOP, JFXPopup.PopupHPosition.RIGHT, 310, 35);
});
}