Changeset 1102 for trunk/src/org/expeditee/actions/Javascript.java
- Timestamp:
- 05/10/18 16:04:51 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/actions/Javascript.java
r919 r1102 19 19 package org.expeditee.actions; 20 20 21 import java.awt.Color;22 21 import java.util.LinkedList; 23 22 import java.util.List; … … 26 25 import org.expeditee.agents.Agent; 27 26 import org.expeditee.agents.DefaultAgent; 28 import org.expeditee.gui.DisplayIO; 27 import org.expeditee.core.Colour; 28 import org.expeditee.gui.DisplayController; 29 29 import org.expeditee.gui.Frame; 30 import org.expeditee.gui.FrameGraphics;31 30 import org.expeditee.gui.FrameIO; 32 31 import org.expeditee.gui.MessageBay; … … 75 74 private static int _stepPause = -1; 76 75 77 private static Colo r _stepColor;76 private static Colour _stepColor; 78 77 79 78 private static boolean _nextStatement; … … 93 92 //Have changed parameters, so it takes an Item, not just a Text item. 94 93 private static void RunJavascriptFrame(Frame frame, Item current, 95 boolean acceptKeyboardInput, boolean step, int pause, Colo r color) {94 boolean acceptKeyboardInput, boolean step, int pause, Colour color) { 96 95 try { 97 96 if (current != null) { … … 101 100 */ 102 101 // DisplayIO.addToBack(current.getParent()); 103 Display IO.addToBack(DisplayIO.getCurrentFrame());102 DisplayController.addToBack(DisplayController.getCurrentFrame()); 104 103 } else { 105 104 /* TODO we should not have to pass an item just to run a frame! */ … … 108 107 } 109 108 110 _stepColor = color == null ? Colo r.green: color;111 _stepColor = new Colo r(_stepColor.getRed(), _stepColor.getGreen(),112 _stepColor.getBlue(), 50);109 _stepColor = color == null ? Colour.GREEN : color; 110 _stepColor = new Colour(_stepColor.getRed(), _stepColor.getGreen(), 111 _stepColor.getBlue(), Colour.FromComponent255(50)); 113 112 _stepPause = pause; 114 113 _step = step; … … 168 167 FrameUtils.DisplayFrame(item.getParent().getName(), true, true); 169 168 item.setHighlightMode(HighlightMode.Normal); 170 item.setHighlightColor(Colo r.CYAN);169 item.setHighlightColor(Colour.CYAN); 171 170 FrameIO.SaveFrame(item.getParent()); 172 171 } … … 192 191 193 192 if (_step) { 194 if (child != Display IO.getCurrentFrame()) {195 Display IO.setCurrentFrame(child, true);196 } 197 Display IO.addToBack(child);193 if (child != DisplayController.getCurrentFrame()) { 194 DisplayController.setCurrentFrame(child, true); 195 } 196 DisplayController.addToBack(child); 198 197 } 199 198 … … 216 215 AgentStats.ItemExecuted(); 217 216 try { 218 Colo r oldColor = item.getBackgroundColor();217 Colour oldColor = item.getBackgroundColor(); 219 218 if (_step) { 220 219 pause(item); … … 226 225 } else { 227 226 item.setHighlightMode(Item.HighlightMode.None); 227 item.setHighlightColorToDefault(); 228 228 } 229 229 } … … 233 233 && lastItemStatus != Status.FalseIf) { 234 234 if (_step) { 235 Display IO.removeFromBack();235 DisplayController.removeFromBack(); 236 236 } 237 237 return lastItemStatus; … … 257 257 258 258 if (_step) { 259 Display IO.removeFromBack();260 if (Display IO.getCurrentFrame() != current.getParent())261 Display IO.setCurrentFrame(current.getParent(), true);259 DisplayController.removeFromBack(); 260 if (DisplayController.getCurrentFrame() != current.getParent()) 261 DisplayController.setCurrentFrame(current.getParent(), true); 262 262 } 263 263 … … 276 276 return; 277 277 278 Colo r oldColor = item.getBackgroundColor();278 Colour oldColor = item.getBackgroundColor(); 279 279 item.setBackgroundColor(_stepColor); 280 280 item.setHighlightMode(Item.HighlightMode.None); 281 item.setHighlightColorToDefault(); 281 282 282 283 // Make sure we are on the frame with this item 283 284 Frame parent = item.getParentOrCurrentFrame(); 284 if (!parent.equals(Display IO.getCurrentFrame())) {285 Display IO.setCurrentFrame(parent, true);286 } 287 288 FrameGraphics.Repaint();285 if (!parent.equals(DisplayController.getCurrentFrame())) { 286 DisplayController.setCurrentFrame(parent, true); 287 } 288 289 DisplayController.requestRefresh(true); 289 290 290 291 int timeRemaining; … … 297 298 if (_stop) { 298 299 item.setBackgroundColor(oldColor); 299 item.setHighlightMode (HighlightMode.Normal, _stepColor);300 item.setHighlightModeAndColour(HighlightMode.Normal, _stepColor); 300 301 throw new Exception("Program terminated"); 301 302 } … … 388 389 _programsRunning++; 389 390 AgentStats.reset(); 390 MessageBay.displayMessage("Running Javascript Program ...", Colo r.BLUE);391 MessageBay.displayMessage("Running Javascript Program ...", Colour.BLUE); 391 392 } 392 393
Note:
See TracChangeset
for help on using the changeset viewer.