summaryrefslogtreecommitdiffstats
path: root/src/se/liu/gusso230/shapes/DiagramViewer.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/se/liu/gusso230/shapes/DiagramViewer.java')
-rw-r--r--src/se/liu/gusso230/shapes/DiagramViewer.java21
1 files changed, 5 insertions, 16 deletions
diff --git a/src/se/liu/gusso230/shapes/DiagramViewer.java b/src/se/liu/gusso230/shapes/DiagramViewer.java
index 56a63d0..b6f33bd 100644
--- a/src/se/liu/gusso230/shapes/DiagramViewer.java
+++ b/src/se/liu/gusso230/shapes/DiagramViewer.java
@@ -6,15 +6,8 @@ import java.util.List;
import java.util.Random;
public class DiagramViewer {
- private final static List<Color> COLORS = List.of(
- Color.BLACK,
- Color.RED,
- Color.GREEN,
- Color.BLUE,
- Color.CYAN,
- Color.YELLOW,
- Color.MAGENTA
- );
+ private final static List<Color> COLORS =
+ List.of(Color.BLACK, Color.RED, Color.GREEN, Color.BLUE, Color.CYAN, Color.YELLOW, Color.MAGENTA);
private final static Random rnd = new Random(0);
@@ -23,19 +16,15 @@ public class DiagramViewer {
}
private static Circle getRandomCircle() {
- return new Circle(rnd.nextInt(400), rnd.nextInt(400),
- rnd.nextInt(200), getRandomColor());
+ return new Circle(rnd.nextInt(400), rnd.nextInt(400), rnd.nextInt(200), getRandomColor());
}
private static Rectangle getRandomRectangle() {
- return new Rectangle(rnd.nextInt(400), rnd.nextInt(400),
- rnd.nextInt(200), rnd.nextInt(200),
- getRandomColor());
+ return new Rectangle(rnd.nextInt(400), rnd.nextInt(400), rnd.nextInt(200), rnd.nextInt(200), getRandomColor());
}
private static Text getRandomText() {
- return new Text(rnd.nextInt(400), rnd.nextInt(400),
- 16, getRandomColor(), "hello");
+ return new Text(rnd.nextInt(400), rnd.nextInt(400), 16, getRandomColor(), "hello");
}
public static void main(String[] args) {