setBackgroundBrush(new QBrush(QColor.black));
//Create transparent QPixmap that accepts hovers
// so that moveMouseEvent is triggered
QPixmap qpm = new QPixmap(new QSize((numCols + 1) * (tileSize + 1),
(numRows + 1) * (tileSize + 1)));
qpm.fill(new QColor(255, 255,255, 0));
QGraphicsPixmapItem background = addPixmap(qpm);
background.setAcceptsHoverEvents(true);
background.setZValue(-1);
// Draw colored tiles onto QImage
qImage = new QImage(new QSize((numCols + 1) * (tileSize + 1),
(numRows + 1) * (tileSize + 1)), Format.Format_RGB16);
QPainter painter = new QPainter(qImage);
painter.setPen(new QPen(QColor.black, lineWidth));
// Draw lines between tiles
for (int i = 0; i <= numCols; i++) {
painter.drawLine((i) * tileSize, tileSize, (i) * tileSize,
(numRows) * tileSize);
}
for (int j = 0; j <= numRows; j++) {
painter.drawLine(tileSize, (j) * tileSize, (numCols) * tileSize,
(j) * tileSize);
}
for (int i = 0; i < numRows; i++) {
for (int j = 0; j < numCols; j++) {
Tile tile = device.getTile(i, j);
String name = tile.getName();
int hash = name.hashCode();
int idx = name.indexOf("_");
if (idx != -1) {
hash = name.substring(0, idx).hashCode();
}
QColor color = QColor.fromRgb(hash);
if (name.startsWith("DSP")) {
// color = QColor.fromRgb(145, 145, 145);
color = QColor.darkCyan;
} else if (name.startsWith("BRAM")) {