GraphicsApp API
Eine überarbeitete und angepasste Variante der originalen GraphicsApp-Umgebung
|
Öffentliche Methoden | |
Line (float startX, float startY, float endX, float endY, Color color) | |
Line (float startX, float startY, float endX, float endY, Color color, float lineWidth) | |
Line (Point start, Point end, Color color) | |
Line (Point start, Point end, Color color, float lineWidth) | |
float | getLineWidth () |
void | setLineWidth (float lineWidth) |
float | getLength () |
float | getStartpointX () |
float | getStartpointY () |
float | getEndpointX () |
float | getEndpointY () |
void | setStartPoint (float xStartPoint, float yStartPoint) |
void | setStartPoint (Point start) |
void | setEndPoint (float xEndPoint, float yEndPoint) |
void | setEndPoint (Point end) |
void | setColor (Color newColor) |
void | move (float dx, float dy) |
void | setPosition (float x, float y) |
void | setPosition (Point p) |
void | setStartAndEndPoint (float toStartPointX, float toStartPointY, float toEndPointX, float toEndPointY) |
float | getRightBorder () |
float | getLeftBorder () |
float | getTopBorder () |
float | getBottomBorder () |
![]() | |
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) |
float | getWidth () |
float | getHeight () |
void | setWidth (float width) |
void | setHeight (float height) |
Color | getColor () |
void | setBorderColor (Color color) |
void | setBorderWeight (float weight) |
void | setBorder (Color color, float weight) |
float | getBorderWeight () |
Color | getBorderColor () |
GraphicsObjectType | getType () |
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 Klasse Line ist ein grafisches Objekt, das eine Linie darstellt.
de.ur.mi.oop.graphics.Line.Line | ( | float | startX, |
float | startY, | ||
float | endX, | ||
float | endY, | ||
Color | color | ||
) |
Konstruiert eine neue Linie von startX und startY nach endX und endY.
startX | Die x-Position des ersten Punktes |
startY | Die y-Position des ersten Punktes |
endX | Die x-Position des Endpunktes |
endY | Die y-Position des Endpunktes |
color | Die Strichfarbe für die Linie |
de.ur.mi.oop.graphics.Line.Line | ( | float | startX, |
float | startY, | ||
float | endX, | ||
float | endY, | ||
Color | color, | ||
float | lineWidth | ||
) |
Konstruiert eine neue Linie von startX und startY nach endX und endY.
startX | Die x-Position des ersten Punktes |
startY | Die y-Position des ersten Punktes |
endX | Die x-Position des Endpunktes |
endY | Die y-Position des Endpunktes |
color | Die Strichfarbe für die Linie |
lineWidth | Die Strichstärke |
float de.ur.mi.oop.graphics.Line.getBottomBorder | ( | ) |
Liefert den unteren Rand des Objekts.
Erneute Implementation von de.ur.mi.oop.graphics.GraphicsObject.
float de.ur.mi.oop.graphics.Line.getLeftBorder | ( | ) |
Liefert den linken Rand des Objekts.
Erneute Implementation von de.ur.mi.oop.graphics.GraphicsObject.
float de.ur.mi.oop.graphics.Line.getLength | ( | ) |
float de.ur.mi.oop.graphics.Line.getRightBorder | ( | ) |
Liefert den rechten Rand des Objekts.
Erneute Implementation von de.ur.mi.oop.graphics.GraphicsObject.
float de.ur.mi.oop.graphics.Line.getTopBorder | ( | ) |
Liefert den oberen Rand des Objekts.
Erneute Implementation von de.ur.mi.oop.graphics.GraphicsObject.
void de.ur.mi.oop.graphics.Line.move | ( | float | dx, |
float | dy | ||
) |
Bewegt das Objekt auf dem Bildschirm mit den Verschiebungen dx und dy.
dx | Die horizontale Änderung der Position |
dy | Die vertikale Änderung der Position |
Erneute Implementation von de.ur.mi.oop.graphics.GraphicsObject.
void de.ur.mi.oop.graphics.Line.setColor | ( | Color | color | ) |
Setzt die Hintergrundfarbe des Objekts
color | die neue Hintergrundfarbe |
Erneute Implementation von de.ur.mi.oop.graphics.GraphicsObject.
void de.ur.mi.oop.graphics.Line.setEndPoint | ( | float | xEndPoint, |
float | yEndPoint | ||
) |
void de.ur.mi.oop.graphics.Line.setEndPoint | ( | Point | end | ) |
void de.ur.mi.oop.graphics.Line.setLineWidth | ( | float | lineWidth | ) |
void de.ur.mi.oop.graphics.Line.setPosition | ( | float | xPos, |
float | yPos | ||
) |
Setzt die Position des Objekts, gegeben durch xPos und yPos
xPos | Die neue x-Koordinate |
yPos | Die neue y-Koordinate |
Erneute Implementation von de.ur.mi.oop.graphics.GraphicsObject.
void de.ur.mi.oop.graphics.Line.setStartAndEndPoint | ( | float | toStartPointX, |
float | toStartPointY, | ||
float | toEndPointX, | ||
float | toEndPointY | ||
) |
void de.ur.mi.oop.graphics.Line.setStartPoint | ( | float | xStartPoint, |
float | yStartPoint | ||
) |
void de.ur.mi.oop.graphics.Line.setStartPoint | ( | Point | start | ) |