当前位置: 首页>>代码示例>>Java>>正文


Java PopupMenuProvider类代码示例

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


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

示例1: getPopupMenuProvider

import org.netbeans.api.visual.action.PopupMenuProvider; //导入依赖的package包/类
@Override
public PopupMenuProvider getPopupMenuProvider() {
    final PopupMenuProvider popupMenuProvider;
    final JPopupMenu popupMenu; //PopupMenu used to give some funcionality to the widget

    popupMenu = new JPopupMenu();

    List<JMenuItem> menuItemList = getPopupMenuItemList();
    for (JMenuItem menuItem : menuItemList) {
        if (menuItem == null) {
            popupMenu.addSeparator();
        } else {
            popupMenu.add(menuItem);
        }
    }
    popupMenuProvider = (final Widget widget, final Point location1) -> popupMenu;

    return popupMenuProvider;
}
 
开发者ID:jeddict,项目名称:NBModeler,代码行数:20,代码来源:AbstractModelerScene.java

示例2: getPopupMenuProvider

import org.netbeans.api.visual.action.PopupMenuProvider; //导入依赖的package包/类
@Override
public PopupMenuProvider getPopupMenuProvider() {
    final PopupMenuProvider popupMenuProvider;
    final JPopupMenu popupMenu; //PopupMenu used to give some funcionality to the widget

    popupMenu = new JPopupMenu();

    List<JMenuItem> menuItemList = getPopupMenuItemList();
    for (JMenuItem menuItem : menuItemList) {
        if (menuItem == null) {
            popupMenu.addSeparator();
        } else {
            popupMenu.add(menuItem);
        }
    }
    popupMenuProvider = (widget, location1) -> popupMenu;

    return popupMenuProvider;
}
 
开发者ID:jeddict,项目名称:NBModeler,代码行数:20,代码来源:PinWidget.java

示例3: getPopupMenuProvider

import org.netbeans.api.visual.action.PopupMenuProvider; //导入依赖的package包/类
@Override
public PopupMenuProvider getPopupMenuProvider() {
    JPopupMenu popupMenu = new JPopupMenu();
    List<JMenuItem> menuItemList = getPopupMenuItemList();
    menuItemList.forEach(menuItem -> {
        if (menuItem == null) {
            popupMenu.addSeparator();
        } else {
            popupMenu.add(menuItem);
        }
    });
    return (widget, location) -> popupMenu;
}
 
开发者ID:jeddict,项目名称:NBModeler,代码行数:14,代码来源:AbstractPModelerScene.java

示例4: createPinConnection

import org.netbeans.api.visual.action.PopupMenuProvider; //导入依赖的package包/类
/**
 * Create a pin with a connection to this note.
 *
 * @param p - In null, the defaul pin location is used.
 */
public void createPinConnection(Point p)
{
    LayerWidget layer = CalloutsUtility.getCalloutsLayer((AbstractReportObjectScene)getScene(), true);

    if (p == null)
    {
        p = new Point(getBounds().width/2 + getPreferredLocation().x, getPreferredLocation().y + getBounds().height+30);
    }
    getScene().validate();

    PinWidget pinWidget = new PinWidget(getScene());
    getScene().validate();
    pinWidget.setPreferredLocation(p);
    getScene().validate();
    layer.addChild(pinWidget);
    getScene().validate();

    ConnectionWidget connection = new ConnectionWidget(getScene());
    getScene().validate();
    pinWidget.setConnectionWidget(connection);
    connection.setTargetAnchorShape (AnchorShape.NONE);
    connection.setEndPointShape (PointShape.NONE); //SQUARE_FILLED_BIG
    connection.setSourceAnchor (AnchorFactory.createRectangularAnchor (CalloutWidget.this));
    connection.setTargetAnchor (AnchorFactory.createRectangularAnchor(pinWidget));
    connection.getActions().addAction(ActionFactory.createPopupMenuAction(new PopupMenuProvider() {

        public JPopupMenu getPopupMenu(Widget widget, Point point) {
            return getConnectionPopupMenu(widget, point);
        }
    }));
    layer.addChild (connection);
    getScene().validate();
    getScene().repaint();
}
 
开发者ID:JockiHendry,项目名称:ireport-fork,代码行数:40,代码来源:CalloutWidget.java

示例5: PopupMenuAction

import org.netbeans.api.visual.action.PopupMenuProvider; //导入依赖的package包/类
public PopupMenuAction (PopupMenuProvider provider) {
    this.provider = provider;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:PopupMenuAction.java

示例6: getPopupMenuProvider

import org.netbeans.api.visual.action.PopupMenuProvider; //导入依赖的package包/类
@Override
public PopupMenuProvider getPopupMenuProvider() {
    return null;
}
 
开发者ID:jeddict,项目名称:NBModeler,代码行数:5,代码来源:AbstractLabelManager.java

示例7: getPopupMenuProvider

import org.netbeans.api.visual.action.PopupMenuProvider; //导入依赖的package包/类
PopupMenuProvider getPopupMenuProvider(); 
开发者ID:jeddict,项目名称:NBModeler,代码行数:2,代码来源:IWidget.java


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