Do My Homework / Homework Help Answers / Computer Science Homework Help / Have certain code match Flyweight Design Pattern

Have certain code match Flyweight Design Pattern

Need help with this question or any other Computer Science assignment help task?

Hi, I need someone to reformat my code in the manner to fit the Flyweight Pattern listed in the .README file. Look at the very bottom of the .README file for the flyweight pattern only. Not to add or change the functionality of the code. But possibly reformat/ refactor the code to match the design pattern. Flyweight Pattern. This is for the listed commands: Copy, Paste, Delete calling the IMovementObserver pattern. Need this done ASAP please.
Additional Instructions:
src/controller/DrawAction.java src/controller/DrawAction.java package controller; public class DrawAction { } src/controller/IJPaintController.java src/controller/IJPaintController.java package controller; public interface IJPaintController {     void setup(); } src/controller/JPaintController.java src/controller/JPaintController.java package controller; import model.interfaces.IApplicationState; import view.EventName; import view.interfaces.IUiModule; public class JPaintController implements IJPaintController {     private final IUiModule uiModule;     private final IApplicationState applicationState;     public JPaintController(IUiModule uiModule, IApplicationState applicationState) {         this.uiModule = uiModule;         this.applicationState = applicationState;     }     @Override     public void setup() {         setupEvents();     }     private void setupEvents() {         uiModule.addEvent(EventName.CHOOSE_SHAPE, () -> applicationState.setActiveShape());         uiModule.addEvent(EventName.CHOOSE_PRIMARY_COLOR, () -> applicationState.setActivePrimaryColor());         uiModule.addEvent(EventName.CHOOSE_SECONDARY_COLOR, () -> applicationState.setActiveSecondaryColor());         uiModule.addEvent(EventName.CHOOSE_SHADING_TYPE, () -> applicationState.setActiveShadingType());         uiModule.addEvent(EventName.CHOOSE_START_POINT_ENDPOINT_MODE,                 () -> applicationState.setActiveStartAndEndPointMode());         uiModule.addEvent(EventName.COPY, () -> applicationState.copySelectedToClipboard());         uiModule.addEvent(EventName.PASTE, () -> applicationState.pasteFromClipboard());         uiModule.addEvent(EventName.DELETE, () -> applicationState.deleteSelectedShape());         uiModule.addEvent(EventName.UNDO, () -> applicationState.undoCommand());         uiModule.addEvent(EventName.REDO, () -> applicationState.redoCommand());         uiModule.addEvent(EventName.GROUP, () -> applicationState.group());         uiModule.addEvent(EventName.UNGROUP, () -> applicationState.ungroup());     } } src/controller/MouseListener.java src/controller/MouseListener.java package controller; import model.persistence.ApplicationState; import view.interfaces.PaintCanvasBase; import model.Point; import model.commands.SelectModeOption; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; public class MouseListener extends MouseAdapter {     private Point startPoint;     private Point endPoint;     private static PaintCanvasBase paintCanvas;     private static ApplicationState appState;     public MouseListener(PaintCanvasBase baseCanvas, ApplicationState baseState) {         paintCanvas = baseCanvas;         appState = baseState;     }     @Override     public void mousePressed(MouseEvent e) {         startPoint = new Point(e.getX(),e.getY());     }     @Override     public void mouseReleased(MouseEvent e) {         endPoint = new Point(e.getX(),e.getY());         SelectModeOption.clickedMode(startPoint, endPoint, paintCanvas, appState);     } } src/controller/RedoAction.java src/controller/RedoAction.java package controller; src/controller/UndoAction.java src/controller/UndoAction.java package controller; src/main/Main.java src/main/Main.java package main; import controller.IJPaintController; import controller.JPaintController; import controller.MouseListener; import model.persistence.ApplicationState; import view.gui.Gui; import view.gui.GuiWindow; import view.gui.PaintCanvas; import view.interfaces.IGuiWindow; import view.interfaces.PaintCanvasBase; import view.interfaces.IUiModule; public class Main {     public static void main(String[] args) {         PaintCanvasBase paintCanvas = new PaintCanvas();         IGuiWindow guiWindow = new GuiWindow(paintCanvas);         IUiModule uiModule = new Gui(guiWindow);         ApplicationState appState = new ApplicationState(uiModule, paintCanvas);         IJPaintController controller = new JPaintController(uiModule, appState);         MouseListener mouseListener = new MouseListener(paintCanvas, appState);         paintCanvas.addMouseListener(mouseListener);         controller.setup();     } } src/model/commands/CommandHistory.java src/model/commands/CommandHistory.java package model.commands; import model.interfaces.IUndoable; import java.util.Stack; public class CommandHistory {     private static final Stack undoStack = new Stack();     private static final Stack redoStack = new Stack();     public static void add(IUndoable cmd) {         undoStack.push(cmd);         redoStack.clear();     }     public static boolean undo() {         boolean result = !undoStack.empty();         if (result) {             IUndoable c = undoStack.pop();             redoStack.push(c);             c.undo();         }         return result;     }     public static boolean redo() {         boolean result = !redoStack.empty();         if (result) {             IUndoable c = redoStack.pop();             undoStack.push(c);             c.redo();         }         return result;     } } src/model/commands/CopyCommand.java src/model/commands/CopyCommand.java package model.commands; import model.interfaces.ICommand; import model.interfaces.IEventCommand; import model.interfaces.ISelectedShapesList; import model.interfaces.IShape; public class CopyCommand implements ICommand, IEventCommand, ISelectedShapesList {     @Override     public void run() {         clipboardShapes.clear();         for (IShape temp : selectedShapes) {             clipboardShapes.add(temp);         }         System.out.println("Copied Shapes List: " + clipboardShapes.toString());     } } src/model/commands/DeleteCommand.java src/model/commands/DeleteCommand.java package model.commands; import model.ShapeList; import model.OutlineCreator; import model.interfaces.*; import view.gui.RefreshCanvas; import view.interfaces.PaintCanvasBase; import java.util.LinkedList; public class DeleteCommand implements IEventCommand, ISelectedShapesList, IUndoable {     private LinkedList tempList;     private PaintCanvasBase paintCanvas = null;     private OutlineCreator selectedShapeOutline;     public DeleteCommand() {         tempList = new LinkedList();         for (IShape temp1 : selectedShapes) {             for (IShape temp2 : ShapeList.shapeList) {                 if (paintCanvas == null)                     paintCanvas = temp2.getPaintCanvas();                 if (temp1.equals(temp2))                     tempList.add(temp1);             }         }     }     public void run() {         for (IShape temp : tempList) {             selectedShapes.remove(temp);             ShapeList.shapeList.remove(temp);         }         if (paintCanvas != null) {             RefreshCanvas.refresh(paintCanvas);         }         CommandHistory.add(this);     }     @Override     public void undo() {         for (IShape temp : tempList)         {             selectedShapes.add(temp);             ShapeList.shapeList.add(temp);         }         if (paintCanvas != null) {             RefreshCanvas.refresh(paintCanvas);             selectedShapeOutline = new OutlineCreator();             selectedShapeOutline.shapeOutline();         }     }     @Override     public void redo() {         this.run();     } } src/model/commands/DrawCommand.java src/model/commands/DrawCommand.java package model.commands; import model.*; import model.Point; import model.Rectangle; import model.Shape; import model.interfaces.*; import view.interfaces.PaintCanvasBase; import java.awt.*; public class DrawCommand implements ICommand {     Point startPoint;     Point endPoint;     PaintCanvasBase paintCanvas;     IApplicationState appState;     Shape drawShapeContext;     IShape shapeStrategy;     public DrawCommand(Point startPoint, Point endPoint, PaintCanvasBase paintCanvas,                        IApplicationState appState) {         this.startPoint = startPoint;         this.endPoint = endPoint;         this.paintCanvas = paintCanvas;         this.appState = appState;         drawShapeContext =  new Shape();     }     @Override     public void run() {         Color primaryColor = appState.getActivePrimaryColor().getColor();         Color secondaryColor = appState.getActiveSecondaryColor().getColor();         // Selecting the shading type for the shape         String shadeType = null;         if (appState.getActiveShapeShadingType() == ShapeShadingType.FILLED_IN) {             shadeType = "filled";         } else if (appState.getActiveShapeShadingType() == ShapeShadingType.OUTLINE) {             shadeType = "outline";         } else if (appState.getActiveShapeShadingType() == ShapeShadingType.OUTLINE_AND_FILLED_IN) {             shadeType = "filledAndOutline";         }         if (appState.getActiveShapeType() == ShapeType.RECTANGLE) {             shapeStrategy = new Rectangle(startPoint,endPoint,paintCanvas,shadeType,primaryColor,secondaryColor);         }         else if (appState.getActiveShapeType() == ShapeType.ELLIPSE) {             shapeStrategy = new Ellipse(startPoint,endPoint,paintCanvas,shadeType,primaryColor,secondaryColor);         }         else if (appState.getActiveShapeType() == ShapeType.TRIANGLE) {             shapeStrategy = new Triangle(startPoint,endPoint,paintCanvas,shadeType,primaryColor,secondaryColor);         }         else {             shapeStrategy = new ExecuteNullShape();         }         drawShapeContext.setDrawShapeStrategy(shapeStrategy);         drawShapeContext.drawShape();         ShapeList.shapeList.add(shapeStrategy);         CommandHistory.add(shapeStrategy);     } } src/model/commands/GroupCommand.java src/model/commands/GroupCommand.java package model.commands; import java.util.LinkedList; import java.util.List; import java.util.Stack; import model.GroupShape; import model.Point; import model.ShapeList; import model.ShapeShadingType; import model.interfaces.IApplicationState; import model.interfaces.ICommand; import model.interfaces.ISelectedShapesList; import model.interfaces.IShape; import model.interfaces.IUndoable; import view.gui.RefreshCanvas; import view.interfaces.PaintCanvasBase; // This class selects the drawn shape public class GroupCommand implements IUndoable, ICommand, ISelectedShapesList {     private PaintCanvasBase paintCanvas;     private IApplicationState appState;     public GroupShape group;     public GroupCommand(IApplicationState appState, PaintCanvasBase paintCanvas) {         this.paintCanvas = paintCanvas;         this.appState = appState;     }     @Override     public void run() {         List tempList = new LinkedList();         for (IShape temp : selectedShapes) {             tempList.add(temp);         }         String shadeType = "";         if(appState.getActiveShapeShadingType() == ShapeShadingType.FILLED_IN) {             shadeType = "filled";         } else if(appState.getActiveShapeShadingType() == ShapeShadingType.OUTLINE) {                shadeType = "outline";         } else if(appState.getActiveShapeShadingType() == ShapeShadingType.OUTLINE_AND_FILLED_IN) {             shadeType = "filledAndOutline";         }          GroupShape groupShape = new GroupShape(tempList, paintCanvas, shadeType, appState.getActivePrimaryColor().getColor(), appState.getActiveSecondaryColor().getColor());         for (IShape temp : selectedShapes) {             ShapeList.shapeList.remove(temp);         }         java.awt.Rectangle bounds = groupShape.getBounds();         Point startPoint = new Point(bounds.x, bounds.y);         Point endPoint = new Point(bounds.x + bounds.width, bounds.y + bounds.height);         ShapeList.shapeList.add(groupShape);         RefreshCanvas.refresh(paintCanvas);         SelectCommand command = new SelectCommand(startPoint, endPoint, paintCanvas);         command.run();         group = groupShape;         CommandHistory.add(this);     }     @Override     public void undo() {         List groupChildren = group.getShapeChildren();         for (IShape temp : groupChildren) {             ShapeList.shapeList.add(temp);         }         ShapeList.shapeList.remove(group);         RefreshCanvas.refresh(paintCanvas);     }     @Override     public void redo() {         List groupChildren = group.getShapeChildren();         for (IShape temp : groupChildren) {             ShapeList.shapeList.remove(temp);         }         ShapeList.shapeList.add(group);         RefreshCanvas.refresh(paintCanvas);     } } src/model/commands/MoveCommand.java src/model/commands/MoveCommand.java package model.commands; import model.ShapeList; import model.Point; import model.interfaces.ICommand; import model.interfaces.ISelectedShapesList; import model.interfaces.IShape; import model.interfaces.IUndoable; import view.gui.RefreshCanvas; import view.interfaces.PaintCanvasBase; import java.util.LinkedList; public class MoveCommand implements ICommand, IUndoable, ISelectedShapesList {     private final PaintCanvasBase paintCanvas;     private int xDelta;     private int yDelta;     private Point startPoint;     private Point endPoint;     private static boolean moveSelected = false;     private static boolean undoSelected = false;     private static boolean redoSelected = false;     private LinkedList tempMoveList;     private LinkedList tempRemoveList;     public MoveCommand(Point startPoint, Point endPoint, PaintCanvasBase paintCanvas) {         this.paintCanvas = paintCanvas;         this.startPoint = startPoint;         this.endPoint = endPoint;         tempMoveList = new LinkedList();         tempRemoveList = new LinkedList();     }     @Override     public void run() {         undoSelected = false;         redoSelected = false;         xDelta = endPoint.getX() - startPoint.getX();         yDelta = endPoint.getY() - startPoint.getY();         for (IShape temp1 : selectedShapes)         {             for (IShape temp2 : ShapeList.shapeList)             {                 if (temp1.equals(temp2))                 {                     tempRemoveList.add(temp2);                     temp1.updateCoordinates(xDelta, yDelta);                     tempMoveList.add(temp1);                 }             }         }         for (IShape temp1 : tempRemoveList)         {             selectedShapes.remove(temp1);             ShapeList.shapeList.remove(temp1);         }         for (IShape temp1 : tempMoveList)         {             selectedShapes.add(temp1);             ShapeList.shapeList.add(temp1);         }         RefreshCanvas.refresh(paintCanvas);         moveSelected = (selectedShapes.size() > 0) ? true : false;         CommandHistory.add(this);     }     @Override     public void undo() {         redoSelected = false;         undoSelected = (tempMoveList.size() > 0) ? true : false;         for (IShape temp1 : tempMoveList)         {             selectedShapes.remove(temp1);             ShapeList.shapeList.remove(temp1);         }         for (IShape temp1 : tempRemoveList)         {             temp1.updateCoordinates(0 - xDelta, 0 - yDelta);             selectedShapes.add(temp1);             ShapeList.shapeList.add(temp1);         }         if (paintCanvas != null) {             RefreshCanvas.refresh(paintCanvas);         }     }     @Override     public void redo() {         undoSelected = false;         redoSelected = (tempMoveList.size() > 0) ? true : false;         for (IShape temp1 : tempRemoveList)         {             selectedShapes.remove(temp1);             ShapeList.shapeList.remove(temp1);         }         for (IShape temp1 : tempMoveList)         {             temp1.updateCoordinates(xDelta, yDelta);             selectedShapes.add(temp1);             ShapeList.shapeList.add(temp1);         }         if (paintCanvas != null) {             RefreshCanvas.refresh(paintCanvas);         }     }     public static boolean isMoveSelected() {         return moveSelected;     }     public static void setMoveSelected(boolean moveSelected) {         MoveCommand.moveSelected = moveSelected;     }     public static boolean isUndoSelected() {         return undoSelected;     }     public static boolean isRedoSelected() {         return redoSelected;     }     public static void setUndoSelected(boolean undoSelected) {         MoveCommand.undoSelected = undoSelected;     }     public static void setRedoSelected(boolean redoSelected) {         MoveCommand.redoSelected = redoSelected;     }     public Point getStartPoint() {         return startPoint;     }     public Point getEndPoint() {         return endPoint;     }     public PaintCanvasBase getPaintCanvas() {         return paintCanvas;     } } src/model/commands/PasteCommand.java src/model/commands/PasteCommand.java package model.commands; import model.ShapeList; import model.Ellipse; import model.GroupShape; import model.Point; import model.Rectangle; import model.SelectedShapesList; import model.Shape; import model.Triangle; import model.interfaces.ICommand; import model.interfaces.IEventCommand; import model.interfaces.IShape; import model.interfaces.IUndoable; import view.gui.RefreshCanvas; import view.interfaces.PaintCanvasBase; import java.util.LinkedList; import java.util.List; // This class paste the copied shape from the clipboard. public class PasteCommand implements IEventCommand, ICommand, IUndoable {     private LinkedList tempPasteList;     private Triangle tempTriangle;     private PaintCanvasBase paintCanvas = null;     private static boolean isPasteSelected = false;     public PasteCommand() {         tempPasteList = new LinkedList();         for (IShape temp : clipboardShapes) {                          // Calculating the offset             Point tempStartPoint = new Point(temp.getStartPointX() + 20, temp.getStartPointY() + 20);             Point tempEndPoint = new Point(temp.getStartPointX() + temp.getWidth() + 20,                     temp.getStartPointY() + temp.getHeight() + 20);             Shape drawShapeContext =  new Shape();             IShape shapeStrategy = null;             if (paintCanvas == null)                 paintCanvas = temp.getPaintCanvas();             // Drawing new object on canvas             if(temp instanceof Rectangle) {                 shapeStrategy = new Rectangle(tempStartPoint, tempEndPoint, temp.getPaintCanvas(),temp.getShadeType(),                         temp.getPrimaryColor(), temp.getSecondaryColor());             }             else if(temp instanceof Ellipse) {                 shapeStrategy = new Ellipse(tempStartPoint, tempEndPoint, temp.getPaintCanvas(),temp.getShadeType(),                         temp.getPrimaryColor(), temp.getSecondaryColor());             }             else if(temp instanceof Triangle) {                 tempTriangle = (Triangle) temp;                 int[] xValues = tempTriangle.getXValues();                 int[] yValues = tempTriangle.getYValues();                 tempStartPoint = new Point(xValues[0] + 15, yValues[0] + 15);                 tempEndPoint = new Point(xValues[2] + 15, yValues[2] + 15);                 shapeStrategy = new Triangle(tempStartPoint, tempEndPoint, temp.getPaintCanvas(),temp.getShadeType(),                         temp.getPrimaryColor(), temp.getSecondaryColor());             } else if (temp instanceof GroupShape) {                 SelectedShapesList.selectedShapes.clear();                 // update cordinates of the group shape to +20 of the current position                 GroupShape group = new GroupShape((GroupShape) temp);                 List children = group.getShapeChildren();                 for (IShape child : children) {                     child.updateCoordinates(50, 50);                 }                 shapeStrategy = temp;             }             drawShapeContext.setDrawShapeStrategy(shapeStrategy);             drawShapeContext.drawShape();             if (drawShapeContext != null)                 tempPasteList.add(shapeStrategy);         }     }     @Override     public void run() {         for (IShape temp : tempPasteList) {             if (temp != null) {                 ShapeList.shapeList.add(temp);                 CommandHistory.add(this);             }         }         if (paintCanvas != null) {             isPasteSelected = (SelectedShapesList.selectedShapes.size() > 0) ? true : false;             // Canvas Refresh             RefreshCanvas.refresh(paintCanvas);         }     }     @Override     public void undo() {         MoveCommand.setUndoSelected(false);         for (IShape temp : tempPasteList)         {             if (temp != null)                 ShapeList.shapeList.remove(temp);         }         if (paintCanvas != null) {             isPasteSelected = (SelectedShapesList.selectedShapes.size() > 0) ? true : false;             RefreshCanvas.refresh(paintCanvas);         }     }     @Override     public void redo() {         MoveCommand.setRedoSelected(false);         this.run();     }     public static void setIsPasteSelected(boolean isPasteSelected) {         PasteCommand.isPasteSelected = isPasteSelected;     }     public static boolean isIsPasteSelected() {         return isPasteSelected;     } } src/model/commands/RedoCommand.java src/model/commands/RedoCommand.java package model.commands; import model.interfaces.ICommand; public class RedoCommand implements ICommand {     @Override     public void run() {         CommandHistory.redo();     } } src/model/commands/SelectCommand.java src/model/commands/SelectCommand.java package model.commands; import model.ShapeList; import model.GroupShape; import model.Point; import model.interfaces.ICommand; import model.interfaces.ISelectedShapesList; import model.interfaces.IShape; import view.gui.RefreshCanvas; import view.interfaces.PaintCanvasBase; // This class selects the drawn shape public class SelectCommand implements ICommand, ISelectedShapesList {     private PaintCanvasBase paintCanvas;     private Point startPoint;     private Point endPoint;     private Point minimum;     private int width;     private int height;     private static boolean isSelected = false;     public SelectCommand(Point startPoint, Point endPoint, PaintCanvasBase paintCanvas) {         this.startPoint = startPoint;         this.endPoint = endPoint;         this.paintCanvas = paintCanvas;     }     @Override     public void run() {         MoveCommand.setMoveSelected(false);         // Calculating minimum(X,Y), height and width of the invisible box         minimum = new Point(Math.min(startPoint.getX(), endPoint.getX()),                 Math.min(startPoint.getY(), endPoint.getY()));         width = java.lang.Math.abs(startPoint.getX() - endPoint.getX());         height = java.lang.Math.abs(startPoint.getY() - endPoint.getY());         selectedShapes.clear();         isSelected = false;         RefreshCanvas.refresh(paintCanvas);         selectedShapes.clear();         // Collision Detection Algorithm         for (IShape temp : ShapeList.shapeList)         {             if(temp instanceof GroupShape) {                 if(((GroupShape) temp).getArea().intersects(minimum.getX(), minimum.getY(), width, height)) {                     selectedShapes.add(temp);                 }             } else {                 if (temp.getStartPointX()  minimum.getX() &&                     temp.getStartPointY()  minimum.getY())             {                      // Added the collided shapes on the list                      selectedShapes.add(temp);             }             }         }         isSelected = (selectedShapes.size() > 0) ? true : false;     }     public static boolean isSelected() {         return isSelected;     }     public PaintCanvasBase getPaintCanvas() {         return paintCanvas;     }     public Point getStartPoint() {         return startPoint;     }     public Point getEndPoint() {         return endPoint;     } } src/model/commands/SelectModeOption.java src/model/commands/SelectModeOption.java package model.commands; import model.Point; import model.OutlineProxy; import model.MouseMode; import model.interfaces.IApplicationState; import model.interfaces.ICommand; import model.interfaces.IShapeOutline; import view.interfaces.PaintCanvasBase; // Command Pattern Implementation public class SelectModeOption {     public static void clickedMode(Point startPoint, Point endPoint,                                    PaintCanvasBase paintCanvas, IApplicationState appState) {         ICommand command = null;         OutlineProxy selectShapeProxy = null;         OutlineProxy moveShapeProxy = null;         if (appState.getActiveStartAndEndPointMode() == MouseMode.DRAW) {             command = new DrawCommand(startPoint, endPoint, paintCanvas, appState);             command.run();         }         // Proxy Pattern Implementation         else if (appState.getActiveStartAndEndPointMode() == MouseMode.SELECT) {             command = new SelectCommand(startPoint, endPoint, paintCanvas);             command.run();             selectShapeProxy = new OutlineProxy();             printShapeOutline(selectShapeProxy);         }         else if (appState.getActiveStartAndEndPointMode() == MouseMode.MOVE) {             command = new MoveCommand(startPoint, endPoint, paintCanvas);             command.run();             moveShapeProxy = new OutlineProxy();             printShapeOutline(moveShapeProxy);         }     }      //     Proxy pattern: printShapeOutline does not know the concrete type of the shapeOutline object; //     it just knows it has received an ISelectedShapeOutline object.     public static void printShapeOutline(IShapeOutline outlineOperation) {         outlineOperation.shapeOutline();     } } src/model/commands/UndoCommand.java src/model/commands/UndoCommand.java package model.commands; import model.interfaces.ICommand; public class UndoCommand implements ICommand {     @Override     public void run() {         CommandHistory.undo();     } } src/model/commands/UngroupCommand.java src/model/commands/UngroupCommand.java package model.commands; import java.util.LinkedList; import java.util.List; import model.GroupShape; import model.ShapeList; import model.interfaces.IApplicationState; import model.interfaces.ICommand; import model.interfaces.ISelectedShapesList; import model.interfaces.IShape; import model.interfaces.IUndoable; import view.gui.RefreshCanvas; import view.interfaces.PaintCanvasBase; // This class selects the drawn shape public class UngroupCommand implements IUndoable, ICommand, ISelectedShapesList {     private PaintCanvasBase paintCanvas;     private IApplicationState appState;     public UngroupCommand(IApplicationState appState, PaintCanvasBase paintCanvas) {         this.paintCanvas = paintCanvas;         this.appState = appState;     }     @Override     public void run() {         for(IShape shape: selectedShapes) {             if (shape instanceof GroupShape) {                 GroupShape group = (GroupShape) shape;                 List children = group.getShapeChildren();                 for (IShape child : children) {                     ShapeList.shapeList.add(child);                 }                 ShapeList.shapeList.remove(shape);                           }         }         RefreshCanvas.refresh(paintCanvas);     }     @Override     public void undo() {     }     @Override     public void redo() {     } } src/model/Coordinate.java src/model/Coordinate.java package model; public class Coordinate {     private int x;     private int y;     public Coordinate(int x, int y) {         this.x = x;         this.y = y;     }     public int getX() {         return x;     }     public int getY() {         return y;     }     public void setX(int x) {         this.x = x;     }     public void setY(int y) {         this.y = y;     } } src/model/dialogs/ChoosePrimaryColorDialog.java src/model/dialogs/ChoosePrimaryColorDialog.java package model.dialogs; import model.ShapeColor; import model.interfaces.IApplicationState; import view.interfaces.IDialogChoice; public class ChoosePrimaryColorDialog implements IDialogChoice {     private final IApplicationState applicationState;     public ChoosePrimaryColorDialog(IApplicationState applicationState) {         this.applicationState = applicationState;     }     @Override     public String getDialogTitle() {         return "Primary Color";     }     @Override     public String getDialogText() {         return "Select a primary color from the menu below:";     }     @Override     public ShapeColor[] getDialogOptions() {         return ShapeColor.values();     }     @Override     public ShapeColor getCurrentSelection() {         return applicationState.getActivePrimaryColor();     } } src/model/dialogs/ChooseSecondaryColorDialog.java src/model/dialogs/ChooseSecondaryColorDialog.java package model.dialogs; import model.ShapeColor; import model.interfaces.IApplicationState; import view.interfaces.IDialogChoice; public class ChooseSecondaryColorDialog implements IDialogChoice {     private final IApplicationState applicationState;     public ChooseSecondaryColorDialog(IApplicationState applicationState) {         this.applicationState = applicationState;     }     @Override     public String getDialogTitle() {         return "Secondary Color";     }     @Override     public String getDialogText() {         return "Select a secondary color from the menu below:";     }     @Override     public ShapeColor[] getDialogOptions() {         return ShapeColor.values();     }     @Override     public ShapeColor getCurrentSelection() {         return applicationState.getActiveSecondaryColor();     } } src/model/dialogs/ChooseShadingTypeDialog.java src/model/dialogs/ChooseShadingTypeDialog.java package model.dialogs; import model.ShapeShadingType; import model.interfaces.IApplicationState; import view.interfaces.IDialogChoice; public class ChooseShadingTypeDialog implements IDialogChoice {     private final IApplicationState applicationState;     public ChooseShadingTypeDialog(IApplicationState applicationState) {         this.applicationState = applicationState;     }     @Override     public String getDialogTitle() {         return "Shading Type";     }     @Override     public String getDialogText() {         return "Select a shading type from the menu below:";     }     @Override     public ShapeShadingType[] getDialogOptions() {         return ShapeShadingType.values();     }     @Override     public ShapeShadingType getCurrentSelection() {         return applicationState.getActiveShapeShadingType();     } } src/model/dialogs/ChooseShapeDialog.java src/model/dialogs/ChooseShapeDialog.java package model.dialogs; import model.ShapeType; import model.interfaces.IApplicationState; import view.interfaces.IDialogChoice; public class ChooseShapeDialog implements IDialogChoice {     private final IApplicationState applicationState;     public ChooseShapeDialog(IApplicationState applicationState) {         this.applicationState = applicationState;     }     @Override     public String getDialogTitle() {         return "Shape";     }     @Override     public String getDialogText() {         return "Select a shape from the menu below:";     }     @Override     public ShapeType[] getDialogOptions() {         return ShapeType.values();     }     @Override     public ShapeType getCurrentSelection() {         return applicationState.getActiveShapeType();     } } src/model/dialogs/ChooseStartAndEndPointModeDialog.java src/model/dialogs/ChooseStartAndEndPointModeDialog.java package model.dialogs; import model.MouseMode; import model.interfaces.IApplicationState; import view.interfaces.IDialogChoice; public class ChooseStartAndEndPointModeDialog implements IDialogChoice {     private final IApplicationState applicationState;     public ChooseStartAndEndPointModeDialog(IApplicationState applicationState) {         this.applicationState = applicationState;     }     @Override     public String getDialogTitle() {         return "Start and End Point Mode";     }     @Override     public String getDialogText() {         return "Select a shading type from the menu below:";     }     @Override     public MouseMode[] getDialogOptions() {         return MouseMode.values();     }     @Override     public MouseMode getCurrentSelection() {         return applicationState.getActiveStartAndEndPointMode();     } } src/model/dialogs/DialogProvider.java src/model/dialogs/DialogProvider.java package model.dialogs; import model.ShapeColor; import model.ShapeShadingType; import model.ShapeType; import model.MouseMode; import model.interfaces.IApplicationState; import model.interfaces.IDialogProvider; import view.interfaces.IDialogChoice; public class DialogProvider implements IDialogProvider {     private final IDialogChoice chooseShapeDialog;     private final IDialogChoice choosePrimaryColorDialog;     private final IDialogChoice chooseSecondaryColorDialog;     private final IDialogChoice chooseShadingTypeDialog;     private final IDialogChoice chooseStartAndEndPointModeDialog;     private final IApplicationState applicationState;     public DialogProvider(IApplicationState applicationState) {         this.applicationState = applicationState;         chooseShapeDialog = new ChooseShapeDialog(this.applicationState);         choosePrimaryColorDialog = new ChoosePrimaryColorDialog(this.applicationState);         chooseSecondaryColorDialog = new ChooseSecondaryColorDialog(this.applicationState);         chooseShadingTypeDialog = new ChooseShadingTypeDialog(this.applicationState);         chooseStartAndEndPointModeDialog = new ChooseStartAndEndPointModeDialog(this.applicationState);     }     @Override     public IDialogChoice getChooseShapeDialog() {         return chooseShapeDialog;     }     @Override     public IDialogChoice getChoosePrimaryColorDialog() {         return choosePrimaryColorDialog;     }     @Override     public IDialogChoice getChooseSecondaryColorDialog() {         return chooseSecondaryColorDialog;     }     @Override     public IDialogChoice getChooseShadingTypeDialog() {         return chooseShadingTypeDialog;     }     @Override     public IDialogChoice getChooseStartAndEndPointModeDialog() {         return chooseStartAndEndPointModeDialog;     } } src/model/Ellipse.java src/model/Ellipse.java package model; import model.interfaces.IShape; import view.gui.RefreshCanvas; import view.interfaces.PaintCanvasBase; import java.awt.*; import java.util.LinkedList; public class Ellipse implements IShape {     private PaintCanvasBase paintCanvas;     private Point startPoint;     private Point endPoint;     private Point minimum;     private Point maximum;     private int width;     private int height;     private String shadeType;     private Color primaryColor;     private Color secondaryColor;     private int startPointX, startPointY;     public Ellipse(Point startPoint, Point endPoint, PaintCanvasBase paintCanvas,             String shadeType, Color primaryColor, Color secondaryColor) {         this.startPoint = startPoint;         this.endPoint = endPoint;         this.paintCanvas = paintCanvas;         this.shadeType = shadeType;         this.primaryColor = primaryColor;         this.secondaryColor = secondaryColor;         minimum = new Point(Math.min(startPoint.getX(), endPoint.getX()),                 Math.min(startPoint.getY(), endPoint.getY()));         maximum = new Point(Math.max(startPoint.getX(), endPoint.getX()),                 Math.max(startPoint.getY(), endPoint.getY()));         width = Math.abs(maximum.getX() - minimum.getX());         height = Math.abs(maximum.getY() - minimum.getY());         startPointX = minimum.getX();         startPointY = minimum.getY();     }     @Override     public void drawShape() {         Graphics2D graphics2d = paintCanvas.getGraphics2D();         if (shadeType.equals("filled")) {             graphics2d.setColor(primaryColor);             graphics2d.fillOval(startPointX, startPointY, width, height);         } else if (shadeType == "outline") {             graphics2d.setStroke(new BasicStroke(5));             graphics2d.setColor(primaryColor);             graphics2d.drawOval(startPointX, startPointY, width, height);         } else if (shadeType == "filledAndOutline") {             graphics2d.setColor(primaryColor);             graphics2d.fillOval(startPointX, startPointY, width, height);             graphics2d.setStroke(new BasicStroke(5));             graphics2d.setColor(secondaryColor);             graphics2d.drawOval(startPointX, startPointY, width, height);         }     }     @Override     public LinkedList getShapeChildren() {         return null;     }     @Override     public void updateCoordinates(int xDelta, int yDelta) {         startPointX = startPointX + xDelta;         startPointY = startPointY + yDelta;     }     @Override     public int getStartPointX() {         return startPointX;     }     @Override     public int getStartPointY() {         return startPointY;     }     @Override     public PaintCanvasBase getPaintCanvas() {         return this.paintCanvas;     }     @Override     public int getWidth() {         return width;     }     @Override     public int getHeight() {         return height;     }     @Override     public Point getStartPoint() {         return this.startPoint;     }     @Override     public Point getEndPoint() {         return this.endPoint;     }     @Override     public IShape getDrawShapeStrategy() {         return getDrawShapeStrategy();     }     @Override     public String getShadeType() {         return this.shadeType;     }     @Override     public Color getPrimaryColor() {         return this.primaryColor;     }     @Override     public Color getSecondaryColor() {         return this.secondaryColor;     }     @Override     public void undo() {         ShapeList.shapeList.removeLast();         if (SelectedShapesList.selectedShapes.contains(this))             SelectedShapesList.selectedShapes.removeLast();         RefreshCanvas.refresh(paintCanvas);     }     @Override     public void redo() {         ShapeList.shapeList.add(this);         RefreshCanvas.refresh(paintCanvas);     } } src/model/ExecuteNullShape.java src/model/ExecuteNullShape.java package model; import model.interfaces.IShape; import view.gui.PaintCanvas; import view.interfaces.PaintCanvasBase; import java.awt.*; import java.util.LinkedList; public class ExecuteNullShape implements IShape {     @Override     public void drawShape() {         System.out.println("Null Shape cannot be executed");     }     @Override     public LinkedList getShapeChildren() {         return null;     }     @Override     public void updateCoordinates(int xDelta, int yDelta) {         System.out.println("Null Shape coordinates cannot be updated");     }     @Override     public PaintCanvasBase getPaintCanvas() {         return new PaintCanvas();     }     @Override     public int getWidth() {         return 0;     }     @Override     public int getHeight() {         return 0;     }     @Override     public Point getStartPoint() {         return null;     }     @Override     public Point getEndPoint() {         return null;     }     @Override     public int getStartPointX() {         return 0;     }     @Override     public int getStartPointY() {         return 0;     }     @Override     public IShape getDrawShapeStrategy() {         return null;     }     @Override     public String getShadeType() {         return "filled";     }     @Override     public Color getPrimaryColor() {         return Color.BLACK;     }     @Override     public Color getSecondaryColor() {         return Color.BLACK;     }     @Override     public void undo() {         ShapeList.shapeList.remove(this);         if (SelectedShapesList.selectedShapes.contains(this))             SelectedShapesList.selectedShapes.remove(this);     }     @Override     public void redo() {         ShapeList.shapeList.add(this);     } } src/model/GroupShape.java src/model/GroupShape.java package model; import java.awt.Color; import java.util.LinkedList; import java.util.List; import model.interfaces.IShape; import view.interfaces.PaintCanvasBase; import java.awt.Graphics2D; import java.awt.geom.Area; import java.awt.geom.Rectangle2D; import java.awt.geom.Ellipse2D; import java.awt.Polygon; public class GroupShape implements IShape {     private List shapeList;     private PaintCanvasBase paintCanvas;     private Color primaryColor;     private Color secondaryColor;     private String shadeType;     private Point startPoint;     private Point endPoint;     private int height;     private int width;     private Area area;     // static id     private static int id = 0;     private int groupId;     // constructor     public GroupShape(List shapes, PaintCanvasBase paintCanvas,             String shadeType, Color primaryColor, Color secondaryColor) {         this.shapeList = shapes;         this.paintCanvas = paintCanvas;         this.shadeType = shadeType;         this.primaryColor = primaryColor;         this.secondaryColor = secondaryColor;         this.startPoint = new Point(Integer.MAX_VALUE, Integer.MAX_VALUE);         this.endPoint = new Point(Integer.MIN_VALUE, Integer.MIN_VALUE);         this.height = 0;         this.width = 0;         this.area = new Area();         this.groupId = id++;     }     // copy constructor     public GroupShape(GroupShape groupShape) {         this.shapeList = new LinkedList();         for (IShape temp : groupShape.shapeList) {             this.shapeList.add(temp);         }         this.paintCanvas = groupShape.paintCanvas;         this.shadeType = groupShape.shadeType;         this.primaryColor = groupShape.primaryColor;         this.secondaryColor = groupShape.secondaryColor;         this.startPoint = groupShape.startPoint;         this.endPoint = groupShape.endPoint;         this.height = groupShape.height;         this.width = groupShape.width;         this.area = groupShape.area;         this.groupId = id++;     }     @Override     public void undo() {         // TODO Auto-generated method stub     }     @Override     public void redo() {         // TODO Auto-generated method stub     }     @Override     public int getStartPointX() {         return this.startPoint.getX();     }     @Override     public int getStartPointY() {         return this.startPoint.getY();     }     @Override     public int getWidth() {         return this.width;     }     @Override     public int getHeight() {         return this.height;     }     @Override     public PaintCanvasBase getPaintCanvas() {         return this.paintCanvas;     }     @Override     public Point getStartPoint() {         return this.startPoint;     }     @Override     public Point getEndPoint() {         return this.endPoint;     }     @Override     public IShape getDrawShapeStrategy() {         return getDrawShapeStrategy();     }     @Override     public String getShadeType() {         return this.shadeType;     }     @Override     public Color getPrimaryColor() {         return this.primaryColor;     }     @Override     public Color getSecondaryColor() {         return this.secondaryColor;     }     public void addShape(IShape shape) {         if(shape instanceof Rectangle) {             Rectangle rectangle = (Rectangle) shape;             int rectWidth = rectangle.getWidth();             int rectHeight = rectangle.getHeight();             int rectStartPointX = rectangle.getStartPointX();             int rectStartPointY = rectangle.getStartPointY();             Rectangle2D rect = new Rectangle2D.Double(rectStartPointX, rectStartPointY, rectWidth, rectHeight);             this.area.add(new Area(rect));         } else if (shape instanceof Ellipse) {             Ellipse ellipse = (Ellipse) shape;             int ellipseWidth = ellipse.getWidth();             int ellipseHeight = ellipse.getHeight();             int ellipseStartPointX = ellipse.getStartPointX();             int ellipseStartPointY = ellipse.getStartPointY();             Ellipse2D ellipse2D = new Ellipse2D.Double(ellipseStartPointX, ellipseStartPointY, ellipseWidth, ellipseHeight);             this.area.add(new Area(ellipse2D));         } else if (shape instanceof Triangle) {             Triangle triangle = (Triangle) shape;             int triangleStartPointX = triangle.getStartPointX();             int triangleStartPointY = triangle.getStartPointY();             int triangleWidth = triangle.getWidth();             int triangleHeight = triangle.getHeight();             int[] xPoints = {triangleStartPointX, triangleStartPointX + triangleWidth, triangleStartPointX + triangleWidth / 2};             int[] yPoints = {triangleStartPointY, triangleStartPointY + triangleHeight, triangleStartPointY + triangleHeight};             Polygon polygon = new Polygon(xPoints, yPoints, 3);             this.area.add(new Area(polygon));         }     }     @Override     public void drawShape() {         Graphics2D graphics2d = paintCanvas.getGraphics2D();         if(shapeList.size() > 0) {             for(IShape shape : shapeList) {                 addShape(shape);             }             if(shadeType.equals("filled")) {                 graphics2d.setColor(primaryColor);                 graphics2d.fill(area);             } else if(shadeType.equals("outlined")) {                 graphics2d.setColor(primaryColor);                 graphics2d.draw(area);             } else if(shadeType.equals("filledAndOutline")) {                 graphics2d.setColor(primaryColor);                 graphics2d.fill(area);                 graphics2d.setColor(secondaryColor);                 graphics2d.draw(area);             }         }     }     // get area     public Area getArea() {         return this.area;     }     @Override     public void updateCoordinates(int xDelta, int yDelta) {                  // update coordinates of all shapes in the group         for(IShape shape : shapeList) {             shape.updateCoordinates(xDelta, yDelta);         }         this.area = new Area();         // update area of the group         drawShape();     }     @Override     public LinkedList getShapeChildren() {         LinkedList shapeList = new LinkedList();         for (IShape shape : this.shapeList) {             shapeList.add(shape);         }         return shapeList;     }     // get bounds     public java.awt.Rectangle getBounds() {         return this.area.getBounds();     }     // get id     public int getId() {         return this.groupId;     } } src/model/interfaces/IApplicationState.java src/model/interfaces/IApplicationState.java package model.interfaces; import model.ShapeColor; import model.ShapeShadingType; import model.ShapeType; import model.MouseMode; public interface IApplicationState {     void setActiveShape();     void setActivePrimaryColor();     void setActiveSecondaryColor();     void setActiveShadingType();     void setActiveStartAndEndPointMode();     ShapeType getActiveShapeType();     ShapeColor getActivePrimaryColor();     ShapeColor getActiveSecondaryColor();     ShapeShadingType getActiveShapeShadingType();     MouseMode getActiveStartAndEndPointMode();     void copySelectedToClipboard();     void pasteFromClipboard();     void deleteSelectedShape();     void undoCommand();     void redoCommand();     void group();     void ungroup();      } src/model/interfaces/ICommand.java src/model/interfaces/ICommand.java package model.interfaces; // Command Interface public interface ICommand {     void run(); } src/model/interfaces/IDialogProvider.java src/model/interfaces/IDialogProvider.java package model.interfaces; import model.ShapeColor; import model.ShapeShadingType; import model.ShapeType; import model.MouseMode; import view.interfaces.IDialogChoice; public interface IDialogProvider {     IDialogChoice getChooseShapeDialog();     IDialogChoice getChoosePrimaryColorDialog();     IDialogChoice getChooseSecondaryColorDialog();     IDialogChoice getChooseShadingTypeDialog();     IDialogChoice getChooseStartAndEndPointModeDialog(); } src/model/interfaces/IEventCommand.java src/model/interfaces/IEventCommand.java package model.interfaces; import java.util.LinkedList; public interface IEventCommand {     public LinkedList clipboardShapes = new LinkedList(); } src/model/interfaces/IMasterShapeList.java src/model/interfaces/IMasterShapeList.java package model.interfaces; import java.util.LinkedList; public interface IMasterShapeList {     public LinkedList shapeList = new LinkedList(); } src/model/interfaces/ISelectedShapesList.java src/model/interfaces/ISelectedShapesList.java package model.interfaces; import java.util.LinkedList; public interface ISelectedShapesList {     LinkedList selectedShapes = new LinkedList(); } src/model/interfaces/IShape.java src/model/interfaces/IShape.java package model.interfaces; import model.Point; import view.interfaces.PaintCanvasBase; import java.awt.*; import java.util.LinkedList; // IShape interface defines all the methods used by the shapes public interface IShape extends IUndoable, ISelectedShapesList {     public int getStartPointX();     public int getStartPointY();     public int getWidth();     public int getHeight();     public PaintCanvasBase getPaintCanvas();     public Point getStartPoint();     public Point getEndPoint();     public IShape getDrawShapeStrategy();     public String getShadeType();     public Color getPrimaryColor();     public Color getSecondaryColor();     public void drawShape();     public void updateCoordinates(int xDelta, int yDelta);     public LinkedList getShapeChildren(); } src/model/interfaces/IShapeOutline.java src/model/interfaces/IShapeOutline.java package model.interfaces; public interface IShapeOutline {     public void shapeOutline(); } src/model/interfaces/IUndoable.java src/model/interfaces/IUndoable.java package model.interfaces; public interface IUndoable {     void undo();     void redo(); } src/model/MouseMode.java src/model/MouseMode.java package model; public enum MouseMode {     DRAW,     SELECT,     MOVE } src/model/OutlineCreator.java src/model/OutlineCreator.java package model; import model.interfaces.IShapeOutline; import model.interfaces.IShape; public class OutlineCreator implements IShapeOutline {     OutlineGroupShape drawGroupShapeOutline = new OutlineGroupShape();     OutlineRectangle drawRectOutline = new OutlineRectangle();     OutlineEllipse drawEllipseOutline = new OutlineEllipse();     OutlineTriangle drawTriangleOutline = new OutlineTriangle();     @Override     public void shapeOutline() {         for (IShape temp1 : ShapeList.shapeList) {             for (IShape temp2 : SelectedShapesList.selectedShapes) {                 if (temp2.equals(temp1)) {                     if (temp2 instanceof Rectangle) {                         drawRectOutline.draw(temp2.getStartPointX(), temp2.getStartPointY(),                                 temp2.getWidth(), temp2.getHeight(), temp2.getPaintCanvas());                     } else if (temp2 instanceof Ellipse) {                         drawEllipseOutline.draw(temp2.getStartPointX(), temp2.getStartPointY(),                                 temp2.getWidth(), temp2.getHeight(), temp2.getPaintCanvas());                     } else if (temp2 instanceof Triangle) {                         Triangle tempTriangleValues = (Triangle) temp2;                         int[] xValues = tempTriangleValues.getXValues();                         int[] yValues = tempTriangleValues.getYValues();                         drawTriangleOutline.draw(xValues, yValues, temp2.getPaintCanvas());                     } else if (temp2 instanceof GroupShape) {                         drawGroupShapeOutline.draw(temp2);                     }                 }             }         }     } } src/model/OutlineEllipse.java src/model/OutlineEllipse.java package model; import view.interfaces.PaintCanvasBase; import java.awt.*; public class OutlineEllipse {     public void draw(int startPointX, int startPointY, int width, int height, PaintCanvasBase paintCanvas) {         Point startPoint = new Point(startPointX - 5,startPointY - 5);         Point endPoint = new Point (startPointX + width + 5, startPointY + height + 5);         Graphics2D graphics2d = paintCanvas.getGraphics2D();         Stroke stroke = new BasicStroke(5, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 1,                 new float[]{9}, 0);         graphics2d.setStroke(stroke);         graphics2d.setColor(Color.BLACK);         graphics2d.drawOval(startPoint.getX(), startPoint.getY(), Math.abs(startPoint.getX() - endPoint.getX()),                 Math.abs(startPoint.getY() - endPoint.getY()));     } } src/model/OutlineGroupShape.java src/model/OutlineGroupShape.java package model; import java.awt.*; import model.interfaces.IShape; public class OutlineGroupShape {     public void draw(IShape shape) {         Graphics2D graphics = shape.getPaintCanvas().getGraphics2D();         Stroke stroke = new BasicStroke(5, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 1,         new float[]{9}, 0);         graphics.setStroke(stroke);         graphics.setColor(Color.BLACK);         graphics.draw(((GroupShape) shape).getArea());     } } src/model/OutlineProxy.java src/model/OutlineProxy.java package model; import model.commands.MoveCommand; import model.commands.SelectCommand; import model.interfaces.IShapeOutline; import model.persistence.ApplicationState; public class OutlineProxy implements IShapeOutline {     private OutlineCreator selectedShapeOutline;     private OutlineCreator selectedShapeOutline1;     private OutlineCreator selectedShapeOutline2;     private OutlineCreator selectedShapeOutline3;     public OutlineProxy() {}     @Override     public void shapeOutline() {         if (SelectCommand.isSelected() && !(MoveCommand.isMoveSelected())) {             selectedShapeOutline = new OutlineCreator();             selectedShapeOutline.shapeOutline();         }         if (MoveCommand.isMoveSelected() && !(ApplicationState.isUndoSelected())) {             selectedShapeOutline1 = new OutlineCreator();             selectedShapeOutline1.shapeOutline();         }         if(ApplicationState.isUndoSelected() && !(ApplicationState.isRedoSelected())) {             selectedShapeOutline2 = new OutlineCreator();             selectedShapeOutline2.shapeOutline();         }         if(ApplicationState.isRedoSelected()) {             selectedShapeOutline3 = new OutlineCreator();             selectedShapeOutline3.shapeOutline();         }     } } src/model/OutlineRectangle.java src/model/OutlineRectangle.java package model; import java.awt.*; import view.interfaces.PaintCanvasBase; public class OutlineRectangle {     public void draw(int startPointX, int startPointY, int width, int height, PaintCanvasBase paintCanvas) {         Point startPoint = new Point(startPointX - 5,startPointY - 5);         Point endPoint = new Point (startPointX + width + 5, startPointY + height + 5);         Graphics2D graphics2d = paintCanvas.getGraphics2D();         Stroke stroke = new BasicStroke(3, BasicStroke.CAP_BUTT,                 BasicStroke.JOIN_BEVEL, 1, new float[]{9}, 0);         graphics2d.setStroke(stroke);         graphics2d.setColor(Color.BLACK);         graphics2d.drawRect(startPoint.getX(), startPoint.getY(), Math.abs(startPoint.getX() - endPoint.getX()),                 Math.abs(startPoint.getY() - endPoint.getY()));     } } src/model/OutlineTriangle.java src/model/OutlineTriangle.java package model; import view.interfaces.PaintCanvasBase; import java.awt.*; public class OutlineTriangle {     public void draw(int xValues[], int yValues[], PaintCanvasBase paintCanvas) {         Graphics2D graphics2d = paintCanvas.getGraphics2D();         Stroke stroke = new BasicStroke(3, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 1,                 new float[]{9}, 0);         graphics2d.setStroke(stroke);         graphics2d.setColor(Color.BLACK);         int[] tempXValues = {0, 0, 0};         int[] tempYValues = {0, 0, 0};         if (xValues[0] 
There are no answers to this question.
Login to buy an answer or post yours. You can also vote on other others

Get Help With a similar task to - Have certain code match Flyweight Design Pattern

Related Questions

Similar orders to Have certain code match Flyweight Design Pattern
Popular Services
Tutlance Experts offer help in a wide range of topics. Here are some of our top services: