keychera / AquaAesthetic

The last Java project for OOP
0 stars 0 forks source link

<Design> move Java swing timer loop to Controller class #1

Closed keychera closed 7 years ago

keychera commented 7 years ago

logically move this snippet from RandomShape.java

timer = new Timer(30, new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                for (Shape shape : shapes) {
                    shape.move();
                    shape.decreaseDelay();
                    repaint();
                }
            }
        });

outside the Swing environment

keychera commented 7 years ago

a related material regarding the solution to this MVC pattern and Java Swing timer from MIT

keychera commented 7 years ago

branch implementMVC's structure has addressed this issue the pattern follows RandomShapeMVC.zip and that MIT course on the above links