{"action":"created","issue":{"url":"https://api.github.com/repos/phetsims/scenery-phet/issues/214","labels_url":"https://api.github.com/repos/phetsims/scenery-phet/issues/214/labels{/name}","comments_url":"https://api.github.com/repos/phetsims/scenery-phet/issues/214/comments","events_url":"https://api.github.com/repos/phetsims/scenery-phet/issues/214/events","html_url":"https://github.com/phetsims/scenery-phet/issues/214","id":125486494,"number":214,"title":"need a generalized model element creator node","user":{"login":"jbphet","id":3082831,"avatar_url":"https://avatars.githubusercontent.com/u/3082831?v=3","gravatar_id":"","url":"https://api.github.com/users/jbphet","html_url":"https://github.com/jbphet","followers_url":"https://api.github.com/users/jbphet/followers","following_url":"https://api.github.com/users/jbphet/following{/other_user}","gists_url":"https://api.github.com/users/jbphet/gists{/gist_id}","starred_url":"https://api.github.com/users/jbphet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbphet/subscriptions","organizations_url":"https://api.github.com/users/jbphet/orgs","repos_url":"https://api.github.com/users/jbphet/repos","events_url":"https://api.github.com/users/jbphet/events{/privacy}","received_events_url":"https://api.github.com/users/jbphet/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-01-07T21:18:32Z","updated_at":"2016-01-08T20:07:24Z","closed_at":null,"body":"There is a behavioral pattern that is used in a number of PhET's simulations where a Scenery node exists somewhere in the view - often in a carousel or tool box - and can be clicked and dragged in order to create a 'real' instance of the item that the node represents.  @pixelzoom recently needed to create such behavior in function-builder, and used ```ShapeCreatorNode``` in area-builder as a starting point.  He had some suggestions for improvements to ```ShapeCreatorNode```, and while implementing these suggestions, I searched through the codebase and found roughly nine additional places where similar code and functionality appeared.  Here is a list by repo and source file:\r\n+ balancing-act ```ModelElementCreatorNode.js```\r\n+ bending-light various places\r\n+ capacitor-lab ```VoltmeterToolBoxPanel.js```\r\n+ capacitor-lab-basics ```VoltmeterToolBoxPanel.js``` (this should probably be consolidated with the capacitor-lab version)\r\n+ charges-and-fields ```ChargesAndFieldsToolboxPanel.js```\r\n+ energy-forms-and-changes ```ThermometerToolBoxNode.js```\r\n+ expression-exchange ```CoinCreatorNode.js```\r\n+ least-squares-regression ```DataPointCreatorNode.js```\r\n+ making-tens ```PaperNumberCreatorNode.js```\r\n\r\nWe should consider creating a generalized version of this (e.g. ```ModelElementCreatorNode```) that can, at the least, be used when we need to do such things in the future and, at the most, can be used to replace most of the duplicated code.\r\n\r\nThis was discussed in the 1/7/2016 developer meeting.\r\n"},"comment":{"url":"https://api.github.com/repos/phetsims/scenery-phet/issues/comments/170109949","html_url":"https://github.com/phetsims/scenery-phet/issues/214#issuecomment-170109949","issue_url":"https://api.github.com/repos/phetsims/scenery-phet/issues/214","id":170109949,"user":{"login":"samreid","id":679486,"avatar_url":"https://avatars.githubusercontent.com/u/679486?v=3","gravatar_id":"","url":"https://api.github.com/users/samreid","html_url":"https://github.com/samreid","followers_url":"https://api.github.com/users/samreid/followers","following_url":"https://api.github.com/users/samreid/following{/other_user}","gists_url":"https://api.github.com/users/samreid/gists{/gist_id}","starred_url":"https://api.github.com/users/samreid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samreid/subscriptions","organizations_url":"https://api.github.com/users/samreid/orgs","repos_url":"https://api.github.com/users/samreid/repos","events_url":"https://api.github.com/users/samreid/events{/privacy}","received_events_url":"https://api.github.com/users/samreid/received_events","type":"User","site_admin":false},"created_at":"2016-01-08T20:07:24Z","updated_at":"2016-01-08T20:07:24Z","body":"Here are my notes from when I was investigating this issue recently:\r\n\r\n\"Add a drag handler for items in a toolbox/carousel/bucket\" https://github.com/phetsims/scenery-phet/issues/186\r\n\r\nIn the issue description, I identified simulations with toolboxes and the different kinds of dragging behavior we would need to support."}}