Java源码示例:org.kordamp.ikonli.fontawesome.FontAwesome

示例1
private void initializeTerminal() {

        terminalTabPane.getTabs().addListener(new ListChangeListener<Tab>() {
            @Override
            public void onChanged(Change<? extends Tab> c) {

                while (c.next()) {
                    recordTerminalButton.setDisable(c.getList().isEmpty());
                }

            }
        });

        recordTerminalButton.setOnAction(e -> {
            if (isNull(scheduledFuture)) {
                Tooltip.install(recordTerminalButton, new Tooltip("Stop"));
                recordTerminalButton.setGraphic(new FontIcon(FontAwesome.STOP_CIRCLE_O));
                scheduledFuture = this.recordTerminal(e);
            } else {
                Tooltip.install(recordTerminalButton, new Tooltip("Record"));
                recordTerminalButton.setGraphic(new FontIcon(FontAwesome.PLAY_CIRCLE));
                scheduledFuture.cancel(false);
                scheduledFuture = null;
            }
        });

        newTerminalButton.setOnAction(this::newTerminal);
        closeTerminalButton.setOnAction(this::closeTerminal);

    }
 
示例2
public Node getIcon(final Path path) {

        FontIcon fontIcon = new FontIcon(FontAwesome.FILE_O);

        if (Files.isDirectory(path)) {
            fontIcon.setIconCode(FontAwesome.FOLDER_O);
        } else {
            if (pathResolver.isAsciidoc(path) || pathResolver.isMarkdown(path))
                fontIcon.setIconCode(FontAwesome.FILE_TEXT_O);
            if (pathResolver.isXML(path) || pathResolver.isCode(path))
                fontIcon.setIconCode(FontAwesome.FILE_CODE_O);
            if (pathResolver.isImage(path))
                fontIcon.setIconCode(FontAwesome.FILE_PICTURE_O);
            if (pathResolver.isPDF(path))
                fontIcon.setIconCode(FontAwesome.FILE_PDF_O);
            if (pathResolver.isHTML(path))
                fontIcon.setIconCode(FontAwesome.HTML5);
            if (pathResolver.isArchive(path))
                fontIcon.setIconCode(FontAwesome.FILE_ZIP_O);
            if (pathResolver.isExcel(path))
                fontIcon.setIconCode(FontAwesome.FILE_EXCEL_O);
            if (pathResolver.isVideo(path))
                fontIcon.setIconCode(FontAwesome.FILE_VIDEO_O);
            if (pathResolver.isWord(path))
                fontIcon.setIconCode(FontAwesome.FILE_WORD_O);
            if (pathResolver.isPPT(path))
                fontIcon.setIconCode(FontAwesome.FILE_POWERPOINT_O);
            if (pathResolver.isBash(path))
                fontIcon.setIconCode(FontAwesome.TERMINAL);
        }

        return new Label(null, fontIcon);
    }
 
示例3
private static void launch() {
    JTabbedPane tabPane = new JTabbedPane();

    createTab(tabPane, Dashicons.class, new DemoTab(allOf(Dashicons.class)));
    createTab(tabPane, Devicons.class, new DemoTab(allOf(Devicons.class)));
    createTab(tabPane, Elusive.class, new DemoTab(allOf(Elusive.class)));
    createTab(tabPane, Entypo.class, new DemoTab(allOf(Entypo.class)));
    createTab(tabPane, Feather.class, new DemoTab(allOf(Feather.class)));
    createTab(tabPane, FontAwesome.class, new DemoTab(allOf(FontAwesome.class)));
    createTab(tabPane, FontAwesomeBrands.class, new DemoTab(allOf(FontAwesomeBrands.class)));
    createTab(tabPane, FontAwesomeSolid.class, new DemoTab(allOf(FontAwesomeSolid.class)));
    createTab(tabPane, FontAwesomeRegular.class, new DemoTab(allOf(FontAwesomeRegular.class)));
    createTab(tabPane, Fontelico.class, new DemoTab(allOf(Fontelico.class)));
    createTab(tabPane, Foundation.class, new DemoTab(allOf(Foundation.class)));
    createTab(tabPane, HawconsFilled.class, new DemoTab(allOf(HawconsFilled.class)));
    createTab(tabPane, HawconsStroke.class, new DemoTab(allOf(HawconsStroke.class)));
    createTab(tabPane, Icomoon.class, new DemoTab(allOf(Icomoon.class)));
    createTab(tabPane, Ionicons4IOS.class, new DemoTab(allOf(Ionicons4IOS.class)));
    createTab(tabPane, Ionicons4Material.class, new DemoTab(allOf(Ionicons4Material.class)));
    createTab(tabPane, Ionicons4Logo.class, new DemoTab(allOf(Ionicons4Logo.class)));
    createTab(tabPane, Ionicons.class, new DemoTab(allOf(Ionicons.class)));
    createTab(tabPane, Ionicons4Material.class, new DemoTab(allOf(Ionicons4Material.class)));
    createTab(tabPane, Ionicons4IOS.class, new DemoTab(allOf(Ionicons4IOS.class)));
    createTab(tabPane, Ionicons4Logo.class, new DemoTab(allOf(Ionicons4Logo.class)));
    createTab(tabPane, LigatureSymbols.class, new DemoTab(allOf(LigatureSymbols.class)));
    createTab(tabPane, Linecons.class, new DemoTab(allOf(Linecons.class)));
    createTab(tabPane, Maki.class, new DemoTab(allOf(Maki.class)));
    createTab(tabPane, Maki2.class, new DemoTab(allOf(Maki2.class)));
    createTab(tabPane, Mapicons.class, new DemoTab(allOf(Mapicons.class)));
    createTab(tabPane, Material.class, new DemoTab(allOf(Material.class)));
    createTab(tabPane, MaterialDesign.class, new DemoTab(allOf(MaterialDesign.class)));
    createTab(tabPane, MetrizeIcons.class, new DemoTab(allOf(MetrizeIcons.class)));
    createTab(tabPane, Ociicons.class, new DemoTab(allOf(Ociicons.class)));
    createTab(tabPane, Octicons.class, new DemoTab(allOf(Octicons.class)));
    createTab(tabPane, Openiconic.class, new DemoTab(allOf(Openiconic.class)));
    createTab(tabPane, PaymentFont.class, new DemoTab(allOf(PaymentFont.class)));
    createTab(tabPane, Runestroicons.class, new DemoTab(allOf(Runestroicons.class)));
    createTab(tabPane, Typicons.class, new DemoTab(allOf(Typicons.class)));
    createTab(tabPane, Themify.class, new DemoTab(allOf(Themify.class)));
    createTab(tabPane, WeatherIcons.class, new DemoTab(allOf(WeatherIcons.class)));
    createTab(tabPane, Websymbols.class, new DemoTab(allOf(Websymbols.class)));
    createTab(tabPane, Zondicons.class, new DemoTab(allOf(Zondicons.class)));

    JFrame frame = new JFrame("Ikonli Sampler");
    frame.add(tabPane);
    frame.setSize(new Dimension(1024, 1024));
    frame.setVisible(true);
}
 
