Skip to content

Geometric shapes relations implemented in Java & JavaFX Gui

License

Notifications You must be signed in to change notification settings

OmriBraha/ClonedShapes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

📐 Geometric Shapes Hierarchy

Java JavaFX

This program is a collection of geometric shapes, implemented in Java and utilizing the JavaFX GUI to display them on a canvas. The program defines a hierarchy of geometric shapes, starting with the abstract class MyShape which contains all common properties and methods shared by all shapes.

🚀 Features

  • A hierarchy of geometric shapes: MyShape, MyBoundedShape, MyLine, MyOval, and MyRectangle classes.
  • Each shape is represented by 4 numbers (x1, y1), (x2, y2) and a color, and can draw itself using the GraphicsContext method.
  • Constructors that take shape's data as input and initialize the variables.
  • equals method implemented to compare shapes by length.
  • Cloneable interface and the clone method of Object to clone shapes.
  • Main program creates 2 shapes of each kind with random values of location and size between 0 and 200, all shapes are initialized with the red color.
  • Cloned shapes will be moved by x+10 and y+10 and will be green instead of red.
  • Displayed on a Canvas inside an Application window in the JavaFX GUI.

About

Geometric shapes relations implemented in Java & JavaFX Gui

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages