public void setFillMode(FillMode fm) {
		fillMode = fm;
		if (fillMode == null || fillMode == FillMode.getNoFillMode()) {
			setBackground(Color.white);
			setBackgroundImage(null);
		} else if (fillMode instanceof FillMode.ColorFill) {
			setBackground(((FillMode.ColorFill) fillMode).getColor());
			setBackgroundImage(null);
		} else if (fillMode instanceof FillMode.ImageFill) {
			String codeBase = FileUtilities.getCodeBase((String) getModel().getProperty("url"));
			if (codeBase != null) {
				String fileName = FileUtilities.getFileName(((FillMode.ImageFill) fillMode).getURL());
				if (fileName != null) {
					String s = codeBase + fileName;
					ImageIcon icon = null;
					if (MDContainer.isApplet() || FileUtilities.isRemote(s)) {
						try {
							icon = ConnectionManager.sharedInstance().loadImage(new URL(FileUtilities.httpEncode(s)));
						} catch (MalformedURLException e) {
							e.printStackTrace();
							setBackgroundImage(null);
							return;
						}
					} else {
						File f1 = new File(s);
						if (!f1.exists()) {
							/*
							 * if a copy of the background image does not exist in the model's directory, create one
							 */
							String u1 = ((FillMode.ImageFill) fillMode).getURL();
							if (!u1.equals(f1.toString())) {
								ModelerUtilities.copyResourceToDirectory(u1, f1.getParentFile());
							}
						}
						/*
						 * For using ImageIcon, we are not supposed to change the source dynamically. When we do need to do so, MUST use the Toolkit method to create a new image and pass it to the ImageIcon. That is the only way to refresh an ImageIcon's content. This is presumably due to the fact that the MediaTracker used to load image in the ImageIcon class is static (shared by all live ImageIcon instances). MediaTracker might look for what it holds in memory first instead of loading from the HD or Web. In the latter case, this may not be a problem because the source is usually stable. So we normally do not recreate an ImageIcon from the Web.
						 */
						icon = new ImageIcon(Toolkit.getDefaultToolkit().createImage(s));
					}
					icon.setDescription(fileName);
					setBackgroundImage(icon);
				} else {
					setBackgroundImage(null);
				}
			} else {
				setBackgroundImage(null);
			}
		}
	}