Bekijk de onderstaande video om te zien hoe je onze site als een web app op je startscherm installeert.
Opmerking: Deze functie is mogelijk niet beschikbaar in sommige browsers.
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Polygon;
import java.awt.Shape;
import java.awt.geom.AffineTransform;
public class Arrow {
private static final Color color = Color.GREEN;
private static final Color color2 = Color.BLACK;
private double angle;
private int radius;
private int centerX;
private int centerY;
private Shape arrow;
private AffineTransform af;
public Arrow(int radius, int centerX, int centerY, int angle) {
this.radius = radius;
this.angle = angle+90;
this.centerX = centerX;
this.centerY = centerY;
initialize();
}
private void initialize() {
final int corners = 6;
int x[] = new int[corners];
int y[] = new int[corners];
x[0] = centerX;
y[0] = centerY;
x[1] = centerX - radius + 10;
y[1] = centerY + 12;
x[2] = centerX - radius + 10;
y[2] = centerY + 6;
x[3] = centerX - radius + 5;
y[3] = centerY;
x[4] = centerX - radius + 10;
y[4] = centerY - 6;
x[5] = centerX - radius + 10;
y[5] = centerY - 12;
arrow = new Polygon(x,y,corners);
}
public void display(Graphics g) {
Graphics2D g2 = (Graphics2D)g;
g.setColor(color);
af = AffineTransform.getRotateInstance(Math.toRadians(angle),centerX,centerY);
g2.fill(af.createTransformedShape(arrow));
g.setColor(color2);
g2.draw(af.createTransformedShape(arrow));
}
We gebruiken essentiële cookies om deze site te laten werken, en optionele cookies om de ervaring te verbeteren.