Commit facddd22 authored by Jonathon Duerig's avatar Jonathon Duerig

Added license information to all source files. Removed D* as they were taken...

Added license information to all source files. Removed D* as they were taken from a non-work project in order to make the demo faster. They have been replaced by Queue*.
parent 4610ef57
/* EMULAB-COPYRIGHT
* Copyright (c) 2008 University of Utah and the Flux Group.
* All rights reserved.
*
* Permission to use, copy, modify and distribute this software is hereby
* granted provided that (1) source code retains these copyright, permission,
* and disclaimer notices, and (2) redistributions including binaries
* reproduce the notices in supporting documentation.
*
* THE UNIVERSITY OF UTAH ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. THE UNIVERSITY OF UTAH DISCLAIMS ANY LIABILITY OF ANY KIND
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*/
package
{
import flash.display.DisplayObject;
......
/* EMULAB-COPYRIGHT
* Copyright (c) 2008 University of Utah and the Flux Group.
* All rights reserved.
*
* Permission to use, copy, modify and distribute this software is hereby
* granted provided that (1) source code retains these copyright, permission,
* and disclaimer notices, and (2) redistributions including binaries
* reproduce the notices in supporting documentation.
*
* THE UNIVERSITY OF UTAH ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. THE UNIVERSITY OF UTAH DISCLAIMS ANY LIABILITY OF ANY KIND
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*/
package
{
import flash.display.MovieClip;
......
/* EMULAB-COPYRIGHT
* Copyright (c) 2008 University of Utah and the Flux Group.
* All rights reserved.
*
* Permission to use, copy, modify and distribute this software is hereby
* granted provided that (1) source code retains these copyright, permission,
* and disclaimer notices, and (2) redistributions including binaries
* reproduce the notices in supporting documentation.
*
* THE UNIVERSITY OF UTAH ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. THE UNIVERSITY OF UTAH DISCLAIMS ANY LIABILITY OF ANY KIND
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*/
package
{
// This object populates and takes events from both 'select', a
......
/* EMULAB-COPYRIGHT
* Copyright (c) 2008 University of Utah and the Flux Group.
* All rights reserved.
*
* Permission to use, copy, modify and distribute this software is hereby
* granted provided that (1) source code retains these copyright, permission,
* and disclaimer notices, and (2) redistributions including binaries
* reproduce the notices in supporting documentation.
*
* THE UNIVERSITY OF UTAH ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. THE UNIVERSITY OF UTAH DISCLAIMS ANY LIABILITY OF ANY KIND
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*/
package
{
import flash.display.DisplayObjectContainer;
......@@ -43,7 +57,7 @@ package
clip.back.addEventListener(MouseEvent.CLICK, clickBack);
clip.visible = false;
queue = new DList();
queue = new Queue();
working = false;
}
......@@ -89,7 +103,7 @@ package
var newRequest = func(i);
if (newRequest != null)
{
queue.push_back(newRequest);
queue.push(newRequest);
nodes.changeState(i, ActiveNodes.PENDING);
if (! working)
{
......@@ -187,7 +201,7 @@ package
clip.text.scrollV = clip.text.maxScrollV;
queue.front().fail();
queue.front().cleanup();
queue.pop_front();
queue.pop();
start();
}
......@@ -198,10 +212,10 @@ package
clip.text.scrollV = clip.text.maxScrollV;
var next : Request = queue.front().complete(code, response, credential);
queue.front().cleanup();
queue.pop_front();
queue.pop();
if (next != null)
{
queue.push_back(next);
queue.push(next);
}
start();
}
......@@ -214,7 +228,7 @@ package
var bootSliversButton : Button;
var deleteSliversButton : Button;
var queue : DList;
var queue : Queue;
var working : Boolean;
var credential : Credential;
......
/* EMULAB-COPYRIGHT
* Copyright (c) 2008 University of Utah and the Flux Group.
* All rights reserved.
*
* Permission to use, copy, modify and distribute this software is hereby
* granted provided that (1) source code retains these copyright, permission,
* and disclaimer notices, and (2) redistributions including binaries
* reproduce the notices in supporting documentation.
*
* THE UNIVERSITY OF UTAH ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. THE UNIVERSITY OF UTAH DISCLAIMS ANY LIABILITY OF ANY KIND
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*/
package
{
class Credential
......
package
{
public class DIterator
{
public function DIterator() : void
{
this.current = null;
}
public function get() : *
{
if(this.current == null)
{
return null;
}
else
{
return this.current.data;
}
}
public function isValid() : Boolean
{
return this.current != null;
}
public function increment() : void
{
if(this.current != null)
{
this.current = this.current.next;
}
}
public function decrement() : void
{
if(this.current != null)
{
this.current = this.current.prev;
}
}
public function copyFrom(right : DIterator) : void
{
this.current = right.current;
}
public function getNode() : DNode
{
return this.current;
}
public function setNode(newNode : DNode) : void
{
this.current = newNode;
}
protected var current : DNode;
}
}
package
{
public class DList
{
public function DList() : void
{
this.head = null;
this.tail = null;
currentSize = 0;
}
public function size() : int
{
return currentSize;
}
public function isEmpty() : Boolean
{
return this.head == null;
}
public function frontIterator() : DIterator
{
var result : DIterator = new DIterator();
result.setNode(this.head);
return result;
}
public function backIterator() : DIterator
{
var result : DIterator = new DIterator();
result.setNode(this.tail);
return result;
}
public function insert(pos : DIterator,newData : *) : DIterator
{
var result : DIterator = new DIterator();
if(!pos.isValid())
{
this.push_back(newData);
result.setNode(this.tail);
}
else if(pos.getNode() == this.head)
{
this.push_front(newData);
result.setNode(this.head);
}
else
{
var newNode : DNode = new DNode();
newNode.data = newData;
newNode.prev = pos.getNode().prev;
newNode.next = pos.getNode();
pos.getNode().prev.next = newNode;
pos.getNode().prev = newNode;
result.setNode(newNode);
}
++currentSize;
return result;
}
public function erase(pos : DIterator) : DIterator
{
var result : DIterator = new DIterator();
if(pos.isValid())
{
if(pos.getNode() == this.head)
{
this.pop_front();
result.setNode(this.head);
}
else if(pos.getNode() == this.tail)
{
this.pop_back();
result.setNode(this.tail);
}
else
{
pos.getNode().prev.next = pos.getNode().next;
pos.getNode().next.prev = pos.getNode().prev;
result.setNode(pos.getNode().next);
}
--currentSize;
}
return result;
}
public function remove(value : *) : void
{
var pos = find(value);
if (pos.isValid())
{
erase(pos);
}
}
// Returns an iterator pointing to value or an invalid iterator
public function find(value : *) : DIterator
{
var current = frontIterator();
for (; current.isValid(); current.increment())
{
if (current.get() == value)
{
break;
}
}
return current;
}
public function front() : *
{
if(this.head != null)
{
return this.head.data;
}
else
{
return null;
}
}
public function back() : *
{
if(this.tail != null)
{
return this.tail.data;
}
else
{
return null;
}
}
public function push_front(newData : *) : void
{
var newNode : DNode = new DNode();
newNode.data = newData;
if(this.head == null)
{
this.head = newNode;
this.tail = newNode;
}
else
{
this.head.prev = newNode;
newNode.next = this.head;
this.head = newNode;
}
++currentSize;
}
public function push_back(newData : *) : void
{
var newNode : DNode = new DNode();
newNode.data = newData;
if(this.tail == null)
{
this.head = newNode;
this.tail = newNode;
}
else
{
this.tail.next = newNode;
newNode.prev = this.tail;
this.tail = newNode;
}
++currentSize;
}
public function pop_front() : void
{
if (this.head != null && this.tail != null)
{
if(this.head == this.tail)
{
this.head = null;
this.tail = null;
}
else
{
this.head.next.prev = null;
this.head = this.head.next;
}
--currentSize;
}
}
public function pop_back() : void
{
if (this.head != null && this.tail != null)
{
if(this.head == this.tail)
{
this.head = null;
this.tail = null;
}
else
{
this.tail.prev.next = null;
this.tail = this.tail.prev;
}
--currentSize;
}
}
protected var head : DNode;
protected var tail : DNode;
protected var currentSize : int;
}
}
package
{
public class DNode
{
public function DNode() : void
{
this.next = null;
this.prev = null;
this.data = null;
}
public var next : DNode;
public var prev : DNode;
public var data : *;
}
}
/* EMULAB-COPYRIGHT
* Copyright (c) 2008 University of Utah and the Flux Group.
* All rights reserved.
*
* Permission to use, copy, modify and distribute this software is hereby
* granted provided that (1) source code retains these copyright, permission,
* and disclaimer notices, and (2) redistributions including binaries
* reproduce the notices in supporting documentation.
*
* THE UNIVERSITY OF UTAH ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. THE UNIVERSITY OF UTAH DISCLAIMS ANY LIABILITY OF ANY KIND
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*/
package
{
public class Geni
......
/* EMULAB-COPYRIGHT
* Copyright (c) 2008 University of Utah and the Flux Group.
* All rights reserved.
*
* Permission to use, copy, modify and distribute this software is hereby
* granted provided that (1) source code retains these copyright, permission,
* and disclaimer notices, and (2) redistributions including binaries
* reproduce the notices in supporting documentation.
*
* THE UNIVERSITY OF UTAH ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. THE UNIVERSITY OF UTAH DISCLAIMS ANY LIABILITY OF ANY KIND
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*/
package
{
import flash.display.DisplayObjectContainer;
......
/* EMULAB-COPYRIGHT
* Copyright (c) 2008 University of Utah and the Flux Group.
* All rights reserved.
*
* Permission to use, copy, modify and distribute this software is hereby
* granted provided that (1) source code retains these copyright, permission,
* and disclaimer notices, and (2) redistributions including binaries
* reproduce the notices in supporting documentation.
*
* THE UNIVERSITY OF UTAH ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. THE UNIVERSITY OF UTAH DISCLAIMS ANY LIABILITY OF ANY KIND
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*/
package
{
class ListItem
......
/* EMULAB-COPYRIGHT
* Copyright (c) 2008 University of Utah and the Flux Group.
* All rights reserved.
*
* Permission to use, copy, modify and distribute this software is hereby
* granted provided that (1) source code retains these copyright, permission,
* and disclaimer notices, and (2) redistributions including binaries
* reproduce the notices in supporting documentation.
*
* THE UNIVERSITY OF UTAH ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. THE UNIVERSITY OF UTAH DISCLAIMS ANY LIABILITY OF ANY KIND
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*/
package
{
import flash.display.DisplayObjectContainer;
......
/* EMULAB-COPYRIGHT
* Copyright (c) 2008 University of Utah and the Flux Group.
* All rights reserved.
*
* Permission to use, copy, modify and distribute this software is hereby
* granted provided that (1) source code retains these copyright, permission,
* and disclaimer notices, and (2) redistributions including binaries
* reproduce the notices in supporting documentation.
*
* THE UNIVERSITY OF UTAH ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. THE UNIVERSITY OF UTAH DISCLAIMS ANY LIABILITY OF ANY KIND
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*/
package
{
import flash.display.DisplayObjectContainer;
......
/* EMULAB-COPYRIGHT
* Copyright (c) 2008 University of Utah and the Flux Group.
* All rights reserved.
*
* Permission to use, copy, modify and distribute this software is hereby
* granted provided that (1) source code retains these copyright, permission,
* and disclaimer notices, and (2) redistributions including binaries
* reproduce the notices in supporting documentation.
*
* THE UNIVERSITY OF UTAH ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. THE UNIVERSITY OF UTAH DISCLAIMS ANY LIABILITY OF ANY KIND
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*/
package
{
import flash.display.DisplayObjectContainer;
......
/* EMULAB-COPYRIGHT
* Copyright (c) 2008 University of Utah and the Flux Group.
* All rights reserved.
*
* Permission to use, copy, modify and distribute this software is hereby
* granted provided that (1) source code retains these copyright, permission,
* and disclaimer notices, and (2) redistributions including binaries
* reproduce the notices in supporting documentation.
*
* THE UNIVERSITY OF UTAH ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. THE UNIVERSITY OF UTAH DISCLAIMS ANY LIABILITY OF ANY KIND
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*/
package
{
import flash.display.DisplayObjectContainer;
......
/* EMULAB-COPYRIGHT
* Copyright (c) 2008 University of Utah and the Flux Group.
* All rights reserved.
*
* Permission to use, copy, modify and distribute this software is hereby
* granted provided that (1) source code retains these copyright, permission,
* and disclaimer notices, and (2) redistributions including binaries
* reproduce the notices in supporting documentation.
*
* THE UNIVERSITY OF UTAH ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. THE UNIVERSITY OF UTAH DISCLAIMS ANY LIABILITY OF ANY KIND
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*/
package
{
import flash.display.DisplayObjectContainer;
......
/* EMULAB-COPYRIGHT
* Copyright (c) 2008 University of Utah and the Flux Group.
* All rights reserved.
*
* Permission to use, copy, modify and distribute this software is hereby
* granted provided that (1) source code retains these copyright, permission,
* and disclaimer notices, and (2) redistributions including binaries
* reproduce the notices in supporting documentation.
*
* THE UNIVERSITY OF UTAH ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. THE UNIVERSITY OF UTAH DISCLAIMS ANY LIABILITY OF ANY KIND
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*/
package
{
import flash.display.MovieClip;
......
/* EMULAB-COPYRIGHT
* Copyright (c) 2008 University of Utah and the Flux Group.
* All rights reserved.
*
* Permission to use, copy, modify and distribute this software is hereby
* granted provided that (1) source code retains these copyright, permission,
* and disclaimer notices, and (2) redistributions including binaries
* reproduce the notices in supporting documentation.
*
* THE UNIVERSITY OF UTAH ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. THE UNIVERSITY OF UTAH DISCLAIMS ANY LIABILITY OF ANY KIND
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*/
package
{
import