{"id":5072,"date":"2023-11-10T22:08:13","date_gmt":"2023-11-10T13:08:13","guid":{"rendered":"http:\/\/attacktube.com\/?p=5072"},"modified":"2023-11-11T11:59:07","modified_gmt":"2023-11-11T02:59:07","slug":"15%e6%ad%b3%e3%81%8b%e3%82%89%e3%81%af%e3%81%98%e3%82%81%e3%82%8bjava%e3%82%8f%e3%81%8f%e3%82%8f%e3%81%8f%e3%82%b2%e3%83%bc%e3%83%a0%e3%83%97%e3%83%ad%e3%82%b0%e3%83%a9%e3%83%9f%e3%83%b3%e3%82%b0","status":"publish","type":"post","link":"https:\/\/attacktube.com\/?p=5072","title":{"rendered":"15\u6b73\u304b\u3089\u306f\u3058\u3081\u308bJAVA\u308f\u304f\u308f\u304f\u30b2\u30fc\u30e0\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u6559\u5ba4\u306e\u899a\u66f8"},"content":{"rendered":"\n<p>\u672c\u7d19\u306e\u7591\u554f\u3068\u304b\u899a\u66f8<\/p>\n\n\n\n<!--more-->\n\n\n\n<br>\n<script async=\"\" src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-3461056110605997\" crossorigin=\"anonymous\"><\/script>\n<ins class=\"adsbygoogle\" style=\"display:block; text-align:center;\" data-ad-layout=\"in-article\" data-ad-format=\"fluid\" data-ad-client=\"ca-pub-3461056110605997\" data-ad-slot=\"3137443461\"><\/ins>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script>\n<br>\n\n\n\n<p>P106\uff5e107<br>getDrawGraphics()\u3068Graphics2D\u306b\u3064\u3044\u3066\u52c9\u5f37\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u306a\u3002<br>\u3068\u308a\u3042\u3048\u305a\u3001(1)\uff5e(3)\u3092\u899a\u3048\u3066\u304a\u304f\u3002<br>(1)\u4e00\u90e8\u306eGraphics\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306fGraphics2D\u306b\u30ad\u30e3\u30b9\u30c8\u3067\u304d\u308b\u3002<br>(2)Graphics2D\u304cGraphics\u3092\u7d99\u627f\u3057\u3066\u3044\u308b\u308f\u3051\u3067\u306f\u306a\u304f\u3001Graphics2D\u306fGraphics\u3068\u3044\u3046\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u62e1\u5f35\u3057\u305f\u3082\u306e\u3067\u3042\u308b\u3002<br>(3)\u300cGraphics2D\u306fGraphics\u3068\u3044\u3046\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u62e1\u5f35\u3057\u305f\u3082\u306e\u300d<br>=\u300cGraphics2D \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306f Graphics \u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306e\u4e00\u90e8\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u7d99\u627f\u3059\u308b\u300d<br>\u6ce8\u610f\u306a\u306e\u304c\u3001\u300cGraphics2D \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306f Graphics\u3092\u7d99\u627f\u3057\u3066\u3044\u308b\u300d\u3068\u3044\u3046\u8a00\u3044\u65b9\u306f\u9593\u9055\u3048\u3002<br><br>\u3046\u30fc\u3093\u3002(1)\u306e\u300c\u4e00\u90e8\u306eGraphics\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306fGraphics2D\u306b\u30ad\u30e3\u30b9\u30c8\u3067\u304d\u308b\u3002\u300d\u3060\u3051\u3069\u3001\u306a\u305c\u30ad\u30e3\u30b9\u30c8\u53ef\u80fd\u306a\u306e\u3060\u308d\u3046\u304b\uff1f\u30a4\u30de\u30a4\u30c1\u7406\u89e3\u3067\u304d\u306a\u3044\u3051\u3069\u3001\u3053\u3053\u307e\u3067\u306b\u3057\u3066\u304a\u3053\u3046\u3002\u307e\u305f\u3001\u4eca\u5ea6\u52c9\u5f37\u3057\u3088\u3002<br><br>Java\u3067\u3082instanceof\u6f14\u7b97\u5b50\u304c\u3042\u308b\u3002instanceof\u306f\u3001\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u7279\u5b9a\u306e\u30af\u30e9\u30b9\u307e\u305f\u306f\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3067\u3042\u308b\u304b\u3069\u3046\u304b\u3092\u78ba\u8a8d\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3055\u308c\u308b\u3002\u57fa\u672c\u7684\u306a\u69cb\u6587\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3042\u308b\u3002<\/p>\n\n\n\n<pre><code>\nif (\u30aa\u30d6\u30b8\u30a7\u30af\u30c8 instanceof \u30af\u30e9\u30b9\u307e\u305f\u306f\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9) {\n    \/\/ \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306f\u6307\u5b9a\u3055\u308c\u305f\u30af\u30e9\u30b9\u307e\u305f\u306f\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3067\u3059\u3002\n}\n<\/code><\/pre>\n\n\n\n<pre><code>\nGraphics gRaw = this.strategy.getDrawGraphics();\nif (gRaw instanceof Graphics2D) {\n  System.out.println(&quot;gRaw\u306ftrue&quot;);\n}\n<\/code><\/pre>\n\n\n\n<pre><code>\nJFrame mainwindow;\nBufferStrategy strategy;\n\nthis.mainwindow = new JFrame(&quot;\u30b7\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0&quot;);\nthis.strategy = this.mainwindow.getBufferStrategy();\n\n\/\/ getDrawGraphics()\u306e\u623b\u308a\u5024\u306e\u578b\u306fGraphics\u306a\u306e\u3067\n\/\/ Graphics\u304b\u3089Graphics2D\u306b\u578b\u5909\u63db\u3059\u308b(Graphics\u304b\u3089Graphics2D\u306b\u30ad\u30e3\u30b9\u30c8\u3059\u308b\u3068\u3082\u8a00\u3046)\nGraphics2D g = (Graphics2D)this.strategy.getDrawGraphics();\ng.setBackground(Color.black);\nGraphics gRaw = this.strategy.getDrawGraphics();\nif (gRaw instanceof Graphics2D) {\n  System.out.println(&quot;gRaw\u306ftrue&quot;);\n}\n<\/code><\/pre>\n\n\n\n<p>P112<br>frametime=0.016\u306e\u3068\u304d\u30010.016\u79d2\u30671\u30d4\u30af\u30bb\u30eb\u52d5\u304f\u305f\u3081\u3001\u901f\u5ea6\u306f(1\/0.016)=62.5[\u30d4\u30af\u30bb\u30eb\/\u79d2]<br>\u21921\u79d2\u306762.5\u30d4\u30af\u30bb\u30eb\u52d5\u304f<br>frametime=0.032\u306e\u3068\u304d\u30010.032\u79d2\u30671\u30d4\u30af\u30bb\u30eb\u52d5\u304f\u305f\u3081\u3001\u901f\u5ea6\u306f(1\/0.032)=32.35[\u30d4\u30af\u30bb\u30eb\/\u79d2]<br>\u21921\u79d2\u306732.35\u30d4\u30af\u30bb\u30eb\u52d5\u304f<br>\u3064\u307e\u308a\u30011\u79d2\u306732.35\u30d4\u30af\u30bb\u30eb\u306f\u9045\u3044\u30021\u79d2\u306762.5\u30d4\u30af\u30bb\u30eb\u52d5\u304f\u306f\u901f\u3044\u3002<br>\u3053\u3046\u3060\u306a\u3002<br>\u901f\u5ea660[\u30d4\u30af\u30bb\u30eb\/\u79d2]\u3068\u3044\u3046\u306e\u306f0.016\u79d2\u3067frame\u304b\u3089\u6b21\u306eframe\u306b\u5909\u308f\u308b\u3068\u304d\u3060\u3051\u3002<br><br>\u3053\u306e0.016\u79d2\u3068\u306f\uff1f<br>1\u79d2\u3067render\u95a2\u6570\u309260\u56de\u547c\u3073\u51fa\u3059\u5834\u5408(1\/60)=0.01666666\u30fb\u30fb\u30fb\u22520.016<\/p>\n\n\n\n<script type=\"text\/javascript\">\njQuery(function($){\n$(\".jp-video\").hide();\n});\n<\/script>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u7d19\u306e\u7591\u554f\u3068\u304b\u899a\u66f8<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[9],"tags":[],"class_list":["post-5072","post","type-post","status-publish","format-standard","hentry","category-java"],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/attacktube.com\/index.php?rest_route=\/wp\/v2\/posts\/5072","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/attacktube.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/attacktube.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/attacktube.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/attacktube.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5072"}],"version-history":[{"count":14,"href":"https:\/\/attacktube.com\/index.php?rest_route=\/wp\/v2\/posts\/5072\/revisions"}],"predecessor-version":[{"id":5095,"href":"https:\/\/attacktube.com\/index.php?rest_route=\/wp\/v2\/posts\/5072\/revisions\/5095"}],"wp:attachment":[{"href":"https:\/\/attacktube.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5072"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/attacktube.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5072"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/attacktube.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5072"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}