On 11/13/13 8:26 PM, "OmPrakash Muppirala" <bigosma...@gmail.com> wrote:

>I think I get it, but I guess I will need some pseudo code to understand
>completely.  What exactly does 'hang it on a strand' man in this context?
>
>Thanks,
>Om
I looked at the commit diffs again.  I missed seeing earlier that you want
to propagate rolloverindex to the List's API surface in order to
communicate that information to the DataGrid.  I was thinking that there
can be some other List that represents the List that is a column in the
DG.  In theory it can be built out of most of the same pieces as List.
Let's call it DataGridColumnList.  That way the List that people stick in
the UI isn't sporting a rollOverIndex property that won't be useful to
them.  DataGridColumnList extends UIBase like List but it would have a
different IRollOverBead, one that knows that its strand, which is a
DataGridColumnList, has a parent DataGrid which has a strand which has an
IRollOverModel on its strand, but it isn't the beadModel property.

So, then I think the pieces are:

Class RollOverModel implements IRollOverModel
{
   Public function get/set rollOverIndex
}

Class DataGridColumnList extends UIBase
{
   Public function get dataGrid():DataGrid
   {
        return parent; // or whatever
   }
}

/* rollover impl for List */
Class RollOverBead implements IRollOverBead
{
  Var rollOverModel:IRollOverModel;

  Public function set strand(strand:IStrand):void
  {
        rollOverModel = strand.getBeadByType(IRollOverModel);
        addEventListener("rollOver", rollOverHandler);  
  }

  Function rollOverHandler()
  {
     // set/unset hovered on renderer
     // draw rect highlight
  }
}

/* rollover impl for DataGridColumnList */
Class DGColumnListRollOverBead implements IRollOverBead
{
  Var rollOverModel:IRollOverModel;

  Public function set strand(strand:IStrand):void
  {
        rollOverModel = strand.dataGrid.getBeadByType(IRollOverModel);
        addEventListener("rollOver", rollOverHandler);  
  }


  Function rollOverHandler()
  {
      // set/unset hovered on renderer
      // does not draw rect highlight
  }


}

/* rollover impl for DataGrid */
Class DGRollOverBead implements IRollOverBead
{
  Var rollOverModel:IRollOverModel;

  Public function set strand(strand:IStrand):void
  {
        rollOverModel = strand.getBeadByType(IRollOverModel);
        addEventListener("rollOver", rollOverHandler);
  }

  Function rollOverHandler()
  {
      // Draws rect highlight across all columns
  }
}



Then the CSS:

List
{
  IRollOverBead: ClassReference(RollOverBead);
  IRollOverModel: ClassReference(RollOverModel);
}

DataGridColumnList
{
  IRollOverBead: ClassReference(DGColumnListRollOverBead);
}

DataGrid
{
  IRollOverBead: ClassReference(DGRollOverBead);
  IRollOverModel: ClassReference(RollOverModel);
}

Of course, I could still be wrong...

-Alex

Reply via email to