/**
   * Update a single tile
   *
   * @param x
   * @param y
   */
  public void paintTile(int x, int y) {
    Graphics g = dbImage.getGraphics();

    tileSet.drawEditorTile(g, x * TileSet.TILE_DIMENSION, y * TileSet.TILE_DIMENSION, x, y);

    g.setColor(Color.BLACK);
    String p = "" + passabilitySet[x][y];

    int xpos;
    int ypos;

    if (pTiles != null) {
      xpos = x * TileSet.TILE_DIMENSION;
      ypos = y * TileSet.TILE_DIMENSION;
      if (passabilitySet[x][y] == TileSet.OVERLAY)
        g.drawImage(
            pTiles,
            xpos,
            ypos,
            xpos + TileSet.TILE_DIMENSION,
            ypos + TileSet.TILE_DIMENSION,
            0,
            0,
            32,
            32,
            null);
      else if (passabilitySet[x][y] == TileSet.IMPASSABLE)
        g.drawImage(
            pTiles,
            xpos,
            ypos,
            xpos + TileSet.TILE_DIMENSION,
            ypos + TileSet.TILE_DIMENSION,
            32,
            0,
            64,
            32,
            null);
    } else {
      xpos = x * TileSet.TILE_DIMENSION + (TileSet.TILE_DIMENSION / 2);
      ypos = y * TileSet.TILE_DIMENSION + (TileSet.TILE_DIMENSION / 2);
      for (int i = 0; i < 9; i++)
        g.drawString(p, xpos - 1 * ((i % 3) - 1), ypos - 1 * ((i / 3) - 1));
      g.setColor(Color.WHITE);
      g.drawString(p, xpos, ypos);
    }
    repaint();
  }