[jsword-devel] proposal

John Jacques john.jacques at bigfoot.com
Wed Sep 15 20:01:47 MST 2004


DM Smith and Troy,

I would like to make the following change to UniTextEdit.java

 void jTextArea1_keyTyped(KeyEvent e) {
      char typedChar = e.getKeyChar();
      String pushChar = null;
      statusBar.setText("");

      SWInputMethod inputMethod = (SWInputMethod)
imComboBox.getSelectedItem();

      pushChar = inputMethod.translate(typedChar);
      if (inputMethod.getState() > 1) {
          statusBar.setText("Compound '"+typedChar+"'");
          e.consume();
+      } else if( null == pushChar ) {
      } else {
          if (pushChar.length() > 1) {
              e.consume();
              jTextArea1.insert(pushChar,
jTextArea1.getCaretPosition());
          }
          else e.setKeyChar(pushChar.charAt(0));
      }
  }

My reason is as follows:

I would like to be able to type characters in the current locale in the
editor.  With the greek prepositions, for example, it would be best to
have a different flash card for each case.  To accomplish this, I would
like to indicate the case of the object of the preposition in the
"word".

	ὑπο,ὑπ',ὑφ' gen.

My plan is to use a control sequence to change modes, something like
ctrl-t.  Since the control sequence is not intended to generate a
character, I would like to be able to return 'null' from the translate()
method and have UniTextEditor.java ignore it.

Is this acceptable?  Would it break other uses of UniTextEdit?




More information about the jsword-devel mailing list