Using ISelectable interface

This interface allows to define a custom behavior of the renderer when node highlight or selection status changes. In fact, if the item renderer is of type ISelectable its isSelected and isHighlighted properties are updated according to node status. The following example gives you a better understanding of this interface. It represents the code of a spark item renderer implementing ISelectable:
<?xml version="1.0" encoding="utf-8"?>
<s:Group xmlns:fx="http://ns.adobe.com/mxml/2009" 
		 xmlns:s="library://ns.adobe.com/flex/spark" 
		 xmlns:mx="library://ns.adobe.com/flex/mx" width="50" height="50"
		 implements="fr.kapit.visualizer.renderers.ISelectable"
		 >
	<fx:Script>
		<![CDATA[
			import fr.kapit.visualizer.renderers.ISelectable;
			[Bindable]
			private var borderColor:int=0xcdddc4;
						
			private var _isSelected:Boolean;
			public function get isSelected():Boolean
			{
				return _isSelected;
			}
			public function set isSelected(value:Boolean):void
			{
				_isSelected = value;
				if(value)
					borderColor = 0x552233;
				else
					borderColor = 0xddddc4;
			}

			private var _isHighlighted:Boolean;
			public function get isHeighlighted():Boolean
			{
				return _isHighlighted;
			}
			public function set isHighlighted(value:Boolean):void
			{
				_isHighlighted = value;
				if(_isSelected)
					return;
				if(value)
					borderColor = 0x998877;
				else
					borderColor= 0xddddc4;
			}
		]]>
	</fx:Script>
	<s:Rect width="100%" height="100%">
		<s:stroke>
			<s:SolidColorStroke color="{borderColor}" weight="3"/>
		</s:stroke>
		<s:fill>
			<s:SolidColor color="0xedded4"/>
		</s:fill>
	</s:Rect>
</s:Group>