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

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

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

Widget.addDependency介绍

[英]Adds a dependency listener which is notified when the widget placement or boundary is going to be changed or similar thing happens to its parent widget.
[中]添加一个依赖侦听器,当小部件的位置或边界将要更改或其父小部件发生类似情况时,该侦听器会收到通知。

代码示例

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

/**
 * Called by ConnectionWidget to register the usage of the anchor.
 * @param entry the anchor entry
 */
public final void addEntry (Anchor.Entry entry) {
  if (entry == null)
    return;
  notifyEntryAdded (entry);
  entries.add (entry);
  if (! attachedToWidget  &&  entries.size () > 0) {
    attachedToWidget = true;
    if (relatedWidget != null)
      relatedWidget.addDependency (this);
    notifyUsed ();
  }
  revalidateDependency ();
}

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

/**
 * Called by ConnectionWidget to register the usage of the anchor.
 * @param entry the anchor entry
 */
public final void addEntry (Anchor.Entry entry) {
  if (entry == null)
    return;
  notifyEntryAdded (entry);
  entries.add (entry);
  if (! attachedToWidget  &&  entries.size () > 0) {
    attachedToWidget = true;
    if (relatedWidget != null)
      relatedWidget.addDependency (this);
    notifyUsed ();
  }
  revalidateDependency ();
}

相关文章