MCPcopy Create free account
hub / github.com/OpenSourcePhysics/osp / paintComponent

Method paintComponent

src/test/Test_Video.java:444–453  ·  view source on GitHub ↗
(Graphics g)

Source from the content-addressed store, hash-verified

442
443 drawLayer = new JPanel() {
444 @Override
445 public void paintComponent(Graphics g) {
446 super.paintComponent(g); // takes care of the background clearing
447 g.setColor(Color.red);
448 for (int i = 0, n = points.size(); i < n; i++) {
449 Point p = points.get(i);
450 g.drawLine(p.x - 5, p.y, p.x + 5, p.y);
451 g.drawLine(p.x, p.y - 5, p.x, p.y + 5);
452 }
453 }
454 };
455 drawLayer.setBounds(0, 0, dim.width, dim.height);
456 drawLayer.setOpaque(false);

Callers

nothing calls this directly

Calls 3

drawLineMethod · 0.80
getMethod · 0.65
setColorMethod · 0.45

Tested by

no test coverage detected