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


Java Widget.isHitAt方法代码示例

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


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

示例1: resolveReplacementWidgetCoreDive

import org.netbeans.api.visual.widget.Widget; //导入方法依赖的package包/类
private boolean resolveReplacementWidgetCoreDive (Widget[] result, Widget widget, Point parentLocation) {
    if (widget == connectionWidget)
        return false;

    Point widgetLocation = widget.getLocation ();
    Point location = new Point (parentLocation.x - widgetLocation.x, parentLocation.y - widgetLocation.y);

    if (! widget.getBounds ().contains (location))
        return false;

    java.util.List<Widget> children = widget.getChildren ();
    for (int i = children.size () - 1; i >= 0; i --) {
        if (resolveReplacementWidgetCoreDive (result, children.get (i), location))
            return true;
    }

    if (! widget.isHitAt (location))
        return false;

    ConnectorState state = provider.isReplacementWidget (connectionWidget, widget, reconnectingSource);
    if (state == ConnectorState.REJECT)
        return false;
    if (state == ConnectorState.ACCEPT)
        result[0] = widget;
    return true;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:27,代码来源:ReconnectAction.java

示例2: resolveTargetWidgetCoreDive

import org.netbeans.api.visual.widget.Widget; //导入方法依赖的package包/类
private boolean resolveTargetWidgetCoreDive (Widget[] result, Widget widget, Point parentLocation) {
    if (interractionLayer.equals (widget))
        return false;
    Point widgetLocation = widget.getLocation ();
    Point location = new Point (parentLocation.x - widgetLocation.x, parentLocation.y - widgetLocation.y);

    if (! widget.getBounds ().contains (location))
        return false;

    java.util.List<Widget> children = widget.getChildren ();
    for (int i = children.size () - 1; i >= 0; i --) {
        if (resolveTargetWidgetCoreDive (result, children.get (i), location))
            return true;
    }

    if (! widget.isHitAt (location))
        return false;

    ConnectorState state = provider.isTargetWidget (sourceWidget, widget);
    if (state == ConnectorState.REJECT)
        return false;
    if (state == ConnectorState.ACCEPT)
        result[0] = widget;
    return true;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:26,代码来源:ConnectAction.java

示例3: updateState

import org.netbeans.api.visual.widget.Widget; //导入方法依赖的package包/类
private void updateState (Widget widget, Point localLocation) {
    if (widget != null  &&  ! widget.isHitAt (localLocation))
        widget = null;
    if (widget == aimedWidget)
        return;
    if (aimedWidget != null)
        aimedWidget.setState (aimedWidget.getState ().deriveWidgetAimed (false));
    aimedWidget = widget;
    if (aimedWidget != null)
        aimedWidget.setState (aimedWidget.getState ().deriveWidgetAimed (true));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:SelectAction.java


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