= 12 && item.jerseyNumber <= 34;
}
s.fields = [f];
ac.sort = s;
ac.refresh();
return ac;
}
public function myItemRendererFunction(item:*):IFactory
{
if(item.type == "text")
return (new ClassFactory(LabelRenderer));
else if (item.type == "checkBox" )
return (new ClassFactory(CheckBoxRenderer))
else if (item.type == "color" )
return (new ClassFactory(ColorLabelRenderer))
return (item);
}
public function aligningItemRendererFunction(item:*):IFactory
{
if (item is DisplayObject || item is GraphicElement)
return new ClassFactory(DataGroupJustifyItemRendererComplex);
else
return new ClassFactory(DataGroupJustifyItemRenderer);
}
public function createAC():ArrayCollection
{
var col:ArrayCollection =
new ArrayCollection(['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']);
return (col);
}
public function createNullDupAC():ArrayCollection
{
var col:ArrayCollection =
new ArrayCollection([null,'A',null,'A','a','a','a','B','C','D','E','F','G','H','I','J','K',
'L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','a','a','aa','aa',null,null]);
return (col);
}
public function addEllipseAt(myList:List, i:int, color:int, width:int=40, height:int=30):void
{
var myGroup:Group = new Group();
var myEllipse:Ellipse = new Ellipse();
myEllipse.width=width; myEllipse.height=height;
var myFill:SolidColor = new SolidColor();
myFill.color = color;
myEllipse.fill = myFill;
myGroup.addElement(myEllipse);
myList.dataProvider.addItemAt(myGroup, i);
}
public function addRectAt(myList:List, i:int, color:int, width:int=15, height:int=30, x:int=30, y:int=40):void
{
var myGroup:Group = new Group();
var myRect:Rect = new Rect();
myRect.x = x; myRect.y = y;
myRect.width=width; myRect.height=height;
var myFill:SolidColor = new SolidColor();
myFill.color = color;
myRect.fill = myFill;
myGroup.addElement(myRect);
myList.dataProvider.addItemAt(myGroup,i);
}
public function createLine(color:int, xFrom:int=0, yFrom:int=0,xTo:int=40, yTo:int=30 ):Line
{
var myLine:Line = new Line();
myLine.xFrom = xFrom; myLine.yFrom = yFrom;
myLine.xTo=xTo; myLine.yTo=yTo;
var mySolidColorStroke:SolidColorStroke = new SolidColorStroke();
mySolidColorStroke.color = color;
myLine.stroke = mySolidColorStroke;
return myLine;
}
public function createGroup(color:int, width:int=40, height:int=40, x:int=0, y:int=0 ):Group
{
var myGroup:Group = new Group();
myGroup.layout = new VerticalLayout();
var myEllipse:Ellipse = new Ellipse();
myEllipse.width=width; myEllipse.height=height;
var myFill:SolidColor = new SolidColor();
myFill.color = color;
myEllipse.fill = myFill;
myGroup.addElement(myEllipse);
var myRect:Rect = new Rect();
myRect.width=width; myRect.height=height;
myRect.fill = myFill;
myGroup.addElement(myRect);
myGroup.addElement(createLine(color));
return myGroup;
}
public function mixItemRendererFunction(item:*):IFactory
{
if (item is DisplayObject || item is GraphicElement)
return new ClassFactory(DefaultComplexItemRenderer);
else
return new ClassFactory(DefaultItemRenderer);
}
public function useDefaultComplexItemRenderer(item:*):IFactory
{
return new ClassFactory(DefaultComplexItemRenderer);
}
public function teamLabelFunction(item:Object):String
{
if (item.team=="ATeam")
return("TeamA " + item.lastName + item.firstName)
else
return("Other Team" + item.lastName + item.firstName)
}
public function jerseyNumberLabelFunction(item:Object):String
{
return( item.lastName + item.firstName + item.jerseyNumber )
}
public function openPopUp(modalSetting:Boolean): void
{
mylistPopUp = PopUpManager.createPopUp(this, comps.ListPopUp, modalSetting);
}
public function closePopUp(): void
{
PopUpManager.removePopUp(mylistPopUp);
}
public var collectionChangeResults:String;
public function resetCollectionChangeResults():String
{
collectionChangeResults = "";
return "complete";
}
public function handleCollectionChangeResults(e:CollectionEvent):void
{
collectionChangeResults += e.kind + "";
}
public function kickoffCollectionChangeMoveEvent(list1:List):int {
var sort:Sort = new Sort();
sort.fields = [new SortField("value",true)];
ArrayCollection(list1.dataProvider).sort = sort;
ArrayCollection(list1.dataProvider).refresh();
list1.validateNow();
list1.dataProvider.getItemAt(0).value = "yello1";
list1.dataProvider.itemUpdated(list1.dataProvider.getItemAt(0));
return 1;
}
]]>