- Timestamp:
- 09/01/14 17:58:47 (10 years ago)
- Location:
- trunk/src/org/expeditee
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/gui/DisplayIO.java
r919 r920 42 42 import org.expeditee.items.Item; 43 43 import org.expeditee.items.ItemParentStateChangedEvent; 44 import org.expeditee.items.ItemUtils; 44 45 import org.expeditee.items.Picture; 45 46 import org.expeditee.items.Text; … … 592 593 } 593 594 } 595 594 596 frame.reset(); 597 598 // fix text items 599 ItemUtils.Justify(frame); 600 595 601 FrameMouseActions.getInstance().refreshHighlights(); 596 602 FrameGraphics.refresh(false); -
trunk/src/org/expeditee/gui/FrameMouseActions.java
r919 r920 37 37 import java.util.ArrayList; 38 38 import java.util.Collection; 39 import java.util.Comparator; 39 40 import java.util.Date; 40 41 import java.util.HashSet; … … 1529 1530 clearParent(copies); 1530 1531 } 1532 1533 ItemUtils.Justify(copies); 1531 1534 1532 1535 pickup(copies); … … 1542 1545 copies = copy(enclosed); 1543 1546 clearParent(copies); 1547 ItemUtils.Justify(copies); 1544 1548 pickup(copies); 1545 1549 for (Item i : clickedIn) { … … 3265 3269 ItemUtils.EnclosedCheck(f.getItems()); 3266 3270 } 3271 3272 // justify text items now 3273 ItemUtils.Justify(toAnchorCopy); 3267 3274 3268 3275 Frame currentFrame = DisplayIO.getCurrentFrame(); -
trunk/src/org/expeditee/items/ItemUtils.java
r919 r920 36 36 import org.expeditee.gui.DisplayIO; 37 37 import org.expeditee.gui.Frame; 38 import org.expeditee.gui.FrameUtils; 38 39 import org.expeditee.gui.FreeItems; 39 40 import org.expeditee.gui.Vector; … … 1032 1033 return iWidgets; 1033 1034 } 1035 1036 public static void Justify(Collection<Item> items) { 1037 for (Item i : items) { 1038 if (i instanceof Text) { 1039 Collection<Item> enclosure = FrameUtils.getEnclosingLineEnds(i.getPosition()); 1040 if (enclosure != null) { 1041 ((Text)i).justify(false, enclosure.iterator().next().getEnclosedShape()); 1042 } 1043 } 1044 } 1045 } 1046 1047 public static void Justify(Frame frame) { 1048 EnclosedCheck(frame.getItems()); 1049 Justify(frame.getItems()); 1050 } 1034 1051 } -
trunk/src/org/expeditee/items/Text.java
r919 r920 2269 2269 } 2270 2270 } 2271 2272 public void justify(boolean fixWidth) { 2273 2271 2272 public void justify(boolean fixWidth, Polygon enclosure) { 2274 2273 // if autowrap is on, wrapping is done every time we draw 2275 2274 if(ExperimentalFeatures.AutoWrap.get()) { … … 2281 2280 // Check if that text item is inside an enclosing rectangle... 2282 2281 // Set its max width accordingly 2283 Polygon enclosure = FrameUtils.getEnlosingPolygon();2284 2282 if (enclosure != null) { 2285 2283 Rectangle bounds = enclosure.getBounds(); … … 2306 2304 2307 2305 } 2306 } 2307 2308 public void justify(boolean fixWidth) { 2309 // if autowrap is on, wrapping is done every time we draw 2310 if(ExperimentalFeatures.AutoWrap.get()) { 2311 return; 2312 } 2313 this.justify(fixWidth, FrameUtils.getEnlosingPolygon()); 2308 2314 } 2309 2315
Note:
See TracChangeset
for help on using the changeset viewer.