Changeset 1379
- Timestamp:
- 05/27/19 11:38:10 (5 years ago)
- Location:
- trunk/src/org/expeditee
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/gui/AttributeUtils.java
r1377 r1379 322 322 _Attrib.put("Placeholder", Text.class.getMethod("getPlaceholder"), 323 323 Text.class.getMethod("setPlaceholder", pString)); 324 _Attrib.put("SingleLineOnly", Text.class.getMethod("isSingleLineOnly"), 325 Text.class.getMethod("setSingleLineOnly", pBool)); 324 326 325 327 // Aliases for attribute setting -
trunk/src/org/expeditee/io/DefaultFrameReader.java
r1377 r1379 181 181 182 182 _ItemTagsExt.put("_ph", Text.class.getMethod("setPlaceholder", pString)); 183 _ItemTagsExt.put("_sl", Text.class.getMethod("setSingleLineOnly", pBool)); 183 184 } catch (Exception e) { 184 185 e.printStackTrace(); -
trunk/src/org/expeditee/io/DefaultFrameWriter.java
r1377 r1379 155 155 156 156 _ItemTagsExt.put("_ph", Text.class.getMethod("getPlaceholder")); 157 _ItemTagsExt.put("_sl", Text.class.getMethod("isSingleLineOnly")); 157 158 } catch (Exception e) { 158 159 e.printStackTrace(); -
trunk/src/org/expeditee/items/Text.java
r1377 r1379 139 139 140 140 private Integer _minWidth = -Integer.MAX_VALUE; 141 142 private boolean _singleLine = false; 141 143 142 144 private Justification _justification = Justification.left; … … 1817 1819 Font paintFont = getPaintFont(); 1818 1820 if (this._text != null && this._text.length() > 0) { 1819 this._textLayouts=1821 List<TextLayout> proposedTextLayout = 1820 1822 EcosystemManager.getTextLayoutManager().layoutString( 1821 1823 _text.toString(), … … 1827 1829 getJustification() == Justification.full 1828 1830 ); 1831 if (proposedTextLayout.size() > 1 && isSingleLineOnly()) { 1832 paintFont = paintFont.clone(); 1833 1834 while(proposedTextLayout.size() > 1) { 1835 paintFont.setSize(paintFont.getSize() - 1); 1836 proposedTextLayout = 1837 EcosystemManager.getTextLayoutManager().layoutString( 1838 _text.toString(), 1839 paintFont, 1840 new Point(getX(), getY()), lines != null ? lines.toArray(new org.expeditee.core.Line[1]) : null, 1841 (int) width, 1842 (int) getSpacing(), 1843 true, 1844 getJustification() == Justification.full 1845 ); 1846 } 1847 } 1848 this._textLayouts = proposedTextLayout; 1829 1849 1830 1850 if (this.getMask() != null) { … … 3154 3174 } 3155 3175 } 3176 3177 public boolean isSingleLineOnly() { 3178 return _singleLine; 3179 } 3180 3181 public void setSingleLineOnly(boolean _singleLine) { 3182 this._singleLine = _singleLine; 3183 } 3156 3184 }
Note:
See TracChangeset
for help on using the changeset viewer.