private boolean areParallelSiblings(Component source,Component target,int axis){
  ComponentInfo sourceInfo=getComponentInfo(source);
  ComponentInfo targetInfo=getComponentInfo(target);
  Spring sourceSpring;
  Spring targetSpring;
  if (axis == HORIZONTAL) {
    sourceSpring=sourceInfo.horizontalSpring;
    targetSpring=targetInfo.horizontalSpring;
  }
 else {
    sourceSpring=sourceInfo.verticalSpring;
    targetSpring=targetInfo.verticalSpring;
  }
  ArrayList sourcePath=tmpParallelSet;
  sourcePath.clear();
  Spring spring=sourceSpring.getParent();
  while (spring != null) {
    sourcePath.add(spring);
    spring=spring.getParent();
  }
  spring=targetSpring.getParent();
  while (spring != null) {
    if (sourcePath.contains(spring)) {
      sourcePath.clear();
      while (spring != null) {
        if (spring instanceof ParallelGroup) {
          return true;
        }
        spring=spring.getParent();
      }
      return false;
    }
    spring=spring.getParent();
  }
  sourcePath.clear();
  return false;
}

private boolean areParallelSiblings ( Component source , Component target , int axis ) { ComponentInfo sourceInfo = getComponentInfo ( source ) ; ComponentInfo targetInfo = getComponentInfo ( target ) ; Spring sourceSpring ; Spring targetSpring ; if ( axis == HORIZONTAL ) { sourceSpring = sourceInfo . horizontalSpring ; targetSpring = targetInfo . horizontalSpring ; } else { sourceSpring = sourceInfo . verticalSpring ; targetSpring = targetInfo . verticalSpring ; } ArrayList sourcePath = tmpParallelSet ; sourcePath . clear ( ) ; Spring spring = sourceSpring . getParent ( ) ; while ( spring != null ) { sourcePath . add ( spring ) ; spring = spring . getParent ( ) ; } spring = targetSpring . getParent ( ) ; while ( spring != null ) { if ( sourcePath . contains ( spring ) ) { sourcePath . clear ( ) ; while ( spring != null ) { if ( spring instanceof ParallelGroup ) { return true ; } spring = spring . getParent ( ) ; } return false ; } spring = spring . getParent ( ) ; } sourcePath . clear ( ) ; return false ; }
returns true if the two components have a common parallelgroup ancestor along the particular axis .
