Browse Source

statisticgraph color fix

Kevin Trometer 7 years ago
parent
commit
80199a3a77
2 changed files with 3 additions and 2 deletions
  1. 2 2
      src/ui/view/HolonCanvas.java
  2. 1 0
      src/ui/view/StatisticGraph.java

+ 2 - 2
src/ui/view/HolonCanvas.java

@@ -83,8 +83,8 @@ public class HolonCanvas extends JPanel implements ActionListener {
 		// the central mass
 		bodies.add(0, new HolonBody(center.width, center.height, 0, 0, 1e6 * solarmass, new Color(0, 0, 0)));
 		for (int i = 0; i < N - 1; i++) {
-			int px = (int) (Math.random() * 201);
-			int py = (int) (Math.random() * 201);
+			int px = (int) (Math.random() * this.getWidth());
+			int py = (int) (Math.random() * this.getHeight());
 
 			double mass = (subnets.get(i).getObjects().size()) / 10 * solarmass * 10 + 1e20;
 			Color color = model.getSubNetColors().get(i);

+ 1 - 0
src/ui/view/StatisticGraph.java

@@ -120,6 +120,7 @@ public class StatisticGraph extends JPanel {
 				default:
 					break;
 				}
+				g2.setColor(set.getColor());
 				g2.draw(path);
 
 			}