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

Java JFXPopup类代码示例

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

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



JFXPopup类属于com.jfoenix.controls包,在下文中一共展示了JFXPopup类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: showSelectTabPopUp

import com.jfoenix.controls.JFXPopup; //导入依赖的package包/类
private void showSelectTabPopUp() {
	LanguageProvider languageProvider = userInterfaceContainer.get(LanguageProvider.class);
	RfxUserinterfaceController userInterfaceController = userInterfaceContainer
			.get(RfxUserinterfaceController.class);
	ViewContainer<View> viewContainer = userInterfaceController.getViewContainer();

	TreeItem<Item> rootNode = new TreeItem<>(new Item(languageProvider));
	rootNode.setExpanded(true);
	RfxItemTreeView itemTreeView = new RfxItemTreeView(rootNode);

	for (int i = 0; i < viewContainer.getViewCount(); i++) {
		View view = viewContainer.getView(i);
		SelectTabItem selectTabItem = new SelectTabItem(languageProvider, viewContainer, view);
		TreeItem<Item> selectTabNode = new TreeItem<>(selectTabItem);
		rootNode.getChildren().add(selectTabNode);
	}
	;

	JFXPopup popup = new JFXPopup();
	popup.setPopupContent(itemTreeView);
	popup.setAnchorLocation(AnchorLocation.CONTENT_TOP_RIGHT);
	popup.show(tabSelectionButton);
}
 
开发者ID:ntenhoeve,项目名称:Introspect-Framework,代码行数:24,代码来源:RfxAppButtonBar.java


示例2: DropDownMenu

import com.jfoenix.controls.JFXPopup; //导入依赖的package包/类
public DropDownMenu(final Pane container, final Node source, final int width, final boolean closeOnMouseExit) {
    this.width = width;

    popup = new JFXPopup();

    list = new VBox();
    list.setStyle("-fx-background-color: white; -fx-padding: 8 0 8 0;");
    list.setMaxHeight(1);
    StackPane.setAlignment(list, Pos.TOP_CENTER);

    content = new StackPane(list);
    content.setMinWidth(width);
    content.setMaxWidth(width);

    if (closeOnMouseExit) {
        final Runnable checkIfWeShouldClose = () -> {
            if (!isHoveringMenu.get() && !isHoveringSubMenu.get()) {
                final Timer timer = new Timer(20, arg0 -> {
                    if (!isHoveringMenu.get() && !isHoveringSubMenu.get()) {
                        close();
                    }
                });
                timer.setRepeats(false); // Only execute once
                timer.start(); // Go go go!
            }
        };
        isHoveringMenu.addListener(observable -> checkIfWeShouldClose.run());
        isHoveringSubMenu.addListener(observable -> checkIfWeShouldClose.run());
    }


    list.setOnMouseExited(event -> isHoveringMenu.set(false));
    list.setOnMouseEntered(event -> isHoveringMenu.set(true));

    popup.setContent(content);
    popup.setPopupContainer(container);
    popup.setSource(source);
}
 
开发者ID:ulriknyman,项目名称:H-Uppaal,代码行数:39,代码来源:DropDownMenu.java


示例3: createFlyout

import com.jfoenix.controls.JFXPopup; //导入依赖的package包/类
/**
 * Creates and returns a {@link Flyout}
 * 
 * @return a new {@link Flyout}
 */
public JFXPopup createFlyout() {
	marsNetBtn = new JFXButton();
	// marsNetBtn.getStyleClass().add("menu-button");//"button-raised");
	marsNetIcon = new IconNode(FontAwesome.COMMENTING_O);
	marsNetIcon.setIconSize(20);
	// marsNetButton.setPadding(new Insets(0, 0, 0, 0)); // Warning : this
	// significantly reduce the size of the button image
	setQuickToolTip(marsNetBtn, "Click to open MarsNet Chat Box");

	marsNetBox = new JFXPopup(createChatBox());
	marsNetBox.setOpacity(.9);

	marsNetBtn.setOnAction(e -> {
		if (!flag)
			chatBox.update();

		if (marsNetBox.isShowing()) {// .isVisible()) {
			marsNetBox.hide();// .close();
		} else {
			openChatBox();
		}
		e.consume();
	});

	return marsNetBox;
}
 
