本文整理汇总了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;
}
示例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;
}
示例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));
}