Esempio n. 1
0
 public double getAngle(double angle) {
   int n = this.slots.size();
   double rotStep = Math.PI * 2 / n;
   for (int i = 0; i < slots.size(); i++) {
     EyeSlot slot = slots.elementAt(i);
     if (slot.isSelected(angle)) {
       angle = -rotStep * i - rotStep / 2;
       break;
     }
   }
   return angle;
 }
Esempio n. 2
0
  public EyeSlot selectSlot(double angle) {
    selectedSlot = null;
    int n = this.slots.size();
    for (int i = 0; i < slots.size(); i++) {
      EyeSlot slot = slots.elementAt(i);
      if (slot.isSelected(angle)) {
        selectedSlot = slot;
        break;
      }
    }

    if (selectedSlot != null) {
      this.selector.describeRelation(selectedSlot);
    }

    return selectedSlot;
  }