Class CenterTranslateIcon

  • All Implemented Interfaces:
    javax.swing.Icon

    public class CenterTranslateIcon
    extends TranslateIcon
    An icon that will update it's x,y offset to be centered over another, presumably larger icon.
    • Constructor Summary

      Constructors 
      Constructor Description
      CenterTranslateIcon​(javax.swing.Icon icon, int centerOverSize)
      Constructor
    • Constructor Detail

      • CenterTranslateIcon

        public CenterTranslateIcon​(javax.swing.Icon icon,
                                   int centerOverSize)
        Constructor
        Parameters:
        icon - the icon to center
        centerOverSize - the size of the area over which this icon is be centered.

        Note: this constructor assumes the area is a square. If not, add another constructor to this class that takes a width and height for the area