Skip to content

Commit

Permalink
🌊refactor: remove unused file
Browse files Browse the repository at this point in the history
  • Loading branch information
xxrjun committed Apr 16, 2024
1 parent df49dbc commit 5887087
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.xxrjun.modes;
package com.xxrjun.factories;

import com.xxrjun.components.uml.basics.UMLBasicObject;
import com.xxrjun.components.uml.basics.ClassBasicObject;
Expand All @@ -18,11 +18,11 @@
*/
// TODO: Could be improved, but now I don't have time QQ
// ref: https://java-design-patterns.com/patterns/abstract-factory/#applicability
public abstract class UMLFactory {
public abstract class UMLObjectFactory {

private static final Logger logger = LoggerFactory.getLogger(UMLFactory.class);
private static final Logger logger = LoggerFactory.getLogger(UMLObjectFactory.class);

private UMLFactory() {
private UMLObjectFactory() {
throw new IllegalStateException("Utility class");
}

Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/xxrjun/modes/CreateBasicUMLObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.xxrjun.components.uml.basics.UMLBasicObject;
import com.xxrjun.enums.UMLObjectTypes;
import com.xxrjun.factories.UMLObjectFactory;

import java.awt.event.MouseEvent;

Expand All @@ -23,7 +24,7 @@ public CreateBasicUMLObject(UMLObjectTypes objectType) {

@Override
public void mousePressed(MouseEvent e) {
UMLBasicObject newUMLBasicObject = UMLFactory.createUMLBasicObject(objectType, e.getPoint());
UMLBasicObject newUMLBasicObject = UMLObjectFactory.createUMLBasicObject(objectType, e.getPoint());
canvas.addUMLObject(newUMLBasicObject);
canvas.repaint();
}
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/com/xxrjun/modes/CreateUMLConnectionLine.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.xxrjun.components.uml.basics.UMLBasicObject;
import com.xxrjun.components.uml.connectionlines.UMLConnectionLine;
import com.xxrjun.enums.UMLObjectTypes;
import com.xxrjun.factories.UMLObjectFactory;

import java.awt.*;
import java.awt.event.MouseEvent;
Expand Down Expand Up @@ -62,7 +63,7 @@ public void mouseReleased(MouseEvent e) {

if (endPoint != null && startPoint != null) {
// Create the connection line
UMLConnectionLine newConnectionLine = UMLFactory.createUMLConnectionLine(lineType, startPoint, endPoint);
UMLConnectionLine newConnectionLine = UMLObjectFactory.createUMLConnectionLine(lineType, startPoint, endPoint);
canvas.addUMLObject(newConnectionLine);

// Set port for line
Expand All @@ -87,7 +88,7 @@ public void mouseReleased(MouseEvent e) {
public void mouseDragged(MouseEvent e) {
// Display temporary dragged line
if (startPoint != null) {
UMLConnectionLine tmpConnectionLine = UMLFactory.createUMLConnectionLine(lineType, startPoint, e.getPoint());
UMLConnectionLine tmpConnectionLine = UMLObjectFactory.createUMLConnectionLine(lineType, startPoint, e.getPoint());
canvas.setTmpConnectionLine(tmpConnectionLine);
canvas.repaint();
}
Expand Down
15 changes: 0 additions & 15 deletions src/main/java/com/xxrjun/modes/UMLFactoryInterface.java

This file was deleted.

0 comments on commit 5887087

Please sign in to comment.