Changeset 1377
- Timestamp:
- 05/27/19 10:17:12 (5 years ago)
- Location:
- trunk/src/org/expeditee
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/gui/AttributeUtils.java
r1374 r1377 294 294 _Attrib.put("MinWidth", Item.class.getMethod("getMinWidthToSave"), 295 295 Item.class.getMethod("setMinWidth", pIntO)); 296 _Attrib.put("MaxWidth", Item.class.getMethod("getMaxWidthToSave"),297 Item.class.getMethod("setMaxWidth", pIntO));298 296 _Attrib.put("X", null, 299 297 Item.class.getMethod("setX", pFloat)); -
trunk/src/org/expeditee/io/DefaultFrameReader.java
r1374 r1377 181 181 182 182 _ItemTagsExt.put("_ph", Text.class.getMethod("setPlaceholder", pString)); 183 _ItemTagsExt.put("_maxW", Text.class.getMethod("setMaxWidth", pIntO));184 183 } catch (Exception e) { 185 184 e.printStackTrace(); -
trunk/src/org/expeditee/io/DefaultFrameWriter.java
r1374 r1377 155 155 156 156 _ItemTagsExt.put("_ph", Text.class.getMethod("getPlaceholder")); 157 _ItemTagsExt.put("_maxW", Text.class.getMethod("getMaxWidthToSave"));158 157 } catch (Exception e) { 159 158 e.printStackTrace(); -
trunk/src/org/expeditee/items/Item.java
r1369 r1377 1170 1170 return getMinWidth(); 1171 1171 } 1172 1173 public Integer getMaxWidthToSave() {1174 return getMaxWidth();1175 }1176 1172 1177 1173 public Integer getWidth() … … 1181 1177 1182 1178 public Integer getMinWidth() { 1183 return null;1184 }1185 1186 public Integer getMaxWidth() {1187 1179 return null; 1188 1180 } -
trunk/src/org/expeditee/items/Text.java
r1369 r1377 140 140 private Integer _minWidth = -Integer.MAX_VALUE; 141 141 142 private Integer _maxWidth = -Integer.MAX_VALUE;143 144 142 private Justification _justification = Justification.left; 145 143 … … 188 186 // The font to display this text in 189 187 private Font _font; 190 private Font _substituteFont;191 private boolean _useSubstituteFont = false;192 188 193 189 // The optional mask character to us in place of the text's content. … … 418 414 invalidateAll(); 419 415 } 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 435 416 436 417 /** … … 468 449 return _minWidth; 469 450 } 470 471 public Integer getMaxWidth() {472 if (_maxWidth == null || _maxWidth <= 0) {473 return null;474 }475 return _maxWidth;476 }477 451 478 452 public Integer getAbsoluteMinWidth() { … … 481 455 } 482 456 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);490 457 } 491 458 … … 1337 1304 _font = EcosystemManager.getFontManager().getDefaultFont().clone(); 1338 1305 f = _font; 1339 1340 if (_useSubstituteFont) {1341 f = _substituteFont;1342 }1343 1306 } 1344 1307 return f; … … 1730 1693 1731 1694 int minWidth = getAbsoluteMinWidth(); 1732 int maxWidth = getAbsoluteMaxWidth();1733 1695 1734 1696 minX = Math.min(minX, bounds.getMinX()); 1735 1697 maxX = minWidth < Integer.MAX_VALUE ? Math.max(minX + minWidth, bounds.getMaxX()) 1736 1698 : 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 }1744 1699 minY = Math.min(minY, (int) (bounds.getMinY() + y)); 1745 1700 maxY = Math.max(maxY, (int) (bounds.getMaxY() + y));
Note:
See TracChangeset
for help on using the changeset viewer.