示例4
@Override
public void start(Stage primaryStage) throws Exception {
    URL location = getClass().getResource("sampler.fxml");
    FXMLLoader fxmlLoader = new FXMLLoader(location);
    TabPane tabPane = fxmlLoader.load();
    tabPane.getTabs().add(new DemoTab(Dashicons.class, allOf(Dashicons.class)));
    tabPane.getTabs().add(new DemoTab(Devicons.class, allOf(Devicons.class)));
    tabPane.getTabs().add(new DemoTab(Elusive.class, allOf(Elusive.class)));
    tabPane.getTabs().add(new DemoTab(Entypo.class, allOf(Entypo.class)));
    tabPane.getTabs().add(new DemoTab(Feather.class, allOf(Feather.class)));
    tabPane.getTabs().add(new DemoTab(FontAwesome.class, allOf(FontAwesome.class)));
    tabPane.getTabs().add(new DemoTab(FontAwesomeBrands.class, allOf(FontAwesomeBrands.class)));
    tabPane.getTabs().add(new DemoTab(FontAwesomeSolid.class, allOf(FontAwesomeSolid.class)));
    tabPane.getTabs().add(new DemoTab(FontAwesomeRegular.class, allOf(FontAwesomeRegular.class)));
    tabPane.getTabs().add(new DemoTab(Fontelico.class, allOf(Fontelico.class)));
    tabPane.getTabs().add(new DemoTab(Foundation.class, allOf(Foundation.class)));
    tabPane.getTabs().add(new DemoTab(HawconsFilled.class, allOf(HawconsFilled.class)));
    tabPane.getTabs().add(new DemoTab(HawconsStroke.class, allOf(HawconsStroke.class)));
    tabPane.getTabs().add(new DemoTab(Icomoon.class, allOf(Icomoon.class)));
    tabPane.getTabs().add(new DemoTab(Ionicons4Material.class, allOf(Ionicons4Material.class)));
    tabPane.getTabs().add(new DemoTab(Ionicons4IOS.class, allOf(Ionicons4IOS.class)));
    tabPane.getTabs().add(new DemoTab(Ionicons4Logo.class, allOf(Ionicons4Logo.class)));
    tabPane.getTabs().add(new DemoTab(Ionicons.class, allOf(Ionicons.class)));
    tabPane.getTabs().add(new DemoTab(LigatureSymbols.class, allOf(LigatureSymbols.class)));
    tabPane.getTabs().add(new DemoTab(Linecons.class, allOf(Linecons.class)));
    tabPane.getTabs().add(new DemoTab(Maki.class, allOf(Maki.class)));
    tabPane.getTabs().add(new DemoTab(Maki2.class, allOf(Maki2.class)));
    tabPane.getTabs().add(new DemoTab(Mapicons.class, allOf(Mapicons.class)));
    tabPane.getTabs().add(new DemoTab(Material.class, allOf(Material.class)));
    tabPane.getTabs().add(new DemoTab(MaterialDesign.class, allOf(MaterialDesign.class)));
    tabPane.getTabs().add(new DemoTab(MetrizeIcons.class, allOf(MetrizeIcons.class)));
    tabPane.getTabs().add(new DemoTab(Ociicons.class, allOf(Ociicons.class)));
    tabPane.getTabs().add(new DemoTab(Octicons.class, allOf(Octicons.class)));
    tabPane.getTabs().add(new DemoTab(Openiconic.class, allOf(Openiconic.class)));
    tabPane.getTabs().add(new DemoTab(PaymentFont.class, allOf(PaymentFont.class)));
    tabPane.getTabs().add(new DemoTab(Runestroicons.class, allOf(Runestroicons.class)));
    tabPane.getTabs().add(new DemoTab(Themify.class, allOf(Themify.class)));
    tabPane.getTabs().add(new DemoTab(Typicons.class, allOf(Typicons.class)));
    tabPane.getTabs().add(new DemoTab(WeatherIcons.class, allOf(WeatherIcons.class)));
    tabPane.getTabs().add(new DemoTab(Websymbols.class, allOf(Websymbols.class)));
    tabPane.getTabs().add(new DemoTab(Zondicons.class, allOf(Zondicons.class)));

    Scene scene = new Scene(tabPane);
    scene.getStylesheets().add("org/kordamp/ikonli/sampler/javafx/sampler.css");

    primaryStage.setTitle("Ikonli Sampler");
    primaryStage.setScene(scene);
    primaryStage.setWidth(1024);
    primaryStage.setHeight(1024);
    primaryStage.show();
}