Class DecoratedResizableIcon
java.lang.Object
org.pushingpixels.flamingo.api.common.icon.DecoratedResizableIcon
- All Implemented Interfaces:
Icon,AsynchronousLoading,ResizableIcon
Implementation of
ResizableIcon that adds decorations to a main icon.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceIcon decorator interface. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<DecoratedResizableIcon.IconDecorator>List of icon decorators.protected ResizableIconThe main delegate icon. -
Constructor Summary
ConstructorsConstructorDescriptionDecoratedResizableIcon(ResizableIcon delegate) Creates a new decorated icon with no decorators.DecoratedResizableIcon(ResizableIcon delegate, DecoratedResizableIcon.IconDecorator... decorators) Creates a new decorated icon. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds listener on the asynchronous loading events.voidAdds the specified decorator to the end of the decorator sequence.intintbooleanReturns indication whether the content is still loading.voidvoidRemoves listener on the asynchronous loading events.voidRemoves the specified decorator.voidsetDimension(Dimension newDimension) Changes the dimension ofthisicon.
-
Field Details
-
delegate
The main delegate icon. -
decorators
List of icon decorators.
-
-
Constructor Details
-
DecoratedResizableIcon
public DecoratedResizableIcon(ResizableIcon delegate, DecoratedResizableIcon.IconDecorator... decorators) Creates a new decorated icon.- Parameters:
delegate- The main icon.decorators- Icon decorators.
-
DecoratedResizableIcon
Creates a new decorated icon with no decorators. Decorators can be added later withaddIconDecorator(IconDecorator).- Parameters:
delegate- Main icon.
-
-
Method Details
-
getIconHeight
public int getIconHeight()- Specified by:
getIconHeightin interfaceIcon
-
getIconWidth
public int getIconWidth()- Specified by:
getIconWidthin interfaceIcon
-
paintIcon
-
setDimension
Description copied from interface:ResizableIconChanges the dimension ofthisicon.- Specified by:
setDimensionin interfaceResizableIcon- Parameters:
newDimension- New dimension forthisicon.
-
addIconDecorator
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
Removes the specified decorator.- Parameters:
decorator- Decorator to remove.
-
addAsynchronousLoadListener
Description copied from interface:AsynchronousLoadingAdds listener on the asynchronous loading events.- Specified by:
addAsynchronousLoadListenerin interfaceAsynchronousLoading- Parameters:
l- Listener to add.
-
removeAsynchronousLoadListener
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.
-