* @param drawUnexploredBorders If true; draws border between explored and
     *        unexplored terrain.
     */
    private void displayBaseTile(Graphics2D g, Tile tile, boolean drawUnexploredBorders) {
        if (tile != null) {
            int x = tile.getX();
            int y = tile.getY();
            // ATTENTION: we assume that all base tiles have the same size
            g.drawImage(lib.getTerrainImage(tile.getType(), x, y), 0, 0, null);
            if (tile.isExplored()) {
                if (!tile.isLand() && tile.getStyle() > 0) {
                    int edgeStyle = tile.getStyle() >> 4;
                    if (edgeStyle > 0) {
                        g.drawImage(lib.getBeachEdgeImage(edgeStyle, x, y), 0, 0, null);
                    }
                    int cornerStyle = tile.getStyle() & 15;
                    if (cornerStyle > 0) {
                        g.drawImage(lib.getBeachCornerImage(cornerStyle, x, y), 0, 0, null);
                    }
                }

                for (Direction direction : Direction.values()) {
                    Tile borderingTile = tile.getAdjacentTile(direction);
                    if (borderingTile != null) {

                        if (!drawUnexploredBorders && !borderingTile.isExplored() &&
                            (direction == Direction.SE || direction == Direction.S ||
                             direction == Direction.SW)) {
                            continue;
                        }

                        if (tile.getType() == borderingTile.getType()) {
                            // Equal tiles, no need to draw border
                            continue;
                        } else if (tile.isLand() && !borderingTile.isLand()) {
                            // The beach borders are drawn on the side of water tiles only
                            continue;
                        } else if (!tile.isLand() && borderingTile.isLand() && borderingTile.isExplored()) {
                            // If there is a Coast image (eg. beach) defined, use it, otherwise skip
                            // Draw the grass from the neighboring tile, spilling over on the side of this tile
                            g.drawImage(lib.getBorderImage(borderingTile.getType(), direction,
                                                           x, y), 0, 0, null);
                            TileImprovement river = borderingTile.getRiver();
                            if (river != null && (direction == Direction.SE || direction == Direction.SW ||
                                                  direction == Direction.NE || direction == Direction.NW)) {
                                int[] branches = river.getStyleBreakdown(Direction.longSides, 3);
                                if (branches[direction.getReverseDirection().ordinal()] > 0) {
                                    g.drawImage(lib.getRiverMouthImage(direction, borderingTile.getRiver()
                                                                       .getMagnitude(), x,
                                                                       y), 0, 0, null);
                                }
                            }
                        } else if (borderingTile.isExplored()) {
                            if (lib.getTerrainImage(tile.getType(), 0, 0)
                                .equals(lib.getTerrainImage(borderingTile.getType(), 0, 0))) {
                                // Do not draw limit between tile that share same graphics (ocean & great river)
                                continue;
                            } else if (borderingTile.getType().getIndex() < tile.getType().getIndex()) {
                                // Draw land terrain with bordering land type, or ocean/high seas limit
                                g.drawImage(lib.getBorderImage(borderingTile.getType(), direction,
                                                               x, y), 0, 0, null);
                            }
                        }
                    }
                }
            }
        }
    }