Changeset 390
- Timestamp:
- 11/17/08 15:43:36 (16 years ago)
- Location:
- trunk/src/org/expeditee
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/actions/Misc.java
r376 r390 760 760 Node node = myParser.parse(formula); 761 761 Object result = myParser.evaluate(node); 762 text.setText(result.toString() );762 text.setText(result.toString(), true); 763 763 text.setFormula(formulaFullCase); 764 764 if (text.isFloating()) { -
trunk/src/org/expeditee/actions/Simple.java
r376 r390 1170 1170 Text textItem = (Text) context.getPointers().getVariable( 1171 1171 tokens[1]).getValue(); 1172 textItem.setText(newText );1172 textItem.setText(newText, true); 1173 1173 } else 1174 1174 throw new Exception("Unsupported setItem command: " … … 1386 1386 t = (Text) context.getPointers().getVariable(tokens[1]) 1387 1387 .getValue(); 1388 t.setText(log );1388 t.setText(log, true); 1389 1389 } else if (tokens[0].equals("getframeitemcount")) { 1390 1390 String frameVar = DEFAULT_FRAME; … … 2455 2455 2456 2456 pause(context.getPrimitives().getDoubleValue(lengthVar)); 2457 } else if (tokens[0].equals("glidecursorto")) { 2457 } else if (tokens[0].equals("waitforagent")) { 2458 while(DefaultAgent.isAgentRunning()){ 2459 Thread.sleep(100); 2460 } 2461 }else if (tokens[0].equals("glidecursorto")) { 2458 2462 assertMinParametreCount(tokens, 2); 2459 2463 int finalX = (int) context.getPrimitives().getIntegerValue( -
trunk/src/org/expeditee/agents/Agent.java
r179 r390 12 12 */ 13 13 public interface Agent extends Runnable { 14 14 15 15 /** 16 16 * This method should always be called before calling process(). The Frame -
trunk/src/org/expeditee/agents/ComputeTree.java
r247 r390 38 38 // Search for @Compute frame tag 39 39 String computeTag = null; 40 41 //TODO can speed this up by using frame.hasAnnotations 40 42 for (Item i : frame.getItems()) { 41 43 if (_stop) … … 109 111 } 110 112 } 113 114 if(value.equals(Double.NaN)) 115 continue; 111 116 112 117 if (value != null) { -
trunk/src/org/expeditee/agents/DefaultAgent.java
r313 r390 18 18 */ 19 19 public abstract class DefaultAgent implements Agent { 20 public static int AGENTS_RUNNING = 0; 21 20 22 public static final String CLIPBOARD = "Clipboard"; 21 23 … … 45 47 46 48 public DefaultAgent(String delay) { 47 super();49 this(); 48 50 try { 49 51 _delay = (int) (Double.parseDouble(delay) * 1000); … … 54 56 public DefaultAgent() { 55 57 super(); 58 AGENTS_RUNNING++; 59 } 60 61 public static boolean isAgentRunning() { 62 return AGENTS_RUNNING > 0; 56 63 } 57 64 … … 101 108 102 109 _running = false; 110 AGENTS_RUNNING--; 103 111 104 112 FrameGraphics.requestRefresh(true); -
trunk/src/org/expeditee/gui/DisplayIO.java
r376 r390 531 531 } 532 532 } 533 frame.re freshItemPermissions(Permission.full);533 frame.reset(); 534 534 FrameMouseActions.getInstance().refreshHighlights(); 535 535 FrameGraphics.refresh(false); -
trunk/src/org/expeditee/gui/Frame.java
r376 r390 131 131 private Collection<Item> _vectorItems = new LinkedHashSet<Item>(); 132 132 133 private Text _dotTemplate = UserSettings.DotTemplate.copy(); 134 133 135 /** 134 136 * Default constructor, nothing is set. 135 137 */ 136 138 public Frame() { 139 } 140 141 public void reset() { 142 refreshItemPermissions(Permission.full); 143 144 resetDot(); 145 } 146 147 private void resetDot() { 148 _dotTemplate.setColor(Item.COLOR_WHEEL[1]); 149 _dotTemplate.setFillColor(Item.FILL_COLOR_WHEEL[0]); 150 } 151 152 public void nextDot() { 153 _dotTemplate.setFillColor(ColorUtils.getNextColor(_dotTemplate 154 .getFillColor(), Item.FILL_COLOR_WHEEL, null)); 155 _dotTemplate.setColor(ColorUtils.getNextColor(_dotTemplate.getColor(), 156 Item.COLOR_WHEEL, null)); 157 158 if(_dotTemplate.getColor().equals(Color.white)){ 159 resetDot(); 160 } 137 161 } 138 162 … … 219 243 } 220 244 221 // private static int updateCount = 0;245 // private static int updateCount = 0; 222 246 223 247 /** … … 229 253 */ 230 254 public void notifyObservers(boolean bRecalculate) { 231 if (bRecalculate){255 if (bRecalculate) { 232 256 recalculate(); 233 257 } … … 241 265 Collection<FrameObserver> observersCopy = new LinkedList<FrameObserver>( 242 266 _observers); 243 // System.out.println(++updateCount + " update");267 // System.out.println(++updateCount + " update"); 244 268 245 269 for (FrameObserver fl : observersCopy) { … … 1508 1532 getNextItemID()); 1509 1533 1510 Item template = getTemplate(UserSettings.DotTemplate, 1511 ItemUtils.TAG_DOT_TEMPLATE); 1534 Item template = getTemplate(_dotTemplate, ItemUtils.TAG_DOT_TEMPLATE); 1512 1535 float thickness = template.getThickness(); 1513 1536 if (thickness > 0) -
trunk/src/org/expeditee/gui/FrameMouseActions.java
r376 r390 693 693 assert (widgetLink != null); 694 694 clicked = widgetLink; 695 } else { 696 for (Item i : _lastClickedIn) { 697 /* 698 * Find the first linked item or the first unlinked Dot This 699 * code assumes that items are are ordered from top to bottom. 700 * TODO make sure the list will always be ordered correctly!! 701 */ 702 if (i.hasLink() || i instanceof Dot){ 703 clicked = i; 704 break; 705 } 706 } 695 707 } 696 708 … … 1386 1398 copies.add(d[i]); 1387 1399 } 1400 1401 current.nextDot(); 1388 1402 1389 1403 // create lines … … 1513 1527 } 1514 1528 1515 DisplayIO.setTextCursor(_lastRanged, Text.NONE, false, e.isShiftDown(), e.isControlDown(), false); 1529 DisplayIO.setTextCursor(_lastRanged, Text.NONE, false, e 1530 .isShiftDown(), e.isControlDown(), false); 1516 1531 FrameGraphics.Repaint(); 1517 1532 return; -
trunk/src/org/expeditee/gui/FrameUtils.java
r376 r390 766 766 AttributeValuePair avp = new AttributeValuePair(item.getText()); 767 767 assert (avp != null); 768 768 769 769 if (avp.hasPair()) { 770 770 item.setLink(avp.getValue()); … … 984 984 } 985 985 Frame overlayFrame = null; 986 986 987 987 Frame current = DisplayIO.getCurrentFrame(); 988 988 if (current != null) { 989 989 for (Overlay o : current.getOverlays()) { 990 if (o.Frame.getName().equalsIgnoreCase(link)) 990 if (o.Frame.getName() 991 .equalsIgnoreCase(link)) 991 992 overlayFrame = o.Frame; 992 993 } 993 994 } 994 if (overlayFrame == null) overlayFrame = FrameIO.LoadFrame(link); 995 995 if (overlayFrame == null) 996 overlayFrame = FrameIO.LoadFrame(link); 997 996 998 // get level if specified 997 999 String level = new AttributeValuePair(i.getText()) … … 1106 1108 toParse.addAllOverlays(overlays); 1107 1109 toParse.addAllVectors(vectors); 1108 1110 1109 1111 } 1110 1112 … … 1294 1296 1295 1297 // Brook: enclosed widgets are to be fully enclosed, never partially 1298 /* 1299 * MIKE says: but doesnt this mean that widgets are treated differently 1300 * from ALL other object which only need to be partially enclosed to be 1301 * picked up 1302 */ 1296 1303 List<InteractiveWidget> enclosedWidgets = new LinkedList<InteractiveWidget>(); 1297 1304 for (Item i : enclosed) { … … 1459 1466 1460 1467 yPos += spacing; 1461 profile.addText(xPos, yPos, "@HomeFrame", null, 1462 profile.getName()); 1468 profile.addText(xPos, yPos, "@HomeFrame", null, profile.getName()); 1463 1469 yPos += spacing; 1464 1470 String defaultFrameName = profile.getFramesetName() + "0"; 1465 profile.addText(xPos, yPos, "@DefaultFrame", null, 1466 defaultFrameName); 1471 profile.addText(xPos, yPos, "@DefaultFrame", null, defaultFrameName); 1467 1472 yPos += spacing; 1468 1473 -
trunk/src/org/expeditee/io/Conversion.java
r362 r390 481 481 public static Object[] Convert(Method method, String value, Object current) { 482 482 483 if(method == null) { 484 System.out.println("Error converting null method"); 485 return null; 486 } 487 483 488 String name = method.getName(); 484 489 Class[] types = method.getParameterTypes(); -
trunk/src/org/expeditee/io/KMSReader.java
r348 r390 493 493 } else { 494 494 Method toRun = _ItemTags.get("" + tag.charAt(0)); 495 if (toRun == null) 495 if (toRun == null){ 496 496 System.out.println("Error accessing tag method: " 497 497 + tag.charAt(0)); 498 499 } 498 500 Object[] vals; 499 501 if (last.length() > 0) -
trunk/src/org/expeditee/items/Item.java
r376 r390 2677 2677 2678 2678 public String getText() { 2679 return toString();2679 return "@" + getClass().getSimpleName() + ":" + getID(); 2680 2680 } 2681 2681 -
trunk/src/org/expeditee/items/Text.java
r376 r390 267 267 @Override 268 268 public void setText(String text) { 269 setText(text, false); 270 } 271 272 public void setText(String text, Boolean clearCache) { 269 273 // if (_text != null && text.length() < _text.length()) 270 274 invalidateAll(); … … 272 276 273 277 /* 274 * A dding the lines belowremove formulas when moving in and out of XRay278 * Always clearingCach remove formulas when moving in and out of XRay 275 279 * mode 276 280 */ 277 // Reset properties 278 // setProcessedText(null); 279 // setFormula(null); 281 if(clearCache){ 282 clearCache(); 283 } 284 280 285 rebuild(true); 281 286 invalidateAll();
Note:
See TracChangeset
for help on using the changeset viewer.