GraphicsApp API
Eine überarbeitete und angepasste Variante der originalen GraphicsApp-Umgebung
|
Öffentliche Methoden | |
Rectangle (float x, float y, float width, float height, Color color) | |
Rectangle (float x, float y, float width, float height) | |
![]() | |
GraphicsObject (float x, float y, Color color) | |
GraphicsObject (float x, float y) | |
GraphicsObject (float x, float y, float width, float height, Color color) | |
GraphicsObject (float x, float y, float width, float height, Color color, Color borderColor) | |
GraphicsObject (Point point) | |
void | draw () |
float | getXPos () |
void | setXPos (float xPos) |
float | getYPos () |
void | setYPos (float yPos) |
void | setPosition (float xPos, float yPos) |
float | getWidth () |
float | getHeight () |
void | setWidth (float width) |
void | setHeight (float height) |
float | getTopBorder () |
float | getBottomBorder () |
float | getLeftBorder () |
float | getRightBorder () |
Color | getColor () |
void | setColor (Color color) |
void | setBorderColor (Color color) |
void | setBorderWeight (float weight) |
void | setBorder (Color color, float weight) |
float | getBorderWeight () |
Color | getBorderColor () |
GraphicsObjectType | getType () |
void | move (float dx, float dy) |
boolean | hitTest (float x, float y) |
double | distanceTo (GraphicsObject object) |
Weitere Geerbte Elemente | |
![]() | |
float | strokeWeight |
GraphicsObjectType | type |
![]() | |
static final Color | DEFAULT_COLOR = Colors.RED |
static final Color | DEFAULT_BORDER_COLOR = Colors.BLACK |
Die Rectangle-Klasse ist ein grafisches Objekt, das ein Rechteck darstellt.
Definiert in Zeile 8 der Datei Rectangle.java.
de.ur.mi.oop.graphics.Rectangle.Rectangle | ( | float | x, |
float | y, | ||
float | width, | ||
float | height, | ||
Color | color | ||
) |
Konstruiert ein neues Rechteck mit der angegebenen Breite, Höhe, und Farbe, das an den Koordinaten x und y positioniert ist.
x | Die x-Position der linken oberen Ecke des Rechtecks. |
y | Die y-Position der linken oberen Ecke des Rechtecks. |
width | Die Breite des Rechtecks in Pixel |
height | Die Höhe des Rechtecks in Pixel |
color | Die Hintergrundfarbe für das Rechteck |
Definiert in Zeile 20 der Datei Rectangle.java.
de.ur.mi.oop.graphics.Rectangle.Rectangle | ( | float | x, |
float | y, | ||
float | width, | ||
float | height | ||
) |
Konstruiert ein neues Rechteck mit der angegebenen Breite, Höhe, das an den Koordinaten x und y positioniert ist.
x | Die x-Position der linken oberen Ecke des Rechtecks. |
y | Die y-Position der linken oberen Ecke des Rechtecks. |
width | Die Breite des Rechtecks in Pixel |
height | Die Höhe des Rechtecks in Pixel |
Definiert in Zeile 36 der Datei Rectangle.java.