Ignore:
Timestamp:
06/26/19 16:02:00 (5 years ago)
Author:
bln4
Message:

More amendments to the way surrogates are handled. Including renaming classic to primary.

File:
1 edited

Legend:

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

    r1413 r1414  
    407407                if (isSurrogate()) {
    408408                        surrogatePropertyInheritance.put(DefaultFrameWriter.WIDTH_TO_SAVE_STR, false);
    409                         Item classic = getClassic();
     409                        Item primary = getPrimary();
    410410                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.WIDTH_TO_SAVE_STR)) {
    411                                 classic.classicPropertyEncryption.put(DefaultFrameWriter.WIDTH_TO_SAVE_STR, EncryptionDetail.InheritanceCheckOnSave);
     411                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.WIDTH_TO_SAVE_STR, EncryptionDetail.InheritanceCheckOnSave);
    412412                        }
    413413                }
     
    430430                if (isSurrogate()) {
    431431                        surrogatePropertyInheritance.put(DefaultFrameWriter.MIN_WIDTH_TO_SAVE_STR, false);
    432                         Item classic = getClassic();
     432                        Item primary = getPrimary();
    433433                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.MIN_WIDTH_TO_SAVE_STR)) {
    434                                 classic.classicPropertyEncryption.put(DefaultFrameWriter.MIN_WIDTH_TO_SAVE_STR, EncryptionDetail.InheritanceCheckOnSave);
     434                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.MIN_WIDTH_TO_SAVE_STR, EncryptionDetail.InheritanceCheckOnSave);
    435435                        }
    436436                }
     
    451451        public Integer getWidth() {
    452452                if (isSurrogate() && surrogatePropertyInheritance.get(DefaultFrameWriter.WIDTH_TO_SAVE_STR)) {
    453                         return this.getClassic().getWidth();
     453                        return this.getPrimary().getWidth();
    454454                } else {
    455455                        return _width;
     
    467467        public Integer getMinWidth() {
    468468                if (isSurrogate() && surrogatePropertyInheritance.get(DefaultFrameWriter.MIN_WIDTH_TO_SAVE_STR)) {
    469                         return this.getClassic().getMinWidth();
     469                        return this.getPrimary().getMinWidth();
    470470                } else {
    471471                        return _minWidth;
     
    483483        public Colour getHighlightColor() {
    484484                if (isSurrogate() && surrogatePropertyInheritance.get(DefaultFrameWriter.HIGHLIGHT_STR)) {
    485                         return this.getClassic().getHighlightColor();
     485                        return this.getPrimary().getHighlightColor();
    486486                } else {
    487487                        return _highlightColour;
     
    511511                if (isSurrogate()) {
    512512                        surrogatePropertyInheritance.put(DefaultFrameWriter.JUSTIFICATION_STR, false);
    513                         Item classic = getClassic();
     513                        Item primary = getPrimary();
    514514                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.JUSTIFICATION_STR)) {
    515                                 classic.classicPropertyEncryption.put(DefaultFrameWriter.JUSTIFICATION_STR, EncryptionDetail.InheritanceCheckOnSave);
     515                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.JUSTIFICATION_STR, EncryptionDetail.InheritanceCheckOnSave);
    516516                        }
    517517                }
     
    528528        public Justification getJustification() {
    529529                if (isSurrogate() && surrogatePropertyInheritance.get(DefaultFrameWriter.JUSTIFICATION_STR)) {
    530                         return ((Text) this.getClassic()).getJustification();
     530                        return ((Text) this.getPrimary()).getJustification();
    531531                } else {
    532532                        if (_justification == null || _justification.equals(Justification.left)) {
     
    692692                if (isSurrogate()) {
    693693                        surrogatePropertyInheritance.put(DefaultFrameWriter.TEXT_STR, false);
    694                         Item classic = getClassic();
     694                        Item primary = getPrimary();
    695695                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.TEXT_STR)) {
    696                                 classic.classicPropertyEncryption.put(DefaultFrameWriter.TEXT_STR, EncryptionDetail.InheritanceCheckOnSave);
     696                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.TEXT_STR, EncryptionDetail.InheritanceCheckOnSave);
    697697                        }
    698698                }
     
    13301330                if (isSurrogate()) {
    13311331                        surrogatePropertyInheritance.put(DefaultFrameWriter.FONT_STR, false);
    1332                         Item classic = getClassic();
     1332                        Item primary = getPrimary();
    13331333                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.FONT_STR)) {
    1334                                 classic.classicPropertyEncryption.put(DefaultFrameWriter.FONT_STR, EncryptionDetail.InheritanceCheckOnSave);
     1334                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.FONT_STR, EncryptionDetail.InheritanceCheckOnSave);
    13351335                        }
    13361336                }
     
    13441344        public Font getFont() {
    13451345                if (isSurrogate() && surrogatePropertyInheritance.get(DefaultFrameWriter.FONT_STR)) {
    1346                         return ((Text) this.getClassic()).getFont();
     1346                        return ((Text) this.getPrimary()).getFont();
    13471347                } else {
    13481348                        return _font;
     
    15081508        public String getText() {
    15091509                if (isSurrogate() && surrogatePropertyInheritance.get(DefaultFrameWriter.TEXT_STR)) {
    1510                         return this.getClassic().getText();
     1510                        return this.getPrimary().getText();
    15111511                } else {
    15121512                        return _text.toString();
     
    15521552                if (isSurrogate()) {
    15531553                        surrogatePropertyInheritance.put(DefaultFrameWriter.SPACING_STR, false);
    1554                         Item classic = getClassic();
     1554                        Item primary = getPrimary();
    15551555                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.SPACING_STR)) {
    1556                                 classic.classicPropertyEncryption.put(DefaultFrameWriter.SPACING_STR, EncryptionDetail.InheritanceCheckOnSave);
     1556                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.SPACING_STR, EncryptionDetail.InheritanceCheckOnSave);
    15571557                        }
    15581558                }
     
    15661566        public float getSpacing() {
    15671567                if (isSurrogate() && surrogatePropertyInheritance.get(DefaultFrameWriter.SPACING_STR)) {
    1568                         return ((Text) this.getClassic()).getSpacing();
     1568                        return ((Text) this.getPrimary()).getSpacing();
    15691569                } else {
    15701570                        return _spacing;
     
    15931593                if (isSurrogate()) {
    15941594                        surrogatePropertyInheritance.put(DefaultFrameWriter.WORD_SPACING_STR, false);
    1595                         Item classic = getClassic();
     1595                        Item primary = getPrimary();
    15961596                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.WORD_SPACING_STR)) {
    1597                                 classic.classicPropertyEncryption.put(DefaultFrameWriter.WORD_SPACING_STR, EncryptionDetail.InheritanceCheckOnSave);
     1597                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.WORD_SPACING_STR, EncryptionDetail.InheritanceCheckOnSave);
    15981598                        }
    15991599                }
     
    16021602        public int getWordSpacing() {
    16031603                if (isSurrogate() && surrogatePropertyInheritance.get(DefaultFrameWriter.WORD_SPACING_STR)) {
    1604                         return ((Text) this.getClassic()).getWordSpacing();
     1604                        return ((Text) this.getPrimary()).getWordSpacing();
    16051605                } else {
    16061606                        return _word_spacing;
     
    16241624                if (isSurrogate()) {
    16251625                        surrogatePropertyInheritance.put(DefaultFrameWriter.LETTER_SPACING_STR, false);
    1626                         Item classic = getClassic();
     1626                        Item primary = getPrimary();
    16271627                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.LETTER_SPACING_STR)) {
    1628                                 classic.classicPropertyEncryption.put(DefaultFrameWriter.LETTER_SPACING_STR, EncryptionDetail.InheritanceCheckOnSave);
     1628                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.LETTER_SPACING_STR, EncryptionDetail.InheritanceCheckOnSave);
    16291629                        }
    16301630                }
     
    16371637        public float getLetterSpacing() {
    16381638                if (isSurrogate() && surrogatePropertyInheritance.get(DefaultFrameWriter.LETTER_SPACING_STR)) {
    1639                         return ((Text) this.getClassic()).getLetterSpacing();
     1639                        return ((Text) this.getPrimary()).getLetterSpacing();
    16401640                } else {
    16411641                        return _letter_spacing;
     
    16481648                if (isSurrogate()) {
    16491649                        surrogatePropertyInheritance.put(DefaultFrameWriter.INITIAL_SPACING_STR, false);
    1650                         Item classic = getClassic();
     1650                        Item primary = getPrimary();
    16511651                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.INITIAL_SPACING_STR)) {
    1652                                 classic.classicPropertyEncryption.put(DefaultFrameWriter.INITIAL_SPACING_STR, EncryptionDetail.InheritanceCheckOnSave);
     1652                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.INITIAL_SPACING_STR, EncryptionDetail.InheritanceCheckOnSave);
    16531653                        }
    16541654                }
     
    16571657        public float getInitialSpacing() {
    16581658                if (isSurrogate() && surrogatePropertyInheritance.get(DefaultFrameWriter.INITIAL_SPACING_STR)) {
    1659                         return ((Text) this.getClassic()).getInitialSpacing();
     1659                        return ((Text) this.getPrimary()).getInitialSpacing();
    16601660                } else {
    16611661                        return _initial_spacing;
     
    28642864                if (isSurrogate()) {
    28652865                        surrogatePropertyInheritance.put(DefaultFrameWriter.ANCHOR_LEFT_STR, false);
    2866                         Item classic = getClassic();
     2866                        Item primary = getPrimary();
    28672867                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.ANCHOR_LEFT_STR)) {
    2868                                 classic.classicPropertyEncryption.put(DefaultFrameWriter.ANCHOR_LEFT_STR, EncryptionDetail.InheritanceCheckOnSave);
     2868                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.ANCHOR_LEFT_STR, EncryptionDetail.InheritanceCheckOnSave);
    28692869                        }
    28702870                }
     
    28982898                if (isSurrogate()) {
    28992899                        surrogatePropertyInheritance.put(DefaultFrameWriter.ANCHOR_RIGHT_STR, false);
    2900                         Item classic = getClassic();
     2900                        Item primary = getPrimary();
    29012901                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.ANCHOR_RIGHT_STR)) {
    2902                                 classic.classicPropertyEncryption.put(DefaultFrameWriter.ANCHOR_RIGHT_STR, EncryptionDetail.InheritanceCheckOnSave);
     2902                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.ANCHOR_RIGHT_STR, EncryptionDetail.InheritanceCheckOnSave);
    29032903                        }
    29042904                }
     
    29392939                if (isSurrogate()) {
    29402940                        surrogatePropertyInheritance.put(DefaultFrameWriter.ANCHOR_TOP_STR, false);
    2941                         Item classic = getClassic();
     2941                        Item primary = getPrimary();
    29422942                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.ANCHOR_TOP_STR)) {
    2943                                 classic.classicPropertyEncryption.put(DefaultFrameWriter.ANCHOR_TOP_STR, EncryptionDetail.InheritanceCheckOnSave);
     2943                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.ANCHOR_TOP_STR, EncryptionDetail.InheritanceCheckOnSave);
    29442944                        }
    29452945                }
     
    29852985                if (isSurrogate()) {
    29862986                        surrogatePropertyInheritance.put(DefaultFrameWriter.ANCHOR_BOTTOM_STR, false);
    2987                         Item classic = getClassic();
     2987                        Item primary = getPrimary();
    29882988                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.ANCHOR_BOTTOM_STR)) {
    2989                                 classic.classicPropertyEncryption.put(DefaultFrameWriter.ANCHOR_BOTTOM_STR, EncryptionDetail.InheritanceCheckOnSave);
     2989                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.ANCHOR_BOTTOM_STR, EncryptionDetail.InheritanceCheckOnSave);
    29902990                        }
    29912991                }
     
    31463146        public boolean getAutoWrap() {
    31473147                if (isSurrogate() && surrogatePropertyInheritance.get(DefaultFrameWriter.AUTO_WRAP_TO_SAVE_STR)) {
    3148                         return ((Text) this.getClassic()).getAutoWrap();
     3148                        return ((Text) this.getPrimary()).getAutoWrap();
    31493149                } else {
    31503150                        return _autoWrap;
     
    31663166                if (isSurrogate()) {
    31673167                        surrogatePropertyInheritance.put(DefaultFrameWriter.AUTO_WRAP_TO_SAVE_STR, false);
    3168                         Item classic = getClassic();
     3168                        Item primary = getPrimary();
    31693169                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.AUTO_WRAP_TO_SAVE_STR)) {
    3170                                 classic.classicPropertyEncryption.put(DefaultFrameWriter.AUTO_WRAP_TO_SAVE_STR, EncryptionDetail.InheritanceCheckOnSave);
     3170                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.AUTO_WRAP_TO_SAVE_STR, EncryptionDetail.InheritanceCheckOnSave);
    31713171                        }
    31723172                }
     
    32943294        public Integer getMask() {
    32953295                if (isSurrogate() && surrogatePropertyInheritance.get(DefaultFrameWriter.MASK_STR)) {
    3296                         return ((Text) this.getClassic()).getMask();
     3296                        return ((Text) this.getPrimary()).getMask();
    32973297                } else {
    32983298                        return _mask;
     
    33053305                if (isSurrogate()) {
    33063306                        surrogatePropertyInheritance.put(DefaultFrameWriter.MASK_STR, false);
    3307                         Item classic = getClassic();
     3307                        Item primary = getPrimary();
    33083308                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.MASK_STR)) {
    3309                                 classic.classicPropertyEncryption.put(DefaultFrameWriter.MASK_STR, EncryptionDetail.InheritanceCheckOnSave);
     3309                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.MASK_STR, EncryptionDetail.InheritanceCheckOnSave);
    33103310                        }
    33113311                }
     
    33143314        public String getPlaceholder() {
    33153315                if (isSurrogate() && surrogatePropertyInheritance.get(DefaultFrameWriter.PLACEHOLDER_STR)) {
    3316                         return ((Text) this.getClassic()).getPlaceholder();
     3316                        return ((Text) this.getPrimary()).getPlaceholder();
    33173317                } else {
    33183318                        if (_placeholder == null || _placeholder.length() == 0) {
     
    33283328                if (isSurrogate()) {
    33293329                        surrogatePropertyInheritance.put(DefaultFrameWriter.PLACEHOLDER_STR, false);
    3330                         Item classic = getClassic();
     3330                        Item primary = getPrimary();
    33313331                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.PLACEHOLDER_STR)) {
    3332                                 classic.classicPropertyEncryption.put(DefaultFrameWriter.PLACEHOLDER_STR, EncryptionDetail.InheritanceCheckOnSave);
     3332                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.PLACEHOLDER_STR, EncryptionDetail.InheritanceCheckOnSave);
    33333333                        }
    33343334                }
     
    33473347        public boolean isSingleLineOnly() {
    33483348                if (isSurrogate() && surrogatePropertyInheritance.get(DefaultFrameWriter.SINGLE_LINE_ONLY_STR)) {
    3349                         return ((Text) this.getClassic()).isSingleLineOnly();
     3349                        return ((Text) this.getPrimary()).isSingleLineOnly();
    33503350                } else {
    33513351                        return _singleLine;
     
    33583358                if (isSurrogate()) {
    33593359                        surrogatePropertyInheritance.put(DefaultFrameWriter.SINGLE_LINE_ONLY_STR, false);
    3360                         Item classic = getClassic();
     3360                        Item primary = getPrimary();
    33613361                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.SINGLE_LINE_ONLY_STR)) {
    3362                                 classic.classicPropertyEncryption.put(DefaultFrameWriter.SINGLE_LINE_ONLY_STR, EncryptionDetail.InheritanceCheckOnSave);
     3362                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.SINGLE_LINE_ONLY_STR, EncryptionDetail.InheritanceCheckOnSave);
    33633363                        }
    33643364                }
     
    33673367        public int getTabIndex() {
    33683368                if (isSurrogate() && surrogatePropertyInheritance.get(DefaultFrameWriter.TAB_INDEX_STR)) {
    3369                         return ((Text) this.getClassic()).getTabIndex();
     3369                        return ((Text) this.getPrimary()).getTabIndex();
    33703370                } else {
    33713371                        return this._tabIndex;
     
    33783378                if (isSurrogate()) {
    33793379                        surrogatePropertyInheritance.put(DefaultFrameWriter.TAB_INDEX_STR, false);
    3380                         Item classic = getClassic();
     3380                        Item primary = getPrimary();
    33813381                        if (subjectToInheritanceCheckOnSave(DefaultFrameWriter.TAB_INDEX_STR)) {
    3382                                 classic.classicPropertyEncryption.put(DefaultFrameWriter.TAB_INDEX_STR, EncryptionDetail.InheritanceCheckOnSave);
     3382                                primary.primaryPropertyEncryption.put(DefaultFrameWriter.TAB_INDEX_STR, EncryptionDetail.InheritanceCheckOnSave);
    33833383                        }
    33843384                }
Note: See TracChangeset for help on using the changeset viewer.