本文整理汇总了Java中org.controlsfx.glyphfont.GlyphFontRegistry.register方法的典型用法代码示例。如果您正苦于以下问题:Java GlyphFontRegistry.register方法的具体用法?Java GlyphFontRegistry.register怎么用?Java GlyphFontRegistry.register使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.controlsfx.glyphfont.GlyphFontRegistry
的用法示例。
在下文中一共展示了GlyphFontRegistry.register方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
示例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();
}
}
示例3: 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;
}
示例4: 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);
}
}