mirror of
https://github.com/jneug/zeichenmaschine.git
synced 2026-10-12 01:45:18 +02:00
Formatierung und Doku
This commit is contained in:
@@ -466,10 +466,27 @@ public class DrawingLayer extends Layer implements Strokeable, Fillable {
|
|||||||
rect(x, y, w, w, anchor);
|
rect(x, y, w, w, anchor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Zeichnet ein Rechteck in die Zeichenebene.
|
||||||
|
*
|
||||||
|
* @param x x-Koordinate des Rechtecks.
|
||||||
|
* @param y y-Koordinate des Rechtecks.
|
||||||
|
* @param w Breite des Rechtecks.
|
||||||
|
* @param h Höhe des Rechtecks.
|
||||||
|
*/
|
||||||
public void rect( double x, double y, double w, double h ) {
|
public void rect( double x, double y, double w, double h ) {
|
||||||
rect(x, y, w, h, shapeDelegate.getAnchor());
|
rect(x, y, w, h, shapeDelegate.getAnchor());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Zeichnet ein Rechteck mit in die Zeichenebene.
|
||||||
|
*
|
||||||
|
* @param x x-Koordinate des Rechtecks.
|
||||||
|
* @param y y-Koordinate des Rechtecks.
|
||||||
|
* @param w Breite des Rechtecks.
|
||||||
|
* @param h Höhe des Rechtecks.
|
||||||
|
* @param anchor Ankerpunkt de Rechtecks.
|
||||||
|
*/
|
||||||
public void rect( double x, double y, double w, double h, Options.Direction anchor ) {
|
public void rect( double x, double y, double w, double h, Options.Direction anchor ) {
|
||||||
Point2D.Double anchorPoint = this.getOriginPoint(x, y, w, h, anchor);
|
Point2D.Double anchorPoint = this.getOriginPoint(x, y, w, h, anchor);
|
||||||
rect.setRect(anchorPoint.getX(), anchorPoint.getY(), w, h);
|
rect.setRect(anchorPoint.getX(), anchorPoint.getY(), w, h);
|
||||||
@@ -477,6 +494,42 @@ public class DrawingLayer extends Layer implements Strokeable, Fillable {
|
|||||||
drawShape(rect);
|
drawShape(rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Zeichnet ein Rechteck mit abgerundeten Ecken in die Zeichenebene.
|
||||||
|
* <p>
|
||||||
|
* Jede Ecke wird als Viertelkreis eines Kreises mit dem Radius
|
||||||
|
* {@code radius} gezeichnet.
|
||||||
|
*
|
||||||
|
* @param x x-Koordinate des Rechtecks.
|
||||||
|
* @param y y-Koordinate des Rechtecks.
|
||||||
|
* @param w Breite des Rechtecks.
|
||||||
|
* @param h Höhe des Rechtecks.
|
||||||
|
* @param radius Radius der Eckenkreise.
|
||||||
|
*/
|
||||||
|
public void roundedRect( double x, double y, double w, double h, double radius ) {
|
||||||
|
roundedRect(x, y, w, h, radius, shapeDelegate.getAnchor());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Zeichnet ein Rechteck mit abgerundeten Ecken in die Zeichenebene.
|
||||||
|
* <p>
|
||||||
|
* Jede Ecke wird als Viertelkreis eines Kreises mit dem Radius
|
||||||
|
* {@code radius} gezeichnet.
|
||||||
|
*
|
||||||
|
* @param x x-Koordinate des Rechtecks.
|
||||||
|
* @param y y-Koordinate des Rechtecks.
|
||||||
|
* @param w Breite des Rechtecks.
|
||||||
|
* @param h Höhe des Rechtecks.
|
||||||
|
* @param radius Radius der Eckenkreise.
|
||||||
|
* @param anchor Ankerpunkt de Rechtecks.
|
||||||
|
*/
|
||||||
|
public void roundedRect( double x, double y, double w, double h, double radius, Options.Direction anchor ) {
|
||||||
|
Point2D.Double anchorPoint = this.getOriginPoint(x, y, w, h, anchor);
|
||||||
|
Shape rect = new RoundRectangle2D.Double(anchorPoint.getX(), anchorPoint.getY(), w, h, radius, radius);
|
||||||
|
fillShape(rect);
|
||||||
|
drawShape(rect);
|
||||||
|
}
|
||||||
|
|
||||||
public void point( double x, double y ) {
|
public void point( double x, double y ) {
|
||||||
ellipse(x - 1, y - 1, 2, 2, shapeDelegate.getAnchor());
|
ellipse(x - 1, y - 1, 2, 2, shapeDelegate.getAnchor());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user