<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -14,7 +14,7 @@ public class CodePage implements Drawable {
 	private String[] code;
 
 	// each position 0,1 or 2 has a list of strings it has to make
-	private ArrayList&lt;LinkedList&lt;String&gt;&gt; copiesToMake = new ArrayList&lt;LinkedList&lt;String&gt;&gt;();
+	private ArrayList&lt;Queue&lt;String&gt;&gt; copiesToMake = new ArrayList&lt;Queue&lt;String&gt;&gt;();
 	
 	//each position 0,1 or 2 has a list of copy ids it owns
 	private ArrayList&lt;LinkedList&lt;String&gt;&gt; copiesOwned = new ArrayList&lt;LinkedList&lt;String&gt;&gt;();
@@ -54,7 +54,7 @@ public class CodePage implements Drawable {
 	
 	private void setup()
 	{
-		copiesToMake = new ArrayList&lt;LinkedList&lt;String&gt;&gt;();
+		copiesToMake = new ArrayList&lt;Queue&lt;String&gt;&gt;();
 		copiesOwned = new ArrayList&lt;LinkedList&lt;String&gt;&gt;();
 		lineToXaalId = new ArrayList&lt;String&gt;();
 		ids = new ArrayList&lt;String&gt;();
@@ -65,7 +65,7 @@ public class CodePage implements Drawable {
 	{
 		copiesToMake.ensureCapacity(pos);
 	
-		copiesToMake.get(pos).push(str);
+		copiesToMake.get(pos).offer(str);
 
 			
 	}
@@ -143,14 +143,14 @@ public class CodePage implements Drawable {
 		for (int i = 0; i &lt; copiesToMake.size(); i++)
 		{
 			copiesOwned.add(new LinkedList&lt;String&gt;());
-			LinkedList&lt;String&gt; posCopiesToMake = copiesToMake.get(i);
+			Queue&lt;String&gt; posCopiesToMake = copiesToMake.get(i);
 			
 			while (posCopiesToMake.size() &gt; 0)
 			{
-				String temp = posCopiesToMake.pop();
+				String temp = posCopiesToMake.poll();
 				String id = scripter.addText(fromPosX[i], y + (lineHeight*callLineNum)
 						, temp, &quot;black&quot;, true);
-				copiesOwned.get(i).add(id);
+				copiesOwned.get(i).offer(id);
 			} 
 		}
 		</diff>
      <filename>viz/CodePage.java</filename>
    </modified>
    <modified>
      <diff>@@ -9,13 +9,14 @@ public class MoveArgCodePageAction extends CodePageAction {
 	
 	
 	public MoveArgCodePageAction(CodePage cp, int slideNum, int fromLine, int fromPos,
-			int toLine, int toPos)
+			int toLine, int toPos, String fromStr)
 	{
 		super(cp, slideNum);
 		this.fromLine = fromLine;
 		this.fromPos = fromPos;
 		this.toLine = toLine;
 		this.toPos = toPos;
+		this.fromStr = fromStr;
 	}
 	
 	public int getFromLine()</diff>
      <filename>viz/MoveArgCodePageAction.java</filename>
    </modified>
    <modified>
      <diff>@@ -68,10 +68,18 @@ public class XAALConnector {
 	  cp.addCopy(fromPos, fromStr);
 	  
 	  actions.offer(new MoveArgCodePageAction(cp, currentSnapNum, 
-			  fromLineNum, fromPos, toLineNum, toPos));
+			  fromLineNum, fromPos, toLineNum, toPos, fromStr));
 	  
   }
   
+  public void swapCodePage(String prevCodePageId, String newCodePageId)
+  {
+	  CodePage cp = cpc.get(prevCodePageId);
+	  CodePage newCP = cpc.get(newCodePageId);
+	  
+	  actions.offer(new SwapCodePageAction(cp, newCP, currentSnapNum));
+  }
+  
   
   public boolean showCodePage(String codePageId)
   {
@@ -553,10 +561,15 @@ public class XAALConnector {
     			  writeCodePageHide((ShowHideCodePageAction)action);
     		  }
     	  }
+    	  else if (action instanceof SwapCodePageAction)
+    	  {
+    		  writeSwapCodePage((SwapCodePageAction)action);
+    	  }
     	  else if (action instanceof ScopeReplaceCodePageAction)
     	  {
     		  writeReplaceWithScopeCodePage((ScopeReplaceCodePageAction)action);
     	  }
+    	  
       }
       
     } while (true);
@@ -583,9 +596,8 @@ public class XAALConnector {
     }
     
   }
-  
- 
-  /**
+
+/**
    * a move consists of:
    * 1. reopening the slide
    * 1.5 reopen par
@@ -1396,6 +1408,7 @@ public class XAALConnector {
 		  String id = cp.popCopy(action.getFromPos());
 		  System.out.println(id);
 		  scripter.addShow(id);
+		  scripter.addChangeStyle(highlightColor, id);
 		  scripter.reclosePar();
 		  
 		  //do the move!!!
@@ -1429,6 +1442,7 @@ public class XAALConnector {
 		    	scripter.endPar();
 		    	
 		    parExists = false;
+		    
 		  parExists = scripter.reopenPar(2);
 		  if(!parExists)
 		  {
@@ -1443,6 +1457,7 @@ public class XAALConnector {
 		  {
 		    	scripter.endPar();
 		  }
+		  
 		    //reclose the slide
 		    scripter.recloseSlide();
 	  }
@@ -1525,4 +1540,37 @@ public class XAALConnector {
 	  {
 	  }
   }
+  
+  /**
+   * this starts at par 2 of move of a moveCodepage
+   * @param action
+   */
+  private void writeSwapCodePage(SwapCodePageAction action)
+  {
+	  try
+	  {
+		  boolean parExists = scripter.reopenPar(2);
+		  if(!parExists)
+		  {
+			  scripter.startPar();
+		  }
+		  
+		  CodePage p = action.getCP();
+		  
+		  
+		  for(String id : p.getIds())
+		  {
+			  scripter.addHide(id);
+		  }
+		  
+		  CodePage newCP = action.getNewCP();
+		  
+		  for(String id : newCP.getIds())
+		  {
+			  scripter.addShow(id);
+		  }
+	  }
+	  catch (Exception e)
+	  {}
+  }
 }</diff>
      <filename>viz/XAALConnector.java</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>b6aecac7ed0508e6a0f764f8fb06e97663d629b5</id>
    </parent>
  </parents>
  <author>
    <name>unknown</name>
    <email>Eric@.(none)</email>
  </author>
  <url>http://github.com/antirush/Viz/commit/1b21a1a114e1219f139d6e809dc1f742a4ff4ad8</url>
  <id>1b21a1a114e1219f139d6e809dc1f742a4ff4ad8</id>
  <committed-date>2009-07-06T18:27:07-07:00</committed-date>
  <authored-date>2009-07-06T18:27:07-07:00</authored-date>
  <message>Moving Args is fixed</message>
  <tree>70952047811883780a4af779da3ae79841750d2a</tree>
  <committer>
    <name>unknown</name>
    <email>Eric@.(none)</email>
  </committer>
</commit>