开发者ID:mars-sim,项目名称:mars-sim,代码行数:32,代码来源:MainScene.java


示例4: init

import com.jfoenix.controls.JFXPopup; //导入依赖的package包/类
/**
 * init fxml when loaded.
 */
@PostConstruct
public void init() {
    try {
        popup = new JFXPopup(FXMLLoader.load(getClass().getResource("/fxml/ui/popup/DemoPopup.fxml")));
    } catch (IOException ioExc) {
        ioExc.printStackTrace();
    }
    burger1.setOnMouseClicked((e) -> popup.show(rippler1, PopupVPosition.TOP, PopupHPosition.LEFT));
    burger2.setOnMouseClicked((e) -> popup.show(rippler2, PopupVPosition.TOP, PopupHPosition.RIGHT));
    burger3.setOnMouseClicked((e) -> popup.show(rippler3, PopupVPosition.BOTTOM, PopupHPosition.LEFT));
    burger4.setOnMouseClicked((e) -> popup.show(rippler4, PopupVPosition.BOTTOM, PopupHPosition.RIGHT));
}
 
开发者ID:jfoenixadmin,项目名称:JFoenix,代码行数:16,代码来源:PopupController.java


示例5: start

import com.jfoenix.controls.JFXPopup; //导入依赖的package包/类
@Override
public void start(Stage primaryStage) throws Exception {

    JFXHamburger show = new JFXHamburger();
    show.setPadding(new Insets(10, 5, 10, 5));
    JFXRippler rippler = new JFXRippler(show, RipplerMask.CIRCLE, RipplerPos.BACK);

    JFXListView<Label> list = new JFXListView<>();
    for (int i = 1; i < 5; i++) {
        list.getItems().add(new Label("Item " + i));
    }

    AnchorPane container = new AnchorPane();
    container.getChildren().add(rippler);
    AnchorPane.setLeftAnchor(rippler, 200.0);
    AnchorPane.setTopAnchor(rippler, 210.0);

    StackPane main = new StackPane();
    main.getChildren().add(container);

    JFXPopup popup = new JFXPopup(list);
    rippler.setOnMouseClicked(e -> popup.show(rippler, PopupVPosition.TOP, PopupHPosition.LEFT));

    final Scene scene = new Scene(main, 800, 800);
    scene.getStylesheets().add(PopupDemo.class.getResource("/css/jfoenix-components.css").toExternalForm());

    primaryStage.setTitle("JFX Popup Demo");
    primaryStage.setScene(scene);
    primaryStage.setResizable(false);
    primaryStage.show();
}
 
开发者ID:jfoenixadmin,项目名称:JFoenix,代码行数:32,代码来源:PopupDemo.java


示例6: JFXPopupSkin

import com.jfoenix.controls.JFXPopup; //导入依赖的package包/类
public JFXPopupSkin(JFXPopup control) {
    this.control = control;
    scale = new Scale(1, 0, 0, 0);
    popupContent = control.getPopupContent();
    container.getStyleClass().add("jfx-popup-container");
    container.setBackground(new Background(new BackgroundFill(Color.WHITE, CornerRadii.EMPTY, Insets.EMPTY)));
    container.getChildren().add(popupContent);
    container.getTransforms().add(scale);
    container.setOpacity(0);
    root = JFXDepthManager.createMaterialNode(container, 4);
    animation = getAnimation();
}
 
开发者ID:jfoenixadmin,项目名称:JFoenix,代码行数:13,代码来源:JFXPopupSkin.java


示例7: makeDraggable

