debugger/debug_ui_tools_swing/src/main/com/thesett/aima/logic/fol/wam/debugger/uifactory/impl/FaderImpl.java
public void doFade(ColorDelta target, String groupName)
    {
        FadeState fadeState = timers.get(groupName);

        // Set up the color interpolator.
        Iterator<Color> interpolator = new ColorInterpolator(startColor, endColor, 8).iterator();

        if (fadeState == null)
        {
            // Create a new fade state for the target group, and a timer to run it.
            Timer timer = new Timer(20, this);

            fadeState = new FadeState(timer, target, interpolator);
            timers.put(groupName, fadeState);
        }
        else
        {
            // Kill any previous fade and replace the target with the new one.
            fadeState.timer.stop();
            fadeState.target = target;
            fadeState.interpolator = interpolator;
        }

        // Iterate to the initial color.
        Color firstColor = fadeState.interpolator.next();
        fadeState.target.changeColor(firstColor);

        // Kick off the fade timer.
        fadeState.timer.setActionCommand(groupName);
        fadeState.timer.setInitialDelay(400);
        fadeState.timer.start();
    }
public void doFade(ColorDelta target, String groupName)
    {
        FadeState fadeState = timers.get(groupName);

        // Set up the color interpolator.
        Iterator<Color> interpolator = new ColorInterpolator(startColor, endColor, 8).iterator();

        if (fadeState == null)
        {
            // Create a new fade state for the target group, and a timer to run it.
            Timer timer = new Timer(20, this);

            fadeState = new FadeState(timer, target, interpolator);
            timers.put(groupName, fadeState);
        }
        else
        {
            // Kill any previous fade and replace the target with the new one.
            fadeState.timer.stop();
            fadeState.target = target;
            fadeState.interpolator = interpolator;
        }

        // Iterate to the initial color.
        Color firstColor = fadeState.interpolator.next();
        fadeState.target.changeColor(firstColor);

        // Kick off the fade timer.
        fadeState.timer.setActionCommand(groupName);
        fadeState.timer.setInitialDelay(400);
        fadeState.timer.start();
    }
Requests a color fade against the specified target, under a group name.

@param target    The color delta target.
@param groupName The group name for the fade. See class level comment for {@link FaderImpl} for an explanation of
how the group name is used.