public void refreshSelection(MouseEvent e) {
		if (image !=null && image.getImage() != null && map!=null) {
			if (e.getX()>=0 && e.getX() <width*zoom && e.getY() >= 0 && e.getY() < height*zoom) {
				Vector<Integer> tileSelected = image.getTile();
				int w=0, width=0, height=0, x=-1, y=-1;
				if (tileSelected.size()>1) {
				for (int v : tileSelected) {
					if (v==-1) {
						if(w!=0) {
							width=w;
							height++;
						}
					w=0;
					} else  {
						if (x==-1) x=v%(image.getImage().getWidth()/(8*zoom));
						if (y==-1) y=v/(image.getImage().getWidth()/(8*zoom));
						w++;
						if (w >= image.getImage().getWidth()/(8*zoom))  {
							height++;
							width = w;
							w=0;
						}
					}
				}
				if ((x+width)>image.getImage().getWidth()/(8*zoom)) width = (image.getImage().getWidth()/(8*zoom))-x;
				if ((y+height)>image.getImage().getHeight()/(8*zoom)) height = (image.getImage().getHeight()/(8*zoom))-y;
				} else if (tileSelected.size()==1) {
					width=1;height=1;
					x=tileSelected.get(0) %(image.getImage().getWidth()/(8*zoom));
					y=tileSelected.get(0) /(image.getImage().getWidth()/(8*zoom));
				}
				Graphics2D g2 = (Graphics2D) selection.getGraphics();
				g2.setBackground(new Color(0, 0, 0, 0));
				g2.clearRect(0, 0, 100*8*zoom, 100*8*zoom);
				g2.setColor(new Color(255, 0, 0));
				g2.drawRect((e.getX()/(8*zoom))*(8*zoom), (e.getY()/(8*zoom))*(8*zoom), width*(8*zoom), height*(8*zoom));
			} else {
				Graphics2D g2 = (Graphics2D) selection.getGraphics();
				g2.setBackground(new Color(0, 0, 0, 0));
				g2.clearRect(0, 0, 100*8*zoom, 100*8*zoom);
			}
		}
	}