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

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

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

Widget.getChildren介绍

[英]Returns a list of children widgets.
[中]返回子窗口小部件的列表。

代码示例

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

public int getAccessibleChildrenCount () {
  return widget.getChildren ().size ();
}

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

public Accessible getAccessibleChild (int i) {
  return widget.getChildren ().get (i);
}

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

public Accessible getAccessibleChild (int i) {
  return widget.getChildren ().get (i);
}

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

public int getAccessibleChildrenCount () {
  return widget.getChildren ().size ();
}

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

private static List<Widget> getAllNodeWidgets(Widget widget, List<Widget> widgetList) {
  if (widgetList == null) {
    widgetList = new ArrayList<Widget>();
  }
  if (widget instanceof LayerWidget && widget.getChildren().size() > 0) //widget has children
  {
    widgetList.addAll(widget.getChildren());
    for (Widget child : widget.getChildren()) {
      getAllNodeWidgets(child, widgetList);
    }
  }
  return widgetList;
}

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

private static List<Widget> getAllNodeWidgets(Widget widget, List<Widget> widgetList) {
  if (widgetList == null) {
    widgetList = new ArrayList<Widget>();
  }
  if (widget instanceof LayerWidget && widget.getChildren().size() > 0) //widget has children
  {
    widgetList.addAll(widget.getChildren());
    for (Widget child : widget.getChildren()) {
      getAllNodeWidgets(child, widgetList);
    }
  }
  return widgetList;
}

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

public void select (Widget widget, Point localLocation, boolean invertSelection) {
    Widget currentActiveCard = LayoutFactory.getActiveCard (cardLayoutWidget);

    List<Widget> children = cardLayoutWidget.getChildren ();
    int i = children.indexOf (currentActiveCard);
    i ++;
    if (i >= children.size ())
      i = 0;
    Widget newActiveCard = children.get (i);

    if (currentActiveCard == newActiveCard)
      return;

    LayoutFactory.setActiveCard (cardLayoutWidget, newActiveCard);
//        notifyCardSwitched (currentActiveCard, newActiveCard);
  }

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

public void select (Widget widget, Point localLocation, boolean invertSelection) {
    Widget currentActiveCard = LayoutFactory.getActiveCard (cardLayoutWidget);

    List<Widget> children = cardLayoutWidget.getChildren ();
    int i = children.indexOf (currentActiveCard);
    i ++;
    if (i >= children.size ())
      i = 0;
    Widget newActiveCard = children.get (i);

    if (currentActiveCard == newActiveCard)
      return;

    LayoutFactory.setActiveCard (cardLayoutWidget, newActiveCard);
//        notifyCardSwitched (currentActiveCard, newActiveCard);
  }

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

public int getAccessibleIndexInParent () {
  return widget != widget.getScene () ? widget.getParentWidget ().getChildren ().indexOf (widget) : 0;
}

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

public int getAccessibleIndexInParent () {
  return widget != widget.getScene () ? widget.getParentWidget ().getChildren ().indexOf (widget) : 0;
}

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

public void layout (Widget widget) {
  Dimension total = new Dimension ();
  for (Widget child : widget.getChildren ()) {
    if (! child.isVisible ())
      continue;
    Dimension size = child.getPreferredBounds ().getSize ();
    if (size.width > total.width)
      total.width = size.width;
    if (size.height > total.height)
      total.height = size.height;
  }
  for (Widget child : widget.getChildren ()) {
    Point location = child.getPreferredBounds ().getLocation ();
    child.resolveBounds (new Point (- location.x, - location.y), new Rectangle (location, total));
  }
}

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

public void layout (Widget widget) {
  Collection<Widget> children = widget.getChildren ();
  for (Widget child : children) {
    if (child.isVisible ())
      child.resolveBounds (child.getPreferredLocation (), null);
    else
      child.resolveBounds (null, new Rectangle ());
  }
}

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

public void layout (Widget widget) {
  Collection<Widget> children = widget.getChildren ();
  for (Widget child : children) {
    if (child.isVisible ())
      child.resolveBounds (child.getPreferredLocation (), null);
    else
      child.resolveBounds (null, new Rectangle ());
  }
}

代码示例来源: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: 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: 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: 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

protected void performLayout () {
  devolveLayout.layout (widget);
  for (Widget child : widget.getChildren ()) {
    if (animate)
      widget.getScene ().getSceneAnimator ().animatePreferredLocation (child, child.getLocation ());
    else
      child.setPreferredLocation (child.getLocation ());
    child.revalidate ();
  }
}

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

protected void performLayout () {
  devolveLayout.layout (widget);
  for (Widget child : widget.getChildren ()) {
    if (animate)
      widget.getScene ().getSceneAnimator ().animatePreferredLocation (child, child.getLocation ());
    else
      child.setPreferredLocation (child.getLocation ());
    child.revalidate ();
  }
}

相关文章