if (comps[i] == c) return i - top;
for (int i = index; i >= 0; --i) { if (layer == getLayer(components[i])) pos++; else break; }
  public int getPosition(Component c)  {    int layer = getLayer (c);    int[] range = layerToRange(new Integer(layer));    int top = range[0];    int bot = range[1];    Component[] comps = getComponents ();    for (int i = top; i < bot; ++i)	    {        if (comps[i] == c)          return i - top;	    }    // should have found it    throw new IllegalArgumentException ();  }