Class DecoratedResizableIcon
- java.lang.Object
-
- org.pushingpixels.flamingo.api.common.icon.DecoratedResizableIcon
-
- All Implemented Interfaces:
Icon,AsynchronousLoading,ResizableIcon
public class DecoratedResizableIcon extends Object implements ResizableIcon, AsynchronousLoading
Implementation ofResizableIconthat adds decorations to a main icon.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceDecoratedResizableIcon.IconDecoratorIcon decorator interface.
-
Field Summary
Fields Modifier and Type Field Description protected List<DecoratedResizableIcon.IconDecorator>decoratorsList of icon decorators.protected ResizableIcondelegateThe main delegate icon.
-
Constructor Summary
Constructors Constructor Description DecoratedResizableIcon(ResizableIcon delegate)Creates a new decorated icon with no decorators.DecoratedResizableIcon(ResizableIcon delegate, DecoratedResizableIcon.IconDecorator... decorators)Creates a new decorated icon.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAsynchronousLoadListener(AsynchronousLoadListener l)Adds listener on the asynchronous loading events.voidaddIconDecorator(DecoratedResizableIcon.IconDecorator decorator)Adds the specified decorator to the end of the decorator sequence.intgetIconHeight()intgetIconWidth()booleanisLoading()Returns indication whether the content is still loading.voidpaintIcon(Component c, Graphics g, int x, int y)voidremoveAsynchronousLoadListener(AsynchronousLoadListener l)Removes listener on the asynchronous loading events.voidremoveIconDecorator(DecoratedResizableIcon.IconDecorator decorator)Removes the specified decorator.voidsetDimension(Dimension newDimension)Changes the dimension ofthisicon.
-
-
-
Field Detail
-
delegate
protected ResizableIcon delegate
The main delegate icon.
-
decorators
protected List<DecoratedResizableIcon.IconDecorator> decorators
List of icon decorators.
-
-
Constructor Detail
-
DecoratedResizableIcon
public DecoratedResizableIcon(ResizableIcon delegate, DecoratedResizableIcon.IconDecorator... decorators)
Creates a new decorated icon.- Parameters:
delegate- The main icon.decorators- Icon decorators.
-
DecoratedResizableIcon
public DecoratedResizableIcon(ResizableIcon delegate)
Creates a new decorated icon with no decorators. Decorators can be added later withaddIconDecorator(IconDecorator).- Parameters:
delegate- Main icon.
-
-
Method Detail
-
getIconHeight
public int getIconHeight()
- Specified by:
getIconHeightin interfaceIcon
-
getIconWidth
public int getIconWidth()
- Specified by:
getIconWidthin interfaceIcon
-
setDimension
public void setDimension(Dimension newDimension)
Description copied from interface:ResizableIconChanges the dimension ofthisicon.- Specified by:
setDimensionin interfaceResizableIcon- Parameters:
newDimension- New dimension forthisicon.
-
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(AsynchronousLoadListener l)
Description copied from interface:AsynchronousLoadingAdds listener on the asynchronous loading events.- Specified by:
addAsynchronousLoadListenerin interfaceAsynchronousLoading- Parameters:
l- Listener to add.
-
removeAsynchronousLoadListener
public void removeAsynchronousLoadListener(AsynchronousLoadListener l)
Description copied from interface:AsynchronousLoadingRemoves listener on the asynchronous loading events.- Specified by:
removeAsynchronousLoadListenerin interfaceAsynchronousLoading- Parameters:
l- Listener to remove.
-
isLoading
public boolean isLoading()
Description copied from interface:AsynchronousLoadingReturns indication whether the content is still loading.- Specified by:
isLoadingin interfaceAsynchronousLoading- Returns:
trueif the content is still loading,falseotherwise.
-
-