Class IconDeckNeonIcon<T>

  • Type Parameters:
    T - enumeration key into the deck
    All Implemented Interfaces:
    javax.swing.Icon, org.pushingpixels.neon.api.AsynchronousLoading, org.pushingpixels.neon.api.icon.NeonIcon


    public class IconDeckNeonIcon<T>
    extends java.lang.Object
    implements org.pushingpixels.neon.api.icon.NeonIcon, org.pushingpixels.neon.api.AsynchronousLoading
    Implementation of the NeonIcon that allows switching the icon painting at runtime. This class can be used as a delegate in the DecoratedNeonIcon where the "base" icon is changed at runtime without the need to recompute all the decorators.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.pushingpixels.neon.api.icon.NeonIcon

        org.pushingpixels.neon.api.icon.NeonIcon.ColorFilter, org.pushingpixels.neon.api.icon.NeonIcon.Factory
    • Constructor Summary

      Constructors 
      Constructor Description
      IconDeckNeonIcon​(java.util.Map<T,? extends org.pushingpixels.neon.api.icon.NeonIcon> iconDeck)
      Creates the icon deck.
    • Constructor Detail

      • IconDeckNeonIcon

        public IconDeckNeonIcon​(java.util.Map<T,? extends org.pushingpixels.neon.api.icon.NeonIcon> iconDeck)
        Creates the icon deck.
        Parameters:
        iconDeck - Icon deck.
    • Method Detail

      • setIcon

        public void setIcon​(T key)
        Sets the currently shown icon.
        Parameters:
        key - Icon key.
      • setDimension

        public void setDimension​(java.awt.Dimension dim)
        Specified by:
        setDimension in interface org.pushingpixels.neon.api.icon.NeonIcon
      • supportsColorFilter

        public boolean supportsColorFilter​()
        Specified by:
        supportsColorFilter in interface org.pushingpixels.neon.api.icon.NeonIcon
      • setColorFilter

        public void setColorFilter​(org.pushingpixels.neon.api.icon.NeonIcon.ColorFilter colorFilter)
        Specified by:
        setColorFilter in interface org.pushingpixels.neon.api.icon.NeonIcon
      • getIconHeight

        public int getIconHeight​()
        Specified by:
        getIconHeight in interface javax.swing.Icon
      • getIconWidth

        public int getIconWidth​()
        Specified by:
        getIconWidth in interface javax.swing.Icon
      • paintIcon

        public void paintIcon​(java.awt.Component c,
                              java.awt.Graphics g,
                              int x,
                              int y)
        Specified by:
        paintIcon in interface javax.swing.Icon
      • addAsynchronousLoadListener

        public void addAsynchronousLoadListener​(org.pushingpixels.neon.api.AsynchronousLoadListener l)
        Specified by:
        addAsynchronousLoadListener in interface org.pushingpixels.neon.api.AsynchronousLoading
      • isLoading

        public boolean isLoading​()
        Specified by:
        isLoading in interface org.pushingpixels.neon.api.AsynchronousLoading
      • removeAsynchronousLoadListener

        public void removeAsynchronousLoadListener​(org.pushingpixels.neon.api.AsynchronousLoadListener l)
        Specified by:
        removeAsynchronousLoadListener in interface org.pushingpixels.neon.api.AsynchronousLoading