Esempio n. 1
0
  /** Set syllabification at given index */
  public void setSyllabificationAtIndex(int pIdx, SyllableConstituentType scType) {
    IPAElement p = getPhoneAtIndex(pIdx);
    if (p != null) {
      final int realPhonexIndex = getTranscript().indexOf(p);
      SyllabificationChangeData oldData =
          new SyllabificationChangeData(realPhonexIndex, p.getScType());
      SyllabificationChangeData newData = new SyllabificationChangeData(realPhonexIndex, scType);

      super.firePropertyChange(SYLLABIFICATION_PROP_ID, oldData, newData);
    }
  }
Esempio n. 2
0
  public void setFocusedPhone(int pIdx) {
    int currentFocus = focusedPhone;
    int direction = pIdx - currentFocus;
    if (pIdx >= 0 && pIdx < getNumberOfDisplayedPhones()) {
      IPAElement p = getPhoneAtIndex(pIdx);
      if (p.getText().equals(" ")) {
        if (direction < 0) pIdx--;
        else pIdx++;
      }
      focusedPhone = pIdx;
      repaint();

      super.firePropertyChange(PHONE_FOCUS, currentFocus, pIdx);
    }
  }