Skip to content

Commit

Permalink
updating
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Leiser authored and Kevin Leiser committed Jun 22, 2018
1 parent a94f233 commit e7d8f49
Show file tree
Hide file tree
Showing 23 changed files with 956 additions and 10 deletions.
918 changes: 918 additions & 0 deletions .idea/workspace.xml

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified out/production/HW6/cs3500/animator/util/DrawableTextShape.class
Binary file not shown.
Binary file modified out/production/HW6/cs3500/animator/view/IView$ViewType.class
Binary file not shown.
Binary file modified out/production/HW6/cs3500/animator/view/IView.class
Binary file not shown.
Binary file modified out/production/HW6/cs3500/animator/view/InteractiveViewGUI.class
Binary file not shown.
Binary file modified out/production/HW6/cs3500/animator/view/ViewGUI.class
Binary file not shown.
Binary file modified out/production/HW6/cs3500/animator/view/ViewText.class
Binary file not shown.
3 changes: 2 additions & 1 deletion src/cs3500/animator/controller/AbstractController.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
import cs3500.animator.model.animation.IAnimationModel;

/**
* Abstract controller class containing identical properties/methods for all controllers.
* Abstract controller class containing identical properties/methods for all animation
* controllers.
*/
public abstract class AbstractController implements IController {

Expand Down
4 changes: 2 additions & 2 deletions src/cs3500/animator/controller/ControllerFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


/**
* This class is for creating instances of {@link IController}.
* This class is for creating instances of {@link IController} for animations.
*/
public class ControllerFactory {

Expand All @@ -19,7 +19,7 @@ public class ControllerFactory {
* @param model the Animation model.
* @param fps the speed of the cs3500.animator.model.animation in frames per second.
* @param outfile the output file location. This is only used for view types text and svg
* @return
* @return a new, configured controller.
*/
public static IController getController(String type, IView view, IAnimationModel model, int fps,
String outfile) {
Expand Down
3 changes: 1 addition & 2 deletions src/cs3500/animator/controller/HybridController.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
import java.awt.event.ActionEvent;

import cs3500.animator.model.animation.IAnimationModel;
import cs3500.animator.view.IGuiInteractiveView;
import cs3500.animator.view.InteractiveViewGUI;
import cs3500.animator.view.TextBasedView;
import cs3500.animator.view.ViewSVG;

/**
*
* Hybrid Controller is an interacted controller than the user can interface with.
*/
public class HybridController extends InteractiveController {
private IController fileOutputController;
Expand Down
2 changes: 2 additions & 0 deletions src/cs3500/animator/controller/InteractiveController.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
import cs3500.animator.view.InteractiveViewGUI;

public class InteractiveController extends ControllerGUI implements Listener {

InteractiveViewGUI interactiveView;

/**
* Constructor for the GUI controller. Reads data from model and tells the view what to print.
*
Expand Down
22 changes: 20 additions & 2 deletions src/cs3500/animator/controller/Listener.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
package cs3500.animator.controller;

/**
* Listener is an object that listens for a change from the view so the controller can decide
* what is to be done next.
*/
public interface Listener {

/**
* Enumeration of types of Gui events
*/
enum GuiEventType { RESTART, CHANGE_SPEED, START_STOP, TOGGLE_LOOPING, EXPORT }

public void action(GuiEventType type);
/**
* This fires when a GuiEvent happens that doesn't need a remembered state (i.e. the restart
* button may have been pressed).
* @param type type of Gui event. Can only be RESTART, START/STOP, TOGGLE_LOOPING, or EXPORT
*/
void action(GuiEventType type);

public void change(GuiEventType type, int value);
/**
* This fires when an event that requires a variable value happens (i.e. change speed).
* @param type
* @param value
*/
void change(GuiEventType type, int value);
}
8 changes: 8 additions & 0 deletions src/cs3500/animator/model/animation/AnimationModelImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,18 @@
import cs3500.animator.model.shapes.Rectangle;
import cs3500.animator.util.TweenModelBuilder;

/**
* This class implements IAnimationModel. This is the model for animations and stores information
* on which shapes will be in the animation and what changes they may undergo.
*/
public class AnimationModelImpl implements IAnimationModel, Serializable {
LinkedHashMap<String, IAnimatedShape> shapes;
List<IChange> changes;

/**
* Default constructor creates a new model and instantiates private fields to store
* the changes and shapes of the animation.
*/
public AnimationModelImpl() {
changes = new ArrayList<>();
shapes = new LinkedHashMap<>();
Expand Down
1 change: 0 additions & 1 deletion src/cs3500/animator/model/animation/ChangeImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ public class ChangeImpl extends AbstractChange {

/**
* This is the constructor for the ChangeImpl class.
*
* @param id the id of the shape.
* @param start the frame when the shape appears.
* @param end the frame when the shape disappears.
Expand Down
2 changes: 1 addition & 1 deletion src/cs3500/animator/util/AbstractDrawableShape.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import java.awt.Color;

/**
* This interface is for a shape that can be used by the various views.
* This abstract class is for a shape that can be used by the various views.
*/
public abstract class AbstractDrawableShape implements IDrawableShape {

Expand Down
3 changes: 2 additions & 1 deletion src/cs3500/animator/view/ViewGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@

/**
* This class serves as both an IView object and a JFrame for cs3500.animator.model.animation.
* This will serve as a visual GUI display for animations.
*/
public class ViewGUI extends JFrame implements IGuiView {
private ShapePanel panel;
private ViewType viewType;

/**
* This is the default constructor.
* This is the default constructor. Creates a new GUI view.
*/
public ViewGUI() {
super();
Expand Down

0 comments on commit e7d8f49

Please sign in to comment.