org.netbeans.api.visual.widget.Widget.getClientArea()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(7.5k)|赞(0)|评价(0)|浏览(106)

本文整理了Java中org.netbeans.api.visual.widget.Widget.getClientArea()方法的一些代码示例,展示了Widget.getClientArea()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Widget.getClientArea()方法的具体详情如下:
包路径:org.netbeans.api.visual.widget.Widget
类名称:Widget
方法名:getClientArea

Widget.getClientArea介绍

[英]Returns a client area of the widget.
[中]返回小部件的客户端区域。

代码示例

代码示例来源:origin: in.jlibs/org-netbeans-api-visual

public java.util.List<Rectangle> getRegions (Widget movingWidget) {
  java.util.List<Widget> children = collectionLayer.getChildren ();
  ArrayList<Rectangle> regions = new ArrayList<Rectangle> (children.size ());
  for (Widget widget : children)
    if (widget != movingWidget)
      regions.add (widget.convertLocalToScene (outerBounds ? widget.getBounds () : widget.getClientArea ()));
  return regions;
}

代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual

public java.util.List<Rectangle> getRegions (Widget movingWidget) {
  java.util.List<Widget> children = collectionLayer.getChildren ();
  ArrayList<Rectangle> regions = new ArrayList<Rectangle> (children.size ());
  for (Widget widget : children)
    if (widget != movingWidget)
      regions.add (widget.convertLocalToScene (outerBounds ? widget.getBounds () : widget.getClientArea ()));
  return regions;
}

代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual

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;
  }
}

代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual

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());
}

代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual

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());
}

代码示例来源:origin: in.jlibs/org-netbeans-api-visual

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;
  }
}

代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual

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;
}

代码示例来源:origin: in.jlibs/org-netbeans-api-visual

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());
}

代码示例来源:origin: in.jlibs/org-netbeans-api-visual

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;
}

代码示例来源:origin: in.jlibs/org-netbeans-api-visual

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());
}

代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual

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 ());
    }
  }
}

代码示例来源:origin: in.jlibs/org-netbeans-api-visual

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 ());
    }
  }
}

代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual

public void justify (Widget widget) {
  assert widget == cardLayoutWidget;
  if (activeChildWidget != null  &&  activeChildWidget.isVisible ())
    for (Widget child : cardLayoutWidget.getChildren ())
      if (child == activeChildWidget) {
        Rectangle bounds = widget.getClientArea ();
        Point location = child.getLocation ();
        Rectangle childBounds = child.getBounds ();
        bounds.translate (- location.x, - location.y);
        childBounds.add (bounds);
        child.resolveBounds (location, bounds);
        return;
      }
}

代码示例来源:origin: in.jlibs/org-netbeans-api-visual

public void justify (Widget widget) {
  assert widget == cardLayoutWidget;
  if (activeChildWidget != null  &&  activeChildWidget.isVisible ())
    for (Widget child : cardLayoutWidget.getChildren ())
      if (child == activeChildWidget) {
        Rectangle bounds = widget.getClientArea ();
        Point location = child.getLocation ();
        Rectangle childBounds = child.getBounds ();
        bounds.translate (- location.x, - location.y);
        childBounds.add (bounds);
        child.resolveBounds (location, bounds);
        return;
      }
}

代码示例来源: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: in.jlibs/org-netbeans-api-visual

public void justify (Widget widget) {
  Rectangle parentBounds = widget.getClientArea ();
  int totalWeight = 0;
  int totalGap = 0;

代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual

public void justify (Widget widget) {
  Rectangle parentBounds = widget.getClientArea ();
  int totalWeight = 0;
  int totalGap = 0;

相关文章