{"id":1651,"date":"2015-08-07T16:33:17","date_gmt":"2015-08-07T08:33:17","guid":{"rendered":"http:\/\/www.magicandlove.com\/blog\/?p=1651"},"modified":"2015-08-07T16:45:38","modified_gmt":"2015-08-07T08:45:38","slug":"processing-3-0-beta","status":"publish","type":"post","link":"http:\/\/www.magicandlove.com\/blog\/2015\/08\/07\/processing-3-0-beta\/","title":{"rendered":"Processing 3.0 Beta 1"},"content":{"rendered":"<p>The new <a href=\"https:\/\/processing.org\/download\/?processing\">Processing 3.0 beta<\/a> is available in the Processing website for download. There are some changes in the internal operations that we may need to pay attention to in case our programs depend on them.<\/p>\n<p>Here is a sketch with 2D graphics, I try to list out those internal hidden variables and functions, especially those related to the <strong>PSurface<\/strong> class.<br \/>\n<!--more--><\/p>\n<pre lang=\"java\">\r\nimport processing.awt.PSurfaceAWT;\r\nimport processing.awt.PSurfaceAWT.SmoothCanvas;\r\nimport javax.swing.JFrame;\r\n\r\nvoid setup() {\r\n  size(640, 480);\r\n  println(frame);\r\n  println(g);\r\n  PSurfaceAWT s = (PSurfaceAWT) this.getSurface();\r\n  println(s);\r\n  SmoothCanvas c = (SmoothCanvas) s.getNative();\r\n  println(c);\r\n  JFrame f = (JFrame) c.getFrame();\r\n  println(f);\r\n}\r\n\r\nvoid draw() {\r\n  background(0);\r\n}\r\n<\/pre>\n<p>It is announced that the <strong>PApplet<\/strong> class is no longer a subclass of Applet. Here are what I test in the sample program.<\/p>\n<p><em>frame<\/em><br \/>\nIt seems not working now.<\/p>\n<p><em>c<\/em><br \/>\nIt still provides the link to the <strong>PGraphics.<\/strong><\/p>\n<p><em>getSurface()<\/em><br \/>\nIt points to an object instance of the drawing surface that is a variation of the <strong>PSurface<\/strong> class.<\/p>\n<p><em>getNative()<\/em><br \/>\nIt is a function inside the <strong>PSurfaceAWT<\/strong> class. It will return a link to the <strong>SmoothCanvas<\/strong> instance, and which is a subclass of <strong>Canvas<\/strong> object.<\/p>\n<p><em>getFrame()<\/em><br \/>\nIt is a function from the SmoothCanvas class. It will provide a link to a <strong>JFrame<\/strong> instance where we can manipulate. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>The new Processing 3.0 beta is available in the Processing website for download. There are some changes in the internal operations that we may need to pay attention to in case our programs depend on them. Here is a sketch with 2D graphics, I try to list out those internal hidden variables and functions, especially [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[79,66],"tags":[111,62],"class_list":["post-1651","post","type-post","status-publish","format-standard","hentry","category-software-2","category-testing","tag-java","tag-processing-org"],"_links":{"self":[{"href":"http:\/\/www.magicandlove.com\/blog\/wp-json\/wp\/v2\/posts\/1651","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.magicandlove.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.magicandlove.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.magicandlove.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.magicandlove.com\/blog\/wp-json\/wp\/v2\/comments?post=1651"}],"version-history":[{"count":5,"href":"http:\/\/www.magicandlove.com\/blog\/wp-json\/wp\/v2\/posts\/1651\/revisions"}],"predecessor-version":[{"id":1656,"href":"http:\/\/www.magicandlove.com\/blog\/wp-json\/wp\/v2\/posts\/1651\/revisions\/1656"}],"wp:attachment":[{"href":"http:\/\/www.magicandlove.com\/blog\/wp-json\/wp\/v2\/media?parent=1651"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.magicandlove.com\/blog\/wp-json\/wp\/v2\/categories?post=1651"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.magicandlove.com\/blog\/wp-json\/wp\/v2\/tags?post=1651"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}