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

Method paintComponent

src/Graphwar/PlayerBoard.java:137–159  ·  view source on GitHub ↗
(Graphics g)

Source from the content-addressed store, hash-verified

135 }
136
137 public void paintComponent(Graphics g)
138 {
139 if(this.player.getReady() == false)
140 {
141 g.setColor(Color.WHITE);
142 }
143 else
144 {
145 g.setColor(Color.GREEN);
146 }
147 g.fillRect(0, 0, this.getWidth()-1, this.getHeight()-1);
148
149 g.setColor(Color.BLACK);
150 g.drawRect(0, 0, this.getWidth()-1, this.getHeight()-1);
151
152 BufferedImage nameChopper = new BufferedImage(maxNameLength, this.getHeight(), BufferedImage.TYPE_4BYTE_ABGR);
153 Graphics2D c = nameChopper.createGraphics();
154 c.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
155 c.setFont(new Font("Sans", Font.PLAIN, 14));
156 c.setColor(Color.BLACK);
157 c.drawString(player.getName(), 1, this.getHeight()-2);
158 g.drawImage(nameChopper, 0, 0, null);
159 }
160
161 private boolean isAddSoldier(Object obj)
162 {

Callers

nothing calls this directly

Calls 2

getReadyMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected