java.awt.Window.paint()方法的使用及代码示例

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

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

Window.paint介绍

暂无

代码示例

代码示例来源:origin: plantuml/plantuml

@Override
public void paint(Graphics g) {
  super.paint(g);
  g.setColor(Color.WHITE);
  g.fillRect(0, 0, width, height);
  g.setColor(Color.BLACK);
  g.drawRect(0, 0, width - 1, height - 1);
  g.drawRect(1, 1, width - 3, height - 3);
  // g.setColor(Color.RED);
  // final String status = done + "/" + total;
  // g.drawString(status, width / 2, height / 2);
  g.drawImage(logo, width - logo.getWidth() - 4, height - logo.getHeight() - 4, null);
  drawProgessBar(g, done.intValue(), total.intValue());
  final int nbErrors = errors.get();
  if (nbErrors > 0) {
    g.setColor(Color.RED);
    final String message = "" + nbErrors + (nbErrors > 1 ? " diagrams" : " diagram") + " contains errors";
    g.drawString(message, 10, 20);
  }
  g.setColor(link);
  final String urllink = "http://plantuml.com";
  final Rectangle2D rect = getUsed(g, urllink);
  g.drawString(urllink, 10, (int) (height - rect.getMaxY()));
  limY = (int) (height - rect.getMaxY() + rect.getMinY());
  limX = (int) (10 + rect.getMaxX());
}

代码示例来源:origin: com.jalalkiswani/jk-desktop

@Override
  public void paint(Graphics g) {
    super.paint(g);
    if (header != null) {
//            setForeground(Colors.SPLASH_HEADER_COLOR);
//            // text
//            setFont(getFont().deriveFont(40f));
//            FontMetrics metrics = g.getFontMetrics(getFont());
//            int width = metrics.stringWidth(header);
//            g.drawString(header, (getWidth() / 2) - (width - 2), getHeight() / 2);
//            // shaddow
//            setForeground(Color.black);
//            g.drawString(header, (getWidth() / 2) - (width - 2) + 10, getHeight() / 2 + 10);
//
    }
  }

代码示例来源:origin: cmu-phil/tetrad

@Override
  public void paint(Graphics g) {
    super.paint(g);
    if (splashIm != null) {
      g.drawImage(splashIm, 0, 0, this);
    }
  }
}

代码示例来源:origin: net.sourceforge.plantuml/plantuml

@Override
public void paint(Graphics g) {
  super.paint(g);
  g.setColor(Color.WHITE);
  g.fillRect(0, 0, width, height);
  g.setColor(Color.BLACK);
  g.drawRect(0, 0, width - 1, height - 1);
  g.drawRect(1, 1, width - 3, height - 3);
  // g.setColor(Color.RED);
  // final String status = done + "/" + total;
  // g.drawString(status, width / 2, height / 2);
  g.drawImage(logo, width - logo.getWidth() - 4, height - logo.getHeight() - 4, null);
  drawProgessBar(g, done.intValue(), total.intValue());
  final int nbErrors = errors.get();
  if (nbErrors > 0) {
    g.setColor(Color.RED);
    final String message = "" + nbErrors + (nbErrors > 1 ? " diagrams" : " diagram") + " contains errors";
    g.drawString(message, 10, 20);
  }
  g.setColor(link);
  final String urllink = "http://plantuml.com";
  final Rectangle2D rect = getUsed(g, urllink);
  g.drawString(urllink, 10, (int) (height - rect.getMaxY()));
  limY = (int) (height - rect.getMaxY() + rect.getMinY());
  limX = (int) (10 + rect.getMaxX());
}

代码示例来源:origin: stackoverflow.com

frame.paint(graphics2D);
ImageIO.write(image,"jpeg", new File("/home/deniz/Desktop/jmemPractice.jpeg"));

代码示例来源:origin: stackoverflow.com

BufferedImage screenshot;
 GraphicsDevice gd = GraphicsEnvironment
     .getLocalGraphicsEnvironment()
     .getDefaultScreenDevice();
 Window window = gd.getFullScreenWindow();
 if(window == null) {
   Robot robot = new Robot();
   GraphicsConfiguration config = gd.getDefaultConfiguration();
   screenshot = robot.createScreenCapture(config.getBounds()); 
 } else {
   screenshot = new BufferedImage(window.getWidth(),
       window.getHeight(),
       BufferedImage.TYPE_INT_RGB);
   window.paint(screenshot.getGraphics());
 }
 ImageIO.write(screenshot, "png", file);

代码示例来源:origin: uk.co.caprica/vlcj

@Override
  public void paint(Graphics g) {
    super.paint(g);
    Graphics2D g2 = (Graphics2D)g;
    g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    GradientPaint gp = new GradientPaint(180.0f, 280.0f, new Color(255, 255, 255, 255), 250.0f, 380.0f, new Color(255, 255, 0, 0));
    g2.setPaint(gp);
    for(int i = 0; i < 3; i ++ ) {
      g2.drawOval(150, 280, 100, 100);
      g2.fillOval(150, 280, 100, 100);
      g2.translate(120, 20);
    }
  }
}

代码示例来源:origin: stackoverflow.com

g2.translate(pXStart, pYStart);
g2.scale(xRatio, xRatio);
frame.paint(g2);
return Printable.PAGE_EXISTS;

代码示例来源:origin: stackoverflow.com

f.paint(f.getGraphics());

代码示例来源:origin: stackoverflow.com

at sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:97)
at java.awt.Container.paint(Container.java:1778)
at java.awt.Window.paint(Window.java:3379)

相关文章

Window类方法