{"action":"created","comment":{"url":"https://api.github.com/repos/garnryang/Team8/pulls/comments/34852672","id":34852672,"diff_hunk":"@@ -346,12 +382,162 @@ private void radHardActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRS\n \tprivate void jButton11ActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_jButton11ActionPerformed\n \t\t// TODO add your handling code here:\n \t\t// Create a file chooser\n+\t\t\n \t\tfinal JFileChooser fc = new JFileChooser();\n-\t\t// In response to a button click:\n+\t\tfc.setFileFilter(new FileFilter()\n+        {\n+           @Override\n+           public boolean accept(File file)\n+           {\n+              return (file.getName().toUpperCase().endsWith(\".SUDOKU\") || file.isDirectory());\n+           }\n+\n+           @Override\n+           public String getDescription()\n+           {\n+              return \"Sudoku files\";\n+           }\n+        });\n+\t\t\n+\t\tfc.setAcceptAllFileFilterUsed(false);\n \t\tint returnVal = fc.showOpenDialog(getComponent(0));\n \n+\t\tif(returnVal == JFileChooser.APPROVE_OPTION){\n+\t\t\n+\t\t\tSavePackage savePackage = null;\n+\t      try\n+\t      {\n+\t         FileInputStream fileIn = new FileInputStream(fc.getSelectedFile().getAbsolutePath());\n+\t         ObjectInputStream in = new ObjectInputStream(fileIn);\n+\t         savePackage = (SavePackage) in.readObject();\n+\t         in.close();\n+\t         fileIn.close();\n+\t         this.loadSession(savePackage);\n+\t      }catch(IOException i)\n+\t      {\n+\t         i.printStackTrace();\n+\t         return;\n+\t      }catch(ClassNotFoundException c)\n+\t      {\n+\t         System.out.println(\"Employee class not found\");\n+\t         c.printStackTrace();\n+\t         return;\n+\t      }\n+\t\t}\n+\t\t\n \t}// GEN-LAST:event_jButton11ActionPerformed\n+\t\n \n+\t\n+    private void jButton10ActionPerformed(java.awt.event.ActionEvent evt) throws FileNotFoundException {\n+\t\t\n+\t\t\n+\t\tfinal JFileChooser fc = new JFileChooser();\n+\n+\t\tfc.setFileFilter(new FileFilter()\n+        {\n+           @Override\n+           public boolean accept(File file)\n+           {\n+              return (file.getName().toUpperCase().endsWith(\".SUDOKU\") || file.isDirectory());\n+           }\n+\n+           @Override\n+           public String getDescription()\n+           {\n+              return \"Sudoku files\";\n+           }\n+        });\n+\t\t\n+\t\tfc.setAcceptAllFileFilterUsed(false);\n+\t\t\n+\t\tint returnVal = fc.showSaveDialog(getComponent(0));;\n+\t\t\n+\t\tif(returnVal == JFileChooser.APPROVE_OPTION){\n+\t\t\t\n+\n+\t\t\t\tFile f = fc.getSelectedFile();\n+\t\t\t\tString path = f.getAbsolutePath();\n+\t\t\t\t\n+\t\t\t\tif(f.exists()){\n+\t\t            int result = JOptionPane.showConfirmDialog(this,\"The file exists, overwrite?\",\"Existing file\",JOptionPane.YES_NO_CANCEL_OPTION);\n+\t\t            switch(result){\n+\t\t                case JOptionPane.YES_OPTION:\n+\t\t                    fc.approveSelection();\n+\t\t                   // savePuzzle(path);\n+\t\t                    return;\n+\t\t                case JOptionPane.NO_OPTION:\n+\t\t                    return;\n+\t\t                case JOptionPane.CLOSED_OPTION:\n+\t\t                    return;\n+\t\t                case JOptionPane.CANCEL_OPTION:\n+\t\t                    fc.cancelSelection();\n+\t\t                    return;\n+\t\t            }\n+\t\t        }\n+\t\t        fc.approveSelection();\n+\t\t        savePuzzle(path);\n+\t\t        \n+\t\t        gameBoard.remarkGivenCells(this.gameSession.getGameBoard().getCellGrid());\n+\t\t      }\n+\t\t\t}\n+\t\t\t\n+    private void savePuzzle(String path){\n+\t\ttry\n+\t      {\n+\t\t\n+\t\t\tif(!path.toLowerCase().endsWith(\".sudoku\")){\n+\t\t\t\tpath = path + \".sudoku\";\n+\t\t\t}\n+\t\t\t\n+\t\t\tSavePackage savePackage = new SavePackage();\n+\t\t\tsavePackage.setCellGrid(this.gameSession.getGameBoard().getCellGrid());\n+\t\t\tsavePackage.setPuzzle(this.gameSession.getGameBoard().getCurrentPuzzle());\n+\t\t\tsavePackage.setControlGrid(this.gameBoard.getControlGrid());","path":"src/edu/psu/sweng500/team8/gui/SudokuGUI.java","position":202,"original_position":203,"commit_id":"0f283ad9a21aa89f58754458e9585af649d42163","original_commit_id":"81e16a53cd0f1cc12a9f7152db1c2433729b4788","user":{"login":"dreeds","id":12604353,"avatar_url":"https://avatars.githubusercontent.com/u/12604353?v=3","gravatar_id":"","url":"https://api.github.com/users/dreeds","html_url":"https://github.com/dreeds","followers_url":"https://api.github.com/users/dreeds/followers","following_url":"https://api.github.com/users/dreeds/following{/other_user}","gists_url":"https://api.github.com/users/dreeds/gists{/gist_id}","starred_url":"https://api.github.com/users/dreeds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dreeds/subscriptions","organizations_url":"https://api.github.com/users/dreeds/orgs","repos_url":"https://api.github.com/users/dreeds/repos","events_url":"https://api.github.com/users/dreeds/events{/privacy}","received_events_url":"https://api.github.com/users/dreeds/received_events","type":"User","site_admin":false},"body":"The board has swing components which aren't serializable. ","created_at":"2015-07-17T00:21:58Z","updated_at":"2015-07-17T00:21:58Z","html_url":"https://github.com/garnryang/Team8/pull/17#discussion_r34852672","pull_request_url":"https://api.github.com/repos/garnryang/Team8/pulls/17","_links":{"self":{"href":"https://api.github.com/repos/garnryang/Team8/pulls/comments/34852672"},"html":{"href":"https://github.com/garnryang/Team8/pull/17#discussion_r34852672"},"pull_request":{"href":"https://api.github.com/repos/garnryang/Team8/pulls/17"}}},"pull_request":{"url":"https://api.github.com/repos/garnryang/Team8/pulls/17","id":40114251,"html_url":"https://github.com/garnryang/Team8/pull/17","diff_url":"https://github.com/garnryang/Team8/pull/17.diff","patch_url":"https://github.com/garnryang/Team8/pull/17.patch","issue_url":"https://api.github.com/repos/garnryang/Team8/issues/17","number":17,"state":"open","locked":false,"title":"David","user":{"login":"dreeds","id":12604353,"avatar_url":"https://avatars.githubusercontent.com/u/12604353?v=3","gravatar_id":"","url":"https://api.github.com/users/dreeds","html_url":"https://github.com/dreeds","followers_url":"https://api.github.com/users/dreeds/followers","following_url":"https://api.github.com/users/dreeds/following{/other_user}","gists_url":"https://api.github.com/users/dreeds/gists{/gist_id}","starred_url":"https://api.github.com/users/dreeds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dreeds/subscriptions","organizations_url":"https://api.github.com/users/dreeds/orgs","repos_url":"https://api.github.com/users/dreeds/repos","events_url":"https://api.github.com/users/dreeds/events{/privacy}","received_events_url":"https://api.github.com/users/dreeds/received_events","type":"User","site_admin":false},"body":"Implemented save/load","created_at":"2015-07-16T10:17:51Z","updated_at":"2015-07-17T00:21:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8eb24efda1314abe09a24673271ef271a53623ea","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/garnryang/Team8/pulls/17/commits","review_comments_url":"https://api.github.com/repos/garnryang/Team8/pulls/17/comments","review_comment_url":"https://api.github.com/repos/garnryang/Team8/pulls/comments{/number}","comments_url":"https://api.github.com/repos/garnryang/Team8/issues/17/comments","statuses_url":"https://api.github.com/repos/garnryang/Team8/statuses/0f283ad9a21aa89f58754458e9585af649d42163","head":{"label":"garnryang:David-3","ref":"David-3","sha":"0f283ad9a21aa89f58754458e9585af649d42163","user":{"login":"garnryang","id":12421716,"avatar_url":"https://avatars.githubusercontent.com/u/12421716?v=3","gravatar_id":"","url":"https://api.github.com/users/garnryang","html_url":"https://github.com/garnryang","followers_url":"https://api.github.com/users/garnryang/followers","following_url":"https://api.github.com/users/garnryang/following{/other_user}","gists_url":"https://api.github.com/users/garnryang/gists{/gist_id}","starred_url":"https://api.github.com/users/garnryang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garnryang/subscriptions","organizations_url":"https://api.github.com/users/garnryang/orgs","repos_url":"https://api.github.com/users/garnryang/repos","events_url":"https://api.github.com/users/garnryang/events{/privacy}","received_events_url":"https://api.github.com/users/garnryang/received_events","type":"User","site_admin":false},"repo":{"id":35524748,"name":"Team8","full_name":"garnryang/Team8","owner":{"login":"garnryang","id":12421716,"avatar_url":"https://avatars.githubusercontent.com/u/12421716?v=3","gravatar_id":"","url":"https://api.github.com/users/garnryang","html_url":"https://github.com/garnryang","followers_url":"https://api.github.com/users/garnryang/followers","following_url":"https://api.github.com/users/garnryang/following{/other_user}","gists_url":"https://api.github.com/users/garnryang/gists{/gist_id}","starred_url":"https://api.github.com/users/garnryang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garnryang/subscriptions","organizations_url":"https://api.github.com/users/garnryang/orgs","repos_url":"https://api.github.com/users/garnryang/repos","events_url":"https://api.github.com/users/garnryang/events{/privacy}","received_events_url":"https://api.github.com/users/garnryang/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/garnryang/Team8","description":"SWENG500 - Team8","fork":false,"url":"https://api.github.com/repos/garnryang/Team8","forks_url":"https://api.github.com/repos/garnryang/Team8/forks","keys_url":"https://api.github.com/repos/garnryang/Team8/keys{/key_id}","collaborators_url":"https://api.github.com/repos/garnryang/Team8/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/garnryang/Team8/teams","hooks_url":"https://api.github.com/repos/garnryang/Team8/hooks","issue_events_url":"https://api.github.com/repos/garnryang/Team8/issues/events{/number}","events_url":"https://api.github.com/repos/garnryang/Team8/events","assignees_url":"https://api.github.com/repos/garnryang/Team8/assignees{/user}","branches_url":"https://api.github.com/repos/garnryang/Team8/branches{/branch}","tags_url":"https://api.github.com/repos/garnryang/Team8/tags","blobs_url":"https://api.github.com/repos/garnryang/Team8/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/garnryang/Team8/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/garnryang/Team8/git/refs{/sha}","trees_url":"https://api.github.com/repos/garnryang/Team8/git/trees{/sha}","statuses_url":"https://api.github.com/repos/garnryang/Team8/statuses/{sha}","languages_url":"https://api.github.com/repos/garnryang/Team8/languages","stargazers_url":"https://api.github.com/repos/garnryang/Team8/stargazers","contributors_url":"https://api.github.com/repos/garnryang/Team8/contributors","subscribers_url":"https://api.github.com/repos/garnryang/Team8/subscribers","subscription_url":"https://api.github.com/repos/garnryang/Team8/subscription","commits_url":"https://api.github.com/repos/garnryang/Team8/commits{/sha}","git_commits_url":"https://api.github.com/repos/garnryang/Team8/git/commits{/sha}","comments_url":"https://api.github.com/repos/garnryang/Team8/comments{/number}","issue_comment_url":"https://api.github.com/repos/garnryang/Team8/issues/comments{/number}","contents_url":"https://api.github.com/repos/garnryang/Team8/contents/{+path}","compare_url":"https://api.github.com/repos/garnryang/Team8/compare/{base}...{head}","merges_url":"https://api.github.com/repos/garnryang/Team8/merges","archive_url":"https://api.github.com/repos/garnryang/Team8/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/garnryang/Team8/downloads","issues_url":"https://api.github.com/repos/garnryang/Team8/issues{/number}","pulls_url":"https://api.github.com/repos/garnryang/Team8/pulls{/number}","milestones_url":"https://api.github.com/repos/garnryang/Team8/milestones{/number}","notifications_url":"https://api.github.com/repos/garnryang/Team8/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/garnryang/Team8/labels{/name}","releases_url":"https://api.github.com/repos/garnryang/Team8/releases{/id}","created_at":"2015-05-13T02:51:29Z","updated_at":"2015-05-26T01:39:48Z","pushed_at":"2015-07-16T23:25:15Z","git_url":"git://github.com/garnryang/Team8.git","ssh_url":"git@github.com:garnryang/Team8.git","clone_url":"https://github.com/garnryang/Team8.git","svn_url":"https://github.com/garnryang/Team8","homepage":null,"size":3041,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"garnryang:master","ref":"master","sha":"8faf419370df75a53a77371d7c8fd1025d9eb7c1","user":{"login":"garnryang","id":12421716,"avatar_url":"https://avatars.githubusercontent.com/u/12421716?v=3","gravatar_id":"","url":"https://api.github.com/users/garnryang","html_url":"https://github.com/garnryang","followers_url":"https://api.github.com/users/garnryang/followers","following_url":"https://api.github.com/users/garnryang/following{/other_user}","gists_url":"https://api.github.com/users/garnryang/gists{/gist_id}","starred_url":"https://api.github.com/users/garnryang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garnryang/subscriptions","organizations_url":"https://api.github.com/users/garnryang/orgs","repos_url":"https://api.github.com/users/garnryang/repos","events_url":"https://api.github.com/users/garnryang/events{/privacy}","received_events_url":"https://api.github.com/users/garnryang/received_events","type":"User","site_admin":false},"repo":{"id":35524748,"name":"Team8","full_name":"garnryang/Team8","owner":{"login":"garnryang","id":12421716,"avatar_url":"https://avatars.githubusercontent.com/u/12421716?v=3","gravatar_id":"","url":"https://api.github.com/users/garnryang","html_url":"https://github.com/garnryang","followers_url":"https://api.github.com/users/garnryang/followers","following_url":"https://api.github.com/users/garnryang/following{/other_user}","gists_url":"https://api.github.com/users/garnryang/gists{/gist_id}","starred_url":"https://api.github.com/users/garnryang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garnryang/subscriptions","organizations_url":"https://api.github.com/users/garnryang/orgs","repos_url":"https://api.github.com/users/garnryang/repos","events_url":"https://api.github.com/users/garnryang/events{/privacy}","received_events_url":"https://api.github.com/users/garnryang/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/garnryang/Team8","description":"SWENG500 - Team8","fork":false,"url":"https://api.github.com/repos/garnryang/Team8","forks_url":"https://api.github.com/repos/garnryang/Team8/forks","keys_url":"https://api.github.com/repos/garnryang/Team8/keys{/key_id}","collaborators_url":"https://api.github.com/repos/garnryang/Team8/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/garnryang/Team8/teams","hooks_url":"https://api.github.com/repos/garnryang/Team8/hooks","issue_events_url":"https://api.github.com/repos/garnryang/Team8/issues/events{/number}","events_url":"https://api.github.com/repos/garnryang/Team8/events","assignees_url":"https://api.github.com/repos/garnryang/Team8/assignees{/user}","branches_url":"https://api.github.com/repos/garnryang/Team8/branches{/branch}","tags_url":"https://api.github.com/repos/garnryang/Team8/tags","blobs_url":"https://api.github.com/repos/garnryang/Team8/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/garnryang/Team8/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/garnryang/Team8/git/refs{/sha}","trees_url":"https://api.github.com/repos/garnryang/Team8/git/trees{/sha}","statuses_url":"https://api.github.com/repos/garnryang/Team8/statuses/{sha}","languages_url":"https://api.github.com/repos/garnryang/Team8/languages","stargazers_url":"https://api.github.com/repos/garnryang/Team8/stargazers","contributors_url":"https://api.github.com/repos/garnryang/Team8/contributors","subscribers_url":"https://api.github.com/repos/garnryang/Team8/subscribers","subscription_url":"https://api.github.com/repos/garnryang/Team8/subscription","commits_url":"https://api.github.com/repos/garnryang/Team8/commits{/sha}","git_commits_url":"https://api.github.com/repos/garnryang/Team8/git/commits{/sha}","comments_url":"https://api.github.com/repos/garnryang/Team8/comments{/number}","issue_comment_url":"https://api.github.com/repos/garnryang/Team8/issues/comments{/number}","contents_url":"https://api.github.com/repos/garnryang/Team8/contents/{+path}","compare_url":"https://api.github.com/repos/garnryang/Team8/compare/{base}...{head}","merges_url":"https://api.github.com/repos/garnryang/Team8/merges","archive_url":"https://api.github.com/repos/garnryang/Team8/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/garnryang/Team8/downloads","issues_url":"https://api.github.com/repos/garnryang/Team8/issues{/number}","pulls_url":"https://api.github.com/repos/garnryang/Team8/pulls{/number}","milestones_url":"https://api.github.com/repos/garnryang/Team8/milestones{/number}","notifications_url":"https://api.github.com/repos/garnryang/Team8/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/garnryang/Team8/labels{/name}","releases_url":"https://api.github.com/repos/garnryang/Team8/releases{/id}","created_at":"2015-05-13T02:51:29Z","updated_at":"2015-05-26T01:39:48Z","pushed_at":"2015-07-16T23:25:15Z","git_url":"git://github.com/garnryang/Team8.git","ssh_url":"git@github.com:garnryang/Team8.git","clone_url":"https://github.com/garnryang/Team8.git","svn_url":"https://github.com/garnryang/Team8","homepage":null,"size":3041,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/garnryang/Team8/pulls/17"},"html":{"href":"https://github.com/garnryang/Team8/pull/17"},"issue":{"href":"https://api.github.com/repos/garnryang/Team8/issues/17"},"comments":{"href":"https://api.github.com/repos/garnryang/Team8/issues/17/comments"},"review_comments":{"href":"https://api.github.com/repos/garnryang/Team8/pulls/17/comments"},"review_comment":{"href":"https://api.github.com/repos/garnryang/Team8/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/garnryang/Team8/pulls/17/commits"},"statuses":{"href":"https://api.github.com/repos/garnryang/Team8/statuses/0f283ad9a21aa89f58754458e9585af649d42163"}}}}