Draws a point at the top of a bin. @param drawingPanel @param g @param binNumber @param occurrences
(DrawingPanel drawingPanel, Graphics g, int binNumber, double occurrences)
| 810 | * @param occurrences |
| 811 | */ |
| 812 | protected void drawPoint(DrawingPanel drawingPanel, Graphics g, int binNumber, double occurrences) { |
| 813 | int px = drawingPanel.xToPix(getLeftMostBinPosition(binNumber)); // leftmost position of bin |
| 814 | int py = drawingPanel.yToPix(occurrences); |
| 815 | int pointRadius = 2; |
| 816 | if (discrete) { |
| 817 | g.fillRect(px - pointRadius, py - pointRadius, pointRadius * 2, pointRadius * 2); |
| 818 | } else { // continous, draw entire bin |
| 819 | int px2 = drawingPanel.xToPix(getRightMostBinPosition(binNumber)); |
| 820 | int pWidth = px2 - px; |
| 821 | g.fillRect(px, py, pWidth, pointRadius * 2); |
| 822 | } |
| 823 | } |
| 824 | |
| 825 | /** |
| 826 | * Draws a filled bin. |
no test coverage detected