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


Java FontIcon.setFill方法代码示例

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


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

示例1: 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

示例2: 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

示例3: SwarmAgentView

import org.kordamp.ikonli.javafx.FontIcon; //导入方法依赖的package包/类
public SwarmAgentView() {
    Circle right = new Circle(10);
    right.setTranslateX(-10);
    right.setTranslateY(-10);
    right.setFill(Color.BLUE);

    FontIcon icon = new FontIcon(FontAwesome.BUG);
    icon.setFill(Color.WHITE);
    icon.setIconSize(16);
    icon.setTranslateX(-16.5);
    icon.setTranslateY(-6);
    getChildren().addAll(right, icon);
}
 
开发者ID:AdrianBZG,项目名称:IEMLS,代码行数:14,代码来源:SwarmAgentView.java

示例4: ExplorerAgentView

import org.kordamp.ikonli.javafx.FontIcon; //导入方法依赖的package包/类
public ExplorerAgentView() {
    Circle right = new Circle(10);
    right.setTranslateX(-10);
    right.setTranslateY(-10);
    right.setFill(Color.BLUE);

    FontIcon icon = new FontIcon(FontAwesome.SEARCH);
    icon.setFill(Color.WHITE);
    icon.setIconSize(16);
    icon.setTranslateX(-16.5);
    icon.setTranslateY(-6);
    getChildren().addAll(right, icon);
}
 
开发者ID:AdrianBZG,项目名称:IEMLS,代码行数:14,代码来源:ExplorerAgentView.java

示例5: QLearningAgentView

import org.kordamp.ikonli.javafx.FontIcon; //导入方法依赖的package包/类
public QLearningAgentView() {
    Circle right = new Circle(10);
    right.setTranslateX(-10);
    right.setTranslateY(-10);
    right.setFill(Color.BLUE);

    FontIcon icon = new FontIcon(FontAwesome.COG);
    icon.setFill(Color.WHITE);
    icon.setIconSize(16);
    icon.setTranslateX(-16.5);
    icon.setTranslateY(-6);
    getChildren().addAll(right, icon);
}
 
开发者ID:AdrianBZG,项目名称:IEMLS,代码行数:14,代码来源:QLearningAgentView.java

示例6: NeuralAgentView

import org.kordamp.ikonli.javafx.FontIcon; //导入方法依赖的package包/类
public NeuralAgentView() {
    Circle right = new Circle(10);
    right.setTranslateX(-10);
    right.setTranslateY(-10);
    right.setFill(Color.BLUE);

    FontIcon icon = new FontIcon(FontAwesome.RANDOM);
    icon.setFill(Color.WHITE);
    icon.setIconSize(16);
    icon.setTranslateX(-16.5);
    icon.setTranslateY(-6);
    getChildren().addAll(right, icon);
}
 
开发者ID:AdrianBZG,项目名称:IEMLS,代码行数:14,代码来源:NeuralAgentView.java

示例7: AntView

import org.kordamp.ikonli.javafx.FontIcon; //导入方法依赖的package包/类
public AntView() {
    FontIcon icon = new FontIcon(FontAwesome.BUG);
    icon.setFill(Color.WHITE);
    icon.setIconSize(16);
    icon.setTranslateX(-16.5);
    icon.setTranslateY(-6);
    getChildren().addAll(icon);
}
 
开发者ID:AdrianBZG,项目名称:IEMLS,代码行数:9,代码来源:AntView.java

示例8: PAAgent

import org.kordamp.ikonli.javafx.FontIcon; //导入方法依赖的package包/类
public PAAgent() {
    Circle right = new Circle(10);
    right.setTranslateX(-10);
    right.setTranslateY(-10);
    right.setFill(Color.BLUE);

    FontIcon icon = new FontIcon(FontAwesome.EYE);
    icon.setFill(Color.WHITE);
    icon.setIconSize(16);
    icon.setTranslateX(-16.5);
    icon.setTranslateY(-6);
    getChildren().addAll(right, icon);
}
 
开发者ID:AdrianBZG,项目名称:IEMLS,代码行数:14,代码来源:PAAgent.java

示例9: ScriptAgentView

import org.kordamp.ikonli.javafx.FontIcon; //导入方法依赖的package包/类
public ScriptAgentView() {
    Circle right = new Circle(10);
    right.setTranslateX(-10);
    right.setTranslateY(-10);
    right.setFill(Color.BLUE);

    FontIcon icon = new FontIcon(FontAwesome.CODE);
    icon.setFill(Color.WHITE);
    icon.setIconSize(16);
    icon.setTranslateX(-16.5);
    icon.setTranslateY(-6);
    getChildren().addAll(right, icon);

}
 
开发者ID:AdrianBZG,项目名称:IEMLS,代码行数:15,代码来源:ScriptAgentView.java

