Class ResizableIcon

java.lang.Object
org.opensourcephysics.display.ResizableIcon
All Implemented Interfaces:
Icon

public class ResizableIcon extends Object implements Icon
An Icon that can be resized.
Author:
Doug Brown
  • Constructor Details

    • ResizableIcon

      public ResizableIcon(URL location)
      Creates a ResizableIcon from the specified URL.
      Parameters:
      location - the URL for the image
    • ResizableIcon

      public ResizableIcon(Icon icon)
      Creates a ResizableIcon from the specified Icon.
      Parameters:
      the - icon to resize
  • Method Details

    • paintIcon

      public void paintIcon(Component c, Graphics g, int x, int y)
      Specified by:
      paintIcon in interface Icon
    • getIconWidth

      public int getIconWidth()
      Specified by:
      getIconWidth in interface Icon
    • getIconHeight

      public int getIconHeight()
      Specified by:
      getIconHeight in interface Icon
    • getBaseIcon

      public Icon getBaseIcon()
      Gets the base icon which is resized by this ResizableIcon.
      Returns:
      the base icon
    • setFixedSizeFactor

      public void setFixedSizeFactor(int factor)
      Sets a fixed size factor. Factors <= 0 unfixes it.
      Parameters:
      factor - the desired fixed factor