本文整理汇总了Java中de.jensd.fx.glyphs.GlyphsDude.setIcon方法的典型用法代码示例。如果您正苦于以下问题:Java GlyphsDude.setIcon方法的具体用法?Java GlyphsDude.setIcon怎么用?Java GlyphsDude.setIcon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类de.jensd.fx.glyphs.GlyphsDude
的用法示例。
在下文中一共展示了GlyphsDude.setIcon方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createMenubar
import de.jensd.fx.glyphs.GlyphsDude; //导入方法依赖的package包/类
/**
* creates the menu bar, probably not much use...
* @return MenuBar
*/
private MenuBar createMenubar() {
MenuBar menuBar = new MenuBar();
MenuItem openItem = new MenuItem("Open");
GlyphsDude.setIcon(openItem, FontAwesomeIcon.FILE);
MenuItem saveItem = new MenuItem("Save");
GlyphsDude.setIcon(saveItem, FontAwesomeIcon.DOWNLOAD);
MenuItem saveAsItem = new MenuItem("Save As...");
GlyphsDude.setIcon(saveAsItem, FontAwesomeIcon.DOWNLOAD);
MenuItem exitItem = new MenuItem("Exit");
GlyphsDude.setIcon(exitItem, FontAwesomeIcon.SIGN_OUT);
Menu menuFile = new Menu("File");
menuFile.getItems().add(openItem);
menuFile.getItems().add(saveItem);
menuFile.getItems().add(saveAsItem);
menuFile.getItems().add(new SeparatorMenuItem());
menuFile.getItems().add(exitItem);
Menu menuEdit = new Menu("Edit");
Menu menuView = new Menu("View");
menuBar.getMenus().addAll(menuFile, menuEdit, menuView);
return menuBar;
}
示例2: urlButton
import de.jensd.fx.glyphs.GlyphsDude; //导入方法依赖的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;
}
示例3: RunButton
import de.jensd.fx.glyphs.GlyphsDude; //导入方法依赖的package包/类
public RunButton() {
getStyleClass().addAll(Style.FOOTER_BUTTON.css());
setText(DefaultI18nContext.getInstance().i18n("Run"));
GlyphsDude.setIcon(this, MaterialDesignIcon.PLAY, "2.0em");
setMaxHeight(Double.MAX_VALUE);
setPrefHeight(Double.MAX_VALUE);
setDefaultButton(true);
eventStudio().addAnnotatedListeners(this);
}
示例4: TaskFailedButton
import de.jensd.fx.glyphs.GlyphsDude; //导入方法依赖的package包/类
public TaskFailedButton() {
getStyleClass().addAll(Style.FOOTER_BUTTON.css());
getStyleClass().add("footer-failed-button");
setText(DefaultI18nContext.getInstance().i18n("Show errors"));
GlyphsDude.setIcon(this, FontAwesomeIcon.TIMES_CIRCLE, "1.6em");
setMaxHeight(Double.MAX_VALUE);
setPrefHeight(Double.MAX_VALUE);
setOnAction(e -> eventStudio().broadcast(ShowStageRequest.INSTANCE, "LogStage"));
}
示例5: accept
import de.jensd.fx.glyphs.GlyphsDude; //导入方法依赖的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);
}
}
示例6: initialize
import de.jensd.fx.glyphs.GlyphsDude; //导入方法依赖的package包/类
@Override
public void initialize(URL arg0, ResourceBundle arg1) {
GlyphsDude.setIcon(createProfileButton, FontAwesomeIcon.PLUS);
GlyphsDude.setIcon(deleteProfileButton, FontAwesomeIcon.TRASH);
GlyphsDude.setIcon(editProfileButton, FontAwesomeIcon.PENCIL);
GlyphsDude.setIcon(settingsButton, FontAwesomeIcon.COG);
GlyphsDude.setIcon(loadProfileButton, FontAwesomeIcon.SIGN_IN);
profileListView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
profileListView.setCellFactory(new Callback<ListView<Profile>, ListCell<Profile>>() {
@Override
public ListCell<Profile> call(ListView<Profile> p) {
ListCell<Profile> cell = new ListCell<Profile>() {
@Override
protected void updateItem(Profile t, boolean bln) {
super.updateItem(t, bln);
if (t != null) {
setText(t.getRegion().region + " - " + t.getName());
} else {
setText("");
}
}
};
return cell;
}
});
profileListView.itemsProperty().bind(loadProfileModel.getProfilesProperty());
// Set actions
createProfileButton.setOnAction(e -> createProfile());
deleteProfileButton.setOnAction(e -> deleteProfile());
editProfileButton.setOnAction(e -> editProfile());
settingsButton.setOnAction(e -> settingsWindow());
loadProfileButton.setOnAction(e -> loadProfile());
}
示例7: setDefaultButtonIcon
import de.jensd.fx.glyphs.GlyphsDude; //导入方法依赖的package包/类
public static void setDefaultButtonIcon(Button button, GlyphIcons icon) {
GlyphsDude.setIcon(button, icon, iconSize(_buttonDefaultIconSize), ContentDisplay.GRAPHIC_ONLY);
fixButtonSize(button, _buttonDefaultIconSize);
}
示例8: setPaginationButtonIcon
import de.jensd.fx.glyphs.GlyphsDude; //导入方法依赖的package包/类
public static void setPaginationButtonIcon(Button button, GlyphIcons icon) {
GlyphsDude.setIcon(button, icon, iconSize(_buttonPaginationIconSize), ContentDisplay.GRAPHIC_ONLY);
fixButtonSize(button, _buttonPaginationIconSize);
}
示例9: setTitledPaneIcon
import de.jensd.fx.glyphs.GlyphsDude; //导入方法依赖的package包/类
public static void setTitledPaneIcon(TitledPane titledPane, GlyphIcons icon) {
GlyphsDude.setIcon(titledPane, icon, iconSize(_titledPaneDefaultIconSize), ContentDisplay.LEFT);
}
示例10: AboutDashboardPane
import de.jensd.fx.glyphs.GlyphsDude; //导入方法依赖的package包/类
@Inject
public AboutDashboardPane(Pdfsam pdfsam) {
getStyleClass().add("dashboard-container");
VBox left = new VBox(5);
addSectionTitle(pdfsam.name(), left);
Label copyright = new Label(pdfsam.property(COPYRIGHT));
GlyphsDude.setIcon(copyright, FontAwesomeIcon.COPYRIGHT);
left.getChildren().addAll(new Label(String.format("ver. %s", pdfsam.property(VERSION))), copyright);
addHyperlink(null, pdfsam.property(LICENSE_URL), pdfsam.property(LICENSE_NAME), left);
addHyperlink(FontAwesomeIcon.HOME, pdfsam.property(HOME_URL), pdfsam.property(HOME_LABEL), left);
addHyperlink(FontAwesomeIcon.RSS_SQUARE, pdfsam.property(FEED_URL),
DefaultI18nContext.getInstance().i18n("Subscribe to the official news feed"), left);
addSectionTitle(DefaultI18nContext.getInstance().i18n("Environment"), left);
Label runtime = new Label(String.format("%s %s", System.getProperty("java.runtime.name"),
System.getProperty("java.runtime.version")));
Label memory = new Label(DefaultI18nContext.getInstance().i18n("Max memory {0}",
FileUtils.byteCountToDisplaySize(Runtime.getRuntime().maxMemory())));
Button copyButton = new Button(DefaultI18nContext.getInstance().i18n("Copy to clipboard"));
GlyphsDude.setIcon(copyButton, FontAwesomeIcon.COPY);
copyButton.getStyleClass().addAll(Style.BUTTON.css());
copyButton.setId("copyEnvDetails");
copyButton.setOnAction(a -> {
ClipboardContent content = new ClipboardContent();
writeContent(Arrays.asList(pdfsam.name(), pdfsam.property(VERSION), runtime.getText(), memory.getText()))
.to(content);
Clipboard.getSystemClipboard().setContent(content);
});
left.getChildren().addAll(runtime, memory, copyButton);
VBox right = new VBox(5);
addSectionTitle(DefaultI18nContext.getInstance().i18n("Support"), right);
addHyperlink(FontAwesomeIcon.BUG, pdfsam.property(TRACKER_URL),
DefaultI18nContext.getInstance().i18n("Bug and feature requests"), right);
addHyperlink(FontAwesomeIcon.QUESTION_CIRCLE, pdfsam.property(SUPPORT_URL),
DefaultI18nContext.getInstance().i18n("Support"), right);
addHyperlink(FontAwesomeIcon.BOOK, pdfsam.property(DOCUMENTATION_URL),
DefaultI18nContext.getInstance().i18n("Documentation"), right);
addSectionTitle(DefaultI18nContext.getInstance().i18n("Contribute"), right);
addHyperlink(FontAwesomeIcon.GITHUB, pdfsam.property(SCM_URL),
DefaultI18nContext.getInstance().i18n("Fork PDFsam on GitHub"), right);
addHyperlink(FontAwesomeIcon.FLAG_ALT, pdfsam.property(TRANSLATE_URL),
DefaultI18nContext.getInstance().i18n("Translate"), right);
addHyperlink(FontAwesomeIcon.DOLLAR, pdfsam.property(DONATE_URL),
DefaultI18nContext.getInstance().i18n("Donate"), right);
addSectionTitle(DefaultI18nContext.getInstance().i18n("Social"), right);
addHyperlink(FontAwesomeIcon.TWITTER_SQUARE, pdfsam.property(TWITTER_URL),
DefaultI18nContext.getInstance().i18n("Follow us on Twitter"), right);
addHyperlink(FontAwesomeIcon.GOOGLE_PLUS_SQUARE, pdfsam.property(GPLUS_URL),
DefaultI18nContext.getInstance().i18n("Follow us on Google Plus"), right);
addHyperlink(FontAwesomeIcon.FACEBOOK_SQUARE, pdfsam.property(FACEBOOK_URL),
DefaultI18nContext.getInstance().i18n("Like us on Facebook"), right);
getChildren().addAll(left, right);
}
示例11: createMenuItem
import de.jensd.fx.glyphs.GlyphsDude; //导入方法依赖的package包/类
private MenuItem createMenuItem(String text, GlyphIcons icon) {
MenuItem item = new MenuItem(text);
GlyphsDude.setIcon(item, icon, "1.1em");
item.setDisable(true);
return item;
}