canvasGraphics.fillRect(0, 0, width, height);
canvasGraphics.fillRect(origX, origY, w, h);
private void redraw(Graphics g) {	if (Settings.getInstance().getNavigator())		createNavigatorImage();		ViewState view = ViewState.getInstance();			if ((canvasImage==null) || 		(canvasSize.width!=width) || 		(canvasSize.height!=height)) {		    canvasImage = getWorkspacePanel().createImage(width, height);	    if (canvasImage==null) return;	    canvasSize = new Dimension(width, height);	    canvasGraphics = canvasImage.getGraphics();	}	canvasGraphics.setColor(Constants.BACKGROUND_COLOR);	canvasGraphics.fillRect(0, 0, width, height);	if (Settings.getInstance().getShowGrid())	{		canvasGraphics.setColor(Constants.GRID_COLOR);		int gridSize = view.getGridSize();		int sx = view.getGridSize() - view.getRx() % gridSize;		int y0 = view.getGridSize() - view.getRy() % gridSize;		int xsteps = view.getViewWidth() / gridSize + 1;		int ysteps = view.getViewHeight() / gridSize + 1;		if (gridSize >= 15)		// crosses		for (int y=0; y < ysteps; y++) {			int x0 = sx;			for (int x=0; x < xsteps; x++) {				canvasGraphics.drawLine(x0-1, y0-1, x0+1, y0+1);				canvasGraphics.drawLine(x0-1, y0+1, x0+1, y0-1);				x0+=gridSize;			}			y0+=gridSize;		}		else		// dots		for (int y=0; y < ysteps; y++) {			int x0 = sx;			for (int x=0; x < xsteps; x++) {				canvasGraphics.drawLine(x0, y0, x0, y0);				x0+=gridSize;			}			y0+=gridSize;		}	}	viewGroup.paintComponents(canvasGraphics, false, isFlat());	if (canvasGraphics!=null) copyCanvasImage(g);	}