(Graphics g, boolean reversed)
| 301 | } |
| 302 | |
| 303 | private void drawFunctionImage(Graphics g, boolean reversed) |
| 304 | { |
| 305 | int numDrawSteps = graphwar.getGameData().getCurrentFunctionPosition(); |
| 306 | |
| 307 | GeneralPath path = new GeneralPath(); |
| 308 | |
| 309 | Graphics2D g2d = (Graphics2D)g; |
| 310 | g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
| 311 | |
| 312 | Color playerColor = graphwar.getGameData().getCurrentTurnPlayer().getColor(); |
| 313 | g2d.setColor(playerColor); |
| 314 | //g2d.setStroke(new BasicStroke(1.0f)); |
| 315 | |
| 316 | Function function = graphwar.getGameData().getFunction(); |
| 317 | |
| 318 | double x = convertX(function.getX(lastStepDrawn)); |
| 319 | double y = convertY(function.getY(lastStepDrawn)); |
| 320 | |
| 321 | if(reversed) |
| 322 | { |
| 323 | x = Constants.PLANE_LENGTH-x; |
| 324 | } |
| 325 | |
| 326 | path.moveTo(x,y); |
| 327 | |
| 328 | for(int i=lastStepDrawn; i<numDrawSteps; i++) |
| 329 | { |
| 330 | x = convertX(function.getX(i)); |
| 331 | y = convertY(function.getY(i)); |
| 332 | |
| 333 | if(reversed) |
| 334 | { |
| 335 | x = Constants.PLANE_LENGTH-x; |
| 336 | } |
| 337 | |
| 338 | path.lineTo(x,y); |
| 339 | //path.curve |
| 340 | } |
| 341 | lastStepDrawn = numDrawSteps-1; |
| 342 | |
| 343 | if(lastStepDrawn < 0) |
| 344 | { |
| 345 | lastStepDrawn = 0; |
| 346 | } |
| 347 | |
| 348 | g2d.draw(path); |
| 349 | |
| 350 | } |
| 351 | |
| 352 | private void drawFunction(Graphics g, boolean terrainReversed) |
| 353 | { |
no test coverage detected