示例10: SituationActionView

import org.kordamp.ikonli.javafx.FontIcon; //导入方法依赖的package包/类
public SituationActionView() {
    Circle right = new Circle(10);
    right.setTranslateX(-10);
    right.setTranslateY(-10);
    right.setFill(Color.BLUE);

    FontIcon icon = new FontIcon(FontAwesome.HISTORY);
    icon.setFill(Color.WHITE);
    icon.setIconSize(16);
    icon.setTranslateX(-16.5);
    icon.setTranslateY(-6);
    getChildren().addAll(right, icon);
}
 
开发者ID:AdrianBZG,项目名称:IEMLS,代码行数:14,代码来源:SituationActionView.java

示例11: initializeColors

import org.kordamp.ikonli.javafx.FontIcon; //导入方法依赖的package包/类
private void initializeColors() {
    final FontIcon moreInformationIcon = (FontIcon) lookup("#moreInformationIcon");

    final Color color = Color.GREY_BLUE;
    final Color.Intensity colorIntensity = Color.Intensity.I50;

    final BiConsumer<Color, Color.Intensity> setBackground = (newColor, newIntensity) -> {
        setBackground(new Background(new BackgroundFill(
                newColor.getColor(newIntensity),
                CornerRadii.EMPTY,
                Insets.EMPTY
        )));

        setBorder(new Border(new BorderStroke(
                newColor.getColor(newIntensity.next(2)),
                BorderStrokeStyle.SOLID,
                CornerRadii.EMPTY,
                new BorderWidths(0, 0, 1, 0)
        )));

        moreInformationIcon.setFill(newColor.getColor(newIntensity.next(5)));
    };

    // Update the background when hovered
    setOnMouseEntered(event -> {
        if(CanvasController.getActiveComponent().equals(component.get())) {
            setBackground.accept(color, colorIntensity.next(2));
        } else {
            setBackground.accept(color, colorIntensity.next());
        }
        setCursor(Cursor.HAND);
    });
    setOnMouseExited(event -> {
        if(CanvasController.getActiveComponent().equals(component.get())) {
            setBackground.accept(color, colorIntensity.next(1));
        } else {
            setBackground.accept(color, colorIntensity);
        }
        setCursor(Cursor.DEFAULT);
    });

    CanvasController.activeComponentProperty().addListener((obs, oldActiveComponent, newActiveComponent) -> {
        if (newActiveComponent == null) return;


        if (newActiveComponent.equals(component.get())) {
            setBackground.accept(color, colorIntensity.next(2));
        } else {
            setBackground.accept(color, colorIntensity);
        }
    });

    // Update the background initially
    setBackground.accept(color, colorIntensity);
}
 
开发者ID:ulriknyman,项目名称:H-Uppaal,代码行数:56,代码来源:FilePresentation.java

示例12: addTogglableListElement

import org.kordamp.ikonli.javafx.FontIcon; //导入方法依赖的package包/类
public void addTogglableListElement(final String s, final ObservableBooleanValue isToggled, final Consumer<MouseEvent> mouseEventConsumer) {
    final Label label = new Label(s);
    label.getStyleClass().add("body2");

    final HBox container = new HBox();
    container.setStyle("-fx-padding: 8 16 8 16;");

    final FontIcon icon = new FontIcon();
    icon.setIconLiteral("gmi-done");
    icon.setFill(Color.GREY.getColor(Color.Intensity.I600));
    icon.setIconSize(20);
    icon.visibleProperty().bind(isToggled);

    final Region spacer = new Region();
    spacer.setMinWidth(8);

    container.getChildren().addAll(icon, spacer, label);

    final StackPane clickListenerFix = new StackPane(container);

    final JFXRippler rippler = new JFXRippler(clickListenerFix);
    rippler.setRipplerFill(Color.GREY_BLUE.getColor(Color.Intensity.I300));

    rippler.setOnMouseEntered(event -> {
        // Set the background to a light grey
        container.setBackground(new Background(new BackgroundFill(
                Color.GREY.getColor(Color.Intensity.I200),
                CornerRadii.EMPTY,
                Insets.EMPTY
        )));

        canIShowSubMenu.set(false);
    });

    rippler.setOnMouseExited(event -> {
        // Set the background to be transparent
        container.setBackground(new Background(new BackgroundFill(
                TRANSPARENT,
                CornerRadii.EMPTY,
                Insets.EMPTY
        )));
    });

    // When the rippler is pressed, run the provided consumer.
    clickListenerFix.setOnMousePressed(event -> {
        mouseEventConsumer.accept(event);
        event.consume();
    });

    list.getChildren().add(rippler);
}
 
开发者ID:ulriknyman,项目名称:H-Uppaal,代码行数:52,代码来源:DropDownMenu.java


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