Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

12
LINES

< > BotCompany Repo | #1024317 // drawRecognitionGrid

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (1969L/13K).

1  
svoid drawRecognitionGrid(Graphics2D g, RecognitionGrid grid) {
2  
  if (g == null || grid == null) ret;
3  
  for (int row = 0; row < grid.rows; row++)
4  
    for (int col = 0; col < grid.cols; col++) {
5  
      RecognitionGrid.Cell c = grid.getCell(col, row);
6  
      if (c == null) continue;
7  
      Rect r = grid.cellRect(col, row);
8  
      fillRect(g, r, colorFromRGBA(c.outerColor));
9  
      fillRect(g, shrinkRect(r, iround(r.w/6)), colorFromRGBA(c.middleColor));
10  
      fillRect(g, shrinkRect(r, iround(r.w/3)), colorFromRGBA(c.centerColor));
11  
    }
12  
}

Author comment

Began life as a copy of #1024315

download  show line numbers  debug dex  old transpilations   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1024317
Snippet name: drawRecognitionGrid
Eternal ID of this version: #1024317/4
Text MD5: 5403fdd81e8039e9973f25181a2e3c58
Transpilation MD5: 5c9f716f043ec307e6f9324589ecb9ed
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-08-02 00:05:51
Source code size: 547 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 228 / 311
Version history: 3 change(s)
Referenced in: [show references]