• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java GlyphIcons类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: setForegroundIcon

import de.jensd.fx.glyphs.GlyphIcons; //导入依赖的package包/类
/**
 * Changes the foregroundIcon icon.
 *
 * Note: previous color setup and animations are reset as well.
 *
 * @param icon the icon which should be set as the new icon.
 * @param color the color of the new icon.
 */
public void setForegroundIcon(final GlyphIcons icon, final Color color) {
    // copy old images to replace later.
    final Text oldForegroundIcon = foregroundIcon;
    final Text oldForegroundFadeIcon = foregroundFadeIcon;

    // create new images.
    this.foregroundIcon = createIcon(icon, Layer.FOREGROUND);
    this.foregroundFadeIcon = createColorFadeIcon(icon, Layer.FOREGROUND);

    // setup icon color
    if (color != null) {
        setForegroundIconColor(color);
    }

    // replace old icons with new ones.
    getChildren().replaceAll((node) -> {
        if (node.equals(oldForegroundIcon)) {
            return foregroundIcon;
        } else if (node.equals(oldForegroundFadeIcon)) {
            return foregroundFadeIcon;
        } else {
            return node;
        }
    });
}
 
开发者ID:openbase,项目名称:bco.bcozy,代码行数:34,代码来源:SVGIcon.java


示例2: addChildren

import de.jensd.fx.glyphs.GlyphIcons; //导入依赖的package包/类
private void addChildren() {
    viewSwitcherPopUp.getChildren().clear();
    for (Map.Entry<GlyphIcons, EventHandler<ActionEvent>> glyphIconsEventHandlerEntry : eventHandler.entrySet()) {
        GlyphIcons icon = glyphIconsEventHandlerEntry.getKey();
        EventHandler<ActionEvent> handler = glyphIconsEventHandlerEntry.getValue();

        if (icon != parent) {
            FloatingButton element = new FloatingButton(new SVGIcon(icon, Constants.SMALL_ICON, true));
            viewSwitcherPopUp.getChildren().addAll(element);
            element.setOnAction(event -> {
                clickOnChild(icon);
                if (Objects.nonNull(handler)) {
                    handler.handle(event);
                }
            });
        }
    }
}
 
开发者ID:openbase,项目名称:bco.bcozy,代码行数:19,代码来源:FloatingPopUp.java


示例3: createIconLabel

import de.jensd.fx.glyphs.GlyphIcons; //导入依赖的package包/类
public static Label createIconLabel(GlyphIcons icon, String iconSize, String text, ContentDisplay contentDisplay, Paint colour, String style)
{
	Text iconLabel = GlyphsDude.createIcon(icon, iconSize);
	iconLabel.setFill(colour);
	Label label = new Label(text);
	label.setTextFill(colour);
	label.setStyle(style);
	label.setGraphic(iconLabel);
	label.setContentDisplay(contentDisplay);
	return label;
}
 
开发者ID:PolyphasicDevTeam,项目名称:NoMoreOversleeps,代码行数:12,代码来源:JavaFxHelper.java


示例4: getIconAsNode

import de.jensd.fx.glyphs.GlyphIcons; //导入依赖的package包/类
/**
 * 
 * @param glyphsFactory
 * @param fontIcon
 * @return 
 */
public Node getIconAsNode(GlyphsFactory glyphsFactory, GlyphIcons fontIcon) {
    if (fontIcon == null) {
        throw new IllegalArgumentException("'fontIcon' can't be NULL."); // NOI18N
    }
    
    // TODO add more data (size, color...)
    final Node node = glyphsFactory.createIcon(fontIcon, "16px");// 1em
    
    return node;
}
 
开发者ID:Naoghuman,项目名称:Incubator,代码行数:17,代码来源:AbstractFontAwesomeFXHandler.java


示例5: resolve

