Skip to content
Snippets Groups Projects
Select Git revision
  • bfd988695c8036e1302200b5731b123cd6401dca
  • master default protected
2 results

ShapeContainer.java

Blame
  • Forked from COUETOUX Basile / graphic-2020
    9 commits ahead of the upstream repository.
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    ShapeContainer.java 392 B
    package shape;
    
    import javafx.scene.canvas.GraphicsContext;
    
    import java.util.ArrayList;
    import java.util.List;
    
    public class ShapeContainer{
    
        private List<Shape> shapes = new ArrayList<>();
    
        public void addShape(Shape shape){
            shapes.add(shape);
        }
    
        public void  draw(GraphicsContext context){
            for(Shape shape : shapes)
                shape.draw(context);
        }
    }