Skip to content
Snippets Groups Projects
Select Git revision
  • 647d95cd3cc593b9cf7742416c356615954d82ca
  • main default protected
  • variant
3 results

FirefighterBoard.java

Blame
  • 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);
    }