本文整理汇总了Java中de.jensd.fx.glyphs.fontawesome.FontAwesomeIcon类的典型用法代码示例。如果您正苦于以下问题:Java FontAwesomeIcon类的具体用法?Java FontAwesomeIcon怎么用?Java FontAwesomeIcon使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FontAwesomeIcon类属于de.jensd.fx.glyphs.fontawesome包,在下文中一共展示了FontAwesomeIcon类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: WeekPage
import de.jensd.fx.glyphs.fontawesome.FontAwesomeIcon; //导入依赖的package包/类
/**
* Constructs a new week page.
*/
public WeekPage() {
getStyleClass().add("week-page"); //$NON-NLS-1$
setDateTimeFormatter(DateTimeFormatter.ofPattern(Messages.getString("WeekPage.DATE_FORMAT"))); //$NON-NLS-1$
this.detailedWeekView = new DetailedWeekView();
ToggleButton layoutButton = new ToggleButton();
layoutButton.setTooltip(new Tooltip(Messages.getString("WeekPage.TOOLTIP_LAYOUT"))); //$NON-NLS-1$
layoutButton.setId("layout-button");
Text layoutIcon = FontAwesomeIconFactory.get().createIcon(FontAwesomeIcon.TABLE);
layoutIcon.getStyleClass().addAll("button-icon", "layout-button-icon"); //$NON-NLS-1$ //$NON-NLS-2$
layoutButton.setGraphic(layoutIcon);
layoutButton.setSelected(getLayout().equals(Layout.SWIMLANE));
layoutButton.setOnAction(evt -> {
if (layoutButton.isSelected()) {
setLayout(Layout.SWIMLANE);
} else {
setLayout(Layout.STANDARD);
}
});
showLayoutButtonProperty().addListener(it -> updateToolBarControls(layoutButton));
updateToolBarControls(layoutButton);
}
示例2: generateBrokenHeartImage
import de.jensd.fx.glyphs.fontawesome.FontAwesomeIcon; //导入依赖的package包/类
private static Image generateBrokenHeartImage() {
FontAwesomeIconView newHeart = new FontAwesomeIconView(FontAwesomeIcon.HEART);
newHeart.setGlyphSize(graphicFontSize);
FontAwesomeIconView newBolt = new FontAwesomeIconView(FontAwesomeIcon.BOLT);
newBolt.setGlyphSize(graphicFontSize);
newBolt.setScaleX(0.65);
newBolt.setScaleY(0.65);
newBolt.setTranslateX(-1.0);
newHeart.setFill(brokenColor);
newBolt.setFill(Color.WHITE);
StackPane generated = new StackPane(
newHeart,
newBolt
);
StackPane.setAlignment(newBolt, Pos.CENTER);
StackPane.setAlignment(newHeart, Pos.CENTER);
generated.setBlendMode(BlendMode.MULTIPLY);
generated.setEffect(
new DropShadow(BlurType.GAUSSIAN, heartDefaultColor, 7.0, 0.25, 0.0, 0.0));
return CellUtils.makeSnapshotWithTransparency(generated);
}
示例3: addToolBar
import de.jensd.fx.glyphs.fontawesome.FontAwesomeIcon; //导入依赖的package包/类
private void addToolBar() {
TextField textField = new TextField();
textField.getStyleClass().add("search-field");
textField.textProperty().bindBidirectional(getSkinnable().filterTextProperty());
Text clearIcon = FontAwesomeIconFactory.get().createIcon(FontAwesomeIcon.TIMES_CIRCLE, "18");
CustomTextField customTextField = new CustomTextField();
customTextField.getStyleClass().add("search-field");
customTextField.setLeft(FontAwesomeIconFactory.get().createIcon(FontAwesomeIcon.SEARCH, "18px"));
customTextField.setRight(clearIcon);
customTextField.textProperty().bindBidirectional(getSkinnable().filterTextProperty());
clearIcon.setOnMouseClicked(evt -> customTextField.setText(""));
FlipPanel searchFlipPanel = new FlipPanel();
searchFlipPanel.setFlipDirection(Orientation.HORIZONTAL);
searchFlipPanel.getFront().getChildren().add(textField);
searchFlipPanel.getBack().getChildren().add(customTextField);
searchFlipPanel.visibleProperty().bind(getSkinnable().enableSortingAndFilteringProperty());
getSkinnable().useControlsFXProperty().addListener(it -> {
if (getSkinnable().isUseControlsFX()) {
searchFlipPanel.flipToBack();
} else {
searchFlipPanel.flipToFront();
}
});
showTrailerButton = new Button("Show Trailer");
showTrailerButton.getStyleClass().add("trailer-button");
showTrailerButton.setMaxHeight(Double.MAX_VALUE);
showTrailerButton.setOnAction(evt -> showTrailer());
BorderPane toolBar = new BorderPane();
toolBar.setLeft(showTrailerButton);
toolBar.setRight(searchFlipPanel);
toolBar.getStyleClass().add("movie-toolbar");
container.add(toolBar, 1, 0);
}
示例4: addTab
import de.jensd.fx.glyphs.fontawesome.FontAwesomeIcon; //导入依赖的package包/类
private SpecificationController addTab(HybridSpecification hybridSpecification, int index) {
final SpecificationController controller =
new SpecificationController(typeContext, ioVariables, hybridSpecification, this.state,
Bindings.isEmpty(scenario.getCode().syntaxErrorsProperty()).not(), globalConfig);
Tab tab = new Tab();
tab.setOnCloseRequest(e -> onTabCloseRequest(e, tab));
if (hybridSpecification.isEditable()) {
tab.setContextMenu(createTabContextMenu());
}
tab.textProperty().bind(hybridSpecification.nameProperty());
tab.setContent(controller.getView());
if (hybridSpecification.isEditable()) {
tab.setGraphic(GlyphsDude.createIcon(FontAwesomeIcon.EDIT));
} else {
tab.setGraphic(GlyphsDude.createIcon(FontAwesomeIcon.LOCK));
}
view.getTabs().add(index, tab);
controllers.put(tab, controller);
view.getTabPane().getSelectionModel().select(tab);
scenario.setActiveSpec(hybridSpecification);
return controller;
}
示例5: setIcons
import de.jensd.fx.glyphs.fontawesome.FontAwesomeIcon; //导入依赖的package包/类
private void setIcons()
{
newButton.setGraphic(GlyphsDude.createIcon(FontAwesomeIcon.PLUS_SQUARE, "16px"));
openButton.setGraphic(GlyphsDude.createIcon(FontAwesomeIcon.FOLDER_OPEN, "16px"));
saveButton.setGraphic(GlyphsDude.createIcon(FontAwesomeIcon.FLOPPY_ALT, "16px"));
removeButton.setGraphic(GlyphsDude.createIcon(FontAwesomeIcon.TRASH, "16px"));
cutButton.setGraphic(GlyphsDude.createIcon(FontAwesomeIcon.CUT, "16px"));
copyButton.setGraphic(GlyphsDude.createIcon(FontAwesomeIcon.COPY, "16px"));
pasteButton.setGraphic(GlyphsDude.createIcon(FontAwesomeIcon.PASTE, "16px"));
undoButton.setGraphic(GlyphsDude.createIcon(FontAwesomeIcon.UNDO, "16px"));
redoButton.setGraphic(GlyphsDude.createIcon(FontAwesomeIcon.REPEAT, "16px"));
dataMapButton.setGraphic(GlyphsDude.createIcon(FontAwesomeIcon.CUBES, "16px"));
dataNodeButton.setGraphic(GlyphsDude.createIcon(FontAwesomeIcon.SERVER, "16px"));
}
示例6: shouldResizeGlyphInGlyphButton
import de.jensd.fx.glyphs.fontawesome.FontAwesomeIcon; //导入依赖的package包/类
@Test public void shouldResizeGlyphInGlyphButton() throws InterruptedException{
GlyphIcon< ? > glyph = new FontAwesomeIconView( FontAwesomeIcon.ADJUST );
Button button = systemUnderTest.createGlyphButton( glyph );
button.setMaxSize( Double.MAX_VALUE, Double.MAX_VALUE );
TestApplication.launch( () -> new BorderPane( button ) );
assertThat( glyph.getGlyphSize(), is( 80.0 ) );
button.resize( 50, 50 );
assertThat( glyph.getGlyphSize(), is( 30.0 ) );
button.resize( 60, 70 );
assertThat( glyph.getGlyphSize(), is( 40.0 ) );
button.resize( 80, 55 );
assertThat( glyph.getGlyphSize(), is( 35.0 ) );
}
示例7: getStartButton
import de.jensd.fx.glyphs.fontawesome.FontAwesomeIcon; //导入依赖的package包/类
/**
*
* @return
*/
public Button getStartButton() {
if (startButton == null) {
startButton = GlyphsDude.createIconButton(FontAwesomeIcon.PLAY, "", "28", "0", ContentDisplay.CENTER);
startButton.getStyleClass().addAll("toolbar-button-transparent", "start", "dropshadow-1-5");
TooltipBuilder.create("Start Capture", startButton);
startButton.setOnAction((ActionEvent event) -> {
getStartButton().setDisable(true);
getStopButton().setDisable(false);
try {
GlobalScreen.addNativeKeyListener(getPrintScreenListener());
GlobalScreen.registerNativeHook();
} catch (NativeHookException ex) {
FxDialogs.showErrorDialog("There was a problem registering the native hook.");
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, "There was a problem registering the native hook.", ex);
}
});
}
return startButton;
}
示例8: getStopButton
import de.jensd.fx.glyphs.fontawesome.FontAwesomeIcon; //导入依赖的package包/类
/**
*
* @return
*/
public Button getStopButton() {
if (stopButton == null) {
stopButton = GlyphsDude.createIconButton(FontAwesomeIcon.STOP, "", "28", "0", ContentDisplay.CENTER);
stopButton.getStyleClass().addAll("toolbar-button-transparent", "stop", "dropshadow-1-5");
TooltipBuilder.create("Stop Capture", stopButton);
stopButton.setDisable(true);
stopButton.setOnAction((ActionEvent event) -> {
getStopButton().setDisable(true);
getStartButton().setDisable(false);
try {
GlobalScreen.removeNativeKeyListener(getPrintScreenListener());
GlobalScreen.unregisterNativeHook();
} catch (NativeHookException ex) {
FxDialogs.showErrorDialog("There was a problem registering the native hook.");
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, "There was a problem registering the native hook.", ex);
}
});
}
return stopButton;
}
示例9: getUploadButton
import de.jensd.fx.glyphs.fontawesome.FontAwesomeIcon; //导入依赖的package包/类
/**
*
* @return
*/
public Button getUploadButton() {
if (uploadButton == null) {
uploadButton = GlyphsDude.createIconButton(FontAwesomeIcon.CLOUD_UPLOAD, "upload image", "24", "15", ContentDisplay.LEFT);
uploadButton.getStyleClass().add("upload-button");
uploadButton.setDisable(true);
// uploadButton.disableProperty().bind(getImageTable().getSelectionModel().selectedItemProperty().isNull());
uploadButton.setOnAction((ActionEvent event) -> {
ImageEN image = getImageTable().getSelectionModel().getSelectedItem();
if (image == null) {
return;
}
doImageUpload(image);
});
}
return uploadButton;
}
示例10: fillTreeTableView
import de.jensd.fx.glyphs.fontawesome.FontAwesomeIcon; //导入依赖的package包/类
private void fillTreeTableView() {
labelColumn.setCellValueFactory(new MethodRefCellValueFactory<>((unit) -> unit.getUnit().getLabel(), labelColumn));
descColumn.setCellValueFactory(new MethodRefCellValueFactory<>((unit) -> unit.getUnit().getDescription(), descColumn));
typeColumn.setCellValueFactory(new MethodRefCellValueFactory<>((unit) -> unit.getUnit().getType().name(), typeColumn));
RecursiveTreeItem<RecursiveUnitConfig> item = new RecursiveTreeItem<>(list, RecursiveTreeObject::getChildren);
unitsTable.setRoot(item);
unitsTable.getSelectionModel()
.selectedItemProperty()
.addListener(this::onSelectionChange);
filterInput.setRight(new SVGIcon(FontAwesomeIcon.SEARCH, Constants.EXTRA_SMALL_ICON, true));
filterInput.promptTextProperty().setValue(new ObserverLabel("searchPlaceholder").getText());
filterInput.textProperty().addListener((o, oldVal, newVal) -> {
unitsTable.setPredicate(
user -> user.getValue().getUnit().getLabel().toLowerCase().contains(newVal.toLowerCase())
|| user.getValue().getUnit().getDescription().toLowerCase().contains(newVal.toLowerCase())
|| user.getValue().getUnit().getType().name().toLowerCase().contains(newVal.toLowerCase()));
});
}
示例11: handleAddButton
import de.jensd.fx.glyphs.fontawesome.FontAwesomeIcon; //导入依赖的package包/类
public void handleAddButton() {
String fileName = fileField.getText();
// Don't allow adding the same file more than once
if (fileNames.contains(fileName)) {
notificationPaneController.addNotification(fileName+" has already been added.");
return;
}
if(!fileName.equals("")){
Label line = new Label(fileName);
line.setWrapText(true);
line.setId("notification");
line.setGraphic(GlyphsDude.createIcon(FontAwesomeIcon.TIMES_CIRCLE));
line.setOnMouseClicked(event -> {
if (event.getTarget().equals(line.getGraphic()))
fileNames.remove(fileName);
filesToCheckout.getChildren().remove(line);
});
fileNames.add(fileName);
filesToCheckout.getChildren().add(0,line);
}else {
notificationPaneController.addNotification("You need to type a file name first");
return;
}
}
示例12: initialize
import de.jensd.fx.glyphs.fontawesome.FontAwesomeIcon; //导入依赖的package包/类
public void initialize() {
commitInfoNameCopyButton.setMinSize(Control.USE_PREF_SIZE, Control.USE_PREF_SIZE);
commitInfoGoToButton.setMinSize(Control.USE_PREF_SIZE, Control.USE_PREF_SIZE);
Text clipboardIcon = GlyphsDude.createIcon(FontAwesomeIcon.CLIPBOARD);
this.commitInfoNameCopyButton.setGraphic(clipboardIcon);
Text goToIcon = GlyphsDude.createIcon(FontAwesomeIcon.ARROW_CIRCLE_LEFT);
this.commitInfoGoToButton.setGraphic(goToIcon);
this.commitInfoGoToButton.setTooltip(new Tooltip(
"Go to selected commit"
));
this.commitInfoNameCopyButton.setTooltip(new Tooltip(
"Copy commit ID"
));
}
示例13: initialize
import de.jensd.fx.glyphs.fontawesome.FontAwesomeIcon; //导入依赖的package包/类
public void initialize() {
openRepoDirButton.setMinSize(Control.USE_PREF_SIZE, Control.USE_PREF_SIZE);
Text openExternallyIcon = GlyphsDude.createIcon(FontAwesomeIcon.EXTERNAL_LINK);
this.openRepoDirButton.setGraphic(openExternallyIcon);
this.openRepoDirButton.setTooltip(new Tooltip("Open repository directory"));
final int REPO_DROPDOWN_MAX_WIDTH = 147;
repoDropdownSelector.setMaxWidth(REPO_DROPDOWN_MAX_WIDTH);
Text plusIcon = GlyphsDude.createIcon(FontAwesomeIcon.PLUS);
this.loadNewRepoButton.setGraphic(plusIcon);
Text minusIcon = GlyphsDude.createIcon(FontAwesomeIcon.MINUS);
this.removeRecentReposButton.setGraphic(minusIcon);
this.removeRecentReposButton.setTooltip(new Tooltip("Clear shortcuts to recently opened repos"));
Text downloadIcon = GlyphsDude.createIcon(FontAwesomeIcon.CLOUD_DOWNLOAD);
cloneOption.setGraphic(downloadIcon);
Text folderOpenIcon = GlyphsDude.createIcon(FontAwesomeIcon.FOLDER_OPEN);
existingOption.setGraphic(folderOpenIcon);
}
示例14: bindToTwitchChannel
import de.jensd.fx.glyphs.fontawesome.FontAwesomeIcon; //导入依赖的package包/类
private void bindToTwitchChannel(final TwitchChannel selectedChannel) {
this.previewImageView.imageProperty().bind((selectedChannel).getPreviewImageLarge());
this.channelDescription.textProperty().bind((selectedChannel).getTitle());
this.channelUptime.textProperty().bind((selectedChannel).getUptimeString());
this.channelUptime.setGraphic(GlyphsDude.createIcon(FontAwesomeIcon.CLOCK_ALT));
this.channelViewers.textProperty().bind((selectedChannel).getViewersString());
this.channelViewers.setGraphic(GlyphsDude.createIcon(FontAwesomeIcon.USER));
this.channelGame.textProperty().bind((selectedChannel).getGame());
this.channelGame.setGraphic(GlyphsDude.createIcon(FontAwesomeIcon.GAMEPAD));
this.openChatButton.setDisable(false);
this.openChatInBrowserButton.setDisable(false);
this.openInBrowserButton.setDisable(false);
this.startStreamButton.disableProperty()
.bind(selectedChannel.isOnline().not().or(selectedChannel.getIsPlaylist()));
this.recordStreamButton.disableProperty()
.bind(selectedChannel.isOnline().not().or(selectedChannel.getIsPlaylist()));
}
示例15: createMainMenuButtton
import de.jensd.fx.glyphs.fontawesome.FontAwesomeIcon; //导入依赖的package包/类
private JFXButton createMainMenuButtton() {
// TODO find out why this does not work:
// RfxPrimaryButton mainMenuButton = new
// RfxPrimaryButton(FontAwesomeIconName.BARS);
// mainMenuButton.setOnAction(this::onMainMenuButton);
// return mainMenuButton;
JFXButton button = new JFXButton();
FontAwesomeIcon icon = new FontAwesomeIcon();
icon.setIcon(de.jensd.fx.glyphs.fontawesome.FontAwesomeIconName.BARS);
icon.setSize("17px");
String iconStyle = icon.getStyle() + ";" + new RfxStyleProperties()
.setFill(MaterialColorSetCssName.PRIMARY.FOREGROUND1()).toString();
icon.setStyle(iconStyle);
// RfxFontIcon icon=new RfxFontIcon(FontAwesomeIconName.BARS, 16,
// Color.WHITE);
button.setGraphic(icon);
button.setPadding(new Insets(8, 16, 8, 17));
// button.getStyleClass().add("button-flat");
button.setOnAction(this::onMainMenuButton);
return button;
}