private void baselineLayout(int origin,int size){
  int ascent;
  int descent;
  if (baselineAnchoredToTop) {
    ascent=prefAscent;
    descent=size - ascent;
  }
 else {
    ascent=size - prefDescent;
    descent=prefDescent;
  }
  for (int counter=springs.size() - 1; counter >= 0; counter--) {
    Spring spring=getSpring(counter);
    int alignment=spring.getAlignment();
    if (alignment == NO_ALIGNMENT || alignment == BASELINE) {
      int baseline=spring.getBaseline();
      if (baseline >= 0) {
        int springMax=spring.getMaximumSize(VERTICAL);
        int springPref=spring.getPreferredSize(VERTICAL);
        int height=springPref;
        int y;
switch (spring.getBaselineResizeBehavior()) {
case Component.BRB_CONSTANT_ASCENT:
          y=origin + ascent - baseline;
        height=Math.min(descent,springMax - baseline) + baseline;
      break;
case Component.BRB_CONSTANT_DESCENT:
    height=Math.min(ascent,springMax - springPref + baseline) + (springPref - baseline);
  y=origin + ascent + (springPref - baseline) - height;
break;
default :
y=origin + ascent - baseline;
break;
}
spring.setSize(VERTICAL,y,height);
}
 else {
setChildSize(spring,VERTICAL,origin,size);
}
}
 else {
setChildSize(spring,VERTICAL,origin,size);
}
}
}

private void baselineLayout ( int origin , int size ) { int ascent ; int descent ; if ( baselineAnchoredToTop ) { ascent = prefAscent ; descent = size - ascent ; } else { ascent = size - prefDescent ; descent = prefDescent ; } for ( int counter = springs . size ( ) - 1 ; counter >= 0 ; counter -- ) { Spring spring = getSpring ( counter ) ; int alignment = spring . getAlignment ( ) ; if ( alignment == NO_ALIGNMENT || alignment == BASELINE ) { int baseline = spring . getBaseline ( ) ; if ( baseline >= 0 ) { int springMax = spring . getMaximumSize ( VERTICAL ) ; int springPref = spring . getPreferredSize ( VERTICAL ) ; int height = springPref ; int y ; switch ( spring . getBaselineResizeBehavior ( ) ) { case Component . BRB_CONSTANT_ASCENT : y = origin + ascent - baseline ; height = Math . min ( descent , springMax - baseline ) + baseline ; break ; case Component . BRB_CONSTANT_DESCENT : height = Math . min ( ascent , springMax - springPref + baseline ) + ( springPref - baseline ) ; y = origin + ascent + ( springPref - baseline ) - height ; break ; default : y = origin + ascent - baseline ; break ; } spring . setSize ( VERTICAL , y , height ) ; } else { setChildSize ( spring , VERTICAL , origin , size ) ; } } else { setChildSize ( spring , VERTICAL , origin , size ) ; } } }
lays out springs that have a baseline along the baseline . all others are centered .
