Ignore:
Timestamp:
06/21/19 15:16:05 (5 years ago)
Author:
bln4
Message:

Fixed bug with surrogate inheritance.

File:
1 edited

Legend:

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

    r1392 r1410  
    4141import org.expeditee.core.bounds.AxisAlignedBoxBounds;
    4242import org.expeditee.core.bounds.PolygonBounds;
     43import org.expeditee.encryption.items.surrogates.Surrogate;
    4344import org.expeditee.gio.EcosystemManager;
    4445import org.expeditee.gio.GraphicsManager;
     
    5152import org.expeditee.gui.FreeItems;
    5253import org.expeditee.gui.MessageBay;
     54import org.expeditee.io.DefaultFrameWriter;
    5355import org.expeditee.items.MagneticConstraint.MagneticConstraints;
    5456import org.expeditee.math.ExpediteeJEP;
     
    499501         */
    500502        public Justification getJustification() {
    501                 if (_justification == null || _justification.equals(Justification.left)) {
    502                         return null;
    503                 }
    504 
    505                 return _justification;
     503                Surrogate surrogate = Surrogate.of(this);
     504                if (surrogate != null &&
     505                                surrogate.isPropertyIsInherited(DefaultFrameWriter.JUSTIFICATION + "")) {
     506                        return ((Text) this.getClassic()).getJustification();
     507                } else {
     508                        if (_justification == null || _justification.equals(Justification.left)) {
     509                                return null;
     510                        }
     511
     512                        return _justification;
     513                }
    506514        }
    507515
     
    12951303         */
    12961304        public Font getFont() {
    1297                 return _font;
     1305                Surrogate surrogate = Surrogate.of(this);
     1306                if (surrogate != null &&
     1307                                surrogate.isPropertyIsInherited(DefaultFrameWriter.FONT + "")) {
     1308                        return ((Text) this.getClassic()).getFont();
     1309                } else {
     1310                        return _font;
     1311                }
    12981312        }
    12991313
     
    15011515         */
    15021516        public float getSpacing() {
    1503                 return _spacing;
     1517                Surrogate surrogate = Surrogate.of(this);
     1518                if (surrogate != null &&
     1519                                surrogate.isPropertyIsInherited(DefaultFrameWriter.SPACING + "")) {
     1520                        return ((Text) this.getClassic()).getSpacing();
     1521                } else {
     1522                        return _spacing;
     1523                }
    15041524        }
    15051525
     
    15251545
    15261546        public int getWordSpacing() {
    1527                 return _word_spacing;
     1547                Surrogate surrogate = Surrogate.of(this);
     1548                if (surrogate != null &&
     1549                                surrogate.isPropertyIsInherited(DefaultFrameWriter.WORD_SPACING + "")) {
     1550                        return ((Text) this.getClassic()).getWordSpacing();
     1551                } else {
     1552                        return _word_spacing;
     1553                }
    15281554        }
    15291555
     
    15481574         */
    15491575        public float getLetterSpacing() {
    1550                 return _letter_spacing;
     1576                Surrogate surrogate = Surrogate.of(this);
     1577                if (surrogate != null &&
     1578                                surrogate.isPropertyIsInherited(DefaultFrameWriter.LETTER_SPACING + "")) {
     1579                        return ((Text) this.getClassic()).getLetterSpacing();
     1580                } else {
     1581                        return _letter_spacing;
     1582                }
    15511583        }
    15521584
     
    15561588
    15571589        public float getInitialSpacing() {
    1558                 return _initial_spacing;
     1590                Surrogate surrogate = Surrogate.of(this);
     1591                if (surrogate != null &&
     1592                                surrogate.isPropertyIsInherited(DefaultFrameWriter.INITIAL_SPACING + "")) {
     1593                        return ((Text) this.getClassic()).getInitialSpacing();
     1594                } else {
     1595                        return _initial_spacing;
     1596                }
    15591597        }
    15601598
     
    30093047
    30103048        public boolean getAutoWrap() {
    3011                 return _autoWrap;
     3049                Surrogate surrogate = Surrogate.of(this);
     3050                if (surrogate != null &&
     3051                                surrogate.isPropertyIsInherited(DefaultFrameWriter.AUTO_WRAP_TO_SAVE + "")) {
     3052                        return ((Text) this.getClassic()).getAutoWrap();
     3053                } else {
     3054                        return _autoWrap;
     3055                }
    30123056        }
    30133057
     
    31453189
    31463190        public Integer getMask() {
    3147                 if (_mask == null) {
    3148                         return null;
     3191                Surrogate surrogate = Surrogate.of(this);
     3192                if (surrogate != null &&
     3193                                surrogate.isPropertyIsInherited(DefaultFrameWriter.MASK + "")) {
     3194                        return ((Text) this.getClassic()).getMask();
    31493195                } else {
    3150                         return _mask;
    3151                 }
     3196                        if (_mask == null) {
     3197                                return null;
     3198                        } else {
     3199                                return _mask;
     3200                        }
     3201                }
     3202
    31523203        }
    31533204
     
    31573208       
    31583209        public String getPlaceholder() {
    3159                 if (_placeholder == null || _placeholder.length() == 0) {
    3160                         return null;
    3161                 }
    3162                 return _placeholder.toString();
     3210                Surrogate surrogate = Surrogate.of(this);
     3211                if (surrogate != null &&
     3212                                surrogate.isPropertyIsInherited(DefaultFrameWriter.PLACEHOLDER + "")) {
     3213                        return ((Text) this.getClassic()).getPlaceholder();
     3214                } else {
     3215                        if (_placeholder == null || _placeholder.length() == 0) {
     3216                                return null;
     3217                        }
     3218                        return _placeholder.toString();
     3219                }
    31633220        }
    31643221
     
    31783235
    31793236        public boolean isSingleLineOnly() {
    3180                 return _singleLine;
     3237                Surrogate surrogate = Surrogate.of(this);
     3238                if (surrogate != null &&
     3239                                surrogate.isPropertyIsInherited(DefaultFrameWriter.SINGLE_LINE_ONLY + "")) {
     3240                        return ((Text) this.getClassic()).isSingleLineOnly();
     3241                } else {
     3242                        return _singleLine;
     3243                }
    31813244        }
    31823245
     
    31863249       
    31873250        public int getTabIndex() {
    3188                 return this._tabIndex;
     3251                Surrogate surrogate = Surrogate.of(this);
     3252                if (surrogate != null &&
     3253                                surrogate.isPropertyIsInherited(DefaultFrameWriter.TAB_INDEX + "")) {
     3254                        return ((Text) this.getClassic()).getTabIndex();
     3255                } else {
     3256                        return this._tabIndex;
     3257                }
    31893258        }
    31903259       
Note: See TracChangeset for help on using the changeset viewer.