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

Java GlyphFontRegistry类代码示例

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

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



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

示例1: initialize

import org.controlsfx.glyphfont.GlyphFontRegistry; //导入依赖的package包/类
/**
 * Initializes every needed service
 *
 * @param location
 * @param resources
 */
@Override
public void initialize(URL location, ResourceBundle resources) {
    // Load FontAweSome
    GlyphFontRegistry.register(new FontAwesome(getClass().getResourceAsStream("/fonts/fontawesome-webfont.ttf")));

    startTreePreloadService();
    initializeAccordion();
    initializeRankChoiceBox();
    initializeGraphSettings();
    initializeAnalysisPane();
    initializeGraphAnalysis();
    initializeInfoPane();
    initializeBindings();
    initializeColorComboBox();
    initializeButtonsOnLeftPane();
    //preload settings
    SaveAndLoadOptions.loadSettings();

    //Display the info text in the bottom left pane
    displayInfoText();
}
 
开发者ID:jmueller95,项目名称:CORNETTO,代码行数:28,代码来源:MainStageController.java


示例2: start

import org.controlsfx.glyphfont.GlyphFontRegistry; //导入依赖的package包/类
@Override
public void start(Stage stage) {
	try {
		mainStage = stage;
		InputStream is = getClass().getResourceAsStream("fontawesome-webfont.ttf");
		GlyphFont fa = new FontAwesome(is);
		GlyphFontRegistry.register(fa);
		Parent root = FXMLLoader.load(getClass().getResource("application.fxml"));
		stage.setTitle("MobTime");
		stage.getIcons().add(new Image(getClass().getResourceAsStream("icon.png")));
		Scene scene = new Scene(root);
		stage.setScene(scene);
		stage.show();
		openMiniTimer();
		
		stage.setOnCloseRequest(new EventHandler<WindowEvent>() {
	        @Override
	        public void handle(final WindowEvent event) {
	        	miniTimer.close();
	        }
		});
	} catch (Exception e) {
		e.printStackTrace();
	}
}
 
开发者ID:GreatWebGuy,项目名称:MobTime,代码行数:26,代码来源:MobTime.java


示例3: setIcon

import org.controlsfx.glyphfont.GlyphFontRegistry; //导入依赖的package包/类
private void setIcon(TreeItem<String> item, Boolean result) {
    GlyphFont fontAwesome = GlyphFontRegistry.font("FontAwesome");

    StackPane pane = new StackPane();
    pane.setPrefWidth(18);

    if (result != null) {
        if (result) {
            pane.getChildren().add(fontAwesome.create(FontAwesome.Glyph.CHECK).color(Color.GREEN));
        } else {
            pane.getChildren().add(fontAwesome.create(FontAwesome.Glyph.EXCLAMATION).color(Color.RED));
        }
    } else {
        pane.getChildren().add(fontAwesome.create(FontAwesome.Glyph.QUESTION).color(Color.GRAY));
    }
    item.setGraphic(pane);
}
 
开发者ID:sanaehirotaka,项目名称:logbook-kai,代码行数:18,代码来源:MissionCheck.java


示例4: updateIcon

import org.controlsfx.glyphfont.GlyphFontRegistry; //导入依赖的package包/类
/**
 * This updates the text with the correct unicode value
 * so that the desired icon is displayed.
 */
private void updateIcon(){

    Object iconValue = getIcon();

    if(iconValue != null) {
        if(iconValue instanceof Character){
            setTextUnicode((Character)iconValue);
        }else {
            GlyphFont gylphFont = GlyphFontRegistry.font(getFontFamily());
            if (gylphFont != null) {
                String name = iconValue.toString();
                Character unicode = gylphFont.getCharacter(name);
                if (unicode != null) {
                    setTextUnicode(unicode);
                } else {
                    // Could not find a icon with this name
                    setText(name);
                }
            }
        }
    }
}
 
开发者ID:Vidada-Project,项目名称:vidada-desktop,代码行数:27,代码来源:GlyphView.java


示例5: getFontAwesome