import com.jfoenix.controls.JFXPopup; //导入依赖的package包/类
private void makeDraggable() {

        root.addEventHandler(MouseEvent.MOUSE_PRESSED, event -> {
            event.consume();

            final Edge unfinishedEdge = getParentComponent().getUnfinishedEdge();

            if ((event.isPrimaryButtonDown() || event.isMiddleButtonDown()) && unfinishedEdge != null) {
                unfinishedEdge.setTargetSubComponent(getSubComponent());

            } else if ((event.isShiftDown() && event.isPrimaryButtonDown()) || event.isMiddleButtonDown()) {

                final Edge newEdge = new Edge(getSubComponent());

                KeyboardTracker.registerKeybind(KeyboardTracker.ABANDON_EDGE, new Keybind(new KeyCodeCombination(KeyCode.ESCAPE), () -> {
                    getParentComponent().removeEdge(newEdge);
                    UndoRedoStack.forgetLast();
                }));

                UndoRedoStack.push(() -> { // Perform
                    getParentComponent().addEdge(newEdge);
                }, () -> { // Undo
                    getParentComponent().removeEdge(newEdge);
                }, "Created edge starting from subcomponent " + getSubComponent().getIdentifier(), "add-circle");
            } else if (event.isSecondaryButtonDown() && unfinishedEdge == null) {
                initializeDropDownMenu();
                dropDownMenu.show(JFXPopup.PopupVPosition.TOP, JFXPopup.PopupHPosition.LEFT, event.getX() - 5, event.getY() - 5);
            } else if(event.isPrimaryButtonDown()) {
                // If the sub component is pressed twice open its corresponding component in the canvas
                if(event.getClickCount() > 1) {
                    CanvasController.setActiveComponent(getSubComponent().getComponent());
                } else {
                    if (event.isShortcutDown()) {
                        SelectHelper.addToSelection(this);
                    } else {
                        SelectHelper.select(this);
                    }
                }
            }
        });

        ItemDragHelper.makeDraggable(root, this::getDragBounds);
    }
 
开发者ID:ulriknyman,项目名称:H-Uppaal,代码行数:44,代码来源:SubComponentController.java


示例8: initializeDetailsButton

import com.jfoenix.controls.JFXPopup; //导入依赖的package包/类
private void initializeDetailsButton() {
    final JFXRippler detailsButton = (JFXRippler) lookup("#detailsButton");
    final FontIcon detailsButtonIcon = (FontIcon) lookup("#detailsButtonIcon");

    detailsButtonIcon.setIconColor(Color.GREY.getColor(Color.Intensity.I900));

    detailsButton.setCursor(Cursor.HAND);
    detailsButton.setRipplerFill(Color.GREY.getColor(Color.Intensity.I500));
    detailsButton.setMaskType(JFXRippler.RipplerMask.CIRCLE);

    final DropDownMenu dropDownMenu = new DropDownMenu((Pane) getParent(), detailsButton, 230, true);

    dropDownMenu.addTogglableListElement("Run periodically", query.isPeriodicProperty(), event -> {
        // Toggle the property
        query.setIsPeriodic(!query.isPeriodic());
    });

    dropDownMenu.addSpacerElement();

    dropDownMenu.addClickableListElement("Clear Status", event -> {
        // Clear the state
        query.setQueryState(QueryState.UNKNOWN);

        // Close the menu
        dropDownMenu.close();
    });

    dropDownMenu.addSpacerElement();

    dropDownMenu.addClickableListElement("Delete", event -> {
        // Remove the query
        HUPPAAL.getProject().getQueries().remove(query);

        // Close the menu
        dropDownMenu.close();
    });

    detailsButton.getChildren().get(0).setOnMousePressed(event -> {
        // Show the popup
        dropDownMenu.show(JFXPopup.PopupVPosition.TOP, JFXPopup.PopupHPosition.RIGHT, 310, 35);
    });
}
 
开发者ID:ulriknyman,项目名称:H-Uppaal,代码行数:43,代码来源:QueryPresentation.java


示例9: show

import com.jfoenix.controls.JFXPopup; //导入依赖的package包/类
public void show(final JFXPopup.PopupVPosition vAlign, final JFXPopup.PopupHPosition hAlign, final double initOffsetX, final double initOffsetY) {
    popup.show(vAlign, hAlign, initOffsetX, initOffsetY);
}
 
开发者ID:ulriknyman,项目名称:H-Uppaal,代码行数:4,代码来源:DropDownMenu.java


示例10: showContextMenu

import com.jfoenix.controls.JFXPopup; //导入依赖的package包/类
private void showContextMenu() {

        final DropDownMenu contextMenu = new DropDownMenu(((Pane) root.getParent().getParent().getParent().getParent()), root, 230, true);

        contextMenu.addClickableListElement("Draw edge",
                (event) -> {
                    final Edge newEdge = new Edge(getJork());

                    KeyboardTracker.registerKeybind(KeyboardTracker.ABANDON_EDGE, new Keybind(new KeyCodeCombination(KeyCode.ESCAPE), () -> {
                        getComponent().removeEdge(newEdge);
                        UndoRedoStack.forgetLast();
                    }));

                    UndoRedoStack.push(() -> { // Perform
                        getComponent().addEdge(newEdge);
                    }, () -> { // Undo
                        getComponent().removeEdge(newEdge);
                    }, "Created edge starting from " + getJork(), "add-circle");

                    contextMenu.close();
                }
        );

        contextMenu.addSpacerElement();

        contextMenu.addClickableListElement("Delete", (mouseEvent -> {
            final Component component = CanvasController.getActiveComponent();
            final Jork jork = getJork();

            final List<Edge> relatedEdges = component.getRelatedEdges(jork);

            UndoRedoStack.push(() -> { // Perform
                // Remove the jork
                component.getJorks().remove(jork);
                relatedEdges.forEach(component::removeEdge);
            }, () -> { // Undo
                // Re-all the jork
                component.getJorks().add(jork);
                relatedEdges.forEach(component::addEdge);
            }, String.format("Deleted %s", jork), "delete");


            contextMenu.close();
        }));

        contextMenu.show(JFXPopup.PopupVPosition.TOP, JFXPopup.PopupHPosition.LEFT, 0, 0);
    }
 
开发者ID:ulriknyman,项目名称:H-Uppaal,代码行数:48,代码来源:JorkController.java


示例11: showContextMenu

import com.jfoenix.controls.JFXPopup; //导入依赖的package包/类
private void showContextMenu() {

        final DropDownMenu contextMenu = new DropDownMenu(((Pane) root.getParent().getParent().getParent().getParent()), root, 230, true);

        contextMenu.addClickableListElement("Delete", (mouseEvent -> {
            final Nail nail = getNail();
            final Edge edge = getEdge();
            final Component component = getComponent();
            final int index = edge.getNails().indexOf(nail);

            final String restoreProperty = edge.getProperty(nail.getPropertyType());

            // If the last nail on a self loop for a location or join/fork delete the edge also
            final boolean shouldDeleteEdgeAlso = edge.isSelfLoop() && edge.getNails().size() == 1 && edge.getSourceSubComponent() == null;

            // Create an undo redo description based, add extra comment if edge is also deleted
            String message =  String.format("Deleted %s", nail.toString());
            if(shouldDeleteEdgeAlso) {
                message += String.format("(Was last Nail on self loop edge --> %s also deleted)", toString());
            }

            UndoRedoStack.push(
                    () -> {
                        edge.removeNail(nail);
                        edge.setProperty(nail.getPropertyType(), "");
                        if(shouldDeleteEdgeAlso) {
                            component.removeEdge(edge);
                        }
                    },
                    () -> {
                        if(shouldDeleteEdgeAlso) {
                            component.addEdge(edge);
                        }
                        edge.setProperty(nail.getPropertyType(), restoreProperty);
                        edge.insertNailAt(nail, index);
                    },
                    message,
                    "delete"
            );
            contextMenu.close();
        }));

        contextMenu.show(JFXPopup.PopupVPosition.TOP, JFXPopup.PopupHPosition.LEFT, 0.5,0.5);
    }
 
开发者ID:ulriknyman,项目名称:H-Uppaal,代码行数:45,代码来源:NailController.java


示例12: getFlyout

import com.jfoenix.controls.JFXPopup; //导入依赖的package包/类
public JFXPopup getFlyout() {
	return marsNetBox;
}
 
开发者ID:mars-sim,项目名称:mars-sim,代码行数:4,代码来源:MainScene.java


示例13: getSkinnable

import com.jfoenix.controls.JFXPopup; //导入依赖的package包/类
@Override
public JFXPopup getSkinnable() {
    return control;
}
 
开发者ID:jfoenixadmin,项目名称:JFoenix,代码行数:5,代码来源:JFXPopupSkin.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java AsyncOnSubscribe类代码示例发布时间:2022-05-22
下一篇:
Java ImmutableValue类代码示例发布时间: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