Exemple #1
0
        public InputMethodEvent(Component src, int id, long when,
                                java.text.AttributedCharacterIterator text,
                                int committedCharacterCount,
                                java.awt.font.TextHitInfo caret,
                                java.awt.font.TextHitInfo visiblePos) :
            base(src, id)
        {
            if ((id < INPUT_METHOD_FIRST) || (id > INPUT_METHOD_LAST))
            {
                // awt.18E=Wrong event id
                throw new java.lang.IllegalArgumentException("Wrong event id"); //$NON-NLS-1$
            }
            if ((id == CARET_POSITION_CHANGED) && (text != null))
            {
                // awt.18F=Text must be null for CARET_POSITION_CHANGED
                throw new java.lang.IllegalArgumentException("Text must be null for CARET_POSITION_CHANGED"); //$NON-NLS-1$
            }
            if ((text != null) &&
                ((committedCharacterCount < 0) ||
                 (committedCharacterCount >
                  (text.getEndIndex() - text.getBeginIndex()))))
            {
                // awt.190=Wrong committedCharacterCount
                throw new java.lang.IllegalArgumentException("Wrong committedCharacterCount"); //$NON-NLS-1$
            }

            this.when                    = when;
            this.text                    = text;
            this.caret                   = caret;
            this.visiblePosition         = visiblePos;
            this.committedCharacterCount = committedCharacterCount;
        }
Exemple #2
0
 public InputMethodEvent(Component src, int id,
                         java.text.AttributedCharacterIterator text,
                         int commitedCharCount,
                         java.awt.font.TextHitInfo caret,
                         java.awt.font.TextHitInfo visiblePos) :
     this(src, id, 0l, text, commitedCharCount, caret, visiblePos)
 {
 }