Index: trunk/src/org/expeditee/actions/Javascript.java
===================================================================
--- trunk/src/org/expeditee/actions/Javascript.java	(revision 919)
+++ trunk/src/org/expeditee/actions/Javascript.java	(revision 1102)
@@ -19,5 +19,4 @@
 package org.expeditee.actions;
 
-import java.awt.Color;
 import java.util.LinkedList;
 import java.util.List;
@@ -26,7 +25,7 @@
 import org.expeditee.agents.Agent;
 import org.expeditee.agents.DefaultAgent;
-import org.expeditee.gui.DisplayIO;
+import org.expeditee.core.Colour;
+import org.expeditee.gui.DisplayController;
 import org.expeditee.gui.Frame;
-import org.expeditee.gui.FrameGraphics;
 import org.expeditee.gui.FrameIO;
 import org.expeditee.gui.MessageBay;
@@ -75,5 +74,5 @@
 	private static int _stepPause = -1;
 
-	private static Color _stepColor;
+	private static Colour _stepColor;
 
 	private static boolean _nextStatement;
@@ -93,5 +92,5 @@
 	//Have changed parameters, so it takes an Item, not just a Text item.
 	private static void RunJavascriptFrame(Frame frame, Item current,
-			boolean acceptKeyboardInput, boolean step, int pause, Color color) {
+			boolean acceptKeyboardInput, boolean step, int pause, Colour color) {
 		try {
 			if (current != null) {
@@ -101,5 +100,5 @@
 				 */
 				// DisplayIO.addToBack(current.getParent());
-				DisplayIO.addToBack(DisplayIO.getCurrentFrame());
+				DisplayController.addToBack(DisplayController.getCurrentFrame());
 			} else {
 				/* TODO we should not have to pass an item just to run a frame! */
@@ -108,7 +107,7 @@
 			}
 
-			_stepColor = color == null ? Color.green : color;
-			_stepColor = new Color(_stepColor.getRed(), _stepColor.getGreen(),
-					_stepColor.getBlue(), 50);
+			_stepColor = color == null ? Colour.GREEN : color;
+			_stepColor = new Colour(_stepColor.getRed(), _stepColor.getGreen(),
+					_stepColor.getBlue(), Colour.FromComponent255(50));
 			_stepPause = pause;
 			_step = step;
@@ -168,5 +167,5 @@
 		FrameUtils.DisplayFrame(item.getParent().getName(), true, true);
 		item.setHighlightMode(HighlightMode.Normal);
-		item.setHighlightColor(Color.CYAN);
+		item.setHighlightColor(Colour.CYAN);
 		FrameIO.SaveFrame(item.getParent());
 	}
@@ -192,8 +191,8 @@
 
 		if (_step) {
-			if (child != DisplayIO.getCurrentFrame()) {
-				DisplayIO.setCurrentFrame(child, true);
-			}
-			DisplayIO.addToBack(child);
+			if (child != DisplayController.getCurrentFrame()) {
+				DisplayController.setCurrentFrame(child, true);
+			}
+			DisplayController.addToBack(child);
 		}
 
@@ -216,5 +215,5 @@
 			AgentStats.ItemExecuted();
 			try {
-				Color oldColor = item.getBackgroundColor();
+				Colour oldColor = item.getBackgroundColor();
 				if (_step) {
 					pause(item);
@@ -226,4 +225,5 @@
 					} else {
 						item.setHighlightMode(Item.HighlightMode.None);
+						item.setHighlightColorToDefault();
 					}
 				}
@@ -233,5 +233,5 @@
 							&& lastItemStatus != Status.FalseIf) {
 						if (_step) {
-							DisplayIO.removeFromBack();
+							DisplayController.removeFromBack();
 						}
 						return lastItemStatus;
@@ -257,7 +257,7 @@
 
 		if (_step) {
-			DisplayIO.removeFromBack();
-			if (DisplayIO.getCurrentFrame() != current.getParent())
-				DisplayIO.setCurrentFrame(current.getParent(), true);
+			DisplayController.removeFromBack();
+			if (DisplayController.getCurrentFrame() != current.getParent())
+				DisplayController.setCurrentFrame(current.getParent(), true);
 		}
 
@@ -276,15 +276,16 @@
 			return;
 
-		Color oldColor = item.getBackgroundColor();
+		Colour oldColor = item.getBackgroundColor();
 		item.setBackgroundColor(_stepColor);
 		item.setHighlightMode(Item.HighlightMode.None);
+		item.setHighlightColorToDefault();
 
 		// Make sure we are on the frame with this item
 		Frame parent = item.getParentOrCurrentFrame();
-		if (!parent.equals(DisplayIO.getCurrentFrame())) {
-			DisplayIO.setCurrentFrame(parent, true);
-		}
-
-		FrameGraphics.Repaint();
+		if (!parent.equals(DisplayController.getCurrentFrame())) {
+			DisplayController.setCurrentFrame(parent, true);
+		}
+
+		DisplayController.requestRefresh(true);
 
 		int timeRemaining;
@@ -297,5 +298,5 @@
 			if (_stop) {
 				item.setBackgroundColor(oldColor);
-				item.setHighlightMode(HighlightMode.Normal, _stepColor);
+				item.setHighlightModeAndColour(HighlightMode.Normal, _stepColor);
 				throw new Exception("Program terminated");
 			}
@@ -388,5 +389,5 @@
 		_programsRunning++;
 		AgentStats.reset();
-		MessageBay.displayMessage("Running Javascript Program ...", Color.BLUE);
+		MessageBay.displayMessage("Running Javascript Program ...", Colour.BLUE);
 	}
 
