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


Java Widget.getClientArea方法代码示例

本文整理汇总了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);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:AlignWithMoveStrategyProvider.java

示例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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:DefaultAnchorShapeResolver.java

示例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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:DefaultAnchorShapeResolver.java

示例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());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:ConnectionWidgetLayout.java

示例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());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:ConnectionWidgetLayout.java

示例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 ());
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:OverlayLayout.java

示例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);
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:10,代码来源:ArrowWidget.java


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