Changeset 97 for trunk/src/org/expeditee/items/Text.java
- Timestamp:
- 06/10/08 10:03:03 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/items/Text.java
r88 r97 76 76 private int _maxWidth = -1; 77 77 78 private int _justification = Item.JUSTIFICATION_NONE;78 private Justification _justification = Justification.none; 79 79 80 80 private int _spacing = -1; … … 131 131 super(); 132 132 setID(id); 133 } 134 135 public Text(int i, String string, Color foreground, Color background) { 136 this(i, string); 137 this.setColor(foreground); 138 this.setBackgroundColor(background); 133 139 } 134 140 … … 169 175 * The justification to apply to this Text item 170 176 */ 171 public void setJustification( intjust) {177 public void setJustification(Justification just) { 172 178 _justification = just; 173 179 rejustify(); … … 180 186 * @return The justification of this Text item 181 187 */ 182 public intgetJustification() {188 public Justification getJustification() { 183 189 return _justification; 184 190 } … … 188 194 return 0; 189 195 190 if (getJustification() == Item.JUSTIFICATION_CENTER)196 if (getJustification() == Justification.center) 191 197 return (int) ((getWidth() - layout.getAdvance()) / 2); 192 else if (getJustification() == Item.JUSTIFICATION_RIGHT)198 else if (getJustification() == Justification.right) 193 199 return (int) (getWidth() - layout.getAdvance()); 194 200 … … 1115 1121 _lineOffsets.add(_lineBreaker.getPosition()); 1116 1122 1117 if (getWidth() > 0 && getJustification() == Item.JUSTIFICATION_FULL1123 if (getWidth() > 0 && getJustification() == Justification.full 1118 1124 && _lineBreaker.getPosition() < _text.length()) 1119 1125 layout = layout.getJustifiedLayout(width); … … 1177 1183 _lineOffsets.add(_lineBreaker.getPosition()); 1178 1184 1179 if (getWidth() > 0 && getJustification() == Item.JUSTIFICATION_FULL1185 if (getWidth() > 0 && getJustification() == Justification.full 1180 1186 && _lineBreaker.getPosition() < _text.length()) 1181 1187 layout = layout.getJustifiedLayout(width); … … 1379 1385 // copy standard item values 1380 1386 Item.DuplicateItem(this, copy); 1381 1387 1382 1388 // copy values specific to text items 1383 1389 copy.setSpacing(getSpacing()); … … 1389 1395 copy.setFont(getFont()); 1390 1396 copy.setText(_text.toString()); 1397 //copy._poly = new Polygon(_poly.xpoints,_poly.ypoints, _poly.npoints); 1391 1398 1392 1399 return copy; … … 1524 1531 lines.addAll(merger.getLines()); 1525 1532 for (Line line : lines) { 1526 line.replace End(merger, this);1533 line.replaceLineEnd(merger, this); 1527 1534 } 1528 1535 merger.delete();
Note:
See TracChangeset
for help on using the changeset viewer.