Graphical paint program which allows the user to draw with different colors and strokes, it also allows the user to draw diffrent types of shapes and manipulate them by resizing, filling, moving and cloning them. It also supports undo and redo operations.
- Draw using brush
- Draw different shapes as: line, rectangle, square, circle and triangle
- Erase
- Clear the screen
- Undo & Redo operations are supported
- Changing paint color
- Changing stroke of each paint/shape
- Filling shapes with vairious colors
- Moving shapes
- Resizing shapes
- Copying & Pasting shapes
- Automatic & Manual screenshot
- IntelliJ IDEA (IDE)
- Java
- Java.swing
- Creately for UMLs diagrams
- LaTeX for writing documentation
To run the program, you have to run the class named "FinalProjectPaint_V1" as your main class with Java SDK 16
1. Factory Design Pattern We have used Factory design patter in order to create new Objects without need of construction and to avoid coupling and dependency between Classes. So we constructed new instances of classes through this factory and returning it in needed methods or classes
2. Prototype Design Pattern We have used Prototype design pattern by implementing “Cloneable” interface and implementing “clone()”method in each and every Shape class and also Cloning instances of “Point” class. It helped us making copies of our Objects using values not references that helped us in copy method.
3. Singleton Design Pattern We have used Singleton design pattern to assure the creation of only one object of “ScreenShotter” class which has main aim to take screenshot of the painting board and it is the only instance that is allowed to do such task.
4. Façade Design Pattern We have used façade design pattern as it offers a simple interface to more complex underlying objects. So we could use draw methods using objects of “ShapeMakerFacade” class and not by accessing the shapes classes itself.
5. Iterator Design Pattern Iterator design Pattern facilitates looping across the array list of Geometric shapes needed to be drawn by only using 2 basic methods which are : “hasNext()” and “next()” avoiding looping with varying conditions.
6. Observer Design Pattern Observer design pattern helped us with automatic screenshotting(update method) while drawing (auto-documentation) as it takes screenshot each and every time we release the mouse by only changing the state in the PaintBoard class.
1. Single-Responsibility Principle A class should have one and only one reason to change, meaning that a class should have only one job, that's why we made classes like ShapeCopier, ShapeFiller, ShapeMover and ShapeResizer. Those classes are only responsiple for one job as shown from their names.
2. Open-Closed Principle Objects or entities should be open for extension but closed for modification, so if anyone wants to contribute to project and add another shape, he can do so effortlessly by adding a class and extending it from "GeometricShape" class.
3. Interface Segregation Principle Each method in each class is there for a reason, there is no unused method, so if you are adding extra shape, you probably won't be forced to implement a method you won't use.