Changeset 1377


Ignore:
Timestamp:
05/27/19 10:17:12 (5 years ago)
Author:
bln4
Message:

Rollback implementation of _maxWidth. After talks with David, this functionality is to be implemented slightly differently.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/gui/AttributeUtils.java

    r1374 r1377  
    294294                        _Attrib.put("MinWidth",                         Item.class.getMethod("getMinWidthToSave"),
    295295                                                                                                Item.class.getMethod("setMinWidth", pIntO));
    296                         _Attrib.put("MaxWidth",                         Item.class.getMethod("getMaxWidthToSave"),
    297                                                                                                 Item.class.getMethod("setMaxWidth", pIntO));
    298296                        _Attrib.put("X",                    null,
    299297                                                            Item.class.getMethod("setX", pFloat));
  • trunk/src/org/expeditee/io/DefaultFrameReader.java

    r1374 r1377  
    181181                       
    182182                        _ItemTagsExt.put("_ph", Text.class.getMethod("setPlaceholder", pString));
    183                         _ItemTagsExt.put("_maxW", Text.class.getMethod("setMaxWidth", pIntO));
    184183                } catch (Exception e) {
    185184                        e.printStackTrace();
  • trunk/src/org/expeditee/io/DefaultFrameWriter.java

    r1374 r1377  
    155155                       
    156156                        _ItemTagsExt.put("_ph", Text.class.getMethod("getPlaceholder"));
    157                         _ItemTagsExt.put("_maxW", Text.class.getMethod("getMaxWidthToSave"));
    158157                } catch (Exception e) {
    159158                        e.printStackTrace();
  • trunk/src/org/expeditee/items/Item.java

    r1369 r1377  
    11701170                return getMinWidth();
    11711171        }
    1172        
    1173         public Integer getMaxWidthToSave() {
    1174                 return getMaxWidth();
    1175         }
    11761172
    11771173        public Integer getWidth()
     
    11811177       
    11821178        public Integer getMinWidth() {
    1183                 return null;
    1184         }
    1185        
    1186         public Integer getMaxWidth() {
    11871179                return null;
    11881180        }
  • trunk/src/org/expeditee/items/Text.java

    r1369 r1377  
    140140        private Integer _minWidth = -Integer.MAX_VALUE;
    141141       
    142         private Integer _maxWidth = -Integer.MAX_VALUE;
    143 
    144142        private Justification _justification = Justification.left;
    145143
     
    188186        // The font to display this text in
    189187        private Font _font;
    190         private Font _substituteFont;
    191         private boolean _useSubstituteFont = false;
    192188
    193189        // The optional mask character to us in place of the text's content.
     
    418414                invalidateAll();
    419415        }
    420        
    421         public void setMaxWidth(Integer width) {
    422                 invalidateAll();
    423 
    424                 if (width == null) {
    425                         setJustification(Justification.left);
    426                         setRightMargin(DisplayController.getFramePaintAreaWidth(), false);
    427                         return;
    428                 }
    429                
    430                 _maxWidth = width;
    431                 rebuild(true);
    432                 invalidateAll();
    433         }
    434        
    435416
    436417        /**
     
    468449                return _minWidth;
    469450        }
    470        
    471         public Integer getMaxWidth() {
    472                 if (_maxWidth == null || _maxWidth <= 0) {
    473                         return null;
    474                 }
    475                 return _maxWidth;
    476         }
    477451
    478452        public Integer getAbsoluteMinWidth() {
     
    481455                }
    482456                return Math.abs(_minWidth);
    483         }
    484        
    485         public Integer getAbsoluteMaxWidth() {
    486                 if (_maxWidth == null) {
    487                         return Integer.MIN_VALUE;
    488                 }
    489                 return Math.abs(_maxWidth);
    490457        }
    491458       
     
    13371304                        _font = EcosystemManager.getFontManager().getDefaultFont().clone();
    13381305                        f = _font;
    1339                        
    1340                         if (_useSubstituteFont) {
    1341                                 f = _substituteFont;
    1342                         }
    13431306                }
    13441307                return f;
     
    17301693
    17311694                        int minWidth = getAbsoluteMinWidth();
    1732                         int maxWidth = getAbsoluteMaxWidth();
    17331695
    17341696                        minX = Math.min(minX, bounds.getMinX());
    17351697                        maxX = minWidth < Integer.MAX_VALUE ? Math.max(minX + minWidth, bounds.getMaxX())
    17361698                                        : Math.max(maxX, bounds.getMaxX());
    1737                         if ((maxWidth - minX) < maxX) {
    1738                                 this._useSubstituteFont = true;
    1739                                 this._substituteFont.setSize(this._substituteFont.getSize() - 1);
    1740                         } else {
    1741                                 this._useSubstituteFont = false;
    1742                                 this._substituteFont = this._font;
    1743                         }
    17441699                        minY = Math.min(minY, (int) (bounds.getMinY() + y));
    17451700                        maxY = Math.max(maxY, (int) (bounds.getMaxY() + y));
Note: See TracChangeset for help on using the changeset viewer.