static Object resolveToolbarConstraint(JToolBar toolbar){
  if (toolbar != null) {
    Container parent=toolbar.getParent();
    if (parent != null) {
      LayoutManager m=parent.getLayout();
      if (m instanceof BorderLayout) {
        BorderLayout b=(BorderLayout)m;
        Object con=b.getConstraints(toolbar);
        if (con == SOUTH || con == EAST || con == WEST) {
          return con;
        }
        return NORTH;
      }
    }
  }
  return NORTH;
}

static Object resolveToolbarConstraint ( JToolBar toolbar ) { if ( toolbar != null ) { Container parent = toolbar . getParent ( ) ; if ( parent != null ) { LayoutManager m = parent . getLayout ( ) ; if ( m instanceof BorderLayout ) { BorderLayout b = ( BorderLayout ) m ; Object con = b . getConstraints ( toolbar ) ; if ( con == SOUTH || con == EAST || con == WEST ) { return con ; } return NORTH ; } } } return NORTH ; }
package private method which returns either borderlayout . north , borderlayout . south , borderlayout . east , or borderlayout . west depending on the location of the toolbar in its parent . the toolbar might be in page_start , page_end , center , or some other position , but will be resolved to either north , south , east , or west based on where the toolbar actually is , with center being north . this code is used to determine where the border line should be drawn by the custom toolbar states , and also used by nimbusicon to determine whether the handle icon needs to be shifted to look correct . toollbars are unfortunately odd in the way these things are handled , and so this code exists to unify the logic related to toolbars so it can be shared among the static files such as nimbusicon and generated files such as the toolbar state classes .
