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

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

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

Widget.paintWidget介绍

[英]Called to paint the widget itself only using the Graphics2D instance acquired from Scene.getGraphics method.
[中]仅使用从场景中获取的Graphics2D实例调用来绘制小部件本身。getGraphics方法。

代码示例

代码示例来源:origin: nl.cloudfarming.client/geoviewer-editor

@Override
  protected void paintWidget() {
    super.paintWidget();
    Graphics g = getGraphics().create();
    g.setColor(Color.RED);
    g.fill3DRect(4, 4, 4, 4, true);
    g.dispose();
  }
}

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

/**
 * Paints the widget with its children widget into the Graphics2D instance acquired from Scene.getGraphics method.
 */
public final void paint () {
  if (! visible)
    return;
  assert bounds != null : MESSAGE_NULL_BOUNDS; // NOI18N
  Graphics2D gr = scene.getGraphics ();
  AffineTransform previousTransform = gr.getTransform();
  gr.translate (location.x, location.y);
  Shape tempClip = null;
  if (checkClipping) {
    tempClip = gr.getClip ();
    gr.clip (bounds);
  }
  if (! checkClipping  ||  bounds.intersects (gr.getClipBounds ())) {
    if (opaque)
      paintBackground ();
    paintBorder ();
    if (checkClipping) {
      Insets insets = border.getInsets ();
      gr.clipRect (bounds.x + insets.left, bounds.y + insets.top, bounds.width - insets.left - insets.right, bounds.height - insets.top - insets.bottom);
    }
    paintWidget ();
    paintChildren ();
  }
  if (checkClipping)
    gr.setClip (tempClip);
  gr.setTransform(previousTransform);
}

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

paintWidget ();
paintChildren ();

相关文章