{"action":"created","comment":{"url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/pulls/comments/45794845","id":45794845,"diff_hunk":"@@ -0,0 +1,171 @@\n+package ru.unn.agile.HexBinOctCalculator.viewmodel;\n+\n+import javafx.beans.binding.BooleanBinding;\n+import javafx.beans.property.*;\n+import javafx.beans.value.ChangeListener;\n+import javafx.beans.value.ObservableValue;\n+import javafx.collections.FXCollections;\n+import javafx.collections.ObservableList;\n+import ru.unn.agile.HexBinOctCalculator.Model.Number;\n+import ru.unn.agile.HexBinOctCalculator.Model.NumeralSystem;\n+import ru.unn.agile.HexBinOctCalculator.Model.HexBinOctCalculator.Operation;\n+\n+import java.util.ArrayList;\n+import java.util.List;\n+\n+public class ViewModel {\n+    private final StringProperty value1 = new SimpleStringProperty();\n+    private final StringProperty value2 = new SimpleStringProperty();\n+\n+    private final ObjectProperty<ObservableList<NumeralSystem>> systems =\n+            new SimpleObjectProperty<>(FXCollections.observableArrayList(NumeralSystem.values()));\n+    private final ObjectProperty<NumeralSystem> system1 = new SimpleObjectProperty<>();\n+    private final ObjectProperty<NumeralSystem> system2 = new SimpleObjectProperty<>();\n+    private final ObjectProperty<NumeralSystem> finalSystem = new SimpleObjectProperty<>();\n+    private final ObjectProperty<ObservableList<Operation>> operations =\n+            new SimpleObjectProperty<>(FXCollections.observableArrayList(Operation.values()));\n+    private final ObjectProperty<Operation> operation = new SimpleObjectProperty<>();\n+    private final BooleanProperty calculationDisabled = new SimpleBooleanProperty();\n+\n+    private final StringProperty result = new SimpleStringProperty();\n+    private final StringProperty status = new SimpleStringProperty();\n+\n+    private final List<ValueChangeListener> valueChangedListeners = new ArrayList<>();\n+\n+    public ViewModel() {\n+        value1.set(\"\");\n+        system1.set(NumeralSystem.BIN);\n+        value2.set(\"\");\n+        system2.set(NumeralSystem.BIN);\n+        finalSystem.set(NumeralSystem.HEX);\n+        operation.set(Operation.ADD);\n+        result.set(\"\");\n+        status.set(Status.WAITING.toString());\n+\n+        BooleanBinding couldCalculate = new BooleanBinding() {\n+            {\n+                super.bind(value1, value2);\n+            }\n+            @Override\n+            protected boolean computeValue() {\n+                return getInputStatus() == Status.READY;\n+            }\n+        };\n+        calculationDisabled.bind(couldCalculate.not());\n+\n+        final List<StringProperty> fields = new ArrayList<StringProperty>() { {\n+            add(value1);\n+            add(value2);\n+        } };\n+\n+        for (StringProperty field : fields) {\n+            final ValueChangeListener listener = new ValueChangeListener();\n+            field.addListener(listener);\n+            valueChangedListeners.add(listener);\n+        }\n+    }\n+\n+    public void calculate() {\n+        if (calculationDisabled.get()) {","path":"code/korotaev-pavel/ViewModel/src/main/java/ru/unn/agile/HexBinOctCalculator/viewmodel/ViewModel.java","position":69,"original_position":69,"commit_id":"09b0fa3634e4209a15f0bbfa257c72a475116891","original_commit_id":"09b0fa3634e4209a15f0bbfa257c72a475116891","user":{"login":"Daniil-Osokin","id":2491976,"avatar_url":"https://avatars.githubusercontent.com/u/2491976?v=3","gravatar_id":"","url":"https://api.github.com/users/Daniil-Osokin","html_url":"https://github.com/Daniil-Osokin","followers_url":"https://api.github.com/users/Daniil-Osokin/followers","following_url":"https://api.github.com/users/Daniil-Osokin/following{/other_user}","gists_url":"https://api.github.com/users/Daniil-Osokin/gists{/gist_id}","starred_url":"https://api.github.com/users/Daniil-Osokin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Daniil-Osokin/subscriptions","organizations_url":"https://api.github.com/users/Daniil-Osokin/orgs","repos_url":"https://api.github.com/users/Daniil-Osokin/repos","events_url":"https://api.github.com/users/Daniil-Osokin/events{/privacy}","received_events_url":"https://api.github.com/users/Daniil-Osokin/received_events","type":"User","site_admin":false},"body":"Давайте честно, времени мало осталось. Скопипастили?","created_at":"2015-11-24T21:07:24Z","updated_at":"2015-11-24T21:07:24Z","html_url":"https://github.com/UNN-VMK-Software/agile-course-practice/pull/126#discussion_r45794845","pull_request_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/pulls/126","_links":{"self":{"href":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/pulls/comments/45794845"},"html":{"href":"https://github.com/UNN-VMK-Software/agile-course-practice/pull/126#discussion_r45794845"},"pull_request":{"href":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/pulls/126"}}},"pull_request":{"url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/pulls/126","id":51108606,"html_url":"https://github.com/UNN-VMK-Software/agile-course-practice/pull/126","diff_url":"https://github.com/UNN-VMK-Software/agile-course-practice/pull/126.diff","patch_url":"https://github.com/UNN-VMK-Software/agile-course-practice/pull/126.patch","issue_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/issues/126","number":126,"state":"open","locked":false,"title":"Коротаев П. - Лабораторная работа #2","user":{"login":"KorotaevPavel","id":5416984,"avatar_url":"https://avatars.githubusercontent.com/u/5416984?v=3","gravatar_id":"","url":"https://api.github.com/users/KorotaevPavel","html_url":"https://github.com/KorotaevPavel","followers_url":"https://api.github.com/users/KorotaevPavel/followers","following_url":"https://api.github.com/users/KorotaevPavel/following{/other_user}","gists_url":"https://api.github.com/users/KorotaevPavel/gists{/gist_id}","starred_url":"https://api.github.com/users/KorotaevPavel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KorotaevPavel/subscriptions","organizations_url":"https://api.github.com/users/KorotaevPavel/orgs","repos_url":"https://api.github.com/users/KorotaevPavel/repos","events_url":"https://api.github.com/users/KorotaevPavel/events{/privacy}","received_events_url":"https://api.github.com/users/KorotaevPavel/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-18T16:40:09Z","updated_at":"2015-11-24T21:07:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"35b4cc1a0a3dd4c2344560fe400cf1a41080244d","assignee":{"login":"Daniil-Osokin","id":2491976,"avatar_url":"https://avatars.githubusercontent.com/u/2491976?v=3","gravatar_id":"","url":"https://api.github.com/users/Daniil-Osokin","html_url":"https://github.com/Daniil-Osokin","followers_url":"https://api.github.com/users/Daniil-Osokin/followers","following_url":"https://api.github.com/users/Daniil-Osokin/following{/other_user}","gists_url":"https://api.github.com/users/Daniil-Osokin/gists{/gist_id}","starred_url":"https://api.github.com/users/Daniil-Osokin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Daniil-Osokin/subscriptions","organizations_url":"https://api.github.com/users/Daniil-Osokin/orgs","repos_url":"https://api.github.com/users/Daniil-Osokin/repos","events_url":"https://api.github.com/users/Daniil-Osokin/events{/privacy}","received_events_url":"https://api.github.com/users/Daniil-Osokin/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/pulls/126/commits","review_comments_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/pulls/126/comments","review_comment_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/pulls/comments{/number}","comments_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/issues/126/comments","statuses_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/statuses/09b0fa3634e4209a15f0bbfa257c72a475116891","head":{"label":"KorotaevPavel:lab2-mvvm-HexBinOct","ref":"lab2-mvvm-HexBinOct","sha":"09b0fa3634e4209a15f0bbfa257c72a475116891","user":{"login":"KorotaevPavel","id":5416984,"avatar_url":"https://avatars.githubusercontent.com/u/5416984?v=3","gravatar_id":"","url":"https://api.github.com/users/KorotaevPavel","html_url":"https://github.com/KorotaevPavel","followers_url":"https://api.github.com/users/KorotaevPavel/followers","following_url":"https://api.github.com/users/KorotaevPavel/following{/other_user}","gists_url":"https://api.github.com/users/KorotaevPavel/gists{/gist_id}","starred_url":"https://api.github.com/users/KorotaevPavel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KorotaevPavel/subscriptions","organizations_url":"https://api.github.com/users/KorotaevPavel/orgs","repos_url":"https://api.github.com/users/KorotaevPavel/repos","events_url":"https://api.github.com/users/KorotaevPavel/events{/privacy}","received_events_url":"https://api.github.com/users/KorotaevPavel/received_events","type":"User","site_admin":false},"repo":{"id":44621205,"name":"agile-course-practice","full_name":"KorotaevPavel/agile-course-practice","owner":{"login":"KorotaevPavel","id":5416984,"avatar_url":"https://avatars.githubusercontent.com/u/5416984?v=3","gravatar_id":"","url":"https://api.github.com/users/KorotaevPavel","html_url":"https://github.com/KorotaevPavel","followers_url":"https://api.github.com/users/KorotaevPavel/followers","following_url":"https://api.github.com/users/KorotaevPavel/following{/other_user}","gists_url":"https://api.github.com/users/KorotaevPavel/gists{/gist_id}","starred_url":"https://api.github.com/users/KorotaevPavel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KorotaevPavel/subscriptions","organizations_url":"https://api.github.com/users/KorotaevPavel/orgs","repos_url":"https://api.github.com/users/KorotaevPavel/repos","events_url":"https://api.github.com/users/KorotaevPavel/events{/privacy}","received_events_url":"https://api.github.com/users/KorotaevPavel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/KorotaevPavel/agile-course-practice","description":"Проект-шаблон для выполнения лабораторных работ по курсу Agile Development","fork":true,"url":"https://api.github.com/repos/KorotaevPavel/agile-course-practice","forks_url":"https://api.github.com/repos/KorotaevPavel/agile-course-practice/forks","keys_url":"https://api.github.com/repos/KorotaevPavel/agile-course-practice/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KorotaevPavel/agile-course-practice/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KorotaevPavel/agile-course-practice/teams","hooks_url":"https://api.github.com/repos/KorotaevPavel/agile-course-practice/hooks","issue_events_url":"https://api.github.com/repos/KorotaevPavel/agile-course-practice/issues/events{/number}","events_url":"https://api.github.com/repos/KorotaevPavel/agile-course-practice/events","assignees_url":"https://api.github.com/repos/KorotaevPavel/agile-course-practice/assignees{/user}","branches_url":"https://api.github.com/repos/KorotaevPavel/agile-course-practice/branches{/branch}","tags_url":"https://api.github.com/repos/KorotaevPavel/agile-course-practice/tags","blobs_url":"https://api.github.com/repos/KorotaevPavel/agile-course-practice/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KorotaevPavel/agile-course-practice/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KorotaevPavel/agile-course-practice/git/refs{/sha}","trees_url":"https://api.github.com/repos/KorotaevPavel/agile-course-practice/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KorotaevPavel/agile-course-practice/statuses/{sha}","languages_url":"https://api.github.com/repos/KorotaevPavel/agile-course-practice/languages","stargazers_url":"https://api.github.com/repos/KorotaevPavel/agile-course-practice/stargazers","contributors_url":"https://api.github.com/repos/KorotaevPavel/agile-course-practice/contributors","subscribers_url":"https://api.github.com/repos/KorotaevPavel/agile-course-practice/subscribers","subscription_url":"https://api.github.com/repos/KorotaevPavel/agile-course-practice/subscription","commits_url":"https://api.github.com/repos/KorotaevPavel/agile-course-practice/commits{/sha}","git_commits_url":"https://api.github.com/repos/KorotaevPavel/agile-course-practice/git/commits{/sha}","comments_url":"https://api.github.com/repos/KorotaevPavel/agile-course-practice/comments{/number}","issue_comment_url":"https://api.github.com/repos/KorotaevPavel/agile-course-practice/issues/comments{/number}","contents_url":"https://api.github.com/repos/KorotaevPavel/agile-course-practice/contents/{+path}","compare_url":"https://api.github.com/repos/KorotaevPavel/agile-course-practice/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KorotaevPavel/agile-course-practice/merges","archive_url":"https://api.github.com/repos/KorotaevPavel/agile-course-practice/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KorotaevPavel/agile-course-practice/downloads","issues_url":"https://api.github.com/repos/KorotaevPavel/agile-course-practice/issues{/number}","pulls_url":"https://api.github.com/repos/KorotaevPavel/agile-course-practice/pulls{/number}","milestones_url":"https://api.github.com/repos/KorotaevPavel/agile-course-practice/milestones{/number}","notifications_url":"https://api.github.com/repos/KorotaevPavel/agile-course-practice/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KorotaevPavel/agile-course-practice/labels{/name}","releases_url":"https://api.github.com/repos/KorotaevPavel/agile-course-practice/releases{/id}","created_at":"2015-10-20T16:56:32Z","updated_at":"2015-10-20T16:56:33Z","pushed_at":"2015-11-18T21:57:46Z","git_url":"git://github.com/KorotaevPavel/agile-course-practice.git","ssh_url":"git@github.com:KorotaevPavel/agile-course-practice.git","clone_url":"https://github.com/KorotaevPavel/agile-course-practice.git","svn_url":"https://github.com/KorotaevPavel/agile-course-practice","homepage":"","size":617,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"UNN-VMK-Software:master","ref":"master","sha":"c12f93f5e0e5217bd6e0d159c47fff06dbe7b046","user":{"login":"UNN-VMK-Software","id":5463209,"avatar_url":"https://avatars.githubusercontent.com/u/5463209?v=3","gravatar_id":"","url":"https://api.github.com/users/UNN-VMK-Software","html_url":"https://github.com/UNN-VMK-Software","followers_url":"https://api.github.com/users/UNN-VMK-Software/followers","following_url":"https://api.github.com/users/UNN-VMK-Software/following{/other_user}","gists_url":"https://api.github.com/users/UNN-VMK-Software/gists{/gist_id}","starred_url":"https://api.github.com/users/UNN-VMK-Software/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UNN-VMK-Software/subscriptions","organizations_url":"https://api.github.com/users/UNN-VMK-Software/orgs","repos_url":"https://api.github.com/users/UNN-VMK-Software/repos","events_url":"https://api.github.com/users/UNN-VMK-Software/events{/privacy}","received_events_url":"https://api.github.com/users/UNN-VMK-Software/received_events","type":"Organization","site_admin":false},"repo":{"id":44518750,"name":"agile-course-practice","full_name":"UNN-VMK-Software/agile-course-practice","owner":{"login":"UNN-VMK-Software","id":5463209,"avatar_url":"https://avatars.githubusercontent.com/u/5463209?v=3","gravatar_id":"","url":"https://api.github.com/users/UNN-VMK-Software","html_url":"https://github.com/UNN-VMK-Software","followers_url":"https://api.github.com/users/UNN-VMK-Software/followers","following_url":"https://api.github.com/users/UNN-VMK-Software/following{/other_user}","gists_url":"https://api.github.com/users/UNN-VMK-Software/gists{/gist_id}","starred_url":"https://api.github.com/users/UNN-VMK-Software/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UNN-VMK-Software/subscriptions","organizations_url":"https://api.github.com/users/UNN-VMK-Software/orgs","repos_url":"https://api.github.com/users/UNN-VMK-Software/repos","events_url":"https://api.github.com/users/UNN-VMK-Software/events{/privacy}","received_events_url":"https://api.github.com/users/UNN-VMK-Software/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/UNN-VMK-Software/agile-course-practice","description":"Проект-шаблон для выполнения лабораторных работ по курсу Agile Development","fork":false,"url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice","forks_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/forks","keys_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/keys{/key_id}","collaborators_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/teams","hooks_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/hooks","issue_events_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/issues/events{/number}","events_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/events","assignees_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/assignees{/user}","branches_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/branches{/branch}","tags_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/tags","blobs_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/git/refs{/sha}","trees_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/git/trees{/sha}","statuses_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/statuses/{sha}","languages_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/languages","stargazers_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/stargazers","contributors_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/contributors","subscribers_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/subscribers","subscription_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/subscription","commits_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/commits{/sha}","git_commits_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/git/commits{/sha}","comments_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/comments{/number}","issue_comment_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/issues/comments{/number}","contents_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/contents/{+path}","compare_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/compare/{base}...{head}","merges_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/merges","archive_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/downloads","issues_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/issues{/number}","pulls_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/pulls{/number}","milestones_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/milestones{/number}","notifications_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/labels{/name}","releases_url":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/releases{/id}","created_at":"2015-10-19T07:42:22Z","updated_at":"2015-10-29T19:46:12Z","pushed_at":"2015-11-24T21:03:14Z","git_url":"git://github.com/UNN-VMK-Software/agile-course-practice.git","ssh_url":"git@github.com:UNN-VMK-Software/agile-course-practice.git","clone_url":"https://github.com/UNN-VMK-Software/agile-course-practice.git","svn_url":"https://github.com/UNN-VMK-Software/agile-course-practice","homepage":"","size":2288,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":46,"mirror_url":null,"open_issues_count":11,"forks":46,"open_issues":11,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/pulls/126"},"html":{"href":"https://github.com/UNN-VMK-Software/agile-course-practice/pull/126"},"issue":{"href":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/issues/126"},"comments":{"href":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/issues/126/comments"},"review_comments":{"href":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/pulls/126/comments"},"review_comment":{"href":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/pulls/126/commits"},"statuses":{"href":"https://api.github.com/repos/UNN-VMK-Software/agile-course-practice/statuses/09b0fa3634e4209a15f0bbfa257c72a475116891"}}}}