/** * Paints up the arena and all the surfaces and objects inside without DoubleBuffering. * * @param svgGraphics */ public void paintUnbuffered(Graphics svgGraphics) { svgGraphics.setColor(Color.WHITE); svgGraphics.fillRect(this.getX(), this.getY(), screenWidth, screenHeight); for (Surface vivaeObject : surfaces) { vivaeObject.paintComponent(svgGraphics); } for (Passive vivaeObject : getPassives()) { vivaeObject.paintComponent(svgGraphics, false); } for (Active active : actives) { active.paintComponent(svgGraphics, false); } }
@Override /** Paints up the arena and all the surfaces and objects inside using DoubleBuffering. */ public void paint(Graphics g) { if (offscreen == null) { return; } bufferGraphics.setColor(Color.WHITE); bufferGraphics.fillRect(this.getX(), this.getY(), screenWidth, screenHeight); for (Surface vivaeObject : surfaces) { vivaeObject.paintComponent(bufferGraphics); } for (Passive vivaeObject : getPassives()) { vivaeObject.paintComponent(bufferGraphics, isObjectsOnSightBlinking); } for (VivaeObject vivaeObject : getPaintable()) { vivaeObject.paintComponent(bufferGraphics, isObjectsOnSightBlinking); } for (Active active : actives) { active.paintComponent(bufferGraphics, isObjectsOnSightBlinking); } g.drawImage(offscreen, 0, 0, this); }