本文整理汇总了Java中org.controlsfx.glyphfont.GlyphFontRegistry类的典型用法代码示例。如果您正苦于以下问题:Java GlyphFontRegistry类的具体用法?Java GlyphFontRegistry怎么用?Java GlyphFontRegistry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GlyphFontRegistry类属于org.controlsfx.glyphfont包,在下文中一共展示了GlyphFontRegistry类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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);
}
示例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);
}
}
}
}
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}
});
}
示例14: getGlyphFont
import org.controlsfx.glyphfont.GlyphFontRegistry; //导入依赖的package包/类
@Bean
public GlyphFont getGlyphFont() {
GlyphFont fontAwesome = GlyphFontRegistry.font("FontAwesome");
return fontAwesome;
}
示例15: getGitIcon
import org.controlsfx.glyphfont.GlyphFontRegistry; //导入依赖的package包/类
private Glyph getGitIcon() {
return GlyphFontRegistry.font("FontAwesome").create(FontAwesome.Glyph.GIT_SQUARE);
}