Class DecoratedResizableIcon

  • All Implemented Interfaces:
    javax.swing.Icon, org.pushingpixels.neon.api.AsynchronousLoading, org.pushingpixels.neon.api.icon.ResizableIcon


    public class DecoratedResizableIcon
    extends java.lang.Object
    implements org.pushingpixels.neon.api.icon.ResizableIcon, org.pushingpixels.neon.api.AsynchronousLoading
    Implementation of ResizableIcon that adds decorations to a main icon.
    • Constructor Detail

      • DecoratedResizableIcon

        public DecoratedResizableIcon​(org.pushingpixels.neon.api.icon.ResizableIcon delegate,
                                      DecoratedResizableIcon.IconDecorator... decorators)
        Creates a new decorated icon.
        Parameters:
        delegate - The main icon.
        decorators - Icon decorators.
      • DecoratedResizableIcon

        public DecoratedResizableIcon​(org.pushingpixels.neon.api.icon.ResizableIcon delegate)
        Creates a new decorated icon with no decorators. Decorators can be added later with addIconDecorator(IconDecorator).
        Parameters:
        delegate - Main icon.
    • Method Detail

      • 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
      • setDimension

        public void setDimension​(java.awt.Dimension newDimension)
        Specified by:
        setDimension in interface org.pushingpixels.neon.api.icon.ResizableIcon
      • addIconDecorator

        public void addIconDecorator​(DecoratedResizableIcon.IconDecorator decorator)
        Adds the specified decorator to the end of the decorator sequence. If the specified decorator already exists, it is not moved to the end of the sequence.
        Parameters:
        decorator - Decorator to add.
      • removeIconDecorator

        public void removeIconDecorator​(DecoratedResizableIcon.IconDecorator decorator)
        Removes the specified decorator.
        Parameters:
        decorator - Decorator to remove.
      • addAsynchronousLoadListener

        public void addAsynchronousLoadListener​(org.pushingpixels.neon.api.AsynchronousLoadListener l)
        Specified by:
        addAsynchronousLoadListener 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
      • isLoading

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

        public static org.pushingpixels.neon.api.icon.ResizableIcon.Factory factory​(org.pushingpixels.neon.api.icon.ResizableIcon.Factory original,
                                                                                    DecoratedResizableIcon.IconDecorator... decorators)