protected SizeRequirements calculateMinorAxisRequirements(int axis,SizeRequirements r){
  updateGrid();
  calculateColumnRequirements(axis);
  if (r == null) {
    r=new SizeRequirements();
  }
  long min=0;
  long pref=0;
  int n=columnRequirements.length;
  for (int i=0; i < n; i++) {
    SizeRequirements req=columnRequirements[i];
    min+=req.minimum;
    pref+=req.preferred;
  }
  int adjust=(n + 1) * cellSpacing + 2 * borderWidth;
  min+=adjust;
  pref+=adjust;
  r.minimum=(int)min;
  r.preferred=(int)pref;
  r.maximum=(int)pref;
  AttributeSet attr=getAttributes();
  CSS.LengthValue cssWidth=(CSS.LengthValue)attr.getAttribute(CSS.Attribute.WIDTH);
  if (BlockView.spanSetFromAttributes(axis,r,cssWidth,null)) {
    if (r.minimum < (int)min) {
      r.maximum=r.minimum=r.preferred=(int)min;
    }
  }
  totalColumnRequirements.minimum=r.minimum;
  totalColumnRequirements.preferred=r.preferred;
  totalColumnRequirements.maximum=r.maximum;
  Object o=attr.getAttribute(CSS.Attribute.TEXT_ALIGN);
  if (o != null) {
    String ta=o.toString();
    if (ta.equals("left")) {
      r.alignment=0;
    }
 else     if (ta.equals("center")) {
      r.alignment=0.5f;
    }
 else     if (ta.equals("right")) {
      r.alignment=1;
    }
 else {
      r.alignment=0;
    }
  }
 else {
    r.alignment=0;
  }
  return r;
}

protected SizeRequirements calculateMinorAxisRequirements ( int axis , SizeRequirements r ) { updateGrid ( ) ; calculateColumnRequirements ( axis ) ; if ( r == null ) { r = new SizeRequirements ( ) ; } long min = 0 ; long pref = 0 ; int n = columnRequirements . length ; for ( int i = 0 ; i < n ; i ++ ) { SizeRequirements req = columnRequirements [ i ] ; min += req . minimum ; pref += req . preferred ; } int adjust = ( n + 1 ) * cellSpacing + 2 * borderWidth ; min += adjust ; pref += adjust ; r . minimum = ( int ) min ; r . preferred = ( int ) pref ; r . maximum = ( int ) pref ; AttributeSet attr = getAttributes ( ) ; CSS . LengthValue cssWidth = ( CSS . LengthValue ) attr . getAttribute ( CSS . Attribute . WIDTH ) ; if ( BlockView . spanSetFromAttributes ( axis , r , cssWidth , null ) ) { if ( r . minimum < ( int ) min ) { r . maximum = r . minimum = r . preferred = ( int ) min ; } } totalColumnRequirements . minimum = r . minimum ; totalColumnRequirements . preferred = r . preferred ; totalColumnRequirements . maximum = r . maximum ; Object o = attr . getAttribute ( CSS . Attribute . TEXT_ALIGN ) ; if ( o != null ) { String ta = o . toString ( ) ; if ( ta . equals ( "left" ) ) { r . alignment = 0 ; } else if ( ta . equals ( "center" ) ) { r . alignment = 0.5f ; } else if ( ta . equals ( "right" ) ) { r . alignment = 1 ; } else { r . alignment = 0 ; } } else { r . alignment = 0 ; } return r ; }
calculate the requirements for the minor axis . this is called by the superclass whenever the requirements need to be updated ( i . e . a preferencechanged was messaged through this view ) . < p > this is implemented to calculate the requirements as the sum of the requirements of the columns and then adjust it if the css width or height attribute is specified and applicable to the axis .
