Ignore:
Timestamp:
05/27/19 13:50:07 (5 years ago)
Author:
bln4
Message:

Functionality for tab index. When a user is cursored over a text item with a _tabIndex property and hits tab (or shift tab), instead of adding a tab to the text item, it will find another text item on the frame with the next highest (or lowerest) _tabIndex property and move the cursor to it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/items/Text.java

    r1381 r1382  
    31923192                this._tabIndex = index;
    31933193        }
     3194       
     3195        public Text getTabNext() {
     3196                if (this._tabIndex >= 0) {
     3197                        Collection<Text> textItems = this.getParent().getTextItems();
     3198                        Text ret = null;
     3199                       
     3200                        for (Text t: textItems) {
     3201                                if (t._tabIndex > this._tabIndex) {
     3202                                        if (ret == null) {
     3203                                                ret = t;
     3204                                        } else if (t._tabIndex < ret._tabIndex) {
     3205                                                ret = t;
     3206                                        }
     3207                                }
     3208                        }
     3209                       
     3210                        return ret;
     3211                } else {
     3212                        return null;
     3213                }
     3214        }
     3215       
     3216        public Text getTabPrevious() {
     3217                if (this._tabIndex >= 0) {
     3218                        Collection<Text> textItems = this.getParent().getTextItems();
     3219                        Text ret = null;
     3220                       
     3221                        for (Text t: textItems) {
     3222                                if (t._tabIndex < this._tabIndex) {
     3223                                        if (ret == null) {
     3224                                                ret = t;
     3225                                        } else if (t._tabIndex > ret._tabIndex) {
     3226                                                ret = t;
     3227                                        }
     3228                                }
     3229                        }
     3230                       
     3231                        return ret;
     3232                } else {
     3233                        return null;
     3234                }
     3235        }
    31943236}
Note: See TracChangeset for help on using the changeset viewer.