public void setupGrid(int nx, int ny) {
		if (nx > 0 && ny > 0) {
			if (boundary.getType() != RectangularBoundary.DBC_ID) {
				grid = new Grid(boundary, new int[] { nx, ny });
			} else {
				grid = new Grid((Rectangle2D.Double) boundary.getView(), new int[] { nx, ny });
			}
			view.setGrid(grid);
			if (job == null)
				initializeJob();
			if (!job.contains(updateGrid))
				job.add(updateGrid);
		} else {
			grid = null;
			view.setGrid(null);
			view.setGridMode((byte) -1);
			if (job != null)
				job.remove(updateGrid);
		}
	}