本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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();
}
示例5: PopupMenuAction
import org.netbeans.api.visual.action.PopupMenuProvider; //导入依赖的package包/类
public PopupMenuAction (PopupMenuProvider provider) {
this.provider = provider;
}
示例6: getPopupMenuProvider
import org.netbeans.api.visual.action.PopupMenuProvider; //导入依赖的package包/类
@Override
public PopupMenuProvider getPopupMenuProvider() {
return null;
}
示例7: getPopupMenuProvider
import org.netbeans.api.visual.action.PopupMenuProvider; //导入依赖的package包/类
PopupMenuProvider getPopupMenuProvider();