public ImageMapper(Vector<HystoryElement> hystory, Vector<HystoryElement> hystoryRedo) {
	    	this.hystory = hystory;
	    this.hystoryRedo = hystoryRedo;
	    toRefresh = refreshSelection = active = dragging = false;
	    gridV = true;
	    	width = height = 256;
		map = null;
		image = null;
		spanel = null;
		offsetPaint = null;
		zoom = 1;
	    	grid = new BufferedImage(257, 257, BufferedImage.TYPE_INT_ARGB);
	    	selection = new BufferedImage(256*zoom + 1, 256*zoom + 1, BufferedImage.TYPE_INT_ARGB);
	    	Graphics g = grid.getGraphics();
		g.setColor(new Color(0, 0, 0, 50));
		for (int x = 0; x <256; x+=8) {
		    	for (int y = 0;y < 256; y+=8) {
		    		g.drawRect(x, y, 8, 8);
		    	}
		}
	    	addMouseListener(this);
	    	addMouseMotionListener(this);
    }