Package com.jidesoft.icons
Class RolloverIcon
- java.lang.Object
-
- com.jidesoft.icons.RolloverIcon
-
- All Implemented Interfaces:
javax.swing.Icon
public class RolloverIcon extends java.lang.Object implements javax.swing.Icon
RolloverIcon
provides the expanded and collapsed tree icons that has rollover and fade effect. However it can be used to implement icon for any other purpose, not just the tree icons.- Since:
- 3.3.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RolloverIcon.DefaultCollapsedIcon
The default collapsed tree icon.static class
RolloverIcon.DefaultExpandedIcon
The default expanded tree icon.static interface
RolloverIcon.IconRolloverSupport
An interface that should be implemented on a component if you want to use an icon that supports rollover and fade (fade in or fade out) effect.
-
Field Summary
Fields Modifier and Type Field Description static java.awt.Color
COLOR_COLLAPSED
static java.awt.Color
COLOR_COLLAPSED_FILL
static java.awt.Color
COLOR_COLLAPSED_FILL_ROLLOVER
All colors used by the default icons.static java.awt.Color
COLOR_COLLAPSED_ROLLOVER
static java.awt.Color
COLOR_EXPANDED
static java.awt.Color
COLOR_EXPANDED_FILL
static java.awt.Color
COLOR_EXPANDED_FILL_ROLLOVER
static java.awt.Color
COLOR_EXPANDED_ROLLOVER
static int
ICON_COLLAPSED
static int
ICON_EXPANDED
-
Constructor Summary
Constructors Constructor Description RolloverIcon(RolloverIcon.IconRolloverSupport rolloverSupport, int iconType)
Creates an RolloverIcon.RolloverIcon(RolloverIcon.IconRolloverSupport rolloverSupport, javax.swing.Icon normalIcon)
Creates an RolloverIcon.RolloverIcon(RolloverIcon.IconRolloverSupport rolloverSupport, javax.swing.Icon normalIcon, javax.swing.Icon rolloverIcon)
Creates an RolloverIcon.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getIconHeight()
int
getIconWidth()
void
paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
-
-
-
Field Detail
-
COLOR_COLLAPSED_FILL_ROLLOVER
public static java.awt.Color COLOR_COLLAPSED_FILL_ROLLOVER
All colors used by the default icons. You can change them to fit your L&F.
-
COLOR_COLLAPSED_FILL
public static java.awt.Color COLOR_COLLAPSED_FILL
-
COLOR_COLLAPSED_ROLLOVER
public static java.awt.Color COLOR_COLLAPSED_ROLLOVER
-
COLOR_COLLAPSED
public static java.awt.Color COLOR_COLLAPSED
-
COLOR_EXPANDED_FILL_ROLLOVER
public static java.awt.Color COLOR_EXPANDED_FILL_ROLLOVER
-
COLOR_EXPANDED_FILL
public static java.awt.Color COLOR_EXPANDED_FILL
-
COLOR_EXPANDED_ROLLOVER
public static java.awt.Color COLOR_EXPANDED_ROLLOVER
-
COLOR_EXPANDED
public static java.awt.Color COLOR_EXPANDED
-
ICON_EXPANDED
public static final int ICON_EXPANDED
- See Also:
- Constant Field Values
-
ICON_COLLAPSED
public static final int ICON_COLLAPSED
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RolloverIcon
public RolloverIcon(RolloverIcon.IconRolloverSupport rolloverSupport, int iconType)
Creates an RolloverIcon.- Parameters:
rolloverSupport
- the IconRolloverSupport interface that should be implemented on a component.iconType
- the icon type. It could be eitherICON_EXPANDED
orICON_COLLAPSED
.
-
RolloverIcon
public RolloverIcon(RolloverIcon.IconRolloverSupport rolloverSupport, javax.swing.Icon normalIcon)
Creates an RolloverIcon.- Parameters:
rolloverSupport
- the IconRolloverSupport interface that should be implemented on a component.normalIcon
- the normal icon
-
RolloverIcon
public RolloverIcon(RolloverIcon.IconRolloverSupport rolloverSupport, javax.swing.Icon normalIcon, javax.swing.Icon rolloverIcon)
Creates an RolloverIcon.- Parameters:
rolloverSupport
- the IconRolloverSupport interface that should be implemented on a component.normalIcon
- the normal icon. This icon will be used to determine the icon size. The size of the rollover icon is ignored so you should make sure the two icons have the same size.rolloverIcon
- the rollover icon
-
-
Method Detail
-
paintIcon
public void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
- Specified by:
paintIcon
in interfacejavax.swing.Icon
-
getIconWidth
public int getIconWidth()
- Specified by:
getIconWidth
in interfacejavax.swing.Icon
-
getIconHeight
public int getIconHeight()
- Specified by:
getIconHeight
in interfacejavax.swing.Icon
-
-