本文整理了Java中org.netbeans.api.visual.widget.Widget.convertSceneToLocal()
方法的一些代码示例,展示了Widget.convertSceneToLocal()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Widget.convertSceneToLocal()
方法的具体详情如下:
包路径:org.netbeans.api.visual.widget.Widget
类名称:Widget
方法名:convertSceneToLocal
[英]Converts a location in the scene coordination system to the local coordination system.
[中]将场景协调系统中的位置转换为本地协调系统。
代码示例来源:origin: it.tidalwave.netbeans/it-tidalwave-netbeans-visual
private boolean isHit (final @Nonnull Point point, final @Nonnull Widget widget)
{
// First check children, widget at last
for (final Widget child : widget.getChildren())
{
if (isHit(point, child))
{
return true;
}
}
if (!(widget instanceof Scene) && widget.isHitAt(widget.convertSceneToLocal(point)))
{
return true;
}
return false;
}
}
代码示例来源:origin: eu.limetri.client/mapviewer-nb-swing
/**
* Recursive method checking if a layerObject is clicked
*/
private boolean isLayerObjectHit(final Point point, final Widget widget) {
if ((widget instanceof GeometricalWidget) && widget.isHitAt(widget.convertSceneToLocal(point))) {
return true;
}
for (final Widget child : widget.getChildren()) {
if (isLayerObjectHit(point, child)) {
return true;
}
}
return false;
}
代码示例来源:origin: nl.cloudfarming.client/cloudfarming-client-geoviewer-jxmap
/**
* Returns true when the event occured on a widget.
*
* @param point Point from where the event was occured
* @param widget Widget to check
* @return
*/
private boolean isHit(final Point point, final Widget widget) {
for (final Widget child : widget.getChildren()) {
if (isHit(point, child)) {
return true;
}
}
if (!(widget instanceof Scene) && widget.isHitAt(widget.convertSceneToLocal(point))) {
return true;
}
return false;
}
代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual
break;
return widget.convertSceneToLocal (suggestedBounds);
代码示例来源:origin: in.jlibs/org-netbeans-api-visual
break;
return widget.convertSceneToLocal (suggestedBounds);
代码示例来源:origin: in.jlibs/org-netbeans-api-visual
public Point locationSuggested (Widget widget, Point originalLocation, Point suggestedLocation) {
Point widgetLocation = widget.getLocation ();
Rectangle widgetBounds = outerBounds ? widget.getBounds () : widget.getClientArea ();
Rectangle bounds = widget.convertLocalToScene (widgetBounds);
bounds.translate (suggestedLocation.x - widgetLocation.x, suggestedLocation.y - widgetLocation.y);
Insets insets = widget.getBorder ().getInsets ();
if (! outerBounds) {
suggestedLocation.x += insets.left;
suggestedLocation.y += insets.top;
}
Point point = super.locationSuggested (widget, bounds, suggestedLocation, true, true, true, true);
if (! outerBounds) {
point.x -= insets.left;
point.y -= insets.top;
}
return widget.getParentWidget ().convertSceneToLocal (point);
}
代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual
public Point locationSuggested (Widget widget, Point originalLocation, Point suggestedLocation) {
Point widgetLocation = widget.getLocation ();
Rectangle widgetBounds = outerBounds ? widget.getBounds () : widget.getClientArea ();
Rectangle bounds = widget.convertLocalToScene (widgetBounds);
bounds.translate (suggestedLocation.x - widgetLocation.x, suggestedLocation.y - widgetLocation.y);
Insets insets = widget.getBorder ().getInsets ();
if (! outerBounds) {
suggestedLocation.x += insets.left;
suggestedLocation.y += insets.top;
}
Point point = super.locationSuggested (widget, bounds, widget.getParentWidget().convertLocalToScene(suggestedLocation), true, true, true, true);
if (! outerBounds) {
point.x -= insets.left;
point.y -= insets.top;
}
return widget.getParentWidget ().convertSceneToLocal (point);
}
代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual
location = lockedWidget.convertSceneToLocal (new Point ());
event.translatePoint (location.x, location.y);
state = operator.operate (lockedAction, lockedWidget, event);
代码示例来源:origin: in.jlibs/org-netbeans-api-visual
location = lockedWidget.convertSceneToLocal (new Point ());
event.translatePoint (location.x, location.y);
state = operator.operate (lockedAction, lockedWidget, event);
内容来源于网络,如有侵权,请联系作者删除!