Base java event POC

This commit is contained in:
2019-03-19 21:17:08 +01:00
parent 95cb82d419
commit 51885d8c53
16 changed files with 587 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
package ovh.gasser.newshapes.shapes;
import ovh.gasser.newshapes.attributes.ColorAttributes;
import ovh.gasser.newshapes.attributes.SelectionAttributes;
import ovh.gasser.newshapes.ShapeVisitor;
import java.awt.*;
public class SRectangle extends AbstractShape {
private SRectangle(Rectangle rect) {
super(rect);
}
@Override
public void accept(ShapeVisitor visitor) {
visitor.visitRectangle(this);
}
@Override
public String toString() {
return "SRectangle{" +
super.toString() +
'}';
}
public static SRectangle create(int x, int y, int width, int height) {
SRectangle rect = new SRectangle(new Rectangle(x, y, width, height));
rect.addAttributes(new SelectionAttributes());
return rect;
}
public static SRectangle create(int x, int y, int width, int height, Color color) {
final SRectangle rect = create(x, y, width, height);
rect.addAttributes(new ColorAttributes(false, true, Color.BLACK, color));
return rect;
}
}