23 package com.realtime.crossfire.jxclient.gui.map;
32 import java.awt.BasicStroke;
33 import java.awt.Color;
34 import java.awt.Graphics;
35 import java.awt.Graphics2D;
36 import java.awt.Shape;
37 import java.awt.Stroke;
38 import java.awt.geom.Line2D;
39 import org.jetbrains.annotations.NotNull;
40 import org.jetbrains.annotations.Nullable;
56 private static final int @NotNull []
DX = {0, 1, 1, 1, 0, -1, -1, -1,};
61 private static final int @NotNull []
DY = {-1, -1, 0, 1, 1, 1, 0, -1,};
91 super.paintComponent(g);
93 final Graphics2D g2 = (Graphics2D)g;
95 final int x0 = getWidth()/2;
96 final int y0 = getHeight()/2;
97 final Stroke s1 =
new BasicStroke(5, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND);
98 final Stroke s2 =
new BasicStroke(3, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND);
101 boolean showRunDirection =
true;
103 final int dx =
DX[direction];
104 final int dy =
DY[direction];
107 final Shape line =
new Line2D.Float(x1, y1, x2, y2);
108 g.setColor(Color.black);
111 g.setColor(Color.green);
116 showRunDirection =
false;
118 if (showRunDirection) {
120 if (direction != -1) {
121 final int dx =
DX[direction];
122 final int dy =
DY[direction];
125 final Shape line =
new Line2D.Float(x1, y1, x2, y2);
126 g.setColor(Color.black);
129 g.setColor(Color.green);