import de.jensd.fx.glyphs.GlyphIcons; //导入依赖的package包/类
@Override
public GlyphIcons resolve(final String fontIconName) {
    final ObservableList<GlyphIcons> glyphIcons = FXCollections.observableArrayList();
    glyphIcons.addAll(MaterialDesignIcon.values());
    
    final Optional<GlyphIcons> oGlyphIcons = glyphIcons
            .stream()
            .filter((gi) ->  gi.name().equals(fontIconName) )
            .findFirst();
    if (oGlyphIcons.isPresent()) {
        return oGlyphIcons.get();
    }
    
    return null;
}
 
开发者ID:Naoghuman,项目名称:Incubator,代码行数:16,代码来源:MaterialDesignFontAwesomeFXHandler.java


示例6: testGlyphIconsIsFound

import de.jensd.fx.glyphs.GlyphIcons; //导入依赖的package包/类
@Test
public void testGlyphIconsIsFound() {
    final String fontIconName = "ACCOUNT_ALERT";
    final GlyphIcons actualGlyphIcons = handler.resolve(fontIconName);

    assertNotNull("actualGlyphIcons can't be NULL", actualGlyphIcons);

    final GlyphIcons expectedGlyphIcons = MaterialDesignIcon.ACCOUNT_ALERT;
    assertEquals("actualGlyphIcons.ACCOUNT_ALERT must be MaterialDesignIcon.ACCOUNT_ALERT", expectedGlyphIcons, actualGlyphIcons);
}
 
开发者ID:Naoghuman,项目名称:Incubator,代码行数:11,代码来源:MaterialDesignFontAwesomeFXHandlerTest.java


示例7: testGlyphIconsNOTFound

import de.jensd.fx.glyphs.GlyphIcons; //导入依赖的package包/类
@Test
public void testGlyphIconsNOTFound() {
    final String fontIconName = "DONT_EXISTS";
    final GlyphIcons actualGlyphIcons = handler.resolve(fontIconName);

    assertNull("GlyphIcons.DONT_EXISTS can't exists", actualGlyphIcons);
}
 
开发者ID:Naoghuman,项目名称:Incubator,代码行数:8,代码来源:MaterialDesignFontAwesomeFXHandlerTest.java


示例8: getIcon

import de.jensd.fx.glyphs.GlyphIcons; //导入依赖的package包/类
public static GlyphIcons getIcon(Attribute attribute) {
    GlyphIcons iconName = attributeMap.get(attribute);
    if (iconName == null) {
        iconName = SQUARE_INC;
    }
    return iconName;
}
 
开发者ID:frosch95,项目名称:GeoFroggerFX,代码行数:8,代码来源:GeocachingIcons.java


示例9: Action

import de.jensd.fx.glyphs.GlyphIcons; //导入依赖的package包/类
public Action(String text, String accelerator, GlyphIcons icon,
	EventHandler<ActionEvent> action, ObservableBooleanValue disable,
	BooleanProperty selected)
{
	this.text = text;
	this.accelerator = (accelerator != null) ? KeyCombination.valueOf(accelerator) : null;
	this.icon = icon;
	this.action = action;
	this.disable = disable;
	this.selected = selected;
}
 
开发者ID:JFormDesigner,项目名称:markdown-writer-fx,代码行数:12,代码来源:Action.java


示例10: SVGIcon

import de.jensd.fx.glyphs.GlyphIcons; //导入依赖的package包/类
/**
 * Constructor for a SVGIcon.
 *
 * @param icon the Icon to be set in the backgroundIcon
 * (can be chosen from one of the supported fonts from fontawesomefx)
 * @param size the size in px for the icon
 * @param styled true if color should be changed by theme, otherwise false
 */
public SVGIcon(final GlyphIcons icon, final double size, final boolean styled) {
    this(size, styled);
    this.foregroundIcon = createIcon(icon, Layer.FOREGROUND);
    this.foregroundFadeIcon = createColorFadeIcon(icon, Layer.FOREGROUND);
    this.backgroundIcon = null;
    this.backgroundFadeIcon = null;
    this.getChildren().addAll(foregroundIcon, foregroundFadeIcon);
}
 
开发者ID:openbase,项目名称:bco.bcozy,代码行数:17,代码来源:SVGIcon.java


示例11: createIcon

import de.jensd.fx.glyphs.GlyphIcons; //导入依赖的package包/类
private static Text createIcon(final GlyphIcons glyphIcon, final double size, final boolean styled) {
    final Text icon = GlyphsDude.createIcon(glyphIcon, String.valueOf(size));
    icon.setSmooth(true);
    if (styled) {
        icon.getStyleClass().clear();
        icon.getStyleClass().add(Constants.ICONS_CSS_STRING);
    }
    return icon;
}
 
开发者ID:openbase,项目名称:bco.bcozy,代码行数:10,代码来源:SVGIcon.java


示例12: createColorFadeIcon

import de.jensd.fx.glyphs.GlyphIcons; //导入依赖的package包/类
private static Text createColorFadeIcon(final GlyphIcons glyphIcon, final double size, final Layer layer) {
    final Text icon = createIcon(glyphIcon, size, layer == Layer.FOREGROUND);

    // should be only visible on fade.
    icon.setOpacity(Constants.FULLY_TRANSPARENT);
    return icon;
}
 
开发者ID:openbase,项目名称:bco.bcozy,代码行数:8,代码来源:SVGIcon.java


示例13: setBackgroundIcon

import de.jensd.fx.glyphs.GlyphIcons; //导入依赖的package包/类
/**
 * Changes the backgroundIcon icon.
 *
 * Note: previous color setup and animations are reset as well.
 *
 * @param icon the icon which should be set as the new icon.
 * @param color the color of the new icon.
 */
public void setBackgroundIcon(final GlyphIcons icon, final Color color) {
    // copy old images to replace later.
    final Text oldBackgroundIcon = backgroundIcon;
    final Text oldBackgroundFadeIcon = backgroundFadeIcon;

    // create new images.
    this.backgroundIcon = createIcon(icon, Layer.BACKGROUND);
    this.backgroundFadeIcon = createColorFadeIcon(icon, Layer.BACKGROUND);

    // setup icon color
    if (color != null) {
        setBackgroundIconColor(color);
    }

    // add background icon if not exists
    if (oldBackgroundIcon == null || oldBackgroundFadeIcon == null) {
        getChildren().clear();
        getChildren().addAll(this.backgroundIcon, this.backgroundFadeIcon, this.foregroundIcon, this.foregroundFadeIcon);
        return;
    }

    // replace old icons with new ones.
    getChildren().replaceAll((node) -> {
        if (node.equals(oldBackgroundIcon)) {
            return backgroundIcon;
        } else if (node.equals(oldBackgroundFadeIcon)) {
            return backgroundFadeIcon;
        } else {
            return node;
        }
    });
}
 
开发者ID:openbase,项目名称:bco.bcozy,代码行数:41,代码来源:SVGIcon.java


示例14: addParentElement

import de.jensd.fx.glyphs.GlyphIcons; //导入依赖的package包/类
public final void addParentElement(final GlyphIcons icon, final EventHandler<ActionEvent> value) {
    parent = icon;
    eventHandler.put(icon, value);

    showParent();
    addChildren();

    setViewSwitchingButtonsVisible(visible);
}
 
开发者ID:openbase,项目名称:bco.bcozy,代码行数:10,代码来源:FloatingPopUp.java


示例15: clickOnChild

import de.jensd.fx.glyphs.GlyphIcons; //导入依赖的package包/类
public void clickOnChild(final GlyphIcons clicked) {
    parent = clicked;

    showParent();
    addChildren();
    switchingButtonsVisible();
}
 
开发者ID:openbase,项目名称:bco.bcozy,代码行数:8,代码来源:FloatingPopUp.java


示例16: createTab

