Skip to content
Snippets Groups Projects
Commit b8dc2b1f authored by SAYEH Nahlane ghina's avatar SAYEH Nahlane ghina
Browse files

modification de ShapeContainer

creation de AbstractShape
creation de Polygon,BorderDecorator et CenterDecorator
parent cad426c7
Branches
No related tags found
No related merge requests found
...@@ -12,6 +12,7 @@ import javafx.stage.Stage; ...@@ -12,6 +12,7 @@ import javafx.stage.Stage;
public class App extends Application { public class App extends Application {
public static void main(String[] args) { public static void main(String[] args) {
...@@ -26,10 +27,14 @@ public class App extends Application { ...@@ -26,10 +27,14 @@ public class App extends Application {
ShapeContainer shapeContainer = new ShapeContainer(); ShapeContainer shapeContainer = new ShapeContainer();
graphicsContext.setFill(Color.AQUAMARINE); graphicsContext.setFill(Color.AQUAMARINE);
graphicsContext.fillOval(10,10,10,10); graphicsContext.fillOval(10,10,10,10);
shapeContainer.addShape(new Rectangle(Color.BLUE,new Point2D(10,10), new Point2D(40,40))); shapeContainer.add(new Rectangle(Color.BLUE,new Point2D(10,10), new Point2D(40,40)));
shapeContainer.draw(graphicsContext); shapeContainer.draw(graphicsContext);
root.getChildren().add(canvas); root.getChildren().add(canvas);
primaryStage.setScene(new Scene(root)); primaryStage.setScene(new Scene(root));
primaryStage.show(); primaryStage.show();
} }
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment