@@ -0,0 +1,3349 @@
+package smp.presenters.buttons;%0A%0Aimport javafx.beans.property.BooleanProperty;%0Aimport javafx.beans.property.DoubleProperty;%0Aimport javafx.beans.property.ObjectProperty;%0Aimport javafx.scene.image.ImageView;%0Aimport javafx.scene.input.MouseEvent;%0Aimport smp.fx.Dialog;%0Aimport smp.models.staff.StaffArrangement;%0Aimport smp.models.staff.StaffSequence;%0Aimport smp.models.stateMachine.ProgramState;%0Aimport smp.models.stateMachine.StateMachine;%0Aimport smp.models.stateMachine.Variables;%0Aimport smp.presenters.api.button.ImagePushButton;%0A%0A/**%0A * This is the button that creates a new song.%0A *%0A * @author RehdBlob%0A * @since 2013.12.18%0A *%0A */%0Apublic class NewButtonPresenter extends ImagePushButton %7B%0A%0A%09//TODO: auto-add these model comments%0A%09//====Models====%0A    private ObjectProperty%3CStaffSequence%3E theSequence;%0A%09private DoubleProperty measureLineNum;%0A%09private BooleanProperty songModified;%0A%09private BooleanProperty arrModified;%0A%09private ObjectProperty%3CStaffArrangement%3E theArrangement;%0A%0A%09/**%0A     * Default constructor.%0A     *%0A     * @param newButton%0A     *            This is the %3Ccode%3EImageView%3C/code%3E object that will house the%0A     *            Load button.%0A     * @param ct%0A     *            The FXML controller object.%0A     * @param im%0A     *            The Image loader object.%0A     */%0A    public NewButtonPresenter(ImageView newButton) %7B%0A        super(newButton);%0A        this.theSequence = Variables.theSequence;%0A        this.measureLineNum = StateMachine.getMeasureLineNum();%0A        this.songModified = StateMachine.getSongModified();%0A        this.arrModified = StateMachine.getArrModified();%0A        this.theArrangement = Variables.theArrangement;%0A    %7D%0A%0A    @Override%0A    protected void reactPressed(MouseEvent event) %7B%0A        ProgramState curr = StateMachine.getState().get();%0A        if (curr == ProgramState.EDITING)%0A            newSong();%0A        else if (curr == ProgramState.ARR_EDITING)%0A            newArrangement();%0A    %7D%0A%0A    @Override%0A    protected void reactReleased(MouseEvent event) %7B%0A        // do nothing.%0A    %7D%0A%0A    /**%0A     * Creates a new song and clears the staff of all notes. Make sure you save%0A     * your song first! The action is ignored if the song is playing.%0A     */%0A    private void newSong() %7B%0A        boolean cont = true;%0A        if (this.songModified.get())%0A            cont = Dialog%0A                    .showYesNoDialog(%22The current song has been modified!%5Cn%22%0A                            + %22Create a new song anyway?%22);%0A%0A        if (cont) %7B%0A            this.theSequence.set(new StaffSequence());%0A//            theStaff.setSequenceFile(null);??%0A            measureLineNum.set(0);%0A            this.songModified.set(false);%0A        %7D%0A    %7D%0A%0A    /**%0A     * Creates a new arrangement and clears the staff of all notes. Make sure%0A     * you save your arrangement first! The action is ignored if an arrangement%0A     * is playing.%0A     */%0A    private void newArrangement() %7B%0A        boolean cont = true;%0A        if (this.arrModified.get()) %7B%0A            cont = Dialog%0A                    .showYesNoDialog(%22The current arrangement has been%5Cn%22%0A                            + %22modified! Create a new arrangement%5Cnanyway?%22);%0A        %7D%0A        if (cont) %7B%0A        %09this.theArrangement.set(new StaffArrangement());%0A//            theStaff.setArrangementFile(null);??%0A            this.arrModified.set(false);%0A        %7D%0A    %7D%0A%0A%7D%0A

add newbuttonpresenter