本文整理汇总了Java中com.gluonhq.charm.glisten.visual.MaterialDesignIcon类的典型用法代码示例。如果您正苦于以下问题:Java MaterialDesignIcon类的具体用法?Java MaterialDesignIcon怎么用?Java MaterialDesignIcon使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MaterialDesignIcon类属于com.gluonhq.charm.glisten.visual包,在下文中一共展示了MaterialDesignIcon类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createWebLaunchFAB
import com.gluonhq.charm.glisten.visual.MaterialDesignIcon; //导入依赖的package包/类
public static FloatingActionButton createWebLaunchFAB(Supplier<String> urlSupplier) {
return createFAB(MaterialDesignIcon.LAUNCH, e -> {
Services.get(BrowserService.class).ifPresent(b -> {
try {
String url = urlSupplier.get();
if (!url.startsWith("http://") && !url.startsWith("https://")) {
url = "http://".concat(url);
}
b.launchExternalBrowser(url);
} catch (IOException | URISyntaxException ex) {
Toast toast = new Toast(OTNBundle.getString("OTN.VISUALS.CONNECTION_FAILED"));
toast.show();
}
});
});
}
示例2: createFloatingActionButtons
import com.gluonhq.charm.glisten.visual.MaterialDesignIcon; //导入依赖的package包/类
private Layer createFloatingActionButtons() {
callActionButton = Util.createFAB(MaterialDesignIcon.CALL, e -> {
Dialog confirmCallDialog = new Dialog(OTNBundle.getString("OTN.VENUE.CALLDIALOG.TITLE"), OTNBundle.getString("OTN.VENUE.CALLDIALOG.CONTENT", getVenue().getName(), getVenue().getPhoneNumber())) {
{
rootNode.setPrefWidth(MobileApplication.getInstance().getView().getScene().getWidth() * 0.9);
}
};
Button cancel = new Button(OTNBundle.getString("OTN.VENUE.CALLDIALOG.NO"));
Button ok = new Button(OTNBundle.getString("OTN.VENUE.CALLDIALOG.YES"));
cancel.setOnAction(event -> confirmCallDialog.hide());
ok.setOnAction(event -> {
Services.get(DialerService.class).ifPresent(d -> d.call(getVenue().getPhoneNumber()));
confirmCallDialog.hide();
});
confirmCallDialog.getButtons().addAll(cancel, ok);
confirmCallDialog.showAndWait();
});
webActionButton = Util.createWebLaunchFAB(() -> getVenue().getUrl());
webActionButton.getStyleClass().add("secondary");
webActionButton.attachTo(callActionButton, Side.TOP);
return callActionButton.getLayer();
}
示例3: updateAppBar
import com.gluonhq.charm.glisten.visual.MaterialDesignIcon; //导入依赖的package包/类
@Override
protected void updateAppBar(AppBar appBar) {
appBar.setNavIcon(MaterialDesignIcon.STAR.button());
appBar.setTitleText("50 States");
Button sort = MaterialDesignIcon.SORT.button(e -> {
if (ascending) {
charmListView.setHeaderComparator((d1, d2) -> d1.compareTo(d2));
charmListView.setComparator((s1, s2) -> Double.compare(s1.getDensity(), s2.getDensity()));
ascending = false;
} else {
charmListView.setHeaderComparator((d1, d2) -> d2.compareTo(d1));
charmListView.setComparator((s1, s2) -> Double.compare(s2.getDensity(), s1.getDensity()));
ascending = true;
}
});
appBar.getActionItems().add(sort);
appBar.getMenuItems().setAll(buildFilterMenu());
}
示例4: createBottomNavigation
import com.gluonhq.charm.glisten.visual.MaterialDesignIcon; //导入依赖的package包/类
private BottomNavigation createBottomNavigation(final Speaker activeSpeaker) {
BottomNavigation bottomNavigation = new BottomNavigation();
final ToggleButton infoButton = bottomNavigation.createButton(OTNBundle.getString("OTN.BUTTON.INFO"), MaterialDesignIcon.INFO.graphic(), e -> {
// when clicked create a label in a scrollpane. Label will contain
// the speaker summary
Label speakerSummary = new Label(activeSpeaker.getSummary());
speakerSummary.setWrapText(true);
speakerSummary.getStyleClass().add("speaker-summary");
speakerView.setCenter(createScrollPane(speakerSummary));
});
final ToggleButton sessionsButton = bottomNavigation.createButton(OTNBundle.getString("OTN.BUTTON.SESSIONS"), MaterialDesignIcon.EVENT_NOTE.graphic(), e -> {
// when clicked we create a pane containing all sessions.
speakerView.setCenter(createSessionsListView(activeSpeaker));
});
bottomNavigation.getActionItems().addAll(infoButton, sessionsButton);
// listen to the selected toggle so we ensure it is selected when the view is returned to
infoButton.getToggleGroup().selectedToggleProperty().addListener((o,ov,nv) -> lastSelectedButton = nv);
infoButton.setSelected(true);
return bottomNavigation;
}
示例5: initialize
import com.gluonhq.charm.glisten.visual.MaterialDesignIcon; //导入依赖的package包/类
public void initialize() {
maxCol = Services.get(DisplayService.class)
.map(d -> d.isTablet() ? 3 : 2)
.orElse(2);
experiences.setOnShowing(event -> {
AppBar appBar = getApp().getAppBar();
appBar.setNavIcon(getApp().getNavMenuButton());
appBar.setTitleText(OTNView.EXPERIENCES.getTitle());
appBar.getActionItems().add(getApp().getSearchButton());
});
experiences.getStyleClass().add("experiences-view");
experiencesGridPane = new GridPane();
experiencesGridPane.getStyleClass().add("experiences-grid-pane");
experiencesGridPane.setAlignment(Pos.TOP_CENTER);
enabledOTNExperiences = service.retrieveEnabledOTNExperiences();
enabledOTNExperiences.addListener(o -> setExperiences());
experiences.setCenter(new Placeholder(PLACEHOLDER_MESSAGE, MaterialDesignIcon.ANNOUNCEMENT));
}
示例6: NoteCell
import com.gluonhq.charm.glisten.visual.MaterialDesignIcon; //导入依赖的package包/类
public NoteCell(Service service, Consumer<Note> edit, Consumer<Note> remove) {
tile = new ListTile();
tile.setPrimaryGraphic(MaterialDesignIcon.DESCRIPTION.graphic());
Button btnEdit = MaterialDesignIcon.EDIT.button(e -> edit.accept(currentItem));
Button btnRemove = MaterialDesignIcon.DELETE.button(e -> remove.accept(currentItem));
HBox buttonBar = new HBox(0, btnEdit, btnRemove);
buttonBar.setAlignment(Pos.CENTER_RIGHT);
tile.setSecondaryGraphic(buttonBar);
dateFormat = DateTimeFormatter.ofPattern("EEE, MMM dd yyyy - HH:mm", Locale.ENGLISH);
noteChangeListener = (obs, ov, nv) -> update();
service.settingsProperty().addListener((obs, ov, nv) -> {
settings = nv;
update();
});
settings = service.settingsProperty().get();
update();
}
示例7: initialize
import com.gluonhq.charm.glisten.visual.MaterialDesignIcon; //导入依赖的package包/类
public void initialize() {
board.setShowTransitionFactory(BounceInLeftTransition::new);
board.showingProperty().addListener((obs, ov, nv) -> {
if (nv) {
AppBar appBar = getApp().getAppBar();
appBar.setNavIcon(MaterialDesignIcon.MENU.button(event -> getApp().showLayer(DRAWER_LAYER)));
appBar.setTitleText("Whiteboard");
}
});
final FloatingActionButton floatingActionButton = new FloatingActionButton();
floatingActionButton.setOnAction(e -> edit(null));
board.getLayers().add(floatingActionButton.getLayer());
GluonObservableList<Item> items = service.retrieveItems();
lstItems.setItems(items);
lstItems.setCellFactory(p -> new ItemCell(service, this::edit, this::remove));
lstItems.setPlaceholder(new Label("The whiteboard is empty."));
}
示例8: setStackEntry
import com.gluonhq.charm.glisten.visual.MaterialDesignIcon; //导入依赖的package包/类
public void setStackEntry(StackEntry stackEntry) {
StackOwner stackOwner = stackEntry.getOwner();
if (stackOwner != null) {
ImageView imageView = new ImageView(Util.getImage(stackOwner.getProfile_image()));
imageView.setPreserveRatio(true);
listTile.setPrimaryGraphic(imageView);
listTile.setWrapText(true);
listTile.textProperty().setAll(stackEntry.getTitle(),
stackOwner.getDisplay_name(),
"Created: " + Util.FORMATTER.format(LocalDateTime.ofEpochSecond(stackEntry.getCreation_date(), 0, ZoneOffset.UTC)) +
" - Answers: " + stackEntry.getAnswer_count());
Icon icon = new Icon(MaterialDesignIcon.OPEN_IN_BROWSER);
icon.setOnMouseClicked(e -> Services.get(BrowserService.class)
.ifPresent(browser -> {
try {
browser.launchExternalBrowser(stackEntry.getLink());
} catch (IOException | URISyntaxException ex) {}
}));
listTile.setSecondaryGraphic(icon);
}
search(String.valueOf(stackEntry.getQuestion_id()));
}
示例9: init
import com.gluonhq.charm.glisten.visual.MaterialDesignIcon; //导入依赖的package包/类
@Override
public void init() {
addViewFactory(LIST_VIEW, () -> new BasicListView(LIST_VIEW));
addViewFactory(OBJECT_VIEW, () -> new BasicObjectView(OBJECT_VIEW));
NavigationDrawer navigationDrawer = new NavigationDrawer();
NavigationDrawer.Item listItem = new NavigationDrawer.Item("List Viewer", MaterialDesignIcon.VIEW_LIST.graphic());
NavigationDrawer.Item objectItem = new NavigationDrawer.Item("Object Viewer", MaterialDesignIcon.INSERT_DRIVE_FILE.graphic());
navigationDrawer.getItems().addAll(listItem, objectItem);
navigationDrawer.selectedItemProperty().addListener((obs, oldItem, newItem) -> {
hideLayer(MENU_LAYER);
if (newItem.equals(listItem)) {
switchView(LIST_VIEW);
} else if (newItem.equals(objectItem)) {
switchView(OBJECT_VIEW);
}
});
addLayerFactory(MENU_LAYER, () -> new SidePopupView(navigationDrawer));
}
示例10: initialize
import com.gluonhq.charm.glisten.visual.MaterialDesignIcon; //导入依赖的package包/类
public void initialize() {
// switch to authenticated view when we have an authenticated user
if (getApp().getUserClient().isAuthenticated()) {
Platform.runLater(this::loadAuthenticatedView);
}
primary.showingProperty().addListener((obs, oldValue, newValue) -> {
if (newValue) {
AppBar appBar = getApp().getAppBar();
appBar.setNavIcon(MaterialDesignIcon.MENU.button(e ->
getApp().showLayer(UserAuthentication.MENU_LAYER)));
appBar.setTitleText("Primary");
appBar.getActionItems().add(MaterialDesignIcon.SEARCH.button(e ->
System.out.println("Search")));
}
});
}
示例11: initialize
import com.gluonhq.charm.glisten.visual.MaterialDesignIcon; //导入依赖的package包/类
public void initialize() {
edition.setShowTransitionFactory(BounceInRightTransition::new);
edition.showingProperty().addListener((obs, oldValue, newValue) -> {
if (newValue) {
AppBar appBar = getApp().getAppBar();
appBar.setNavIcon(MaterialDesignIcon.MENU.button(e ->
getApp().showLayer(DRAWER_LAYER)));
appBar.setTitleText("Edition");
}
});
submit.disableProperty().bind(Bindings.createBooleanBinding(() -> {
return authorText.textProperty().isEmpty()
.or(commentsText.textProperty().isEmpty()).get();
}, authorText.textProperty(), commentsText.textProperty()));
}
示例12: initialize
import com.gluonhq.charm.glisten.visual.MaterialDesignIcon; //导入依赖的package包/类
public void initialize() {
comments.showingProperty().addListener((obs, oldValue, newValue) -> {
if (newValue) {
AppBar appBar = getApp().getAppBar();
appBar.setNavIcon(MaterialDesignIcon.MENU.button(e ->
getApp().showLayer(DRAWER_LAYER)));
appBar.setTitleText("Comments");
}
});
comments.getLayers().add(new FloatingActionButton(MaterialDesignIcon.ADD.text,
e -> AppViewManager.EDITION_VIEW.switchView()).getLayer());
commentsList.setCellFactory(p -> new CommentListCell());
commentsList.setPlaceholder(new Label("There are no comments"));
commentsList.setItems(service.commentsProperty());
service.retrieveComments();
}
示例13: initialize
import com.gluonhq.charm.glisten.visual.MaterialDesignIcon; //导入依赖的package包/类
public void initialize() {
notes.setShowTransitionFactory(BounceInLeftTransition::new);
notes.showingProperty().addListener((obs, oldValue, newValue) -> {
if (newValue) {
AppBar appBar = getApp().getAppBar();
appBar.setNavIcon(MaterialDesignIcon.MENU.button(e ->
getApp().showLayer(DRAWER_LAYER)));
appBar.setTitleText(resources.getString("appbar.notes"));
}
});
lstNotes.setCellFactory(p -> new NoteCell(service, this::edit, this::remove));
lstNotes.setHeadersFunction(t -> t.getCreationDate().toLocalDate());
lstNotes.setHeaderCellFactory(p -> new HeaderCell());
lstNotes.setComparator((n1, n2) -> n1.getCreationDate().compareTo(n2.getCreationDate()));
lstNotes.setHeaderComparator((h1, h2) -> h1.compareTo(h2));
lstNotes.setPlaceholder(new Label(resources.getString("label.no.notes")));
final FloatingActionButton floatingActionButton = new FloatingActionButton();
floatingActionButton.setOnAction(e -> edit(null));
notes.getLayers().add(floatingActionButton.getLayer());
lstNotes.setItems(service.getNotes());
}
示例14: initialize
import com.gluonhq.charm.glisten.visual.MaterialDesignIcon; //导入依赖的package包/类
public void initialize() {
settings.setShowTransitionFactory(BounceInRightTransition::new);
final Option<StringProperty> uuidOption = new DefaultOption<>(MaterialDesignIcon.BLUETOOTH_SEARCHING.graphic(),
"Set the UUID", "Set the UUID to be scanned", "Beacon Settings", config.uuidProperty(), true);
((OptionBase<StringProperty>) uuidOption).setLayout(Orientation.VERTICAL);
settingsPane.getOptions().add(uuidOption);
settingsPane.setSearchBoxVisible(false);
settings.showingProperty().addListener((obs, oldValue, newValue) -> {
if (newValue) {
AppBar appBar = getApp().getAppBar();
appBar.setNavIcon(MaterialDesignIcon.MENU.button(e ->
getApp().showLayer(DRAWER_LAYER)));
appBar.setTitleText("Settings");
appBar.getActionItems().add(MaterialDesignIcon.SYNC.button(e -> config.setUuid(Settings.UUID)));
}
});
}
示例15: Placeholder
import com.gluonhq.charm.glisten.visual.MaterialDesignIcon; //导入依赖的package包/类
public Placeholder(String titleText, String messageText, MaterialDesignIcon image) {
getStyleClass().add("placeholder");
getChildren().add(getNodeFromIcon(image));
if (titleText != null && !titleText.isEmpty()) {
Label title = new Label(titleText);
title.getStyleClass().add("title");
getChildren().add(title);
}
this.message.setText(messageText);
getChildren().add(message);
}