import de.jensd.fx.glyphs.GlyphIcons; //导入依赖的package包/类
/**
 * Creates a new Tab.
 *
 * @param pane the tab-content
 * @param icon the tab-icon
 * @return the new tab
 */
private Tab createTab(Pane pane, GlyphIcons icon) {
    Tab tab = new Tab();
    SVGIcon svgIcon = new SVGIcon(icon, Constants.EXTRA_SMALL_ICON, true);
    tab.setGraphic(svgIcon);
    tab.setContent(pane);
    pane.getStyleClass().add("tab-content-area");
    tab.getStyleClass().add("tab");
    return tab;
}
 
开发者ID:openbase,项目名称:bco.bcozy,代码行数:17,代码来源:UserActionPane.java


示例17: setButtonStackedIcons

import de.jensd.fx.glyphs.GlyphIcons; //导入依赖的package包/类
public static void setButtonStackedIcons(Button button, GlyphIcons icon1, GlyphIcons icon2) {
	Region saveAsImg = GlyphsStack.create()
			.add(GlyphsBuilder.create(FontAwesomeIcon.class).glyph(icon1).size(iconSize(_buttonDefaultIconSize)).build())
			.add(GlyphsBuilder.create(FontAwesomeIcon.class).glyph(icon2).size(iconSize(_iconSmallSize)).build());
			
	button.setGraphic(saveAsImg);
	button.setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
	
	fixButtonSize(button, _buttonDefaultIconSize);
}
 
开发者ID:aic-sri-international,项目名称:aic-praise,代码行数:11,代码来源:FXUtil.java


示例18: withIcon

import de.jensd.fx.glyphs.GlyphIcons; //导入依赖的package包/类
public ViewModelListCellFactory<T> withIcon(Callback<T, GlyphIcons> toIcon, Callback<T, Paint> toColor) {
    this.toGraphic = viewModel -> {
        Text graphic = MaterialDesignIconFactory.get().createIcon(toIcon.call(viewModel));
        graphic.setFill(toColor.call(viewModel));
        return graphic;
    };
    return this;
}
 
开发者ID:JabRef,项目名称:jabref,代码行数:9,代码来源:ViewModelListCellFactory.java


示例19: urlButton

import de.jensd.fx.glyphs.GlyphIcons; //导入依赖的package包/类
/**
 * Factory method to create an {@link UrlButton}
 * 
 * @param text
 *            optional button text
 * @param url
 * @param icon
 *            optional icon
 * @param style
 *            optional style classes
 * @return
 */
public static final UrlButton urlButton(String text, String url, GlyphIcons icon, String... style) {
    require(isNotBlank(url), "URL cannot be blank");
    UrlButton button = new UrlButton(text);
    button.setOnAction(e -> eventStudio().broadcast(new OpenUrlRequest(url)));
    if (nonNull(icon)) {
        GlyphsDude.setIcon(button, icon);
    }
    if (nonNull(style) && style.length > 0) {
        button.getStyleClass().addAll(style);
    }
    return button;
}
 
开发者ID:torakiki,项目名称:pdfsam,代码行数:25,代码来源:UrlButton.java


示例20: accept

import de.jensd.fx.glyphs.GlyphIcons; //导入依赖的package包/类
@Override
public void accept(PdfDescriptorLoadingStatus t) {

    GlyphIcons icon = Optional.ofNullable(t).map(PdfDescriptorLoadingStatus::getIcon).orElse(null);
    if (nonNull(icon)) {
        GlyphsDude.setIcon(indicator, icon, ContentDisplay.CENTER);
    } else {
        indicator.setGraphic(null);
    }
    if (t != null && isNotBlank(t.getDescription())) {
        indicator.setTooltip(new Tooltip(t.getDescription()));
    } else {
        indicator.setTooltip(null);
    }
}
 
开发者ID:torakiki,项目名称:pdfsam,代码行数:16,代码来源:LoadingStatusIndicatorUpdater.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ThriftConversion类代码示例发布时间:2022-05-22
下一篇:
Java ServiceException类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap