pygments.rb 0.6.3 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +11 -0
- data/README.md +6 -6
- data/Rakefile +2 -1
- data/cache-lexers.rb +1 -1
- data/circle.yml +7 -0
- data/lib/pygments/lexer.rb +3 -3
- data/lib/pygments/popen.rb +67 -30
- data/lib/pygments/version.rb +1 -1
- data/pygments.rb.gemspec +2 -1
- data/test/test_pygments.rb +16 -16
- data/vendor/pygments-main/AUTHORS +54 -8
- data/vendor/pygments-main/CHANGES +247 -25
- data/vendor/pygments-main/LICENSE +1 -1
- data/vendor/pygments-main/Makefile +15 -6
- data/vendor/pygments-main/README.rst +39 -0
- data/vendor/pygments-main/REVISION +1 -1
- data/vendor/pygments-main/TODO +0 -3
- data/vendor/pygments-main/doc/_themes/pygments14/layout.html +1 -1
- data/vendor/pygments-main/doc/_themes/pygments14/static/pygments14.css_t +1 -1
- data/vendor/pygments-main/doc/conf.py +3 -11
- data/vendor/pygments-main/doc/docs/api.rst +15 -0
- data/vendor/pygments-main/doc/docs/cmdline.rst +6 -2
- data/vendor/pygments-main/doc/docs/filterdevelopment.rst +4 -3
- data/vendor/pygments-main/doc/docs/integrate.rst +11 -15
- data/vendor/pygments-main/doc/docs/java.rst +7 -7
- data/vendor/pygments-main/doc/docs/lexerdevelopment.rst +258 -171
- data/vendor/pygments-main/doc/docs/lexers.rst +2 -2
- data/vendor/pygments-main/doc/docs/styles.rst +58 -0
- data/vendor/pygments-main/doc/docs/tokens.rst +22 -2
- data/vendor/pygments-main/doc/docs/unicode.rst +15 -7
- data/vendor/pygments-main/doc/faq.rst +17 -21
- data/vendor/pygments-main/doc/index.rst +12 -11
- data/vendor/pygments-main/doc/languages.rst +10 -7
- data/vendor/pygments-main/external/autopygmentize +9 -6
- data/vendor/pygments-main/external/lasso-builtins-generator-9.lasso +70 -52
- data/vendor/pygments-main/external/markdown-processor.py +1 -1
- data/vendor/pygments-main/external/moin-parser.py +1 -1
- data/vendor/pygments-main/external/rst-directive.py +1 -1
- data/vendor/pygments-main/pygmentize +2 -1
- data/vendor/pygments-main/pygments/__init__.py +14 -15
- data/vendor/pygments-main/pygments/cmdline.py +188 -113
- data/vendor/pygments-main/pygments/console.py +13 -13
- data/vendor/pygments-main/pygments/filter.py +7 -7
- data/vendor/pygments-main/pygments/filters/__init__.py +24 -32
- data/vendor/pygments-main/pygments/formatter.py +5 -5
- data/vendor/pygments-main/pygments/formatters/__init__.py +92 -44
- data/vendor/pygments-main/pygments/formatters/_mapping.py +51 -69
- data/vendor/pygments-main/pygments/formatters/bbcode.py +1 -1
- data/vendor/pygments-main/pygments/formatters/html.py +63 -51
- data/vendor/pygments-main/pygments/formatters/img.py +25 -22
- data/vendor/pygments-main/pygments/formatters/irc.py +182 -0
- data/vendor/pygments-main/pygments/formatters/latex.py +34 -22
- data/vendor/pygments-main/pygments/formatters/other.py +5 -7
- data/vendor/pygments-main/pygments/formatters/rtf.py +28 -31
- data/vendor/pygments-main/pygments/formatters/svg.py +1 -2
- data/vendor/pygments-main/pygments/formatters/terminal.py +29 -45
- data/vendor/pygments-main/pygments/formatters/terminal256.py +118 -31
- data/vendor/pygments-main/pygments/lexer.py +120 -34
- data/vendor/pygments-main/pygments/lexers/__init__.py +85 -53
- data/vendor/pygments-main/pygments/lexers/{_asybuiltins.py → _asy_builtins.py} +7 -7
- data/vendor/pygments-main/pygments/lexers/{_clbuiltins.py → _cl_builtins.py} +17 -17
- data/vendor/pygments-main/pygments/lexers/_cocoa_builtins.py +72 -0
- data/vendor/pygments-main/pygments/lexers/_csound_builtins.py +1346 -0
- data/vendor/pygments-main/pygments/lexers/{_lassobuiltins.py → _lasso_builtins.py} +4699 -4561
- data/vendor/pygments-main/pygments/lexers/{_luabuiltins.py → _lua_builtins.py} +91 -51
- data/vendor/pygments-main/pygments/lexers/_mapping.py +342 -242
- data/vendor/pygments-main/pygments/lexers/_mql_builtins.py +1172 -0
- data/vendor/pygments-main/pygments/lexers/_openedge_builtins.py +2547 -0
- data/vendor/pygments-main/pygments/lexers/{_phpbuiltins.py → _php_builtins.py} +350 -353
- data/vendor/pygments-main/pygments/lexers/_postgres_builtins.py +600 -212
- data/vendor/pygments-main/pygments/lexers/_scilab_builtins.py +3084 -30
- data/vendor/pygments-main/pygments/lexers/_sourcemod_builtins.py +1163 -0
- data/vendor/pygments-main/pygments/lexers/_stan_builtins.py +91 -13
- data/vendor/pygments-main/pygments/lexers/_stata_builtins.py +419 -0
- data/vendor/pygments-main/pygments/lexers/_tsql_builtins.py +1004 -0
- data/vendor/pygments-main/pygments/lexers/_vim_builtins.py +1939 -0
- data/vendor/pygments-main/pygments/lexers/actionscript.py +240 -0
- data/vendor/pygments-main/pygments/lexers/agile.py +14 -2542
- data/vendor/pygments-main/pygments/lexers/algebra.py +221 -0
- data/vendor/pygments-main/pygments/lexers/ambient.py +76 -0
- data/vendor/pygments-main/pygments/lexers/ampl.py +87 -0
- data/vendor/pygments-main/pygments/lexers/apl.py +101 -0
- data/vendor/pygments-main/pygments/lexers/archetype.py +318 -0
- data/vendor/pygments-main/pygments/lexers/asm.py +276 -81
- data/vendor/pygments-main/pygments/lexers/automation.py +374 -0
- data/vendor/pygments-main/pygments/lexers/basic.py +500 -0
- data/vendor/pygments-main/pygments/lexers/bibtex.py +156 -0
- data/vendor/pygments-main/pygments/lexers/business.py +594 -0
- data/vendor/pygments-main/pygments/lexers/c_cpp.py +252 -0
- data/vendor/pygments-main/pygments/lexers/c_like.py +541 -0
- data/vendor/pygments-main/pygments/lexers/capnproto.py +79 -0
- data/vendor/pygments-main/pygments/lexers/chapel.py +101 -0
- data/vendor/pygments-main/pygments/lexers/clean.py +288 -0
- data/vendor/pygments-main/pygments/lexers/compiled.py +24 -5182
- data/vendor/pygments-main/pygments/lexers/configs.py +833 -0
- data/vendor/pygments-main/pygments/lexers/console.py +114 -0
- data/vendor/pygments-main/pygments/lexers/crystal.py +384 -0
- data/vendor/pygments-main/pygments/lexers/csound.py +366 -0
- data/vendor/pygments-main/pygments/lexers/css.py +689 -0
- data/vendor/pygments-main/pygments/lexers/d.py +251 -0
- data/vendor/pygments-main/pygments/lexers/dalvik.py +6 -6
- data/vendor/pygments-main/pygments/lexers/data.py +555 -0
- data/vendor/pygments-main/pygments/lexers/diff.py +165 -0
- data/vendor/pygments-main/pygments/lexers/dotnet.py +96 -88
- data/vendor/pygments-main/pygments/lexers/dsls.py +878 -0
- data/vendor/pygments-main/pygments/lexers/dylan.py +289 -0
- data/vendor/pygments-main/pygments/lexers/ecl.py +125 -0
- data/vendor/pygments-main/pygments/lexers/eiffel.py +65 -0
- data/vendor/pygments-main/pygments/lexers/elm.py +121 -0
- data/vendor/pygments-main/pygments/lexers/erlang.py +533 -0
- data/vendor/pygments-main/pygments/lexers/esoteric.py +275 -0
- data/vendor/pygments-main/pygments/lexers/ezhil.py +68 -0
- data/vendor/pygments-main/pygments/lexers/factor.py +344 -0
- data/vendor/pygments-main/pygments/lexers/fantom.py +250 -0
- data/vendor/pygments-main/pygments/lexers/felix.py +273 -0
- data/vendor/pygments-main/pygments/lexers/forth.py +177 -0
- data/vendor/pygments-main/pygments/lexers/fortran.py +205 -0
- data/vendor/pygments-main/pygments/lexers/foxpro.py +1 -1
- data/vendor/pygments-main/pygments/lexers/functional.py +11 -3661
- data/vendor/pygments-main/pygments/lexers/go.py +101 -0
- data/vendor/pygments-main/pygments/lexers/grammar_notation.py +213 -0
- data/vendor/pygments-main/pygments/lexers/graph.py +7 -8
- data/vendor/pygments-main/pygments/lexers/graphics.py +553 -0
- data/vendor/pygments-main/pygments/lexers/haskell.py +840 -0
- data/vendor/pygments-main/pygments/lexers/haxe.py +936 -0
- data/vendor/pygments-main/pygments/lexers/hdl.py +172 -145
- data/vendor/pygments-main/pygments/lexers/hexdump.py +97 -0
- data/vendor/pygments-main/pygments/lexers/html.py +602 -0
- data/vendor/pygments-main/pygments/lexers/idl.py +270 -0
- data/vendor/pygments-main/pygments/lexers/igor.py +288 -0
- data/vendor/pygments-main/pygments/lexers/inferno.py +3 -3
- data/vendor/pygments-main/pygments/lexers/installers.py +322 -0
- data/vendor/pygments-main/pygments/lexers/int_fiction.py +1343 -0
- data/vendor/pygments-main/pygments/lexers/iolang.py +63 -0
- data/vendor/pygments-main/pygments/lexers/j.py +146 -0
- data/vendor/pygments-main/pygments/lexers/javascript.py +1506 -0
- data/vendor/pygments-main/pygments/lexers/julia.py +333 -0
- data/vendor/pygments-main/pygments/lexers/jvm.py +232 -186
- data/vendor/pygments-main/pygments/lexers/lisp.py +2621 -0
- data/vendor/pygments-main/pygments/lexers/make.py +202 -0
- data/vendor/pygments-main/pygments/lexers/markup.py +595 -0
- data/vendor/pygments-main/pygments/lexers/math.py +11 -2276
- data/vendor/pygments-main/pygments/lexers/matlab.py +663 -0
- data/vendor/pygments-main/pygments/lexers/ml.py +769 -0
- data/vendor/pygments-main/pygments/lexers/modeling.py +358 -0
- data/vendor/pygments-main/pygments/lexers/modula2.py +1561 -0
- data/vendor/pygments-main/pygments/lexers/monte.py +203 -0
- data/vendor/pygments-main/pygments/lexers/ncl.py +1053 -0
- data/vendor/pygments-main/pygments/lexers/nimrod.py +159 -0
- data/vendor/pygments-main/pygments/lexers/nit.py +64 -0
- data/vendor/pygments-main/pygments/lexers/nix.py +136 -0
- data/vendor/pygments-main/pygments/lexers/oberon.py +105 -0
- data/vendor/pygments-main/pygments/lexers/objective.py +504 -0
- data/vendor/pygments-main/pygments/lexers/ooc.py +85 -0
- data/vendor/pygments-main/pygments/lexers/other.py +30 -4481
- data/vendor/pygments-main/pygments/lexers/parasail.py +79 -0
- data/vendor/pygments-main/pygments/lexers/parsers.py +171 -114
- data/vendor/pygments-main/pygments/lexers/pascal.py +644 -0
- data/vendor/pygments-main/pygments/lexers/pawn.py +199 -0
- data/vendor/pygments-main/pygments/lexers/perl.py +616 -0
- data/vendor/pygments-main/pygments/lexers/php.py +267 -0
- data/vendor/pygments-main/pygments/lexers/praat.py +294 -0
- data/vendor/pygments-main/pygments/lexers/prolog.py +306 -0
- data/vendor/pygments-main/pygments/lexers/python.py +938 -0
- data/vendor/pygments-main/pygments/lexers/qvt.py +152 -0
- data/vendor/pygments-main/pygments/lexers/r.py +453 -0
- data/vendor/pygments-main/pygments/lexers/rdf.py +195 -24
- data/vendor/pygments-main/pygments/lexers/rebol.py +431 -0
- data/vendor/pygments-main/pygments/lexers/resource.py +85 -0
- data/vendor/pygments-main/pygments/lexers/rnc.py +67 -0
- data/vendor/pygments-main/pygments/lexers/roboconf.py +82 -0
- data/vendor/pygments-main/pygments/lexers/{_robotframeworklexer.py → robotframework.py} +20 -18
- data/vendor/pygments-main/pygments/lexers/ruby.py +519 -0
- data/vendor/pygments-main/pygments/lexers/rust.py +209 -0
- data/vendor/pygments-main/pygments/lexers/sas.py +228 -0
- data/vendor/pygments-main/pygments/lexers/scripting.py +1222 -0
- data/vendor/pygments-main/pygments/lexers/shell.py +478 -115
- data/vendor/pygments-main/pygments/lexers/smalltalk.py +195 -0
- data/vendor/pygments-main/pygments/lexers/smv.py +75 -0
- data/vendor/pygments-main/pygments/lexers/snobol.py +83 -0
- data/vendor/pygments-main/pygments/lexers/special.py +6 -2
- data/vendor/pygments-main/pygments/lexers/sql.py +209 -120
- data/vendor/pygments-main/pygments/lexers/stata.py +106 -0
- data/vendor/pygments-main/pygments/lexers/supercollider.py +90 -0
- data/vendor/pygments-main/pygments/lexers/tcl.py +145 -0
- data/vendor/pygments-main/pygments/lexers/templates.py +282 -90
- data/vendor/pygments-main/pygments/lexers/testing.py +207 -0
- data/vendor/pygments-main/pygments/lexers/text.py +15 -2045
- data/vendor/pygments-main/pygments/lexers/textedit.py +169 -0
- data/vendor/pygments-main/pygments/lexers/textfmts.py +297 -0
- data/vendor/pygments-main/pygments/lexers/theorem.py +458 -0
- data/vendor/pygments-main/pygments/lexers/trafficscript.py +54 -0
- data/vendor/pygments-main/pygments/lexers/typoscript.py +225 -0
- data/vendor/pygments-main/pygments/lexers/urbi.py +133 -0
- data/vendor/pygments-main/pygments/lexers/varnish.py +190 -0
- data/vendor/pygments-main/pygments/lexers/verification.py +111 -0
- data/vendor/pygments-main/pygments/lexers/web.py +13 -4499
- data/vendor/pygments-main/pygments/lexers/webmisc.py +979 -0
- data/vendor/pygments-main/pygments/lexers/whiley.py +117 -0
- data/vendor/pygments-main/pygments/lexers/x10.py +69 -0
- data/vendor/pygments-main/pygments/modeline.py +5 -2
- data/vendor/pygments-main/pygments/plugin.py +1 -1
- data/vendor/pygments-main/pygments/regexopt.py +92 -0
- data/vendor/pygments-main/pygments/scanner.py +3 -2
- data/vendor/pygments-main/pygments/sphinxext.py +11 -6
- data/vendor/pygments-main/pygments/style.py +41 -4
- data/vendor/pygments-main/pygments/styles/__init__.py +5 -1
- data/vendor/pygments-main/pygments/styles/algol.py +63 -0
- data/vendor/pygments-main/pygments/styles/algol_nu.py +63 -0
- data/vendor/pygments-main/pygments/styles/arduino.py +98 -0
- data/vendor/pygments-main/pygments/styles/autumn.py +1 -1
- data/vendor/pygments-main/pygments/styles/borland.py +1 -1
- data/vendor/pygments-main/pygments/styles/bw.py +1 -1
- data/vendor/pygments-main/pygments/styles/colorful.py +1 -1
- data/vendor/pygments-main/pygments/styles/default.py +1 -1
- data/vendor/pygments-main/pygments/styles/emacs.py +1 -1
- data/vendor/pygments-main/pygments/styles/friendly.py +1 -1
- data/vendor/pygments-main/pygments/styles/fruity.py +1 -1
- data/vendor/pygments-main/pygments/styles/igor.py +1 -1
- data/vendor/pygments-main/pygments/styles/lovelace.py +97 -0
- data/vendor/pygments-main/pygments/styles/manni.py +1 -1
- data/vendor/pygments-main/pygments/styles/monokai.py +1 -1
- data/vendor/pygments-main/pygments/styles/murphy.py +1 -1
- data/vendor/pygments-main/pygments/styles/native.py +1 -1
- data/vendor/pygments-main/pygments/styles/paraiso_dark.py +1 -1
- data/vendor/pygments-main/pygments/styles/paraiso_light.py +1 -1
- data/vendor/pygments-main/pygments/styles/pastie.py +1 -1
- data/vendor/pygments-main/pygments/styles/perldoc.py +2 -2
- data/vendor/pygments-main/pygments/styles/rrt.py +1 -1
- data/vendor/pygments-main/pygments/styles/sas.py +41 -0
- data/vendor/pygments-main/pygments/styles/stata.py +37 -0
- data/vendor/pygments-main/pygments/styles/tango.py +1 -1
- data/vendor/pygments-main/pygments/styles/trac.py +1 -1
- data/vendor/pygments-main/pygments/styles/vim.py +1 -1
- data/vendor/pygments-main/pygments/styles/vs.py +1 -1
- data/vendor/pygments-main/pygments/styles/xcode.py +1 -1
- data/vendor/pygments-main/pygments/token.py +31 -16
- data/vendor/pygments-main/pygments/unistring.py +141 -65
- data/vendor/pygments-main/pygments/util.py +129 -33
- data/vendor/pygments-main/requirements.txt +5 -0
- data/vendor/pygments-main/scripts/check_sources.py +25 -40
- data/vendor/pygments-main/scripts/debug_lexer.py +246 -0
- data/vendor/pygments-main/scripts/find_error.py +1 -0
- data/vendor/pygments-main/scripts/get_vimkw.py +35 -4
- data/vendor/pygments-main/setup.cfg +3 -0
- data/vendor/pygments-main/setup.py +17 -30
- data/vendor/pygments-main/tox.ini +7 -0
- metadata +159 -387
- data/vendor/pygments-main/ez_setup.py +0 -382
- data/vendor/pygments-main/pygments/lexers/_cocoabuiltins.py +0 -73
- data/vendor/pygments-main/pygments/lexers/_openedgebuiltins.py +0 -562
- data/vendor/pygments-main/pygments/lexers/_sourcemodbuiltins.py +0 -1077
- data/vendor/pygments-main/pygments/lexers/_vimbuiltins.py +0 -13
- data/vendor/pygments-main/pygments/lexers/qbasic.py +0 -157
- data/vendor/pygments-main/scripts/find_codetags.py +0 -213
- data/vendor/pygments-main/scripts/find_error.py +0 -173
- data/vendor/pygments-main/tests/dtds/HTML4-f.dtd +0 -37
- data/vendor/pygments-main/tests/dtds/HTML4-s.dtd +0 -869
- data/vendor/pygments-main/tests/dtds/HTML4.dcl +0 -88
- data/vendor/pygments-main/tests/dtds/HTML4.dtd +0 -1092
- data/vendor/pygments-main/tests/dtds/HTML4.soc +0 -9
- data/vendor/pygments-main/tests/dtds/HTMLlat1.ent +0 -195
- data/vendor/pygments-main/tests/dtds/HTMLspec.ent +0 -77
- data/vendor/pygments-main/tests/dtds/HTMLsym.ent +0 -241
- data/vendor/pygments-main/tests/examplefiles/99_bottles_of_beer.chpl +0 -118
- data/vendor/pygments-main/tests/examplefiles/AcidStateAdvanced.hs +0 -209
- data/vendor/pygments-main/tests/examplefiles/AlternatingGroup.mu +0 -102
- data/vendor/pygments-main/tests/examplefiles/BOM.js +0 -1
- data/vendor/pygments-main/tests/examplefiles/CPDictionary.j +0 -611
- data/vendor/pygments-main/tests/examplefiles/Config.in.cache +0 -1973
- data/vendor/pygments-main/tests/examplefiles/Constants.mo +0 -158
- data/vendor/pygments-main/tests/examplefiles/DancingSudoku.lhs +0 -411
- data/vendor/pygments-main/tests/examplefiles/Deflate.fs +0 -578
- data/vendor/pygments-main/tests/examplefiles/Error.pmod +0 -38
- data/vendor/pygments-main/tests/examplefiles/Errors.scala +0 -18
- data/vendor/pygments-main/tests/examplefiles/FakeFile.pike +0 -360
- data/vendor/pygments-main/tests/examplefiles/Get-CommandDefinitionHtml.ps1 +0 -66
- data/vendor/pygments-main/tests/examplefiles/IPDispatchC.nc +0 -104
- data/vendor/pygments-main/tests/examplefiles/IPDispatchP.nc +0 -671
- data/vendor/pygments-main/tests/examplefiles/Intro.java +0 -1660
- data/vendor/pygments-main/tests/examplefiles/Makefile +0 -1131
- data/vendor/pygments-main/tests/examplefiles/Object.st +0 -4394
- data/vendor/pygments-main/tests/examplefiles/OrderedMap.hx +0 -584
- data/vendor/pygments-main/tests/examplefiles/RoleQ.pm6 +0 -23
- data/vendor/pygments-main/tests/examplefiles/SmallCheck.hs +0 -378
- data/vendor/pygments-main/tests/examplefiles/Sorting.mod +0 -470
- data/vendor/pygments-main/tests/examplefiles/Sudoku.lhs +0 -382
- data/vendor/pygments-main/tests/examplefiles/addressbook.proto +0 -30
- data/vendor/pygments-main/tests/examplefiles/antlr_ANTLRv3.g +0 -608
- data/vendor/pygments-main/tests/examplefiles/antlr_throws +0 -1
- data/vendor/pygments-main/tests/examplefiles/apache2.conf +0 -393
- data/vendor/pygments-main/tests/examplefiles/as3_test.as +0 -143
- data/vendor/pygments-main/tests/examplefiles/as3_test2.as +0 -46
- data/vendor/pygments-main/tests/examplefiles/as3_test3.as +0 -3
- data/vendor/pygments-main/tests/examplefiles/aspx-cs_example +0 -27
- data/vendor/pygments-main/tests/examplefiles/autoit_submit.au3 +0 -25
- data/vendor/pygments-main/tests/examplefiles/badcase.java +0 -2
- data/vendor/pygments-main/tests/examplefiles/batchfile.bat +0 -49
- data/vendor/pygments-main/tests/examplefiles/bigtest.nsi +0 -308
- data/vendor/pygments-main/tests/examplefiles/boot-9.scm +0 -1557
- data/vendor/pygments-main/tests/examplefiles/ca65_example +0 -284
- data/vendor/pygments-main/tests/examplefiles/cbmbas_example +0 -9
- data/vendor/pygments-main/tests/examplefiles/cells.ps +0 -515
- data/vendor/pygments-main/tests/examplefiles/ceval.c +0 -2604
- data/vendor/pygments-main/tests/examplefiles/cheetah_example.html +0 -13
- data/vendor/pygments-main/tests/examplefiles/classes.dylan +0 -125
- data/vendor/pygments-main/tests/examplefiles/clojure-weird-keywords.clj +0 -5
- data/vendor/pygments-main/tests/examplefiles/condensed_ruby.rb +0 -10
- data/vendor/pygments-main/tests/examplefiles/coq_RelationClasses +0 -447
- data/vendor/pygments-main/tests/examplefiles/core.cljs +0 -52
- data/vendor/pygments-main/tests/examplefiles/database.pytb +0 -20
- data/vendor/pygments-main/tests/examplefiles/de.MoinMoin.po +0 -2461
- data/vendor/pygments-main/tests/examplefiles/demo.ahk +0 -181
- data/vendor/pygments-main/tests/examplefiles/demo.cfm +0 -50
- data/vendor/pygments-main/tests/examplefiles/demo.hbs +0 -12
- data/vendor/pygments-main/tests/examplefiles/django_sample.html+django +0 -68
- data/vendor/pygments-main/tests/examplefiles/dwarf.cw +0 -17
- data/vendor/pygments-main/tests/examplefiles/ember.handlebars +0 -33
- data/vendor/pygments-main/tests/examplefiles/erl_session +0 -10
- data/vendor/pygments-main/tests/examplefiles/escape_semicolon.clj +0 -1
- data/vendor/pygments-main/tests/examplefiles/evil_regex.js +0 -48
- data/vendor/pygments-main/tests/examplefiles/example.Rd +0 -78
- data/vendor/pygments-main/tests/examplefiles/example.als +0 -217
- data/vendor/pygments-main/tests/examplefiles/example.bug +0 -54
- data/vendor/pygments-main/tests/examplefiles/example.c +0 -2080
- data/vendor/pygments-main/tests/examplefiles/example.ceylon +0 -52
- data/vendor/pygments-main/tests/examplefiles/example.chai +0 -6
- data/vendor/pygments-main/tests/examplefiles/example.clay +0 -33
- data/vendor/pygments-main/tests/examplefiles/example.cls +0 -15
- data/vendor/pygments-main/tests/examplefiles/example.cob +0 -3556
- data/vendor/pygments-main/tests/examplefiles/example.coffee +0 -27
- data/vendor/pygments-main/tests/examplefiles/example.cpp +0 -2363
- data/vendor/pygments-main/tests/examplefiles/example.e +0 -124
- data/vendor/pygments-main/tests/examplefiles/example.f90 +0 -8
- data/vendor/pygments-main/tests/examplefiles/example.feature +0 -16
- data/vendor/pygments-main/tests/examplefiles/example.gd +0 -23
- data/vendor/pygments-main/tests/examplefiles/example.gi +0 -64
- data/vendor/pygments-main/tests/examplefiles/example.groovy +0 -2
- data/vendor/pygments-main/tests/examplefiles/example.gs +0 -106
- data/vendor/pygments-main/tests/examplefiles/example.gst +0 -7
- data/vendor/pygments-main/tests/examplefiles/example.hs +0 -27
- data/vendor/pygments-main/tests/examplefiles/example.hx +0 -185
- data/vendor/pygments-main/tests/examplefiles/example.i6t +0 -32
- data/vendor/pygments-main/tests/examplefiles/example.i7x +0 -45
- data/vendor/pygments-main/tests/examplefiles/example.inf +0 -374
- data/vendor/pygments-main/tests/examplefiles/example.j +0 -564
- data/vendor/pygments-main/tests/examplefiles/example.jag +0 -48
- data/vendor/pygments-main/tests/examplefiles/example.java +0 -16
- data/vendor/pygments-main/tests/examplefiles/example.kal +0 -75
- data/vendor/pygments-main/tests/examplefiles/example.kt +0 -47
- data/vendor/pygments-main/tests/examplefiles/example.lagda +0 -19
- data/vendor/pygments-main/tests/examplefiles/example.liquid +0 -42
- data/vendor/pygments-main/tests/examplefiles/example.lua +0 -250
- data/vendor/pygments-main/tests/examplefiles/example.ma +0 -8
- data/vendor/pygments-main/tests/examplefiles/example.monkey +0 -152
- data/vendor/pygments-main/tests/examplefiles/example.moo +0 -26
- data/vendor/pygments-main/tests/examplefiles/example.moon +0 -629
- data/vendor/pygments-main/tests/examplefiles/example.mq4 +0 -187
- data/vendor/pygments-main/tests/examplefiles/example.mqh +0 -123
- data/vendor/pygments-main/tests/examplefiles/example.msc +0 -43
- data/vendor/pygments-main/tests/examplefiles/example.ni +0 -57
- data/vendor/pygments-main/tests/examplefiles/example.nim +0 -1010
- data/vendor/pygments-main/tests/examplefiles/example.nix +0 -80
- data/vendor/pygments-main/tests/examplefiles/example.ns2 +0 -69
- data/vendor/pygments-main/tests/examplefiles/example.pas +0 -2708
- data/vendor/pygments-main/tests/examplefiles/example.pp +0 -8
- data/vendor/pygments-main/tests/examplefiles/example.prg +0 -161
- data/vendor/pygments-main/tests/examplefiles/example.rb +0 -1852
- data/vendor/pygments-main/tests/examplefiles/example.red +0 -257
- data/vendor/pygments-main/tests/examplefiles/example.reds +0 -150
- data/vendor/pygments-main/tests/examplefiles/example.reg +0 -19
- data/vendor/pygments-main/tests/examplefiles/example.rexx +0 -50
- data/vendor/pygments-main/tests/examplefiles/example.rhtml +0 -561
- data/vendor/pygments-main/tests/examplefiles/example.rkt +0 -743
- data/vendor/pygments-main/tests/examplefiles/example.rpf +0 -4
- data/vendor/pygments-main/tests/examplefiles/example.sh +0 -22
- data/vendor/pygments-main/tests/examplefiles/example.sh-session +0 -19
- data/vendor/pygments-main/tests/examplefiles/example.shell-session +0 -45
- data/vendor/pygments-main/tests/examplefiles/example.slim +0 -31
- data/vendor/pygments-main/tests/examplefiles/example.sls +0 -51
- data/vendor/pygments-main/tests/examplefiles/example.sml +0 -156
- data/vendor/pygments-main/tests/examplefiles/example.snobol +0 -15
- data/vendor/pygments-main/tests/examplefiles/example.stan +0 -110
- data/vendor/pygments-main/tests/examplefiles/example.tea +0 -34
- data/vendor/pygments-main/tests/examplefiles/example.todotxt +0 -9
- data/vendor/pygments-main/tests/examplefiles/example.ts +0 -28
- data/vendor/pygments-main/tests/examplefiles/example.u +0 -548
- data/vendor/pygments-main/tests/examplefiles/example.weechatlog +0 -9
- data/vendor/pygments-main/tests/examplefiles/example.xhtml +0 -376
- data/vendor/pygments-main/tests/examplefiles/example.xtend +0 -34
- data/vendor/pygments-main/tests/examplefiles/example.yaml +0 -302
- data/vendor/pygments-main/tests/examplefiles/example2.aspx +0 -29
- data/vendor/pygments-main/tests/examplefiles/example2.msc +0 -79
- data/vendor/pygments-main/tests/examplefiles/exampleScript.cfc +0 -241
- data/vendor/pygments-main/tests/examplefiles/exampleTag.cfc +0 -18
- data/vendor/pygments-main/tests/examplefiles/example_elixir.ex +0 -205
- data/vendor/pygments-main/tests/examplefiles/example_file.fy +0 -128
- data/vendor/pygments-main/tests/examplefiles/firefox.mak +0 -586
- data/vendor/pygments-main/tests/examplefiles/flipflop.sv +0 -19
- data/vendor/pygments-main/tests/examplefiles/foo.sce +0 -6
- data/vendor/pygments-main/tests/examplefiles/format.ml +0 -1213
- data/vendor/pygments-main/tests/examplefiles/fucked_up.rb +0 -77
- data/vendor/pygments-main/tests/examplefiles/function.mu +0 -1
- data/vendor/pygments-main/tests/examplefiles/functional.rst +0 -1472
- data/vendor/pygments-main/tests/examplefiles/garcia-wachs.kk +0 -133
- data/vendor/pygments-main/tests/examplefiles/genclass.clj +0 -510
- data/vendor/pygments-main/tests/examplefiles/genshi_example.xml+genshi +0 -193
- data/vendor/pygments-main/tests/examplefiles/genshitext_example.genshitext +0 -33
- data/vendor/pygments-main/tests/examplefiles/glsl.frag +0 -7
- data/vendor/pygments-main/tests/examplefiles/glsl.vert +0 -13
- data/vendor/pygments-main/tests/examplefiles/grammar-test.p6 +0 -22
- data/vendor/pygments-main/tests/examplefiles/hash_syntax.rb +0 -5
- data/vendor/pygments-main/tests/examplefiles/hello.at +0 -6
- data/vendor/pygments-main/tests/examplefiles/hello.golo +0 -5
- data/vendor/pygments-main/tests/examplefiles/hello.lsl +0 -12
- data/vendor/pygments-main/tests/examplefiles/hello.smali +0 -40
- data/vendor/pygments-main/tests/examplefiles/hello.sp +0 -9
- data/vendor/pygments-main/tests/examplefiles/html+php_faulty.php +0 -1
- data/vendor/pygments-main/tests/examplefiles/http_request_example +0 -15
- data/vendor/pygments-main/tests/examplefiles/http_response_example +0 -29
- data/vendor/pygments-main/tests/examplefiles/hybris_File.hy +0 -174
- data/vendor/pygments-main/tests/examplefiles/idl_sample.pro +0 -73
- data/vendor/pygments-main/tests/examplefiles/iex_example +0 -23
- data/vendor/pygments-main/tests/examplefiles/inet_pton6.dg +0 -71
- data/vendor/pygments-main/tests/examplefiles/intro.ik +0 -24
- data/vendor/pygments-main/tests/examplefiles/ints.php +0 -10
- data/vendor/pygments-main/tests/examplefiles/intsyn.fun +0 -675
- data/vendor/pygments-main/tests/examplefiles/intsyn.sig +0 -286
- data/vendor/pygments-main/tests/examplefiles/irb_heredoc +0 -8
- data/vendor/pygments-main/tests/examplefiles/irc.lsp +0 -214
- data/vendor/pygments-main/tests/examplefiles/java.properties +0 -16
- data/vendor/pygments-main/tests/examplefiles/jbst_example1.jbst +0 -28
- data/vendor/pygments-main/tests/examplefiles/jbst_example2.jbst +0 -45
- data/vendor/pygments-main/tests/examplefiles/jinjadesignerdoc.rst +0 -713
- data/vendor/pygments-main/tests/examplefiles/json.lasso +0 -301
- data/vendor/pygments-main/tests/examplefiles/json.lasso9 +0 -213
- data/vendor/pygments-main/tests/examplefiles/language.hy +0 -165
- data/vendor/pygments-main/tests/examplefiles/lighttpd_config.conf +0 -13
- data/vendor/pygments-main/tests/examplefiles/limbo.b +0 -456
- data/vendor/pygments-main/tests/examplefiles/linecontinuation.py +0 -47
- data/vendor/pygments-main/tests/examplefiles/livescript-demo.ls +0 -43
- data/vendor/pygments-main/tests/examplefiles/logos_example.xm +0 -28
- data/vendor/pygments-main/tests/examplefiles/ltmain.sh +0 -2849
- data/vendor/pygments-main/tests/examplefiles/main.cmake +0 -44
- data/vendor/pygments-main/tests/examplefiles/markdown.lsp +0 -679
- data/vendor/pygments-main/tests/examplefiles/matlab_noreturn +0 -3
- data/vendor/pygments-main/tests/examplefiles/matlab_sample +0 -30
- data/vendor/pygments-main/tests/examplefiles/matlabsession_sample.txt +0 -37
- data/vendor/pygments-main/tests/examplefiles/metagrammar.treetop +0 -455
- data/vendor/pygments-main/tests/examplefiles/minehunt.qml +0 -112
- data/vendor/pygments-main/tests/examplefiles/minimal.ns2 +0 -4
- data/vendor/pygments-main/tests/examplefiles/moin_SyntaxReference.txt +0 -340
- data/vendor/pygments-main/tests/examplefiles/multiline_regexes.rb +0 -38
- data/vendor/pygments-main/tests/examplefiles/nanomsg.intr +0 -95
- data/vendor/pygments-main/tests/examplefiles/nasm_aoutso.asm +0 -96
- data/vendor/pygments-main/tests/examplefiles/nasm_objexe.asm +0 -30
- data/vendor/pygments-main/tests/examplefiles/nemerle_sample.n +0 -87
- data/vendor/pygments-main/tests/examplefiles/nginx_nginx.conf +0 -118
- data/vendor/pygments-main/tests/examplefiles/numbers.c +0 -12
- data/vendor/pygments-main/tests/examplefiles/objc_example.m +0 -179
- data/vendor/pygments-main/tests/examplefiles/openedge_example +0 -34
- data/vendor/pygments-main/tests/examplefiles/pawn_example +0 -25
- data/vendor/pygments-main/tests/examplefiles/perl_misc +0 -62
- data/vendor/pygments-main/tests/examplefiles/perl_perl5db +0 -998
- data/vendor/pygments-main/tests/examplefiles/perl_regex-delims +0 -120
- data/vendor/pygments-main/tests/examplefiles/perlfunc.1 +0 -856
- data/vendor/pygments-main/tests/examplefiles/phpMyAdmin.spec +0 -163
- data/vendor/pygments-main/tests/examplefiles/phpcomplete.vim +0 -567
- data/vendor/pygments-main/tests/examplefiles/pleac.in.rb +0 -1223
- data/vendor/pygments-main/tests/examplefiles/postgresql_test.txt +0 -47
- data/vendor/pygments-main/tests/examplefiles/pppoe.applescript +0 -10
- data/vendor/pygments-main/tests/examplefiles/psql_session.txt +0 -122
- data/vendor/pygments-main/tests/examplefiles/py3_test.txt +0 -2
- data/vendor/pygments-main/tests/examplefiles/py3tb_test.py3tb +0 -4
- data/vendor/pygments-main/tests/examplefiles/pycon_test.pycon +0 -14
- data/vendor/pygments-main/tests/examplefiles/pytb_test2.pytb +0 -2
- data/vendor/pygments-main/tests/examplefiles/pytb_test3.pytb +0 -4
- data/vendor/pygments-main/tests/examplefiles/python25-bsd.mak +0 -234
- data/vendor/pygments-main/tests/examplefiles/qbasic_example +0 -2
- data/vendor/pygments-main/tests/examplefiles/qsort.prolog +0 -13
- data/vendor/pygments-main/tests/examplefiles/r-console-transcript.Rout +0 -38
- data/vendor/pygments-main/tests/examplefiles/r6rs-comments.scm +0 -23
- data/vendor/pygments-main/tests/examplefiles/ragel-cpp_rlscan +0 -280
- data/vendor/pygments-main/tests/examplefiles/ragel-cpp_snippet +0 -2
- data/vendor/pygments-main/tests/examplefiles/regex.js +0 -22
- data/vendor/pygments-main/tests/examplefiles/reversi.lsp +0 -427
- data/vendor/pygments-main/tests/examplefiles/robotframework_test.txt +0 -39
- data/vendor/pygments-main/tests/examplefiles/rql-queries.rql +0 -34
- data/vendor/pygments-main/tests/examplefiles/ruby_func_def.rb +0 -11
- data/vendor/pygments-main/tests/examplefiles/rust_example.rs +0 -233
- data/vendor/pygments-main/tests/examplefiles/scilab.sci +0 -30
- data/vendor/pygments-main/tests/examplefiles/scope.cirru +0 -43
- data/vendor/pygments-main/tests/examplefiles/session.dylan-console +0 -9
- data/vendor/pygments-main/tests/examplefiles/sibling.prolog +0 -19
- data/vendor/pygments-main/tests/examplefiles/simple.md +0 -747
- data/vendor/pygments-main/tests/examplefiles/smarty_example.html +0 -209
- data/vendor/pygments-main/tests/examplefiles/source.lgt +0 -343
- data/vendor/pygments-main/tests/examplefiles/sources.list +0 -62
- data/vendor/pygments-main/tests/examplefiles/sparql.rq +0 -23
- data/vendor/pygments-main/tests/examplefiles/sphere.pov +0 -18
- data/vendor/pygments-main/tests/examplefiles/sqlite3.sqlite3-console +0 -27
- data/vendor/pygments-main/tests/examplefiles/squid.conf +0 -30
- data/vendor/pygments-main/tests/examplefiles/string.jl +0 -1031
- data/vendor/pygments-main/tests/examplefiles/string_delimiters.d +0 -21
- data/vendor/pygments-main/tests/examplefiles/stripheredoc.sh +0 -3
- data/vendor/pygments-main/tests/examplefiles/swig_java.swg +0 -1329
- data/vendor/pygments-main/tests/examplefiles/swig_std_vector.i +0 -225
- data/vendor/pygments-main/tests/examplefiles/test.R +0 -185
- data/vendor/pygments-main/tests/examplefiles/test.adb +0 -211
- data/vendor/pygments-main/tests/examplefiles/test.agda +0 -102
- data/vendor/pygments-main/tests/examplefiles/test.apl +0 -26
- data/vendor/pygments-main/tests/examplefiles/test.asy +0 -131
- data/vendor/pygments-main/tests/examplefiles/test.awk +0 -121
- data/vendor/pygments-main/tests/examplefiles/test.bb +0 -95
- data/vendor/pygments-main/tests/examplefiles/test.bmx +0 -145
- data/vendor/pygments-main/tests/examplefiles/test.boo +0 -39
- data/vendor/pygments-main/tests/examplefiles/test.bro +0 -250
- data/vendor/pygments-main/tests/examplefiles/test.cs +0 -374
- data/vendor/pygments-main/tests/examplefiles/test.css +0 -54
- data/vendor/pygments-main/tests/examplefiles/test.cu +0 -36
- data/vendor/pygments-main/tests/examplefiles/test.cyp +0 -123
- data/vendor/pygments-main/tests/examplefiles/test.d +0 -135
- data/vendor/pygments-main/tests/examplefiles/test.dart +0 -23
- data/vendor/pygments-main/tests/examplefiles/test.dtd +0 -89
- data/vendor/pygments-main/tests/examplefiles/test.ebnf +0 -31
- data/vendor/pygments-main/tests/examplefiles/test.ec +0 -605
- data/vendor/pygments-main/tests/examplefiles/test.ecl +0 -58
- data/vendor/pygments-main/tests/examplefiles/test.eh +0 -315
- data/vendor/pygments-main/tests/examplefiles/test.erl +0 -169
- data/vendor/pygments-main/tests/examplefiles/test.evoque +0 -33
- data/vendor/pygments-main/tests/examplefiles/test.fan +0 -818
- data/vendor/pygments-main/tests/examplefiles/test.flx +0 -57
- data/vendor/pygments-main/tests/examplefiles/test.gdc +0 -13
- data/vendor/pygments-main/tests/examplefiles/test.groovy +0 -97
- data/vendor/pygments-main/tests/examplefiles/test.html +0 -339
- data/vendor/pygments-main/tests/examplefiles/test.idr +0 -93
- data/vendor/pygments-main/tests/examplefiles/test.ini +0 -10
- data/vendor/pygments-main/tests/examplefiles/test.java +0 -653
- data/vendor/pygments-main/tests/examplefiles/test.jsp +0 -24
- data/vendor/pygments-main/tests/examplefiles/test.maql +0 -45
- data/vendor/pygments-main/tests/examplefiles/test.mask +0 -41
- data/vendor/pygments-main/tests/examplefiles/test.mod +0 -374
- data/vendor/pygments-main/tests/examplefiles/test.moo +0 -51
- data/vendor/pygments-main/tests/examplefiles/test.myt +0 -166
- data/vendor/pygments-main/tests/examplefiles/test.nim +0 -93
- data/vendor/pygments-main/tests/examplefiles/test.opa +0 -10
- data/vendor/pygments-main/tests/examplefiles/test.p6 +0 -252
- data/vendor/pygments-main/tests/examplefiles/test.pan +0 -54
- data/vendor/pygments-main/tests/examplefiles/test.pas +0 -743
- data/vendor/pygments-main/tests/examplefiles/test.php +0 -507
- data/vendor/pygments-main/tests/examplefiles/test.pig +0 -148
- data/vendor/pygments-main/tests/examplefiles/test.plot +0 -333
- data/vendor/pygments-main/tests/examplefiles/test.ps1 +0 -108
- data/vendor/pygments-main/tests/examplefiles/test.pwn +0 -253
- data/vendor/pygments-main/tests/examplefiles/test.pypylog +0 -1839
- data/vendor/pygments-main/tests/examplefiles/test.r3 +0 -114
- data/vendor/pygments-main/tests/examplefiles/test.rb +0 -177
- data/vendor/pygments-main/tests/examplefiles/test.rhtml +0 -43
- data/vendor/pygments-main/tests/examplefiles/test.rsl +0 -111
- data/vendor/pygments-main/tests/examplefiles/test.scaml +0 -8
- data/vendor/pygments-main/tests/examplefiles/test.ssp +0 -12
- data/vendor/pygments-main/tests/examplefiles/test.swift +0 -65
- data/vendor/pygments-main/tests/examplefiles/test.tcsh +0 -830
- data/vendor/pygments-main/tests/examplefiles/test.vb +0 -407
- data/vendor/pygments-main/tests/examplefiles/test.vhdl +0 -161
- data/vendor/pygments-main/tests/examplefiles/test.xqy +0 -138
- data/vendor/pygments-main/tests/examplefiles/test.xsl +0 -23
- data/vendor/pygments-main/tests/examplefiles/test.zep +0 -33
- data/vendor/pygments-main/tests/examplefiles/test2.pypylog +0 -120
- data/vendor/pygments-main/tests/examplefiles/truncated.pytb +0 -15
- data/vendor/pygments-main/tests/examplefiles/type.lisp +0 -1218
- data/vendor/pygments-main/tests/examplefiles/underscore.coffee +0 -603
- data/vendor/pygments-main/tests/examplefiles/unicode.applescript +0 -5
- data/vendor/pygments-main/tests/examplefiles/unicode.go +0 -10
- data/vendor/pygments-main/tests/examplefiles/unicodedoc.py +0 -11
- data/vendor/pygments-main/tests/examplefiles/unix-io.lid +0 -37
- data/vendor/pygments-main/tests/examplefiles/vbnet_test.bas +0 -29
- data/vendor/pygments-main/tests/examplefiles/vctreestatus_hg +0 -4
- data/vendor/pygments-main/tests/examplefiles/vimrc +0 -21
- data/vendor/pygments-main/tests/examplefiles/webkit-transition.css +0 -3
- data/vendor/pygments-main/tests/examplefiles/while.pov +0 -13
- data/vendor/pygments-main/tests/examplefiles/wiki.factor +0 -384
- data/vendor/pygments-main/tests/examplefiles/xml_example +0 -1897
- data/vendor/pygments-main/tests/examplefiles/zmlrpc.f90 +0 -798
- data/vendor/pygments-main/tests/run.py +0 -44
- data/vendor/pygments-main/tests/string_asserts.py +0 -22
- data/vendor/pygments-main/tests/support.py +0 -15
- data/vendor/pygments-main/tests/support/tags +0 -36
- data/vendor/pygments-main/tests/test_basic_api.py +0 -309
- data/vendor/pygments-main/tests/test_cfm.py +0 -46
- data/vendor/pygments-main/tests/test_clexer.py +0 -236
- data/vendor/pygments-main/tests/test_cmdline.py +0 -106
- data/vendor/pygments-main/tests/test_examplefiles.py +0 -110
- data/vendor/pygments-main/tests/test_html_formatter.py +0 -180
- data/vendor/pygments-main/tests/test_latex_formatter.py +0 -57
- data/vendor/pygments-main/tests/test_lexers_other.py +0 -68
- data/vendor/pygments-main/tests/test_objectiveclexer.py +0 -81
- data/vendor/pygments-main/tests/test_perllexer.py +0 -137
- data/vendor/pygments-main/tests/test_qbasiclexer.py +0 -43
- data/vendor/pygments-main/tests/test_regexlexer.py +0 -54
- data/vendor/pygments-main/tests/test_rtf_formatter.py +0 -109
- data/vendor/pygments-main/tests/test_string_asserts.py +0 -39
- data/vendor/pygments-main/tests/test_token.py +0 -46
- data/vendor/pygments-main/tests/test_using_api.py +0 -40
- data/vendor/pygments-main/tests/test_util.py +0 -135
@@ -1,1660 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
|
3
|
-
*
|
4
|
-
* Redistribution and use in source and binary forms, with or without
|
5
|
-
* modification, are permitted provided that the following conditions
|
6
|
-
* are met:
|
7
|
-
*
|
8
|
-
* -Redistributions of source code must retain the above copyright
|
9
|
-
* notice, this list of conditions and the following disclaimer.
|
10
|
-
*
|
11
|
-
* -Redistribution in binary form must reproduct the above copyright
|
12
|
-
* notice, this list of conditions and the following disclaimer in
|
13
|
-
* the documentation and/or other materials provided with the distribution.
|
14
|
-
*
|
15
|
-
* Neither the name of Sun Microsystems, Inc. or the names of contributors
|
16
|
-
* may be used to endorse or promote products derived from this software
|
17
|
-
* without specific prior written permission.
|
18
|
-
*
|
19
|
-
* This software is provided "AS IS," without a warranty of any kind. ALL
|
20
|
-
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING
|
21
|
-
* ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
|
22
|
-
* OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN AND ITS LICENSORS SHALL NOT
|
23
|
-
* BE LIABLE FOR ANY DAMAGES OR LIABILITIES SUFFERED BY LICENSEE AS A RESULT
|
24
|
-
* OF OR RELATING TO USE, MODIFICATION OR DISTRIBUTION OF THE SOFTWARE OR ITS
|
25
|
-
* DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST
|
26
|
-
* REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL,
|
27
|
-
* INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY
|
28
|
-
* OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE, EVEN
|
29
|
-
* IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
30
|
-
*
|
31
|
-
* You acknowledge that Software is not designed, licensed or intended for
|
32
|
-
* use in the design, construction, operation or maintenance of any nuclear
|
33
|
-
* facility.
|
34
|
-
*/
|
35
|
-
|
36
|
-
|
37
|
-
package java2d;
|
38
|
-
|
39
|
-
import java.awt.*;
|
40
|
-
import java.awt.event.*;
|
41
|
-
import java.awt.geom.*;
|
42
|
-
import java.awt.image.BufferedImage;
|
43
|
-
import java.awt.image.DataBuffer;
|
44
|
-
import java.awt.font.*;
|
45
|
-
import javax.swing.*;
|
46
|
-
import javax.swing.border.*;
|
47
|
-
import javax.swing.table.*;
|
48
|
-
import javax.swing.event.*;
|
49
|
-
import java.util.Vector;
|
50
|
-
import java.util.List;
|
51
|
-
import java.util.Arrays;
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
/**
|
56
|
-
* Introduction to the Java2Demo.
|
57
|
-
*
|
58
|
-
* @version @(#)Intro.java 1.19 03/06/26
|
59
|
-
* @author Brian Lichtenwalter
|
60
|
-
*/
|
61
|
-
public class Intro extends JPanel {
|
62
|
-
|
63
|
-
static Color black = new Color(20, 20, 20);
|
64
|
-
static Color white = new Color(240, 240, 255);
|
65
|
-
static Color red = new Color(149, 43, 42);
|
66
|
-
static Color blue = new Color(94, 105, 176);
|
67
|
-
static Color yellow = new Color(255, 255, 140);
|
68
|
-
|
69
|
-
static Surface surface;
|
70
|
-
private ScenesTable scenesTable;
|
71
|
-
private boolean doTable;
|
72
|
-
|
73
|
-
|
74
|
-
public Intro() {
|
75
|
-
EmptyBorder eb = new EmptyBorder(80,110,80,110);
|
76
|
-
BevelBorder bb = new BevelBorder(BevelBorder.LOWERED);
|
77
|
-
setBorder(new CompoundBorder(eb,bb));
|
78
|
-
setLayout(new BorderLayout());
|
79
|
-
setBackground(Color.gray);
|
80
|
-
setToolTipText("click for scene table");
|
81
|
-
add(surface = new Surface());
|
82
|
-
addMouseListener(new MouseAdapter() {
|
83
|
-
public void mouseClicked(MouseEvent e) {
|
84
|
-
removeAll();
|
85
|
-
if ((doTable = !doTable)) {
|
86
|
-
setToolTipText("click for animation");
|
87
|
-
surface.stop();
|
88
|
-
if (scenesTable == null) {
|
89
|
-
scenesTable = new ScenesTable();
|
90
|
-
}
|
91
|
-
add(scenesTable);
|
92
|
-
} else {
|
93
|
-
setToolTipText("click for scene table");
|
94
|
-
surface.start();
|
95
|
-
add(surface);
|
96
|
-
}
|
97
|
-
revalidate();
|
98
|
-
repaint();
|
99
|
-
}
|
100
|
-
});
|
101
|
-
}
|
102
|
-
|
103
|
-
|
104
|
-
public void start() {
|
105
|
-
if (!doTable) {
|
106
|
-
surface.start();
|
107
|
-
}
|
108
|
-
}
|
109
|
-
|
110
|
-
|
111
|
-
public void stop() {
|
112
|
-
if (!doTable) {
|
113
|
-
surface.stop();
|
114
|
-
}
|
115
|
-
}
|
116
|
-
|
117
|
-
|
118
|
-
public static void main(String argv[]) {
|
119
|
-
final Intro intro = new Intro();
|
120
|
-
WindowListener l = new WindowAdapter() {
|
121
|
-
public void windowClosing(WindowEvent e) {System.exit(0);}
|
122
|
-
public void windowDeiconified(WindowEvent e) { intro.start(); }
|
123
|
-
public void windowIconified(WindowEvent e) { intro.stop(); }
|
124
|
-
};
|
125
|
-
JFrame f = new JFrame("Java2D Demo - Intro");
|
126
|
-
f.addWindowListener(l);
|
127
|
-
f.getContentPane().add("Center", intro);
|
128
|
-
f.pack();
|
129
|
-
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
|
130
|
-
int w = 720;
|
131
|
-
int h = 510;
|
132
|
-
f.setLocation(screenSize.width/2 - w/2, screenSize.height/2 - h/2);
|
133
|
-
f.setSize(w, h);
|
134
|
-
f.setVisible(true);
|
135
|
-
intro.start();
|
136
|
-
}
|
137
|
-
|
138
|
-
|
139
|
-
/**
|
140
|
-
* ScenesTable is the list of scenes known to the Director.
|
141
|
-
* Scene participation, scene name and scene pause amount columns.
|
142
|
-
* Global animation delay for scene's steps.
|
143
|
-
*/
|
144
|
-
static class ScenesTable extends JPanel implements ActionListener, ChangeListener {
|
145
|
-
|
146
|
-
private JTable table;
|
147
|
-
private TableModel dataModel;
|
148
|
-
|
149
|
-
public ScenesTable() {
|
150
|
-
setBackground(Color.white);
|
151
|
-
setLayout(new BorderLayout());
|
152
|
-
final String[] names = { "", "Scenes", "Pause" };
|
153
|
-
|
154
|
-
dataModel = new AbstractTableModel() {
|
155
|
-
public int getColumnCount() { return names.length; }
|
156
|
-
public int getRowCount() { return surface.director.size();}
|
157
|
-
public Object getValueAt(int row, int col) {
|
158
|
-
Surface.Scene scene = (Surface.Scene) surface.director.get(row);
|
159
|
-
if (col == 0) {
|
160
|
-
return scene.participate;
|
161
|
-
} else if (col == 1) {
|
162
|
-
return scene.name;
|
163
|
-
} else {
|
164
|
-
return scene.pauseAmt;
|
165
|
-
}
|
166
|
-
}
|
167
|
-
public String getColumnName(int col) {return names[col]; }
|
168
|
-
public Class getColumnClass(int c) {
|
169
|
-
return getValueAt(0, c).getClass();
|
170
|
-
}
|
171
|
-
public boolean isCellEditable(int row, int col) {
|
172
|
-
return col != 1 ? true : false;
|
173
|
-
}
|
174
|
-
public void setValueAt(Object aValue, int row, int col) {
|
175
|
-
Surface.Scene scene = (Surface.Scene) surface.director.get(row);
|
176
|
-
if (col == 0) {
|
177
|
-
scene.participate = aValue;
|
178
|
-
} else if (col == 1) {
|
179
|
-
scene.name = aValue;
|
180
|
-
} else {
|
181
|
-
scene.pauseAmt = aValue;
|
182
|
-
}
|
183
|
-
}
|
184
|
-
};
|
185
|
-
|
186
|
-
table = new JTable(dataModel);
|
187
|
-
TableColumn col = table.getColumn("");
|
188
|
-
col.setWidth(16);
|
189
|
-
col.setMinWidth(16);
|
190
|
-
col.setMaxWidth(20);
|
191
|
-
col = table.getColumn("Pause");
|
192
|
-
col.setWidth(60);
|
193
|
-
col.setMinWidth(60);
|
194
|
-
col.setMaxWidth(60);
|
195
|
-
table.sizeColumnsToFit(0);
|
196
|
-
|
197
|
-
JScrollPane scrollpane = new JScrollPane(table);
|
198
|
-
add(scrollpane);
|
199
|
-
|
200
|
-
JPanel panel = new JPanel(new BorderLayout());
|
201
|
-
JButton b = new JButton("Unselect All");
|
202
|
-
b.setHorizontalAlignment(JButton.LEFT);
|
203
|
-
Font font = new Font("serif", Font.PLAIN, 10);
|
204
|
-
b.setFont(font);
|
205
|
-
b.addActionListener(this);
|
206
|
-
panel.add("West", b);
|
207
|
-
|
208
|
-
JSlider slider = new JSlider(JSlider.HORIZONTAL, 0, 200, (int) surface.sleepAmt);
|
209
|
-
slider.addChangeListener(this);
|
210
|
-
TitledBorder tb = new TitledBorder(new EtchedBorder());
|
211
|
-
tb.setTitleFont(font);
|
212
|
-
tb.setTitle("Anim delay = " + String.valueOf(surface.sleepAmt) + " ms");
|
213
|
-
slider.setBorder(tb);
|
214
|
-
slider.setPreferredSize(new Dimension(140,40));
|
215
|
-
slider.setMinimumSize(new Dimension(100,40));
|
216
|
-
slider.setMaximumSize(new Dimension(180,40));
|
217
|
-
panel.add("East", slider);
|
218
|
-
|
219
|
-
add("South", panel);
|
220
|
-
}
|
221
|
-
|
222
|
-
|
223
|
-
public void actionPerformed(ActionEvent e) {
|
224
|
-
JButton b = (JButton) e.getSource();
|
225
|
-
b.setSelected(!b.isSelected());
|
226
|
-
b.setText(b.isSelected() ? "Select All" : "Unselect All");
|
227
|
-
for (int i = 0; i < surface.director.size(); i++) {
|
228
|
-
Surface.Scene scene = (Surface.Scene) surface.director.get(i);
|
229
|
-
scene.participate = new Boolean(!b.isSelected());
|
230
|
-
}
|
231
|
-
table.tableChanged(new TableModelEvent(dataModel));
|
232
|
-
}
|
233
|
-
|
234
|
-
|
235
|
-
public void stateChanged(ChangeEvent e) {
|
236
|
-
JSlider slider = (JSlider) e.getSource();
|
237
|
-
int value = slider.getValue();
|
238
|
-
TitledBorder tb = (TitledBorder) slider.getBorder();
|
239
|
-
tb.setTitle("Anim delay = " + String.valueOf(value) + " ms");
|
240
|
-
surface.sleepAmt = (long) value;
|
241
|
-
slider.repaint();
|
242
|
-
}
|
243
|
-
} // End ScenesTable class
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
/**
|
248
|
-
* Surface is the stage where the Director plays its scenes.
|
249
|
-
*/
|
250
|
-
static class Surface extends JPanel implements Runnable {
|
251
|
-
|
252
|
-
static Surface surf;
|
253
|
-
static Image cupanim, java_logo;
|
254
|
-
static BufferedImage bimg;
|
255
|
-
public Director director;
|
256
|
-
public int index;
|
257
|
-
public long sleepAmt = 30;
|
258
|
-
private Thread thread;
|
259
|
-
|
260
|
-
|
261
|
-
public Surface() {
|
262
|
-
surf = this;
|
263
|
-
setBackground(black);
|
264
|
-
setLayout(new BorderLayout());
|
265
|
-
addMouseListener(new MouseAdapter() {
|
266
|
-
public void mouseClicked(MouseEvent e) {
|
267
|
-
if (thread == null) start(); else stop();
|
268
|
-
}
|
269
|
-
});
|
270
|
-
cupanim = DemoImages.getImage("cupanim.gif", this);
|
271
|
-
java_logo = DemoImages.getImage("java_logo.png", this);
|
272
|
-
director = new Director();
|
273
|
-
}
|
274
|
-
|
275
|
-
|
276
|
-
static FontMetrics getMetrics(Font font) {
|
277
|
-
return surf.getFontMetrics(font);
|
278
|
-
}
|
279
|
-
|
280
|
-
|
281
|
-
public void paint(Graphics g) {
|
282
|
-
Dimension d = getSize();
|
283
|
-
if (d.width <= 0 || d.height <= 0) {
|
284
|
-
return;
|
285
|
-
}
|
286
|
-
if (bimg == null || bimg.getWidth() != d.width || bimg.getHeight() != d.height) {
|
287
|
-
bimg = getGraphicsConfiguration().createCompatibleImage(d.width, d.height);
|
288
|
-
// reset future scenes
|
289
|
-
for (int i = index+1; i < director.size(); i++) {
|
290
|
-
((Scene) director.get(i)).reset(d.width, d.height);
|
291
|
-
}
|
292
|
-
}
|
293
|
-
|
294
|
-
Scene scene = (Scene) director.get(index);
|
295
|
-
if (scene.index <= scene.length) {
|
296
|
-
if (thread != null) {
|
297
|
-
scene.step(d.width, d.height);
|
298
|
-
}
|
299
|
-
|
300
|
-
Graphics2D g2 = bimg.createGraphics();
|
301
|
-
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
|
302
|
-
RenderingHints.VALUE_ANTIALIAS_ON);
|
303
|
-
g2.setBackground(getBackground());
|
304
|
-
g2.clearRect(0, 0, d.width, d.height);
|
305
|
-
|
306
|
-
scene.render(d.width, d.height, g2);
|
307
|
-
|
308
|
-
if (thread != null) {
|
309
|
-
// increment scene.index after scene.render
|
310
|
-
scene.index++;
|
311
|
-
}
|
312
|
-
g2.dispose();
|
313
|
-
}
|
314
|
-
g.drawImage(bimg, 0, 0, this);
|
315
|
-
}
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
public void start() {
|
320
|
-
if (thread == null) {
|
321
|
-
thread = new Thread(this);
|
322
|
-
thread.setPriority(Thread.MIN_PRIORITY);
|
323
|
-
thread.setName("Intro");
|
324
|
-
thread.start();
|
325
|
-
}
|
326
|
-
}
|
327
|
-
|
328
|
-
|
329
|
-
public synchronized void stop() {
|
330
|
-
if (thread != null) {
|
331
|
-
thread.interrupt();
|
332
|
-
}
|
333
|
-
thread = null;
|
334
|
-
notifyAll();
|
335
|
-
}
|
336
|
-
|
337
|
-
|
338
|
-
public void reset() {
|
339
|
-
index = 0;
|
340
|
-
Dimension d = getSize();
|
341
|
-
for (int i = 0; i < director.size(); i++) {
|
342
|
-
((Scene) director.get(i)).reset(d.width, d.height);
|
343
|
-
}
|
344
|
-
}
|
345
|
-
|
346
|
-
|
347
|
-
public void run() {
|
348
|
-
|
349
|
-
Thread me = Thread.currentThread();
|
350
|
-
|
351
|
-
while (thread == me && !isShowing() || getSize().width <= 0) {
|
352
|
-
try {
|
353
|
-
thread.sleep(500);
|
354
|
-
} catch (InterruptedException e) { return; }
|
355
|
-
}
|
356
|
-
|
357
|
-
if (index == 0) {
|
358
|
-
reset();
|
359
|
-
}
|
360
|
-
|
361
|
-
while (thread == me) {
|
362
|
-
Scene scene = (Scene) director.get(index);
|
363
|
-
if (((Boolean) scene.participate).booleanValue()) {
|
364
|
-
repaint();
|
365
|
-
try {
|
366
|
-
thread.sleep(sleepAmt);
|
367
|
-
} catch (InterruptedException e) { break; }
|
368
|
-
if (scene.index > scene.length) {
|
369
|
-
scene.pause(thread);
|
370
|
-
if (++index >= director.size()) {
|
371
|
-
reset();
|
372
|
-
}
|
373
|
-
}
|
374
|
-
} else {
|
375
|
-
if (++index >= director.size()) {
|
376
|
-
reset();
|
377
|
-
}
|
378
|
-
}
|
379
|
-
}
|
380
|
-
thread = null;
|
381
|
-
}
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
/**
|
386
|
-
* Part is a piece of the scene. Classes must implement Part
|
387
|
-
* inorder to participate in a scene.
|
388
|
-
*/
|
389
|
-
interface Part {
|
390
|
-
public void reset(int newwidth, int newheight);
|
391
|
-
public void step(int w, int h);
|
392
|
-
public void render(int w, int h, Graphics2D g2);
|
393
|
-
public int getBegin();
|
394
|
-
public int getEnd();
|
395
|
-
}
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
/**
|
400
|
-
* Director is the holder of the scenes, their names & pause amounts
|
401
|
-
* between scenes.
|
402
|
-
*/
|
403
|
-
static class Director extends Vector {
|
404
|
-
|
405
|
-
GradientPaint gp = new GradientPaint(0,40,blue,38,2,black);
|
406
|
-
Font f1 = new Font("serif", Font.PLAIN, 200);
|
407
|
-
Font f2 = new Font("serif", Font.PLAIN, 120);
|
408
|
-
Font f3 = new Font("serif", Font.PLAIN, 72);
|
409
|
-
Object parts[][][] = {
|
410
|
-
{ { "J - scale text on gradient", "0" },
|
411
|
-
{ new GpE(GpE.BURI, black, blue, 0, 20),
|
412
|
-
new TxE("J", f1, TxE.SCI, yellow, 2, 20) } },
|
413
|
-
{ { "2 - scale & rotate text on gradient" , "0" },
|
414
|
-
{ new GpE(GpE.BURI, blue, black, 0, 22),
|
415
|
-
new TxE("2", f1, TxE.RI | TxE.SCI, yellow, 2, 22) } },
|
416
|
-
{ { "D - scale text on gradient", "0" },
|
417
|
-
{ new GpE(GpE.BURI, black, blue, 0, 20),
|
418
|
-
new TxE("D", f1, TxE.SCI, yellow, 2, 20) } },
|
419
|
-
{ { "Java2D - scale & rotate text on gradient", "1000" },
|
420
|
-
{ new GpE(GpE.SIH, blue, black, 0, 40),
|
421
|
-
new TxE("Java2D", f2, TxE.RI | TxE.SCI, yellow, 0, 40) }},
|
422
|
-
{ { "Previous scene dither dissolve out", "0"},
|
423
|
-
{ new DdE(0, 20, 1) }},
|
424
|
-
{ { "Graphics Features", "999" },
|
425
|
-
{ new Temp(Temp.RECT, null, 0, 15),
|
426
|
-
new Temp(Temp.IMG, java_logo, 2, 15),
|
427
|
-
new Temp(Temp.RNA | Temp.INA, java_logo, 16, 130),
|
428
|
-
new Features(Features.GRAPHICS, 16, 130) }},
|
429
|
-
{ { "Java2D - texture text on gradient", "1000"},
|
430
|
-
{ new GpE(GpE.WI, blue, black, 0, 20),
|
431
|
-
new GpE(GpE.WD, blue, black, 21, 40),
|
432
|
-
new TpE(TpE.OI | TpE.NF, black, yellow, 4, 0, 10),
|
433
|
-
new TpE(TpE.OD | TpE.NF, black, yellow, 4, 11, 20),
|
434
|
-
new TpE(TpE.OI | TpE.NF | TpE.HAF, black, yellow,5,21,40),
|
435
|
-
new TxE("Java2D", f2, 0, null, 0, 40) }},
|
436
|
-
{ { "Previous scene random close out", "0"},
|
437
|
-
{ new CoE(CoE.RAND, 0, 20) } },
|
438
|
-
{ { "Text Features", "999" },
|
439
|
-
{ new Temp(Temp.RECT, null, 0, 15),
|
440
|
-
new Temp(Temp.IMG, java_logo, 2, 15),
|
441
|
-
new Temp(Temp.RNA | Temp.INA, java_logo, 16, 130),
|
442
|
-
new Features(Features.TEXT, 16, 130) }},
|
443
|
-
{ { "Java2D - composite text on texture", "1000"},
|
444
|
-
{ new TpE(TpE.RI, black, gp, 40, 0, 20),
|
445
|
-
new TpE(TpE.RD, black, gp, 40, 21, 40),
|
446
|
-
new TpE(TpE.RI, black, gp, 40, 41, 60),
|
447
|
-
new TxE("Java2D", f2, TxE.AC, yellow, 0, 60) }},
|
448
|
-
{ { "Previous scene dither dissolve out", "0"},
|
449
|
-
{ new DdE(0, 20, 4) }},
|
450
|
-
{ { "Imaging Features", "999" },
|
451
|
-
{ new Temp(Temp.RECT, null, 0, 15),
|
452
|
-
new Temp(Temp.IMG, java_logo, 2, 15),
|
453
|
-
new Temp(Temp.RNA | Temp.INA, java_logo, 16, 130),
|
454
|
-
new Features(Features.IMAGES, 16, 130) }},
|
455
|
-
{ { "Java2D - text on gradient", "1000" },
|
456
|
-
{ new GpE(GpE.SDH, blue, black, 0, 20),
|
457
|
-
new GpE(GpE.SIH, blue, black, 21, 40),
|
458
|
-
new GpE(GpE.SDH, blue, black, 41, 50),
|
459
|
-
new GpE(GpE.INC | GpE.NF, red, yellow, 0, 50),
|
460
|
-
new TxE("Java2D", f2, TxE.NOP, null, 0, 50) }},
|
461
|
-
{ { "Previous scene ellipse close out", "0"},
|
462
|
-
{ new CoE(CoE.OVAL, 0, 20) } },
|
463
|
-
{ { "Color Features", "999" },
|
464
|
-
{ new Temp(Temp.RECT, null, 0, 15),
|
465
|
-
new Temp(Temp.IMG, java_logo, 2, 15),
|
466
|
-
new Temp(Temp.RNA | Temp.INA, java_logo, 16, 99),
|
467
|
-
new Features(Features.COLOR, 16, 99) }},
|
468
|
-
{ { "Java2D - composite and rotate text on paints", "2000" },
|
469
|
-
{ new GpE(GpE.BURI, black, blue, 0, 20),
|
470
|
-
new GpE(GpE.BURD, black, blue, 21, 30),
|
471
|
-
new TpE(TpE.OI | TpE.HAF, black, blue, 10, 31, 40),
|
472
|
-
new TxE("Java2D", f2, TxE.AC | TxE.RI, yellow, 0, 40) }},
|
473
|
-
{ { "Previous scene subimage transform out", "0" },
|
474
|
-
{ new SiE(60, 60, 0, 40) }},
|
475
|
-
{ { "CREDITS - transform in", "1000" },
|
476
|
-
{ new LnE(LnE.ACI | LnE.ZOOMI | LnE.RI, 0, 60),
|
477
|
-
new TxE("CREDITS", f3, TxE.AC | TxE.SCI, Color.red,20,30),
|
478
|
-
new TxE("CREDITS", f3, TxE.SCXD, Color.red, 31, 38),
|
479
|
-
new TxE("CREDITS", f3, TxE.SCXI, Color.red, 39, 48),
|
480
|
-
new TxE("CREDITS", f3, TxE.SCXD, Color.red, 49, 54),
|
481
|
-
new TxE("CREDITS", f3, TxE.SCXI, Color.red, 55, 60) }},
|
482
|
-
{ { "CREDITS - transform out", "0" },
|
483
|
-
{ new LnE(LnE.ACD | LnE.ZOOMD | LnE.RD, 0, 45),
|
484
|
-
new TxE("CREDITS", f3, 0, Color.red, 0, 9),
|
485
|
-
new TxE("CREDITS", f3, TxE.SCD | TxE.RD, Color.red,10,30)}},
|
486
|
-
{ { "Contributors", "1000" },
|
487
|
-
{ new Temp(Temp.RECT, null, 0, 30),
|
488
|
-
new Temp(Temp.IMG, cupanim, 4, 30),
|
489
|
-
new Temp(Temp.RNA | Temp.INA, cupanim, 31, 200),
|
490
|
-
new Contributors(34, 200) } },
|
491
|
-
};
|
492
|
-
|
493
|
-
|
494
|
-
public Director() {
|
495
|
-
for (int i = 0; i < parts.length; i++) {
|
496
|
-
Vector v = new Vector();
|
497
|
-
for (int j = 0; j < parts[i][1].length; j++) {
|
498
|
-
v.addElement(parts[i][1][j]);
|
499
|
-
}
|
500
|
-
addElement(new Scene(v, parts[i][0][0], parts[i][0][1]));
|
501
|
-
}
|
502
|
-
}
|
503
|
-
}
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
/**
|
508
|
-
* Scene is the manager of the parts.
|
509
|
-
*/
|
510
|
-
static class Scene extends Object {
|
511
|
-
public Object name;
|
512
|
-
public Object participate = new Boolean(true);
|
513
|
-
public Object pauseAmt;
|
514
|
-
public Vector parts;
|
515
|
-
public int index;
|
516
|
-
public int length;
|
517
|
-
|
518
|
-
public Scene(Vector parts, Object name, Object pauseAmt) {
|
519
|
-
this.name = name;
|
520
|
-
this.parts = parts;
|
521
|
-
this.pauseAmt = pauseAmt;
|
522
|
-
for (int i = 0; i < parts.size(); i++) {
|
523
|
-
if (((Part) parts.get(i)).getEnd() > length) {
|
524
|
-
length = ((Part) parts.get(i)).getEnd();
|
525
|
-
}
|
526
|
-
}
|
527
|
-
}
|
528
|
-
|
529
|
-
public void reset(int w, int h) {
|
530
|
-
index = 0;
|
531
|
-
for (int i = 0; i < parts.size(); i++) {
|
532
|
-
((Part) parts.get(i)).reset(w, h);
|
533
|
-
}
|
534
|
-
}
|
535
|
-
|
536
|
-
public void step(int w, int h) {
|
537
|
-
for (int i = 0; i < parts.size(); i++) {
|
538
|
-
Part part = (Part) parts.get(i);
|
539
|
-
if (index >= part.getBegin() && index <= part.getEnd()) {
|
540
|
-
part.step(w, h);
|
541
|
-
}
|
542
|
-
}
|
543
|
-
}
|
544
|
-
|
545
|
-
public void render(int w, int h, Graphics2D g2) {
|
546
|
-
for (int i = 0; i < parts.size(); i++) {
|
547
|
-
Part part = (Part) parts.get(i);
|
548
|
-
if (index >= part.getBegin() && index <= part.getEnd()) {
|
549
|
-
part.render(w, h, g2);
|
550
|
-
}
|
551
|
-
}
|
552
|
-
}
|
553
|
-
|
554
|
-
public void pause(Thread thread) {
|
555
|
-
try {
|
556
|
-
thread.sleep(Long.parseLong((String) pauseAmt));
|
557
|
-
} catch (Exception e) { }
|
558
|
-
System.gc();
|
559
|
-
}
|
560
|
-
} // End Scene class
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
/**
|
565
|
-
* Text Effect. Transformation of characters. Clip or fill.
|
566
|
-
*/
|
567
|
-
static class TxE implements Part {
|
568
|
-
|
569
|
-
static final int INC = 1;
|
570
|
-
static final int DEC = 2;
|
571
|
-
static final int R = 4; // rotate
|
572
|
-
static final int RI = R | INC;
|
573
|
-
static final int RD = R | DEC;
|
574
|
-
static final int SC = 8; // scale
|
575
|
-
static final int SCI = SC | INC;
|
576
|
-
static final int SCD = SC | DEC;
|
577
|
-
static final int SCX = 16; // scale invert x
|
578
|
-
static final int SCXI = SCX | SC | INC;
|
579
|
-
static final int SCXD = SCX | SC | DEC;
|
580
|
-
static final int SCY = 32; // scale invert y
|
581
|
-
static final int SCYI = SCY | SC | INC;
|
582
|
-
static final int SCYD = SCY | SC | DEC;
|
583
|
-
static final int AC = 64; // AlphaComposite
|
584
|
-
static final int CLIP = 128; // Clipping
|
585
|
-
static final int NOP = 512; // No Paint
|
586
|
-
private int beginning, ending;
|
587
|
-
private int type;
|
588
|
-
private double rIncr, sIncr;
|
589
|
-
private double sx, sy, rotate;
|
590
|
-
private Shape shapes[], txShapes[];
|
591
|
-
private int sw;
|
592
|
-
private int numRev;
|
593
|
-
private Paint paint;
|
594
|
-
|
595
|
-
|
596
|
-
public TxE(String text,
|
597
|
-
Font font,
|
598
|
-
int type,
|
599
|
-
Paint paint,
|
600
|
-
int beg,
|
601
|
-
int end) {
|
602
|
-
this.type = type;
|
603
|
-
this.paint = paint;
|
604
|
-
this.beginning = beg;
|
605
|
-
this.ending = end;
|
606
|
-
|
607
|
-
setIncrements(2);
|
608
|
-
|
609
|
-
char[] chars = text.toCharArray();
|
610
|
-
shapes = new Shape[chars.length];
|
611
|
-
txShapes = new Shape[chars.length];
|
612
|
-
FontRenderContext frc = new FontRenderContext(null,true,true);
|
613
|
-
TextLayout tl = new TextLayout(text, font, frc);
|
614
|
-
sw = (int) tl.getOutline(null).getBounds().getWidth();
|
615
|
-
for (int j = 0; j < chars.length; j++) {
|
616
|
-
String s = String.valueOf(chars[j]);
|
617
|
-
shapes[j] = new TextLayout(s, font, frc).getOutline(null);
|
618
|
-
}
|
619
|
-
}
|
620
|
-
|
621
|
-
|
622
|
-
public void setIncrements(double numRevolutions) {
|
623
|
-
this.numRev = (int) numRevolutions;
|
624
|
-
rIncr = 360.0 / ((ending - beginning) / numRevolutions);
|
625
|
-
sIncr = 1.0 / (ending - beginning);
|
626
|
-
if ((type & SCX) != 0 || (type & SCY) != 0) {
|
627
|
-
sIncr *= 2;
|
628
|
-
}
|
629
|
-
if ((type & DEC) != 0) {
|
630
|
-
rIncr = -rIncr;
|
631
|
-
sIncr = -sIncr;
|
632
|
-
}
|
633
|
-
}
|
634
|
-
|
635
|
-
|
636
|
-
public void reset(int w, int h) {
|
637
|
-
if (type == SCXI) {
|
638
|
-
sx = -1.0; sy = 1.0;
|
639
|
-
} else if (type == SCYI) {
|
640
|
-
sx = 1.0; sy = -1.0;
|
641
|
-
} else {
|
642
|
-
sx = sy = (type & DEC) != 0 ? 1.0 : 0.0;
|
643
|
-
}
|
644
|
-
rotate = 0;
|
645
|
-
}
|
646
|
-
|
647
|
-
|
648
|
-
public void step(int w, int h) {
|
649
|
-
|
650
|
-
float charWidth = w/2-sw/2;
|
651
|
-
|
652
|
-
for (int i = 0; i < shapes.length; i++) {
|
653
|
-
AffineTransform at = new AffineTransform();
|
654
|
-
Rectangle2D maxBounds = shapes[i].getBounds();
|
655
|
-
at.translate(charWidth, h/2+maxBounds.getHeight()/2);
|
656
|
-
charWidth += (float) maxBounds.getWidth() + 1;
|
657
|
-
Shape shape = at.createTransformedShape(shapes[i]);
|
658
|
-
Rectangle2D b1 = shape.getBounds2D();
|
659
|
-
|
660
|
-
if ((type & R) != 0) {
|
661
|
-
at.rotate(Math.toRadians(rotate));
|
662
|
-
}
|
663
|
-
if ((type & SC) != 0) {
|
664
|
-
at.scale(sx, sy);
|
665
|
-
}
|
666
|
-
shape = at.createTransformedShape(shapes[i]);
|
667
|
-
Rectangle2D b2 = shape.getBounds2D();
|
668
|
-
|
669
|
-
double xx = (b1.getX()+b1.getWidth()/2)
|
670
|
-
- (b2.getX()+b2.getWidth()/2);
|
671
|
-
double yy = (b1.getY()+b1.getHeight()/2)
|
672
|
-
- (b2.getY()+b2.getHeight()/2);
|
673
|
-
AffineTransform toCenterAT = new AffineTransform();
|
674
|
-
toCenterAT.translate(xx, yy);
|
675
|
-
toCenterAT.concatenate(at);
|
676
|
-
txShapes[i] = toCenterAT.createTransformedShape(shapes[i]);
|
677
|
-
}
|
678
|
-
// avoid over rotation
|
679
|
-
if (Math.abs(rotate) <= numRev * 360) {
|
680
|
-
rotate += rIncr;
|
681
|
-
if ((type & SCX) != 0) {
|
682
|
-
sx += sIncr;
|
683
|
-
} else if ((type & SCY) != 0) {
|
684
|
-
sy += sIncr;
|
685
|
-
} else {
|
686
|
-
sx += sIncr; sy += sIncr;
|
687
|
-
}
|
688
|
-
}
|
689
|
-
}
|
690
|
-
|
691
|
-
|
692
|
-
public void render(int w, int h, Graphics2D g2) {
|
693
|
-
Composite saveAC = null;
|
694
|
-
if ((type & AC) != 0 && sx > 0 && sx < 1) {
|
695
|
-
saveAC = g2.getComposite();
|
696
|
-
g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, (float) sx));
|
697
|
-
}
|
698
|
-
GeneralPath path = null;
|
699
|
-
if ((type & CLIP) != 0) {
|
700
|
-
path = new GeneralPath();
|
701
|
-
}
|
702
|
-
if (paint != null) {
|
703
|
-
g2.setPaint(paint);
|
704
|
-
}
|
705
|
-
for (int i = 0; i < txShapes.length; i++) {
|
706
|
-
if ((type & CLIP) != 0) {
|
707
|
-
path.append(txShapes[i], false);
|
708
|
-
} else {
|
709
|
-
g2.fill(txShapes[i]);
|
710
|
-
}
|
711
|
-
}
|
712
|
-
if ((type & CLIP) != 0) {
|
713
|
-
g2.clip(path);
|
714
|
-
}
|
715
|
-
if (saveAC != null) {
|
716
|
-
g2.setComposite(saveAC);
|
717
|
-
}
|
718
|
-
}
|
719
|
-
|
720
|
-
|
721
|
-
public int getBegin() {
|
722
|
-
return beginning;
|
723
|
-
}
|
724
|
-
|
725
|
-
public int getEnd() {
|
726
|
-
return ending;
|
727
|
-
}
|
728
|
-
} // End TxE class
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
/**
|
734
|
-
* GradientPaint Effect. Burst, split, horizontal and
|
735
|
-
* vertical gradient fill effects.
|
736
|
-
*/
|
737
|
-
static class GpE implements Part {
|
738
|
-
|
739
|
-
static final int INC = 1; // increasing
|
740
|
-
static final int DEC = 2; // decreasing
|
741
|
-
static final int CNT = 4; // center
|
742
|
-
static final int WID = 8; // width
|
743
|
-
static final int WI = WID | INC;
|
744
|
-
static final int WD = WID | DEC;
|
745
|
-
static final int HEI = 16; // height
|
746
|
-
static final int HI = HEI | INC;
|
747
|
-
static final int HD = HEI | DEC;
|
748
|
-
static final int SPL = 32 | CNT; // split
|
749
|
-
static final int SIW = SPL | INC | WID;
|
750
|
-
static final int SDW = SPL | DEC | WID;
|
751
|
-
static final int SIH = SPL | INC | HEI;
|
752
|
-
static final int SDH = SPL | DEC | HEI;
|
753
|
-
static final int BUR = 64 | CNT; // burst
|
754
|
-
static final int BURI = BUR | INC;
|
755
|
-
static final int BURD = BUR | DEC;
|
756
|
-
static final int NF = 128; // no fill
|
757
|
-
private Color c1, c2;
|
758
|
-
private int beginning, ending;
|
759
|
-
private float incr, index;
|
760
|
-
private Vector rect = new Vector();
|
761
|
-
private Vector grad = new Vector();
|
762
|
-
private int type;
|
763
|
-
|
764
|
-
|
765
|
-
public GpE(int type, Color c1, Color c2, int beg, int end) {
|
766
|
-
this.type = type;
|
767
|
-
this.c1 = c1;
|
768
|
-
this.c2 = c2;
|
769
|
-
this.beginning = beg;
|
770
|
-
this.ending = end;
|
771
|
-
}
|
772
|
-
|
773
|
-
|
774
|
-
public void reset(int w, int h) {
|
775
|
-
incr = 1.0f / (ending - beginning);
|
776
|
-
if ((type & CNT) != 0) {
|
777
|
-
incr /= 2.3f;
|
778
|
-
}
|
779
|
-
if ((type & CNT) != 0 && (type & INC) != 0) {
|
780
|
-
index = 0.5f;
|
781
|
-
} else if ((type & DEC) != 0) {
|
782
|
-
index = 1.0f;
|
783
|
-
incr = -incr;
|
784
|
-
} else {
|
785
|
-
index = 0.0f;
|
786
|
-
}
|
787
|
-
index += incr;
|
788
|
-
}
|
789
|
-
|
790
|
-
|
791
|
-
public void step(int w, int h) {
|
792
|
-
rect.clear();
|
793
|
-
grad.clear();
|
794
|
-
|
795
|
-
if ((type & WID) != 0) {
|
796
|
-
float w2 = 0, x1 = 0, x2 = 0;
|
797
|
-
if ((type & SPL) != 0) {
|
798
|
-
w2 = w * 0.5f;
|
799
|
-
x1 = w * (1.0f - index);
|
800
|
-
x2 = w * index;
|
801
|
-
} else {
|
802
|
-
w2 = w * index;
|
803
|
-
x1 = x2 = w2;
|
804
|
-
}
|
805
|
-
rect.addElement(new Rectangle2D.Float(0, 0, w2, h));
|
806
|
-
rect.addElement(new Rectangle2D.Float(w2, 0, w-w2, h));
|
807
|
-
grad.addElement(new GradientPaint(0,0,c1,x1,0,c2));
|
808
|
-
grad.addElement(new GradientPaint(x2,0,c2,w,0,c1));
|
809
|
-
} else if ((type & HEI) != 0) {
|
810
|
-
float h2 = 0, y1 = 0, y2 = 0;
|
811
|
-
if ((type & SPL) != 0) {
|
812
|
-
h2 = h * 0.5f;
|
813
|
-
y1 = h * (1.0f - index);
|
814
|
-
y2 = h * index;
|
815
|
-
} else {
|
816
|
-
h2 = h * index;
|
817
|
-
y1 = y2 = h2;
|
818
|
-
}
|
819
|
-
rect.addElement(new Rectangle2D.Float(0, 0, w, h2));
|
820
|
-
rect.addElement(new Rectangle2D.Float(0, h2, w, h-h2));
|
821
|
-
grad.addElement(new GradientPaint(0,0,c1,0,y1,c2));
|
822
|
-
grad.addElement(new GradientPaint(0,y2,c2,0,h,c1));
|
823
|
-
} else if ((type & BUR) != 0) {
|
824
|
-
|
825
|
-
float w2 = w/2;
|
826
|
-
float h2 = h/2;
|
827
|
-
|
828
|
-
rect.addElement(new Rectangle2D.Float(0, 0, w2, h2));
|
829
|
-
rect.addElement(new Rectangle2D.Float(w2, 0, w2, h2));
|
830
|
-
rect.addElement(new Rectangle2D.Float(0, h2, w2, h2));
|
831
|
-
rect.addElement(new Rectangle2D.Float(w2, h2, w2, h2));
|
832
|
-
|
833
|
-
float x1 = w * (1.0f - index);
|
834
|
-
float x2 = w * index;
|
835
|
-
float y1 = h * (1.0f - index);
|
836
|
-
float y2 = h * index;
|
837
|
-
|
838
|
-
grad.addElement(new GradientPaint(0,0,c1,x1,y1,c2));
|
839
|
-
grad.addElement(new GradientPaint(w,0,c1,x2,y1,c2));
|
840
|
-
grad.addElement(new GradientPaint(0,h,c1,x1,y2,c2));
|
841
|
-
grad.addElement(new GradientPaint(w,h,c1,x2,y2,c2));
|
842
|
-
} else if ((type & NF) != 0) {
|
843
|
-
float x = w * index;
|
844
|
-
float y = h * index;
|
845
|
-
grad.addElement(new GradientPaint(0,0,c1,0,y,c2));
|
846
|
-
}
|
847
|
-
|
848
|
-
if ((type & INC) != 0 || (type & DEC) != 0) {
|
849
|
-
index += incr;
|
850
|
-
}
|
851
|
-
}
|
852
|
-
|
853
|
-
|
854
|
-
public void render(int w, int h, Graphics2D g2) {
|
855
|
-
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
|
856
|
-
RenderingHints.VALUE_ANTIALIAS_OFF);
|
857
|
-
for (int i = 0; i < grad.size(); i++) {
|
858
|
-
g2.setPaint((GradientPaint) grad.get(i));
|
859
|
-
if ((type & NF) == 0) {
|
860
|
-
g2.fill((Rectangle2D) rect.get(i));
|
861
|
-
}
|
862
|
-
}
|
863
|
-
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
|
864
|
-
RenderingHints.VALUE_ANTIALIAS_ON);
|
865
|
-
}
|
866
|
-
|
867
|
-
public int getBegin() {
|
868
|
-
return beginning;
|
869
|
-
}
|
870
|
-
|
871
|
-
public int getEnd() {
|
872
|
-
return ending;
|
873
|
-
}
|
874
|
-
} // End GpE class
|
875
|
-
|
876
|
-
|
877
|
-
|
878
|
-
/**
|
879
|
-
* TexturePaint Effect. Expand and collapse a texture.
|
880
|
-
*/
|
881
|
-
static class TpE implements Part {
|
882
|
-
|
883
|
-
static final int INC = 1; // increasing
|
884
|
-
static final int DEC = 2; // decreasing
|
885
|
-
static final int OVAL = 4; // oval
|
886
|
-
static final int RECT = 8; // rectangle
|
887
|
-
static final int HAF = 16; // half oval or rect size
|
888
|
-
static final int OI = OVAL | INC;
|
889
|
-
static final int OD = OVAL | DEC;
|
890
|
-
static final int RI = RECT | INC;
|
891
|
-
static final int RD = RECT | DEC;
|
892
|
-
static final int NF = 32; // no fill
|
893
|
-
private Paint p1, p2;
|
894
|
-
private int beginning, ending;
|
895
|
-
private float incr, index;
|
896
|
-
private TexturePaint texture;
|
897
|
-
private int type;
|
898
|
-
private int size;
|
899
|
-
private BufferedImage bimg;
|
900
|
-
private Rectangle rect;
|
901
|
-
|
902
|
-
|
903
|
-
public TpE(int type, Paint p1, Paint p2, int size,
|
904
|
-
int beg, int end) {
|
905
|
-
this.type = type;
|
906
|
-
this.p1 = p1;
|
907
|
-
this.p2 = p2;
|
908
|
-
this.beginning = beg;
|
909
|
-
this.ending = end;
|
910
|
-
setTextureSize(size);
|
911
|
-
}
|
912
|
-
|
913
|
-
|
914
|
-
public void setTextureSize(int size) {
|
915
|
-
this.size = size;
|
916
|
-
bimg = new BufferedImage(size,size,BufferedImage.TYPE_INT_RGB);
|
917
|
-
rect = new Rectangle(0,0,size,size);
|
918
|
-
}
|
919
|
-
|
920
|
-
|
921
|
-
public void reset(int w, int h) {
|
922
|
-
incr = (float) (size) / (float) (ending - beginning);
|
923
|
-
if ((type & HAF) != 0) {
|
924
|
-
incr /= 2;
|
925
|
-
}
|
926
|
-
if ((type & DEC) != 0) {
|
927
|
-
index = size;
|
928
|
-
if ((type & HAF) != 0) {
|
929
|
-
index /= 2;
|
930
|
-
}
|
931
|
-
incr = -incr;
|
932
|
-
} else {
|
933
|
-
index = 0.0f;
|
934
|
-
}
|
935
|
-
index += incr;
|
936
|
-
}
|
937
|
-
|
938
|
-
|
939
|
-
public void step(int w, int h) {
|
940
|
-
Graphics2D g2 = bimg.createGraphics();
|
941
|
-
g2.setPaint(p1);
|
942
|
-
g2.fillRect(0,0,size,size);
|
943
|
-
g2.setPaint(p2);
|
944
|
-
if ((type & OVAL) != 0) {
|
945
|
-
g2.fill(new Ellipse2D.Float(0,0,index,index));
|
946
|
-
} else if ((type & RECT) != 0) {
|
947
|
-
g2.fill(new Rectangle2D.Float(0,0,index,index));
|
948
|
-
}
|
949
|
-
texture = new TexturePaint(bimg, rect);
|
950
|
-
g2.dispose();
|
951
|
-
index += incr;
|
952
|
-
}
|
953
|
-
|
954
|
-
|
955
|
-
public void render(int w, int h, Graphics2D g2) {
|
956
|
-
g2.setPaint(texture);
|
957
|
-
if ((type & NF) == 0) {
|
958
|
-
g2.fillRect(0, 0, w, h);
|
959
|
-
}
|
960
|
-
}
|
961
|
-
|
962
|
-
public int getBegin() {
|
963
|
-
return beginning;
|
964
|
-
}
|
965
|
-
|
966
|
-
public int getEnd() {
|
967
|
-
return ending;
|
968
|
-
}
|
969
|
-
} // End TpE class
|
970
|
-
|
971
|
-
|
972
|
-
|
973
|
-
/**
|
974
|
-
* Close out effect. Close out the buffered image with different
|
975
|
-
* geometry shapes.
|
976
|
-
*/
|
977
|
-
static class CoE implements Part {
|
978
|
-
|
979
|
-
static final int WID = 1;
|
980
|
-
static final int HEI = 2;
|
981
|
-
static final int OVAL = 4;
|
982
|
-
static final int RECT = 8;
|
983
|
-
static final int RAND = 16;
|
984
|
-
static final int ARC = 32;
|
985
|
-
private int type;
|
986
|
-
private int beginning, ending;
|
987
|
-
private BufferedImage bimg;
|
988
|
-
private Shape shape;
|
989
|
-
private double zoom, extent;
|
990
|
-
private double zIncr, eIncr;
|
991
|
-
private boolean doRandom;
|
992
|
-
|
993
|
-
|
994
|
-
public CoE(int type, int beg, int end) {
|
995
|
-
this.type = type;
|
996
|
-
this.beginning = beg;
|
997
|
-
this.ending = end;
|
998
|
-
zIncr = -(2.0 / (ending - beginning));
|
999
|
-
eIncr = 360.0 / (ending - beginning);
|
1000
|
-
doRandom = (type & RAND) != 0;
|
1001
|
-
}
|
1002
|
-
|
1003
|
-
|
1004
|
-
public void reset(int w, int h) {
|
1005
|
-
if (doRandom) {
|
1006
|
-
int num = (int) (Math.random() * 5.0);
|
1007
|
-
switch (num) {
|
1008
|
-
case 0 : type = OVAL; break;
|
1009
|
-
case 1 : type = RECT; break;
|
1010
|
-
case 2 : type = RECT | WID; break;
|
1011
|
-
case 3 : type = RECT | HEI; break;
|
1012
|
-
case 4 : type = ARC; break;
|
1013
|
-
default : type = OVAL;
|
1014
|
-
}
|
1015
|
-
}
|
1016
|
-
shape = null;
|
1017
|
-
bimg = null;
|
1018
|
-
extent = 360.0;
|
1019
|
-
zoom = 2.0;
|
1020
|
-
}
|
1021
|
-
|
1022
|
-
|
1023
|
-
public void step(int w, int h) {
|
1024
|
-
if (bimg == null) {
|
1025
|
-
int biw = Surface.bimg.getWidth();
|
1026
|
-
int bih = Surface.bimg.getHeight();
|
1027
|
-
bimg = new BufferedImage(biw, bih, BufferedImage.TYPE_INT_RGB);
|
1028
|
-
Graphics2D big = bimg.createGraphics();
|
1029
|
-
big.drawImage(Surface.bimg, 0, 0, null);
|
1030
|
-
}
|
1031
|
-
double z = Math.min(w, h) * zoom;
|
1032
|
-
if ((type & OVAL) != 0) {
|
1033
|
-
shape = new Ellipse2D.Double(w/2-z/2,h/2-z/2,z,z);
|
1034
|
-
} else if ((type & ARC) != 0) {
|
1035
|
-
shape = new Arc2D.Double(-100,-100,w+200,h+200,90,extent,Arc2D.PIE);
|
1036
|
-
extent -= eIncr;
|
1037
|
-
} else if ((type & RECT) != 0) {
|
1038
|
-
if ((type & WID) != 0) {
|
1039
|
-
shape = new Rectangle2D.Double(w/2-z/2,0,z,h);
|
1040
|
-
} else if ((type & HEI) != 0) {
|
1041
|
-
shape = new Rectangle2D.Double(0,h/2-z/2,w,z);
|
1042
|
-
} else {
|
1043
|
-
shape = new Rectangle2D.Double(w/2-z/2,h/2-z/2,z,z);
|
1044
|
-
}
|
1045
|
-
}
|
1046
|
-
zoom += zIncr;
|
1047
|
-
}
|
1048
|
-
|
1049
|
-
|
1050
|
-
public void render(int w, int h, Graphics2D g2) {
|
1051
|
-
g2.clip(shape);
|
1052
|
-
g2.drawImage(bimg, 0, 0, null);
|
1053
|
-
}
|
1054
|
-
|
1055
|
-
public int getBegin() {
|
1056
|
-
return beginning;
|
1057
|
-
}
|
1058
|
-
|
1059
|
-
public int getEnd() {
|
1060
|
-
return ending;
|
1061
|
-
}
|
1062
|
-
} // End CoE class
|
1063
|
-
|
1064
|
-
|
1065
|
-
|
1066
|
-
/**
|
1067
|
-
* Dither Dissolve Effect. For each successive step in the animation,
|
1068
|
-
* a pseudo-random starting horizontal position is chosen using list,
|
1069
|
-
* and then the corresponding points created from xlist and ylist are
|
1070
|
-
* blacked out for the current "chunk". The x and y chunk starting
|
1071
|
-
* positions are each incremented by the associated chunk size, and
|
1072
|
-
* this process is repeated for the number of "steps" in the
|
1073
|
-
* animation, causing an equal number of pseudo-randomly picked
|
1074
|
-
* "blocks" to be blacked out during each step of the animation.
|
1075
|
-
*/
|
1076
|
-
static class DdE implements Part {
|
1077
|
-
|
1078
|
-
private int beginning, ending;
|
1079
|
-
private BufferedImage bimg;
|
1080
|
-
private Graphics2D big;
|
1081
|
-
private List list, xlist, ylist;
|
1082
|
-
private int xeNum, yeNum; // element number
|
1083
|
-
private int xcSize, ycSize; // chunk size
|
1084
|
-
private int inc;
|
1085
|
-
private int blocksize;
|
1086
|
-
|
1087
|
-
|
1088
|
-
public DdE(int beg, int end, int blocksize) {
|
1089
|
-
this.beginning = beg;
|
1090
|
-
this.ending = end;
|
1091
|
-
this.blocksize = blocksize;
|
1092
|
-
}
|
1093
|
-
|
1094
|
-
private void createShuffledLists() {
|
1095
|
-
int width = bimg.getWidth();
|
1096
|
-
int height = bimg.getHeight();
|
1097
|
-
Integer xarray[] = new Integer[width];
|
1098
|
-
Integer yarray[] = new Integer[height];
|
1099
|
-
Integer array[] = new Integer[ending - beginning + 1];
|
1100
|
-
for (int i = 0; i < xarray.length; i++) {
|
1101
|
-
xarray[i] = new Integer(i);
|
1102
|
-
}
|
1103
|
-
for (int j = 0; j < yarray.length; j++) {
|
1104
|
-
yarray[j] = new Integer(j);
|
1105
|
-
}
|
1106
|
-
for (int k = 0; k < array.length; k++) {
|
1107
|
-
array[k] = new Integer(k);
|
1108
|
-
}
|
1109
|
-
java.util.Collections.shuffle(xlist = Arrays.asList(xarray));
|
1110
|
-
java.util.Collections.shuffle(ylist = Arrays.asList(yarray));
|
1111
|
-
java.util.Collections.shuffle(list = Arrays.asList(array));
|
1112
|
-
}
|
1113
|
-
|
1114
|
-
public void reset(int w, int h) {
|
1115
|
-
bimg = null;
|
1116
|
-
}
|
1117
|
-
|
1118
|
-
public void step(int w, int h) {
|
1119
|
-
if (bimg == null) {
|
1120
|
-
int biw = Surface.bimg.getWidth();
|
1121
|
-
int bih = Surface.bimg.getHeight();
|
1122
|
-
bimg = new BufferedImage(biw, bih, BufferedImage.TYPE_INT_RGB);
|
1123
|
-
createShuffledLists();
|
1124
|
-
big = bimg.createGraphics();
|
1125
|
-
big.drawImage(Surface.bimg, 0, 0, null);
|
1126
|
-
xcSize = (xlist.size() / (ending - beginning)) + 1;
|
1127
|
-
ycSize = (ylist.size() / (ending - beginning)) + 1;
|
1128
|
-
xeNum = 0;
|
1129
|
-
inc = 0;
|
1130
|
-
}
|
1131
|
-
xeNum = xcSize * ((Integer)list.get(inc)).intValue();
|
1132
|
-
yeNum = -ycSize;
|
1133
|
-
inc++;
|
1134
|
-
}
|
1135
|
-
|
1136
|
-
|
1137
|
-
public void render(int w, int h, Graphics2D g2) {
|
1138
|
-
big.setColor(black);
|
1139
|
-
|
1140
|
-
for (int k = 0; k <= (ending - beginning); k++) {
|
1141
|
-
if ((xeNum + xcSize) > xlist.size()) {
|
1142
|
-
xeNum = 0;
|
1143
|
-
} else {
|
1144
|
-
xeNum += xcSize;
|
1145
|
-
}
|
1146
|
-
yeNum += ycSize;
|
1147
|
-
|
1148
|
-
for (int i = xeNum; i < xeNum+xcSize && i < xlist.size(); i++) {
|
1149
|
-
for (int j = yeNum; j < yeNum+ycSize && j < ylist.size(); j++) {
|
1150
|
-
int xval = ((Integer)xlist.get(i)).intValue();
|
1151
|
-
int yval = ((Integer)ylist.get(j)).intValue();
|
1152
|
-
if (((xval % blocksize) == 0) &&
|
1153
|
-
((yval % blocksize) == 0)) {
|
1154
|
-
big.fillRect(xval, yval, blocksize, blocksize);
|
1155
|
-
}
|
1156
|
-
}
|
1157
|
-
}
|
1158
|
-
}
|
1159
|
-
|
1160
|
-
g2.drawImage(bimg, 0, 0, null);
|
1161
|
-
}
|
1162
|
-
|
1163
|
-
public int getBegin() {
|
1164
|
-
return beginning;
|
1165
|
-
}
|
1166
|
-
|
1167
|
-
public int getEnd() {
|
1168
|
-
return ending;
|
1169
|
-
}
|
1170
|
-
} // End DdE class
|
1171
|
-
|
1172
|
-
|
1173
|
-
/**
|
1174
|
-
* Subimage effect. Subimage the scene's buffered
|
1175
|
-
* image then rotate and scale down the subimages.
|
1176
|
-
*/
|
1177
|
-
static class SiE implements Part {
|
1178
|
-
|
1179
|
-
private int beginning, ending;
|
1180
|
-
private BufferedImage bimg;
|
1181
|
-
private double rIncr, sIncr;
|
1182
|
-
private double scale, rotate;
|
1183
|
-
private int siw, sih;
|
1184
|
-
private Vector subs = new Vector(20);
|
1185
|
-
private Vector pts = new Vector(20);
|
1186
|
-
|
1187
|
-
|
1188
|
-
public SiE(int siw, int sih, int beg, int end) {
|
1189
|
-
this.siw = siw;
|
1190
|
-
this.sih = sih;
|
1191
|
-
this.beginning = beg;
|
1192
|
-
this.ending = end;
|
1193
|
-
rIncr = 360.0 / (ending - beginning);
|
1194
|
-
sIncr = 1.0 / (ending - beginning);
|
1195
|
-
}
|
1196
|
-
|
1197
|
-
|
1198
|
-
public void reset(int w, int h) {
|
1199
|
-
scale = 1.0;
|
1200
|
-
rotate = 0.0;
|
1201
|
-
bimg = null;
|
1202
|
-
subs.clear();
|
1203
|
-
pts.clear();
|
1204
|
-
}
|
1205
|
-
|
1206
|
-
|
1207
|
-
public void step(int w, int h) {
|
1208
|
-
if (bimg == null) {
|
1209
|
-
int biw = Surface.bimg.getWidth();
|
1210
|
-
int bih = Surface.bimg.getHeight();
|
1211
|
-
bimg = new BufferedImage(biw, bih, BufferedImage.TYPE_INT_RGB);
|
1212
|
-
Graphics2D big = bimg.createGraphics();
|
1213
|
-
big.drawImage(Surface.bimg, 0, 0, null);
|
1214
|
-
for (int x = 0; x < w && scale > 0.0; x+=siw) {
|
1215
|
-
int ww = x+siw < w ? siw : w-x;
|
1216
|
-
for (int y = 0; y < h; y+=sih) {
|
1217
|
-
int hh = y+sih < h ? sih : h-y;
|
1218
|
-
subs.addElement(bimg.getSubimage(x,y,ww,hh));
|
1219
|
-
pts.addElement(new Point(x, y));
|
1220
|
-
}
|
1221
|
-
}
|
1222
|
-
}
|
1223
|
-
|
1224
|
-
rotate += rIncr;
|
1225
|
-
scale -= sIncr;
|
1226
|
-
}
|
1227
|
-
|
1228
|
-
|
1229
|
-
public void render(int w, int h, Graphics2D g2) {
|
1230
|
-
AffineTransform saveTx = g2.getTransform();
|
1231
|
-
g2.setColor(blue);
|
1232
|
-
for (int i = 0; i < subs.size() && scale > 0.0; i++) {
|
1233
|
-
BufferedImage bi = (BufferedImage) subs.get(i);
|
1234
|
-
Point p = (Point) pts.get(i);
|
1235
|
-
int ww = bi.getWidth();
|
1236
|
-
int hh = bi.getHeight();
|
1237
|
-
AffineTransform at = new AffineTransform();
|
1238
|
-
at.rotate(Math.toRadians(rotate), p.x+ww/2, p.y+hh/2);
|
1239
|
-
at.translate(p.x, p.y);
|
1240
|
-
at.scale(scale, scale);
|
1241
|
-
|
1242
|
-
Rectangle b1 = new Rectangle(0, 0, ww, hh);
|
1243
|
-
Shape shape = at.createTransformedShape(b1);
|
1244
|
-
Rectangle2D b2 = shape.getBounds2D();
|
1245
|
-
double xx = (p.x+ww/2) - (b2.getX()+b2.getWidth()/2);
|
1246
|
-
double yy = (p.y+hh/2) - (b2.getY()+b2.getHeight()/2);
|
1247
|
-
AffineTransform toCenterAT = new AffineTransform();
|
1248
|
-
toCenterAT.translate(xx, yy);
|
1249
|
-
toCenterAT.concatenate(at);
|
1250
|
-
|
1251
|
-
g2.setTransform(toCenterAT);
|
1252
|
-
g2.drawImage(bi, 0, 0, null);
|
1253
|
-
g2.draw(b1);
|
1254
|
-
}
|
1255
|
-
g2.setTransform(saveTx);
|
1256
|
-
}
|
1257
|
-
|
1258
|
-
public int getBegin() {
|
1259
|
-
return beginning;
|
1260
|
-
}
|
1261
|
-
|
1262
|
-
public int getEnd() {
|
1263
|
-
return ending;
|
1264
|
-
}
|
1265
|
-
} // End SiE class
|
1266
|
-
|
1267
|
-
|
1268
|
-
|
1269
|
-
|
1270
|
-
/**
|
1271
|
-
* Line Effect. Flattened ellipse with lines from the center
|
1272
|
-
* to the edge. Expand or collapse the ellipse. Fade in or out
|
1273
|
-
* the lines.
|
1274
|
-
*/
|
1275
|
-
static class LnE implements Part {
|
1276
|
-
|
1277
|
-
static final int INC = 1;
|
1278
|
-
static final int DEC = 2;
|
1279
|
-
static final int R = 4; // rotate
|
1280
|
-
static final int RI = R | INC;
|
1281
|
-
static final int RD = R | DEC;
|
1282
|
-
static final int ZOOM = 8; // zoom
|
1283
|
-
static final int ZOOMI = ZOOM | INC;
|
1284
|
-
static final int ZOOMD = ZOOM | DEC;
|
1285
|
-
static final int AC = 32; // AlphaComposite
|
1286
|
-
static final int ACI = 32 | INC;
|
1287
|
-
static final int ACD = 32 | DEC;
|
1288
|
-
private int beginning, ending;
|
1289
|
-
private double rIncr, rotate;
|
1290
|
-
private double zIncr, zoom;
|
1291
|
-
private Vector pts = new Vector();
|
1292
|
-
private float alpha, aIncr;
|
1293
|
-
private int type;
|
1294
|
-
|
1295
|
-
|
1296
|
-
public LnE(int type, int beg, int end) {
|
1297
|
-
this.type = type;
|
1298
|
-
this.beginning = beg;
|
1299
|
-
this.ending = end;
|
1300
|
-
rIncr = 360.0 / (ending - beginning);
|
1301
|
-
aIncr = 0.9f / (ending - beginning);
|
1302
|
-
zIncr = 2.0 / (ending - beginning);
|
1303
|
-
if ((type & DEC) != 0) {
|
1304
|
-
rIncr = -rIncr;
|
1305
|
-
aIncr = -aIncr;
|
1306
|
-
zIncr = -zIncr;
|
1307
|
-
}
|
1308
|
-
}
|
1309
|
-
|
1310
|
-
|
1311
|
-
public void generatePts(int w, int h, double sizeF) {
|
1312
|
-
pts.clear();
|
1313
|
-
double size = Math.min(w, h) * sizeF;
|
1314
|
-
Ellipse2D ellipse = new Ellipse2D.Double(w/2-size/2,h/2-size/2,size,size);
|
1315
|
-
PathIterator pi = ellipse.getPathIterator(null, 0.8);
|
1316
|
-
while ( !pi.isDone() ) {
|
1317
|
-
double[] pt = new double[6];
|
1318
|
-
switch ( pi.currentSegment(pt) ) {
|
1319
|
-
case FlatteningPathIterator.SEG_MOVETO:
|
1320
|
-
case FlatteningPathIterator.SEG_LINETO:
|
1321
|
-
pts.addElement(new Point2D.Double(pt[0], pt[1]));
|
1322
|
-
}
|
1323
|
-
pi.next();
|
1324
|
-
}
|
1325
|
-
}
|
1326
|
-
|
1327
|
-
|
1328
|
-
public void reset(int w, int h) {
|
1329
|
-
if ((type & DEC) != 0) {
|
1330
|
-
rotate = 360;
|
1331
|
-
alpha = 1.0f;
|
1332
|
-
zoom = 2.0;
|
1333
|
-
} else {
|
1334
|
-
rotate = alpha = 0;
|
1335
|
-
zoom = 0;
|
1336
|
-
}
|
1337
|
-
if ((type & ZOOM) == 0) {
|
1338
|
-
generatePts(w, h, 0.5);
|
1339
|
-
}
|
1340
|
-
}
|
1341
|
-
|
1342
|
-
|
1343
|
-
public void step(int w, int h) {
|
1344
|
-
if ((type & ZOOM) != 0) {
|
1345
|
-
generatePts(w, h, zoom += zIncr);
|
1346
|
-
}
|
1347
|
-
if ((type & RI) != 0 || (type & RI) != 0) {
|
1348
|
-
rotate += rIncr;
|
1349
|
-
}
|
1350
|
-
if ((type & ACI) != 0 || (type & ACD) != 0) {
|
1351
|
-
alpha += aIncr;
|
1352
|
-
}
|
1353
|
-
}
|
1354
|
-
|
1355
|
-
|
1356
|
-
public void render(int w, int h, Graphics2D g2) {
|
1357
|
-
Composite saveAC = null;
|
1358
|
-
if ((type & AC) != 0 && alpha >= 0 && alpha <= 1) {
|
1359
|
-
saveAC = g2.getComposite();
|
1360
|
-
g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alpha));
|
1361
|
-
}
|
1362
|
-
AffineTransform saveTx = null;
|
1363
|
-
if ((type & R) != 0) {
|
1364
|
-
saveTx = g2.getTransform();
|
1365
|
-
AffineTransform at = new AffineTransform();
|
1366
|
-
at.rotate(Math.toRadians(rotate), w/2, h/2);
|
1367
|
-
g2.setTransform(at);
|
1368
|
-
}
|
1369
|
-
Point2D p1 = new Point2D.Double(w/2, h/2);
|
1370
|
-
g2.setColor(Color.yellow);
|
1371
|
-
for (int i = 0; i < pts.size()-1; i++) {
|
1372
|
-
g2.draw(new Line2D.Float(p1, (Point2D) pts.get(i)));
|
1373
|
-
}
|
1374
|
-
if (saveTx != null) {
|
1375
|
-
g2.setTransform(saveTx);
|
1376
|
-
}
|
1377
|
-
if (saveAC != null) {
|
1378
|
-
g2.setComposite(saveAC);
|
1379
|
-
}
|
1380
|
-
}
|
1381
|
-
|
1382
|
-
public int getBegin() {
|
1383
|
-
return beginning;
|
1384
|
-
}
|
1385
|
-
|
1386
|
-
public int getEnd() {
|
1387
|
-
return ending;
|
1388
|
-
}
|
1389
|
-
} // End LnE class
|
1390
|
-
|
1391
|
-
|
1392
|
-
|
1393
|
-
/**
|
1394
|
-
* Template for Features & Contributors consisting of translating
|
1395
|
-
* blue and red rectangles and an image going from transparent to
|
1396
|
-
* opaque.
|
1397
|
-
*/
|
1398
|
-
static class Temp implements Part {
|
1399
|
-
static final int NOANIM = 1;
|
1400
|
-
static final int RECT = 2;
|
1401
|
-
static final int RNA = RECT | NOANIM;
|
1402
|
-
static final int IMG = 4;
|
1403
|
-
static final int INA = IMG | NOANIM;
|
1404
|
-
private int beginning, ending;
|
1405
|
-
private float alpha, aIncr;
|
1406
|
-
private int type;
|
1407
|
-
private Rectangle rect1, rect2;
|
1408
|
-
private int x, y, xIncr, yIncr;
|
1409
|
-
private Image img;
|
1410
|
-
|
1411
|
-
|
1412
|
-
public Temp(int type, Image img, int beg, int end) {
|
1413
|
-
this.type = type;
|
1414
|
-
this.img = img;
|
1415
|
-
this.beginning = beg;
|
1416
|
-
this.ending = end;
|
1417
|
-
aIncr = 0.9f / (ending - beginning);
|
1418
|
-
if ((type & NOANIM) != 0) {
|
1419
|
-
alpha = 1.0f;
|
1420
|
-
}
|
1421
|
-
}
|
1422
|
-
|
1423
|
-
|
1424
|
-
|
1425
|
-
public void reset(int w, int h) {
|
1426
|
-
rect1 = new Rectangle(8, 20, w-20, 30);
|
1427
|
-
rect2 = new Rectangle(20, 8, 30, h-20);
|
1428
|
-
if ((type & NOANIM) == 0) {
|
1429
|
-
alpha = 0.0f;
|
1430
|
-
xIncr = w / (ending - beginning);
|
1431
|
-
yIncr = h / (ending - beginning);
|
1432
|
-
x = w+(int)(xIncr*1.4);
|
1433
|
-
y = h+(int)(yIncr*1.4);
|
1434
|
-
}
|
1435
|
-
}
|
1436
|
-
|
1437
|
-
|
1438
|
-
public void step(int w, int h) {
|
1439
|
-
if ((type & NOANIM) != 0) {
|
1440
|
-
return;
|
1441
|
-
}
|
1442
|
-
if ((type & RECT) != 0) {
|
1443
|
-
rect1.setLocation(x-=xIncr, 20);
|
1444
|
-
rect2.setLocation(20, y-=yIncr);
|
1445
|
-
}
|
1446
|
-
if ((type & IMG) != 0) {
|
1447
|
-
alpha += aIncr;
|
1448
|
-
}
|
1449
|
-
}
|
1450
|
-
|
1451
|
-
|
1452
|
-
public void render(int w, int h, Graphics2D g2) {
|
1453
|
-
if ((type & RECT) != 0) {
|
1454
|
-
g2.setColor(blue);
|
1455
|
-
g2.fill(rect1);
|
1456
|
-
g2.setColor(red);
|
1457
|
-
g2.fill(rect2);
|
1458
|
-
}
|
1459
|
-
if ((type & IMG) != 0) {
|
1460
|
-
Composite saveAC = g2.getComposite();
|
1461
|
-
if (alpha >= 0 && alpha <= 1) {
|
1462
|
-
g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alpha));
|
1463
|
-
}
|
1464
|
-
g2.drawImage(img, 30, 30, null);
|
1465
|
-
g2.setComposite(saveAC);
|
1466
|
-
}
|
1467
|
-
}
|
1468
|
-
|
1469
|
-
public int getBegin() {
|
1470
|
-
return beginning;
|
1471
|
-
}
|
1472
|
-
|
1473
|
-
public int getEnd() {
|
1474
|
-
return ending;
|
1475
|
-
}
|
1476
|
-
} // End Temp class
|
1477
|
-
|
1478
|
-
|
1479
|
-
|
1480
|
-
/**
|
1481
|
-
* Features of Java2D. Single character advancement effect.
|
1482
|
-
*/
|
1483
|
-
static class Features implements Part {
|
1484
|
-
|
1485
|
-
static final int GRAPHICS = 0;
|
1486
|
-
static final int TEXT = 1;
|
1487
|
-
static final int IMAGES = 2;
|
1488
|
-
static final int COLOR = 3;
|
1489
|
-
static Font font1 = new Font("serif", Font.BOLD, 38);
|
1490
|
-
static Font font2 = new Font("serif", Font.PLAIN, 24);
|
1491
|
-
static FontMetrics fm1 = Surface.getMetrics(font1);
|
1492
|
-
static FontMetrics fm2 = Surface.getMetrics(font2);
|
1493
|
-
static String table[][] =
|
1494
|
-
{{ "Graphics", "Antialiased rendering", "Bezier paths",
|
1495
|
-
"Transforms", "Compositing", "Stroking parameters" },
|
1496
|
-
{ "Text", "Extended font support",
|
1497
|
-
"Advanced text layout", "Dynamic font loading",
|
1498
|
-
"AttributeSets for font customization" },
|
1499
|
-
{ "Images", "Flexible image layouts",
|
1500
|
-
"Extended imaging operations",
|
1501
|
-
" Convolutions, Lookup Tables",
|
1502
|
-
"RenderableImage interface"},
|
1503
|
-
{ "Color", "ICC profile support", "Color conversion",
|
1504
|
-
"Arbitrary color spaces"} };
|
1505
|
-
private String list[];
|
1506
|
-
private int beginning, ending;
|
1507
|
-
private int strH;
|
1508
|
-
private int endIndex, listIndex;
|
1509
|
-
private Vector v = new Vector();
|
1510
|
-
|
1511
|
-
|
1512
|
-
public Features(int type, int beg, int end) {
|
1513
|
-
list = table[type];
|
1514
|
-
this.beginning = beg;
|
1515
|
-
this.ending = end;
|
1516
|
-
}
|
1517
|
-
|
1518
|
-
|
1519
|
-
public void reset(int w, int h) {
|
1520
|
-
strH = (int) (fm2.getAscent()+fm2.getDescent());
|
1521
|
-
endIndex = 1;
|
1522
|
-
listIndex = 0;
|
1523
|
-
v.clear();
|
1524
|
-
v.addElement(list[listIndex].substring(0,endIndex));
|
1525
|
-
}
|
1526
|
-
|
1527
|
-
|
1528
|
-
public void step(int w, int h) {
|
1529
|
-
if (listIndex < list.length) {
|
1530
|
-
if (++endIndex > list[listIndex].length()) {
|
1531
|
-
if (++listIndex < list.length) {
|
1532
|
-
endIndex = 1;
|
1533
|
-
v.addElement(list[listIndex].substring(0,endIndex));
|
1534
|
-
}
|
1535
|
-
} else {
|
1536
|
-
v.set(listIndex, list[listIndex].substring(0,endIndex));
|
1537
|
-
}
|
1538
|
-
}
|
1539
|
-
}
|
1540
|
-
|
1541
|
-
|
1542
|
-
public void render(int w, int h, Graphics2D g2) {
|
1543
|
-
g2.setColor(white);
|
1544
|
-
g2.setFont(font1);
|
1545
|
-
g2.drawString((String) v.get(0), 90, 85);
|
1546
|
-
g2.setFont(font2);
|
1547
|
-
for (int i = 1, y = 90; i < v.size(); i++) {
|
1548
|
-
g2.drawString((String) v.get(i), 120, y += strH);
|
1549
|
-
}
|
1550
|
-
}
|
1551
|
-
|
1552
|
-
public int getBegin() {
|
1553
|
-
return beginning;
|
1554
|
-
}
|
1555
|
-
|
1556
|
-
public int getEnd() {
|
1557
|
-
return ending;
|
1558
|
-
}
|
1559
|
-
} // End Features class
|
1560
|
-
|
1561
|
-
|
1562
|
-
|
1563
|
-
/**
|
1564
|
-
* Scrolling text of Java2D contributors.
|
1565
|
-
*/
|
1566
|
-
static class Contributors implements Part {
|
1567
|
-
|
1568
|
-
static String members[] =
|
1569
|
-
{
|
1570
|
-
"Brian Lichtenwalter", "Jeannette Hung",
|
1571
|
-
"Thanh Nguyen", "Jim Graham", "Jerry Evans",
|
1572
|
-
"John Raley", "Michael Peirce", "Robert Kim",
|
1573
|
-
"Jennifer Ball", "Deborah Adair", "Paul Charlton",
|
1574
|
-
"Dmitry Feld", "Gregory Stone", "Richard Blanchard",
|
1575
|
-
"Link Perry", "Phil Race", "Vincent Hardy",
|
1576
|
-
"Parry Kejriwal", "Doug Felt", "Rekha Rangarajan",
|
1577
|
-
"Paula Patel", "Michael Bundschuh", "Joe Warzecha",
|
1578
|
-
"Joey Beheler", "Aastha Bhardwaj", "Daniel Rice",
|
1579
|
-
"Chris Campbell", "Shinsuke Fukuda", "Dmitri Trembovetski",
|
1580
|
-
"Chet Haase", "Jennifer Godinez", "Nicholas Talian",
|
1581
|
-
"Raul Vera", "Ankit Patel", "Ilya Bagrak"
|
1582
|
-
};
|
1583
|
-
static Font font = new Font("serif", Font.PLAIN, 26);
|
1584
|
-
static FontMetrics fm = Surface.getMetrics(font);
|
1585
|
-
private int beginning, ending;
|
1586
|
-
private int nStrs, strH, index, yh, height;
|
1587
|
-
private Vector v = new Vector();
|
1588
|
-
private Vector cast = new Vector(members.length+3);
|
1589
|
-
private int counter, cntMod;
|
1590
|
-
private GradientPaint gp;
|
1591
|
-
|
1592
|
-
|
1593
|
-
public Contributors(int beg, int end) {
|
1594
|
-
this.beginning = beg;
|
1595
|
-
this.ending = end;
|
1596
|
-
java.util.Arrays.sort(members);
|
1597
|
-
cast.addElement("CONTRIBUTORS");
|
1598
|
-
cast.addElement(" ");
|
1599
|
-
for (int i = 0; i < members.length; i++) {
|
1600
|
-
cast.addElement(members[i]);
|
1601
|
-
}
|
1602
|
-
cast.addElement(" "); cast.addElement(" ");
|
1603
|
-
cntMod = (ending - beginning) / cast.size() - 1;
|
1604
|
-
}
|
1605
|
-
|
1606
|
-
|
1607
|
-
public void reset(int w, int h) {
|
1608
|
-
v.clear();
|
1609
|
-
strH = (int) (fm.getAscent()+fm.getDescent());
|
1610
|
-
nStrs = (h-40)/strH + 1;
|
1611
|
-
height = strH * (nStrs-1) + 48;
|
1612
|
-
index = 0;
|
1613
|
-
gp = new GradientPaint(0,h/2,Color.white,0,h+20,Color.black);
|
1614
|
-
counter = 0;
|
1615
|
-
}
|
1616
|
-
|
1617
|
-
|
1618
|
-
public void step(int w, int h) {
|
1619
|
-
if (counter++%cntMod == 0) {
|
1620
|
-
if (index < cast.size()) {
|
1621
|
-
v.addElement(cast.get(index));
|
1622
|
-
}
|
1623
|
-
if ((v.size() == nStrs || index >= cast.size()) && v.size() != 0) {
|
1624
|
-
v.removeElementAt(0);
|
1625
|
-
}
|
1626
|
-
++index;
|
1627
|
-
}
|
1628
|
-
}
|
1629
|
-
|
1630
|
-
|
1631
|
-
public void render(int w, int h, Graphics2D g2) {
|
1632
|
-
g2.setPaint(gp);
|
1633
|
-
g2.setFont(font);
|
1634
|
-
double remainder = counter%cntMod;
|
1635
|
-
double incr = 1.0-remainder/cntMod;
|
1636
|
-
incr = incr == 1.0 ? 0 : incr;
|
1637
|
-
int y = (int) (incr * strH);
|
1638
|
-
|
1639
|
-
if (index >= cast.size()) {
|
1640
|
-
y = yh + y;
|
1641
|
-
} else {
|
1642
|
-
y = yh = height - v.size() * strH + y;
|
1643
|
-
}
|
1644
|
-
for (int i = 0; i < v.size(); i++) {
|
1645
|
-
String s = (String) v.get(i);
|
1646
|
-
g2.drawString(s, w/2-fm.stringWidth(s)/2, y += strH);
|
1647
|
-
}
|
1648
|
-
}
|
1649
|
-
|
1650
|
-
public int getBegin() {
|
1651
|
-
return beginning;
|
1652
|
-
}
|
1653
|
-
|
1654
|
-
public int getEnd() {
|
1655
|
-
return ending;
|
1656
|
-
}
|
1657
|
-
} // End Contributors class
|
1658
|
-
|
1659
|
-
} // End Surface class
|
1660
|
-
} // End Intro class
|