 
 import spark.components.IItemRenderer;
 import spark.components.Label;
+import spark.components.supportClasses.ItemRendererInteractionStateDetector;
 import spark.components.supportClasses.TextBase;
 
 use namespace mx_internal;

    
    /**
     *  @private
     *  Keeps track of whether rollover/rollout events were added
     * 
     *  We need to be careful about calling add/remove event listener because 
     *  of the reference counting going on in 
     *  super.addEventListener/removeEventListener.
     */
    private var rolloverEventsAdded:Boolean = false;
    
    /**
     *  @private
     *  Attach the mouse events.
     */
    private function addHandlers():void
    {
        if (getStyle("interactionMode") == InteractionMode.MOUSE)
        {
            if (!rolloverEventsAdded)
            {
                rolloverEventsAdded = true;
                addEventListener(MouseEvent.ROLL_OVER, itemRenderer_rollOverHandler);
                addEventListener(MouseEvent.ROLL_OUT, itemRenderer_rollOutHandler);
            }
        }
        else
        {
            if (rolloverEventsAdded)
            {
                rolloverEventsAdded = false;
                removeEventListener(MouseEvent.ROLL_OVER, itemRenderer_rollOverHandler);
                removeEventListener(MouseEvent.ROLL_OUT, itemRenderer_rollOutHandler);
            }
        }
    }
    
    /**
     *  @private
     */
    private function anyButtonDown(event:MouseEvent):Boolean
    {
        var type:String = event.type;
        return event.buttonDown || (type == "middleMouseDown") || (type == "rightMouseDown"); 
    }
    
    /**
     *  @private
     *  Mouse rollOver event handler.
     */
    protected function itemRenderer_rollOverHandler(event:MouseEvent):void
    {
        if (!anyButtonDown(event))
        {
            hovered = true;
            invalidateDisplayList();
        }
    }
    
    /**
     *  @private
     *  Mouse rollOut event handler.
     */
    protected function itemRenderer_rollOutHandler(event:MouseEvent):void
    {
        hovered = false;
        invalidateDisplayList();
    }
    

[Style(name="alternatingItemColors", type="Array", arrayType="uint", format="Color", inherit="yes", theme="spark, mobile")]

/**
 *  Color of the background of an item renderer when it is pressed down
 * 
 *  <p>This style is only applicable in touch <code>interactionMode</code>.</p>
 *   
 *  @default 0xA8C6EE
 *  
 *  @langversion 3.0
 *  @playerversion Flash 10.1
 *  @playerversion AIR 2.5
 *  @productversion Flex 4.5
 */
[Style(name="downColor", type="uint", format="Color", inherit="yes", theme="mobile")]

/**
 *  Color of focus ring when the component is in focus
 *   
 *  @default 0x70B2EE
