Пример #1
0
  /**
   * 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);
    }
  }
Пример #2
0
  @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 (Active active : actives) {
      active.paintComponent(bufferGraphics, isObjectsOnSightBlinking);
    }
    // bufferGraphics.draw(new Rectangle(10,10,100,100));
    // frictionBuffer.paintSensorBuffer(bufferGraphics);
    g.drawImage(offscreen, 0, 0, this);
  }