protected boolean labelsHaveSameBaselines(){
  if (!checkedLabelBaselines) {
    checkedLabelBaselines=true;
    Dictionary dictionary=slider.getLabelTable();
    if (dictionary != null) {
      sameLabelBaselines=true;
      Enumeration elements=dictionary.elements();
      int baseline=-1;
      while (elements.hasMoreElements()) {
        JComponent label=(JComponent)elements.nextElement();
        Dimension pref=label.getPreferredSize();
        int labelBaseline=label.getBaseline(pref.width,pref.height);
        if (labelBaseline >= 0) {
          if (baseline == -1) {
            baseline=labelBaseline;
          }
 else           if (baseline != labelBaseline) {
            sameLabelBaselines=false;
            break;
          }
        }
 else {
          sameLabelBaselines=false;
          break;
        }
      }
    }
 else {
      sameLabelBaselines=false;
    }
  }
  return sameLabelBaselines;
}

protected boolean labelsHaveSameBaselines ( ) { if ( ! checkedLabelBaselines ) { checkedLabelBaselines = true ; Dictionary dictionary = slider . getLabelTable ( ) ; if ( dictionary != null ) { sameLabelBaselines = true ; Enumeration elements = dictionary . elements ( ) ; int baseline = - 1 ; while ( elements . hasMoreElements ( ) ) { JComponent label = ( JComponent ) elements . nextElement ( ) ; Dimension pref = label . getPreferredSize ( ) ; int labelBaseline = label . getBaseline ( pref . width , pref . height ) ; if ( labelBaseline >= 0 ) { if ( baseline == - 1 ) { baseline = labelBaseline ; } else if ( baseline != labelBaseline ) { sameLabelBaselines = false ; break ; } } else { sameLabelBaselines = false ; break ; } } } else { sameLabelBaselines = false ; } } return sameLabelBaselines ; }
returns true if all the labels from the label table have the same baseline .
