MCPcopy Index your code
hub / github.com/BombusMod/BombusMod / paint

Method paint

src/main/java/ui/VirtualList.java:459–610  ·  view source on GitHub ↗
(Graphics g)

Source from the content-addressed store, hash-verified

457 protected void beginPaint() { }
458
459 public synchronized void paint(Graphics g) {
460 if (messagesWidth == 0) {
461 messagesWidth = getListWidth();
462 }
463 beginPaint();
464 PopUp.getInstance().init(g, width, height);
465
466 //StaticData.getInstance().screenWidth=width;
467
468
469
470 int count = updateLayout();
471
472 setAbsOrg(g, 0, 0);
473
474 setInfo();
475
476 if (paintTop) {
477 if (reverse) {
478 if (infobar != null) {
479 list_top = infobar.getVHeight();
480 drawInfoPanel(g);
481 }
482 } else {
483 if (mainbar != null) {
484 list_top = mainbar.getVHeight();
485 drawMainPanel(g);
486 }
487 }
488 }
489 if (paintBottom) {
490 if (reverse) {
491 if (mainbar != null) {
492 list_bottom = mainbar.getVHeight();
493 }
494 } else {
495 if (infobar != null) {
496 list_bottom = infobar.getVHeight();
497 }
498 }
499 }
500
501 winHeight = height - list_top - list_bottom;
502
503 boolean scroll = (listHeight > winHeight);
504
505 if (count == 0) {
506 cursor = (cursor == -1) ? -1 : 0;
507 win_top = 0;
508 } else if (cursor >= count) {
509 cursor = count - 1;
510 stickyWindow = true;
511 }
512 if (updateLayout() > 0 && stickyWindow) {
513 fitCursorByTop();
514 }
515
516 int itemMaxWidth = (scroll) ? (width - scrollbar.getScrollWidth()) : (width);

Callers

nothing calls this directly

Calls 15

getListWidthMethod · 0.95
beginPaintMethod · 0.95
getInstanceMethod · 0.95
updateLayoutMethod · 0.95
setAbsOrgMethod · 0.95
setInfoMethod · 0.95
getVHeightMethod · 0.95
drawInfoPanelMethod · 0.95
drawMainPanelMethod · 0.95
fitCursorByTopMethod · 0.95
getElementIndexAtMethod · 0.95
getItemRefMethod · 0.95

Tested by

no test coverage detected