import org.controlsfx.glyphfont.GlyphFontRegistry; //导入依赖的package包/类
private GlyphFont getFontAwesome() {
    if (fontAwesome == null) {
        try (InputStream inputStream = UniformDesign.class.getResourceAsStream("/de/factoryfx/javafx/icon/fontawesome-webfont4_3.ttf")) {
            GlyphFont font_awesome = new FontAwesome(inputStream);
            GlyphFontRegistry.register(font_awesome);
            fontAwesome = GlyphFontRegistry.font("FontAwesome");
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
    return fontAwesome;
}
 
开发者ID:factoryfx,项目名称:factoryfx,代码行数:13,代码来源:UniformDesign.java


示例6: makeAction

import org.controlsfx.glyphfont.GlyphFontRegistry; //导入依赖的package包/类
public static Action makeAction(String tooltip, FontAwesome.Glyph g, Consumer<ActionEvent> eventHandler) {
	initJfx();
	Action action = new Action("", eventHandler);
	GlyphFont fontAwesome = GlyphFontRegistry.font(FontAwesome4);
	action.setGraphic(fontAwesome.create(g).size(14));
	action.setLongText(tooltip);
	return action;
}
 
开发者ID:davidB,项目名称:jme3_ext_spatial_explorer,代码行数:9,代码来源:Helper.java


示例7: createErrorIcon

import org.controlsfx.glyphfont.GlyphFontRegistry; //导入依赖的package包/类
/**
 * Returns an error icon (glyph created using font awesome).
 *
 * @return graphic node
 */
public static Node createErrorIcon() {
	GlyphFont fontAwesome = GlyphFontRegistry.font("FontAwesome");
	Glyph graphic = fontAwesome.create(FontAwesome.Glyph.EXCLAMATION_TRIANGLE);
	graphic.setFontSize(20.0);
	graphic.setColor(Color.RED);
	return graphic;
}
 
开发者ID:PeerWasp,项目名称:PeerWasp,代码行数:13,代码来源:IconUtils.java


示例8: init

import org.controlsfx.glyphfont.GlyphFontRegistry; //导入依赖的package包/类
public static void init() {
	InputStream input = FontAwesomeOffline.class.getResourceAsStream(fontLocation);
	if (input != null) {
		font = new FontAwesome(input);
		GlyphFontRegistry.register(font);
		// Note: if we would close the input stream, icons would not be displayed anymore!
	} else {
		logger.warn("Could not initialize font awesome: ''.", fontLocation);
	}
}
 
开发者ID:PeerWasp,项目名称:PeerWasp,代码行数:11,代码来源:IconUtils.java


示例9: testInitFontAwesomeOffline

import org.controlsfx.glyphfont.GlyphFontRegistry; //导入依赖的package包/类
@Test
public void testInitFontAwesomeOffline() {
	// this test may fail if already initialized due to other tests.
	assertNull(IconUtils.getFontAwesome());

	IconUtils.initFontAwesomeOffline();
	GlyphFont font = IconUtils.getFontAwesome();
	assertNotNull(font);

	GlyphFont registeredFont = GlyphFontRegistry.font("FontAwesome");
	assertNotNull(registeredFont);
	assertEquals(font, registeredFont);
}
 
开发者ID:PeerWasp,项目名称:PeerWasp,代码行数:14,代码来源:IconUtilsTest.java


示例10: FolderView

import org.controlsfx.glyphfont.GlyphFontRegistry; //导入依赖的package包/类
public FolderView(){

		description.setId("description"); // style id
		description.setAlignment(Pos.CENTER_LEFT);
		description.setPadding(new Insets(10));

		GlyphFont font = GlyphFontRegistry.font("FontAwesome");
		Glyph folderViewNode = font.create(FontAwesome.Glyph.FOLDER_ALT.name()).size(100);
		this.addEventFilter(MouseEvent.MOUSE_CLICKED, mouseOpenHandler);

		this.setCenter(folderViewNode);
		this.setBottom(description);
	}
 
开发者ID:Vidada-Project,项目名称:vidada-desktop,代码行数:14,代码来源:FolderView.java


示例11: SimpleCellItemView

import org.controlsfx.glyphfont.GlyphFontRegistry; //导入依赖的package包/类
public SimpleCellItemView(){
	description.setId("description"); // style id
	description.setAlignment(Pos.CENTER_LEFT);
	description.setPadding(new Insets(10));

	GlyphFont font = GlyphFontRegistry.font("FontAwesome");
	Glyph folderViewNode = font.create(FontAwesome.Glyph.FILE_ALT.name()).size(100);

	this.addEventFilter(MouseEvent.MOUSE_CLICKED, mouseOpenHandler);

	this.setCenter(folderViewNode);
	this.setBottom(description);
}
 
开发者ID:Vidada-Project,项目名称:vidada-desktop,代码行数:14,代码来源:SimpleCellItemView.java


示例12: PrimaryMediaExplorerFX

import org.controlsfx.glyphfont.GlyphFontRegistry; //导入依赖的package包/类
/**
    * Creates a new PrimaryMediaExplorerFX
    */
   public PrimaryMediaExplorerFX(){


	GlyphFont font = GlyphFontRegistry.font("FontAwesome");
	homeView = font.create(FontAwesome.Glyph.HOME.name()).size(16);

	// Browser View
	mediaBrowserFX = new MediaBrowserFX();

	this.setCenter(mediaBrowserFX);
	//this.setCenter(mediaBrowserFX);

	// Filter View
	filterView = new ExplorerFilterFX();

	// Navigation / Breadcrumb
	breadCrumbBar = createNavigation();
	breadCrumbModel = new BreadCrumbNavigationDecorator(breadCrumbBar, new HomeLocationBreadCrumb());

	VBox topBox = new VBox();
	topBox.getChildren().add(filterView);
	topBox.getChildren().add(breadCrumbBar);

	TitledPane filterPane = new TitledPane("Source", topBox);
	this.setTop(filterPane);
}
 
开发者ID:Vidada-Project,项目名称:vidada-desktop,代码行数:30,代码来源:PrimaryMediaExplorerFX.java


示例13: SimulatorPane

import org.controlsfx.glyphfont.GlyphFontRegistry; //导入依赖的package包/类
/**
 * construct me
 * 
 * @param logPlayer
 * @param javaFXDisplay
 * @param e
 * @param d
 */
public SimulatorPane(LogPlayer logPlayer, MonitorControl monitorControl) {
  this.monitorControl = monitorControl;
  this.logPlayer = logPlayer;
  logPlayer.addListener(this);
  fileField = new TextField();
  fileField.setEditable(false);
  slider = new Slider();
  playTime = new Label();
  fontAwesome = GlyphFontRegistry.font("FontAwesome");
  pause = fontAwesome.create(FontAwesome.Glyph.PAUSE);
  play = fontAwesome.create(FontAwesome.Glyph.PLAY);
  playButton = new Button("", play);
  this.add(fileField, 0, 0);
  this.add(playButton, 1, 0);
  this.add(slider, 2, 0);
  this.add(playTime, 3, 0);
  super.fixColumnSizes(5, 25, 5, 55, 15);
  super.fixRowSizes(0, 100);
  slider.valueChangingProperty().addListener(new ChangeListener<Boolean>() {
    @Override
    public void changed(ObservableValue<? extends Boolean> observableValue,
        Boolean wasChanging, Boolean changing) {
      if (changing) {
        if (!computerChange) {
          humanSliderMovement = true;
        }
      } else {
        if (humanSliderMovement) {
          onSliderNewHumanValue();
          humanSliderMovement = false;
        }
      }
    }
  });
  playButton.setOnAction(new EventHandler<ActionEvent>() {
    @Override
    public void handle(ActionEvent e) {
      play();
    }
  });
}
 
开发者ID:BITPlan,项目名称:can4eve,代码行数:50,代码来源:SimulatorPane.java


示例14: getGlyphFont

import org.controlsfx.glyphfont.GlyphFontRegistry; //导入依赖的package包/类
@Bean
public GlyphFont getGlyphFont() {
	GlyphFont fontAwesome = GlyphFontRegistry.font("FontAwesome");
	return fontAwesome;
}
 
开发者ID:lewis007,项目名称:spring-boot-javafx,代码行数:6,代码来源:MainApplication.java


示例15: getGitIcon

import org.controlsfx.glyphfont.GlyphFontRegistry; //导入依赖的package包/类
private Glyph getGitIcon() {
    return GlyphFontRegistry.font("FontAwesome").create(FontAwesome.Glyph.GIT_SQUARE);
}
 
开发者ID:gluonhq,项目名称:gluon-samples,代码行数:4,代码来源:RepoManagerView.java


示例16: getIcon

import org.controlsfx.glyphfont.GlyphFontRegistry; //导入依赖的package包/类
public static Node getIcon(Octicons.Glyph iconType ) {
    Glyph icon = GlyphFontRegistry.font(Octicons.NAME).create(iconType).size(14);
    icon.getStyleClass().add("ref-icon");
    return icon;
}
 
开发者ID:gluonhq,项目名称:gluon-samples,代码行数:6,代码来源:UITools.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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