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


Java WidgetKeyEvent类代码示例

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


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

示例1: keyTyped

import org.netbeans.api.visual.action.WidgetAction.WidgetKeyEvent; //导入依赖的package包/类
public State keyTyped(Widget widget, WidgetKeyEvent event) {
    if (widget instanceof IEdgeWidget && event.getKeyChar() == KeyEvent.VK_DELETE) {
        GraphPinScene scene = (GraphPinScene) widget.getScene();
        if (widget instanceof IEdgeWidget) {
            ((IEdgeWidget) widget).remove(true);
            return State.CONSUMED;
        }
    }
    return State.REJECTED;
}
 
开发者ID:jeddict,项目名称:NBModeler,代码行数:11,代码来源:EdgeDeleteAction.java

示例2: keyTyped

import org.netbeans.api.visual.action.WidgetAction.WidgetKeyEvent; //导入依赖的package包/类
public State keyTyped (Widget widget, WidgetKeyEvent event) {
    if (! aiming  &&  event.getKeyChar () == KeyEvent.VK_SPACE) {
        provider.select (widget, null, (event.getModifiersEx () & MouseEvent.CTRL_DOWN_MASK) != 0);
        return State.CONSUMED;
    }
    return State.REJECTED;
}
 
开发者ID:JockiHendry,项目名称:ireport-fork,代码行数:8,代码来源:SelectAction.java

示例3: keyTyped

import org.netbeans.api.visual.action.WidgetAction.WidgetKeyEvent; //导入依赖的package包/类
@Override
public State keyTyped(Widget widget, WidgetKeyEvent event) {
    return innerAction.keyTyped(widget, event);
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:5,代码来源:ExtendedSelectAction.java

示例4: keyPressed

import org.netbeans.api.visual.action.WidgetAction.WidgetKeyEvent; //导入依赖的package包/类
@Override
public State keyPressed(Widget widget, WidgetKeyEvent event) {
    
    if (!event.isControlDown())
    {
        if (event.getKeyCode() == KeyEvent.VK_LEFT ||
            event.getKeyCode() == KeyEvent.VK_RIGHT ||
            event.getKeyCode() == KeyEvent.VK_UP ||
            event.getKeyCode() == KeyEvent.VK_DOWN)
        {

            int len = (event.isShiftDown()) ? 10 : 1;

            Point delta = new Point(0,0);
            switch (event.getKeyCode())
            {
                case KeyEvent.VK_LEFT: delta.x -= len; break;
                case KeyEvent.VK_RIGHT: delta.x = len; break;
                case KeyEvent.VK_UP: delta.y -= len; break;
                case KeyEvent.VK_DOWN: delta.y = len; break;
            }

            List<JRDesignElementWidget> widgets = new ArrayList<JRDesignElementWidget>();
            AbstractReportObjectScene scene = (AbstractReportObjectScene)widget.getScene();

            Iterator iterSelectedObject = scene.getSelectedObjects().iterator();
            while (iterSelectedObject.hasNext())
            {
                Object obj = iterSelectedObject.next();
                Widget w = scene.findWidget(obj);
                if (w instanceof JRDesignElementWidget)
                {
                    widgets.add((JRDesignElementWidget)w);
                }
            }

            move(widgets, delta);

            return State.CHAIN_ONLY;
        }
    }
    return State.REJECTED;
}
 
开发者ID:JockiHendry,项目名称:ireport-fork,代码行数:44,代码来源:KeyboardElementMoveAction.java


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