Skip to content
Snippets Groups Projects
Commit 8b2e3f0c authored by Huber-Saffer, Lasse's avatar Huber-Saffer, Lasse :desktop:
Browse files

Fixed undefined ordering of the Turtle color array to conform to docs of setzeFarbe(int)

parent ec82c465
No related branches found
No related tags found
2 merge requests!3Remove redundant colors and method to get colors,!1Fixed undefined ordering of the Turtle color array to conform to docs of setzeFarbe(int)
This commit is part of merge request !1. Comments created here will be created in the context of that merge request.
......@@ -11,7 +11,7 @@ import java.awt.image.BufferedImage;
import javax.swing.JFrame;
import javax.swing.JPanel;
import java.util.HashMap;
import java.util.LinkedHashMap;
/**
* Diese Klasse definiert Turtles, die mit einfachen
......@@ -31,7 +31,8 @@ import java.util.HashMap;
* @author Axel Schmolitzky
* @author Fredrik Winkler
* @author Clara Marie Lueders
* @version 5. Dezember 2018
* @author Lasse Huber-Saffer
* @version 25. Januar 2022
*/
public class Turtle
{
......@@ -52,12 +53,12 @@ public class Turtle
private int _verzoegerung;
// Moegliche Farbwerte
private static final HashMap<String, Color> FARBEN;
private static final LinkedHashMap<String, Color> FARBEN;
private static final Color[] FARB_ARRAY;
static
{
FARBEN = new HashMap<String, Color>();
FARBEN = new LinkedHashMap<String, Color>();
FARBEN.put("schwarz", Color.BLACK);
FARBEN.put("blau", Color.BLUE);
FARBEN.put("cyan", Color.CYAN);
......@@ -298,8 +299,7 @@ class TurtleWelt
BufferedImage image = new BufferedImage(WIDTH, HEIGHT, BufferedImage.TYPE_INT_RGB);
_graphics = image.createGraphics();
_graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
_graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
_graphics.setColor(Color.WHITE);
_graphics.fillRect(0, 0, WIDTH, HEIGHT);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment