Index: trunk/code/projects/colonet/client/Colonet.java
===================================================================
--- trunk/code/projects/colonet/client/Colonet.java	(revision 532)
+++ trunk/code/projects/colonet/client/Colonet.java	(revision 533)
@@ -885,8 +885,9 @@
 		}
 
 		public synchronized void paint (Graphics g) {
-			if (img == null)
+			if (img == null) {
 				return;
+			}
 
 			// Calculate scaling
 			int maxWidth = getWidth() - 2*BORDER;
@@ -900,17 +901,17 @@
 			int y = 0;
 
 			if (widthRatio > heightRatio) {	 //height is the limiting factor
-					scale = heightRatio;
-					newHeight = maxHeight;
-					newWidth = (int) (img.getWidth() * scale);
-					y = BORDER;
-					x = (maxWidth - newWidth) / 2 + BORDER;
+				scale = heightRatio;
+				newHeight = maxHeight;
+				newWidth = (int) (img.getWidth() * scale);
+				y = BORDER;
+				x = (maxWidth - newWidth) / 2 + BORDER;
 			} else {	//width is the limiting factor
-					scale = widthRatio;
-					newWidth = maxWidth;
-					newHeight = (int) (img.getHeight() * scale);
-					x = BORDER;
-					y = (maxHeight - newHeight) / 2 + BORDER;
+				scale = widthRatio;
+				newWidth = maxWidth;
+				newHeight = (int) (img.getHeight() * scale);
+				x = BORDER;
+				y = (maxHeight - newHeight) / 2 + BORDER;
 			}
 
 			// Draw everything onto the buffer
@@ -924,35 +925,35 @@
 
 			// Draw Identifiers and battery levels
 			if (robotIcons != null) {
-					bufferedGraphics.setStroke(new BasicStroke(2));
-					for (int i = 0; i < robotIcons.size(); i++) {
-						RobotIcon r = robotIcons.get(i);
-						bufferedGraphics.setColor(r.color);
-						// Identifier circle
-						int px = (int) (x + r.x * scale);
-						int py = (int) (y + r.y * scale);
-						bufferedGraphics.drawOval(px-RADIUS, py-RADIUS, 2*r.RADIUS, 2*r.RADIUS);
-						// Battery
-						//if (r.battery >= 0) {
-								bufferedGraphics.setColor(Color.GREEN);
-								bufferedGraphics.fillRect(px+20, py+20, 30, 10);
-								bufferedGraphics.setColor(Color.BLACK);
-								bufferedGraphics.drawRect(px+20, py+20, 50, 10);
-						//}
-						// If the robot has a destination, draw the vector
-						if (r.destx >= 0) {
-								bufferedGraphics.drawLine(px, py, (int)(x + r.destx * scale), (int)(y + r.desty * scale));
-						}
+				bufferedGraphics.setStroke(new BasicStroke(2));
+				for (int i = 0; i < robotIcons.size(); i++) {
+					RobotIcon r = robotIcons.get(i);
+					bufferedGraphics.setColor(r.color);
+					// Identifier circle
+					int px = (int) (x + r.x * scale);
+					int py = (int) (y + r.y * scale);
+					bufferedGraphics.drawOval(px-RADIUS, py-RADIUS, 2*r.RADIUS, 2*r.RADIUS);
+					// Battery
+					//if (r.battery >= 0) {
+							bufferedGraphics.setColor(Color.GREEN);
+							bufferedGraphics.fillRect(px+20, py+20, 30, 10);
+							bufferedGraphics.setColor(Color.BLACK);
+							bufferedGraphics.drawRect(px+20, py+20, 50, 10);
+					//}
+					// If the robot has a destination, draw the vector
+					if (r.destx >= 0) {
+						bufferedGraphics.drawLine(px, py, (int)(x + r.destx * scale), (int)(y + r.desty * scale));
 					}
+				}
 			}
 
 			// Identify currently-selected robot
-			if (selectedBot >= 0) {
-					bufferedGraphics.setColor(Color.BLACK);
-					RobotIcon r = robotIcons.get(selectedBot);
-					int px = (int) (x + r.x * scale);
-					int py = (int) (y + r.y * scale);
-					bufferedGraphics.drawOval(px-RADIUS-6, py-RADIUS-6, 2*r.RADIUS+12, 2*r.RADIUS+12);
+			if (selectedBot >= 0 && selectedBot < robotIcons.size()) {
+				bufferedGraphics.setColor(Color.BLACK);
+				RobotIcon r = robotIcons.get(selectedBot);
+				int px = (int) (x + r.x * scale);
+				int py = (int) (y + r.y * scale);
+				bufferedGraphics.drawOval(px-RADIUS-6, py-RADIUS-6, 2*r.RADIUS+12, 2*r.RADIUS+12);
 			}
 
 			//Display buffered content
@@ -1061,70 +1062,6 @@
 	}
 
 	/*
-	*	 RobotIcon class
-	*	 Provides a means for graphically representing and keeping track of webcam bots.
-	*/
-	class RobotIcon {
-		public final int RADIUS = 30;
-		public final int CLOSE = 80;
-
-		public int x, y;
-		public int destx, desty;
-		public int id;
-		public Color color;
-				public int battery;
-
-		public RobotIcon (int id, int x, int y) {
-			this.color = Color.RED;
-			this.x = x;
-			this.y = y;
-			this.id = id;
-			this.destx = -1;
-			this.desty = -1;
-			this.battery = -1;
-		}
-
-		/**
-		*	 Relocates this RobotIcon to a new coordinate point.
-		*
-		*/
-		public void move (int newX, int newY) {
-			this.x = newX;
-			this.y = newY;
-		}
-
-		/**
-		*	 Determines if a given point is within a reasonable range of the current location
-		*	 to be considered the same robot when moving. The threshold is determined by the
-		*	 CLOSE value.
-		*
-		*	 @returns Whether or not the given point is reasonably close to the current location.
-		*
-		*/
-		public boolean isClose (int nx, int ny) {
-			int dist = (int) Point.distance(this.x, this.y, nx, ny);
-			return (dist < CLOSE);
-		}
-
-		/**
-		*	 Determines whether a given point is within the rectangle that circumscribes the
-		*	 robot's circlular icon. Used for clicking on robots in webcam view.
-				*
-				*/
-		public boolean contains (int px, int py) {
-				Rectangle rect = new Rectangle(x-RADIUS, y-RADIUS, 2*RADIUS, 2*RADIUS);
-				return rect.contains(px, py);
-		}
-
-		public String toString () {
-			String s = "RobotIcon at (" + x + "," + y + "), id " + id;
-			return s;
-		}
-
-	}
-
-
-	/*
 	* VectorController class
 	* Manages robot motion control graphically
 	*/
Index: trunk/code/projects/colonet/client/Makefile
===================================================================
--- trunk/code/projects/colonet/client/Makefile	(revision 532)
+++ trunk/code/projects/colonet/client/Makefile	(revision 533)
@@ -20,7 +20,7 @@
 
 default: $(DIR)/Colonet.class $(DIR)/ColonetServerInterface.class $(DIR)/Colonet.jar
 
-$(DIR)/Colonet.jar: $(DIR)/Colonet.class $(DIR)/ColonetServerInterface.class
+$(DIR)/Colonet.jar: $(DIR)/Colonet.class $(DIR)/ColonetServerInterface.class $(DIR)/RobotIcon.class
 	@echo --- Creating archive file ---
 	cd $(DIR); jar cf Colonet.jar *.class; jarsigner -keystore colonetkey -storepass colonet Colonet.jar colonet
 	@echo --- Done ---
@@ -32,6 +32,9 @@
 $(DIR)/ColonetServerInterface.class: ColonetServerInterface.java
 	$(JC) $(JCWARN) $(JCFLAGS) ColonetServerInterface.java
 
+$(DIR)/RobotIcon.class: RobotIcon.java
+	$(JC) $(JCWARN) $(JCFLAGS) RobotIcon.java
+
 # Install into the local computer's www directory.
 # The user should use sudo when running make install.
 
Index: trunk/code/projects/colonet/client/RobotIcon.java
===================================================================
--- trunk/code/projects/colonet/client/RobotIcon.java	(nonexistent)
+++ trunk/code/projects/colonet/client/RobotIcon.java	(revision 533)
@@ -0,0 +1,72 @@
+/*
+*	 RobotIcon class
+*	 Provides a means for graphically representing and keeping track of webcam bots.
+*/
+
+import javax.swing.*;
+import javax.swing.event.*;
+import javax.imageio.*;
+import java.awt.*;
+import java.awt.image.*;
+import java.awt.event.*;
+import java.net.*;
+import java.io.*;
+import java.util.*;
+
+public class RobotIcon {
+	public final int RADIUS = 30;
+	public final int CLOSE = 80;
+
+	public int x, y;
+	public int destx, desty;
+	public int id;
+	public Color color;
+	public int battery;
+
+	public RobotIcon (int id, int x, int y) {
+		this.color = Color.RED;
+		this.x = x;
+		this.y = y;
+		this.id = id;
+		this.destx = -1;
+		this.desty = -1;
+		this.battery = -1;
+	}
+
+	/**
+		*	 Relocates this RobotIcon to a new coordinate point.
+		*
+		*/
+	public void move (int newX, int newY) {
+		this.x = newX;
+		this.y = newY;
+	}
+
+	/**
+		*	 Determines if a given point is within a reasonable range of the current location
+		*	 to be considered the same robot when moving. The threshold is determined by the
+		*	 CLOSE value.
+		*
+		*	 @returns Whether or not the given point is reasonably close to the current location.
+		*
+		*/
+	public boolean isClose (int nx, int ny) {
+		int dist = (int) Point.distance(this.x, this.y, nx, ny);
+		return (dist < CLOSE);
+	}
+
+	/**
+		*	 Determines whether a given point is within the rectangle that circumscribes the
+		*	 robot's circlular icon. Used for clicking on robots in webcam view.
+		*
+		*/
+	public boolean contains (int px, int py) {
+		Rectangle rect = new Rectangle(x-RADIUS, y-RADIUS, 2*RADIUS, 2*RADIUS);
+		return rect.contains(px, py);
+	}
+
+	public String toString () {
+		String s = "RobotIcon at (" + x + "," + y + "), id " + id;
+		return s;
+	}
+}

Property changes on: trunk/code/projects/colonet/client/RobotIcon.java
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
