- Timestamp:
- 02/19/20 10:44:38 (4 years ago)
- Location:
- trunk/src/org/expeditee
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/gio/gesture/StandardGestureActions.java
r1503 r1511 1208 1208 } 1209 1209 if (bReparse) { 1210 FrameUtils.Parse(currentFrame, false, false );1210 FrameUtils.Parse(currentFrame, false, false, false); 1211 1211 } else { 1212 1212 currentFrame.notifyObservers(bRecalculate); … … 1933 1933 Frame currentFrame = DisplayController.getCurrentFrame(); 1934 1934 if (bReparse) { 1935 FrameUtils.Parse(currentFrame, false, false );1935 FrameUtils.Parse(currentFrame, false, false, false); 1936 1936 } else { 1937 1937 currentFrame.notifyObservers(bRecalculate); … … 2013 2013 itemList.clear(); 2014 2014 if (bReparse) { 2015 FrameUtils.Parse(currentFrame, false, false );2015 FrameUtils.Parse(currentFrame, false, false, false); 2016 2016 /* 2017 2017 * TODO check if I need to recalculate even if reparse occurs, here and in … … 3344 3344 } 3345 3345 if (toDelete.hasOverlay()) { 3346 FrameUtils.Parse(parent, false, false );3346 FrameUtils.Parse(parent, false, false, false); 3347 3347 DisplayController.requestRefresh(false); 3348 3348 } -
trunk/src/org/expeditee/gui/Frame.java
r1509 r1511 1196 1196 1197 1197 if (reparse) { 1198 FrameUtils.Parse(this, false, false );1198 FrameUtils.Parse(this, false, false, false); 1199 1199 } else { 1200 1200 notifyObservers(recalculate); … … 1258 1258 1259 1259 if (bReparse) { 1260 FrameUtils.Parse(this, false, false );1260 FrameUtils.Parse(this, false, false, false); 1261 1261 } else { 1262 1262 notifyObservers(bRecalculate); -
trunk/src/org/expeditee/gui/FrameUtils.java
r1508 r1511 71 71 import org.expeditee.items.Item; 72 72 import org.expeditee.items.Item.HighlightMode; 73 import org.expeditee.items.ItemParentStateChangedEvent; 73 74 import org.expeditee.items.ItemUtils; 74 75 import org.expeditee.items.JSItem; … … 680 681 * @param txt 681 682 * Text to create the widget from. Must not be null. 683 * @param userEdit True if createWidget is being called because a user has made a edit, false otherwise. 682 684 * 683 685 * @return True if created/added. False if could not create. … … 685 687 * @author Brook Novak 686 688 */ 687 private static boolean createWidget(Frame frame, Text txt, ItemsList list ) {689 private static boolean createWidget(Frame frame, Text txt, ItemsList list, boolean userEdit) { 688 690 689 691 if (frame == null) { … … 723 725 724 726 frame.addAllItems(iw.getItems(), list); 727 728 if (userEdit) { 729 iw.onParentStateChanged(new ItemParentStateChangedEvent(frame, ItemParentStateChangedEvent.EVENT_TYPE_SHOWN)); 730 } 725 731 726 732 return true; … … 728 734 729 735 private static boolean createWidgetInBody(Frame frame, Text txt) { 730 return createWidget(frame, txt, frame.getBody(false) );736 return createWidget(frame, txt, frame.getBody(false), false); 731 737 } 732 738 … … 889 895 } 890 896 891 private static void transformOutOfPlaceItems(Frame toParse, ItemsList toTransform ) {897 private static void transformOutOfPlaceItems(Frame toParse, ItemsList toTransform, boolean sendWidgetVisible) { 892 898 // Get all items from toTransform that have not been marked as deleted. 893 899 List<Item> items = toParse.getItems(false, toTransform); … … 988 994 // Check for interactive widgets 989 995 } else if (ItemUtils.startsWithTag(i, ItemUtils.TAG_IWIDGET)) { 990 createWidget(toParse, (Text) i, toTransform );996 createWidget(toParse, (Text) i, toTransform, sendWidgetVisible); 991 997 } 992 998 … … 1149 1155 */ 1150 1156 public static void Parse(Frame toParse, boolean firstParse) { 1151 Parse(toParse, firstParse, false );1157 Parse(toParse, firstParse, false, false); 1152 1158 } 1153 1159 … … 1160 1166 * an ao tag linked to a frame with an frameImage of a frame which 1161 1167 * also has an ao tag on it. 1168 * @param userEdit TODO 1162 1169 */ 1163 public static void Parse(Frame toParse, boolean firstParse, boolean ignoreAnnotations ) {1170 public static void Parse(Frame toParse, boolean firstParse, boolean ignoreAnnotations, boolean userEdit) { 1164 1171 List<String> accessList = Label.getAccessibleLabelsNames(toParse.getPrimaryBody()); 1165 1172 … … 1167 1174 ItemsList surrogates = toParse.getSurrogateBody(); 1168 1175 1169 transformOutOfPlaceItems(toParse, primaries );1170 transformOutOfPlaceItems(toParse, surrogates );1176 transformOutOfPlaceItems(toParse, primaries, userEdit); 1177 transformOutOfPlaceItems(toParse, surrogates, userEdit); 1171 1178 1172 1179 toParse.getInteractableItems().clear(); … … 1801 1808 if (!DisplayController.isXRayMode()) { 1802 1809 if (toReparse != null) { 1803 Parse(toReparse, false, false );1810 Parse(toReparse, false, false, true); 1804 1811 } else { 1805 1812 if (toRecalculate != null) { -
trunk/src/org/expeditee/items/Item.java
r1509 r1511 2740 2740 } 2741 2741 2742 public void setRightMargin(int i, boolean fixWidth) 2743 { 2744 int newWidth = i - getX() - Item.MARGIN_LEFT; 2745 if (newWidth < 0) newWidth = 0; 2746 2747 if (!fixWidth) { 2748 newWidth *= -1; 2749 } 2750 2751 setWidth(newWidth); 2742 public void setRightMargin(int rightEdgeToFitTo, boolean fixWidth) 2743 { 2744 int itemXLeft = getX(); 2745 int adjustedRightEdgeToFitTo = rightEdgeToFitTo - Item.MARGIN_LEFT; 2746 2747 if (itemXLeft < adjustedRightEdgeToFitTo) { 2748 int newWidth = adjustedRightEdgeToFitTo - itemXLeft; 2749 2750 if (!fixWidth) { 2751 newWidth *= -1; 2752 } 2753 2754 setWidth(newWidth); 2755 } else if (fixWidth) { 2756 System.err.println( 2757 "Item::setRightMargin() called to set right margin outside of writable area but with fixWidth set to true."); 2758 System.err.println(this); 2759 } 2752 2760 } 2753 2761 … … 3655 3663 if (anchor != null) { 3656 3664 anchorConstraints(); 3657 setX(DisplayController.getFramePaintArea().getMaxX() - anchor - getBoundsWidth()); 3665 int width = Math.abs(getBoundsWidth()); 3666 //System.err.println("Item::setAnchorRight::Text Content= " + getText() + "; width=" + width); 3667 setX(DisplayController.getFramePaintArea().getMaxX() - anchor - width); 3658 3668 } 3659 3669 -
trunk/src/org/expeditee/items/Text.java
r1416 r1511 393 393 @Override 394 394 public void setWidth(Integer width) { 395 System.err.println("Text::setWidth::Text content=" + getText() + ", new width=" + width); 395 396 invalidateAll(); 396 397 … … 400 401 return; 401 402 } 402 403 404 if (width == 0) { 405 System.err.println("Width of Zero: " + getText()); 406 } 407 403 408 _width = width; 404 409 rebuild(true); … … 1783 1788 1784 1789 if (this.getMinWidth() != null && getTextLayouts().size() == 0 && this.getFont() != null) { 1790 // could use any text, 'p' is used simply to get some text in correct font. 1785 1791 getTextLayouts().add(TextLayout.getManager().layoutStringSimple("p", this.getFont())); 1786 1792 isFakeLayout = true; … … 2910 2916 if (anchor != null) { 2911 2917 setX(DisplayController.getFramePaintAreaWidth() - anchor - getBoundsWidth() + getLeftMargin()); 2918 //System.err.println("Text::setAnchorRight::boundsWidth=" + getBoundsWidth()); 2912 2919 } 2913 2920 return; -
trunk/src/org/expeditee/items/widgets/SampleWidget1.java
r1191 r1511 50 50 c.setFocusable(true); 51 51 } 52 System.err.println("SampleWidget1::setting light weight popup enabled to false."); 53 cmboOptions.setLightWeightPopupEnabled(false); 52 54 } 53 55 -
trunk/src/org/expeditee/items/widgets/SampleWidget2.java
r1178 r1511 74 74 cmboPrepend.setFont(BIG_FONT); 75 75 cmboPrepend.addActionListener(new PrependManager(cmboPrepend, utxt)); 76 cmboPrepend.setLightWeightPopupEnabled(false); 76 77 77 78 controls.add(lblTitle); -
trunk/src/org/expeditee/items/widgets/SwingWidget.java
r1191 r1511 15 15 16 16 import javax.swing.JComponent; 17 import javax.swing.JPopupMenu;18 17 19 18 import org.expeditee.core.bounds.AxisAlignedBoxBounds; … … 52 51 onBoundsChanged(); 53 52 54 JPopupMenu.setDefaultLightWeightPopupEnabled(false); 53 System.err.println("SwingWidget::Suppressed static setDefaultLightWeightPopupEnabled to false."); 54 //JPopupMenu.setDefaultLightWeightPopupEnabled(false); 55 55 } 56 56 -
trunk/src/org/expeditee/items/widgets/Widget.java
r1258 r1511 1113 1113 case ItemParentStateChangedEvent.EVENT_TYPE_ADDED: 1114 1114 case ItemParentStateChangedEvent.EVENT_TYPE_ADDED_VIA_OVERLAY: 1115 System.err.println("Widget::onParentStateChanged: Added but not yet shown widget."); 1116 break; 1115 1117 case ItemParentStateChangedEvent.EVENT_TYPE_SHOWN: 1116 1118 case ItemParentStateChangedEvent.EVENT_TYPE_SHOWN_VIA_OVERLAY: 1119 System.err.println("Widget::onParentStateChanged: Shown widget."); 1117 1120 EcosystemManager.addInteractiveWidget(this); 1118 1121 addWidgetContent(e);
Note:
See TracChangeset
for help on using the changeset viewer.