1 import org.aswing.ListCell;
2 import org.aswing.ListCellFactory;
3
4
9 class org.aswing.GeneralListCellFactory implements ListCellFactory {
10
11 private var listCellClass:Function;
12 private var shareCelles:Boolean;
13 private var cellHeight:Number;
14 private var sameHeight:Boolean;
15
16
24 public function GeneralListCellFactory(listCellClass:Function, shareCelles:Boolean, sameHeight:Boolean, height:Number){
25 this.listCellClass = listCellClass;
26
27 if(shareCelles == undefined){
28 shareCelles = true;
29 }
30 this.shareCelles = shareCelles;
31 if(sameHeight == undefined){
32 sameHeight = true;
33 }
34 this.sameHeight = sameHeight;
35
36 if(height == undefined){
37 height = 22;
38 }
39 cellHeight = height;
40 }
41
42 public function createNewCell() : ListCell {
43 return new listCellClass();
44 }
45
46
49 public function isAllCellHasSameHeight() : Boolean {
50 return sameHeight;
51 }
52
53
57 public function isShareCells() : Boolean {
58 return shareCelles;
59 }
60
61
64 public function setCellHeight(h:Number):Void{
65 cellHeight = h;
66 }
67
68
72 public function getCellHeight() : Number {
73 return cellHeight;
74 }
75 }