MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / paint

Method paint

ij/src/main/java/ij/plugin/LUT_Editor.java:449–481  ·  view source on GitHub ↗
(Graphics g)

Source from the content-addressed store, hash-verified

447 }
448
449 public void paint(Graphics g) {
450 if (updateLut) {
451 updateLut();
452 updateLut = false;
453 }
454 int index = 0;
455 for (int y=0; y<rows; y++) {
456 for (int x=0; x<columns; x++) {
457 if(index>=mapSize) {
458 g.setColor(Color.lightGray);
459 g.fillRect(x*entryWidth, y*entryHeight, entryWidth, entryHeight);
460 } else if (((index <= finalC) && (index >= initialC)) || ((index >= finalC) && (index <= initialC))){
461 g.setColor(c[index].brighter());
462 g.fillRect(x*entryWidth, y*entryHeight, entryWidth, entryHeight);
463 g.setColor(Color.white);
464 g.drawRect((x*entryWidth), (y*entryHeight), entryWidth, entryHeight);
465 g.setColor(Color.black);
466 g.drawLine((x*entryWidth)+entryWidth-1, (y*entryHeight), (x*entryWidth)+entryWidth-1, (y*entryWidth)+entryHeight);
467 g.drawLine((x*entryWidth), (y*entryHeight)+entryHeight-1, (x*entryWidth)+entryWidth-1, (y*entryHeight)+entryHeight-1);
468 g.setColor(Color.white);
469 } else {
470 g.setColor(c[index]);
471 g.fillRect(x*entryWidth, y*entryHeight, entryWidth, entryHeight);
472 g.setColor(Color.white);
473 g.drawRect((x*entryWidth), (y*entryHeight), entryWidth-1, entryHeight-1);
474 g.setColor(Color.black);
475 g.drawLine((x*entryWidth), (y*entryHeight), (x*entryWidth)+entryWidth-1, (y*entryWidth));
476 g.drawLine((x*entryWidth), (y*entryHeight), (x*entryWidth), (y*entryHeight)+entryHeight-1);
477 }
478 index++;
479 }
480 }
481 }
482
483 int getMapSize() {
484 return mapSize;

Callers 1

updateMethod · 0.95

Calls 5

updateLutMethod · 0.95
fillRectMethod · 0.80
drawRectMethod · 0.80
setColorMethod · 0.65
drawLineMethod · 0.45

Tested by

no test coverage detected