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

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

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

Widget.revalidate介绍

[英]Schedules the widget for revalidation. The Scene.validate method has to be called after all changes to invoke validation. In some cases it is invoked automatically.
[中]安排小部件进行重新验证。现场。必须在所有更改之后调用validate方法才能调用验证。在某些情况下,它会自动调用。

代码示例

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

/**
 * Sets whether the widget is visible.
 * @param visible if true, then the widget is visible
 */
public final void setVisible (boolean visible) {
  this.visible = visible;
  revalidate ();
}

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

/**
 * Sets the layout of the widget.
 * @param layout the layout
 */
public final void setLayout (Layout layout) {
  this.layout = layout;
  revalidate ();
}

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

/**
 * Sets whether the widget is visible.
 * @param visible if true, then the widget is visible
 */
public final void setVisible (boolean visible) {
  this.visible = visible;
  revalidate ();
}

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

/**
 * Sets the layout of the widget.
 * @param layout the layout
 */
public final void setLayout (Layout layout) {
  this.layout = layout;
  revalidate ();
}

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

/**
 * Sets a preferred bounds that are specified relatively to the location of the widget.
 * @param preferredBounds the preferred bounds; if null, then the preferred bounds are unset
 */
public final void setPreferredBounds (Rectangle preferredBounds) {
  if (GeomUtil.equals (this.preferredBounds, preferredBounds))
    return;
  this.preferredBounds = preferredBounds;
  revalidate ();
}

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

/**
 * Schedules the widget to repaint or revalidation.
 * @param repaintOnly if true, then the widget is scheduled for repainting only;
 *            if false, then widget is scheduled for revalidation (the Scene.validate method has to be called after all changes to invoke validation)
 */
// NOTE - has to be called before a change is set into the widget when the change affects the local/scene location/boundary because repaint/revalidate needs to calculate old scene boundaries
public final void revalidate (boolean repaintOnly) {
  if (repaintOnly)
    repaint ();
  else
    revalidate ();
}

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

/**
 * Sets a maximum size of the widget
 * @param maximumSize the maximum size; if null, then maximum size are unset.
 */
public final void setMaximumSize (Dimension maximumSize) {
  if (GeomUtil.equals (this.maximumSize, maximumSize))
    return;
  this.maximumSize = maximumSize;
  revalidate ();
}

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

/**
 * Sets a minumum size of the widget
 * @param minimumSize the minimum size; if null, then minimum size are unset.
 */
public final void setMinimumSize (Dimension minimumSize) {
  if (GeomUtil.equals (this.minimumSize, minimumSize))
    return;
  this.minimumSize = minimumSize;
  revalidate ();
}

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

/**
 * Sets a maximum size of the widget
 * @param maximumSize the maximum size; if null, then maximum size are unset.
 */
public final void setMaximumSize (Dimension maximumSize) {
  if (GeomUtil.equals (this.maximumSize, maximumSize))
    return;
  this.maximumSize = maximumSize;
  revalidate ();
}

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

/**
 * Sets a preferred location of the widget.
 * @param preferredLocation the preferred location; if null, then the preferred location is unset
 */
public final void setPreferredLocation (Point preferredLocation) {
  if (GeomUtil.equals (this.preferredLocation, preferredLocation))
    return;
  this.preferredLocation = preferredLocation;
  revalidate ();
}

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

/**
 * Sets a preferred bounds that are specified relatively to the location of the widget.
 * @param preferredBounds the preferred bounds; if null, then the preferred bounds are unset
 */
public final void setPreferredBounds (Rectangle preferredBounds) {
  if (GeomUtil.equals (this.preferredBounds, preferredBounds))
    return;
  this.preferredBounds = preferredBounds;
  revalidate ();
}

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

/**
 * Schedules the widget to repaint or revalidation.
 * @param repaintOnly if true, then the widget is scheduled for repainting only;
 *            if false, then widget is scheduled for revalidation (the Scene.validate method has to be called after all changes to invoke validation)
 */
// NOTE - has to be called before a change is set into the widget when the change affects the local/scene location/boundary because repaint/revalidate needs to calculate old scene boundaries
public final void revalidate (boolean repaintOnly) {
  if (repaintOnly)
    repaint ();
  else
    revalidate ();
}

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

/**
 * Sets a preferred location of the widget.
 * @param preferredLocation the preferred location; if null, then the preferred location is unset
 */
public final void setPreferredLocation (Point preferredLocation) {
  if (GeomUtil.equals (this.preferredLocation, preferredLocation))
    return;
  this.preferredLocation = preferredLocation;
  revalidate ();
}

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

/**
 * Sets a minumum size of the widget
 * @param minimumSize the minimum size; if null, then minimum size are unset.
 */
public final void setMinimumSize (Dimension minimumSize) {
  if (GeomUtil.equals (this.minimumSize, minimumSize))
    return;
  this.minimumSize = minimumSize;
  revalidate ();
}

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

/**
 * Sets a preferred size of the widget
 * @param preferredSize the preferred size; if null, then preferred size are unset.
 */
public final void setPreferredSize (Dimension preferredSize) {
  if (GeomUtil.equals (this.preferredSize, preferredSize))
    return;
  this.preferredSize = preferredSize;
  revalidate ();
}

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

/**
 * Sets a preferred size of the widget
 * @param preferredSize the preferred size; if null, then preferred size are unset.
 */
public final void setPreferredSize (Dimension preferredSize) {
  if (GeomUtil.equals (this.preferredSize, preferredSize))
    return;
  this.preferredSize = preferredSize;
  revalidate ();
}

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

/**
 * Sets the border of the widget.
 * @param border the border
 */
public final void setBorder (Border border) {
  assert border != null;
  boolean repaintOnly = this.border.getInsets ().equals (border.getInsets ());
  this.border = border;
  revalidate (repaintOnly);
}

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

/**
 * Sets the border of the widget.
 * @param border the border
 */
public final void setBorder (Border border) {
  assert border != null;
  boolean repaintOnly = this.border.getInsets ().equals (border.getInsets ());
  this.border = border;
  revalidate (repaintOnly);
}

代码示例来源: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 ();
  }
}

相关文章