GraphicsApp API
Eine überarbeitete und angepasste Variante der originalen GraphicsApp-Umgebung
Rectangle.java
gehe zur Dokumentation dieser Datei
1package de.ur.mi.oop.graphics;
2
3import de.ur.mi.oop.colors.Color;
4
5/**
6 * Die Rectangle-Klasse ist ein grafisches Objekt, das ein Rechteck darstellt.
7 */
8public class Rectangle extends GraphicsObject {
9
10 /**
11 * Konstruiert ein neues Rechteck mit der angegebenen Breite, Höhe, und Farbe,
12 * das an den Koordinaten x und y positioniert ist.
13 *
14 * @param x Die x-Position der linken oberen Ecke des Rechtecks.
15 * @param y Die y-Position der linken oberen Ecke des Rechtecks.
16 * @param width Die Breite des Rechtecks in Pixel
17 * @param height Die Höhe des Rechtecks in Pixel
18 * @param color Die Hintergrundfarbe für das Rechteck
19 */
20 public Rectangle(float x, float y, float width, float height, Color color) {
21 super(x, y, color);
22 super.setWidth(width);
23 setHeight(height);
25 }
26
27 /**
28 * Konstruiert ein neues Rechteck mit der angegebenen Breite, Höhe,
29 * das an den Koordinaten x und y positioniert ist.
30 *
31 * @param x Die x-Position der linken oberen Ecke des Rechtecks.
32 * @param y Die y-Position der linken oberen Ecke des Rechtecks.
33 * @param width Die Breite des Rechtecks in Pixel
34 * @param height Die Höhe des Rechtecks in Pixel
35 */
36 public Rectangle(float x, float y, float width, float height) {
37 super(x, y);
38 setWidth(width);
39 setHeight(height);
41 }
42}
Rectangle(float x, float y, float width, float height, Color color)
Definition: Rectangle.java:20
Rectangle(float x, float y, float width, float height)
Definition: Rectangle.java:36