@Override public ConstraintWidget mousePressed(float x,float y,ViewTransform transform,Selection selection){
  ConstraintTableLayout table=(ConstraintTableLayout)mWidget;
  mTableClickTargets.clear();
  ArrayList<Guideline> vertical=table.getVerticalGuidelines();
  int l=transform.getSwingX(table.getDrawX());
  int t=transform.getSwingY(table.getDrawY());
  int column=0;
  TableClickTarget firstTarget=new TableClickTarget(table,column++,l,t - 20 - 4,20,20);
  mTableClickTargets.add(firstTarget);
  for (  ConstraintWidget v : vertical) {
    int bx=transform.getSwingX(v.getX()) + l;
    TableClickTarget target=new TableClickTarget(table,column++,bx,t - 20 - 4,20,20);
    mTableClickTargets.add(target);
  }
  ConstraintWidget widgetHit=null;
  if (mTableClickTargets.size() > 0) {
    for (    TableClickTarget tableClickTarget : mTableClickTargets) {
      if (tableClickTarget.contains(x,y)) {
        widgetHit=tableClickTarget.getTable();
        break;
      }
    }
    if (selection.isEmpty()) {
      mTableClickTargets.clear();
    }
  }
  return widgetHit;
}

@ Override public ConstraintWidget mousePressed ( float x , float y , ViewTransform transform , Selection selection ) { ConstraintTableLayout table = ( ConstraintTableLayout ) mWidget ; mTableClickTargets . clear ( ) ; ArrayList < Guideline > vertical = table . getVerticalGuidelines ( ) ; int l = transform . getSwingX ( table . getDrawX ( ) ) ; int t = transform . getSwingY ( table . getDrawY ( ) ) ; int column = 0 ; TableClickTarget firstTarget = new TableClickTarget ( table , column ++ , l , t - 20 - 4 , 20 , 20 ) ; mTableClickTargets . add ( firstTarget ) ; for ( ConstraintWidget v : vertical ) { int bx = transform . getSwingX ( v . getX ( ) ) + l ; TableClickTarget target = new TableClickTarget ( table , column ++ , bx , t - 20 - 4 , 20 , 20 ) ; mTableClickTargets . add ( target ) ; } ConstraintWidget widgetHit = null ; if ( mTableClickTargets . size ( ) > 0 ) { for ( TableClickTarget tableClickTarget : mTableClickTargets ) { if ( tableClickTarget . contains ( x , y ) ) { widgetHit = tableClickTarget . getTable ( ) ; break ; } } if ( selection . isEmpty ( ) ) { mTableClickTargets . clear ( ) ; } } return widgetHit ; }
handle mouse press event to add click targets . todo : clean this up .
