private void setBorders(Tile tile, Territory t){
		int tX = tile.getX();
		int tY = tile.getY();
		final int MARGIN = 2;
		// The margin will be added to the borders to ensure there is no overlapping of borders, margin should be equal to painted line width for the border

		// check northern border
		if (tY - 1 >= 0)
			if (tiles[tX][tY -1].getTerritory().getID() != t.getID())
				t.getBorder().add(new OffsetLine(tX * Tile.SIZE, tY * Tile.SIZE + MARGIN, tX* Tile.SIZE + Tile.SIZE, tY * Tile.SIZE + MARGIN));
		// check eastern border
		if (tX + 1 <= size - 1)
			if (tiles[tX + 1][tY].getTerritory().getID() != t.getID())
				t.getBorder().add(new OffsetLine(tX * Tile.SIZE + Tile.SIZE - MARGIN, tY * Tile.SIZE, tX* Tile.SIZE + Tile.SIZE - MARGIN, tY * Tile.SIZE + Tile.SIZE));
		// check southern border
		if (tY + 1 <= size - 1)
			if (tiles[tX][tY + 1].getTerritory().getID() != t.getID())
				t.getBorder().add(new OffsetLine(tX * Tile.SIZE, tY * Tile.SIZE + Tile.SIZE - MARGIN, tX* Tile.SIZE + Tile.SIZE, tY * Tile.SIZE + Tile.SIZE - MARGIN));
		// check western border
		if (tX - 1 >= 0)
			if (tiles[tX - 1][tY].getTerritory().getID() != t.getID())
				t.getBorder().add(new OffsetLine(tX * Tile.SIZE + MARGIN, tY * Tile.SIZE, tX* Tile.SIZE + MARGIN, tY * Tile.SIZE + Tile.SIZE));

	}