Class IconDeckResizableIcon<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.ResizableIcon


    public class IconDeckResizableIcon<T>
    extends java.lang.Object
    implements org.pushingpixels.neon.api.icon.ResizableIcon, org.pushingpixels.neon.api.AsynchronousLoading
    Implementation of the ResizableIcon that allows switching the icon painting at runtime. This class can be used as a delegate in the DecoratedResizableIcon 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.ResizableIcon

        org.pushingpixels.neon.api.icon.ResizableIcon.Factory
    • Constructor Summary

      Constructors 
      Constructor Description
      IconDeckResizableIcon​(java.util.Map<T,? extends org.pushingpixels.neon.api.icon.ResizableIcon> iconDeck)
      Creates the icon deck.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addAsynchronousLoadListener​(org.pushingpixels.neon.api.AsynchronousLoadListener l)  
      int getIconHeight​()  
      int getIconWidth​()  
      boolean isLoading​()  
      void paintIcon​(java.awt.Component c, java.awt.Graphics g, int x, int y)  
      void removeAsynchronousLoadListener​(org.pushingpixels.neon.api.AsynchronousLoadListener l)  
      void setDimension​(java.awt.Dimension dim)  
      void setIcon​(T key)
      Sets the currently shown icon.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.pushingpixels.neon.api.icon.ResizableIcon

        toImage
    • Constructor Detail

      • IconDeckResizableIcon

        public IconDeckResizableIcon​(java.util.Map<T,? extends org.pushingpixels.neon.api.icon.ResizableIcon> 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.ResizableIcon
      • 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