// Path: src/com/ndtorrent/client/status/PieceInfo.java
// public final class PieceInfo {
// 
// 	private final int index;
// 	private final int length;
// 	private final int num_blocks;
// 	private final BitSet available;
// 	private final BitSet requested;
// 
// 	public PieceInfo(Piece piece) {
// 		index = piece.getIndex();
// 		length = piece.getLength();
// 		num_blocks = piece.numBlocks();
// 		available = piece.getAvailableBlocks();
// 		requested = (BitSet) piece.getNotRequested().clone();
// 		requested.flip(0, num_blocks);
// 		requested.andNot(available);
// 	}
// 
// 	public int getIndex() {
// 		return index;
// 	}
// 
// 	public int getLength() {
// 		return length;
// 	}
// 
// 	public int numBlocks() {
// 		return num_blocks;
// 	}
// 
// 	public int numAvailableBlocks() {
// 		return available.cardinality();
// 	}
// 
// 	public BitSet getAvailableBlocks() {
// 		return available;
// 	}
// 
// 	public BitSet getRequestedBlocks() {
// 		return requested;
// 	}
// 
// }
// 
// Path: src/com/ndtorrent/client/status/TorrentInfo.java
// public final class TorrentInfo {
// 
// 	private final BitSet available;
// 	private final BitSet missing;
// 	private final int num_pieces;
// 	private final String name;
// 	private final long remaining_length;
// 	private final long total_length;
// 	private final long completion_time;
// 	private final double input_rate;
// 	private final double output_rate;
// 
// 	public TorrentInfo(Torrent torrent, BitSet missing, long completion_time,
// 			double input_rate, double output_rate) {
// 
// 		available = torrent.getAvailablePieces();
// 		this.missing = missing;
// 		num_pieces = torrent.numPieces();
// 		name = torrent.getName();
// 		remaining_length = torrent.getRemainingLength();
// 		total_length = torrent.getTotalLength();
// 		this.completion_time = completion_time;
// 		this.input_rate = input_rate;
// 		this.output_rate = output_rate;
// 
// 	}
// 
// 	public BitSet getAvailablePieces() {
// 		return available;
// 	}
// 
// 	public BitSet getMissingPieces() {
// 		return missing;
// 	}
// 
// 	public int numPieces() {
// 		return num_pieces;
// 	}
// 
// 	public String getName() {
// 		return name;
// 	}
// 
// 	public long getRemainingLength() {
// 		return remaining_length;
// 	}
// 
// 	public long getTotalLength() {
// 		return total_length;
// 	}
// 
// 	public long getCompletionTime() {
// 		return completion_time;
// 	}
// 
// 	public double getInputRate() {
// 		return input_rate;
// 	}
// 
// 	public double getOutputRate() {
// 		return output_rate;
// 	}
// 
// }


