Major media subsystem revamp:
- 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
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
//
|
||||
// $Id: MirageIcon.java,v 1.1 2003/01/13 22:49:46 mdb Exp $
|
||||
|
||||
package com.threerings.media.image;
|
||||
|
||||
import java.awt.Component;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.Graphics;
|
||||
|
||||
import javax.swing.Icon;
|
||||
|
||||
/**
|
||||
* Implements the Swing {@link Icon} interface with a mirage providing the
|
||||
* image information.
|
||||
*/
|
||||
public class MirageIcon implements Icon
|
||||
{
|
||||
public MirageIcon (Mirage mirage)
|
||||
{
|
||||
_mirage = mirage;
|
||||
}
|
||||
|
||||
// documentation inherited from interface
|
||||
public void paintIcon (Component c, Graphics g, int x, int y)
|
||||
{
|
||||
_mirage.paint((Graphics2D)g, x, y);
|
||||
}
|
||||
|
||||
// documentation inherited from interface
|
||||
public int getIconWidth()
|
||||
{
|
||||
return _mirage.getWidth();
|
||||
}
|
||||
|
||||
// documentation inherited from interface
|
||||
public int getIconHeight()
|
||||
{
|
||||
return _mirage.getHeight();
|
||||
}
|
||||
|
||||
protected Mirage _mirage;
|
||||
}
|
||||
Reference in New Issue
Block a user