Package furbelow

Class SelectionIcon

java.lang.Object
furbelow.SelectionIcon
All Implemented Interfaces:
Icon

public class SelectionIcon extends Object implements Icon
Paint an icon appropriately for a selection to ensure that the icon is visible and to avoid having to generate minor icon variations. This may mean a mouse-over, a selected button, or a selected row in a tree or table. Primarily to make icons in selected rows of a table on Windows 2000 show up properly, since that setup has a dark blue selection background which makes any black pixels difficult to see. This class replaces any pixels of the given foreground/background with a different foreground/background.
  • Constructor Details

    • SelectionIcon

      public SelectionIcon(Icon icon, Color fg, Color bg, Color sfg, Color sbg)
      Create an icon that paints a modified version given Icon.
  • Method Details

    • setTolerance

      public static void setTolerance(int tol)
    • getTolerance

      public static int getTolerance()
    • setTint

      public static void setTint(float tint)
    • getTint

      public static float getTint()
    • getIconWidth

      public int getIconWidth()
      Width is same as the original.
      Specified by:
      getIconWidth in interface Icon
    • getIconHeight

      public int getIconHeight()
      Height is same as the original.
      Specified by:
      getIconHeight in interface Icon
    • toString

      public String toString()
      Returns same value as the original.
      Overrides:
      toString in class Object
    • paintIcon

      public void paintIcon(Component c, Graphics g, int x, int y)
      Paints the original, but replaces the original fg/bg pixels with new ones. Transparency is preserved.
      Specified by:
      paintIcon in interface Icon