• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java MaterialDesignIcon类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.gluonhq.charm.glisten.visual.MaterialDesignIcon的典型用法代码示例。如果您正苦于以下问题:Java MaterialDesignIcon类的具体用法?Java MaterialDesignIcon怎么用?Java MaterialDesignIcon使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MaterialDesignIcon类属于com.gluonhq.charm.glisten.visual包,在下文中一共展示了MaterialDesignIcon类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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();
            }
        });
    });
}
 
开发者ID:gluonhq,项目名称:javaone2016,代码行数:17,代码来源:Util.java


示例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();
}
 
开发者ID:gluonhq,项目名称:javaone2016,代码行数:25,代码来源:VenuePresenter.java


示例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());

}
 
开发者ID:gluonhq,项目名称:gluon-samples,代码行数:21,代码来源:BasicView.java


示例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;
    }
 
开发者ID:gluonhq,项目名称:javaone2016,代码行数:27,代码来源:SpeakerPresenter.java


示例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));
}
 
开发者ID:gluonhq,项目名称:javaone2016,代码行数:22,代码来源:ExperiencesPresenter.java


示例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();
}
 
开发者ID:gluonhq,项目名称:gluon-samples,代码行数:24,代码来源:NoteCell.java


示例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."));

}
 
开发者ID:gluonhq,项目名称:gluon-samples,代码行数:21,代码来源:BoardPresenter.java


示例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()));
}
 
开发者ID:gluonhq,项目名称:gluon-samples,代码行数:23,代码来源:DetailPresenter.java


示例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));
}
 
开发者ID:gluonhq,项目名称:gluon-samples,代码行数:20,代码来源:Main.java


示例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")));
        }
    });
}
 
开发者ID:gluonhq,项目名称:gluon-samples,代码行数:18,代码来源:PrimaryPresenter.java


示例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()));
}
 
开发者ID:gluonhq,项目名称:gluon-samples,代码行数:18,代码来源:EditionPresenter.java


示例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();
}
 
开发者ID:gluonhq,项目名称:gluon-samples,代码行数:20,代码来源:CommentsPresenter.java


示例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());
}
 
开发者ID:gluonhq,项目名称:gluon-samples,代码行数:25,代码来源:NotesPresenter.java


示例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)));
        }
    });
}
 
开发者ID:gluonhq,项目名称:gluon-samples,代码行数:22,代码来源:SettingsPresenter.java


示例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);
}
 
开发者ID:gluonhq,项目名称:javaone2016,代码行数:14,代码来源:Placeholder.java


示例16: LoginPrompter

import com.gluonhq.charm.glisten.visual.MaterialDesignIcon; //导入依赖的package包/类
public LoginPrompter(Service service, String titleText, String messageText, MaterialDesignIcon image, Runnable onAuthenticated) {
    super(titleText, messageText, image);

    getStyleClass().add("login-prompter");

    this.login = new Button(OTNBundle.getString("OTN.BUTTON.LOGIN"));
    this.login.getStyleClass().add("login");
    this.login.setOnAction(e -> {
        if (service.authenticate()) {
            onAuthenticated.run();
        }
    });
    getChildren().add(login);
}
 
开发者ID:gluonhq,项目名称:javaone2016,代码行数:15,代码来源:LoginPrompter.java


示例17: SpeakerCell

import com.gluonhq.charm.glisten.visual.MaterialDesignIcon; //导入依赖的package包/类
public SpeakerCell() {
        tile = new ListTile();
        // Fix for OTN-393: This fails on iOS because the MISSING_RESOURCE_ERROR issue
        // when there are non Ascii characters and trying to break the line throws
        // a RuntimeException
//        tile.setWrapText(true);
        tile.setSecondaryGraphic(MaterialDesignIcon.CHEVRON_RIGHT.graphic());
        setGraphic(tile);
        setText(null);
        getStyleClass().add("speaker-cell");
    }
 
开发者ID:gluonhq,项目名称:javaone2016,代码行数:12,代码来源:SpeakerCell.java


示例18: NoteCell

import com.gluonhq.charm.glisten.visual.MaterialDesignIcon; //导入依赖的package包/类
public NoteCell(Service service) {
    this.service = service;

    tile = new ListTile();
    tile.setSecondaryGraphic(MaterialDesignIcon.CHEVRON_RIGHT.graphic());
    setText(null);
    getStyleClass().add("note-cell");
}
 
开发者ID:gluonhq,项目名称:javaone2016,代码行数:9,代码来源:NoteCell.java


示例19: VenueCell

import com.gluonhq.charm.glisten.visual.MaterialDesignIcon; //导入依赖的package包/类
public VenueCell() {
    tile = new ListTile();
    tile.setSecondaryGraphic(MaterialDesignIcon.CHEVRON_RIGHT.graphic());

    setText(null);
    getStyleClass().add("venue-cell");
}
 
开发者ID:gluonhq,项目名称:javaone2016,代码行数:8,代码来源:VenueCell.java


示例20: SponsorCell

import com.gluonhq.charm.glisten.visual.MaterialDesignIcon; //导入依赖的package包/类
public SponsorCell() {
    tile = new ListTile();
    tile.setSecondaryGraphic(MaterialDesignIcon.CHEVRON_RIGHT.graphic());

    setText(null);

    imageView = new ImageView();
    imageView.setFitWidth(100);
    imageView.setPreserveRatio(true);
    tile.setLeft(imageView);

    getStyleClass().add("sponsor-cell");
}
 
开发者ID:gluonhq,项目名称:javaone2016,代码行数:14,代码来源:SponsorCell.java



注:本文中的com.gluonhq.charm.glisten.visual.MaterialDesignIcon类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java RsXslt类代码示例发布时间:2022-05-22
下一篇:
Java LanguageSpecific类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap