当前位置: 首页>>代码示例>>Java>>正文


Java FontIcon类代码示例

本文整理汇总了Java中org.kordamp.ikonli.javafx.FontIcon的典型用法代码示例。如果您正苦于以下问题:Java FontIcon类的具体用法?Java FontIcon怎么用?Java FontIcon使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


FontIcon类属于org.kordamp.ikonli.javafx包,在下文中一共展示了FontIcon类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initializeAddQueryButton

import org.kordamp.ikonli.javafx.FontIcon; //导入依赖的package包/类
private void initializeAddQueryButton() {
    final Color color = Color.GREY_BLUE;
    final Color.Intensity intensity = Color.Intensity.I700;

    // Set the background of the add query button (will make it look like a floating action button)
    controller.addQueryButton.setBackground(new Background(new BackgroundFill(
            color.getColor(intensity),
            new CornerRadii(100),
            Insets.EMPTY
    )));

    // Add a drop shadow to the add query button
    controller.addQueryButton.setEffect(DropShadowHelper.generateElevationShadow(6));

    // Set the font color of the button
    controller.addQueryButton.setRipplerFill(color.getTextColor(intensity));
    ((FontIcon) controller.addQueryButton.getGraphic()).setFill(color.getTextColor(intensity));
}
 
开发者ID:ulriknyman,项目名称:H-Uppaal,代码行数:19,代码来源:QueryPanePresentation.java

示例2: initializeIcon

import org.kordamp.ikonli.javafx.FontIcon; //导入依赖的package包/类
private void initializeIcon() {
    final Circle circle = (Circle) lookup("#iconBackground");
    final FontIcon icon = (FontIcon) lookup("#icon");

    component.get().colorProperty().addListener((obs, oldColor, newColor) -> {
        circle.setFill(newColor.getColor(component.get().getColorIntensity()));
        icon.setFill(newColor.getTextColor(component.get().getColorIntensity()));
    });

    circle.setFill(component.get().getColor().getColor(component.get().getColorIntensity()));
    icon.setFill(component.get().getColor().getTextColor(component.get().getColorIntensity()));

    component.get().isMainProperty().addListener((obs, oldIsMain, newIsMain) -> {
        if (newIsMain) {
            icon.setIconLiteral("gmi-star");
            icon.setIconSize(22);
        } else {
            icon.setIconLiteral("gmi-description");
            icon.setIconSize(22);
        }
    });
}
 
开发者ID:ulriknyman,项目名称:H-Uppaal,代码行数:23,代码来源:FilePresentation.java

示例3: initializeIcon

import org.kordamp.ikonli.javafx.FontIcon; //导入依赖的package包/类
private void initializeIcon() {
    final Circle circle = (Circle) lookup("#iconBackground");
    final FontIcon icon = (FontIcon) lookup("#icon");

    circle.setFill(color.getColor(colorIntensity));
    icon.setFill(color.getTextColor(colorIntensity));

    if (command != null) {
        icon.setIconLiteral("gmi-" + command.getIcon());
    }
    icon.setIconSize(24);
}
 
开发者ID:ulriknyman,项目名称:H-Uppaal,代码行数:13,代码来源:UndoRedoHistoryEntryPresentation.java

示例4: getValue

import org.kordamp.ikonli.javafx.FontIcon; //导入依赖的package包/类
@Override
public FontIcon getValue() {
    String st = statuses.stream().filter(s -> s.equals(ScmItemStatus.MODIFIED)
            || s.equals(ScmItemStatus.REMOVED)
            || s.equals(ScmItemStatus.MISSED)
            || s.equals(ScmItemStatus.ADDED)
            || s.equals(ScmItemStatus.CONFLICT)
            || s.equals(ScmItemStatus.UNTRACKED)
    ).findFirst().orElse(
            statuses.stream().filter(s -> s.equals(ScmItemStatus.UNCOMMITED)).findFirst().orElse(null)
    );



    try {
        return icons.getOrDefault(st,
                fontIconUnknown).call();
    } catch (Exception e) {
    }
    return null;
}
 
开发者ID:iazarny,项目名称:gitember,代码行数:22,代码来源:StatusCellValueFactory.java

示例5: showOptions

import org.kordamp.ikonli.javafx.FontIcon; //导入依赖的package包/类
@Override
public void showOptions() {
    Dialog<String> dialog = new Dialog<>();
    dialog.setTitle("Perception-Action Configuration");
    dialog.setHeaderText("You can define next action in function of agent perception (up, left, right and down)");
    dialog.getDialogPane().setPrefSize(500, 600);

    FontIcon icon = new FontIcon(FontAwesome.COGS);
    icon.setIconSize(64);
    dialog.setGraphic(icon);
    ButtonType applyChanges = new ButtonType("Apply", ButtonBar.ButtonData.OK_DONE);
    dialog.getDialogPane().getButtonTypes().addAll(applyChanges, ButtonType.CANCEL);

    try {
        FXMLLoader fxmlLoader = new FXMLLoader(ClassLoader.getSystemClassLoader().getResource("PerceptionActionAgent.fxml"));
        Parent root = fxmlLoader.load();
        dialog.getDialogPane().setContent(root);
        dialog.setResultConverter(dialogButton -> {
            if (dialogButton == applyChanges) {
                PerceptionActionAgentController configurationController = fxmlLoader.getController();
                for (PerceptionActionAgentController.PerceptionRule rule : configurationController.tableContent) {
                    ((PerceptionAction) getAlgorithm()).addRule(rule.getLeft(), rule.getRight(), rule.getUp(), rule.getDown(), Directions.valueOf(rule.getAction()));
                }
                return null;
            }
            return null;
        });

    } catch (IOException e) {
        new ErrorView("No possible load agent configuration");
        e.printStackTrace();
    }

    Optional<String> s = dialog.showAndWait();
}
 
