Changeset 1410


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

Fixed bug with surrogate inheritance.

Location:
trunk/src/org/expeditee
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/encryption/io/EncryptedExpWriter.java

    r1409 r1410  
    1111import java.util.LinkedHashMap;
    1212import java.util.List;
     13import java.util.Set;
    1314import java.util.function.Consumer;
    1415
     
    135136                LinkedHashMap<Character,Method> itemTags = new LinkedHashMap<Character, Method>(getItemTags());
    136137                LinkedHashMap<String,Method> itemTagsExt = new LinkedHashMap<String, Method>(getItemTagsExt());
     138               
     139                // Perform final update on surrogates to ensure inheritance works.
     140                Set<Surrogate> surrogates = toWrite.getSurrogates();
     141                for (Surrogate s: surrogates) {
     142                        s.toString();
     143                }
    137144               
    138145                writeTag(toWrite, new Object[] {}, itemTags, 'S');
  • trunk/src/org/expeditee/encryption/items/surrogates/Surrogate.java

    r1408 r1410  
    88import java.util.List;
    99import java.util.Map;
     10import java.util.Optional;
    1011import java.util.Set;
    1112
     
    1718
    1819public class Surrogate {
     20       
     21        private static List<Surrogate> surrogateCache = new ArrayList<Surrogate>();
    1922       
    2023        private static Map<String, Boolean> propertyInheritanceDefault = new HashMap<String, Boolean>();
     
    4043                this.surrogateItem = surrogateItem;
    4144                this.propertyInheritance = new HashMap<String, Boolean>(propertyInheritanceDefault);
     45                surrogateCache.add(this);
    4246        }
    4347       
     
    6973                        boolean propertyIsInherited = isPropertyIsInherited(itemTag + "");
    7074                        if (propertyIsInherited) {
     75                                surrogateItem.getClassic().setEncryptionDetailForTag(itemTag + "", EncryptionDetail.UnencryptedOnSave);
    7176                                continue;
    7277                        }
     
    120125        }
    121126       
    122         public static Surrogate forItem(Item item) {
     127        public static Surrogate of(Item surrogate) {
     128                Optional<Surrogate> s = surrogateCache.stream().filter(si -> si.getSurrogateItem() == surrogate).findAny();
     129                if (s.isPresent()) {
     130                        return s.get();
     131                } else {
     132                        return null;
     133                }
     134        }
     135       
     136        public static Surrogate forItem(Item item) {           
    123137                Item surrogateItem = item.copy();
    124138                surrogateItem.setID(item.getParent().getNextItemID());
  • trunk/src/org/expeditee/gui/FrameGraphics.java

    r1218 r1410  
    3232import org.expeditee.core.Image;
    3333import org.expeditee.core.bounds.PolygonBounds;
     34import org.expeditee.encryption.items.surrogates.Label.LabelResult;
     35import org.expeditee.encryption.items.surrogates.Label;
     36import org.expeditee.encryption.items.surrogates.Surrogate;
    3437import org.expeditee.gio.EcosystemManager;
    3538import org.expeditee.gio.input.KBMInputEvent.Key;
     
    454457                if (i == null) {
    455458                        return;
     459                }
     460               
     461                String encryptionLabel = i.getEncryptionLabel();
     462                if (encryptionLabel != null && encryptionLabel.length() > 0 && !i.isSurrogate()) {
     463                        LabelResult result = Label.resolveKey(encryptionLabel);
     464                        if (result != LabelResult.SuccessResolveLabelToKey) {
     465                                for(Surrogate s: i.getSurrogates()) {
     466                                        PaintItem(s.getSurrogateItem());
     467                                }
     468                                return;
     469                        }
    456470                }
    457471
  • trunk/src/org/expeditee/io/DefaultFrameWriter.java

    r1408 r1410  
    4242                FrameWriter {
    4343
     44        public static final String TAB_INDEX = "_ti";
     45        public static final String SINGLE_LINE_ONLY = "_sl";
     46        public static final String PLACEHOLDER = "_ph";
     47        public static final String ENCRYPTION_LABEL = "_el";
     48        public static final char MAGNETIZED_ITEM_BOTTOM = '/';
     49        public static final char MAGNETIZED_ITEM_TOP = '^';
     50        public static final char MAGNETIZED_ITEM_RIGHT = ']';
     51        public static final char MAGNETIZED_ITEM_LEFT = '[';
     52        public static final char PERMISSION = 'p';
     53        public static final char LINK_HISTORY = 'B';
     54        public static final char TOOLTIP = 'A';
     55        public static final char CONSTRAINT_IDS = 'c';
     56        public static final char LINE_IDS = 'l';
     57        public static final char THICKNESS = 'h';
     58        public static final char AUTO_WRAP_TO_SAVE = 'r';
     59        public static final char JUSTIFICATION = 'k';
     60        public static final char MIN_WIDTH_TO_SAVE = 'M';
     61        public static final char WIDTH_TO_SAVE = 'w';
     62        public static final char INITIAL_SPACING = 'm';
     63        public static final char LETTER_SPACING = 'b';
     64        public static final char WORD_SPACING = 'a';
     65        public static final char FORMULA = 'J';
     66        public static final char MASK = 'O';
     67        public static final char SPACING = 't';
     68        public static final char FONT = 'f';
     69        public static final char FILLED = 'z';
     70        public static final char DOT_TYPE = 'v';
     71        public static final char ARROW = 'j';
     72        public static final char LINE_PATTERN = 'g';
     73        public static final char LINK_TEMPLATE = 'y';
     74        public static final char LINK_FRAMESET = 'q';
     75        public static final char LINK_MARK = 'n';
     76        public static final char OWNER = 'o';
     77        public static final char FILL_PATTERN = 'i';
     78        public static final char ANCHOR_BOTTOM = 'I';
     79        public static final char ANCHOR_TOP = 'N';
     80        public static final char ANCHOR_RIGHT = 'H';
     81        public static final char ANCHOR_LEFT = 'R';
     82        public static final char GRADIENT_ANGLE = 'Q';
     83        public static final char GRADIENT_COLOR = 'E';
     84        public static final char FILL_COLOR = 'e';
     85        public static final char HIGHLIGHT = 'u';
     86        public static final char DATA = 'D';
     87        public static final char ACTION_LEAVE_FRAME = 'Y';
     88        public static final char ACTION_ENTER_FRAME = 'W';
     89        public static final char ACTION_CURSOR_LEAVE = 'V';
     90        public static final char ACTION_CURSOR_ENTER = 'U';
     91        public static final char ACTION_MARK = 'x';
     92        public static final char ACTION = 'X';
     93        public static final char LINK = 'F';
     94        public static final char TEXT = 'T';
     95        public static final char POSITION = 'P';
     96        public static final char BORDER_COLOR = 'K';
     97        public static final char BACKGROUND_COLOR = 'G';
     98        public static final char COLOR = 'd';
     99        public static final char DATE_CREATED = 's';
     100        public static final char TYPE_AND_ID = 'S';
     101
    44102        protected String _filename = null;
    45103
     
    86144                       
    87145                        // Note: As of 26/11/18 there are no unused letter item tags.  Use other characters.
    88                         _ItemTags.put('S', Item.class.getMethod("getTypeAndID"));
    89                         _ItemTags.put('s', Item.class.getMethod("getDateCreated"));
    90                         _ItemTags.put('d', Item.class.getMethod("getColor"));
    91                         _ItemTags.put('G', Item.class.getMethod("getBackgroundColor"));
    92                         _ItemTags.put('K', Item.class.getMethod("getBorderColor"));
    93 
    94                         _ItemTags.put('P', Item.class.getMethod("getPosition"));
    95                         _ItemTags.put('T', Text.class.getMethod("getText"));
    96                         _ItemTags.put('F', Item.class.getMethod("getLink"));
    97                         _ItemTags.put('X', Item.class.getMethod("getAction"));
    98                         _ItemTags.put('x', Item.class.getMethod("getActionMark"));
    99                         _ItemTags.put('U', Item.class.getMethod("getActionCursorEnter"));
    100                         _ItemTags.put('V', Item.class.getMethod("getActionCursorLeave"));
    101                         _ItemTags.put('W', Item.class.getMethod("getActionEnterFrame"));
    102                         _ItemTags.put('Y', Item.class.getMethod("getActionLeaveFrame"));
    103                         _ItemTags.put('D', Item.class.getMethod("getData"));
    104                         _ItemTags.put('u', Item.class.getMethod("getHighlight"));
    105                         _ItemTags.put('e', Item.class.getMethod("getFillColor"));
    106                         _ItemTags.put('E', Item.class.getMethod("getGradientColor"));
    107                         _ItemTags.put('Q', Item.class.getMethod("getGradientAngle"));
    108                        
    109                         _ItemTags.put('R', Item.class.getMethod("getAnchorLeft"));
    110                         _ItemTags.put('H', Item.class.getMethod("getAnchorRight"));
    111                         _ItemTags.put('N', Item.class.getMethod("getAnchorTop"));
    112                         _ItemTags.put('I', Item.class.getMethod("getAnchorBottom"));
    113 
    114                         _ItemTags.put('i', Item.class.getMethod("getFillPattern"));
    115                         _ItemTags.put('o', Item.class.getMethod("getOwner"));
    116                         _ItemTags.put('n', Item.class.getMethod("getLinkMark"));
    117                         _ItemTags.put('q', Item.class.getMethod("getLinkFrameset"));
    118                         _ItemTags.put('y', Item.class.getMethod("getLinkTemplate"));
    119                         _ItemTags.put('g', Item.class.getMethod("getLinePattern"));
    120 
    121                         _ItemTags.put('j', Item.class.getMethod("getArrow"));
    122                        
    123                         _ItemTags.put('v', Item.class.getMethod("getDotType"));
    124                         _ItemTags.put('z', Item.class.getMethod("getFilled"));
    125 
    126                         _ItemTags.put('f', Text.class.getMethod("getFont"));
    127                         _ItemTags.put('t', Text.class.getMethod("getSpacing"));
    128                        
    129                         _ItemTags.put('O', Text.class.getMethod("getMask"));
     146                        _ItemTags.put(DefaultFrameWriter.TYPE_AND_ID, Item.class.getMethod("getTypeAndID"));
     147                        _ItemTags.put(DefaultFrameWriter.DATE_CREATED, Item.class.getMethod("getDateCreated"));
     148                        _ItemTags.put(DefaultFrameWriter.COLOR, Item.class.getMethod("getColor"));
     149                        _ItemTags.put(DefaultFrameWriter.BACKGROUND_COLOR, Item.class.getMethod("getBackgroundColor"));
     150                        _ItemTags.put(DefaultFrameWriter.BORDER_COLOR, Item.class.getMethod("getBorderColor"));
     151
     152                        _ItemTags.put(DefaultFrameWriter.POSITION, Item.class.getMethod("getPosition"));
     153                        _ItemTags.put(DefaultFrameWriter.TEXT, Text.class.getMethod("getText"));
     154                        _ItemTags.put(DefaultFrameWriter.LINK, Item.class.getMethod("getLink"));
     155                        _ItemTags.put(DefaultFrameWriter.ACTION, Item.class.getMethod("getAction"));
     156                        _ItemTags.put(DefaultFrameWriter.ACTION_MARK, Item.class.getMethod("getActionMark"));
     157                        _ItemTags.put(DefaultFrameWriter.ACTION_CURSOR_ENTER, Item.class.getMethod("getActionCursorEnter"));
     158                        _ItemTags.put(DefaultFrameWriter.ACTION_CURSOR_LEAVE, Item.class.getMethod("getActionCursorLeave"));
     159                        _ItemTags.put(DefaultFrameWriter.ACTION_ENTER_FRAME, Item.class.getMethod("getActionEnterFrame"));
     160                        _ItemTags.put(DefaultFrameWriter.ACTION_LEAVE_FRAME, Item.class.getMethod("getActionLeaveFrame"));
     161                        _ItemTags.put(DefaultFrameWriter.DATA, Item.class.getMethod("getData"));
     162                        _ItemTags.put(DefaultFrameWriter.HIGHLIGHT, Item.class.getMethod("getHighlight"));
     163                        _ItemTags.put(DefaultFrameWriter.FILL_COLOR, Item.class.getMethod("getFillColor"));
     164                        _ItemTags.put(DefaultFrameWriter.GRADIENT_COLOR, Item.class.getMethod("getGradientColor"));
     165                        _ItemTags.put(DefaultFrameWriter.GRADIENT_ANGLE, Item.class.getMethod("getGradientAngle"));
     166                       
     167                        _ItemTags.put(DefaultFrameWriter.ANCHOR_LEFT, Item.class.getMethod("getAnchorLeft"));
     168                        _ItemTags.put(DefaultFrameWriter.ANCHOR_RIGHT, Item.class.getMethod("getAnchorRight"));
     169                        _ItemTags.put(DefaultFrameWriter.ANCHOR_TOP, Item.class.getMethod("getAnchorTop"));
     170                        _ItemTags.put(DefaultFrameWriter.ANCHOR_BOTTOM, Item.class.getMethod("getAnchorBottom"));
     171
     172                        _ItemTags.put(DefaultFrameWriter.FILL_PATTERN, Item.class.getMethod("getFillPattern"));
     173                        _ItemTags.put(DefaultFrameWriter.OWNER, Item.class.getMethod("getOwner"));
     174                        _ItemTags.put(DefaultFrameWriter.LINK_MARK, Item.class.getMethod("getLinkMark"));
     175                        _ItemTags.put(DefaultFrameWriter.LINK_FRAMESET, Item.class.getMethod("getLinkFrameset"));
     176                        _ItemTags.put(DefaultFrameWriter.LINK_TEMPLATE, Item.class.getMethod("getLinkTemplate"));
     177                        _ItemTags.put(DefaultFrameWriter.LINE_PATTERN, Item.class.getMethod("getLinePattern"));
     178
     179                        _ItemTags.put(DefaultFrameWriter.ARROW, Item.class.getMethod("getArrow"));
     180                       
     181                        _ItemTags.put(DefaultFrameWriter.DOT_TYPE, Item.class.getMethod("getDotType"));
     182                        _ItemTags.put(DefaultFrameWriter.FILLED, Item.class.getMethod("getFilled"));
     183
     184                        _ItemTags.put(DefaultFrameWriter.FONT, Text.class.getMethod("getFont"));
     185                        _ItemTags.put(DefaultFrameWriter.SPACING, Text.class.getMethod("getSpacing"));
     186                       
     187                        _ItemTags.put(DefaultFrameWriter.MASK, Text.class.getMethod("getMask"));
    130188
    131189                        // TODO set a boolean flag to indicate that the text is a formula
    132190                        // Store the formula in the text property NOT the answer
    133                         _ItemTags.put('J', Item.class.getMethod("getFormula"));
    134 
    135                         _ItemTags.put('a', Text.class.getMethod("getWordSpacing"));
    136                         _ItemTags.put('b', Text.class.getMethod("getLetterSpacing"));
    137                         _ItemTags.put('m', Text.class.getMethod("getInitialSpacing"));
    138                         _ItemTags.put('w', Text.class.getMethod("getWidthToSave"));
    139                         _ItemTags.put('M', Text.class.getMethod("getMinWidthToSave"));
    140                         _ItemTags.put('k', Text.class.getMethod("getJustification"));
    141                         _ItemTags.put('r', Text.class.getMethod("getAutoWrapToSave"));
    142 
    143                         _ItemTags.put('h', Item.class.getMethod("getThickness"));
    144                         _ItemTags.put('l', Item.class.getMethod("getLineIDs"));
    145                         _ItemTags.put('c', Item.class.getMethod("getConstraintIDs"));
    146                        
    147                         _ItemTags.put('A', Item.class.getMethod("getTooltip"));
    148                         _ItemTags.put('B', Item.class.getMethod("getLinkHistory"));
    149                        
    150                         _ItemTags.put('p', Item.class.getMethod("getPermission"));
    151 
    152                         _ItemTags.put('[', Item.class.getMethod("getMagnetizedItemLeft"));
    153                         _ItemTags.put(']', Item.class.getMethod("getMagnetizedItemRight"));
    154                         _ItemTags.put('^', Item.class.getMethod("getMagnetizedItemTop"));
    155                         _ItemTags.put('/', Item.class.getMethod("getMagnetizedItemBottom"));
    156                        
    157                         _ItemTagsExt.put("_el", Item.class.getMethod("getEncryptionLabel"));
    158                        
    159                         _ItemTagsExt.put("_ph", Text.class.getMethod("getPlaceholder"));
    160                         _ItemTagsExt.put("_sl", Text.class.getMethod("isSingleLineOnly"));
    161                         _ItemTagsExt.put("_ti", Text.class.getMethod("getTabIndex"));
     191                        _ItemTags.put(DefaultFrameWriter.FORMULA, Item.class.getMethod("getFormula"));
     192
     193                        _ItemTags.put(DefaultFrameWriter.WORD_SPACING, Text.class.getMethod("getWordSpacing"));
     194                        _ItemTags.put(DefaultFrameWriter.LETTER_SPACING, Text.class.getMethod("getLetterSpacing"));
     195                        _ItemTags.put(DefaultFrameWriter.INITIAL_SPACING, Text.class.getMethod("getInitialSpacing"));
     196                        _ItemTags.put(DefaultFrameWriter.WIDTH_TO_SAVE, Text.class.getMethod("getWidthToSave"));
     197                        _ItemTags.put(DefaultFrameWriter.MIN_WIDTH_TO_SAVE, Text.class.getMethod("getMinWidthToSave"));
     198                        _ItemTags.put(DefaultFrameWriter.JUSTIFICATION, Text.class.getMethod("getJustification"));
     199                        _ItemTags.put(DefaultFrameWriter.AUTO_WRAP_TO_SAVE, Text.class.getMethod("getAutoWrapToSave"));
     200
     201                        _ItemTags.put(DefaultFrameWriter.THICKNESS, Item.class.getMethod("getThickness"));
     202                        _ItemTags.put(DefaultFrameWriter.LINE_IDS, Item.class.getMethod("getLineIDs"));
     203                        _ItemTags.put(DefaultFrameWriter.CONSTRAINT_IDS, Item.class.getMethod("getConstraintIDs"));
     204                       
     205                        _ItemTags.put(DefaultFrameWriter.TOOLTIP, Item.class.getMethod("getTooltip"));
     206                        _ItemTags.put(DefaultFrameWriter.LINK_HISTORY, Item.class.getMethod("getLinkHistory"));
     207                       
     208                        _ItemTags.put(DefaultFrameWriter.PERMISSION, Item.class.getMethod("getPermission"));
     209
     210                        _ItemTags.put(DefaultFrameWriter.MAGNETIZED_ITEM_LEFT, Item.class.getMethod("getMagnetizedItemLeft"));
     211                        _ItemTags.put(DefaultFrameWriter.MAGNETIZED_ITEM_RIGHT, Item.class.getMethod("getMagnetizedItemRight"));
     212                        _ItemTags.put(DefaultFrameWriter.MAGNETIZED_ITEM_TOP, Item.class.getMethod("getMagnetizedItemTop"));
     213                        _ItemTags.put(DefaultFrameWriter.MAGNETIZED_ITEM_BOTTOM, Item.class.getMethod("getMagnetizedItemBottom"));
     214                       
     215                        _ItemTagsExt.put(DefaultFrameWriter.ENCRYPTION_LABEL, Item.class.getMethod("getEncryptionLabel"));
     216                       
     217                        _ItemTagsExt.put(DefaultFrameWriter.PLACEHOLDER, Text.class.getMethod("getPlaceholder"));
     218                        _ItemTagsExt.put(DefaultFrameWriter.SINGLE_LINE_ONLY, Text.class.getMethod("isSingleLineOnly"));
     219                        _ItemTagsExt.put(DefaultFrameWriter.TAB_INDEX, Text.class.getMethod("getTabIndex"));
    162220                } catch (Exception e) {
    163221                        e.printStackTrace();
  • trunk/src/org/expeditee/items/Item.java

    r1408 r1410  
    418418
    419419        public DotType getDotType() {
    420                 return _type;
     420                Surrogate surrogate = Surrogate.of(this);
     421                if (surrogate != null &&
     422                                surrogate.isPropertyIsInherited(DefaultFrameWriter.DOT_TYPE + "")) {
     423                        return this.getClassic().getDotType();
     424                } else {
     425                        return _type;
     426                }
    421427        }
    422428
     
    430436
    431437        public boolean getFilled() {
    432                 return _filled;
     438                Surrogate surrogate = Surrogate.of(this);
     439                if (surrogate != null &&
     440                                surrogate.isPropertyIsInherited(DefaultFrameWriter.FILLED + "")) {
     441                        return this.getClassic().getFilled();
     442                } else {
     443                        return _filled;
     444                }
    433445        }
    434446
     
    457469         */
    458470        public double getGradientAngle() {
    459                 return _gradientAngle;
     471                Surrogate surrogate = Surrogate.of(this);
     472                if (surrogate != null &&
     473                                surrogate.isPropertyIsInherited(DefaultFrameWriter.GRADIENT_ANGLE + "")) {
     474                        return this.getClassic().getGradientAngle();
     475                } else {
     476                        return _gradientAngle;
     477                }
    460478        }
    461479
     
    513531       
    514532        public PermissionTriple getPermission() {
    515                 return _permissionTriple;
     533                Surrogate surrogate = Surrogate.of(this);
     534                if (surrogate != null &&
     535                                surrogate.isPropertyIsInherited(DefaultFrameWriter.PERMISSION + "")) {
     536                        return this.getClassic().getPermission();
     537                } else {
     538                        return _permissionTriple;
     539                }
    516540        }
    517541
     
    659683         */
    660684        public List<String> getAction() {
    661                 return _actions;
     685                Surrogate surrogate = Surrogate.of(this);
     686                if (surrogate != null &&
     687                                surrogate.isPropertyIsInherited(DefaultFrameWriter.ACTION + "")) {
     688                        return this.getClassic().getAction();
     689                } else {
     690                        return _actions;
     691                }
    662692        }
    663693
    664694        public List<String> getData() {
    665                 return _data.getData();
     695                Surrogate surrogate = Surrogate.of(this);
     696                if (surrogate != null &&
     697                                surrogate.isPropertyIsInherited(DefaultFrameWriter.DATA + "")) {
     698                        return this.getClassic().getData();
     699                } else {
     700                        return _data.getData();
     701                }
    666702        }
    667703
    668704        public List<String> getActionCursorEnter() {
    669                 return _actionCursorEnter;
     705                Surrogate surrogate = Surrogate.of(this);
     706                if (surrogate != null &&
     707                                surrogate.isPropertyIsInherited(DefaultFrameWriter.ACTION_CURSOR_ENTER + "")) {
     708                        return this.getClassic().getActionCursorEnter();
     709                } else {
     710                        return _actionCursorEnter;
     711                }
    670712        }
    671713
    672714        public List<String> getActionCursorLeave() {
    673                 return _actionCursorLeave;
     715                Surrogate surrogate = Surrogate.of(this);
     716                if (surrogate != null &&
     717                                surrogate.isPropertyIsInherited(DefaultFrameWriter.ACTION_CURSOR_LEAVE + "")) {
     718                        return this.getClassic().getActionCursorLeave();
     719                } else {
     720                        return _actionCursorLeave;
     721                }
    674722        }
    675723
    676724        public List<String> getActionEnterFrame() {
    677                 return _actionEnterFrame;
     725                Surrogate surrogate = Surrogate.of(this);
     726                if (surrogate != null &&
     727                                surrogate.isPropertyIsInherited(DefaultFrameWriter.ACTION_ENTER_FRAME + "")) {
     728                        return this.getClassic().getActionEnterFrame();
     729                } else {
     730                        return _actionEnterFrame;
     731                }
    678732        }
    679733
    680734        public List<String> getActionLeaveFrame() {
    681                 return _actionLeaveFrame;
     735                Surrogate surrogate = Surrogate.of(this);
     736                if (surrogate != null &&
     737                                surrogate.isPropertyIsInherited(DefaultFrameWriter.ACTION_LEAVE_FRAME + "")) {
     738                        return this.getClassic().getActionLeaveFrame();
     739                } else {
     740                        return _actionLeaveFrame;
     741                }
    682742        }
    683743
    684744        public boolean getActionMark() {
    685                 return _actionMark;
     745                Surrogate surrogate = Surrogate.of(this);
     746                if (surrogate != null &&
     747                                surrogate.isPropertyIsInherited(DefaultFrameWriter.ACTION_MARK + "")) {
     748                        return this.getClassic().getActionMark();
     749                } else {
     750                        return _actionMark;
     751                }
    686752        }
    687753
     
    703769        }*/
    704770
    705         public String getArrow()
    706         {
    707                 if (!hasVisibleArrow())
    708                         return null;
    709 
    710                 String ratio = "" + getArrowheadRatio();
    711                 if (ratio.length() - ratio.indexOf(".") > 2)
    712                         ratio = ratio.substring(0, ratio.indexOf(".") + 3);
    713 
    714                 return getArrowheadLength() + " " + ratio + " " + getArrowheadNibPerc();
     771        public String getArrow() {
     772                Surrogate surrogate = Surrogate.of(this);
     773                if (surrogate != null &&
     774                                surrogate.isPropertyIsInherited(DefaultFrameWriter.ARROW + "")) {
     775                        return this.getClassic().getArrow();
     776                } else {
     777                        if (!hasVisibleArrow())
     778                                return null;
     779
     780                        String ratio = "" + getArrowheadRatio();
     781                        if (ratio.length() - ratio.indexOf(".") > 2)
     782                                ratio = ratio.substring(0, ratio.indexOf(".") + 3);
     783
     784                        return getArrowheadLength() + " " + ratio + " " + getArrowheadNibPerc();
     785                }
    715786        }
    716787
     
    735806        }
    736807       
    737         public Colour getBackgroundColor()
    738         {
    739                 return _backgroundColour;
    740         }
    741 
    742         public Colour getBorderColor()
    743         {
    744                 return _colorBorder;
     808        public Colour getBackgroundColor() {
     809                Surrogate surrogate = Surrogate.of(this);
     810                if (surrogate != null &&
     811                                surrogate.isPropertyIsInherited(DefaultFrameWriter.BACKGROUND_COLOR + "")) {
     812                        return this.getClassic().getBackgroundColor();
     813                } else {
     814                        return _backgroundColour;
     815                }
     816        }
     817
     818        public Colour getBorderColor() {
     819                Surrogate surrogate = Surrogate.of(this);
     820                if (surrogate != null &&
     821                                surrogate.isPropertyIsInherited(DefaultFrameWriter.TYPE_AND_ID + "")) {
     822                        return this.getClassic().getBorderColor();
     823                } else {
     824                        return _colorBorder;
     825                }
    745826        }
    746827
     
    814895        }
    815896
    816         public Colour getColor()
    817         {
    818                 return _foregroundColour;
     897        public Colour getColor() {
     898                Surrogate surrogate = Surrogate.of(this);
     899                if (surrogate != null &&
     900                                surrogate.isPropertyIsInherited(DefaultFrameWriter.COLOR + "")) {
     901                        return this.getClassic().getColor();
     902                } else {
     903                        return _foregroundColour;
     904                }
    819905        }
    820906
     
    828914        }
    829915
    830         public String getConstraintIDs()
    831         {
    832                 if (_constraints == null || _constraints.size() == 0)
    833                         return null;
    834 
    835                 String cons = "";
    836 
    837                 for (Constraint c : _constraints)
    838                         cons += c.getID() + " ";
    839 
    840                 return cons.trim();
     916        public String getConstraintIDs() {
     917                Surrogate surrogate = Surrogate.of(this);
     918                if (surrogate != null &&
     919                                surrogate.isPropertyIsInherited(DefaultFrameWriter.CONSTRAINT_IDS + "")) {
     920                        return this.getClassic().getConstraintIDs();
     921                } else {
     922                        if (_constraints == null || _constraints.size() == 0)
     923                                return null;
     924
     925                        String cons = "";
     926
     927                        for (Constraint c : _constraints)
     928                                cons += c.getID() + " ";
     929
     930                        return cons.trim();
     931                }
    841932        }
    842933
     
    862953        }
    863954
    864         public String getDateCreated()
    865         {
    866                 return _creationDate;
    867         }
    868 
    869         public Colour getFillColor()
    870         {
    871                 return _fillColour;
    872         }
    873 
    874         public String getFillPattern()
    875         {
    876                 return _fillPattern;
     955        public String getDateCreated() {
     956                Surrogate surrogate = Surrogate.of(this);
     957                if (surrogate != null &&
     958                                surrogate.isPropertyIsInherited(DefaultFrameWriter.DATE_CREATED + "")) {
     959                        return this.getClassic().getDateCreated();
     960                } else {
     961                        return _creationDate;
     962                }
     963        }
     964
     965        public Colour getFillColor() {
     966                Surrogate surrogate = Surrogate.of(this);
     967                if (surrogate != null &&
     968                                surrogate.isPropertyIsInherited(DefaultFrameWriter.FILL_COLOR + "")) {
     969                        return this.getClassic().getFillColor();
     970                } else {
     971                        return _fillColour;
     972                }
     973        }
     974
     975        public String getFillPattern() {
     976                Surrogate surrogate = Surrogate.of(this);
     977                if (surrogate != null &&
     978                                surrogate.isPropertyIsInherited(DefaultFrameWriter.FILL_PATTERN + "")) {
     979                        return this.getClassic().getFillPattern();
     980                } else {
     981                        return _fillPattern;
     982                }
    877983        }
    878984
     
    890996         * @return The value of <code>_highlight</code>.
    891997         */
    892         public boolean getHighlight()
    893         {
    894                 return _highlight;
     998        public boolean getHighlight() {
     999                Surrogate surrogate = Surrogate.of(this);
     1000                if (surrogate != null &&
     1001                                surrogate.isPropertyIsInherited(DefaultFrameWriter.HIGHLIGHT + "")) {
     1002                        return this.getClassic().getHighlight();
     1003                } else {
     1004                        return _highlight;
     1005                }
    8951006        }
    8961007
     
    9191030         * @return The list of Line IDs that this point is part of.
    9201031         */
    921         public String getLineIDs()
    922         {
    923                 String lineID = null;
    924 
    925                 if (_lines.size() > 0) {
    926                         lineID = "" + _lines.get(0).getID();
    927 
    928                         for (int i = 1; i < _lines.size(); i++)
    929                                 lineID += " " + _lines.get(i).getID();
    930                 }
    931 
    932                 return lineID;
    933         }
    934 
    935         public int[] getLinePattern()
    936         {
    937                 return _linePattern;
     1032        public String getLineIDs() {
     1033                Surrogate surrogate = Surrogate.of(this);
     1034                if (surrogate != null &&
     1035                                surrogate.isPropertyIsInherited(DefaultFrameWriter.LINE_IDS + "")) {
     1036                        return this.getClassic().getLineIDs();
     1037                } else {
     1038                        String lineID = null;
     1039
     1040                        if (_lines.size() > 0) {
     1041                                lineID = "" + _lines.get(0).getID();
     1042
     1043                                for (int i = 1; i < _lines.size(); i++)
     1044                                        lineID += " " + _lines.get(i).getID();
     1045                        }
     1046
     1047                        return lineID;
     1048                }
     1049        }
     1050
     1051        public int[] getLinePattern() {
     1052                Surrogate surrogate = Surrogate.of(this);
     1053                if (surrogate != null &&
     1054                                surrogate.isPropertyIsInherited(DefaultFrameWriter.LINE_PATTERN + "")) {
     1055                        return this.getClassic().getLinePattern();
     1056                } else {
     1057                        return _linePattern;
     1058                }
    9381059        }
    9391060
     
    9561077         *         this Item does not link to anything.
    9571078         */
    958         public String getLink()
    959         {
    960                 return _link;
    961         }
    962 
    963         public String getFormula()
    964         {
    965                 return _formula;
     1079        public String getLink() {
     1080                Surrogate surrogate = Surrogate.of(this);
     1081                if (surrogate != null &&
     1082                                surrogate.isPropertyIsInherited(DefaultFrameWriter.LINK + "")) {
     1083                        return this.getClassic().getLink();
     1084                } else {
     1085                        return _link;
     1086                }
     1087        }
     1088
     1089        public String getFormula() {
     1090                Surrogate surrogate = Surrogate.of(this);
     1091                if (surrogate != null &&
     1092                                surrogate.isPropertyIsInherited(DefaultFrameWriter.FORMULA + "")) {
     1093                        return this.getClassic().getFormula();
     1094                } else {
     1095                        return _formula;
     1096                }
    9661097        }
    9671098
     
    9871118        }
    9881119
    989         public String getLinkFrameset()
    990         {
    991                 return _link_frameset;
    992         }
    993 
    994         public boolean getLinkMark()
    995         {
    996                 return _linkMark;
    997         }
    998 
    999         public String getLinkTemplate()
    1000         {
    1001                 return _link_template;
     1120        public String getLinkFrameset() {
     1121                Surrogate surrogate = Surrogate.of(this);
     1122                if (surrogate != null &&
     1123                                surrogate.isPropertyIsInherited(DefaultFrameWriter.LINK_FRAMESET + "")) {
     1124                        return this.getClassic().getLinkFrameset();
     1125                } else {
     1126                        return _link_frameset;
     1127                }
     1128        }
     1129
     1130        public boolean getLinkMark() {
     1131                Surrogate surrogate = Surrogate.of(this);
     1132                if (surrogate != null &&
     1133                                surrogate.isPropertyIsInherited(DefaultFrameWriter.LINK_MARK + "")) {
     1134                        return this.getClassic().getLinkMark();
     1135                } else {
     1136                        return _linkMark;
     1137                }
     1138        }
     1139
     1140        public String getLinkTemplate() {
     1141                Surrogate surrogate = Surrogate.of(this);
     1142                if (surrogate != null &&
     1143                                surrogate.isPropertyIsInherited(DefaultFrameWriter.LINK_TEMPLATE + "")) {
     1144                        return this.getClassic().getLinkTemplate();
     1145                } else {
     1146                        return _link_template;
     1147                }
    10021148        }
    10031149
     
    10121158        }
    10131159
    1014         public String getOwner()
    1015         {
    1016                 return _owner;
     1160        public String getOwner() {
     1161                Surrogate surrogate = Surrogate.of(this);
     1162                if (surrogate != null &&
     1163                                surrogate.isPropertyIsInherited(DefaultFrameWriter.OWNER + "")) {
     1164                        return this.getClassic().getOwner();
     1165                } else {
     1166                        return _owner;
     1167                }
    10171168        }
    10181169
     
    11291280
    11301281        /** Gets the position of this item. */
    1131         public final Point getPosition()
    1132         {
    1133                 return new Point(getX(), getY());
     1282        public final Point getPosition() {
     1283                Surrogate surrogate = Surrogate.of(this);
     1284                if (surrogate != null &&
     1285                                surrogate.isPropertyIsInherited(DefaultFrameWriter.POSITION + "")) {
     1286                        return this.getClassic().getPosition();
     1287                } else {
     1288                        return new Point(getX(), getY());
     1289                }
    11341290        }
    11351291
     
    11561312        }
    11571313
    1158         public String getTypeAndID()
    1159         {
    1160                 return "T " + getID();
    1161         }
    1162 
    1163         public Integer getWidthToSave()
    1164         {
    1165                 return getWidth();
     1314        public String getTypeAndID() {
     1315                Surrogate surrogate = Surrogate.of(this);
     1316                if (surrogate != null &&
     1317                                surrogate.isPropertyIsInherited(DefaultFrameWriter.TYPE_AND_ID + "")) {
     1318                        return this.getClassic().getTypeAndID();
     1319                } else {
     1320                        return "T " + getID();
     1321                }
     1322        }
     1323
     1324        public Integer getWidthToSave() {
     1325                Surrogate surrogate = Surrogate.of(this);
     1326                if (surrogate != null &&
     1327                                surrogate.isPropertyIsInherited(DefaultFrameWriter.WIDTH_TO_SAVE + "")) {
     1328                        return this.getClassic().getWidthToSave();
     1329                } else {
     1330                        return getWidth();
     1331                }
    11661332        }
    11671333       
    11681334        public Integer getMinWidthToSave() {
    1169                 return getMinWidth();
     1335                Surrogate surrogate = Surrogate.of(this);
     1336                if (surrogate != null &&
     1337                                surrogate.isPropertyIsInherited(DefaultFrameWriter.MIN_WIDTH_TO_SAVE + "")) {
     1338                        return this.getClassic().getMinWidthToSave();
     1339                } else {
     1340                        return getMinWidth();
     1341                }
    11701342        }
    11711343
     
    11891361         * @return The X coordinate of this Item on the screen
    11901362         */
    1191         public int getX()
    1192         {
    1193                 return Math.round(_x);
     1363        public int getX() {
     1364                Surrogate surrogate = Surrogate.of(this);
     1365                if (surrogate != null &&
     1366                                surrogate.isPropertyIsInherited(DefaultFrameWriter.POSITION + "")) {
     1367                        return this.getClassic().getX();
     1368                } else {
     1369                        return Math.round(_x);
     1370                }
    11941371        }
    11951372
     
    11991376         * @return The Y coordinate of this Item on the screen
    12001377         */
    1201         public int getY()
    1202         {
    1203                 return Math.round(_y);
     1378        public int getY() {
     1379                Surrogate surrogate = Surrogate.of(this);
     1380                if (surrogate != null &&
     1381                                surrogate.isPropertyIsInherited(DefaultFrameWriter.POSITION + "")) {
     1382                        return this.getClassic().getY();
     1383                } else {
     1384                        return Math.round(_y);
     1385                }
    12041386        }
    12051387
     
    13571539        }
    13581540       
    1359         public List<String> getTooltip()
    1360         {
    1361                 return _tooltip.asStringList();
     1541        public List<String> getTooltip() {
     1542                Surrogate surrogate = Surrogate.of(this);
     1543                if (surrogate != null &&
     1544                                surrogate.isPropertyIsInherited(DefaultFrameWriter.TOOLTIP + "")) {
     1545                        return this.getClassic().getTooltip();
     1546                } else {
     1547                        return _tooltip.asStringList();
     1548                }
    13621549        }
    13631550       
     
    18362023
    18372024        public Colour getGradientColor() {
    1838                 return _gradientColour;
     2025                Surrogate surrogate = Surrogate.of(this);
     2026                if (surrogate != null &&
     2027                                surrogate.isPropertyIsInherited(DefaultFrameWriter.GRADIENT_COLOR + "")) {
     2028                        return this.getClassic().getGradientColor();
     2029                } else {
     2030                        return _gradientColour;
     2031                }
    18392032        }
    18402033
     
    19242117       
    19252118        public boolean getLinkHistory() {
    1926                 return _linkHistory;
     2119                Surrogate surrogate = Surrogate.of(this);
     2120                if (surrogate != null &&
     2121                                surrogate.isPropertyIsInherited(DefaultFrameWriter.LINK_HISTORY + "")) {
     2122                        return this.getClassic().getLinkHistory();
     2123                } else {
     2124                        return _linkHistory;
     2125                }
    19272126        }
    19282127
     
    22512450         *         set).
    22522451         */
    2253         public float getThickness()
    2254         {
    2255                 return _thickness;
     2452        public float getThickness()     {
     2453                Surrogate surrogate = Surrogate.of(this);
     2454                if (surrogate != null &&
     2455                                surrogate.isPropertyIsInherited(DefaultFrameWriter.THICKNESS + "")) {
     2456                        return this.getClassic().getThickness();
     2457                } else {
     2458                        return _thickness;
     2459                }
    22562460        }
    22572461
     
    31603364
    31613365        public Integer getAnchorLeft() {
    3162                 return _anchoring.getLeftAnchor();
     3366                Surrogate surrogate = Surrogate.of(this);
     3367                if (surrogate != null &&
     3368                                surrogate.isPropertyIsInherited(DefaultFrameWriter.ANCHOR_LEFT + "")) {
     3369                        return this.getClassic().getAnchorLeft();
     3370                } else {
     3371                        return _anchoring.getLeftAnchor();
     3372                }
    31633373        }
    31643374
    31653375        public Integer getAnchorRight() {
    3166                 return _anchoring.getRightAnchor();
     3376                Surrogate surrogate = Surrogate.of(this);
     3377                if (surrogate != null &&
     3378                                surrogate.isPropertyIsInherited(DefaultFrameWriter.ANCHOR_RIGHT + "")) {
     3379                        return this.getClassic().getAnchorRight();
     3380                } else {
     3381                        return _anchoring.getRightAnchor();
     3382                }
    31673383        }
    31683384
    31693385        public Integer getAnchorTop() {
    3170                 return _anchoring.getTopAnchor();
     3386                Surrogate surrogate = Surrogate.of(this);
     3387                if (surrogate != null &&
     3388                                surrogate.isPropertyIsInherited(DefaultFrameWriter.ANCHOR_TOP + "")) {
     3389                        return this.getClassic().getAnchorTop();
     3390                } else {
     3391                        return _anchoring.getTopAnchor();
     3392                }
    31713393        }
    31723394
    31733395        public Integer getAnchorBottom() {
    3174                 return _anchoring.getBottomAnchor();
     3396                Surrogate surrogate = Surrogate.of(this);
     3397                if (surrogate != null &&
     3398                                surrogate.isPropertyIsInherited(DefaultFrameWriter.ANCHOR_BOTTOM + "")) {
     3399                        return this.getClassic().getAnchorBottom();
     3400                } else {
     3401                        return _anchoring.getBottomAnchor();
     3402                }
    31753403        }
    31763404
    31773405        public String getText() {
    3178                 return "@" + getClass().getSimpleName() + ":" + getID();
     3406                Surrogate surrogate = Surrogate.of(this);
     3407                if (surrogate != null &&
     3408                                surrogate.isPropertyIsInherited(DefaultFrameWriter.TEXT + "")) {
     3409                        return this.getClassic().getText();
     3410                } else {
     3411                        return "@" + getClass().getSimpleName() + ":" + getID();
     3412                }
    31793413        }
    31803414
     
    34123646       
    34133647        public int getMagnetizedItemLeft() {
    3414                 if(_magnetizedItemLeft != null) return _magnetizedItemLeft.getID();
    3415                 else return -1;
     3648                Surrogate surrogate = Surrogate.of(this);
     3649                if (surrogate != null &&
     3650                                surrogate.isPropertyIsInherited(DefaultFrameWriter.MAGNETIZED_ITEM_LEFT + "")) {
     3651                        return this.getClassic().getMagnetizedItemLeft();
     3652                } else {
     3653                        if(_magnetizedItemLeft != null) return _magnetizedItemLeft.getID();
     3654                        else return -1;
     3655                }
    34163656        }
    34173657       
     
    34253665       
    34263666        public int getMagnetizedItemRight() {
    3427                 if(_magnetizedItemRight != null) return _magnetizedItemRight.getID();
    3428                 else return -1;
     3667                Surrogate surrogate = Surrogate.of(this);
     3668                if (surrogate != null &&
     3669                                surrogate.isPropertyIsInherited(DefaultFrameWriter.MAGNETIZED_ITEM_RIGHT + "")) {
     3670                        return this.getClassic().getMagnetizedItemRight();
     3671                } else {
     3672                        if(_magnetizedItemRight != null) return _magnetizedItemRight.getID();
     3673                        else return -1;
     3674                }
    34293675        }
    34303676       
     
    34383684       
    34393685        public int getMagnetizedItemTop() {
    3440                 if(_magnetizedItemTop != null) return _magnetizedItemTop.getID();
    3441                 else return -1;
     3686                Surrogate surrogate = Surrogate.of(this);
     3687                if (surrogate != null &&
     3688                                surrogate.isPropertyIsInherited(DefaultFrameWriter.MAGNETIZED_ITEM_TOP + "")) {
     3689                        return this.getClassic().getMagnetizedItemTop();
     3690                } else {
     3691                        if(_magnetizedItemTop != null) return _magnetizedItemTop.getID();
     3692                        else return -1;
     3693                }
    34423694        }
    34433695       
     
    34513703       
    34523704        public int getMagnetizedItemBottom() {
    3453                 if(_magnetizedItemBottom != null) return _magnetizedItemBottom.getID();
    3454                 else return -1;
     3705                Surrogate surrogate = Surrogate.of(this);
     3706                if (surrogate != null &&
     3707                                surrogate.isPropertyIsInherited(DefaultFrameWriter.MAGNETIZED_ITEM_BOTTOM + "")) {
     3708                        return this.getClassic().getMagnetizedItemBottom();
     3709                } else {
     3710                        if(_magnetizedItemBottom != null) return _magnetizedItemBottom.getID();
     3711                        else return -1;
     3712                }
    34553713        }
    34563714       
     
    34643722       
    34653723        public String getEncryptionLabel() {
    3466                 return _encryptionLabel;
     3724                Surrogate surrogate = Surrogate.of(this);
     3725                if (surrogate != null &&
     3726                                surrogate.isPropertyIsInherited(DefaultFrameWriter.ENCRYPTION_LABEL + "")) {
     3727                        return this.getClassic().getEncryptionLabel();
     3728                } else {
     3729                        return _encryptionLabel;
     3730                }
    34673731        }
    34683732       
  • 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.