public Image getImage(Object element) {
if (!(element instanceof PageDescriptor)) {
return null;
}
PageDescriptor page = (PageDescriptor) element;
if (page.getImage() == null) {
return null;
}
Image image = images.get(page.getName());
if (image == null) {
image = page.getImage().createImage();
images.put(page.getName(), image);
}
return image;
}