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 interface
Icon decorator interface. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<DecoratedResizableIcon.IconDecorator>
List of icon decorators.protected ResizableIcon
The 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 TypeMethodDescriptionvoid
Adds listener on the asynchronous loading events.void
Adds the specified decorator to the end of the decorator sequence.int
int
boolean
Returns indication whether the content is still loading.void
void
Removes listener on the asynchronous loading events.void
Removes the specified decorator.void
setDimension
(Dimension newDimension) Changes the dimension ofthis
icon.
-
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:
getIconHeight
in interfaceIcon
-
getIconWidth
public int getIconWidth()- Specified by:
getIconWidth
in interfaceIcon
-
paintIcon
-
setDimension
Description copied from interface:ResizableIcon
Changes the dimension ofthis
icon.- Specified by:
setDimension
in interfaceResizableIcon
- Parameters:
newDimension
- New dimension forthis
icon.
-
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:AsynchronousLoading
Adds listener on the asynchronous loading events.- Specified by:
addAsynchronousLoadListener
in interfaceAsynchronousLoading
- Parameters:
l
- Listener to add.
-
removeAsynchronousLoadListener
Description copied from interface:AsynchronousLoading
Removes listener on the asynchronous loading events.- Specified by:
removeAsynchronousLoadListener
in interfaceAsynchronousLoading
- Parameters:
l
- Listener to remove.
-
isLoading
public boolean isLoading()Description copied from interface:AsynchronousLoading
Returns indication whether the content is still loading.- Specified by:
isLoading
in interfaceAsynchronousLoading
- Returns:
true
if the content is still loading,false
otherwise.
-