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


Java WidgetMouseEvent.getModifiersEx方法代码示例

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


在下文中一共展示了WidgetMouseEvent.getModifiersEx方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: mousePressed

import org.netbeans.api.visual.action.WidgetAction.WidgetMouseEvent; //导入方法依赖的package包/类
@Override
public State mousePressed (Widget widget, WidgetMouseEvent event) {
    if (isLocked ())
        return State.createLocked (widget, this);
    if (enabled && (event.getModifiersEx() & modifiersExMask) == modifiersEx) {
        scene = widget.getScene ();
        scrollPane = findScrollPane (scene.getView ());
        if (scrollPane != null) {
            lastLocation = scene.convertSceneToView (widget.convertLocalToScene (event.getPoint ()));
            SwingUtilities.convertPointToScreen (lastLocation, scene.getView ());
            return State.createLocked (widget, this);
        }
    }
    return State.REJECTED;
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:16,代码来源:CustomizablePanAction.java

示例2: mousePressed

import org.netbeans.api.visual.action.WidgetAction.WidgetMouseEvent; //导入方法依赖的package包/类
public State mousePressed (Widget widget, WidgetMouseEvent event) {

        if (isLocked ())
            return State.createLocked (widget, this);
        if (event.getButton ()  ==  MouseEvent.BUTTON1 ||  event.getButton () == MouseEvent.BUTTON3)
        {

            rightButton = event.getButton () == MouseEvent.BUTTON3;
            widget.getScene().getView().requestFocus();

            invertSelection = (event.getModifiersEx () & MouseEvent.CTRL_DOWN_MASK) != 0;
            Point localLocation = event.getPoint ();
            if (provider.isSelectionAllowed (widget, localLocation, invertSelection)) {
                aiming = provider.isAimingAllowed (widget, localLocation, invertSelection);
                if (aiming) {
                    updateState (widget, localLocation);
                    return State.createLocked (widget, this);
                } else {
                    provider.select (widget, localLocation, invertSelection);
                    // check if the widget is still selected...
                    Object object = null;
                    if (widget instanceof SelectionWidget)
                    {
                         object = ((ObjectScene)widget.getScene()).findObject ( ((SelectionWidget)widget).getRealWidget() );
                    }
                    else
                    {
                        object = ((ObjectScene)widget.getScene()).findObject (widget);
                    }
                    
                    if (!((ObjectScene)widget.getScene()).getSelectedObjects().contains (object))
                    {
                        return State.CONSUMED;
                    }
                    return State.CHAIN_ONLY;
                }
            }
        }
        return State.REJECTED;
    }
 
开发者ID:JockiHendry,项目名称:ireport-fork,代码行数:41,代码来源:SelectAction.java


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