MiniPaint is a lightweight, user-friendly painting application built in Java using the Swing graphics library. It supports creating, customizing, and managing shapes on a canvas. This tool is designed for beginners exploring GUI programming and Object-Oriented concepts.
-
Shape Creation and Management
- Create basic shapes: rectangles, circles, squares, and lines.
- Assign unique names to shapes (e.g.,
circle01,rectangle03). - Organize and manage shapes using a drop-down menu for easy selection.
-
Shape Customization
- Adjust properties such as position, size, and color.
- Resize and move shapes via a simple interface.
- Customize pen and fill colors for a polished look.
-
Interactive GUI
- Utilize a graphical interface for selecting and editing shapes.
- Input properties (position, radius, etc.) via dialog boxes.
- Position shapes easily by clicking on the canvas.
-
File Operations
- Save and load shapes to/from a file for persistence.
-
Deletion, Undo and Redo
- Delete selected shapes from the drop-down menu.
- Include optional undo and redo features for accidental edits.
-
ShapeDialog
- Handles temporary input for creating and customizing shapes.
-
Shape
- Represents a geometric object with attributes like type, size, and coordinates.
-
Engine
- Manages all shape instances, updates the canvas, and facilitates file operations.
-
GUI Interface
- Developed using Java Swing for buttons, menus, and dialog boxes.
The app design utilizes inheritance and polymorphism, ensuring scalability and clean code. The UML diagram illustrates relationships between:
- Base Class:
Shape - Derived Classes:
Circle,Rectangle,Square,LineSegment - Additional utilities for managing events and file I/O.