/// Evolver Copyright 2000, Morgan McGuire
/// matrix@alum.mit.edu   http://graphics3d.com/matrix
import javax.swing.*;
import java.awt.*;

/**
 * Creates an enlarged icon by scaling up another icon.
 */
public class ScaleIcon implements Icon
{

  ELMatrix icon;
  double displayScale;

  public ScaleIcon(double displayScale, ELMatrix icon)
  {
    this.displayScale = displayScale;
    this.icon = icon;
  }

  // Inherited from Icon
  public int getIconWidth()
  {
    return (int)(icon.getIconWidth() * displayScale);
  }

  // Inherited from Icon
  public int getIconHeight()
  {
    return (int)(icon.getIconHeight() * displayScale);
  }
  
  // Inherited from Icon
  public void paintIcon(Component c, Graphics g, int x, int y) 
  {
    icon.drawImage((Graphics2D)g, x, y, getIconWidth(), getIconHeight());
  }
}