开发者ID:AdrianBZG,项目名称:IEMLS,代码行数:36,代码来源:PerceptionActionAgent.java

示例6: 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();
        }
    });
}
 
开发者ID:ulriknyman,项目名称:H-Uppaal,代码行数:40,代码来源:QueryPresentation.java

示例7: 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);
}
 
开发者ID:HanSolo,项目名称:worldheatmap,代码行数:29,代码来源:World.java

示例8: getIconAsNode

import org.kordamp.ikonli.javafx.FontIcon; //导入依赖的package包/类
/**
 * 
 * @param fontIcon
 * @return 
 */
public Node getIconAsNode(Ikon fontIcon) {
    if (fontIcon == null) {
        throw new IllegalArgumentException("'fontIcon' can't be NULL."); // NOI18N
    }
    
    // TODO add more data (size, color...)
    final Node node = new FontIcon(fontIcon);
    
    return node;
}
 
开发者ID:Naoghuman,项目名称:Incubator,代码行数:16,代码来源:AbstractIkonliHandler.java

示例9: initGraphics

import org.kordamp.ikonli.javafx.FontIcon; //导入依赖的package包/类
private void initGraphics() {
    getStyleClass().add("menu-item");

    icon = null == iconCode ? new FontIcon() : new FontIcon(iconCode);
    icon.setTextOrigin(VPos.CENTER);
    icon.getStyleClass().add("menu-item-icon");

    getChildren().setAll(icon);
}
 
开发者ID:HanSolo,项目名称:funmenu,代码行数:10,代码来源:FunMenuItem.java

示例10: initializeButton

import org.kordamp.ikonli.javafx.FontIcon; //导入依赖的package包/类
private void initializeButton(Button btn, Ikon icon, String tooltip) {
    final FontIcon fi = new FontIcon(icon);
    fi.setIconSize(24);
    btn.setGraphic(fi);
    btn.setText(null);
    btn.setTooltip(new Tooltip(tooltip));
}
 
开发者ID:Naoghuman,项目名称:SokubanFX,代码行数:8,代码来源:GamePresenter.java

示例11: initializeMenuButton

import org.kordamp.ikonli.javafx.FontIcon; //导入依赖的package包/类
private void initializeMenuButton() {
    LoggerFacade.INSTANCE.info(this.getClass(), "Initialize MenuButton"); // NOI18N
    
    lMenuButton.setText(null);
    lMenuButton.setCursor(Cursor.HAND);
    
    final FontIcon fiBlockMenu = new FontIcon(Elusive.REMOVE_SIGN);
    fiBlockMenu.setIconSize(36);
    lMenuButton.setGraphic(fiBlockMenu);
}
 
开发者ID:Naoghuman,项目名称:SokubanFX,代码行数:11,代码来源:MainMenuPresenter.java

示例12: initializeButtonPlayGame

import org.kordamp.ikonli.javafx.FontIcon; //导入依赖的package包/类
private void initializeButtonPlayGame() {
    LoggerFacade.INSTANCE.info(this.getClass(), "Initialize button PlayGame"); // NOI18N
    
    lPlayGame.setText(null);
    lPlayGame.setCursor(Cursor.HAND);
    
    final FontIcon fiPlayAlt = new FontIcon(Elusive.PLAY_ALT);
    fiPlayAlt.setIconSize(56);
    lPlayGame.setGraphic(fiPlayAlt);
}
 
开发者ID:Naoghuman,项目名称:SokubanFX,代码行数:11,代码来源:PreviewPresenter.java

示例13: initializeMenuButton

import org.kordamp.ikonli.javafx.FontIcon; //导入依赖的package包/类
private void initializeMenuButton() {
    LoggerFacade.INSTANCE.info(this.getClass(), "Initialize MenuButton"); // NOI18N
    
    lMenuButton.setText(null);
    lMenuButton.setCursor(Cursor.HAND);
    
    final FontIcon fiBlockMenu = new FontIcon(Elusive.LINES);
    fiBlockMenu.setIconSize(56);
    lMenuButton.setGraphic(fiBlockMenu);
}
 
开发者ID:Naoghuman,项目名称:SokubanFX,代码行数:11,代码来源:ApplicationPresenter.java

示例14: getValue

import org.kordamp.ikonli.javafx.FontIcon; //导入依赖的package包/类
@Override
public FontIcon getValue() {
    try {
        if (cellDataFeaturesScmRev == null) {
            return icons.getOrDefault(cellDataFeatures.getValue().getFirst(), fontIconUnknown).call();
        } else {
            return icons.getOrDefault(cellDataFeaturesScmRev.getValue().getAffectedItems().get(0).getFirst(),
                    fontIconUnknown).call();

        }
    } catch (Exception e) {
        e.printStackTrace();
    }
    return null;
}
 
开发者ID:iazarny,项目名称:gitember,代码行数:16,代码来源:ActionCellValueFactory.java

示例15: 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));
}
 
开发者ID:HanSolo,项目名称:cardnav,代码行数:10,代码来源:CardBox.java


注:本文中的org.kordamp.ikonli.javafx.FontIcon类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。