gc.setLineStyle(SWT.LINE_SOLID);
}
gc.setLineWidth(1);
CoordinateTransform t = new CoordinateTransform(rect);
t.shiftExternal(rect.width,0);
t.scale(-1.0, 1.0);
String[] boxContent = new String[] {
MessageText.getString("PiecesView.DistributionView.NoAvl"),
MessageText.getString("PiecesView.DistributionView.SeedAvl"),
MessageText.getString("PiecesView.DistributionView.PeerAvl"),
MessageText.getString("PiecesView.DistributionView.RarestAvl",new String[] {globalPiecesPerAvailability[minAvail]+"",minAvail+""}),
MessageText.getString("PiecesView.DistributionView."+ (isMe? "weHave" : "theyHave")),
MessageText.getString("PiecesView.DistributionView.weDownload")
};
int charWidth = gc.getFontMetrics().getAverageCharWidth();
int charHeight = gc.getFontMetrics().getHeight();
int maxBoxOffsetY = charHeight + 2;
int maxBoxWidth = 0;
int maxBoxOffsetX = 0;
for (int i = 0; i < boxContent.length; i++)
maxBoxWidth = Math.max(maxBoxWidth, boxContent[i].length());
maxBoxOffsetX = (maxBoxWidth+5) * charWidth;
maxBoxWidth = ++maxBoxWidth * charWidth;
int boxNum = 1;
gc.setForeground(Colors.colorError);
gc.setBackground(Colors.background);
gc.drawRectangle(t.x(maxBoxOffsetX),t.y(maxBoxOffsetY*boxNum),maxBoxWidth,charHeight);
gc.drawString(boxContent[boxNum-1],t.x(maxBoxOffsetX-5),t.y(maxBoxOffsetY*boxNum),true);
boxNum++;
gc.setForeground(Colors.green);
gc.setBackground(Colors.background);
gc.drawRectangle(t.x(maxBoxOffsetX),t.y(maxBoxOffsetY*boxNum),maxBoxWidth,charHeight);
gc.drawString(boxContent[boxNum-1],t.x(maxBoxOffsetX-5),t.y(maxBoxOffsetY*boxNum),true);
boxNum++;
gc.setForeground(Colors.blues[Colors.BLUES_DARKEST]);
gc.drawRectangle(t.x(maxBoxOffsetX),t.y(maxBoxOffsetY*boxNum),maxBoxWidth,charHeight);
gc.drawString(boxContent[boxNum-1],t.x(maxBoxOffsetX-5),t.y(maxBoxOffsetY*boxNum),true);
boxNum++;
gc.setForeground(Colors.blue);
gc.drawRectangle(t.x(maxBoxOffsetX),t.y(maxBoxOffsetY*boxNum),maxBoxWidth,charHeight);
gc.drawString(boxContent[boxNum-1],t.x(maxBoxOffsetX-5),t.y(maxBoxOffsetY*boxNum),true);
boxNum++;
gc.setForeground(Colors.black);
gc.setBackground(Colors.black);
gc.drawRectangle(t.x(maxBoxOffsetX),t.y(maxBoxOffsetY*boxNum),maxBoxWidth,charHeight);
gc.fillRectangle(t.x(maxBoxOffsetX),t.y(maxBoxOffsetY*boxNum),maxBoxWidth/2,charHeight);
gc.setForeground(Colors.grey);
gc.setBackground(Colors.background);
gc.drawString(boxContent[boxNum-1],t.x(maxBoxOffsetX-5),t.y(maxBoxOffsetY*boxNum),true);
if(isMe)
{
boxNum++;
gc.setForeground(Colors.black);
gc.setLineStyle(SWT.LINE_DASH);
gc.drawRectangle(t.x(maxBoxOffsetX),t.y(maxBoxOffsetY*boxNum),maxBoxWidth,charHeight);
gc.drawString(boxContent[boxNum-1],t.x(maxBoxOffsetX-5),t.y(maxBoxOffsetY*boxNum),true);
}
gc.setLineStyle(SWT.LINE_SOLID);
} finally