&& room.isFloorVisible()) {
// Use room floor color or texture image
if (room.getFloorColor() != null) {
g2D.setPaint(new Color(room.getFloorColor()));
} else {
final HomeTexture floorTexture = room.getFloorTexture();
if (floorTexture != null) {
if (this.floorTextureImagesCache == null) {
this.floorTextureImagesCache = new WeakHashMap<Content, BufferedImage>();
}
BufferedImage textureImage = this.floorTextureImagesCache.get(floorTexture.getImage());
if (textureImage == null
|| textureImage == WAIT_TEXTURE_IMAGE) {
final boolean waitForTexture = paintMode != PaintMode.PAINT;
if ("true".equalsIgnoreCase(System.getProperty("com.eteks.sweethome3d.no3D"))) {
// Use icon manager if texture manager should be ignored
Icon textureIcon = IconManager.getInstance().getIcon(floorTexture.getImage(),
waitForTexture ? null : this);
if (IconManager.getInstance().isWaitIcon(textureIcon)) {
floorTextureImagesCache.put(floorTexture.getImage(), WAIT_TEXTURE_IMAGE);
} else if (IconManager.getInstance().isErrorIcon(textureIcon)) {
floorTextureImagesCache.put(floorTexture.getImage(), ERROR_TEXTURE_IMAGE);
} else {
BufferedImage textureIconImage = new BufferedImage(
textureIcon.getIconWidth(), textureIcon.getIconHeight(), BufferedImage.TYPE_INT_ARGB);
Graphics2D g2DIcon = (Graphics2D)textureIconImage.getGraphics();
textureIcon.paintIcon(this, g2DIcon, 0, 0);
g2DIcon.dispose();
floorTextureImagesCache.put(floorTexture.getImage(), textureIconImage);
}
} else {
// Prefer to share textures images with texture manager if it's available
TextureManager.getInstance().loadTexture(floorTexture.getImage(), waitForTexture,
new TextureManager.TextureObserver() {
public void textureUpdated(Texture texture) {
floorTextureImagesCache.put(floorTexture.getImage(),
((ImageComponent2D)texture.getImage(0)).getImage());
if (!waitForTexture) {
repaint();
}
}
});
}
textureImage = this.floorTextureImagesCache.get(floorTexture.getImage());
}
g2D.setPaint(new TexturePaint(textureImage,
new Rectangle2D.Float(0, 0, floorTexture.getWidth(), floorTexture.getHeight())));
}
}
}
if (oldComposite instanceof AlphaComposite) {