Skip to content

ItsMerad/Geometry-Drawer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

📐 Geometry Drawer 📏

An interactive geometric shape drawing and calculation application developed with Java Swing.

Geometry Drawer is a desktop application that allows users to draw basic geometric shapes like circles, squares, and triangles, and instantly calculate their area and perimeter. With its user-friendly graphical interface, it's an ideal tool for visualizing geometric concepts and performing quick calculations.


✨ Features

  • Interactive Drawing: Users can draw shapes directly on the canvas using the mouse.
  • Instant Calculations: The area and perimeter of each drawn shape are automatically calculated and displayed.
  • Variety of Shapes: Ability to draw circles, squares, and triangles.
  • User-Friendly Interface: An intuitive and clean interface designed with Java Swing.

🚀 Setup and Running

Setting up and running this project on your local machine is quite straightforward.

Prerequisites

  • Java Development Kit (JDK) 8 or newer: Required to compile and run the project.

Steps

  1. Clone the Repository: First, download the project's source code to your computer. Open your terminal (Mac/Linux) or Command Prompt/PowerShell (Windows) and run the following command:

    git clone https://github.com/ItsMerad/Geometry-Drawer.git
  2. Navigate to the Project Folder: Change your current directory to the main project folder you just cloned:

    cd Geometry-Drawer
  3. Compile the Source Code: You need to compile the .java source files to create .class files. We'll compile all Java files located in the src/Geometry_Drawer/ directory:

    javac -d out src/Geometry_Drawer/*.java
  4. Run the Application: After compilation is complete, you can run the application via its main class. The main class for this application is likely Geometry_Drawer.GeometryDrawer.

    java -cp out Geometry_Drawer.GeometryDrawer
    • -cp out: Specifies that compiled .class files are in the out directory.
    • Geometry_Drawer.GeometryDrawer: The fully qualified name of your main class (including its package).

🛠️ Development Environment

This project was primarily developed using the following tools:

  • Java
  • Java Swing (for the graphical user interface)
  • Git (for version control)
  • Visual Studio Code (as the primary development environment)

📚 Learnings

Developing the Geometry Drawer application was an insightful journey that solidified my understanding of several key programming concepts and best practices:

  • Mastering Java Swing: Gained practical experience in designing and implementing interactive graphical user interfaces (GUIs) using Swing components, including event handling for user interactions like drawing on a canvas.
  • Object-Oriented Design (OOD) in Practice: Applied OOD principles to model geometric shapes (Circle, Square, Triangle) as distinct objects, inheriting from a common Shape interface or abstract class to manage their properties and behaviors (e.g., calculating area and perimeter).
  • Understanding Compilation and Execution: Reinforce my knowledge of the Java compilation process (javac) and how to execute Java applications from the command line, including managing class paths.
  • Version Control Workflow: Further practiced essential Git commands such as add, commit, and push, deepening my understanding of version control for tracking project evolution.

📁 Project Structure

The main directory structure of the project is as follows:

Geometry-Drawer/
├── out/                  # Compiled Java .class files
│   └── Geometry_Drawer/
│       ├── Circle.class
│       ├── GeometryDrawer$1.class
│       ├── GeometryDrawer$2.class
│       ├── GeometryDrawer$3.class
│       ├── GeometryDrawer.class
│       ├── Point.class
│       ├── Shape.class
│       ├── Square.class
│       └── Triangle.class
└── src/                  # Main source code of the project
    └── Geometry_Drawer/
        ├── Circle.java
        ├── GeometryDrawer.java   # Main application class
        ├── Point.java
        ├── Shape.java
        ├── Square.java
        └── Triangle.java

🤝 Contributing

Contributions are welcome! If you find a bug, want to add a new feature, or have any suggestions for improvement, please feel free to open an issue or submit a pull request.


📄 License

This project is licensed under the MIT License.

✉️ Contact


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages