100aa3ace3
- All images are loaded through the image manager - Architected to allow the use of prepared or unprepared images (and volatile images when the day comes that they support alpha) - Tunable caches for images and tiles - Resource manager caches unpacked resources on the filesystem - Various and sundry other cleanups git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2116 542714f4-19e9-0310-aa3c-eee0fc999fb1
47 lines
991 B
Java
47 lines
991 B
Java
//
|
|
// $Id: TileIcon.java,v 1.2 2003/01/13 22:49:46 mdb Exp $
|
|
|
|
package com.threerings.media.tile;
|
|
|
|
import java.awt.Component;
|
|
import java.awt.Graphics2D;
|
|
import java.awt.Graphics;
|
|
|
|
import javax.swing.Icon;
|
|
|
|
/**
|
|
* Implements the icon interface, using a {@link Tile} to render the icon
|
|
* image.
|
|
*/
|
|
public class TileIcon implements Icon
|
|
{
|
|
/**
|
|
* Creates a tile icon that will use the supplied tile to render itself.
|
|
*/
|
|
public TileIcon (Tile tile)
|
|
{
|
|
_tile = tile;
|
|
}
|
|
|
|
// documentation inherited from interface
|
|
public void paintIcon (Component c, Graphics g, int x, int y)
|
|
{
|
|
_tile.paint((Graphics2D)g, x, y);
|
|
}
|
|
|
|
// documentation inherited from interface
|
|
public int getIconWidth ()
|
|
{
|
|
return _tile.getWidth();
|
|
}
|
|
|
|
// documentation inherited from interface
|
|
public int getIconHeight ()
|
|
{
|
|
return _tile.getHeight();
|
|
}
|
|
|
|
/** The tile used to render this icon. */
|
|
protected Tile _tile;
|
|
}
|