本文整理汇总了Java中de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIcon类的典型用法代码示例。如果您正苦于以下问题:Java MaterialDesignIcon类的具体用法?Java MaterialDesignIcon怎么用?Java MaterialDesignIcon使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MaterialDesignIcon类属于de.jensd.fx.glyphs.materialdesignicons包,在下文中一共展示了MaterialDesignIcon类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setState
import de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIcon; //导入依赖的package包/类
/**
* GUI Method to switch the displayed panes.
*
* @param state A state from the defined Enum
*/
public void setState(final State state) {
switch (state) {
case LOGINACTIVE:
this.getChildren().clear();
this.getChildren().addAll(loginLayout);
this.statusIcon.getChildren().clear();
this.statusIcon.getChildren().addAll(new SVGIcon(MaterialDesignIcon.LOGIN, Constants.MIDDLE_ICON,
true));
break;
case LOGOUT:
this.getChildren().clear();
this.getChildren().addAll(logoutLayout);
this.statusIcon.getChildren().clear();
this.statusIcon.getChildren().addAll(new SVGIcon(MaterialDesignIcon.LOGOUT, Constants.MIDDLE_ICON,
true));
break;
}
}
示例2: setupTable
import de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIcon; //导入依赖的package包/类
private void setupTable() {
colFile.setCellValueFactory(cellData -> cellData.getValue().getFile());
colMessage.setCellValueFactory(cellData -> cellData.getValue().getMessage());
colStatus.setCellValueFactory(cellData -> cellData.getValue().getIcon());
colFile.setCellFactory(new ValueTableCellFactory<CopyFilesResultItemViewModel, String>().withText(item -> item).withTooltip(item -> item));
colStatus.setCellFactory(new ValueTableCellFactory<CopyFilesResultItemViewModel, MaterialDesignIcon>().withGraphic(item -> {
Text icon = MaterialDesignIconFactory.get().createIcon(item);
if (item == MaterialDesignIcon.CHECK) {
icon.setFill(Color.GREEN);
}
if (item == MaterialDesignIcon.ALERT) {
icon.setFill(Color.RED);
}
return icon;
}));
tvResult.setItems(viewModel.copyFilesResultListProperty());
tvResult.setColumnResizePolicy((param) -> true);
}
示例3: resolve
import de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIcon; //导入依赖的package包/类
@Override
public GlyphIcons resolve(final String fontIconName) {
final ObservableList<GlyphIcons> glyphIcons = FXCollections.observableArrayList();
glyphIcons.addAll(MaterialDesignIcon.values());
final Optional<GlyphIcons> oGlyphIcons = glyphIcons
.stream()
.filter((gi) -> gi.name().equals(fontIconName) )
.findFirst();
if (oGlyphIcons.isPresent()) {
return oGlyphIcons.get();
}
return null;
}
示例4: testGlyphIconsIsFound
import de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIcon; //导入依赖的package包/类
@Test
public void testGlyphIconsIsFound() {
final String fontIconName = "ACCOUNT_ALERT";
final GlyphIcons actualGlyphIcons = handler.resolve(fontIconName);
assertNotNull("actualGlyphIcons can't be NULL", actualGlyphIcons);
final GlyphIcons expectedGlyphIcons = MaterialDesignIcon.ACCOUNT_ALERT;
assertEquals("actualGlyphIcons.ACCOUNT_ALERT must be MaterialDesignIcon.ACCOUNT_ALERT", expectedGlyphIcons, actualGlyphIcons);
}
示例5: makeIcon
import de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIcon; //导入依赖的package包/类
/**
* Create icon for whatever, sized for zest writer menu
* @param type code name of material design icon
* @param cssClass css class for override standard
* @return material icon
*/
public static MaterialDesignIconView makeIcon(MaterialDesignIcon type, String cssClass) {
MaterialDesignIconView icon = new MaterialDesignIconView(type);
icon.setSize("1.8em");
icon.setStyleClass(cssClass);
return icon;
}
示例6: setFoundIcon
import de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIcon; //导入依赖的package包/类
private void setFoundIcon(CacheListEntry cache) {
if (cache.getFound()) {
foundIcon.setText(MaterialDesignIcon.CHECK.characterToString());
} else {
foundIcon.setText("");
}
}
示例7: setLogLinkButton
import de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIcon; //导入依赖的package包/类
private void setLogLinkButton() {
Button logLink = MaterialDesignIconFactory.get().createIconButton(MaterialDesignIcon.LINK_VARIANT);
logLink.setStyle("-fx-background-color: transparent;");
logButtonPane.getChildren().add(logLink);
logLink.setOnAction(event -> {
Cache cache = (Cache) sessionContext.getData(CURRENT_CACHE);
if (cache != null) {
showLogPopOver(logLink, cache);
}
});
}
示例8: createPalette
import de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIcon; //导入依赖的package包/类
private Text createPalette(String styleClass) {
Text t = GlyphsDude.createIcon(MaterialDesignIcon.PALETTE);
if (styleClass != null) {
t.getStyleClass().add(styleClass);
}
return t;
}
示例9: CenterPane
import de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIcon; //导入依赖的package包/类
/**
* Constructor for the center pane.
*/
public CenterPane(final double height, final ForegroundPane foregroundPane) {
this.foregroundPane = foregroundPane;
appStateProperty = new SimpleObjectProperty<>(CenterPaneController.State.MOVEMENT);
// Initializing components
this.settingsMenu = loadSettingsMenu(height);
// Initializing view mode switch
final FloatingPopUp viewModes = new FloatingPopUp(Pos.BOTTOM_RIGHT);
viewModes.addParentElement(MaterialIcon.WEEKEND, () -> {
appStateProperty.set(CenterPaneController.State.MOVEMENT);
});
viewModes.addElement(MaterialDesignIcon.THERMOMETER_LINES, () -> {
appStateProperty.set(CenterPaneController.State.TEMPERATURE);
});
viewModes.addElement(MaterialIcon.VISIBILITY, () -> {
appStateProperty.set(CenterPaneController.State.SETTINGS);
});
//final FloatingButton settingsBtn = new FloatingButton(new SVGIcon(MaterialDesignIcon.SETTINGS, Constants.MIDDLE_ICON, true));
//this.setAlignment(settingsBtn, Pos.TOP_RIGHT);
//settingsBtn.setOnAction(e -> toggleSettings());
// Styling components with CSS
this.getStyleClass().addAll("padding-small");
this.setPickOnBounds(false);
this.getChildren().addAll(viewModes);
this.setMinHeight(height);
this.setPrefHeight(height);
}
示例10: updateDynamicContent
import de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIcon; //导入依赖的package包/类
@Override
public void updateDynamicContent() {
super.updateDynamicContent();
try {
switch (getUnitRemote().getData().getContactState().getValue()) {
case CLOSED:
setIcon(MaterialIcon.RADIO_BUTTON_CHECKED, MaterialIcon.LENS);
getIcon().setForegroundIconColor(Color.BLACK);
getIcon().setBackgroundIconColor(Color.WHITE);
break;
case OPEN:
setIcon(MaterialIcon.RADIO_BUTTON_UNCHECKED, MaterialIcon.LENS);
getIcon().setForegroundIconColor(Color.BLACK);
getIcon().setBackgroundIconColor(Color.WHITE);
break;
case UNKNOWN:
default:
setIcon(MaterialDesignIcon.HELP_CIRCLE, MaterialDesignIcon.CHECKBOX_BLANK_CIRCLE);
getIcon().setForegroundIconColor(Color.ORANGE);
getIcon().setBackgroundIconColor(Color.BLACK);
break;
}
} catch (CouldNotPerformException ex) {
setIcon(MaterialDesignIcon.HELP_CIRCLE, MaterialDesignIcon.CHECKBOX_BLANK_CIRCLE);
getIcon().setForegroundIconColor(Color.RED);
getIcon().setBackgroundIconColor(Color.BLACK);
}
}
示例11: updateDynamicContent
import de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIcon; //导入依赖的package包/类
@Override
public void updateDynamicContent() {
super.updateDynamicContent();
State state = State.UNKNOWN;
try {
state = getUnitRemote().getData().getTamperState().getValue();
} catch (CouldNotPerformException ex) {
ExceptionPrinter.printHistory(ex, LOGGER, LogLevel.DEBUG);
}
switch (state) {
case NO_TAMPER:
getIcon().setForegroundIcon(MaterialDesignIcon.CHECKBOX_MARKED_CIRCLE_OUTLINE);
setInfoText("noTamper");
break;
case TAMPER:
getIcon().setForegroundIcon(MaterialDesignIcon.ALERT_CIRCLE, Color.RED);
getIcon().startForegroundIconColorFadeAnimation(Animation.INDEFINITE);
setInfoText("tamper");
break;
default:
setInfoText("unknown");
break;
}
}
示例12: AvailableUsersPane
import de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIcon; //导入依赖的package包/类
/**
* Constructor for the AvailableUsersPane.
*/
public AvailableUsersPane() {
searchField = new CustomTextField();
searchField.setRight(new SVGIcon(FontAwesomeIcon.SEARCH, Constants.EXTRA_SMALL_ICON, true));
searchField.textProperty().addListener((observable, oldValue, newValue) -> search(newValue));
userPanes = new VBox(Constants.INSETS);
statusIcon = new BorderPane(new SVGIcon(MaterialDesignIcon.ACCOUNT_CIRCLE, Constants.MIDDLE_ICON, true));
final ScrollPane verticalScrollPane = new ScrollPane();
verticalScrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
verticalScrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
final ScrollBar scrollBar = new ScrollBar();
scrollBar.setOrientation(Orientation.VERTICAL);
this.hiddenSidesPane = new HiddenSidesPane();
hiddenSidesPane.setContent(verticalScrollPane);
hiddenSidesPane.setRight(scrollBar);
//hiddenSidesPane.setTriggerDistance(Constants.TRIGGER_DISTANCE);
scrollBar.maxProperty().bind(verticalScrollPane.vmaxProperty());
scrollBar.minProperty().bind(verticalScrollPane.vminProperty());
verticalScrollPane.setContent(userPanes);
verticalScrollPane.setFitToWidth(true);
enableSearchField(false);
hoverProperty().addListener((observable, oldValue, newValue) -> {
enableSearchField(newValue);
});
}
示例13: start
import de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIcon; //导入依赖的package包/类
@Override
public void start(Stage primaryStage) throws Exception {
BorderPane pane = new BorderPane();
Scene scene = new Scene(pane, 300, 300);
primaryStage.setScene(scene);
/*
CenterPane centerPane = new CenterPane();
pane.setCenter(centerPane);
centerPane.setViewSwitchingButtonsVisible(true);
new CenterPaneController(centerPane);
*/
popUp = new FloatingPopUp(Pos.TOP_CENTER);
popUp.addParentElement(MaterialIcon.SETTINGS, this::setMaximizeAction);
popUp.addElement(MaterialDesignIcon.THERMOMETER_LINES, this::setMaximizeAction);
popUp.addElement(MaterialIcon.VISIBILITY, this::setMaximizeAction);
popUp.addElement(MaterialIcon.ACCESS_ALARM, event -> System.out.println("ACCESS_ALARM"));
pane.setLeft(popUp);
popUp = new FloatingPopUp(Pos.TOP_CENTER);
popUp.addElement(MaterialIcon.FULLSCREEN, this::setMaximizeAction);
popUp.addParentElement(MaterialIcon.FULLSCREEN_EXIT, this::setMaximizeAction);
pane.setRight(popUp);
primaryStage.show();
}
示例14: createFileDisplay
import de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIcon; //导入依赖的package包/类
private static Node createFileDisplay(LinkedFileViewModel linkedFile) {
Text icon = MaterialDesignIconFactory.get().createIcon(linkedFile.getTypeIcon());
icon.setOnMouseClicked(event -> linkedFile.open());
Text link = new Text(linkedFile.getLink());
Text desc = new Text(linkedFile.getDescription());
ProgressBar progressIndicator = new ProgressBar();
progressIndicator.progressProperty().bind(linkedFile.downloadProgressProperty());
progressIndicator.visibleProperty().bind(linkedFile.downloadOngoingProperty());
Button acceptAutoLinkedFile = MaterialDesignIconFactory.get().createIconButton(MaterialDesignIcon.BRIEFCASE_CHECK);
acceptAutoLinkedFile.setTooltip(new Tooltip(Localization.lang("This file was found automatically. Do you want to link it to this entry?")));
acceptAutoLinkedFile.visibleProperty().bind(linkedFile.isAutomaticallyFoundProperty());
acceptAutoLinkedFile.setOnAction(event -> linkedFile.acceptAsLinked());
acceptAutoLinkedFile.getStyleClass().setAll("flatButton");
Button writeXMPMetadata = MaterialDesignIconFactory.get().createIconButton(MaterialDesignIcon.IMPORT);
writeXMPMetadata.setTooltip(new Tooltip(Localization.lang("Write BibTeXEntry as XMP-metadata to PDF.")));
writeXMPMetadata.visibleProperty().bind(linkedFile.canWriteXMPMetadataProperty());
writeXMPMetadata.setOnAction(event -> linkedFile.writeXMPMetadata());
writeXMPMetadata.getStyleClass().setAll("flatButton");
HBox container = new HBox(10);
container.setPrefHeight(Double.NEGATIVE_INFINITY);
if (desc.getText().isEmpty()) {
container.getChildren().addAll(icon, link, progressIndicator, acceptAutoLinkedFile, writeXMPMetadata);
} else {
container.getChildren().addAll(icon, desc, link, progressIndicator, acceptAutoLinkedFile, writeXMPMetadata);
}
return container;
}
示例15: withIcon
import de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIcon; //导入依赖的package包/类
public ViewModelTreeTableCellFactory<S, T> withIcon(Callback<S, MaterialDesignIcon> toIcon, Callback<S, Paint> toColor) {
this.toGraphic = viewModel -> {
Text graphic = MaterialDesignIconFactory.get().createIcon(toIcon.call(viewModel));
graphic.setFill(toColor.call(viewModel));
return graphic;
};
return this;
}