import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.image.BufferedImage;
import java.util.BitSet;
import javax.swing.JComponent;
import javax.swing.JTable;
import javax.swing.table.TableCellRenderer;
import com.ndtorrent.client.status.PieceInfo;
import com.ndtorrent.client.status.TorrentInfo;
					RenderingHints.VALUE_INTERPOLATION_BILINEAR);
			g2.drawImage(full_image, 0, 0, half_image.getWidth(), 1, null);
			g2.dispose();

			g2 = (Graphics2D) g;
			g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
					RenderingHints.VALUE_INTERPOLATION_BICUBIC);

			g2.drawImage(half_image, 0, 0, width, height, null);

		} else if (width < full_image.getWidth()) {
			Graphics2D g2 = (Graphics2D) g;
			g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
					RenderingHints.VALUE_INTERPOLATION_BILINEAR);

			g2.drawImage(full_image, 0, 0, width, height, null);

		} else {
			g.drawImage(full_image, 0, 0, width, height, null);
		}
	}

	@Override
	public Component getTableCellRendererComponent(JTable table, Object value,
			boolean isSelected, boolean hasFocus, int row, int column) {

		if (value instanceof TorrentInfo) {
			TorrentInfo info = (TorrentInfo) value;
			setBits(info.getAvailablePieces(), info.getMissingPieces(),
					info.numPieces());
// Path: src/com/ndtorrent/client/status/PieceInfo.java
// public final class PieceInfo {
// 
// 	private final int index;
// 	private final int length;
// 	private final int num_blocks;
// 	private final BitSet available;
// 	private final BitSet requested;
// 
// 	public PieceInfo(Piece piece) {
// 		index = piece.getIndex();
// 		length = piece.getLength();
// 		num_blocks = piece.numBlocks();
// 		available = piece.getAvailableBlocks();
// 		requested = (BitSet) piece.getNotRequested().clone();
// 		requested.flip(0, num_blocks);
// 		requested.andNot(available);
// 	}
// 
// 	public int getIndex() {
// 		return index;
// 	}
// 
// 	public int getLength() {
// 		return length;
// 	}
// 
// 	public int numBlocks() {
// 		return num_blocks;
// 	}
// 
// 	public int numAvailableBlocks() {
// 		return available.cardinality();
// 	}
// 
// 	public BitSet getAvailableBlocks() {
// 		return available;
// 	}
// 
// 	public BitSet getRequestedBlocks() {
// 		return requested;
// 	}
// 
// }
// 
// Path: src/com/ndtorrent/client/status/TorrentInfo.java
// public final class TorrentInfo {
// 
// 	private final BitSet available;
// 	private final BitSet missing;
// 	private final int num_pieces;
// 	private final String name;
// 	private final long remaining_length;
// 	private final long total_length;
// 	private final long completion_time;
// 	private final double input_rate;
// 	private final double output_rate;
// 
// 	public TorrentInfo(Torrent torrent, BitSet missing, long completion_time,
// 			double input_rate, double output_rate) {
// 
// 		available = torrent.getAvailablePieces();
// 		this.missing = missing;
// 		num_pieces = torrent.numPieces();
// 		name = torrent.getName();
// 		remaining_length = torrent.getRemainingLength();
// 		total_length = torrent.getTotalLength();
// 		this.completion_time = completion_time;
// 		this.input_rate = input_rate;
// 		this.output_rate = output_rate;
// 
// 	}
// 
// 	public BitSet getAvailablePieces() {
// 		return available;
// 	}
// 
// 	public BitSet getMissingPieces() {
// 		return missing;
// 	}
// 
// 	public int numPieces() {
// 		return num_pieces;
// 	}
// 
// 	public String getName() {
// 		return name;
// 	}
// 
// 	public long getRemainingLength() {
// 		return remaining_length;
// 	}
// 
// 	public long getTotalLength() {
// 		return total_length;
// 	}
// 
// 	public long getCompletionTime() {
// 		return completion_time;
// 	}
// 
// 	public double getInputRate() {
// 		return input_rate;
// 	}
// 
// 	public double getOutputRate() {
// 		return output_rate;
// 	}
// 
// }


// Path: src/com/ndtorrent/gui/BarRenderer.java
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.image.BufferedImage;
import java.util.BitSet;
import javax.swing.JComponent;
import javax.swing.JTable;
import javax.swing.table.TableCellRenderer;
import com.ndtorrent.client.status.PieceInfo;
import com.ndtorrent.client.status.TorrentInfo;

					RenderingHints.VALUE_INTERPOLATION_BILINEAR);
			g2.drawImage(full_image, 0, 0, half_image.getWidth(), 1, null);
			g2.dispose();

			g2 = (Graphics2D) g;
			g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
					RenderingHints.VALUE_INTERPOLATION_BICUBIC);

			g2.drawImage(half_image, 0, 0, width, height, null);

		} else if (width < full_image.getWidth()) {
			Graphics2D g2 = (Graphics2D) g;
			g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
					RenderingHints.VALUE_INTERPOLATION_BILINEAR);

			g2.drawImage(full_image, 0, 0, width, height, null);

		} else {
			g.drawImage(full_image, 0, 0, width, height, null);
		}
	}

	@Override
	public Component getTableCellRendererComponent(JTable table, Object value,
			boolean isSelected, boolean hasFocus, int row, int column) {

		if (value instanceof TorrentInfo) {
			TorrentInfo info = (TorrentInfo) value;
			setBits(info.getAvailablePieces(), info.getMissingPieces(),
					info.numPieces());
		} else if (value instanceof PieceInfo) {