MCPcopy Create free account
hub / github.com/BombusMod/BombusMod / drawItem

Method drawItem

src/main/java/ui/controls/form/TrackItem.java:56–71  ·  view source on GitHub ↗
(Graphics g, int ofs, boolean sel)

Source from the content-addressed store, hash-verified

54 public int getValue() { return value; }
55
56 public void drawItem(Graphics g, int ofs, boolean sel) {
57 int width=g.getClipWidth();
58 int height=g.getClipHeight();
59
60 int itemWidth=6;
61 int pos=((width-itemWidth)*value)/(steps-1);
62
63 int oldColor=g.getColor();
64
65 g.setColor(ColorTheme.getColor(ColorTheme.CONTROL_ITEM));
66 g.drawLine(4, height/2, width-4, height/2);
67
68 g.fillRect(pos, 2, itemWidth, height-4);
69
70 g.setColor(oldColor);
71 }
72
73 public void onSelect(){ value=(value+1)%steps; }
74

Callers

nothing calls this directly

Calls 7

getColorMethod · 0.95
getColorMethod · 0.65
getClipWidthMethod · 0.45
getClipHeightMethod · 0.45
setColorMethod · 0.45
drawLineMethod · 0.45
fillRectMethod · 0.45

Tested by

no test coverage detected