{"action":"created","comment":{"url":"https://api.github.com/repos/terrestris/momo3-frontend/pulls/comments/78947013","id":78947013,"diff_hunk":"@@ -0,0 +1,190 @@\n+/* Copyright (c) 2016 terrestris GmbH & Co. KG\n+ *\n+ * This program is free software: you can redistribute it and/or modify\n+ * it under the terms of the GNU General Public License as published by\n+ * the Free Software Foundation, either version 3 of the License, or\n+ * (at your option) any later version.\n+ *\n+ * This program is distributed in the hope that it will be useful,\n+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\n+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+ * GNU General Public License for more details.\n+ *\n+ * You should have received a copy of the GNU General Public License\n+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n+ */\n+/**\n+ * ShowRedliningToolsPanelController\n+ *\n+ * This controller will be used to manage the redlining tools in the GIS\n+ * application. Actually the following actions/tools are supported:\n+ *  * Draw point\n+ *  * Draw line\n+ *  * Draw polygon\n+ *  * Draw post-it\n+ *  * Move object\n+ *  * Copy object\n+ *  * Modify object\n+ *  * Delete object\n+ *  * Style object (simple styling of points, lines and polygons. No images as\n+ *    point icon are supported at the moment).\n+ * The controller is based on the logic of BasiGX.view.container.Redlining\n+ * class, which was adapted to match the MVVC structure better.\n+ *\n+ * @class MoMo.client.view.button.ShowRedliningToolsPanelController\n+ */\n+Ext.define('MoMo.client.view.button.ShowRedliningToolsPanelController', {\n+    extend: 'Ext.app.ViewController',\n+\n+    requires: [\n+    ],\n+\n+    alias: 'controller.button.showredliningtoolspanel',\n+\n+    /**\n+     * Placeholder for the redlining tools panel\n+     */\n+    btnPanel: null,\n+\n+    /**\n+    *\n+    */\n+    onToggle: function(btn, pressed){\n+        var me = this;\n+        if (pressed){\n+            me.showRedliningToolsPanel();\n+        } else {\n+            me.hideRedliningToolsPanel();\n+            me.deactivateRedliningTools();\n+        }\n+    },\n+\n+    /**\n+     * Creates a panel containing buttons for redlining tools.\n+     * The position of the panel will be computed dynamically (s. method\n+     * #computePosition below).\n+     * The `redlinePointStyle`, `redlineLineStringStyle` and\n+     * `redlinePolygonStyle` must be declared here by instanciating of the panel\n+     * as these will be uses as default values in the styler class (compare\n+     * {@link MoMo.client.view.window.RedliningStylerWindow})\n+     */\n+    createRedliningButtonsPanel: function() {\n+\n+        var me = this;\n+\n+        var parentBtn = me.getView().getEl();\n+\n+        var position = me.computePosition(parentBtn);\n+\n+        var postitPictureUrl = Ext.Loader.getPath('MoMo.client') +\n+            '/../../../resources/img/blue-post-it.png';\n+\n+        var btnPanel =\n+            Ext.create(\"MoMo.client.view.panel.RedliningToolsPanel\", {\n+                style: {\n+                    'top': position.top,\n+                    'right': position.right\n+                },\n+                bodyStyle: {\n+                    background: 'transparent'\n+                },\n+                postitPictureUrl: postitPictureUrl,\n+                redlinePointStyle: new ol.style.Style({\n+                    image: new ol.style.Circle({\n+                        radius: 7,\n+                        fill: new ol.style.Fill({\n+                            color: '#5fa2dd'\n+                        }),\n+                        stroke: new ol.style.Stroke({\n+                            color: '#ececec',\n+                            width: 2\n+                        })\n+                    })\n+                }),\n+                redlineLineStringStyle: new ol.style.Style({\n+                    stroke: new ol.style.Stroke({\n+                        color: '#ececec',\n+                        width: 2\n+                    })\n+                }),\n+                redlinePolygonStyle: new ol.style.Style({\n+                    stroke: new ol.style.Stroke({\n+                        color: '#ececec',\n+                        width: 2\n+                    }),\n+                    fill: new ol.style.Fill({\n+                        color: '#5fa2dd'\n+                    })\n+                })\n+            }\n+        );","path":"app/view/button/ShowRedliningToolsPanelController.js","position":120,"original_position":120,"commit_id":"5e821ecc2aa4e1c204aaa54d59e488297ead58e6","original_commit_id":"5e821ecc2aa4e1c204aaa54d59e488297ead58e6","user":{"login":"buehner","id":3939332,"avatar_url":"https://avatars.githubusercontent.com/u/3939332?v=3","gravatar_id":"","url":"https://api.github.com/users/buehner","html_url":"https://github.com/buehner","followers_url":"https://api.github.com/users/buehner/followers","following_url":"https://api.github.com/users/buehner/following{/other_user}","gists_url":"https://api.github.com/users/buehner/gists{/gist_id}","starred_url":"https://api.github.com/users/buehner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/buehner/subscriptions","organizations_url":"https://api.github.com/users/buehner/orgs","repos_url":"https://api.github.com/users/buehner/repos","events_url":"https://api.github.com/users/buehner/events{/privacy}","received_events_url":"https://api.github.com/users/buehner/received_events","type":"User","site_admin":false},"body":"Is it possible to move/externalize the config of the `btnPanel` in some way? Maybe as default values in the `RedliningToolsPanel` view? Or is it even possible to make clever use of data binding here, e.g. for the color values!?\r\n\r\nIf this is too much for know, just ignore this comment (but keep it in mind :wink: )","created_at":"2016-09-15T12:00:42Z","updated_at":"2016-09-15T12:01:28Z","html_url":"https://github.com/terrestris/momo3-frontend/pull/31#discussion_r78947013","pull_request_url":"https://api.github.com/repos/terrestris/momo3-frontend/pulls/31","_links":{"self":{"href":"https://api.github.com/repos/terrestris/momo3-frontend/pulls/comments/78947013"},"html":{"href":"https://github.com/terrestris/momo3-frontend/pull/31#discussion_r78947013"},"pull_request":{"href":"https://api.github.com/repos/terrestris/momo3-frontend/pulls/31"}}},"pull_request":{"url":"https://api.github.com/repos/terrestris/momo3-frontend/pulls/31","id":85353292,"html_url":"https://github.com/terrestris/momo3-frontend/pull/31","diff_url":"https://github.com/terrestris/momo3-frontend/pull/31.diff","patch_url":"https://github.com/terrestris/momo3-frontend/pull/31.patch","issue_url":"https://api.github.com/repos/terrestris/momo3-frontend/issues/31","number":31,"state":"open","locked":false,"title":"Redlining tools panel","user":{"login":"annarieger","id":3939355,"avatar_url":"https://avatars.githubusercontent.com/u/3939355?v=3","gravatar_id":"","url":"https://api.github.com/users/annarieger","html_url":"https://github.com/annarieger","followers_url":"https://api.github.com/users/annarieger/followers","following_url":"https://api.github.com/users/annarieger/following{/other_user}","gists_url":"https://api.github.com/users/annarieger/gists{/gist_id}","starred_url":"https://api.github.com/users/annarieger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/annarieger/subscriptions","organizations_url":"https://api.github.com/users/annarieger/orgs","repos_url":"https://api.github.com/users/annarieger/repos","events_url":"https://api.github.com/users/annarieger/events{/privacy}","received_events_url":"https://api.github.com/users/annarieger/received_events","type":"User","site_admin":false},"body":"This PR introduces a redlining tools functionality. The following tools are supported at the moment:\r\n\r\n- Draw point\r\n- Draw linestring\r\n- Draw polygon\r\n- Add post-it\r\n- Move drawn object\r\n- Copy/clone drawn object\r\n- Modify drawn object\r\n- Delete drawn object\r\n- Styler for point/line/polygon features (\"simple\" styling with stroke color/width, point radius and fillcolor properties, no images as sources for point features are supported now)\r\n\r\nThe implementation is based on https://github.com/terrestris/BasiGX/blob/master/src/view/container/RedlineStyler.js and  https://github.com/terrestris/BasiGX/blob/master/src/view/container/Redlining.js classes of `BasiGX` library. It was significantly adapted to match the MVVM structure.\r\n\r\nCorresponding PR in backend: https://github.com/terrestris/momo3-backend/pull/30\r\n\r\nPlease review @buehner @marcjansen\r\n","created_at":"2016-09-15T06:53:17Z","updated_at":"2016-09-15T12:01:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1e920cfcbadcd94ee00f4a78b1d800a8de94a3bb","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/terrestris/momo3-frontend/pulls/31/commits","review_comments_url":"https://api.github.com/repos/terrestris/momo3-frontend/pulls/31/comments","review_comment_url":"https://api.github.com/repos/terrestris/momo3-frontend/pulls/comments{/number}","comments_url":"https://api.github.com/repos/terrestris/momo3-frontend/issues/31/comments","statuses_url":"https://api.github.com/repos/terrestris/momo3-frontend/statuses/5e821ecc2aa4e1c204aaa54d59e488297ead58e6","head":{"label":"annarieger:redlining-tools","ref":"redlining-tools","sha":"5e821ecc2aa4e1c204aaa54d59e488297ead58e6","user":{"login":"annarieger","id":3939355,"avatar_url":"https://avatars.githubusercontent.com/u/3939355?v=3","gravatar_id":"","url":"https://api.github.com/users/annarieger","html_url":"https://github.com/annarieger","followers_url":"https://api.github.com/users/annarieger/followers","following_url":"https://api.github.com/users/annarieger/following{/other_user}","gists_url":"https://api.github.com/users/annarieger/gists{/gist_id}","starred_url":"https://api.github.com/users/annarieger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/annarieger/subscriptions","organizations_url":"https://api.github.com/users/annarieger/orgs","repos_url":"https://api.github.com/users/annarieger/repos","events_url":"https://api.github.com/users/annarieger/events{/privacy}","received_events_url":"https://api.github.com/users/annarieger/received_events","type":"User","site_admin":false},"repo":{"id":54474516,"name":"momo3-frontend","full_name":"annarieger/momo3-frontend","owner":{"login":"annarieger","id":3939355,"avatar_url":"https://avatars.githubusercontent.com/u/3939355?v=3","gravatar_id":"","url":"https://api.github.com/users/annarieger","html_url":"https://github.com/annarieger","followers_url":"https://api.github.com/users/annarieger/followers","following_url":"https://api.github.com/users/annarieger/following{/other_user}","gists_url":"https://api.github.com/users/annarieger/gists{/gist_id}","starred_url":"https://api.github.com/users/annarieger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/annarieger/subscriptions","organizations_url":"https://api.github.com/users/annarieger/orgs","repos_url":"https://api.github.com/users/annarieger/repos","events_url":"https://api.github.com/users/annarieger/events{/privacy}","received_events_url":"https://api.github.com/users/annarieger/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/annarieger/momo3-frontend","description":"The frontend-code for the third phase of MoMo, http://www.bmbf.wasserressourcen-management.de/en/111.php","fork":true,"url":"https://api.github.com/repos/annarieger/momo3-frontend","forks_url":"https://api.github.com/repos/annarieger/momo3-frontend/forks","keys_url":"https://api.github.com/repos/annarieger/momo3-frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/annarieger/momo3-frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/annarieger/momo3-frontend/teams","hooks_url":"https://api.github.com/repos/annarieger/momo3-frontend/hooks","issue_events_url":"https://api.github.com/repos/annarieger/momo3-frontend/issues/events{/number}","events_url":"https://api.github.com/repos/annarieger/momo3-frontend/events","assignees_url":"https://api.github.com/repos/annarieger/momo3-frontend/assignees{/user}","branches_url":"https://api.github.com/repos/annarieger/momo3-frontend/branches{/branch}","tags_url":"https://api.github.com/repos/annarieger/momo3-frontend/tags","blobs_url":"https://api.github.com/repos/annarieger/momo3-frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/annarieger/momo3-frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/annarieger/momo3-frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/annarieger/momo3-frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/annarieger/momo3-frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/annarieger/momo3-frontend/languages","stargazers_url":"https://api.github.com/repos/annarieger/momo3-frontend/stargazers","contributors_url":"https://api.github.com/repos/annarieger/momo3-frontend/contributors","subscribers_url":"https://api.github.com/repos/annarieger/momo3-frontend/subscribers","subscription_url":"https://api.github.com/repos/annarieger/momo3-frontend/subscription","commits_url":"https://api.github.com/repos/annarieger/momo3-frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/annarieger/momo3-frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/annarieger/momo3-frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/annarieger/momo3-frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/annarieger/momo3-frontend/contents/{+path}","compare_url":"https://api.github.com/repos/annarieger/momo3-frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/annarieger/momo3-frontend/merges","archive_url":"https://api.github.com/repos/annarieger/momo3-frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/annarieger/momo3-frontend/downloads","issues_url":"https://api.github.com/repos/annarieger/momo3-frontend/issues{/number}","pulls_url":"https://api.github.com/repos/annarieger/momo3-frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/annarieger/momo3-frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/annarieger/momo3-frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/annarieger/momo3-frontend/labels{/name}","releases_url":"https://api.github.com/repos/annarieger/momo3-frontend/releases{/id}","deployments_url":"https://api.github.com/repos/annarieger/momo3-frontend/deployments","created_at":"2016-03-22T12:47:38Z","updated_at":"2016-03-22T12:47:39Z","pushed_at":"2016-09-15T06:45:18Z","git_url":"git://github.com/annarieger/momo3-frontend.git","ssh_url":"git@github.com:annarieger/momo3-frontend.git","clone_url":"https://github.com/annarieger/momo3-frontend.git","svn_url":"https://github.com/annarieger/momo3-frontend","homepage":"","size":340,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"terrestris:master","ref":"master","sha":"eaf03351872ff65ee6eb04ba2251eb89875faafb","user":{"login":"terrestris","id":1510416,"avatar_url":"https://avatars.githubusercontent.com/u/1510416?v=3","gravatar_id":"","url":"https://api.github.com/users/terrestris","html_url":"https://github.com/terrestris","followers_url":"https://api.github.com/users/terrestris/followers","following_url":"https://api.github.com/users/terrestris/following{/other_user}","gists_url":"https://api.github.com/users/terrestris/gists{/gist_id}","starred_url":"https://api.github.com/users/terrestris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/terrestris/subscriptions","organizations_url":"https://api.github.com/users/terrestris/orgs","repos_url":"https://api.github.com/users/terrestris/repos","events_url":"https://api.github.com/users/terrestris/events{/privacy}","received_events_url":"https://api.github.com/users/terrestris/received_events","type":"Organization","site_admin":false},"repo":{"id":40877306,"name":"momo3-frontend","full_name":"terrestris/momo3-frontend","owner":{"login":"terrestris","id":1510416,"avatar_url":"https://avatars.githubusercontent.com/u/1510416?v=3","gravatar_id":"","url":"https://api.github.com/users/terrestris","html_url":"https://github.com/terrestris","followers_url":"https://api.github.com/users/terrestris/followers","following_url":"https://api.github.com/users/terrestris/following{/other_user}","gists_url":"https://api.github.com/users/terrestris/gists{/gist_id}","starred_url":"https://api.github.com/users/terrestris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/terrestris/subscriptions","organizations_url":"https://api.github.com/users/terrestris/orgs","repos_url":"https://api.github.com/users/terrestris/repos","events_url":"https://api.github.com/users/terrestris/events{/privacy}","received_events_url":"https://api.github.com/users/terrestris/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/terrestris/momo3-frontend","description":"The frontend-code for the third phase of MoMo, http://www.bmbf.wasserressourcen-management.de/en/111.php","fork":false,"url":"https://api.github.com/repos/terrestris/momo3-frontend","forks_url":"https://api.github.com/repos/terrestris/momo3-frontend/forks","keys_url":"https://api.github.com/repos/terrestris/momo3-frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/terrestris/momo3-frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/terrestris/momo3-frontend/teams","hooks_url":"https://api.github.com/repos/terrestris/momo3-frontend/hooks","issue_events_url":"https://api.github.com/repos/terrestris/momo3-frontend/issues/events{/number}","events_url":"https://api.github.com/repos/terrestris/momo3-frontend/events","assignees_url":"https://api.github.com/repos/terrestris/momo3-frontend/assignees{/user}","branches_url":"https://api.github.com/repos/terrestris/momo3-frontend/branches{/branch}","tags_url":"https://api.github.com/repos/terrestris/momo3-frontend/tags","blobs_url":"https://api.github.com/repos/terrestris/momo3-frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/terrestris/momo3-frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/terrestris/momo3-frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/terrestris/momo3-frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/terrestris/momo3-frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/terrestris/momo3-frontend/languages","stargazers_url":"https://api.github.com/repos/terrestris/momo3-frontend/stargazers","contributors_url":"https://api.github.com/repos/terrestris/momo3-frontend/contributors","subscribers_url":"https://api.github.com/repos/terrestris/momo3-frontend/subscribers","subscription_url":"https://api.github.com/repos/terrestris/momo3-frontend/subscription","commits_url":"https://api.github.com/repos/terrestris/momo3-frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/terrestris/momo3-frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/terrestris/momo3-frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/terrestris/momo3-frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/terrestris/momo3-frontend/contents/{+path}","compare_url":"https://api.github.com/repos/terrestris/momo3-frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/terrestris/momo3-frontend/merges","archive_url":"https://api.github.com/repos/terrestris/momo3-frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/terrestris/momo3-frontend/downloads","issues_url":"https://api.github.com/repos/terrestris/momo3-frontend/issues{/number}","pulls_url":"https://api.github.com/repos/terrestris/momo3-frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/terrestris/momo3-frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/terrestris/momo3-frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/terrestris/momo3-frontend/labels{/name}","releases_url":"https://api.github.com/repos/terrestris/momo3-frontend/releases{/id}","deployments_url":"https://api.github.com/repos/terrestris/momo3-frontend/deployments","created_at":"2015-08-17T08:24:53Z","updated_at":"2016-03-22T13:29:46Z","pushed_at":"2016-09-15T06:53:17Z","git_url":"git://github.com/terrestris/momo3-frontend.git","ssh_url":"git@github.com:terrestris/momo3-frontend.git","clone_url":"https://github.com/terrestris/momo3-frontend.git","svn_url":"https://github.com/terrestris/momo3-frontend","homepage":"","size":297,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":2,"forks":9,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/terrestris/momo3-frontend/pulls/31"},"html":{"href":"https://github.com/terrestris/momo3-frontend/pull/31"},"issue":{"href":"https://api.github.com/repos/terrestris/momo3-frontend/issues/31"},"comments":{"href":"https://api.github.com/repos/terrestris/momo3-frontend/issues/31/comments"},"review_comments":{"href":"https://api.github.com/repos/terrestris/momo3-frontend/pulls/31/comments"},"review_comment":{"href":"https://api.github.com/repos/terrestris/momo3-frontend/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/terrestris/momo3-frontend/pulls/31/commits"},"statuses":{"href":"https://api.github.com/repos/terrestris/momo3-frontend/statuses/5e821ecc2aa4e1c204aaa54d59e488297ead58e6"}}}}
{"actor":{"display_login":"buehner"}}