本文整理汇总了Java中de.jensd.fx.glyphs.fontawesome.FontAwesomeIconView类的典型用法代码示例。如果您正苦于以下问题:Java FontAwesomeIconView类的具体用法?Java FontAwesomeIconView怎么用?Java FontAwesomeIconView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FontAwesomeIconView类属于de.jensd.fx.glyphs.fontawesome包,在下文中一共展示了FontAwesomeIconView类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generateBrokenHeartImage
import de.jensd.fx.glyphs.fontawesome.FontAwesomeIconView; //导入依赖的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);
}
示例2: PhotoGridTile
import de.jensd.fx.glyphs.fontawesome.FontAwesomeIconView; //导入依赖的package包/类
public PhotoGridTile() {
getStyleClass().add("photo-tile");
overlay.getStyleClass().add("overlay");
setAlignment(overlay, Pos.BOTTOM_CENTER);
ratingIndicator.getStyleClass().add("rating");
ratingIndicator.setGraphic(ratingIndicatorIcon);
ratingIndicator.setTooltip(ratingIndicatorTooltip);
taggingIndicator.getStyleClass().add("tagging");
FontAwesomeIconView taggingIndicatorIcon = new FontAwesomeIconView();
taggingIndicatorIcon.setGlyphName("TAGS");
taggingIndicator.setGraphic(taggingIndicatorIcon);
taggingIndicator.setTooltip(taggingIndicatorTooltip);
dateLabel.getStyleClass().add("date");
getChildren().add(overlay);
overlay.setLeft(taggingIndicator);
overlay.setCenter(dateLabel);
overlay.setRight(ratingIndicator);
}
示例3: shouldResizeGlyphInGlyphButton
import de.jensd.fx.glyphs.fontawesome.FontAwesomeIconView; //导入依赖的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 ) );
}
示例4: initialize
import de.jensd.fx.glyphs.fontawesome.FontAwesomeIconView; //导入依赖的package包/类
@FXML
@Override
public void initialize() {
super.initialize();
btnS3.setGraphic(new FontAwesomeIconView(FontAwesomeIcon.CLOUD_DOWNLOAD));
btnS3.setTooltip(new Tooltip("Load Files from S3"));
btnChartStacked.setGraphic(new FontAwesomeIconView(FontAwesomeIcon.BAR_CHART));
btnChartStacked.setTooltip(new Tooltip("Add Stacked Bar Chart"));
btnError.setTooltip(new Tooltip("Add Error Widget"));
btnError.setGraphic(new FontAwesomeIconView(FontAwesomeIcon.EXCLAMATION_TRIANGLE));
btnResource.setTooltip(new Tooltip("Add Resource Widget"));
btnResource.setGraphic(new FontAwesomeIconView(FontAwesomeIcon.SERVER));
btnSecurity.setGraphic(new FontAwesomeIconView(FontAwesomeIcon.SHIELD));
btnSecurity.setTooltip(new Tooltip("Add Security Widget"));
}
示例5: addString
import de.jensd.fx.glyphs.fontawesome.FontAwesomeIconView; //导入依赖的package包/类
/**
* Add a simple String to a wizard step.
*
* @param fieldName
* @param defaultValue
* the default String the textfield will contains.
* @param prompt
* the text to show on the textfield prompt String.
* @param isRequired
* set the field required to continue
* @return
*/
@SuppressWarnings("unchecked")
public WizardStepBuilder addString(final String fieldName, final String defaultValue, final String prompt,
final boolean isRequired)
{
final JFXTextField text = new JFXTextField();
text.setPromptText(prompt);
if (isRequired)
{
final RequiredFieldValidator validator = new RequiredFieldValidator();
validator.setMessage(Translation.LANG.getTranslation("wizard.error.input_required"));
validator.setIcon(GlyphsBuilder.create(FontAwesomeIconView.class).glyph(FontAwesomeIcon.WARNING).size("1em")
.styleClass("error").build());
text.getValidators().add(validator);
}
text.focusedProperty().addListener((o, oldVal, newVal) ->
{
if (!newVal)
text.validate();
});
text.setText(defaultValue);
this.current.getData().put(fieldName, new SimpleStringProperty());
this.current.getData().get(fieldName).bind(text.textProperty());
this.current.addToValidate(text);
final Label label = new Label(fieldName);
GridPane.setHalignment(label, HPos.RIGHT);
GridPane.setHalignment(text, HPos.LEFT);
this.current.add(label, 0, this.current.getData().size() - 1);
this.current.add(text, 1, this.current.getData().size() - 1);
return this;
}
示例6: addNumber
import de.jensd.fx.glyphs.fontawesome.FontAwesomeIconView; //导入依赖的package包/类
/**
* Add a number only textfield to a wizard step. A {@link NumberValitor}
* will be added to the textfield.
*
* @param fieldName
* @param defaultValue
* the default number value of the textfield.
* @param prompt
* the text to show on the textfield prompt String.
* @return
*/
@SuppressWarnings("unchecked")
public WizardStepBuilder addNumber(final String fieldName, final Integer defaultValue, final String prompt)
{
final JFXTextField text = new JFXTextField();
text.setPromptText(prompt);
final NumberValidator numberValidator = new NumberValidator();
numberValidator.setMessage(Translation.LANG.getTranslation("wizard.error.not_number"));
numberValidator.setIcon(GlyphsBuilder.create(FontAwesomeIconView.class).glyph(FontAwesomeIcon.WARNING)
.size("1em").styleClass("error").build());
text.getValidators().add(numberValidator);
text.setOnKeyReleased(e ->
{
if (!text.getText().equals(""))
text.validate();
});
text.setText(defaultValue.toString());
this.current.getData().put(fieldName, new SimpleStringProperty());
this.current.getData().get(fieldName).bind(text.textProperty());
this.current.addToValidate(text);
final Label label = new Label(fieldName);
GridPane.setHalignment(label, HPos.RIGHT);
GridPane.setHalignment(text, HPos.LEFT);
this.current.add(label, 0, this.current.getData().size() - 1);
this.current.add(text, 1, this.current.getData().size() - 1);
return this;
}
示例7: initMenu
import de.jensd.fx.glyphs.fontawesome.FontAwesomeIconView; //导入依赖的package包/类
private void initMenu() {
Menu fileMenu = new Menu(EditorConfig.MENU_FILE);
MenuItem openFile = new MenuItem(EditorConfig.MENU_FILE_OPEN);
FontAwesomeIconView openView = new FontAwesomeIconView(FontAwesomeIcon.FOLDER_OPEN);
openFile.setGraphic(openView);
MenuItem saveFile = new MenuItem(EditorConfig.MENU_FILE_SAVE);
FontAwesomeIconView saveView = new FontAwesomeIconView(FontAwesomeIcon.SAVE);
saveFile.setGraphic(saveView);
fileMenu.getItems().addAll(openFile, saveFile);
Menu toolMenu = new Menu(EditorConfig.MENU_TOOL);
MenuItem randomName = new MenuItem(EditorConfig.MENU_TOOL_RANDOM);
BooleanBinding when = new When(Bindings.createBooleanBinding(() -> torrentProperty.getValue() == null, torrentProperty)).then(true).otherwise(false);
randomName.disableProperty().bind(when);
saveFile.disableProperty().bind(when);
centerBtn.visibleProperty().bind(when);
fileTree.visibleProperty().bind(when.not());
toolMenu.getItems().add(randomName);
menuBar.setBackground(new Background(new BackgroundFill(Color.TRANSPARENT, null, null)));
menuBar.getMenus().addAll(fileMenu, toolMenu);
openFile.setOnAction(event -> openFile());
saveFile.setOnAction((event) -> saveFile());
randomName.setOnAction(event -> randomNameAll(itemRoot));
}
示例8: buildItemTree
import de.jensd.fx.glyphs.fontawesome.FontAwesomeIconView; //导入依赖的package包/类
/**
* 将文件树转换成FX中的TreeView的节点
*
* @param fileTree
*/
private TreeItem<FileTreeItemModel> buildItemTree(TreeNode<FileTreeItemModel> fileTree) {
TreeItem<FileTreeItemModel> root = new TreeItem<>(fileTree.getValue());
List<TreeItem<FileTreeItemModel>> collect = fileTree.getChildren().stream().map(this::buildItemTree).collect(Collectors.toList());
if (fileTree.isLeaf()) {
//TODO 支持更多文件类型图标显示
//TODO 研究,是否可以共享图标
root.setGraphic(new FontAwesomeIconView(FontAwesomeIcon.FILE_VIDEO_ALT));
} else {
root.setGraphic(new FontAwesomeIconView(FontAwesomeIcon.FOLDER));
}
root.getChildren().addAll(collect);
return root;
}
示例9: TabEntity
import de.jensd.fx.glyphs.fontawesome.FontAwesomeIconView; //导入依赖的package包/类
TabEntity() {
this.tab = new Tab();
this.manager = new CodeAreaManager(new CodeArea());
this.codeArea = manager.getCodeArea();
this.file = new SimpleObjectProperty<>();
this.name = new SimpleStringProperty();
this.icon = new FontAwesomeIconView();
this.order = new SimpleIntegerProperty(nameOrder.next());
init();
CacheUtil.cache(MainFrameController.this, tab, () -> this);
}
示例10: SpecificationTableView
import de.jensd.fx.glyphs.fontawesome.FontAwesomeIconView; //导入依赖的package包/类
/**
* Create a new SpecificationTableView from a given header label and a {@link TableView} of
* {@link HybridRow}s.
*
* @param tableView The underlying {@link TableView} of {@link HybridRow}s
*/
public SpecificationTableView(TableView<HybridRow> tableView) {
this.tableView = tableView;
setContent(content);
setText("Specification Table");
content.getChildren().addAll(toolbar, tableView);
VBox.setVgrow(tableView, Priority.ALWAYS);
tableView.getColumns().add(0, createIndexColumn());
ViewUtils.setupView(this);
// setOnMouseClicked(this::showInDialog);
Button btnOpenExternal = new Button();
btnOpenExternal.setGraphic(new FontAwesomeIconView(FontAwesomeIcon.EXTERNAL_LINK_SQUARE));
btnOpenExternal.setOnAction(this::showInDialog);
setGraphic(btnOpenExternal);
setContentDisplay(ContentDisplay.RIGHT);
btnResize.setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
btnCommentRow.setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
btnAddRows.setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
btnRemoveRows.setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
Region stretch = new Region();
HBox.setHgrow(stretch, Priority.ALWAYS);
toolbar.getItems().addAll(
// new Label("Column:"),
stretch, btnResize, btnCommentRow, btnAddRows, btnRemoveRows
);
}
示例11: PageSelector
import de.jensd.fx.glyphs.fontawesome.FontAwesomeIconView; //导入依赖的package包/类
public PageSelector() {
LOGGER.debug("instantiating");
getStyleClass().add("page-selector");
FontAwesomeIconView previousIcon = new FontAwesomeIconView();
previousIcon.setGlyphName("CHEVRON_LEFT");
previousButton.setGraphic(previousIcon);
Tooltip previousTooltip = new Tooltip();
previousTooltip.setText("Vorige Seite");
previousButton.setTooltip(previousTooltip);
previousButton.getStyleClass().addAll("nav-button");
previousButton.setOnAction(e -> previousPage());
previousButton.setMaxHeight(Double.MAX_VALUE);
HBox.setHgrow(previousButton, Priority.ALWAYS);
FontAwesomeIconView nextIcon = new FontAwesomeIconView();
nextIcon.setGlyphName("CHEVRON_RIGHT");
nextButton.setGraphic(nextIcon);
Tooltip nextTooltip = new Tooltip();
nextTooltip.setText("Nächste Seite");
nextButton.setTooltip(nextTooltip);
nextButton.getStyleClass().addAll("nav-button");
nextButton.setOnAction(e -> nextPage());
nextButton.setMaxHeight(Double.MAX_VALUE);
HBox.setHgrow(nextButton, Priority.ALWAYS);
getChildren().addAll(previousButton, buttonContainer, nextButton);
setPageCount(1);
setCurrentPage(0);
}
示例12: InspectorPaneSkin
import de.jensd.fx.glyphs.fontawesome.FontAwesomeIconView; //导入依赖的package包/类
public InspectorPaneSkin(InspectorPane control) {
super(control);
VBox placeholder = new VBox();
placeholder.setAlignment(Pos.CENTER);
FontAwesomeIconView placeholderIcon = new FontAwesomeIconView();
placeholderIcon.setGlyphName("CAMERA");
placeholder.getChildren().addAll(placeholderIcon, placeholderLabel);
selectionInfo.getStyleClass().add("selection-info");
selectionInfo.setAlignment(Pos.CENTER);
VBox.setVgrow(selectionInfoLabel, Priority.ALWAYS);
selectionInfo.getChildren().add(selectionInfoLabel);
header.getStyleClass().setAll("header");
body.getStyleClass().setAll("body");
body.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
body.setVbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED);
root.setPlaceholder(placeholder);
root.setContent(new VBox(header, body));
getChildren().add(root);
getSkinnable().headerProperty().addListener((observable, oldValue, newValue) -> update());
getSkinnable().bodyProperty().addListener((observable, oldValue, newValue) -> update());
getSkinnable().entityNameProperty().addListener((observable, oldValue, newValue) -> update());
getSkinnable().countProperty().addListener((observable, oldValue, newValue) -> update());
update();
}
示例13: finish
import de.jensd.fx.glyphs.fontawesome.FontAwesomeIconView; //导入依赖的package包/类
public void finish(boolean interrupted){
ft.stop();
borderPane.getChildren().clear();
HBox hBox = new HBox();
hBox.setPadding(new Insets(5.0,5.0,5.0,5.0));
hBox.setAlignment(Pos.CENTER);
if(!interrupted){
hBox.getChildren().add(new Label("Fotos heruntergeladen "));
hBox.getChildren().add(new FontAwesomeIconView(FontAwesomeIcon.CHECK));
}
else{
hBox.getChildren().add(new Label("Herunterladen fehlgeschlagen "));
hBox.getChildren().add(new FontAwesomeIconView(FontAwesomeIcon.TIMES));
}
borderPane.setCenter(hBox);
button.setOnMouseExited(e -> {
fadeOut();
button.setOnMouseEntered(null);
button.setOnMouseExited(null);
button.setTooltip(buttonTooltip);
button.getGraphic().setStyle(buttonStyle);
});
button.setOnAction(buttonOnAction);
}
示例14: FlickrImageTile
import de.jensd.fx.glyphs.fontawesome.FontAwesomeIconView; //导入依赖的package包/类
public FlickrImageTile(com.flickr4java.flickr.photos.Photo flickrPhoto) {
super();
this.flickrPhoto = flickrPhoto;
Image image = null;
try {
FileInputStream fis = new FileInputStream(new File(
Paths.get(tmpDir, flickrPhoto.getId() + "." + flickrPhoto.getOriginalFormat()).toString()));
image = new Image(fis, 150, 0, true, true);
fis.close();
} catch (FileNotFoundException ex) {
logger.error("Could not find photo", ex);
return;
} catch (IOException e) {
logger.error("Could not close fileinputstream", e);
}
ImageView imageView = new ImageView(image);
imageView.setFitWidth(150);
imageView.setFitHeight(150);
getChildren().add(imageView);
setAlignment(overlay, Pos.BOTTOM_CENTER);
FontAwesomeIconView checkIcon = new FontAwesomeIconView();
checkIcon.setGlyphName("CHECK");
checkIcon.setStyle("-fx-fill: white");
overlay.setAlignment(checkIcon, Pos.CENTER_RIGHT);
overlay.setStyle("-fx-background-color: -tmg-secondary; -fx-max-height: 20px;");
overlay.setBottom(checkIcon);
getChildren().add(overlay);
overlay.setVisible(false);
setOnMouseClicked(new EventHandler<MouseEvent>() {
@Override public void handle(MouseEvent event) {
if(!getSelectedProperty().getValue()){
select();
}
else{
deselect();
}
}
});
}
示例15: LogMessage
import de.jensd.fx.glyphs.fontawesome.FontAwesomeIconView; //导入依赖的package包/类
public LogMessage(LogLevel logLevel, String message) {
glyphIcon = new FontAwesomeIconView();
glyphIcon.setGlyphName(logLevel.getGlyphName());
glyphIcon.setGlyphSize(18);
glyphIcon.setStyleClass(logLevel.getStyleClass());
this.message = message;
}