Examples of QColor


Examples of com.trolltech.qt.gui.QColor

      for(int x = 0; x < cols; x++){
        Tile tile = drawnTiles[y][x];
        TileType tileType = tile.getType();

        // Set pen color based on current tile
        QColor color = TileColors.getSuggestedTileColor(tile);
        painter.setPen(color);
       
        int rectX = x * tileSize;
        int rectY = y * tileSize;
        int rectSide = tileSize - 2 * offset;
 
View Full Code Here

Examples of com.trolltech.qt.gui.QColor

    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")) {
View Full Code Here

Examples of com.trolltech.qt.gui.QColor

  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.QColor

      QPixmap overlayPix = new QPixmap(pix.size());
      overlayPix.fill(QColor.transparent);
      QPainter p2 = new QPainter(overlayPix);
      p2.setBackgroundMode(BGMode.TransparentMode);
      p2.setRenderHint(RenderHint.Antialiasing, true);
    QColor yellow = QColor.yellow;
//    yellow.setAlphaF(0.4);
      p2.setBrush(yellow);
 
    // Get the recognition data from the note
      QDomDocument doc = new QDomDocument();
View Full Code Here

Examples of com.trolltech.qt.gui.QColor

          else
            return null;
        }
        case Qt.ItemDataRole.BackgroundRole: {
          String guid = (String)valueAt(index.row(), Global.noteTableGuidPosition);
        QColor backgroundColor = new QColor(QColor.white);
        if (metaData != null && metaData.containsKey(guid)) {
          int color = metaData.get(guid).getColor();
          backgroundColor.setRgb(color);
        }
          return backgroundColor;
        }
        case Qt.ItemDataRole.ForegroundRole: {
          String guid = (String)valueAt(index.row(), Global.noteTableGuidPosition);
        QColor backgroundColor = new QColor(QColor.white);
        QColor foregroundColor = new QColor(QColor.black);
        if (metaData != null && metaData.containsKey(guid)) {
          int color = metaData.get(guid).getColor();
          backgroundColor.setRgb(color);
          if (backgroundColor.rgb() == QColor.black.rgb() || backgroundColor.rgb() == QColor.blue.rgb())
            foregroundColor.setRgb(QColor.white.rgb());
        }
          return foregroundColor;
        }
        default:
            break;
View Full Code Here

Examples of com.trolltech.qt.gui.QColor

 
  public ColorMenu(QWidget b) {
    menu = new QMenu();
    parent = b;
    populateList();
    currentColor = new QColor("black");
  }
View Full Code Here

Examples of com.trolltech.qt.gui.QColor

  }
   
  private void populateList() {
    List<String> colorNames = QColor.colorNames();
    for(int i=0; i<colorNames.size(); i++) {
      QColor color = new QColor(colorNames.get(i));
      QPixmap pix = new QPixmap(new QSize(22, 22));
      pix.fill(color);
      QAction newAction = new QAction(new QIcon(pix), "", parent);
      newAction.setToolTip(colorNames.get(i));
      newAction.setText(colorNames.get(i));
View Full Code Here

Examples of com.trolltech.qt.gui.QColor

  }
 
  @SuppressWarnings("unused")
  private void itemHovered() {
    if (menu.activeAction() != null && menu.activeAction().toolTip() != null)
      currentColor = new QColor(menu.activeAction().toolTip());
  }
View Full Code Here

Examples of com.trolltech.qt.gui.QColor

  // Listener when a font size is changed
  @SuppressWarnings("unused")
  private void fontColorClicked() {
//    QColorDialog dialog = new QColorDialog();
//    QColor color = QColorDialog.getColor();
    QColor color = fontColorMenu.getColor();
    if (color.isValid())
      browser.page().mainFrame().evaluateJavaScript(
          "document.execCommand('foreColor',false,'" + color.name()
              + "');");
    browser.setFocus();
  }
View Full Code Here

Examples of com.trolltech.qt.gui.QColor

  // Listener for when a background color change is requested
  @SuppressWarnings("unused")
  private void fontHilightClicked() {
//    QColorDialog dialog = new QColorDialog();
//    QColor color = QColorDialog.getColor();
    QColor color = fontHilightColorMenu.getColor();
    if (color.isValid())
      browser.page().mainFrame().evaluateJavaScript(
          "document.execCommand('backColor',false,'" + color.name()
              + "');");
    browser.setFocus();
  }
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.