Index: trunk/gli/src/org/greenstone/gatherer/gui/GProgressBar.java
===================================================================
--- trunk/gli/src/org/greenstone/gatherer/gui/GProgressBar.java	(revision 5322)
+++ trunk/gli/src/org/greenstone/gatherer/gui/GProgressBar.java	(revision 5571)
@@ -35,29 +35,11 @@
  *########################################################################
  */
-
- 
-
-
-
-
 package org.greenstone.gatherer.gui;
 
-import java.awt.BorderLayout;
-import java.awt.Component;
-import java.awt.Dimension;
-import java.awt.Graphics2D;
-import java.awt.GridLayout;
-import java.awt.Image;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.geom.AffineTransform;
-import java.awt.image.BufferedImage;
-import javax.swing.BorderFactory;
-import javax.swing.ImageIcon;
-import javax.swing.JButton;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JProgressBar;
-import javax.swing.border.BevelBorder;
+import java.awt.*;
+import java.awt.event.*;
+import javax.swing.*;
+import javax.swing.border.*;
+import org.greenstone.gatherer.Dictionary;
 import org.greenstone.gatherer.Gatherer;
 import org.greenstone.gatherer.collection.Job;
@@ -71,9 +53,4 @@
 
     private Dimension bar_size = new Dimension(520, 15);
-
-    private Gatherer gatherer;
-
-    private ImageIcon busy_bar;
-    private ImageIcon ready_bar;
 
     private int current_action;
@@ -104,6 +81,4 @@
     public JButton cancel;
 
-    //public GProgressBar(Gatherer gatherer, WGet owner, String initial_url) {
-    //	  this.gatherer = gatherer;
     public GProgressBar(Job owner, String initial_url, boolean simple) {
 	this.owner = owner;
@@ -120,20 +95,14 @@
 	this.setLayout(new BorderLayout());
 	this.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED));
-	//this.setMinimumSize(Utility.PROGRESS_BAR_SIZE);
-	//this.setSize(Utility.PROGRESS_BAR_SIZE);
-	//this.setMaximumSize(Utility.PROGRESS_BAR_SIZE);
-	//this.setAlignmentY(Component.LEFT_ALIGNMENT);
-	//this.setHorizontalAlignment(JLabel.LEFT);
 
 	this.current_action = Job.STOPPED;
-		  
+
 	inner_pane = new JPanel(new BorderLayout());
 	inner_pane.setBorder(BorderFactory.createEmptyBorder(2,2,2,2));
 
 	action = new JButton(Utility.getImage("vcrplay.gif"));
-	//action.setToolTipText(get("Action_Tip"));
-	action.setToolTipText("Start current download");
 	action.addActionListener(this);
 	action.addActionListener(owner);
+	Dictionary.setTooltip(action, "Mirroring.Job.Start_Tooltip");
 
 	center_pane = new JPanel(new GridLayout(3,1));
@@ -146,9 +115,9 @@
 
 	progress = new JProgressBar();
-	progress.setString("Waiting to start");
 	progress.setStringPainted(true);
 	progress.setMinimum(0);
 	progress.setMaximum(0);
 	progress.setEnabled(false);
+	Dictionary.setText(progress, "Mirroring.Job.Waiting");
 	inner_pane.add(progress, BorderLayout.CENTER);
 
@@ -158,8 +127,7 @@
 
 	cancel = new JButton(Utility.getImage("vcrstop.gif"));
-	//cancel.setToolTipText(get("Cancel_Tip"));
-	cancel.setToolTipText("Cancel current download");
 	cancel.addActionListener(owner);
 	cancel.addActionListener(this);
+	Dictionary.setTooltip(cancel, "Mirroring.Job.Stop_Tooltip");
 
 	inner_pane.add(center_pane, BorderLayout.NORTH);
@@ -175,8 +143,8 @@
     public void actionPerformed(ActionEvent event) {
 	if(event.getSource() == action) {
-	    if(current_action == Job.RUNNING) {
+	    if (current_action == Job.RUNNING) {
 		current_action = Job.STOPPED;
 		action.setIcon(Utility.getImage("vcrplay.gif"));
-		action.setToolTipText("Start current download");
+		Dictionary.setTooltip(action, "Mirroring.Job.Start_Tooltip");
 		cancel.setEnabled(true);
 	    }
@@ -184,5 +152,5 @@
 		current_action = Job.RUNNING;
 		action.setIcon(Utility.getImage("vcrpause.gif"));
-		action.setToolTipText("Pause current download");
+		Dictionary.setTooltip(action, "Mirroring.Job.Pause_Tooltip");
 		cancel.setEnabled(false);
 	    }
@@ -212,5 +180,5 @@
 	}
 	progress.setValue(progress.getMaximum());
-	progress.setString("Download Complete.");
+	Dictionary.setText(progress, "Mirroring.Job.Download_Complete");
 	refresh();
     }
@@ -232,5 +200,5 @@
     }
 
-    public Dimension getPerferredSize() {
+    public Dimension getPreferredSize() {
 	return Utility.PROGRESS_BAR_SIZE;
     }
@@ -259,8 +227,8 @@
 	    this.err_count = 0;
 	    this.warning_count = 0;
-	}				
+	}
 	current_action = Job.RUNNING;
 	action.setIcon(Utility.getImage("vcrpause.gif"));
-	action.setToolTipText("Pause current download");
+	Dictionary.setTooltip(cancel, "Mirroring.Job.Pause_Tooltip");
 	// If this is a simple download, then pause is not available (nor is prematurely stopping!)
 	action.setEnabled(!simple);
