Select Git revision
Forked from
COUETOUX Basile / FirefighterStarter
Source project has a limited visibility.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
Decorator.java 722 B
package shape;
import javafx.geometry.Point2D;
import javafx.scene.canvas.GraphicsContext;
public abstract class Decorator implements Shape {
protected Shape decoratedShape;
public Decorator(Shape decoratedShape) {
this.decoratedShape = decoratedShape;
}
@Override
public int pointsCount() {
return decoratedShape.pointsCount();
}
@Override
public Point2D point(int index) {
return decoratedShape.point(index);
}
@Override
public void draw(GraphicsContext graphicsContext) {
decoratedShape.draw(graphicsContext);
drawDecoration(graphicsContext);
}
protected abstract void drawDecoration(GraphicsContext graphicsContext);
}