Changeset 922 for trunk/src/org/expeditee/items
- Timestamp:
- 09/02/14 18:08:55 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/items/ItemUtils.java
r920 r922 1034 1034 } 1035 1035 1036 /** 1037 * Wraps any text items to the size of their container, or the frame size if they have not container 1038 * 1039 * @param items A list of Items to wrap (non-Text items are ignored) 1040 */ 1036 1041 public static void Justify(Collection<Item> items) { 1037 1042 for (Item i : items) { 1038 1043 if (i instanceof Text) { 1039 1044 Collection<Item> enclosure = FrameUtils.getEnclosingLineEnds(i.getPosition()); 1040 if (enclosure != null) { 1041 ((Text)i).justify(false, enclosure.iterator().next().getEnclosedShape()); 1042 } 1045 ((Text)i).justify(false, enclosure != null ? enclosure.iterator().next().getEnclosedShape() : null); 1043 1046 } 1044 1047 } 1045 1048 } 1046 1049 1050 /** 1051 * Recalculates containers on the frame, then wraps all text items 1052 * 1053 * @param frame 1054 */ 1047 1055 public static void Justify(Frame frame) { 1048 1056 EnclosedCheck(frame.getItems());
Note:
See TracChangeset
for help on using the changeset viewer.