Examples of QBrush


Examples of com.trolltech.qt.gui.QBrush

      }
    }
  }
 
  private void drawFPGAFabric(boolean drawPrimitives){
    setBackgroundBrush(new QBrush(QColor.black));
   
    //Create transparent QPixmap that accepts hovers
    //  so that moveMouseEvent is triggered
    QPixmap pixelMap = new QPixmap(sceneSize);
    pixelMap.fill(QColor.transparent);
View Full Code Here

Examples of com.trolltech.qt.gui.QBrush

    painter.drawRect(rectX + rectSide / 6, rectY, 4 * rectSide / 6 - 1, rectSide - 1);
  }
 
  private void colorTile(QPainter painter, int x, int y, int offset, QColor color){
    painter.fillRect(x * tileSize, y * tileSize,
        tileSize - 2 * offset, tileSize - 2 * offset, new QBrush(color));
  }
View Full Code Here

Examples of com.trolltech.qt.gui.QBrush

      case VALID:
        this.setPen(new QPen(GREEN));
        if(isAnchor)
          this.setBrush(ANCHOR_GREEN);
        else
          this.setBrush(new QBrush(GREEN));
        break;
      case COLLIDING:
        this.setPen(new QPen(ORANGE));
        if(isAnchor)
          this.setBrush(ANCHOR_ORANGE);
        else
          this.setBrush(new QBrush(ORANGE));
        break;
      case INVALID:
        this.setPen(new QPen(RED));
        if(isAnchor)
          this.setBrush(ANCHOR_RED);
        else
          this.setBrush(new QBrush(RED));
        break;
      default:
        break;
    }
  }
View Full Code Here

Examples of com.trolltech.qt.gui.QBrush

  }

  private void addHMTile(Tile tile, int tileX, int tileY, boolean hasSLICEM, boolean isAnchor) {
    HMTile hmTile = new HMTile(tile, scene, this, hasSLICEM, isAnchor);
    hmTile.moveBy(tileX * scene.tileSize, tileY * scene.tileSize);
    hmTile.setBrush(new QBrush(QColor.white));
    hmTiles.add(hmTile);

  }
View Full Code Here

Examples of com.trolltech.qt.gui.QBrush

  }
  public void showGuts(){
    for (HMTile hmTile : this.hmTiles) {
      hmTile.show();
    }
    this.setBrush(new QBrush(QColor.transparent));
    checkPlacement();
  }
View Full Code Here

Examples of com.trolltech.qt.gui.QBrush

  public void setState(GuiShapeState newState){
    switch (newState) {
      case VALID:
        this.setPen(new QPen(HMTile.GREEN));
        if(gutsHidden)
          this.setBrush(new QBrush(HMTile.GREEN));
        else
          this.setBrush(new QBrush(QColor.transparent));
        break;
      case COLLIDING:
        this.setPen(new QPen(HMTile.ORANGE));
        if(gutsHidden)
          this.setBrush(new QBrush(HMTile.ORANGE));
        else
          this.setBrush(new QBrush(QColor.transparent));
        break;
      case INVALID:
        this.setPen(new QPen(HMTile.RED));
        if(gutsHidden)
          this.setBrush(new QBrush(HMTile.RED));
        else
          this.setBrush(new QBrush(QColor.transparent));
        break;
      default:
        break;
    }
  }
View Full Code Here

Examples of com.trolltech.qt.gui.QBrush

    drawSliceBackground();
  }

  private void drawSliceBackground() {

    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")) {
          // color = QColor.fromRgb(165, 165, 165);
          color = QColor.darkMagenta;
        } else if (name.startsWith("INT")) {
          // color = QColor.fromRgb(125, 125, 125);
          color = QColor.darkYellow;
        } else if (name.startsWith("CLB")) {
          color = QColor.blue;
          // color = QColor.fromRgb(185, 185, 185);
        } else if (name.startsWith("DCM")) {
          // color = QColor.fromRgb(205, 205, 205);
        } else if (name.startsWith("EMPTY")) {
          // color = QColor.white;
        } else {
          // color = QColor.black;
        }

        painter.fillRect(j * tileSize, i * tileSize, tileSize - 2, tileSize - 2, new QBrush(color));
      }
    }

    painter.end();
   
View Full Code Here

Examples of com.trolltech.qt.gui.QBrush

  private void drawReachability(HashMap<Tile, Integer> map){
    menuReachabilityClear();
    for(Tile t : map.keySet()){
      int color = map.get(t)*16 > 255 ? 255 : map.get(t)*16;
      NumberedHighlightedTile tile = new NumberedHighlightedTile(t, this, map.get(t));
      tile.setBrush(new QBrush(new QColor(0, color, 0)));
      currentTiles.add(tile);
    }
  }
View Full Code Here

Examples of com.trolltech.qt.gui.QBrush

  }

  @Override
  protected void highlightBlock(String text) {
    QTextCharFormat format = new QTextCharFormat();
    QBrush brush = new QBrush(QColor.blue, Qt.BrushStyle.SolidPattern);
    format.setForeground(brush);
    format.setFontWeight(QFont.Weight.Bold.value());
   
    int index = text.indexOf("<");
    while (index >= 0) {
View Full Code Here

Examples of com.trolltech.qt.gui.QBrush

    flags.set(MatchFlag.MatchWildcard);
    flags.set(MatchFlag.MatchRecursive);
//    List<QTreeWidgetItem> children = new ArrayList<QTreeWidgetItem>();
    List <QTreeWidgetItem>  children = findItems("*", flags);
   
    QBrush black = new QBrush();
    black.setColor(QColor.black);
    QBrush blue = new QBrush();
    blue.setColor(QColor.blue);
    if (!Global.tagBehavior().equalsIgnoreCase("ColorActive"))
      blue.setColor(QColor.black);
   
    for (int i=0; i<children.size(); i++) {
      children.get(i).setText(1,"0");
      children.get(i).setForeground(0, black);     
      children.get(i).setForeground(1, black);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.