本文整理汇总了Java中org.netbeans.api.visual.widget.Widget.getClientArea方法的典型用法代码示例。如果您正苦于以下问题:Java Widget.getClientArea方法的具体用法?Java Widget.getClientArea怎么用?Java Widget.getClientArea使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.netbeans.api.visual.widget.Widget
的用法示例。
在下文中一共展示了Widget.getClientArea方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: locationSuggested
import org.netbeans.api.visual.widget.Widget; //导入方法依赖的package包/类
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);
}
示例2: getSourceBounds
import org.netbeans.api.visual.widget.Widget; //导入方法依赖的package包/类
private Rectangle getSourceBounds()
{
Widget source = connection.getSourceAnchor().getRelatedWidget();
if(source != null)
{
Point sourceLocation = source.getLocation();
Rectangle clientArea = source.getClientArea();
return new Rectangle(sourceLocation, clientArea.getSize());
}
return null;
}
示例3: getTargetBounds
import org.netbeans.api.visual.widget.Widget; //导入方法依赖的package包/类
private Rectangle getTargetBounds()
{
Widget target = connection.getTargetAnchor().getRelatedWidget();
if(target != null)
{
Point targetLocation = target.getLocation();
Rectangle targetArea = target.getClientArea();
return new Rectangle(targetLocation, targetArea.getSize());
}
return null;
}
示例4: getSourceBounds
import org.netbeans.api.visual.widget.Widget; //导入方法依赖的package包/类
private Rectangle getSourceBounds(ConnectionWidget connectionWidget) {
Widget source = connectionWidget.getSourceAnchor().getRelatedWidget();
if (source == null)
return null;
Point sourceLocation = source.getLocation();
Rectangle clientArea = source.getClientArea();
return new Rectangle(sourceLocation, clientArea.getSize());
}
示例5: getTargetBounds
import org.netbeans.api.visual.widget.Widget; //导入方法依赖的package包/类
private Rectangle getTargetBounds(ConnectionWidget connectionWidget) {
Widget target = connectionWidget.getTargetAnchor().getRelatedWidget();
if (target == null)
return null;
Point targetLocation = target.getLocation();
Rectangle targetArea = target.getClientArea();
return new Rectangle(targetLocation, targetArea.getSize());
}
示例6: justify
import org.netbeans.api.visual.widget.Widget; //导入方法依赖的package包/类
public void justify (Widget widget) {
Rectangle clientArea = widget.getClientArea ();
for (Widget child : widget.getChildren ()) {
if (child.isVisible ()) {
Point location = child.getPreferredBounds ().getLocation ();
child.resolveBounds (new Point (clientArea.x - location.x, clientArea.y - location.y), new Rectangle (location, clientArea.getSize ()));
} else {
child.resolveBounds (clientArea.getLocation (), new Rectangle ());
}
}
}
示例7: compute
import org.netbeans.api.visual.widget.Widget; //导入方法依赖的package包/类
@Override
public Result compute(Entry entry) {
Widget widget = getRelatedWidget();
int widgetWidth = widget.getClientArea().width;
Point rightAnchorPoint = new Point(widgetWidth, ShedWidget.height / 2);
Point sceneLocation = widget.convertLocalToScene(rightAnchorPoint);
return new Anchor.Result(new Point(sceneLocation), Anchor.Direction.RIGHT);
}