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

Fixed bug with surrogate inheritance.

Location:
trunk/src/org/expeditee/items
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • 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.