MCPcopy Create free account
hub / github.com/catabriga/graphwar / paintComponent

Method paintComponent

src/Graphwar/GraphAngleDisplay.java:42–64  ·  view source on GitHub ↗
(Graphics g)

Source from the content-addressed store, hash-verified

40 }
41
42 public void paintComponent(Graphics g)
43 {
44 Player currentPlayer = graphwar.getGameData().getCurrentTurnPlayer();
45 double angle;
46
47 if(graphwar.getGameData().isAngleDown() || graphwar.getGameData().isAngleUp())
48 {
49 angle = graphwar.getGameData().getAngle();
50
51 this.repaint();
52 }
53 else
54 {
55
56 angle = currentPlayer.getCurrentTurnSoldier().getAngle();
57 }
58
59 Graphics2D g2d = (Graphics2D)g;
60 g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
61 g2d.setColor(currentPlayer.getColor());
62 paintCircle(g2d, angle);
63 paintAngleText(g2d, angle);
64 }
65
66 private void paintCircle(Graphics g, double angle)
67 {

Callers

nothing calls this directly

Calls 9

getCurrentTurnSoldierMethod · 0.95
getColorMethod · 0.95
paintCircleMethod · 0.95
paintAngleTextMethod · 0.95
getCurrentTurnPlayerMethod · 0.80
getGameDataMethod · 0.80
isAngleDownMethod · 0.80
isAngleUpMethod · 0.80
getAngleMethod · 0.45

Tested by

no test coverage detected