214215216217218219220221222223224
} g.drawImage(image, 0, 0, getWidth(), getHeight(), null); g.dispose(); bs.show(); } /** * Opens a GUI to display. *
165166167168169170171172173174175
public void update() { Window window = device.getFullScreenWindow(); if (window != null) { BufferStrategy strategy = window.getBufferStrategy(); if (!strategy.contentsLost()) { strategy.show(); } } // Sync the display on some systems. // (on Linux, this fixes event queue problems) Toolkit.getDefaultToolkit().sync();
7374757677787980818283
for (int i = 0; i < numBuffers; i++) { Graphics g = bufferStrategy.getDrawGraphics(); if (!bufferStrategy.contentsLost()) { g.setColor(COLORS[i]); g.fillRect(0,0,bounds.width, bounds.height); bufferStrategy.show(); g.dispose(); } try { Thread.sleep((int)lag); } catch (InterruptedException e) {}
8586878889909192939495
Graphics g = bs.getDrawGraphics(); render(g); g.dispose(); bs.show(); Toolkit.getDefaultToolkit().sync(); try { Thread.sleep(SLEEP_TIME); } catch (InterruptedException e) { e.printStackTrace();
124125126127128129130131132133134
g.drawString("Rendering test", 20, 20); g.drawImage(bi, 50, 50, null); g.dispose(); bs.show(); } while (bs.contentsLost()||bs.contentsRestored()); } } }
335336337338339340341342343344345
while (!done) { if (useBS) { Graphics g = bs.getDrawGraphics(); renderDimensions(g, fsWindow.getBounds(), fsWindow.getGraphicsConfiguration()); bs.show(); } else { fsWindow.repaint(); } try { Thread.sleep(1000);
2728293031323334353637
for(Component component : components) { component.render(graphics); } bufferStrategy.show(); } finally { graphics.dispose(); }
259260261262263264265266267268269
int hh = HEIGHT * 3; int xo = (getWidth() - ww) / 2; int yo = (getHeight() - hh) / 2; g.drawImage(image, xo, yo, ww, hh, null); g.dispose(); bs.show(); } private void renderGui() { for (int y = 0; y < 2; y++) { for (int x = 0; x < 20; x++) {
9293949596979899100101102
public void update() { Window window = device.getFullScreenWindow(); if (window != null) { BufferStrategy strategy = window.getBufferStrategy(); if (!strategy.contentsLost()) { strategy.show(); } } // Sync the display on some systems. On Linux, this fixes event queue problems. Toolkit.getDefaultToolkit().sync();
190191192193194195196197198199200
int x = (getWidth() - getHeight())/2; g.drawImage(image, x, 0, getHeight(), getHeight(), this); g.dispose(); strategy.show(); } private void paintComponent(Graphics2D g) { g.setColor(Color.WHITE); g.fillRect(0, 0, WIDTH, HEIGHT);