@@ -283,8 +251,8 @@
 	}
 	progress.setValue(progress.getMaximum());
-	progress.setString("Mirroring Complete.");
+	Dictionary.setText(progress, "Mirroring.Job.Mirror_Complete");
 
 	action.setIcon(Utility.getImage("vcrfastforward.gif"));
-	action.setToolTipText("Restart current download");
+	Dictionary.setText(action, "Mirroring.Job.Restart");
 	action.setEnabled(true);
 	cancel.setEnabled(true);
@@ -298,6 +266,6 @@
 	file_size = file_size + current;
 	if(!progress.isIndeterminate()) {
-				// If current is zero, then this is the 'precall' before the
-				// downloading actually starts.
+	    // If current is zero, then this is the 'precall' before the
+	    // downloading actually starts.
 	    if(current == 0) {
 		// Remove the old progress bar, then deallocate it.
@@ -305,13 +273,10 @@
 		progress = null;
 		if(expected == 0) {
-		    // We don't have a content length. This bar will go from
-		    // 0 to 100 only!
+		    // We don't have a content length. This bar will go from 0 to 100 only!
 		    progress = new JProgressBar(0, 100);
 		}
 		else {
-		    // Assign a new progress bar of length expected content
-		    // length.
-		    progress = 
-			new JProgressBar(0, (new Long(expected)).intValue());
+		    // Assign a new progress bar of length expected content length.
+		    progress = new JProgressBar(0, (new Long(expected)).intValue());
 		}
 		progress.setEnabled(true);
@@ -320,62 +285,20 @@
 		inner_pane.updateUI();
 	    }
-				// Otherwise if expected is not zero move the progress bar and
-				// update percent complete.
+	    // Otherwise if expected is not zero move the progress bar and
+	    // update percent complete.
 	    else if (expected != 0) {
 		progress.setValue((new Long(file_size)).intValue());
-		int p_c = 
-		    (new Double(
-				progress.getPercentComplete() * 100)).intValue();
+		int p_c = (new Double(progress.getPercentComplete() * 100)).intValue();
 		progress.setString(p_c + "%");
 		progress.setStringPainted(true);
 	    }
-				// Finally, in the case we have no content length, we'll instead
-				// write the current number of bytes downloaded again.
+	    // Finally, in the case we have no content length, we'll instead
+	    // write the current number of bytes downloaded again.
 	    else {
-		progress.setString( file_size + " bytes");
+		progress.setString(file_size + " b");
 		progress.setStringPainted(true);
 	    }
 	}
 	refresh();
-    }
-
-    /** Retrieve a String from the dictionary using no arguments.
-     * @param key The String which acts as a key mapping for the 
-     * ResourceBundle.
-     * @return A String which is the value for the given key.
-     */
-    private String get(String key) {
-	return get(key, null);
-    }
-
-    /** Retrieve a String from the dictionary using the given arguments.
-     * @param key The String which acts as a key mapping for the 
-     * ResourceBundle.
-     * @param args A String array of arguments to be filled out inside the
-     * dictionary value.
-     * @return A String which is the value for the given key.
-     */
-    private String get(String key, String args[]) {
-	if(key.indexOf('.') == -1) {
-	    return gatherer.dictionary.get("GProgressBar."+key, args);
-	}
-	return gatherer.dictionary.get(key, args);
-    }
-
-    /** The given parameter is taken as the number of bytes and is 
-     * formatted into a strings such as:
-     *   45 bytes
-     * 1.21 Kbytes
-     * 2.12 Mbytes
-     * etc
-     * @param size The number to be formatted, in bytes, as a Long.
-     * @return A String which contains the size formatting into a
-     * nice little number - unit label.
-     */
-    private String formatMetric(long size) {
-	if(size > 1024) {
-	    return (size / 1024) + " Kbytes";
-	}
-	return size + " bytes";
     }
 
@@ -389,22 +312,17 @@
 	String args1[] = new String[1];
 	args1[0] = initial_url.toString();
-		  
-	//main_status.setText(get("Main_Status", args1));
-	main_status.setText("Mirroring " + args1[0] + ".");
-
-	if(current_url != null) {
-				// Refresh the current label contents.
+	Dictionary.setText(main_status, "Mirroring.Job.Mirroring", args1);
+
+	if (current_url != null) {
+	    // Refresh the current label contents.
 	    String args2[] = new String[1];
 	    args2[0] = current_url;
-				
-	    String cstext = "Downloading " + args2[0];
-	    current_status.setText(Utility.trim(cstext, 50));
-	}
-	else if(current_action == Job.STOPPED 
-		|| current_action == Job.PAUSED) {
-	    current_status.setText("Waiting for user action.");
-	} 
+	    Dictionary.setText(current_status, "Mirroring.Job.Downloading", args2);
+	}
+	else if (current_action == Job.STOPPED || current_action == Job.PAUSED) {
+	    Dictionary.setText(current_status, "Mirroring.Job.Waiting_User");
+	}
 	else {
-	    current_status.setText("Mirroring Complete.");
+	    Dictionary.setText(current_status, "Mirroring.Job.Mirroring_Complete");
 	}
 
@@ -415,8 +333,5 @@
 	args3[2] = warning_count + "";
 	args3[3] = err_count + "";
-
-	results_status.setText("Downloaded " + args3[0] + " of " + 
-			       args3[1] + " files (" + args3[2] + 
-			       " warnings, " + args3[3] + " errors)");
+	Dictionary.setText(results_status, "Mirroring.Job.Status", args3);
 
 	this.updateUI();
