From c31281108447869f32b6ccb3c9ea86d5437794b4 Mon Sep 17 00:00:00 2001 From: Glen Whitney Date: Tue, 4 Sep 2018 22:51:42 -0400 Subject: [PATCH] Make first real commit: copy of CaRMetal 4.2.8 --- Main.java | 158 + README.md | 16 +- atp/Des10.gif | Bin 0 -> 6762 bytes atp/Des12.gif | Bin 0 -> 6762 bytes atp/Des14.gif | Bin 0 -> 6762 bytes atp/Des18.gif | Bin 0 -> 6762 bytes atp/Des8.gif | Bin 0 -> 6762 bytes atp/Fonts10.gif | Bin 0 -> 5150 bytes atp/Fonts12.gif | Bin 0 -> 7097 bytes atp/Fonts14.gif | Bin 0 -> 8721 bytes atp/Fonts18.gif | Bin 0 -> 12843 bytes atp/Fonts8.gif | Bin 0 -> 3793 bytes atp/a.java | 60 + atp/b.java | 1129 +++ atp/c.java | 43 + atp/d.java | 176 + atp/e.java | 64 + atp/f.java | 134 + atp/sHotEqn.java | 2027 +++++ base3D-es.zir | 139 + base3D-fr-modifs.zir | 101 + base3D-fr.zir | 139 + base3D.zir | 138 + baseDP.zir | 13 + builtin.mcr | 1446 +++ com/apple/eawt/Application.java | 50 + com/apple/eawt/ApplicationAdapter.java | 50 + com/apple/eawt/ApplicationBeanInfo.java | 39 + com/apple/eawt/ApplicationEvent.java | 37 + com/apple/eawt/ApplicationListener.java | 38 + com/apple/eawt/CocoaComponent.java | 56 + .../vectorgraphics2d/DataUtils.java | 103 + .../vectorgraphics2d/EPSGraphics2D.java | 459 + .../vectorgraphics2d/GraphicsUtils.java | 125 + .../vectorgraphics2d/PDFGraphics2D.java | 637 ++ .../vectorgraphics2d/SVGGraphics2D.java | 371 + .../vectorgraphics2d/VectorGraphics2D.java | 957 ++ .../vectorgraphics2d/package-info.java | 25 + default.mcr | 69 + eric/.DS_Store | Bin 0 -> 14340 bytes eric/FileTools.java | 1194 +++ eric/GUI/.DS_Store | Bin 0 -> 6148 bytes eric/GUI/ZDialog/ZButton.java | 55 + eric/GUI/ZDialog/ZCheckBox.java | 70 + eric/GUI/ZDialog/ZDialog.java | 263 + eric/GUI/ZDialog/ZLabel.java | 24 + eric/GUI/ZDialog/ZMessageDialog.java | 30 + eric/GUI/ZDialog/ZSep.java | 45 + eric/GUI/ZDialog/ZTextField.java | 127 + eric/GUI/ZDialog/ZTextFieldAndLabel.java | 132 + eric/GUI/ZDialog/ZTools.java | 39 + eric/GUI/icons/.DS_Store | Bin 0 -> 10244 bytes eric/GUI/icons/bar/aimant.png | Bin 0 -> 863 bytes eric/GUI/icons/bar/aimantON.png | Bin 0 -> 1065 bytes eric/GUI/icons/bar/angle0.png | Bin 0 -> 1120 bytes eric/GUI/icons/bar/angle1.png | Bin 0 -> 1142 bytes eric/GUI/icons/bar/angle2.png | Bin 0 -> 1110 bytes eric/GUI/icons/bar/angle3.png | Bin 0 -> 1124 bytes eric/GUI/icons/bar/bold.png | Bin 0 -> 608 bytes eric/GUI/icons/bar/carbtn.png | Bin 0 -> 700 bytes eric/GUI/icons/bar/carbtn_dis.png | Bin 0 -> 606 bytes eric/GUI/icons/bar/cblack.png | Bin 0 -> 118 bytes eric/GUI/icons/bar/cblue.png | Bin 0 -> 118 bytes eric/GUI/icons/bar/cbrown.png | Bin 0 -> 118 bytes eric/GUI/icons/bar/ccyan.png | Bin 0 -> 118 bytes eric/GUI/icons/bar/cgreen.png | Bin 0 -> 118 bytes eric/GUI/icons/bar/chidden.png | Bin 0 -> 612 bytes eric/GUI/icons/bar/cnormal.png | Bin 0 -> 589 bytes eric/GUI/icons/bar/cod0.png | Bin 0 -> 228 bytes eric/GUI/icons/bar/cod1.png | Bin 0 -> 367 bytes eric/GUI/icons/bar/cod2.png | Bin 0 -> 373 bytes eric/GUI/icons/bar/cod3.png | Bin 0 -> 379 bytes eric/GUI/icons/bar/cod4.png | Bin 0 -> 378 bytes eric/GUI/icons/bar/cod5.png | Bin 0 -> 409 bytes eric/GUI/icons/bar/cod6.png | Bin 0 -> 367 bytes eric/GUI/icons/bar/color0.png | Bin 0 -> 633 bytes eric/GUI/icons/bar/color1.png | Bin 0 -> 658 bytes eric/GUI/icons/bar/color2.png | Bin 0 -> 657 bytes eric/GUI/icons/bar/color3.png | Bin 0 -> 657 bytes eric/GUI/icons/bar/color4.png | Bin 0 -> 657 bytes eric/GUI/icons/bar/color5.png | Bin 0 -> 657 bytes eric/GUI/icons/bar/cred.png | Bin 0 -> 118 bytes eric/GUI/icons/bar/cshowname.png | Bin 0 -> 561 bytes eric/GUI/icons/bar/cshowvalue.png | Bin 0 -> 208 bytes eric/GUI/icons/bar/csolid.png | Bin 0 -> 794 bytes eric/GUI/icons/bar/csuperhidden.png | Bin 0 -> 535 bytes eric/GUI/icons/bar/cthick.png | Bin 0 -> 694 bytes eric/GUI/icons/bar/cthin.png | Bin 0 -> 581 bytes eric/GUI/icons/bar/filled.png | Bin 0 -> 1007 bytes eric/GUI/icons/bar/fnct.png | Bin 0 -> 1269 bytes eric/GUI/icons/bar/hide.png | Bin 0 -> 902 bytes eric/GUI/icons/bar/large.png | Bin 0 -> 655 bytes eric/GUI/icons/bar/obtuse.png | Bin 0 -> 921 bytes eric/GUI/icons/bar/open_left.png | Bin 0 -> 349 bytes eric/GUI/icons/bar/open_right.png | Bin 0 -> 343 bytes eric/GUI/icons/bar/partial.png | Bin 0 -> 1109 bytes eric/GUI/icons/bar/plines.png | Bin 0 -> 975 bytes eric/GUI/icons/bar/showname.png | Bin 0 -> 751 bytes eric/GUI/icons/bar/showvalue.png | Bin 0 -> 1059 bytes eric/GUI/icons/bar/solid.png | Bin 0 -> 1000 bytes eric/GUI/icons/bar/thickness0.png | Bin 0 -> 281 bytes eric/GUI/icons/bar/thickness1.png | Bin 0 -> 349 bytes eric/GUI/icons/bar/thickness2.png | Bin 0 -> 250 bytes eric/GUI/icons/bar/thickness3.png | Bin 0 -> 665 bytes eric/GUI/icons/bar/type0.png | Bin 0 -> 543 bytes eric/GUI/icons/bar/type1.png | Bin 0 -> 581 bytes eric/GUI/icons/bar/type2.png | Bin 0 -> 862 bytes eric/GUI/icons/bar/type3.png | Bin 0 -> 346 bytes eric/GUI/icons/bar/type4.png | Bin 0 -> 758 bytes eric/GUI/icons/bar/type5.png | Bin 0 -> 929 bytes eric/GUI/icons/jswindow/.DS_Store | Bin 0 -> 6148 bytes eric/GUI/icons/jswindow/comment.png | Bin 0 -> 1952 bytes eric/GUI/icons/jswindow/error.png | Bin 0 -> 3516 bytes eric/GUI/icons/jswindow/format.png | Bin 0 -> 1334 bytes eric/GUI/icons/jswindow/french.png | Bin 0 -> 479 bytes eric/GUI/icons/jswindow/french2.png | Bin 0 -> 356 bytes eric/GUI/icons/jswindow/help.png | Bin 0 -> 1578 bytes eric/GUI/icons/jswindow/js.png | Bin 0 -> 791 bytes eric/GUI/icons/jswindow/js2.png | Bin 0 -> 884 bytes eric/GUI/icons/jswindow/restore.png | Bin 0 -> 1721 bytes eric/GUI/icons/jswindow/run.png | Bin 0 -> 4154 bytes eric/GUI/icons/palette/.DS_Store | Bin 0 -> 22532 bytes eric/GUI/icons/palette/Mcancel.png | Bin 0 -> 811 bytes eric/GUI/icons/palette/Mvalid.png | Bin 0 -> 765 bytes eric/GUI/icons/palette/PaletteTriangleBas.png | Bin 0 -> 184 bytes .../icons/palette/PaletteTriangleDroite.png | Bin 0 -> 189 bytes eric/GUI/icons/palette/acolor0.png | Bin 0 -> 520 bytes eric/GUI/icons/palette/acolor1.png | Bin 0 -> 520 bytes eric/GUI/icons/palette/acolor2.png | Bin 0 -> 514 bytes eric/GUI/icons/palette/acolor3.png | Bin 0 -> 521 bytes eric/GUI/icons/palette/acolor4.png | Bin 0 -> 523 bytes eric/GUI/icons/palette/acolor5.png | Bin 0 -> 514 bytes eric/GUI/icons/palette/allback.png | Bin 0 -> 1279 bytes eric/GUI/icons/palette/allforward.png | Bin 0 -> 1262 bytes eric/GUI/icons/palette/angle.png | Bin 0 -> 1704 bytes eric/GUI/icons/palette/angle0.gif | Bin 0 -> 475 bytes eric/GUI/icons/palette/angle1.gif | Bin 0 -> 496 bytes eric/GUI/icons/palette/angle2.gif | Bin 0 -> 502 bytes eric/GUI/icons/palette/angle3.gif | Bin 0 -> 546 bytes eric/GUI/icons/palette/angle3D.png | Bin 0 -> 1704 bytes eric/GUI/icons/palette/animate.png | Bin 0 -> 720 bytes eric/GUI/icons/palette/area.png | Bin 0 -> 1353 bytes eric/GUI/icons/palette/area3D.png | Bin 0 -> 1353 bytes eric/GUI/icons/palette/athickness0.png | Bin 0 -> 345 bytes eric/GUI/icons/palette/athickness1.png | Bin 0 -> 400 bytes eric/GUI/icons/palette/athickness2.png | Bin 0 -> 348 bytes eric/GUI/icons/palette/avancer.png | Bin 0 -> 486 bytes eric/GUI/icons/palette/avancer2.png | Bin 0 -> 739 bytes eric/GUI/icons/palette/avancer3.png | Bin 0 -> 974 bytes eric/GUI/icons/palette/avancer4.png | Bin 0 -> 1067 bytes eric/GUI/icons/palette/back.png | Bin 0 -> 1135 bytes eric/GUI/icons/palette/background.png | Bin 0 -> 2432 bytes eric/GUI/icons/palette/bi_3Darete.png | Bin 0 -> 585 bytes eric/GUI/icons/palette/bi_3Dcircle1.png | Bin 0 -> 2335 bytes eric/GUI/icons/palette/bi_3Dcircle2.png | Bin 0 -> 2222 bytes eric/GUI/icons/palette/bi_3Dcircle3pts.png | Bin 0 -> 2230 bytes eric/GUI/icons/palette/bi_3Dcoords.png | Bin 0 -> 3354 bytes eric/GUI/icons/palette/bi_3Dcube.png | Bin 0 -> 1866 bytes eric/GUI/icons/palette/bi_3Ddode.png | Bin 0 -> 2817 bytes eric/GUI/icons/palette/bi_3Disoc.png | Bin 0 -> 2831 bytes eric/GUI/icons/palette/bi_3Docta.png | Bin 0 -> 2033 bytes eric/GUI/icons/palette/bi_3Dplandroite.png | Bin 0 -> 1562 bytes eric/GUI/icons/palette/bi_3Dplanplan.png | Bin 0 -> 2216 bytes eric/GUI/icons/palette/bi_3Dproj.png | Bin 0 -> 414 bytes eric/GUI/icons/palette/bi_3Dspheredroite.png | Bin 0 -> 2361 bytes eric/GUI/icons/palette/bi_3Dsphereplan.png | Bin 0 -> 2207 bytes eric/GUI/icons/palette/bi_3Dspherepoint.png | Bin 0 -> 2233 bytes eric/GUI/icons/palette/bi_3Dsphererayon.png | Bin 0 -> 2078 bytes eric/GUI/icons/palette/bi_3Dspheresphere.png | Bin 0 -> 1991 bytes eric/GUI/icons/palette/bi_3Dsymc.png | Bin 0 -> 372 bytes eric/GUI/icons/palette/bi_3Dsymp.png | Bin 0 -> 415 bytes eric/GUI/icons/palette/bi_3Dtetra.png | Bin 0 -> 2519 bytes eric/GUI/icons/palette/bi_3Dtrans.png | Bin 0 -> 930 bytes eric/GUI/icons/palette/bi_arc.png | Bin 0 -> 1181 bytes eric/GUI/icons/palette/bi_biss.png | Bin 0 -> 1333 bytes eric/GUI/icons/palette/bi_circ.png | Bin 0 -> 1611 bytes eric/GUI/icons/palette/bi_distance.png | Bin 0 -> 1258 bytes eric/GUI/icons/palette/bi_equidistante.png | Bin 0 -> 1765 bytes eric/GUI/icons/palette/bi_function_u.png | Bin 0 -> 812 bytes eric/GUI/icons/palette/bi_horocycle.png | Bin 0 -> 1727 bytes eric/GUI/icons/palette/bi_lineIP.png | Bin 0 -> 1082 bytes eric/GUI/icons/palette/bi_med.png | Bin 0 -> 1248 bytes eric/GUI/icons/palette/bi_perp_common.png | Bin 0 -> 1458 bytes eric/GUI/icons/palette/bi_pinceau1.png | Bin 0 -> 1212 bytes eric/GUI/icons/palette/bi_pinceau3.png | Bin 0 -> 1090 bytes eric/GUI/icons/palette/bi_pinceaubiss.png | Bin 0 -> 1315 bytes eric/GUI/icons/palette/bi_pinceaucycle.png | Bin 0 -> 1610 bytes eric/GUI/icons/palette/bi_pinceauhauteur.png | Bin 0 -> 1168 bytes eric/GUI/icons/palette/bi_pinceauinter.png | Bin 0 -> 1382 bytes eric/GUI/icons/palette/bi_syma.png | Bin 0 -> 1137 bytes eric/GUI/icons/palette/bi_symc.png | Bin 0 -> 397 bytes eric/GUI/icons/palette/bi_t_align.png | Bin 0 -> 607 bytes eric/GUI/icons/palette/bi_t_app.png | Bin 0 -> 1048 bytes eric/GUI/icons/palette/bi_t_conf.png | Bin 0 -> 821 bytes eric/GUI/icons/palette/bi_t_equi.png | Bin 0 -> 717 bytes eric/GUI/icons/palette/bi_t_para.png | Bin 0 -> 1232 bytes eric/GUI/icons/palette/bi_t_perp.png | Bin 0 -> 1428 bytes eric/GUI/icons/palette/bi_trans.png | Bin 0 -> 930 bytes eric/GUI/icons/palette/blank.png | Bin 0 -> 126 bytes eric/GUI/icons/palette/bold.png | Bin 0 -> 543 bytes eric/GUI/icons/palette/boundedpoint.png | Bin 0 -> 1068 bytes eric/GUI/icons/palette/cacher.png | Bin 0 -> 2269 bytes eric/GUI/icons/palette/chaine.png | Bin 0 -> 526 bytes eric/GUI/icons/palette/chaineOFF.png | Bin 0 -> 459 bytes eric/GUI/icons/palette/circle.png | Bin 0 -> 1933 bytes eric/GUI/icons/palette/circle3.png | Bin 0 -> 2186 bytes eric/GUI/icons/palette/color.png | Bin 0 -> 765 bytes eric/GUI/icons/palette/color0.png | Bin 0 -> 765 bytes eric/GUI/icons/palette/color1.png | Bin 0 -> 834 bytes eric/GUI/icons/palette/color2.png | Bin 0 -> 839 bytes eric/GUI/icons/palette/color3.png | Bin 0 -> 881 bytes eric/GUI/icons/palette/color4.png | Bin 0 -> 906 bytes eric/GUI/icons/palette/color5.png | Bin 0 -> 840 bytes eric/GUI/icons/palette/copy.png | Bin 0 -> 867 bytes eric/GUI/icons/palette/crayonB.png | Bin 0 -> 1951 bytes eric/GUI/icons/palette/crayonH.png | Bin 0 -> 1952 bytes eric/GUI/icons/palette/ctrl_button.png | Bin 0 -> 759 bytes eric/GUI/icons/palette/ctrl_chkbox.png | Bin 0 -> 719 bytes eric/GUI/icons/palette/ctrl_edit.png | Bin 0 -> 783 bytes eric/GUI/icons/palette/ctrl_popup.png | Bin 0 -> 633 bytes eric/GUI/icons/palette/ctrl_resize.png | Bin 0 -> 328 bytes eric/GUI/icons/palette/ctrl_slider.png | Bin 0 -> 497 bytes eric/GUI/icons/palette/ctrl_txtfield.png | Bin 0 -> 847 bytes eric/GUI/icons/palette/delete.png | Bin 0 -> 872 bytes eric/GUI/icons/palette/dice.png | Bin 0 -> 2325 bytes eric/GUI/icons/palette/dottedgrid.png | Bin 0 -> 688 bytes eric/GUI/icons/palette/edit.png | Bin 0 -> 1499 bytes eric/GUI/icons/palette/equationxy.png | Bin 0 -> 1321 bytes eric/GUI/icons/palette/exporteps.png | Bin 0 -> 1451 bytes eric/GUI/icons/palette/exportpdf.png | Bin 0 -> 1425 bytes eric/GUI/icons/palette/exportpng.png | Bin 0 -> 1446 bytes eric/GUI/icons/palette/exportsvg.png | Bin 0 -> 1431 bytes eric/GUI/icons/palette/expression.png | Bin 0 -> 905 bytes eric/GUI/icons/palette/fastback.png | Bin 0 -> 1647 bytes eric/GUI/icons/palette/fastforward.png | Bin 0 -> 1633 bytes eric/GUI/icons/palette/filled.png | Bin 0 -> 1288 bytes eric/GUI/icons/palette/fixedangle.png | Bin 0 -> 1374 bytes eric/GUI/icons/palette/fixedcircle.png | Bin 0 -> 1898 bytes eric/GUI/icons/palette/fixedsegment.png | Bin 0 -> 994 bytes eric/GUI/icons/palette/forbidden.png | Bin 0 -> 161 bytes eric/GUI/icons/palette/function.png | Bin 0 -> 1456 bytes eric/GUI/icons/palette/grid.png | Bin 0 -> 818 bytes eric/GUI/icons/palette/help_panel.png | Bin 0 -> 1261 bytes eric/GUI/icons/palette/hidden.png | Bin 0 -> 1503 bytes eric/GUI/icons/palette/hide.png | Bin 0 -> 865 bytes eric/GUI/icons/palette/history_panel.png | Bin 0 -> 1270 bytes eric/GUI/icons/palette/hour.png | Bin 0 -> 1321 bytes eric/GUI/icons/palette/image3.png | Bin 0 -> 1852 bytes eric/GUI/icons/palette/imcenter.png | Bin 0 -> 558 bytes eric/GUI/icons/palette/imstretch.png | Bin 0 -> 1232 bytes eric/GUI/icons/palette/imtile.png | Bin 0 -> 594 bytes eric/GUI/icons/palette/inter3D.png | Bin 0 -> 1525 bytes eric/GUI/icons/palette/interactiveinput.png | Bin 0 -> 1338 bytes eric/GUI/icons/palette/intersection.png | Bin 0 -> 1525 bytes eric/GUI/icons/palette/js_abs.png | Bin 0 -> 543 bytes eric/GUI/icons/palette/js_acos.png | Bin 0 -> 495 bytes eric/GUI/icons/palette/js_and.png | Bin 0 -> 457 bytes eric/GUI/icons/palette/js_array.png | Bin 0 -> 197 bytes eric/GUI/icons/palette/js_asin.png | Bin 0 -> 518 bytes eric/GUI/icons/palette/js_atan.png | Bin 0 -> 509 bytes eric/GUI/icons/palette/js_ceil.png | Bin 0 -> 553 bytes eric/GUI/icons/palette/js_cos.png | Bin 0 -> 472 bytes eric/GUI/icons/palette/js_e.png | Bin 0 -> 417 bytes eric/GUI/icons/palette/js_ex.png | Bin 0 -> 521 bytes eric/GUI/icons/palette/js_floor.png | Bin 0 -> 636 bytes eric/GUI/icons/palette/js_ln.png | Bin 0 -> 482 bytes eric/GUI/icons/palette/js_max.png | Bin 0 -> 513 bytes eric/GUI/icons/palette/js_min.png | Bin 0 -> 509 bytes eric/GUI/icons/palette/js_no.png | Bin 0 -> 359 bytes eric/GUI/icons/palette/js_or.png | Bin 0 -> 475 bytes eric/GUI/icons/palette/js_pi.png | Bin 0 -> 434 bytes eric/GUI/icons/palette/js_round.png | Bin 0 -> 526 bytes eric/GUI/icons/palette/js_sin.png | Bin 0 -> 479 bytes eric/GUI/icons/palette/js_sqrt.png | Bin 0 -> 596 bytes eric/GUI/icons/palette/js_tan.png | Bin 0 -> 477 bytes eric/GUI/icons/palette/js_xn.png | Bin 0 -> 546 bytes eric/GUI/icons/palette/large.png | Bin 0 -> 629 bytes eric/GUI/icons/palette/lg_ar_TN.png | Bin 0 -> 563 bytes eric/GUI/icons/palette/lg_de.png | Bin 0 -> 333 bytes eric/GUI/icons/palette/lg_en.png | Bin 0 -> 778 bytes eric/GUI/icons/palette/lg_es.png | Bin 0 -> 448 bytes eric/GUI/icons/palette/lg_fr.png | Bin 0 -> 270 bytes eric/GUI/icons/palette/lg_gl.png | Bin 0 -> 509 bytes eric/GUI/icons/palette/lg_it.png | Bin 0 -> 190 bytes eric/GUI/icons/palette/lg_nl.png | Bin 0 -> 231 bytes eric/GUI/icons/palette/lg_no.png | Bin 0 -> 459 bytes eric/GUI/icons/palette/lg_pl.png | Bin 0 -> 175 bytes eric/GUI/icons/palette/lg_pt.png | Bin 0 -> 569 bytes eric/GUI/icons/palette/lg_pt_BR.png | Bin 0 -> 684 bytes eric/GUI/icons/palette/lg_ru_RU.png | Bin 0 -> 1547 bytes eric/GUI/icons/palette/lg_sl.png | Bin 0 -> 304 bytes eric/GUI/icons/palette/lg_sv.png | Bin 0 -> 240 bytes eric/GUI/icons/palette/lg_zh_TW.png | Bin 0 -> 387 bytes eric/GUI/icons/palette/line.png | Bin 0 -> 1068 bytes eric/GUI/icons/palette/line3D.png | Bin 0 -> 1068 bytes eric/GUI/icons/palette/load.png | Bin 0 -> 1348 bytes eric/GUI/icons/palette/loadmacros.png | Bin 0 -> 1500 bytes eric/GUI/icons/palette/locus.png | Bin 0 -> 1677 bytes eric/GUI/icons/palette/longnames.png | Bin 0 -> 653 bytes eric/GUI/icons/palette/macro.png | Bin 0 -> 986 bytes eric/GUI/icons/palette/manage_macros.png | Bin 0 -> 1290 bytes eric/GUI/icons/palette/mask.gif | Bin 0 -> 73 bytes eric/GUI/icons/palette/midpoint.png | Bin 0 -> 722 bytes eric/GUI/icons/palette/midpoint3D.png | Bin 0 -> 714 bytes eric/GUI/icons/palette/moins.gif | Bin 0 -> 45 bytes eric/GUI/icons/palette/montrer.png | Bin 0 -> 2304 bytes eric/GUI/icons/palette/move.png | Bin 0 -> 866 bytes eric/GUI/icons/palette/nail.png | Bin 0 -> 1303 bytes eric/GUI/icons/palette/new.png | Bin 0 -> 1145 bytes eric/GUI/icons/palette/newmacro.png | Bin 0 -> 1563 bytes eric/GUI/icons/palette/nextbreak.png | Bin 0 -> 1312 bytes eric/GUI/icons/palette/null.gif | Bin 0 -> 307 bytes eric/GUI/icons/palette/null.png | Bin 0 -> 142 bytes eric/GUI/icons/palette/numgrid.png | Bin 0 -> 430 bytes eric/GUI/icons/palette/objecttracker.png | Bin 0 -> 1564 bytes eric/GUI/icons/palette/obtuse.png | Bin 0 -> 1121 bytes eric/GUI/icons/palette/oneback.png | Bin 0 -> 939 bytes eric/GUI/icons/palette/oneforward.png | Bin 0 -> 946 bytes eric/GUI/icons/palette/onepix.png | Bin 0 -> 126 bytes eric/GUI/icons/palette/orienter.png | Bin 0 -> 974 bytes eric/GUI/icons/palette/palbackgroundpx.gif | Bin 0 -> 43 bytes eric/GUI/icons/palette/palettetitlebar.gif | Bin 0 -> 96 bytes eric/GUI/icons/palette/parallel.png | Bin 0 -> 1531 bytes eric/GUI/icons/palette/parametricfunction.png | Bin 0 -> 1349 bytes eric/GUI/icons/palette/partial.png | Bin 0 -> 1571 bytes eric/GUI/icons/palette/pivoterB.png | Bin 0 -> 1096 bytes eric/GUI/icons/palette/pivoterD.png | Bin 0 -> 1273 bytes eric/GUI/icons/palette/pivoterG.png | Bin 0 -> 1247 bytes eric/GUI/icons/palette/pivoterH.png | Bin 0 -> 1104 bytes eric/GUI/icons/palette/plines.png | Bin 0 -> 1185 bytes eric/GUI/icons/palette/plumb.png | Bin 0 -> 1540 bytes eric/GUI/icons/palette/point.png | Bin 0 -> 450 bytes eric/GUI/icons/palette/properties_panel.png | Bin 0 -> 1086 bytes eric/GUI/icons/palette/quadric.png | Bin 0 -> 1433 bytes eric/GUI/icons/palette/ray.png | Bin 0 -> 1018 bytes eric/GUI/icons/palette/ray3D.png | Bin 0 -> 994 bytes eric/GUI/icons/palette/reculer.png | Bin 0 -> 483 bytes eric/GUI/icons/palette/reculer2.png | Bin 0 -> 739 bytes eric/GUI/icons/palette/reculer3.png | Bin 0 -> 983 bytes eric/GUI/icons/palette/reculer4.png | Bin 0 -> 1089 bytes eric/GUI/icons/palette/rename.png | Bin 0 -> 1687 bytes eric/GUI/icons/palette/save.png | Bin 0 -> 1073 bytes eric/GUI/icons/palette/savedis.png | Bin 0 -> 1045 bytes eric/GUI/icons/palette/segment.png | Bin 0 -> 929 bytes eric/GUI/icons/palette/segment3D.png | Bin 0 -> 918 bytes eric/GUI/icons/palette/select.png | Bin 0 -> 1431 bytes eric/GUI/icons/palette/selmark.png | Bin 0 -> 320 bytes eric/GUI/icons/palette/setbreak.png | Bin 0 -> 1051 bytes eric/GUI/icons/palette/showname.png | Bin 0 -> 753 bytes eric/GUI/icons/palette/showvalue.png | Bin 0 -> 1258 bytes eric/GUI/icons/palette/solid.png | Bin 0 -> 1319 bytes eric/GUI/icons/palette/text.png | Bin 0 -> 616 bytes eric/GUI/icons/palette/thickness.png | Bin 0 -> 345 bytes eric/GUI/icons/palette/thickness0.png | Bin 0 -> 345 bytes eric/GUI/icons/palette/thickness1.png | Bin 0 -> 400 bytes eric/GUI/icons/palette/thickness2.png | Bin 0 -> 348 bytes eric/GUI/icons/palette/tortue.png | Bin 0 -> 1603 bytes eric/GUI/icons/palette/tournerD.png | Bin 0 -> 596 bytes eric/GUI/icons/palette/tournerD3D.png | Bin 0 -> 1057 bytes eric/GUI/icons/palette/tournerG.png | Bin 0 -> 615 bytes eric/GUI/icons/palette/tournerG3D.png | Bin 0 -> 1045 bytes eric/GUI/icons/palette/tracker.png | Bin 0 -> 1297 bytes eric/GUI/icons/palette/type.png | Bin 0 -> 546 bytes eric/GUI/icons/palette/type0.png | Bin 0 -> 546 bytes eric/GUI/icons/palette/type1.png | Bin 0 -> 688 bytes eric/GUI/icons/palette/type2.png | Bin 0 -> 864 bytes eric/GUI/icons/palette/type3.png | Bin 0 -> 422 bytes eric/GUI/icons/palette/type4.png | Bin 0 -> 713 bytes eric/GUI/icons/palette/type5.png | Bin 0 -> 1121 bytes eric/GUI/icons/palette/undo.png | Bin 0 -> 1103 bytes eric/GUI/icons/palette/vector.png | Bin 0 -> 1080 bytes eric/GUI/icons/palette/vector3D.png | Bin 0 -> 1080 bytes eric/GUI/icons/palette/viser.png | Bin 0 -> 1257 bytes eric/GUI/icons/palette/vitesse.png | Bin 0 -> 588 bytes eric/GUI/icons/palette/zoom.png | Bin 0 -> 1715 bytes .../icons/themes/brushed/PaletteTitleBarH.png | Bin 0 -> 2534 bytes .../icons/themes/brushed/PaletteTitleBarN.png | Bin 0 -> 2543 bytes .../icons/themes/brushed/addmacrofolder.png | Bin 0 -> 465 bytes .../themes/brushed/addmacrofoldersel.png | Bin 0 -> 449 bytes .../GUI/icons/themes/brushed/backcontrols.gif | Bin 0 -> 678 bytes eric/GUI/icons/themes/brushed/createmacro.png | Bin 0 -> 830 bytes .../icons/themes/brushed/createmacroover.png | Bin 0 -> 830 bytes .../icons/themes/brushed/createmacrosel.png | Bin 0 -> 794 bytes eric/GUI/icons/themes/brushed/delmacro.png | Bin 0 -> 542 bytes eric/GUI/icons/themes/brushed/delmacrosel.png | Bin 0 -> 548 bytes eric/GUI/icons/themes/brushed/leftcanvas.png | Bin 0 -> 1795 bytes .../icons/themes/brushed/macrospanelback.gif | Bin 0 -> 108 bytes eric/GUI/icons/themes/brushed/menubar.gif | Bin 0 -> 924 bytes .../icons/themes/brushed/palbackground.gif | Bin 0 -> 152 bytes eric/GUI/icons/themes/brushed/renamemacro.png | Bin 0 -> 608 bytes .../icons/themes/brushed/renamemacrosel.png | Bin 0 -> 584 bytes eric/GUI/icons/themes/brushed/rightcanvas.png | Bin 0 -> 1846 bytes eric/GUI/icons/themes/brushed/statusbar.gif | Bin 0 -> 1463 bytes eric/GUI/icons/themes/brushed/titlebar.gif | Bin 0 -> 1284 bytes .../themes/brushed/verticalseparator.png | Bin 0 -> 2191 bytes eric/GUI/icons/themes/brushed/zcborder.gif | Bin 0 -> 185 bytes .../GUI/icons/themes/brushed/zclosebutton.png | Bin 0 -> 618 bytes .../icons/themes/brushed/zclosebuttonover.png | Bin 0 -> 603 bytes eric/GUI/icons/themes/brushed/zgrowbutton.png | Bin 0 -> 298 bytes .../icons/themes/brushed/zgrowbuttonover.png | Bin 0 -> 301 bytes eric/GUI/icons/themes/brushed/zoombox.png | Bin 0 -> 492 bytes .../icons/themes/brushed/zreducebutton.png | Bin 0 -> 499 bytes .../themes/brushed/zreducebuttonover.png | Bin 0 -> 499 bytes .../icons/themes/common/JTreefoldclosed.gif | Bin 0 -> 161 bytes .../icons/themes/common/JTreefoldopened.gif | Bin 0 -> 161 bytes eric/GUI/icons/themes/common/JTreeleaf_0.gif | Bin 0 -> 276 bytes eric/GUI/icons/themes/common/JTreeleaf_1.gif | Bin 0 -> 286 bytes eric/GUI/icons/themes/common/JTreeleaf_2.gif | Bin 0 -> 263 bytes eric/GUI/icons/themes/common/JTreeleaf_3.gif | Bin 0 -> 170 bytes .../themes/common/MCreateDlogBackground.gif | Bin 0 -> 185 bytes eric/GUI/icons/themes/common/Mcomments.png | Bin 0 -> 825 bytes eric/GUI/icons/themes/common/Mnext.png | Bin 0 -> 643 bytes eric/GUI/icons/themes/common/animation.png | Bin 0 -> 1056 bytes eric/GUI/icons/themes/common/chkboxOFF.gif | Bin 0 -> 131 bytes eric/GUI/icons/themes/common/chkboxON.gif | Bin 0 -> 217 bytes eric/GUI/icons/themes/common/helpsearch1.gif | Bin 0 -> 176 bytes eric/GUI/icons/themes/common/helpsearch2.png | Bin 0 -> 513 bytes eric/GUI/icons/themes/common/helpsearch3.gif | Bin 0 -> 156 bytes .../icons/themes/common/helpsearchback.png | Bin 0 -> 578 bytes eric/GUI/icons/themes/common/left_help.png | Bin 0 -> 578 bytes eric/GUI/icons/themes/common/left_history.png | Bin 0 -> 151 bytes eric/GUI/icons/themes/common/left_macros.png | Bin 0 -> 720 bytes eric/GUI/icons/themes/common/leftcanvas.png | Bin 0 -> 110 bytes .../GUI/icons/themes/common/leftpanel_off.png | Bin 0 -> 669 bytes .../icons/themes/common/leftpanel_off_btn.gif | Bin 0 -> 461 bytes eric/GUI/icons/themes/common/leftpanel_on.png | Bin 0 -> 698 bytes .../icons/themes/common/leftpanel_on_btn.gif | Bin 0 -> 465 bytes .../themes/common/leftpanelbackground.gif | Bin 0 -> 162 bytes .../icons/themes/common/middlepanel_off.png | Bin 0 -> 454 bytes .../icons/themes/common/middlepanel_on.png | Bin 0 -> 517 bytes .../GUI/icons/themes/common/monkeybtn_off.png | Bin 0 -> 1334 bytes eric/GUI/icons/themes/common/monkeybtn_on.png | Bin 0 -> 1239 bytes eric/GUI/icons/themes/common/navleft.png | Bin 0 -> 601 bytes .../GUI/icons/themes/common/navleftpushed.png | Bin 0 -> 750 bytes eric/GUI/icons/themes/common/navmenu1.png | Bin 0 -> 561 bytes .../icons/themes/common/navmenu1pushed.png | Bin 0 -> 706 bytes eric/GUI/icons/themes/common/navmenu2.png | Bin 0 -> 954 bytes .../icons/themes/common/navmenu2pushed.png | Bin 0 -> 1052 bytes eric/GUI/icons/themes/common/navright.png | Bin 0 -> 600 bytes .../icons/themes/common/navrightpushed.png | Bin 0 -> 735 bytes eric/GUI/icons/themes/common/null.gif | Bin 0 -> 43 bytes .../GUI/icons/themes/common/palbackground.gif | Bin 0 -> 43 bytes .../icons/themes/common/palbackground2.gif | Bin 0 -> 43 bytes .../icons/themes/common/palbackground3.gif | Bin 0 -> 43 bytes eric/GUI/icons/themes/common/pixel.png | Bin 0 -> 110 bytes eric/GUI/icons/themes/common/progressback.png | Bin 0 -> 159 bytes eric/GUI/icons/themes/common/rightback.png | Bin 0 -> 168 bytes eric/GUI/icons/themes/common/rightcanvas.png | Bin 0 -> 110 bytes .../icons/themes/common/rightpanel_off.png | Bin 0 -> 675 bytes .../GUI/icons/themes/common/rightpanel_on.png | Bin 0 -> 677 bytes eric/GUI/icons/themes/common/scripts.png | Bin 0 -> 2171 bytes eric/GUI/icons/themes/common/sep.png | Bin 0 -> 128 bytes eric/GUI/icons/themes/common/tab_bottom.gif | Bin 0 -> 96 bytes eric/GUI/icons/themes/common/tab_btn_off.gif | Bin 0 -> 96 bytes .../themes/common/tab_btn_off_left_border.gif | Bin 0 -> 216 bytes .../icons/themes/common/tab_btn_off_over.gif | Bin 0 -> 98 bytes .../common/tab_btn_off_over_left_border.gif | Bin 0 -> 215 bytes .../common/tab_btn_off_over_right_border.gif | Bin 0 -> 218 bytes .../common/tab_btn_off_right_border.gif | Bin 0 -> 219 bytes eric/GUI/icons/themes/common/tab_btn_on.gif | Bin 0 -> 96 bytes .../themes/common/tab_btn_on_left_border.gif | Bin 0 -> 224 bytes .../themes/common/tab_btn_on_right_border.gif | Bin 0 -> 225 bytes eric/GUI/icons/themes/common/tab_close.png | Bin 0 -> 189 bytes .../icons/themes/common/tab_close_over.png | Bin 0 -> 173 bytes .../GUI/icons/themes/common/tab_file_icon.png | Bin 0 -> 654 bytes eric/GUI/icons/themes/common/tab_left.gif | Bin 0 -> 44 bytes eric/GUI/icons/themes/common/tab_right.gif | Bin 0 -> 44 bytes eric/GUI/icons/themes/common/tab_top.gif | Bin 0 -> 96 bytes .../icons/themes/gray/PaletteTitleBarH.png | Bin 0 -> 263 bytes .../icons/themes/gray/PaletteTitleBarN.png | Bin 0 -> 255 bytes eric/GUI/icons/themes/gray/addmacrofolder.png | Bin 0 -> 241 bytes .../icons/themes/gray/addmacrofoldersel.png | Bin 0 -> 263 bytes eric/GUI/icons/themes/gray/backcontrols.gif | Bin 0 -> 43 bytes eric/GUI/icons/themes/gray/createmacro.png | Bin 0 -> 577 bytes .../GUI/icons/themes/gray/createmacroover.png | Bin 0 -> 593 bytes eric/GUI/icons/themes/gray/createmacrosel.png | Bin 0 -> 634 bytes eric/GUI/icons/themes/gray/delmacro.png | Bin 0 -> 212 bytes eric/GUI/icons/themes/gray/delmacrosel.png | Bin 0 -> 224 bytes eric/GUI/icons/themes/gray/leftcanvas.png | Bin 0 -> 109 bytes .../GUI/icons/themes/gray/macrospanelback.gif | Bin 0 -> 108 bytes eric/GUI/icons/themes/gray/menubar.gif | Bin 0 -> 96 bytes eric/GUI/icons/themes/gray/renamemacro.png | Bin 0 -> 429 bytes eric/GUI/icons/themes/gray/renamemacrosel.png | Bin 0 -> 444 bytes eric/GUI/icons/themes/gray/rightcanvas.png | Bin 0 -> 109 bytes eric/GUI/icons/themes/gray/statusbar.gif | Bin 0 -> 98 bytes eric/GUI/icons/themes/gray/tabbar.gif | Bin 0 -> 104 bytes eric/GUI/icons/themes/gray/titlebar.gif | Bin 0 -> 98 bytes .../icons/themes/gray/verticalseparator.png | Bin 0 -> 109 bytes eric/GUI/icons/themes/gray/zcborder.gif | Bin 0 -> 43 bytes eric/GUI/icons/themes/gray/zclosebutton.png | Bin 0 -> 745 bytes .../icons/themes/gray/zclosebuttonover.png | Bin 0 -> 775 bytes eric/GUI/icons/themes/gray/zgrowbutton.png | Bin 0 -> 750 bytes .../GUI/icons/themes/gray/zgrowbuttonover.png | Bin 0 -> 763 bytes eric/GUI/icons/themes/gray/zoombox.png | Bin 0 -> 215 bytes eric/GUI/icons/themes/gray/zreducebutton.png | Bin 0 -> 740 bytes .../icons/themes/gray/zreducebuttonover.png | Bin 0 -> 751 bytes eric/GUI/palette/.DS_Store | Bin 0 -> 12292 bytes eric/GUI/palette/JColorPanel.java | 358 + eric/GUI/palette/JCursor.java | 132 + eric/GUI/palette/JIcon.java | 611 ++ eric/GUI/palette/JIconMouseAdapter.java | 57 + eric/GUI/palette/PaletteManager.java | 685 ++ eric/GUI/palette/PaletteZone.java | 179 + eric/GUI/palette/PaletteZoneCheckBox.java | 63 + eric/GUI/palette/PaletteZoneContent.java | 76 + eric/GUI/palette/PaletteZoneLabel.java | 41 + eric/GUI/palette/PaletteZoneTitle.java | 83 + eric/GUI/palette/PaletteZone_3D.java | 40 + eric/GUI/palette/PaletteZone_Aspect.java | 159 + eric/GUI/palette/PaletteZone_Geom.java | 72 + eric/GUI/pipe_tools.java | 366 + eric/GUI/themes.java | 358 + eric/GUI/window/CanvasPanel.java | 37 + eric/GUI/window/CloseBox.java | 61 + eric/GUI/window/ContentPane.java | 181 + eric/GUI/window/GrowBox.java | 73 + eric/GUI/window/ImageFilter.java | 66 + eric/GUI/window/LeftPanel.java | 195 + eric/GUI/window/LeftPanel_btn.java | 15 + eric/GUI/window/LeftPanel_close_btn.java | 64 + eric/GUI/window/LeftPanel_content.java | 79 + eric/GUI/window/LeftPanel_help_btn.java | 67 + eric/GUI/window/LeftPanel_history_btn.java | 63 + eric/GUI/window/LeftPanel_macros_btn.java | 62 + eric/GUI/window/LeftPanel_scripts_btn.java | 55 + eric/GUI/window/MainApplet.java | 186 + eric/GUI/window/MainContainer.java | 32 + eric/GUI/window/MainWindow.java | 162 + eric/GUI/window/Margin.java | 35 + eric/GUI/window/MenuBar.java | 74 + eric/GUI/window/Monkey_panel_btn.java | 92 + eric/GUI/window/Open_left_panel_btn.java | 112 + eric/GUI/window/Open_middle_panel_btn.java | 99 + eric/GUI/window/Open_right_panel_btn.java | 103 + eric/GUI/window/ReduceBox.java | 66 + eric/GUI/window/ResizeBox.java | 73 + eric/GUI/window/RightPanel.java | 95 + eric/GUI/window/TitleBar.java | 79 + eric/GUI/window/VerticalLeftBorder.java | 52 + eric/GUI/window/VerticalLeftPanelBorder.java | 76 + eric/GUI/window/VerticalRightBorder.java | 52 + eric/GUI/window/clock.java | 29 + eric/GUI/window/comments.java | 87 + eric/GUI/window/comments_area.java | 232 + eric/GUI/window/myJMenuItem.java | 52 + eric/GUI/window/nav_left.java | 79 + eric/GUI/window/nav_menu1.java | 86 + eric/GUI/window/nav_menu2.java | 85 + eric/GUI/window/nav_right.java | 81 + eric/GUI/window/tab_bottom.java | 65 + eric/GUI/window/tab_btn.java | 279 + eric/GUI/window/tab_btn_label.java | 177 + eric/GUI/window/tab_canvas_panel.java | 25 + eric/GUI/window/tab_close_btn.java | 71 + eric/GUI/window/tab_control_panel.java | 71 + eric/GUI/window/tab_left.java | 38 + eric/GUI/window/tab_main_panel.java | 530 ++ eric/GUI/window/tab_right.java | 38 + eric/GUI/windowComponent.java | 71 + eric/JBrowserLauncher.java | 120 + eric/JCharacterPalette.java | 361 + eric/JColorPicker.java | 317 + eric/JColors.java | 38 + eric/JEricPanel.java | 25 + eric/JFileFilter.java | 62 + eric/JGeneralMenuBar.java | 1305 +++ eric/JGlobalPreferences.java | 112 + eric/JGlobalPreferencesColor.java | 355 + eric/JGlobalPreferencesCursor.java | 125 + eric/JGlobalPreferencesDlog.form | 190 + eric/JGlobalPreferencesDlog.java | 246 + eric/JHelpPanel.java | 792 ++ eric/JLicence.java | 185 + eric/JLogoWindow.java | 231 + eric/JMacOShandler.java | 63 + eric/JMacroPrompt.java | 249 + eric/JPointName.java | 278 + eric/JSelectPopup.java | 208 + eric/JSprogram/.DS_Store | Bin 0 -> 8196 bytes eric/JSprogram/.cvsignore | 1 + eric/JSprogram/Const.java | 31 + eric/JSprogram/JSBlankIcon.java | 31 + eric/JSprogram/JSButton.java | 144 + eric/JSprogram/JSEditor.form | 877 ++ eric/JSprogram/JSEditor.java | 2977 +++++++ eric/JSprogram/JSFunctions.java | 7815 +++++++++++++++++ eric/JSprogram/JSIcon.java | 411 + eric/JSprogram/JSOuputConsole.java | 43 + eric/JSprogram/JScriptsLeftPanel.java | 253 + eric/JSprogram/LineNumber.java | 133 + eric/JSprogram/LineNumberView.java | 330 + eric/JSprogram/ScriptItem.java | 487 + eric/JSprogram/ScriptItemsArray.java | 20 + eric/JSprogram/ScriptPanel.java | 432 + eric/JSprogram/ScriptThread.java | 1650 ++++ eric/JSprogram/ScriptsManager.java | 300 + eric/JSprogram/myJTitleBar.java | 138 + eric/JSprogram/myJVerticalSeparatorPanel.java | 50 + eric/JSprogram/myStatusBarPanel.java | 50 + eric/JUniqueInstance.java | 138 + eric/JZirkelCanvas.java | 781 ++ eric/Media.java | 109 + eric/OS.java | 46 + eric/Progress_Bar.java | 103 + eric/animations/Animation.java | 246 + eric/animations/AnimationPanel.java | 313 + eric/bar/.DS_Store | Bin 0 -> 6148 bytes eric/bar/JControlProperties.java | 678 ++ eric/bar/JProperties.java | 5315 +++++++++++ eric/bar/JPropertiesBar.java | 326 + eric/bar/JTabPanel.java | 166 + eric/bar/JTabPanelTitleBar.java | 173 + eric/bar/gui/Pclose.png | Bin 0 -> 608 bytes eric/bar/gui/Pcloseover.png | Bin 0 -> 600 bytes eric/bar/gui/chkboxOFF.png | Bin 0 -> 296 bytes eric/bar/gui/chkboxON.png | Bin 0 -> 452 bytes eric/bar/gui/panel_back.png | Bin 0 -> 125 bytes eric/bar/gui/sep.png | Bin 0 -> 89 bytes eric/bar/gui/tab_off.png | Bin 0 -> 353 bytes eric/bar/gui/tab_on.png | Bin 0 -> 314 bytes eric/bar/gui/title_back_end.png | Bin 0 -> 343 bytes eric/bar/gui/titlebar.png | Bin 0 -> 120 bytes eric/bar/gui/titles_back.png | Bin 0 -> 136 bytes eric/controls/JCanvasButton.java | 146 + eric/controls/JCanvasCheckBox.java | 128 + eric/controls/JCanvasPanel.java | 532 ++ eric/controls/JCanvasPopup.java | 171 + eric/controls/JCanvasSlider.java | 249 + eric/controls/JCanvasTxtfield.java | 143 + eric/controls/JControlsManager.java | 450 + eric/controls/SliderSnap.java | 296 + eric/docs/.DS_Store | Bin 0 -> 12292 bytes eric/docs/JZirkelProperties.properties | 824 ++ eric/docs/JZirkelProperties_ar_TN.properties | 447 + eric/docs/JZirkelProperties_de.properties | 290 + eric/docs/JZirkelProperties_en.properties | 0 eric/docs/JZirkelProperties_es.properties | 762 ++ eric/docs/JZirkelProperties_fr.properties | 801 ++ eric/docs/JZirkelProperties_gl.properties | 213 + eric/docs/JZirkelProperties_it.properties | 481 + eric/docs/JZirkelProperties_nl.properties | 297 + eric/docs/JZirkelProperties_no.properties | 218 + eric/docs/JZirkelProperties_pl.properties | 329 + eric/docs/JZirkelProperties_pt.properties | 481 + eric/docs/JZirkelProperties_pt_BR.properties | 438 + eric/docs/JZirkelProperties_ru_RU.properties | 481 + eric/docs/JZirkelProperties_sl.properties | 265 + eric/docs/JZirkelProperties_sv.properties | 481 + eric/docs/JZirkelProperties_zh_TW.properties | 372 + eric/docs/applet.html | 67 + eric/docs/applet_ext.html | 69 + eric/docs/index.html | 127 + eric/jobs/AlphaContainer.java | 45 + eric/jobs/Base64Coder.java | 225 + eric/jobs/JobControlPanel.java | 122 + eric/jobs/JobManager.java | 322 + eric/jobs/JobMessage.java | 54 + eric/jobs/JobValidPanel.java | 112 + eric/jobs/JobValidation.java | 209 + eric/jobs/StringCompressionUtils.java | 80 + eric/macros/CTransferableTreePath.java | 68 + eric/macros/CTree.java | 663 ++ eric/macros/CreateMacroDialog.java | 154 + eric/macros/CreateMacroPanel.java | 326 + eric/macros/DialogTitleBar.java | 128 + eric/macros/DragDropList.java | 138 + eric/macros/JDefaultMutableTreeNode.java | 106 + eric/macros/JMacrosFProperties.java | 182 + eric/macros/JMacrosInspector.java | 653 ++ eric/macros/JMacrosProperties.java | 227 + eric/macros/MacroTools.java | 570 ++ eric/macros/MacrosList.java | 583 ++ eric/macros/NodePopupMenu.java | 428 + eric/macros/TopDialog.java | 14 + eric/monkey/monkey.java | 113 + eric/restrict/RestrictContainer.java | 70 + eric/restrict/RestrictContainerControls.java | 115 + eric/restrict/RestrictContainerTitle.java | 48 + eric/restrict/RestrictItems.java | 174 + .../RestrictNonPalettePreference.java | 44 + eric/restrict/RestrictPanel.java | 222 + eric/restrict/RestrictPanelActiveLine.java | 49 + eric/restrict/RestrictPanelComment.java | 29 + eric/restrict/RestrictPanelFlowIcons.java | 55 + eric/restrict/RestrictPanelIcon.java | 112 + eric/restrict/RestrictPanelIconsLine.java | 41 + .../restrict/RestrictPanelIconsLineTitle.java | 104 + eric/restrict/RestrictPanelLine.java | 39 + eric/restrict/RestrictSeparator.java | 31 + eric/textfieldpopup/JFunctionsPanel.java | 104 + eric/textfieldpopup/JMenuPanel.java | 152 + eric/textfieldpopup/JSpecialCarsPanel.java | 66 + eric/textfieldpopup/JTexPanel.java | 145 + eric/textfieldpopup/JTextFieldPopup.java | 90 + java.policy.applet | 7 + makejar-source.jardesc | 28 + net/java/dev/colorchooser/Bundle.properties | 337 + .../dev/colorchooser/Bundle_en_US.properties | 333 + .../dev/colorchooser/Bundle_fr.properties | 42 + net/java/dev/colorchooser/CCBorder.java | 112 + .../dev/colorchooser/CDDL_GPLv2_licence.txt | 156 + net/java/dev/colorchooser/ColorChooser.java | 398 + .../colorchooser/ColorChooserBeanInfo.java | 382 + net/java/dev/colorchooser/ColorChooserUI.java | 366 + .../dev/colorchooser/ContinuousPalette.java | 343 + .../colorchooser/DefaultColorChooserUI.java | 106 + net/java/dev/colorchooser/NamedColor.java | 126 + net/java/dev/colorchooser/Palette.java | 132 + net/java/dev/colorchooser/PalettePopup.java | 376 + .../dev/colorchooser/PredefinedPalette.java | 680 ++ net/java/dev/colorchooser/RecentColors.java | 331 + net/java/dev/colorchooser/chooserIcon.gif | Bin 0 -> 233 bytes net/java/dev/colorchooser/chooserIcon32.gif | Bin 0 -> 560 bytes netscape/javascript/JSObject.java | 178 + org/mozilla/classfile/ByteCode.java | 274 + org/mozilla/classfile/ClassFileWriter.java | 3043 +++++++ org/mozilla/javascript/Arguments.java | 322 + org/mozilla/javascript/BaseFunction.java | 564 ++ org/mozilla/javascript/Callable.java | 59 + org/mozilla/javascript/ClassCache.java | 223 + org/mozilla/javascript/ClassShutter.java | 89 + org/mozilla/javascript/CompilerEnvirons.java | 233 + org/mozilla/javascript/ConstProperties.java | 109 + org/mozilla/javascript/Context.java | 2649 ++++++ org/mozilla/javascript/ContextAction.java | 58 + org/mozilla/javascript/ContextFactory.java | 590 ++ org/mozilla/javascript/ContextListener.java | 60 + .../javascript/ContinuationPending.java | 99 + org/mozilla/javascript/DToA.java | 1271 +++ org/mozilla/javascript/Decompiler.java | 918 ++ .../javascript/DefaultErrorReporter.java | 113 + .../javascript/DefiningClassLoader.java | 89 + org/mozilla/javascript/Delegator.java | 266 + org/mozilla/javascript/EcmaError.java | 161 + org/mozilla/javascript/ErrorReporter.java | 106 + org/mozilla/javascript/Evaluator.java | 118 + .../javascript/EvaluatorException.java | 123 + org/mozilla/javascript/Function.java | 84 + org/mozilla/javascript/FunctionNode.java | 117 + org/mozilla/javascript/FunctionObject.java | 572 ++ .../javascript/GeneratedClassLoader.java | 66 + org/mozilla/javascript/IRFactory.java | 1607 ++++ org/mozilla/javascript/IdFunctionCall.java | 55 + org/mozilla/javascript/IdFunctionObject.java | 196 + .../javascript/IdScriptableObject.java | 741 ++ org/mozilla/javascript/ImporterTopLevel.java | 324 + org/mozilla/javascript/InterfaceAdapter.java | 156 + .../javascript/InterpretedFunction.java | 235 + org/mozilla/javascript/Interpreter.java | 4740 ++++++++++ org/mozilla/javascript/InterpreterData.java | 192 + org/mozilla/javascript/JavaAdapter.java | 1140 +++ org/mozilla/javascript/JavaMembers.java | 933 ++ .../javascript/JavaScriptException.java | 118 + org/mozilla/javascript/Kit.java | 455 + org/mozilla/javascript/LazilyLoadedCtor.java | 141 + org/mozilla/javascript/MemberBox.java | 372 + org/mozilla/javascript/NativeArray.java | 1745 ++++ org/mozilla/javascript/NativeBoolean.java | 175 + org/mozilla/javascript/NativeCall.java | 158 + .../javascript/NativeContinuation.java | 139 + org/mozilla/javascript/NativeDate.java | 1610 ++++ org/mozilla/javascript/NativeError.java | 232 + org/mozilla/javascript/NativeFunction.java | 172 + org/mozilla/javascript/NativeGenerator.java | 288 + org/mozilla/javascript/NativeGlobal.java | 795 ++ org/mozilla/javascript/NativeIterator.java | 269 + org/mozilla/javascript/NativeJavaArray.java | 180 + org/mozilla/javascript/NativeJavaClass.java | 329 + .../javascript/NativeJavaConstructor.java | 88 + org/mozilla/javascript/NativeJavaMethod.java | 580 ++ org/mozilla/javascript/NativeJavaObject.java | 1002 +++ org/mozilla/javascript/NativeJavaPackage.java | 218 + .../javascript/NativeJavaTopPackage.java | 186 + org/mozilla/javascript/NativeMath.java | 403 + org/mozilla/javascript/NativeNumber.java | 250 + org/mozilla/javascript/NativeObject.java | 321 + org/mozilla/javascript/NativeScript.java | 230 + org/mozilla/javascript/NativeString.java | 995 +++ org/mozilla/javascript/NativeWith.java | 207 + org/mozilla/javascript/Node.java | 1399 +++ org/mozilla/javascript/NodeTransformer.java | 565 ++ org/mozilla/javascript/ObjArray.java | 388 + org/mozilla/javascript/ObjToIntMap.java | 697 ++ org/mozilla/javascript/Parser.java | 2507 ++++++ .../javascript/PolicySecurityController.java | 223 + org/mozilla/javascript/Ref.java | 64 + org/mozilla/javascript/RefCallable.java | 59 + org/mozilla/javascript/RegExpProxy.java | 71 + org/mozilla/javascript/RhinoException.java | 308 + org/mozilla/javascript/Script.java | 73 + org/mozilla/javascript/ScriptOrFnNode.java | 230 + org/mozilla/javascript/ScriptRuntime.java | 3925 +++++++++ org/mozilla/javascript/Scriptable.java | 342 + org/mozilla/javascript/ScriptableObject.java | 2522 ++++++ org/mozilla/javascript/SecureCaller.java | 196 + .../javascript/SecurityController.java | 211 + org/mozilla/javascript/SecurityUtilities.java | 80 + org/mozilla/javascript/SpecialRef.java | 155 + org/mozilla/javascript/Synchronizer.java | 82 + org/mozilla/javascript/Token.java | 434 + org/mozilla/javascript/TokenStream.java | 1463 +++ org/mozilla/javascript/UintMap.java | 659 ++ org/mozilla/javascript/Undefined.java | 60 + org/mozilla/javascript/UniqueTag.java | 121 + org/mozilla/javascript/VMBridge.java | 183 + org/mozilla/javascript/WrapFactory.java | 183 + org/mozilla/javascript/WrappedException.java | 95 + org/mozilla/javascript/Wrapper.java | 58 + org/mozilla/javascript/debug/DebugFrame.java | 91 + .../javascript/debug/DebuggableObject.java | 61 + .../javascript/debug/DebuggableScript.java | 119 + org/mozilla/javascript/debug/Debugger.java | 69 + .../javascript/jdk13/VMBridge_jdk13.java | 165 + .../javascript/jdk15/VMBridge_jdk15.java | 89 + org/mozilla/javascript/optimizer/Block.java | 619 ++ .../javascript/optimizer/ClassCompiler.java | 211 + org/mozilla/javascript/optimizer/Codegen.java | 5048 +++++++++++ .../javascript/optimizer/DataFlowBitSet.java | 135 + .../javascript/optimizer/OptFunctionNode.java | 149 + .../javascript/optimizer/OptRuntime.java | 311 + .../javascript/optimizer/OptTransformer.java | 135 + .../javascript/optimizer/Optimizer.java | 509 ++ .../javascript/regexp/NativeRegExp.java | 2792 ++++++ .../javascript/regexp/NativeRegExpCtor.java | 297 + org/mozilla/javascript/regexp/RegExpImpl.java | 541 ++ org/mozilla/javascript/regexp/SubString.java | 76 + .../javascript/resources/Messages.properties | 781 ++ .../resources/Messages_fr.properties | 329 + .../serialize/ScriptableInputStream.java | 114 + .../serialize/ScriptableOutputStream.java | 220 + org/mozilla/javascript/xml/XMLLib.java | 173 + org/mozilla/javascript/xml/XMLObject.java | 128 + pm/Client/Client.java | 38 + pm/Client/ClientNetworkTools.java | 269 + pm/Client/Communication.java | 66 + pm/Client/ConnectionControlPanel.java | 162 + pm/Client/Connexion.java | 43 + pm/Client/Reception.java | 91 + pm/Server/Accept_clients.java | 171 + pm/Server/Communication.java | 60 + pm/Server/Reception.java | 93 + pm/Server/Server.java | 64 + pm/Server/ServerControlPanel.java | 438 + rene/.DS_Store | Bin 0 -> 6148 bytes rene/dialogs/ColorEditor.java | 161 + rene/dialogs/ExportPictureDlg.form | 174 + rene/dialogs/ExportPictureDlg.java | 381 + rene/dialogs/FontEditor.java | 208 + rene/dialogs/GetParameter.java | 118 + rene/dialogs/ImageFilter.java | 65 + rene/dialogs/ItemEditor.java | 375 + rene/dialogs/ItemEditorElement.java | 26 + rene/dialogs/ItemPanel.java | 84 + rene/dialogs/MyFileDialog.java | 667 ++ rene/dialogs/Question.java | 120 + rene/dialogs/SearchFileDialog.java | 349 + rene/dialogs/Warning.java | 102 + rene/gui/ActionTranslator.java | 49 + rene/gui/ButtonAction.java | 62 + rene/gui/CheckboxAction.java | 71 + rene/gui/CheckboxMenu.java | 58 + rene/gui/CheckboxMenuItemAction.java | 68 + rene/gui/ChoiceAction.java | 68 + rene/gui/CloseDialog.java | 313 + rene/gui/CloseFrame.java | 269 + rene/gui/CloseListener.java | 26 + rene/gui/DoActionListener.java | 28 + rene/gui/FormTextField.java | 48 + rene/gui/Global.java | 1106 +++ rene/gui/HistoryTextField.java | 196 + rene/gui/HistoryTextFieldChoice.java | 87 + rene/gui/IconBar.java | 1795 ++++ rene/gui/IconBarListener.java | 26 + rene/gui/IconBarPanel.java | 71 + rene/gui/IntField.java | 83 + rene/gui/KeyDictionary.java | 76 + rene/gui/Keyboard.java | 287 + rene/gui/KeyboardController.java | 158 + rene/gui/KeyboardInterface.java | 44 + rene/gui/KeyboardItem.java | 206 + rene/gui/KeyboardPanel.java | 238 + rene/gui/ListAction.java | 49 + rene/gui/MenuItemAction.java | 67 + rene/gui/MyCheckboxMenuItem.java | 37 + rene/gui/MyChoice.java | 36 + rene/gui/MyLabel.java | 66 + rene/gui/MyList.java | 53 + rene/gui/MyMenu.java | 37 + rene/gui/MyMenuItem.java | 37 + rene/gui/MyPanel.java | 43 + rene/gui/MyPopupMenu.java | 37 + rene/gui/MyTextField.java | 66 + rene/gui/Panel3D.java | 98 + rene/gui/SimplePanel.java | 72 + rene/gui/TextFieldAction.java | 107 + rene/gui/TextFieldActionListener.java | 39 + rene/lister/Element.java | 32 + rene/lister/Lister.java | 177 + rene/lister/ListerMouseEvent.java | 56 + rene/lister/ListerPanel.java | 454 + rene/lister/StringElement.java | 50 + rene/lister/Wheel.java | 48 + rene/lister/WheelListener.java | 32 + rene/util/FileList.java | 281 + rene/util/FileName.java | 206 + rene/util/ImageSelection.java | 61 + rene/util/MyVector.java | 325 + rene/util/PngEncoder.java | 647 ++ rene/util/SimpleByteBuffer.java | 71 + rene/util/SimpleStringBuffer.java | 69 + rene/util/TestEncoder.java | 302 + rene/util/list/ListClass.java | 166 + rene/util/list/ListElement.java | 79 + rene/util/list/Tree.java | 118 + rene/util/parser/StringParser.java | 372 + rene/util/sort/SortObject.java | 26 + rene/util/sort/SortString.java | 40 + rene/util/sort/SortStringNoCase.java | 36 + rene/util/sort/Sorter.java | 140 + rene/util/xml/SVGWriter.java | 86 + rene/util/xml/XmlReader.java | 505 ++ rene/util/xml/XmlReaderException.java | 55 + rene/util/xml/XmlTag.java | 149 + rene/util/xml/XmlTagPI.java | 30 + rene/util/xml/XmlTagRoot.java | 30 + rene/util/xml/XmlTagText.java | 35 + rene/util/xml/XmlTranslator.java | 104 + rene/util/xml/XmlTree.java | 119 + rene/util/xml/XmlWriter.java | 203 + rene/viewer/ExtendedViewer.java | 423 + rene/viewer/Line.java | 224 + rene/viewer/SystemViewer.java | 83 + rene/viewer/TextDisplay.java | 575 ++ rene/viewer/TextPosition.java | 49 + rene/viewer/Viewer.java | 339 + rene/viewer/Wheel.java | 48 + rene/viewer/WheelListener.java | 32 + rene/zirkel/.#Zirkel.java.1.6 | 0 rene/zirkel/.#ZirkelApplet.java.1.5 | 1466 ++++ rene/zirkel/.DS_Store | Bin 0 -> 10244 bytes rene/zirkel/DragThread.java | 87 + rene/zirkel/ZirkelCanvas.java | 5886 +++++++++++++ rene/zirkel/ZirkelCanvasInterface.java | 38 + rene/zirkel/ZirkelFrame.java | 1536 ++++ .../construction/.#Construction.java.1.4 | 1693 ++++ rene/zirkel/construction/ChangedListener.java | 26 + rene/zirkel/construction/Construction.java | 1772 ++++ .../ConstructionDisplayPanel.java | 442 + .../construction/ConstructionException.java | 44 + rene/zirkel/construction/Count.java | 83 + rene/zirkel/construction/DepList.java | 88 + rene/zirkel/construction/Interpreter.java | 811 ++ rene/zirkel/construction/Selector.java | 29 + .../.#QuadricConstructor.java.1.3 | 181 + rene/zirkel/constructors/.DS_Store | Bin 0 -> 12292 bytes .../zirkel/constructors/AngleConstructor.java | 448 + rene/zirkel/constructors/AreaConstructor.java | 239 + .../constructors/BoundedPointConstructor.java | 244 + .../constructors/Circle3Constructor.java | 150 + .../constructors/CircleConstructor.java | 448 + .../constructors/EquationXYConstructor.java | 57 + .../constructors/ExpressionConstructor.java | 155 + .../constructors/FunctionConstructor.java | 174 + .../zirkel/constructors/ImageConstructor.java | 140 + .../constructors/IntersectionConstructor.java | 468 + rene/zirkel/constructors/LineConstructor.java | 319 + .../constructors/MidpointConstructor.java | 117 + .../constructors/ObjectConstructor.java | 328 + .../constructors/ParallelConstructor.java | 243 + .../zirkel/constructors/PlumbConstructor.java | 121 + .../zirkel/constructors/PointConstructor.java | 308 + .../constructors/QuadricConstructor.java | 244 + rene/zirkel/constructors/RayConstructor.java | 121 + .../constructors/SegmentConstructor.java | 192 + rene/zirkel/constructors/TextConstructor.java | 90 + .../constructors/VectorConstructor.java | 145 + rene/zirkel/dialogs/Replay.java | 195 + rene/zirkel/docs/.DS_Store | Bin 0 -> 8196 bytes rene/zirkel/docs/ZirkelProperties.properties | 1192 +++ .../docs/ZirkelProperties_ar.properties | 1178 +++ .../docs/ZirkelProperties_br.properties | 1119 +++ .../docs/ZirkelProperties_da.properties | 867 ++ .../docs/ZirkelProperties_de.properties | 1202 +++ .../docs/ZirkelProperties_es.properties | 1196 +++ .../ZirkelProperties_es.properties - copie | 1190 +++ .../docs/ZirkelProperties_fr.properties | 1192 +++ .../docs/ZirkelProperties_it.properties | 1146 +++ .../docs/ZirkelProperties_ko.properties | 1189 +++ .../docs/ZirkelProperties_nl.properties | 1200 +++ .../docs/ZirkelProperties_no.properties | 1171 +++ .../docs/ZirkelProperties_pl.properties | 822 ++ .../docs/ZirkelProperties_pt.properties | 1106 +++ .../docs/ZirkelProperties_ru.properties | 1015 +++ .../docs/ZirkelProperties_sk.properties | 1147 +++ .../docs/ZirkelProperties_sl.properties | 1221 +++ .../docs/ZirkelProperties_vi.properties | 921 ++ rene/zirkel/expression/ConvexMin.java | 77 + rene/zirkel/expression/Expression.java | 2784 ++++++ rene/zirkel/expression/ExpressionColor.java | 159 + rene/zirkel/expression/ExpressionString.java | 245 + rene/zirkel/expression/InvalidException.java | 35 + rene/zirkel/expression/NoValueException.java | 41 + rene/zirkel/expression/Quartic.java | 277 + rene/zirkel/expression/Romberg.java | 100 + rene/zirkel/expression/Secant.java | 64 + rene/zirkel/expression/Translator.java | 32 + rene/zirkel/graphics/Drawing.java | 55 + rene/zirkel/graphics/EPSGraphics.java | 489 ++ rene/zirkel/graphics/FontStruct.java | 58 + .../graphics/FunctionPolygonFiller.java | 96 + rene/zirkel/graphics/LatexOutput.java | 94 + rene/zirkel/graphics/MainGraphics.java | 867 ++ rene/zirkel/graphics/MyFormula.java | 26 + rene/zirkel/graphics/MyGraphics.java | 143 + rene/zirkel/graphics/MyHotEqnFormula.java | 58 + rene/zirkel/graphics/MyTeXFormula.java | 107 + rene/zirkel/graphics/MyTeXIcon.java | 74 + rene/zirkel/graphics/PolygonDrawer.java | 146 + rene/zirkel/graphics/PolygonFiller.java | 124 + rene/zirkel/graphics/TrackPainter.java | 33 + rene/zirkel/icon.gif | Bin 0 -> 78 bytes rene/zirkel/icon.png | Bin 0 -> 2043 bytes rene/zirkel/listener/AddEventListener.java | 29 + rene/zirkel/listener/CloseListener.java | 30 + rene/zirkel/listener/DoneListener.java | 26 + rene/zirkel/listener/StatusListener.java | 26 + rene/zirkel/logowindow.jpg | Bin 0 -> 9422 bytes rene/zirkel/macro/.DS_Store | Bin 0 -> 6148 bytes rene/zirkel/macro/Macro.java | 375 + rene/zirkel/macro/MacroBar.java | 104 + .../macro/MacroContextualPopupMenu.java | 48 + rene/zirkel/macro/MacroItem.java | 44 + rene/zirkel/macro/MacroMenu.java | 196 + rene/zirkel/macro/MacroRunner.java | 1347 +++ rene/zirkel/objects/.#PointObject.java.1.6 | 1538 ++++ rene/zirkel/objects/.DS_Store | Bin 0 -> 10244 bytes rene/zirkel/objects/AngleObject.java | 1015 +++ rene/zirkel/objects/AreaObject.java | 785 ++ .../AxisFunctionIntersectionObject.java | 118 + rene/zirkel/objects/AxisObject.java | 183 + rene/zirkel/objects/Circle3Object.java | 104 + .../objects/CircleIntersectionObject.java | 202 + rene/zirkel/objects/CircleObject.java | 272 + rene/zirkel/objects/ConstructionObject.java | 2345 +++++ rene/zirkel/objects/DriverObject.java | 31 + rene/zirkel/objects/EquationXYObject.java | 464 + rene/zirkel/objects/Evaluator.java | 28 + rene/zirkel/objects/ExpressionObject.java | 747 ++ rene/zirkel/objects/FixedAngleObject.java | 764 ++ rene/zirkel/objects/FixedCircleObject.java | 270 + rene/zirkel/objects/FunctionObject.java | 1401 +++ rene/zirkel/objects/HeavyObject.java | 33 + rene/zirkel/objects/ImageObject.java | 171 + rene/zirkel/objects/InsideObject.java | 31 + rene/zirkel/objects/IntersectionObject.java | 291 + rene/zirkel/objects/JLocusTrackObject.java | 659 ++ .../objects/LineCircleIntersectionObject.java | 115 + .../objects/LineIntersectionObject.java | 222 + rene/zirkel/objects/LineObject.java | 193 + .../LineQuadricIntersectionObject.java | 268 + rene/zirkel/objects/MidpointObject.java | 121 + rene/zirkel/objects/MoveableObject.java | 38 + rene/zirkel/objects/ParallelObject.java | 150 + rene/zirkel/objects/PlumbObject.java | 175 + rene/zirkel/objects/PointObject.java | 1748 ++++ rene/zirkel/objects/PointonObject.java | 32 + .../PointonObjectIntersectionObject.java | 237 + .../zirkel/objects/PrimitiveCircleObject.java | 988 +++ rene/zirkel/objects/PrimitiveLineObject.java | 467 + rene/zirkel/objects/QuadricObject.java | 829 ++ .../QuadricQuadricIntersectionObject.java | 296 + rene/zirkel/objects/RayObject.java | 305 + rene/zirkel/objects/SegmentObject.java | 747 ++ rene/zirkel/objects/SimulationObject.java | 28 + rene/zirkel/objects/TextObject.java | 386 + rene/zirkel/objects/TrackObject.java | 1273 +++ rene/zirkel/objects/TwoPointLineObject.java | 132 + rene/zirkel/objects/UserFunctionObject.java | 483 + rene/zirkel/objects/VectorObject.java | 328 + rene/zirkel/structures/Complex.java | 106 + rene/zirkel/structures/Coordinates.java | 55 + rene/zirkel/structures/Coordinates4.java | 41 + rene/zirkel/structures/CoordinatesXY.java | 44 + rene/zirkel/structures/MagnetObj.java | 84 + rene/zirkel/tools/.#ZoomerTool.java.1.3 | 210 + rene/zirkel/tools/AnimatorTool.java | 160 + rene/zirkel/tools/BinderTool.java | 111 + rene/zirkel/tools/BreakpointAnimator.java | 184 + rene/zirkel/tools/DefineJobTool.java | 73 + rene/zirkel/tools/DeleteTool.java | 75 + rene/zirkel/tools/DrawerTool.java | 76 + rene/zirkel/tools/EditTool.java | 113 + rene/zirkel/tools/HiderTool.java | 65 + rene/zirkel/tools/JLocusObjectTracker.java | 85 + rene/zirkel/tools/JSmacroTool.java | 175 + rene/zirkel/tools/LabelMover.java | 117 + rene/zirkel/tools/MagnetTool.java | 106 + rene/zirkel/tools/MetaMover.java | 112 + rene/zirkel/tools/MoverTool.java | 550 ++ rene/zirkel/tools/ObjectTracker.java | 1294 +++ rene/zirkel/tools/RenamerTool.java | 70 + rene/zirkel/tools/ReorderTool.java | 135 + rene/zirkel/tools/Ruler.java | 68 + rene/zirkel/tools/SaveJob.java | 77 + rene/zirkel/tools/Scripts_SetMouseDrag.java | 107 + rene/zirkel/tools/Scripts_SetMouseOver.java | 84 + rene/zirkel/tools/Scripts_SetMouseUp.java | 81 + rene/zirkel/tools/SelectTool.java | 213 + rene/zirkel/tools/SetAwayTool.java | 128 + rene/zirkel/tools/SetCurveCenterTool.java | 70 + rene/zirkel/tools/SetFixedAngle.java | 125 + rene/zirkel/tools/SetFixedCircle.java | 116 + rene/zirkel/tools/SetParameterTool.java | 127 + rene/zirkel/tools/SetRangeTool.java | 86 + rene/zirkel/tools/SetTargetsTool.java | 95 + rene/zirkel/tools/Tracker.java | 315 + rene/zirkel/tools/UniversalTracker.java | 203 + rene/zirkel/tools/ZoomerTool.java | 212 + rene/zirkel/tools/nullTool.java | 68 + zirkel.jardesc | 65 + 1120 files changed, 226843 insertions(+), 1 deletion(-) create mode 100644 Main.java create mode 100644 atp/Des10.gif create mode 100644 atp/Des12.gif create mode 100644 atp/Des14.gif create mode 100644 atp/Des18.gif create mode 100644 atp/Des8.gif create mode 100644 atp/Fonts10.gif create mode 100644 atp/Fonts12.gif create mode 100644 atp/Fonts14.gif create mode 100644 atp/Fonts18.gif create mode 100644 atp/Fonts8.gif create mode 100644 atp/a.java create mode 100644 atp/b.java create mode 100644 atp/c.java create mode 100644 atp/d.java create mode 100644 atp/e.java create mode 100644 atp/f.java create mode 100644 atp/sHotEqn.java create mode 100644 base3D-es.zir create mode 100644 base3D-fr-modifs.zir create mode 100644 base3D-fr.zir create mode 100644 base3D.zir create mode 100644 baseDP.zir create mode 100644 builtin.mcr create mode 100644 com/apple/eawt/Application.java create mode 100644 com/apple/eawt/ApplicationAdapter.java create mode 100644 com/apple/eawt/ApplicationBeanInfo.java create mode 100644 com/apple/eawt/ApplicationEvent.java create mode 100644 com/apple/eawt/ApplicationListener.java create mode 100644 com/apple/eawt/CocoaComponent.java create mode 100644 de/erichseifert/vectorgraphics2d/DataUtils.java create mode 100644 de/erichseifert/vectorgraphics2d/EPSGraphics2D.java create mode 100644 de/erichseifert/vectorgraphics2d/GraphicsUtils.java create mode 100644 de/erichseifert/vectorgraphics2d/PDFGraphics2D.java create mode 100644 de/erichseifert/vectorgraphics2d/SVGGraphics2D.java create mode 100644 de/erichseifert/vectorgraphics2d/VectorGraphics2D.java create mode 100644 de/erichseifert/vectorgraphics2d/package-info.java create mode 100644 default.mcr create mode 100644 eric/.DS_Store create mode 100644 eric/FileTools.java create mode 100644 eric/GUI/.DS_Store create mode 100644 eric/GUI/ZDialog/ZButton.java create mode 100644 eric/GUI/ZDialog/ZCheckBox.java create mode 100644 eric/GUI/ZDialog/ZDialog.java create mode 100644 eric/GUI/ZDialog/ZLabel.java create mode 100644 eric/GUI/ZDialog/ZMessageDialog.java create mode 100644 eric/GUI/ZDialog/ZSep.java create mode 100644 eric/GUI/ZDialog/ZTextField.java create mode 100644 eric/GUI/ZDialog/ZTextFieldAndLabel.java create mode 100644 eric/GUI/ZDialog/ZTools.java create mode 100644 eric/GUI/icons/.DS_Store create mode 100644 eric/GUI/icons/bar/aimant.png create mode 100644 eric/GUI/icons/bar/aimantON.png create mode 100644 eric/GUI/icons/bar/angle0.png create mode 100644 eric/GUI/icons/bar/angle1.png create mode 100644 eric/GUI/icons/bar/angle2.png create mode 100644 eric/GUI/icons/bar/angle3.png create mode 100644 eric/GUI/icons/bar/bold.png create mode 100644 eric/GUI/icons/bar/carbtn.png create mode 100644 eric/GUI/icons/bar/carbtn_dis.png create mode 100644 eric/GUI/icons/bar/cblack.png create mode 100644 eric/GUI/icons/bar/cblue.png create mode 100644 eric/GUI/icons/bar/cbrown.png create mode 100644 eric/GUI/icons/bar/ccyan.png create mode 100644 eric/GUI/icons/bar/cgreen.png create mode 100644 eric/GUI/icons/bar/chidden.png create mode 100644 eric/GUI/icons/bar/cnormal.png create mode 100644 eric/GUI/icons/bar/cod0.png create mode 100644 eric/GUI/icons/bar/cod1.png create mode 100644 eric/GUI/icons/bar/cod2.png create mode 100644 eric/GUI/icons/bar/cod3.png create mode 100644 eric/GUI/icons/bar/cod4.png create mode 100644 eric/GUI/icons/bar/cod5.png create mode 100644 eric/GUI/icons/bar/cod6.png create mode 100644 eric/GUI/icons/bar/color0.png create mode 100644 eric/GUI/icons/bar/color1.png create mode 100644 eric/GUI/icons/bar/color2.png create mode 100644 eric/GUI/icons/bar/color3.png create mode 100644 eric/GUI/icons/bar/color4.png create mode 100644 eric/GUI/icons/bar/color5.png create mode 100644 eric/GUI/icons/bar/cred.png create mode 100644 eric/GUI/icons/bar/cshowname.png create mode 100644 eric/GUI/icons/bar/cshowvalue.png create mode 100644 eric/GUI/icons/bar/csolid.png create mode 100644 eric/GUI/icons/bar/csuperhidden.png create mode 100644 eric/GUI/icons/bar/cthick.png create mode 100644 eric/GUI/icons/bar/cthin.png create mode 100644 eric/GUI/icons/bar/filled.png create mode 100644 eric/GUI/icons/bar/fnct.png create mode 100644 eric/GUI/icons/bar/hide.png create mode 100644 eric/GUI/icons/bar/large.png create mode 100644 eric/GUI/icons/bar/obtuse.png create mode 100644 eric/GUI/icons/bar/open_left.png create mode 100644 eric/GUI/icons/bar/open_right.png create mode 100644 eric/GUI/icons/bar/partial.png create mode 100644 eric/GUI/icons/bar/plines.png create mode 100644 eric/GUI/icons/bar/showname.png create mode 100644 eric/GUI/icons/bar/showvalue.png create mode 100644 eric/GUI/icons/bar/solid.png create mode 100644 eric/GUI/icons/bar/thickness0.png create mode 100644 eric/GUI/icons/bar/thickness1.png create mode 100644 eric/GUI/icons/bar/thickness2.png create mode 100644 eric/GUI/icons/bar/thickness3.png create mode 100644 eric/GUI/icons/bar/type0.png create mode 100644 eric/GUI/icons/bar/type1.png create mode 100644 eric/GUI/icons/bar/type2.png create mode 100644 eric/GUI/icons/bar/type3.png create mode 100644 eric/GUI/icons/bar/type4.png create mode 100644 eric/GUI/icons/bar/type5.png create mode 100644 eric/GUI/icons/jswindow/.DS_Store create mode 100644 eric/GUI/icons/jswindow/comment.png create mode 100644 eric/GUI/icons/jswindow/error.png create mode 100644 eric/GUI/icons/jswindow/format.png create mode 100644 eric/GUI/icons/jswindow/french.png create mode 100644 eric/GUI/icons/jswindow/french2.png create mode 100644 eric/GUI/icons/jswindow/help.png create mode 100644 eric/GUI/icons/jswindow/js.png create mode 100644 eric/GUI/icons/jswindow/js2.png create mode 100644 eric/GUI/icons/jswindow/restore.png create mode 100644 eric/GUI/icons/jswindow/run.png create mode 100644 eric/GUI/icons/palette/.DS_Store create mode 100644 eric/GUI/icons/palette/Mcancel.png create mode 100644 eric/GUI/icons/palette/Mvalid.png create mode 100644 eric/GUI/icons/palette/PaletteTriangleBas.png create mode 100644 eric/GUI/icons/palette/PaletteTriangleDroite.png create mode 100644 eric/GUI/icons/palette/acolor0.png create mode 100644 eric/GUI/icons/palette/acolor1.png create mode 100644 eric/GUI/icons/palette/acolor2.png create mode 100644 eric/GUI/icons/palette/acolor3.png create mode 100644 eric/GUI/icons/palette/acolor4.png create mode 100644 eric/GUI/icons/palette/acolor5.png create mode 100644 eric/GUI/icons/palette/allback.png create mode 100644 eric/GUI/icons/palette/allforward.png create mode 100644 eric/GUI/icons/palette/angle.png create mode 100644 eric/GUI/icons/palette/angle0.gif create mode 100644 eric/GUI/icons/palette/angle1.gif create mode 100644 eric/GUI/icons/palette/angle2.gif create mode 100644 eric/GUI/icons/palette/angle3.gif create mode 100644 eric/GUI/icons/palette/angle3D.png create mode 100644 eric/GUI/icons/palette/animate.png create mode 100644 eric/GUI/icons/palette/area.png create mode 100644 eric/GUI/icons/palette/area3D.png create mode 100644 eric/GUI/icons/palette/athickness0.png create mode 100644 eric/GUI/icons/palette/athickness1.png create mode 100644 eric/GUI/icons/palette/athickness2.png create mode 100644 eric/GUI/icons/palette/avancer.png create mode 100644 eric/GUI/icons/palette/avancer2.png create mode 100644 eric/GUI/icons/palette/avancer3.png create mode 100644 eric/GUI/icons/palette/avancer4.png create mode 100644 eric/GUI/icons/palette/back.png create mode 100644 eric/GUI/icons/palette/background.png create mode 100644 eric/GUI/icons/palette/bi_3Darete.png create mode 100644 eric/GUI/icons/palette/bi_3Dcircle1.png create mode 100644 eric/GUI/icons/palette/bi_3Dcircle2.png create mode 100644 eric/GUI/icons/palette/bi_3Dcircle3pts.png create mode 100644 eric/GUI/icons/palette/bi_3Dcoords.png create mode 100644 eric/GUI/icons/palette/bi_3Dcube.png create mode 100644 eric/GUI/icons/palette/bi_3Ddode.png create mode 100644 eric/GUI/icons/palette/bi_3Disoc.png create mode 100644 eric/GUI/icons/palette/bi_3Docta.png create mode 100644 eric/GUI/icons/palette/bi_3Dplandroite.png create mode 100644 eric/GUI/icons/palette/bi_3Dplanplan.png create mode 100644 eric/GUI/icons/palette/bi_3Dproj.png create mode 100644 eric/GUI/icons/palette/bi_3Dspheredroite.png create mode 100644 eric/GUI/icons/palette/bi_3Dsphereplan.png create mode 100644 eric/GUI/icons/palette/bi_3Dspherepoint.png create mode 100644 eric/GUI/icons/palette/bi_3Dsphererayon.png create mode 100644 eric/GUI/icons/palette/bi_3Dspheresphere.png create mode 100644 eric/GUI/icons/palette/bi_3Dsymc.png create mode 100644 eric/GUI/icons/palette/bi_3Dsymp.png create mode 100644 eric/GUI/icons/palette/bi_3Dtetra.png create mode 100644 eric/GUI/icons/palette/bi_3Dtrans.png create mode 100644 eric/GUI/icons/palette/bi_arc.png create mode 100644 eric/GUI/icons/palette/bi_biss.png create mode 100644 eric/GUI/icons/palette/bi_circ.png create mode 100644 eric/GUI/icons/palette/bi_distance.png create mode 100644 eric/GUI/icons/palette/bi_equidistante.png create mode 100644 eric/GUI/icons/palette/bi_function_u.png create mode 100644 eric/GUI/icons/palette/bi_horocycle.png create mode 100644 eric/GUI/icons/palette/bi_lineIP.png create mode 100644 eric/GUI/icons/palette/bi_med.png create mode 100644 eric/GUI/icons/palette/bi_perp_common.png create mode 100644 eric/GUI/icons/palette/bi_pinceau1.png create mode 100644 eric/GUI/icons/palette/bi_pinceau3.png create mode 100644 eric/GUI/icons/palette/bi_pinceaubiss.png create mode 100644 eric/GUI/icons/palette/bi_pinceaucycle.png create mode 100644 eric/GUI/icons/palette/bi_pinceauhauteur.png create mode 100644 eric/GUI/icons/palette/bi_pinceauinter.png create mode 100644 eric/GUI/icons/palette/bi_syma.png create mode 100644 eric/GUI/icons/palette/bi_symc.png create mode 100644 eric/GUI/icons/palette/bi_t_align.png create mode 100644 eric/GUI/icons/palette/bi_t_app.png create mode 100644 eric/GUI/icons/palette/bi_t_conf.png create mode 100644 eric/GUI/icons/palette/bi_t_equi.png create mode 100644 eric/GUI/icons/palette/bi_t_para.png create mode 100644 eric/GUI/icons/palette/bi_t_perp.png create mode 100644 eric/GUI/icons/palette/bi_trans.png create mode 100644 eric/GUI/icons/palette/blank.png create mode 100644 eric/GUI/icons/palette/bold.png create mode 100644 eric/GUI/icons/palette/boundedpoint.png create mode 100644 eric/GUI/icons/palette/cacher.png create mode 100644 eric/GUI/icons/palette/chaine.png create mode 100644 eric/GUI/icons/palette/chaineOFF.png create mode 100644 eric/GUI/icons/palette/circle.png create mode 100644 eric/GUI/icons/palette/circle3.png create mode 100644 eric/GUI/icons/palette/color.png create mode 100644 eric/GUI/icons/palette/color0.png create mode 100644 eric/GUI/icons/palette/color1.png create mode 100644 eric/GUI/icons/palette/color2.png create mode 100644 eric/GUI/icons/palette/color3.png create mode 100644 eric/GUI/icons/palette/color4.png create mode 100644 eric/GUI/icons/palette/color5.png create mode 100644 eric/GUI/icons/palette/copy.png create mode 100644 eric/GUI/icons/palette/crayonB.png create mode 100644 eric/GUI/icons/palette/crayonH.png create mode 100644 eric/GUI/icons/palette/ctrl_button.png create mode 100644 eric/GUI/icons/palette/ctrl_chkbox.png create mode 100644 eric/GUI/icons/palette/ctrl_edit.png create mode 100644 eric/GUI/icons/palette/ctrl_popup.png create mode 100644 eric/GUI/icons/palette/ctrl_resize.png create mode 100644 eric/GUI/icons/palette/ctrl_slider.png create mode 100644 eric/GUI/icons/palette/ctrl_txtfield.png create mode 100644 eric/GUI/icons/palette/delete.png create mode 100644 eric/GUI/icons/palette/dice.png create mode 100644 eric/GUI/icons/palette/dottedgrid.png create mode 100644 eric/GUI/icons/palette/edit.png create mode 100644 eric/GUI/icons/palette/equationxy.png create mode 100644 eric/GUI/icons/palette/exporteps.png create mode 100644 eric/GUI/icons/palette/exportpdf.png create mode 100644 eric/GUI/icons/palette/exportpng.png create mode 100644 eric/GUI/icons/palette/exportsvg.png create mode 100644 eric/GUI/icons/palette/expression.png create mode 100644 eric/GUI/icons/palette/fastback.png create mode 100644 eric/GUI/icons/palette/fastforward.png create mode 100644 eric/GUI/icons/palette/filled.png create mode 100644 eric/GUI/icons/palette/fixedangle.png create mode 100644 eric/GUI/icons/palette/fixedcircle.png create mode 100644 eric/GUI/icons/palette/fixedsegment.png create mode 100644 eric/GUI/icons/palette/forbidden.png create mode 100644 eric/GUI/icons/palette/function.png create mode 100644 eric/GUI/icons/palette/grid.png create mode 100644 eric/GUI/icons/palette/help_panel.png create mode 100644 eric/GUI/icons/palette/hidden.png create mode 100644 eric/GUI/icons/palette/hide.png create mode 100644 eric/GUI/icons/palette/history_panel.png create mode 100644 eric/GUI/icons/palette/hour.png create mode 100644 eric/GUI/icons/palette/image3.png create mode 100644 eric/GUI/icons/palette/imcenter.png create mode 100644 eric/GUI/icons/palette/imstretch.png create mode 100644 eric/GUI/icons/palette/imtile.png create mode 100644 eric/GUI/icons/palette/inter3D.png create mode 100644 eric/GUI/icons/palette/interactiveinput.png create mode 100644 eric/GUI/icons/palette/intersection.png create mode 100644 eric/GUI/icons/palette/js_abs.png create mode 100644 eric/GUI/icons/palette/js_acos.png create mode 100644 eric/GUI/icons/palette/js_and.png create mode 100644 eric/GUI/icons/palette/js_array.png create mode 100644 eric/GUI/icons/palette/js_asin.png create mode 100644 eric/GUI/icons/palette/js_atan.png create mode 100644 eric/GUI/icons/palette/js_ceil.png create mode 100644 eric/GUI/icons/palette/js_cos.png create mode 100644 eric/GUI/icons/palette/js_e.png create mode 100644 eric/GUI/icons/palette/js_ex.png create mode 100644 eric/GUI/icons/palette/js_floor.png create mode 100644 eric/GUI/icons/palette/js_ln.png create mode 100644 eric/GUI/icons/palette/js_max.png create mode 100644 eric/GUI/icons/palette/js_min.png create mode 100644 eric/GUI/icons/palette/js_no.png create mode 100644 eric/GUI/icons/palette/js_or.png create mode 100644 eric/GUI/icons/palette/js_pi.png create mode 100644 eric/GUI/icons/palette/js_round.png create mode 100644 eric/GUI/icons/palette/js_sin.png create mode 100644 eric/GUI/icons/palette/js_sqrt.png create mode 100644 eric/GUI/icons/palette/js_tan.png create mode 100644 eric/GUI/icons/palette/js_xn.png create mode 100644 eric/GUI/icons/palette/large.png create mode 100644 eric/GUI/icons/palette/lg_ar_TN.png create mode 100644 eric/GUI/icons/palette/lg_de.png create mode 100644 eric/GUI/icons/palette/lg_en.png create mode 100644 eric/GUI/icons/palette/lg_es.png create mode 100644 eric/GUI/icons/palette/lg_fr.png create mode 100644 eric/GUI/icons/palette/lg_gl.png create mode 100644 eric/GUI/icons/palette/lg_it.png create mode 100644 eric/GUI/icons/palette/lg_nl.png create mode 100644 eric/GUI/icons/palette/lg_no.png create mode 100644 eric/GUI/icons/palette/lg_pl.png create mode 100644 eric/GUI/icons/palette/lg_pt.png create mode 100644 eric/GUI/icons/palette/lg_pt_BR.png create mode 100644 eric/GUI/icons/palette/lg_ru_RU.png create mode 100644 eric/GUI/icons/palette/lg_sl.png create mode 100644 eric/GUI/icons/palette/lg_sv.png create mode 100644 eric/GUI/icons/palette/lg_zh_TW.png create mode 100644 eric/GUI/icons/palette/line.png create mode 100644 eric/GUI/icons/palette/line3D.png create mode 100644 eric/GUI/icons/palette/load.png create mode 100644 eric/GUI/icons/palette/loadmacros.png create mode 100644 eric/GUI/icons/palette/locus.png create mode 100644 eric/GUI/icons/palette/longnames.png create mode 100644 eric/GUI/icons/palette/macro.png create mode 100644 eric/GUI/icons/palette/manage_macros.png create mode 100644 eric/GUI/icons/palette/mask.gif create mode 100644 eric/GUI/icons/palette/midpoint.png create mode 100644 eric/GUI/icons/palette/midpoint3D.png create mode 100644 eric/GUI/icons/palette/moins.gif create mode 100644 eric/GUI/icons/palette/montrer.png create mode 100644 eric/GUI/icons/palette/move.png create mode 100644 eric/GUI/icons/palette/nail.png create mode 100644 eric/GUI/icons/palette/new.png create mode 100644 eric/GUI/icons/palette/newmacro.png create mode 100644 eric/GUI/icons/palette/nextbreak.png create mode 100644 eric/GUI/icons/palette/null.gif create mode 100644 eric/GUI/icons/palette/null.png create mode 100644 eric/GUI/icons/palette/numgrid.png create mode 100644 eric/GUI/icons/palette/objecttracker.png create mode 100644 eric/GUI/icons/palette/obtuse.png create mode 100644 eric/GUI/icons/palette/oneback.png create mode 100644 eric/GUI/icons/palette/oneforward.png create mode 100644 eric/GUI/icons/palette/onepix.png create mode 100644 eric/GUI/icons/palette/orienter.png create mode 100644 eric/GUI/icons/palette/palbackgroundpx.gif create mode 100644 eric/GUI/icons/palette/palettetitlebar.gif create mode 100644 eric/GUI/icons/palette/parallel.png create mode 100644 eric/GUI/icons/palette/parametricfunction.png create mode 100644 eric/GUI/icons/palette/partial.png create mode 100644 eric/GUI/icons/palette/pivoterB.png create mode 100644 eric/GUI/icons/palette/pivoterD.png create mode 100644 eric/GUI/icons/palette/pivoterG.png create mode 100644 eric/GUI/icons/palette/pivoterH.png create mode 100644 eric/GUI/icons/palette/plines.png create mode 100644 eric/GUI/icons/palette/plumb.png create mode 100644 eric/GUI/icons/palette/point.png create mode 100644 eric/GUI/icons/palette/properties_panel.png create mode 100644 eric/GUI/icons/palette/quadric.png create mode 100644 eric/GUI/icons/palette/ray.png create mode 100644 eric/GUI/icons/palette/ray3D.png create mode 100644 eric/GUI/icons/palette/reculer.png create mode 100644 eric/GUI/icons/palette/reculer2.png create mode 100644 eric/GUI/icons/palette/reculer3.png create mode 100644 eric/GUI/icons/palette/reculer4.png create mode 100644 eric/GUI/icons/palette/rename.png create mode 100644 eric/GUI/icons/palette/save.png create mode 100644 eric/GUI/icons/palette/savedis.png create mode 100644 eric/GUI/icons/palette/segment.png create mode 100644 eric/GUI/icons/palette/segment3D.png create mode 100644 eric/GUI/icons/palette/select.png create mode 100644 eric/GUI/icons/palette/selmark.png create mode 100644 eric/GUI/icons/palette/setbreak.png create mode 100644 eric/GUI/icons/palette/showname.png create mode 100644 eric/GUI/icons/palette/showvalue.png create mode 100644 eric/GUI/icons/palette/solid.png create mode 100644 eric/GUI/icons/palette/text.png create mode 100644 eric/GUI/icons/palette/thickness.png create mode 100644 eric/GUI/icons/palette/thickness0.png create mode 100644 eric/GUI/icons/palette/thickness1.png create mode 100644 eric/GUI/icons/palette/thickness2.png create mode 100644 eric/GUI/icons/palette/tortue.png create mode 100644 eric/GUI/icons/palette/tournerD.png create mode 100644 eric/GUI/icons/palette/tournerD3D.png create mode 100644 eric/GUI/icons/palette/tournerG.png create mode 100644 eric/GUI/icons/palette/tournerG3D.png create mode 100644 eric/GUI/icons/palette/tracker.png create mode 100644 eric/GUI/icons/palette/type.png create mode 100644 eric/GUI/icons/palette/type0.png create mode 100644 eric/GUI/icons/palette/type1.png create mode 100644 eric/GUI/icons/palette/type2.png create mode 100644 eric/GUI/icons/palette/type3.png create mode 100644 eric/GUI/icons/palette/type4.png create mode 100644 eric/GUI/icons/palette/type5.png create mode 100644 eric/GUI/icons/palette/undo.png create mode 100644 eric/GUI/icons/palette/vector.png create mode 100644 eric/GUI/icons/palette/vector3D.png create mode 100644 eric/GUI/icons/palette/viser.png create mode 100644 eric/GUI/icons/palette/vitesse.png create mode 100644 eric/GUI/icons/palette/zoom.png create mode 100644 eric/GUI/icons/themes/brushed/PaletteTitleBarH.png create mode 100644 eric/GUI/icons/themes/brushed/PaletteTitleBarN.png create mode 100644 eric/GUI/icons/themes/brushed/addmacrofolder.png create mode 100644 eric/GUI/icons/themes/brushed/addmacrofoldersel.png create mode 100644 eric/GUI/icons/themes/brushed/backcontrols.gif create mode 100644 eric/GUI/icons/themes/brushed/createmacro.png create mode 100644 eric/GUI/icons/themes/brushed/createmacroover.png create mode 100644 eric/GUI/icons/themes/brushed/createmacrosel.png create mode 100644 eric/GUI/icons/themes/brushed/delmacro.png create mode 100644 eric/GUI/icons/themes/brushed/delmacrosel.png create mode 100644 eric/GUI/icons/themes/brushed/leftcanvas.png create mode 100644 eric/GUI/icons/themes/brushed/macrospanelback.gif create mode 100644 eric/GUI/icons/themes/brushed/menubar.gif create mode 100644 eric/GUI/icons/themes/brushed/palbackground.gif create mode 100644 eric/GUI/icons/themes/brushed/renamemacro.png create mode 100644 eric/GUI/icons/themes/brushed/renamemacrosel.png create mode 100644 eric/GUI/icons/themes/brushed/rightcanvas.png create mode 100644 eric/GUI/icons/themes/brushed/statusbar.gif create mode 100644 eric/GUI/icons/themes/brushed/titlebar.gif create mode 100644 eric/GUI/icons/themes/brushed/verticalseparator.png create mode 100644 eric/GUI/icons/themes/brushed/zcborder.gif create mode 100644 eric/GUI/icons/themes/brushed/zclosebutton.png create mode 100644 eric/GUI/icons/themes/brushed/zclosebuttonover.png create mode 100644 eric/GUI/icons/themes/brushed/zgrowbutton.png create mode 100644 eric/GUI/icons/themes/brushed/zgrowbuttonover.png create mode 100644 eric/GUI/icons/themes/brushed/zoombox.png create mode 100644 eric/GUI/icons/themes/brushed/zreducebutton.png create mode 100644 eric/GUI/icons/themes/brushed/zreducebuttonover.png create mode 100644 eric/GUI/icons/themes/common/JTreefoldclosed.gif create mode 100644 eric/GUI/icons/themes/common/JTreefoldopened.gif create mode 100644 eric/GUI/icons/themes/common/JTreeleaf_0.gif create mode 100644 eric/GUI/icons/themes/common/JTreeleaf_1.gif create mode 100644 eric/GUI/icons/themes/common/JTreeleaf_2.gif create mode 100644 eric/GUI/icons/themes/common/JTreeleaf_3.gif create mode 100644 eric/GUI/icons/themes/common/MCreateDlogBackground.gif create mode 100644 eric/GUI/icons/themes/common/Mcomments.png create mode 100644 eric/GUI/icons/themes/common/Mnext.png create mode 100644 eric/GUI/icons/themes/common/animation.png create mode 100644 eric/GUI/icons/themes/common/chkboxOFF.gif create mode 100644 eric/GUI/icons/themes/common/chkboxON.gif create mode 100644 eric/GUI/icons/themes/common/helpsearch1.gif create mode 100644 eric/GUI/icons/themes/common/helpsearch2.png create mode 100644 eric/GUI/icons/themes/common/helpsearch3.gif create mode 100644 eric/GUI/icons/themes/common/helpsearchback.png create mode 100644 eric/GUI/icons/themes/common/left_help.png create mode 100644 eric/GUI/icons/themes/common/left_history.png create mode 100644 eric/GUI/icons/themes/common/left_macros.png create mode 100644 eric/GUI/icons/themes/common/leftcanvas.png create mode 100644 eric/GUI/icons/themes/common/leftpanel_off.png create mode 100644 eric/GUI/icons/themes/common/leftpanel_off_btn.gif create mode 100644 eric/GUI/icons/themes/common/leftpanel_on.png create mode 100644 eric/GUI/icons/themes/common/leftpanel_on_btn.gif create mode 100644 eric/GUI/icons/themes/common/leftpanelbackground.gif create mode 100644 eric/GUI/icons/themes/common/middlepanel_off.png create mode 100644 eric/GUI/icons/themes/common/middlepanel_on.png create mode 100644 eric/GUI/icons/themes/common/monkeybtn_off.png create mode 100644 eric/GUI/icons/themes/common/monkeybtn_on.png create mode 100644 eric/GUI/icons/themes/common/navleft.png create mode 100644 eric/GUI/icons/themes/common/navleftpushed.png create mode 100644 eric/GUI/icons/themes/common/navmenu1.png create mode 100644 eric/GUI/icons/themes/common/navmenu1pushed.png create mode 100644 eric/GUI/icons/themes/common/navmenu2.png create mode 100644 eric/GUI/icons/themes/common/navmenu2pushed.png create mode 100644 eric/GUI/icons/themes/common/navright.png create mode 100644 eric/GUI/icons/themes/common/navrightpushed.png create mode 100644 eric/GUI/icons/themes/common/null.gif create mode 100644 eric/GUI/icons/themes/common/palbackground.gif create mode 100644 eric/GUI/icons/themes/common/palbackground2.gif create mode 100644 eric/GUI/icons/themes/common/palbackground3.gif create mode 100644 eric/GUI/icons/themes/common/pixel.png create mode 100644 eric/GUI/icons/themes/common/progressback.png create mode 100644 eric/GUI/icons/themes/common/rightback.png create mode 100644 eric/GUI/icons/themes/common/rightcanvas.png create mode 100644 eric/GUI/icons/themes/common/rightpanel_off.png create mode 100644 eric/GUI/icons/themes/common/rightpanel_on.png create mode 100644 eric/GUI/icons/themes/common/scripts.png create mode 100644 eric/GUI/icons/themes/common/sep.png create mode 100644 eric/GUI/icons/themes/common/tab_bottom.gif create mode 100644 eric/GUI/icons/themes/common/tab_btn_off.gif create mode 100644 eric/GUI/icons/themes/common/tab_btn_off_left_border.gif create mode 100644 eric/GUI/icons/themes/common/tab_btn_off_over.gif create mode 100644 eric/GUI/icons/themes/common/tab_btn_off_over_left_border.gif create mode 100644 eric/GUI/icons/themes/common/tab_btn_off_over_right_border.gif create mode 100644 eric/GUI/icons/themes/common/tab_btn_off_right_border.gif create mode 100644 eric/GUI/icons/themes/common/tab_btn_on.gif create mode 100644 eric/GUI/icons/themes/common/tab_btn_on_left_border.gif create mode 100644 eric/GUI/icons/themes/common/tab_btn_on_right_border.gif create mode 100644 eric/GUI/icons/themes/common/tab_close.png create mode 100644 eric/GUI/icons/themes/common/tab_close_over.png create mode 100644 eric/GUI/icons/themes/common/tab_file_icon.png create mode 100644 eric/GUI/icons/themes/common/tab_left.gif create mode 100644 eric/GUI/icons/themes/common/tab_right.gif create mode 100644 eric/GUI/icons/themes/common/tab_top.gif create mode 100644 eric/GUI/icons/themes/gray/PaletteTitleBarH.png create mode 100644 eric/GUI/icons/themes/gray/PaletteTitleBarN.png create mode 100644 eric/GUI/icons/themes/gray/addmacrofolder.png create mode 100644 eric/GUI/icons/themes/gray/addmacrofoldersel.png create mode 100644 eric/GUI/icons/themes/gray/backcontrols.gif create mode 100644 eric/GUI/icons/themes/gray/createmacro.png create mode 100644 eric/GUI/icons/themes/gray/createmacroover.png create mode 100644 eric/GUI/icons/themes/gray/createmacrosel.png create mode 100644 eric/GUI/icons/themes/gray/delmacro.png create mode 100644 eric/GUI/icons/themes/gray/delmacrosel.png create mode 100644 eric/GUI/icons/themes/gray/leftcanvas.png create mode 100644 eric/GUI/icons/themes/gray/macrospanelback.gif create mode 100644 eric/GUI/icons/themes/gray/menubar.gif create mode 100644 eric/GUI/icons/themes/gray/renamemacro.png create mode 100644 eric/GUI/icons/themes/gray/renamemacrosel.png create mode 100644 eric/GUI/icons/themes/gray/rightcanvas.png create mode 100644 eric/GUI/icons/themes/gray/statusbar.gif create mode 100644 eric/GUI/icons/themes/gray/tabbar.gif create mode 100644 eric/GUI/icons/themes/gray/titlebar.gif create mode 100644 eric/GUI/icons/themes/gray/verticalseparator.png create mode 100644 eric/GUI/icons/themes/gray/zcborder.gif create mode 100644 eric/GUI/icons/themes/gray/zclosebutton.png create mode 100644 eric/GUI/icons/themes/gray/zclosebuttonover.png create mode 100644 eric/GUI/icons/themes/gray/zgrowbutton.png create mode 100644 eric/GUI/icons/themes/gray/zgrowbuttonover.png create mode 100644 eric/GUI/icons/themes/gray/zoombox.png create mode 100644 eric/GUI/icons/themes/gray/zreducebutton.png create mode 100644 eric/GUI/icons/themes/gray/zreducebuttonover.png create mode 100644 eric/GUI/palette/.DS_Store create mode 100644 eric/GUI/palette/JColorPanel.java create mode 100644 eric/GUI/palette/JCursor.java create mode 100644 eric/GUI/palette/JIcon.java create mode 100644 eric/GUI/palette/JIconMouseAdapter.java create mode 100644 eric/GUI/palette/PaletteManager.java create mode 100644 eric/GUI/palette/PaletteZone.java create mode 100644 eric/GUI/palette/PaletteZoneCheckBox.java create mode 100644 eric/GUI/palette/PaletteZoneContent.java create mode 100644 eric/GUI/palette/PaletteZoneLabel.java create mode 100644 eric/GUI/palette/PaletteZoneTitle.java create mode 100644 eric/GUI/palette/PaletteZone_3D.java create mode 100644 eric/GUI/palette/PaletteZone_Aspect.java create mode 100644 eric/GUI/palette/PaletteZone_Geom.java create mode 100644 eric/GUI/pipe_tools.java create mode 100644 eric/GUI/themes.java create mode 100644 eric/GUI/window/CanvasPanel.java create mode 100644 eric/GUI/window/CloseBox.java create mode 100644 eric/GUI/window/ContentPane.java create mode 100644 eric/GUI/window/GrowBox.java create mode 100644 eric/GUI/window/ImageFilter.java create mode 100644 eric/GUI/window/LeftPanel.java create mode 100644 eric/GUI/window/LeftPanel_btn.java create mode 100644 eric/GUI/window/LeftPanel_close_btn.java create mode 100644 eric/GUI/window/LeftPanel_content.java create mode 100644 eric/GUI/window/LeftPanel_help_btn.java create mode 100644 eric/GUI/window/LeftPanel_history_btn.java create mode 100644 eric/GUI/window/LeftPanel_macros_btn.java create mode 100644 eric/GUI/window/LeftPanel_scripts_btn.java create mode 100644 eric/GUI/window/MainApplet.java create mode 100644 eric/GUI/window/MainContainer.java create mode 100644 eric/GUI/window/MainWindow.java create mode 100644 eric/GUI/window/Margin.java create mode 100644 eric/GUI/window/MenuBar.java create mode 100644 eric/GUI/window/Monkey_panel_btn.java create mode 100644 eric/GUI/window/Open_left_panel_btn.java create mode 100644 eric/GUI/window/Open_middle_panel_btn.java create mode 100644 eric/GUI/window/Open_right_panel_btn.java create mode 100644 eric/GUI/window/ReduceBox.java create mode 100644 eric/GUI/window/ResizeBox.java create mode 100644 eric/GUI/window/RightPanel.java create mode 100644 eric/GUI/window/TitleBar.java create mode 100644 eric/GUI/window/VerticalLeftBorder.java create mode 100644 eric/GUI/window/VerticalLeftPanelBorder.java create mode 100644 eric/GUI/window/VerticalRightBorder.java create mode 100644 eric/GUI/window/clock.java create mode 100644 eric/GUI/window/comments.java create mode 100644 eric/GUI/window/comments_area.java create mode 100644 eric/GUI/window/myJMenuItem.java create mode 100644 eric/GUI/window/nav_left.java create mode 100644 eric/GUI/window/nav_menu1.java create mode 100644 eric/GUI/window/nav_menu2.java create mode 100644 eric/GUI/window/nav_right.java create mode 100644 eric/GUI/window/tab_bottom.java create mode 100644 eric/GUI/window/tab_btn.java create mode 100644 eric/GUI/window/tab_btn_label.java create mode 100644 eric/GUI/window/tab_canvas_panel.java create mode 100644 eric/GUI/window/tab_close_btn.java create mode 100644 eric/GUI/window/tab_control_panel.java create mode 100644 eric/GUI/window/tab_left.java create mode 100644 eric/GUI/window/tab_main_panel.java create mode 100644 eric/GUI/window/tab_right.java create mode 100644 eric/GUI/windowComponent.java create mode 100644 eric/JBrowserLauncher.java create mode 100644 eric/JCharacterPalette.java create mode 100644 eric/JColorPicker.java create mode 100644 eric/JColors.java create mode 100644 eric/JEricPanel.java create mode 100644 eric/JFileFilter.java create mode 100644 eric/JGeneralMenuBar.java create mode 100644 eric/JGlobalPreferences.java create mode 100644 eric/JGlobalPreferencesColor.java create mode 100644 eric/JGlobalPreferencesCursor.java create mode 100644 eric/JGlobalPreferencesDlog.form create mode 100644 eric/JGlobalPreferencesDlog.java create mode 100644 eric/JHelpPanel.java create mode 100644 eric/JLicence.java create mode 100644 eric/JLogoWindow.java create mode 100644 eric/JMacOShandler.java create mode 100644 eric/JMacroPrompt.java create mode 100644 eric/JPointName.java create mode 100644 eric/JSelectPopup.java create mode 100644 eric/JSprogram/.DS_Store create mode 100755 eric/JSprogram/.cvsignore create mode 100644 eric/JSprogram/Const.java create mode 100644 eric/JSprogram/JSBlankIcon.java create mode 100644 eric/JSprogram/JSButton.java create mode 100644 eric/JSprogram/JSEditor.form create mode 100644 eric/JSprogram/JSEditor.java create mode 100644 eric/JSprogram/JSFunctions.java create mode 100644 eric/JSprogram/JSIcon.java create mode 100644 eric/JSprogram/JSOuputConsole.java create mode 100644 eric/JSprogram/JScriptsLeftPanel.java create mode 100644 eric/JSprogram/LineNumber.java create mode 100644 eric/JSprogram/LineNumberView.java create mode 100644 eric/JSprogram/ScriptItem.java create mode 100644 eric/JSprogram/ScriptItemsArray.java create mode 100644 eric/JSprogram/ScriptPanel.java create mode 100644 eric/JSprogram/ScriptThread.java create mode 100644 eric/JSprogram/ScriptsManager.java create mode 100644 eric/JSprogram/myJTitleBar.java create mode 100644 eric/JSprogram/myJVerticalSeparatorPanel.java create mode 100644 eric/JSprogram/myStatusBarPanel.java create mode 100644 eric/JUniqueInstance.java create mode 100644 eric/JZirkelCanvas.java create mode 100644 eric/Media.java create mode 100644 eric/OS.java create mode 100644 eric/Progress_Bar.java create mode 100644 eric/animations/Animation.java create mode 100644 eric/animations/AnimationPanel.java create mode 100644 eric/bar/.DS_Store create mode 100644 eric/bar/JControlProperties.java create mode 100644 eric/bar/JProperties.java create mode 100644 eric/bar/JPropertiesBar.java create mode 100644 eric/bar/JTabPanel.java create mode 100644 eric/bar/JTabPanelTitleBar.java create mode 100644 eric/bar/gui/Pclose.png create mode 100644 eric/bar/gui/Pcloseover.png create mode 100644 eric/bar/gui/chkboxOFF.png create mode 100644 eric/bar/gui/chkboxON.png create mode 100644 eric/bar/gui/panel_back.png create mode 100644 eric/bar/gui/sep.png create mode 100644 eric/bar/gui/tab_off.png create mode 100644 eric/bar/gui/tab_on.png create mode 100644 eric/bar/gui/title_back_end.png create mode 100644 eric/bar/gui/titlebar.png create mode 100644 eric/bar/gui/titles_back.png create mode 100644 eric/controls/JCanvasButton.java create mode 100644 eric/controls/JCanvasCheckBox.java create mode 100644 eric/controls/JCanvasPanel.java create mode 100644 eric/controls/JCanvasPopup.java create mode 100644 eric/controls/JCanvasSlider.java create mode 100644 eric/controls/JCanvasTxtfield.java create mode 100644 eric/controls/JControlsManager.java create mode 100644 eric/controls/SliderSnap.java create mode 100644 eric/docs/.DS_Store create mode 100644 eric/docs/JZirkelProperties.properties create mode 100644 eric/docs/JZirkelProperties_ar_TN.properties create mode 100644 eric/docs/JZirkelProperties_de.properties create mode 100644 eric/docs/JZirkelProperties_en.properties create mode 100644 eric/docs/JZirkelProperties_es.properties create mode 100644 eric/docs/JZirkelProperties_fr.properties create mode 100644 eric/docs/JZirkelProperties_gl.properties create mode 100644 eric/docs/JZirkelProperties_it.properties create mode 100644 eric/docs/JZirkelProperties_nl.properties create mode 100644 eric/docs/JZirkelProperties_no.properties create mode 100644 eric/docs/JZirkelProperties_pl.properties create mode 100644 eric/docs/JZirkelProperties_pt.properties create mode 100644 eric/docs/JZirkelProperties_pt_BR.properties create mode 100644 eric/docs/JZirkelProperties_ru_RU.properties create mode 100644 eric/docs/JZirkelProperties_sl.properties create mode 100644 eric/docs/JZirkelProperties_sv.properties create mode 100644 eric/docs/JZirkelProperties_zh_TW.properties create mode 100644 eric/docs/applet.html create mode 100644 eric/docs/applet_ext.html create mode 100644 eric/docs/index.html create mode 100644 eric/jobs/AlphaContainer.java create mode 100644 eric/jobs/Base64Coder.java create mode 100644 eric/jobs/JobControlPanel.java create mode 100644 eric/jobs/JobManager.java create mode 100644 eric/jobs/JobMessage.java create mode 100644 eric/jobs/JobValidPanel.java create mode 100644 eric/jobs/JobValidation.java create mode 100644 eric/jobs/StringCompressionUtils.java create mode 100644 eric/macros/CTransferableTreePath.java create mode 100644 eric/macros/CTree.java create mode 100644 eric/macros/CreateMacroDialog.java create mode 100644 eric/macros/CreateMacroPanel.java create mode 100644 eric/macros/DialogTitleBar.java create mode 100644 eric/macros/DragDropList.java create mode 100644 eric/macros/JDefaultMutableTreeNode.java create mode 100644 eric/macros/JMacrosFProperties.java create mode 100644 eric/macros/JMacrosInspector.java create mode 100644 eric/macros/JMacrosProperties.java create mode 100644 eric/macros/MacroTools.java create mode 100644 eric/macros/MacrosList.java create mode 100644 eric/macros/NodePopupMenu.java create mode 100644 eric/macros/TopDialog.java create mode 100644 eric/monkey/monkey.java create mode 100644 eric/restrict/RestrictContainer.java create mode 100644 eric/restrict/RestrictContainerControls.java create mode 100644 eric/restrict/RestrictContainerTitle.java create mode 100644 eric/restrict/RestrictItems.java create mode 100644 eric/restrict/RestrictNonPalettePreference.java create mode 100644 eric/restrict/RestrictPanel.java create mode 100644 eric/restrict/RestrictPanelActiveLine.java create mode 100644 eric/restrict/RestrictPanelComment.java create mode 100644 eric/restrict/RestrictPanelFlowIcons.java create mode 100644 eric/restrict/RestrictPanelIcon.java create mode 100644 eric/restrict/RestrictPanelIconsLine.java create mode 100644 eric/restrict/RestrictPanelIconsLineTitle.java create mode 100644 eric/restrict/RestrictPanelLine.java create mode 100644 eric/restrict/RestrictSeparator.java create mode 100644 eric/textfieldpopup/JFunctionsPanel.java create mode 100644 eric/textfieldpopup/JMenuPanel.java create mode 100644 eric/textfieldpopup/JSpecialCarsPanel.java create mode 100644 eric/textfieldpopup/JTexPanel.java create mode 100644 eric/textfieldpopup/JTextFieldPopup.java create mode 100644 java.policy.applet create mode 100644 makejar-source.jardesc create mode 100644 net/java/dev/colorchooser/Bundle.properties create mode 100644 net/java/dev/colorchooser/Bundle_en_US.properties create mode 100644 net/java/dev/colorchooser/Bundle_fr.properties create mode 100644 net/java/dev/colorchooser/CCBorder.java create mode 100644 net/java/dev/colorchooser/CDDL_GPLv2_licence.txt create mode 100644 net/java/dev/colorchooser/ColorChooser.java create mode 100644 net/java/dev/colorchooser/ColorChooserBeanInfo.java create mode 100644 net/java/dev/colorchooser/ColorChooserUI.java create mode 100644 net/java/dev/colorchooser/ContinuousPalette.java create mode 100644 net/java/dev/colorchooser/DefaultColorChooserUI.java create mode 100644 net/java/dev/colorchooser/NamedColor.java create mode 100644 net/java/dev/colorchooser/Palette.java create mode 100644 net/java/dev/colorchooser/PalettePopup.java create mode 100644 net/java/dev/colorchooser/PredefinedPalette.java create mode 100644 net/java/dev/colorchooser/RecentColors.java create mode 100644 net/java/dev/colorchooser/chooserIcon.gif create mode 100644 net/java/dev/colorchooser/chooserIcon32.gif create mode 100644 netscape/javascript/JSObject.java create mode 100644 org/mozilla/classfile/ByteCode.java create mode 100644 org/mozilla/classfile/ClassFileWriter.java create mode 100644 org/mozilla/javascript/Arguments.java create mode 100644 org/mozilla/javascript/BaseFunction.java create mode 100644 org/mozilla/javascript/Callable.java create mode 100644 org/mozilla/javascript/ClassCache.java create mode 100644 org/mozilla/javascript/ClassShutter.java create mode 100644 org/mozilla/javascript/CompilerEnvirons.java create mode 100644 org/mozilla/javascript/ConstProperties.java create mode 100644 org/mozilla/javascript/Context.java create mode 100644 org/mozilla/javascript/ContextAction.java create mode 100644 org/mozilla/javascript/ContextFactory.java create mode 100644 org/mozilla/javascript/ContextListener.java create mode 100644 org/mozilla/javascript/ContinuationPending.java create mode 100644 org/mozilla/javascript/DToA.java create mode 100644 org/mozilla/javascript/Decompiler.java create mode 100644 org/mozilla/javascript/DefaultErrorReporter.java create mode 100644 org/mozilla/javascript/DefiningClassLoader.java create mode 100644 org/mozilla/javascript/Delegator.java create mode 100644 org/mozilla/javascript/EcmaError.java create mode 100644 org/mozilla/javascript/ErrorReporter.java create mode 100644 org/mozilla/javascript/Evaluator.java create mode 100644 org/mozilla/javascript/EvaluatorException.java create mode 100644 org/mozilla/javascript/Function.java create mode 100644 org/mozilla/javascript/FunctionNode.java create mode 100644 org/mozilla/javascript/FunctionObject.java create mode 100644 org/mozilla/javascript/GeneratedClassLoader.java create mode 100644 org/mozilla/javascript/IRFactory.java create mode 100644 org/mozilla/javascript/IdFunctionCall.java create mode 100644 org/mozilla/javascript/IdFunctionObject.java create mode 100644 org/mozilla/javascript/IdScriptableObject.java create mode 100644 org/mozilla/javascript/ImporterTopLevel.java create mode 100644 org/mozilla/javascript/InterfaceAdapter.java create mode 100644 org/mozilla/javascript/InterpretedFunction.java create mode 100644 org/mozilla/javascript/Interpreter.java create mode 100644 org/mozilla/javascript/InterpreterData.java create mode 100644 org/mozilla/javascript/JavaAdapter.java create mode 100644 org/mozilla/javascript/JavaMembers.java create mode 100644 org/mozilla/javascript/JavaScriptException.java create mode 100644 org/mozilla/javascript/Kit.java create mode 100644 org/mozilla/javascript/LazilyLoadedCtor.java create mode 100644 org/mozilla/javascript/MemberBox.java create mode 100644 org/mozilla/javascript/NativeArray.java create mode 100644 org/mozilla/javascript/NativeBoolean.java create mode 100644 org/mozilla/javascript/NativeCall.java create mode 100644 org/mozilla/javascript/NativeContinuation.java create mode 100644 org/mozilla/javascript/NativeDate.java create mode 100644 org/mozilla/javascript/NativeError.java create mode 100644 org/mozilla/javascript/NativeFunction.java create mode 100644 org/mozilla/javascript/NativeGenerator.java create mode 100644 org/mozilla/javascript/NativeGlobal.java create mode 100644 org/mozilla/javascript/NativeIterator.java create mode 100644 org/mozilla/javascript/NativeJavaArray.java create mode 100644 org/mozilla/javascript/NativeJavaClass.java create mode 100644 org/mozilla/javascript/NativeJavaConstructor.java create mode 100644 org/mozilla/javascript/NativeJavaMethod.java create mode 100644 org/mozilla/javascript/NativeJavaObject.java create mode 100644 org/mozilla/javascript/NativeJavaPackage.java create mode 100644 org/mozilla/javascript/NativeJavaTopPackage.java create mode 100644 org/mozilla/javascript/NativeMath.java create mode 100644 org/mozilla/javascript/NativeNumber.java create mode 100644 org/mozilla/javascript/NativeObject.java create mode 100644 org/mozilla/javascript/NativeScript.java create mode 100644 org/mozilla/javascript/NativeString.java create mode 100644 org/mozilla/javascript/NativeWith.java create mode 100644 org/mozilla/javascript/Node.java create mode 100644 org/mozilla/javascript/NodeTransformer.java create mode 100644 org/mozilla/javascript/ObjArray.java create mode 100644 org/mozilla/javascript/ObjToIntMap.java create mode 100644 org/mozilla/javascript/Parser.java create mode 100644 org/mozilla/javascript/PolicySecurityController.java create mode 100644 org/mozilla/javascript/Ref.java create mode 100644 org/mozilla/javascript/RefCallable.java create mode 100644 org/mozilla/javascript/RegExpProxy.java create mode 100644 org/mozilla/javascript/RhinoException.java create mode 100644 org/mozilla/javascript/Script.java create mode 100644 org/mozilla/javascript/ScriptOrFnNode.java create mode 100644 org/mozilla/javascript/ScriptRuntime.java create mode 100644 org/mozilla/javascript/Scriptable.java create mode 100644 org/mozilla/javascript/ScriptableObject.java create mode 100644 org/mozilla/javascript/SecureCaller.java create mode 100644 org/mozilla/javascript/SecurityController.java create mode 100644 org/mozilla/javascript/SecurityUtilities.java create mode 100644 org/mozilla/javascript/SpecialRef.java create mode 100644 org/mozilla/javascript/Synchronizer.java create mode 100644 org/mozilla/javascript/Token.java create mode 100644 org/mozilla/javascript/TokenStream.java create mode 100644 org/mozilla/javascript/UintMap.java create mode 100644 org/mozilla/javascript/Undefined.java create mode 100644 org/mozilla/javascript/UniqueTag.java create mode 100644 org/mozilla/javascript/VMBridge.java create mode 100644 org/mozilla/javascript/WrapFactory.java create mode 100644 org/mozilla/javascript/WrappedException.java create mode 100644 org/mozilla/javascript/Wrapper.java create mode 100644 org/mozilla/javascript/debug/DebugFrame.java create mode 100644 org/mozilla/javascript/debug/DebuggableObject.java create mode 100644 org/mozilla/javascript/debug/DebuggableScript.java create mode 100644 org/mozilla/javascript/debug/Debugger.java create mode 100644 org/mozilla/javascript/jdk13/VMBridge_jdk13.java create mode 100644 org/mozilla/javascript/jdk15/VMBridge_jdk15.java create mode 100644 org/mozilla/javascript/optimizer/Block.java create mode 100644 org/mozilla/javascript/optimizer/ClassCompiler.java create mode 100644 org/mozilla/javascript/optimizer/Codegen.java create mode 100644 org/mozilla/javascript/optimizer/DataFlowBitSet.java create mode 100644 org/mozilla/javascript/optimizer/OptFunctionNode.java create mode 100644 org/mozilla/javascript/optimizer/OptRuntime.java create mode 100644 org/mozilla/javascript/optimizer/OptTransformer.java create mode 100644 org/mozilla/javascript/optimizer/Optimizer.java create mode 100644 org/mozilla/javascript/regexp/NativeRegExp.java create mode 100644 org/mozilla/javascript/regexp/NativeRegExpCtor.java create mode 100644 org/mozilla/javascript/regexp/RegExpImpl.java create mode 100644 org/mozilla/javascript/regexp/SubString.java create mode 100644 org/mozilla/javascript/resources/Messages.properties create mode 100644 org/mozilla/javascript/resources/Messages_fr.properties create mode 100644 org/mozilla/javascript/serialize/ScriptableInputStream.java create mode 100644 org/mozilla/javascript/serialize/ScriptableOutputStream.java create mode 100644 org/mozilla/javascript/xml/XMLLib.java create mode 100644 org/mozilla/javascript/xml/XMLObject.java create mode 100644 pm/Client/Client.java create mode 100644 pm/Client/ClientNetworkTools.java create mode 100644 pm/Client/Communication.java create mode 100644 pm/Client/ConnectionControlPanel.java create mode 100644 pm/Client/Connexion.java create mode 100644 pm/Client/Reception.java create mode 100644 pm/Server/Accept_clients.java create mode 100644 pm/Server/Communication.java create mode 100644 pm/Server/Reception.java create mode 100644 pm/Server/Server.java create mode 100644 pm/Server/ServerControlPanel.java create mode 100644 rene/.DS_Store create mode 100644 rene/dialogs/ColorEditor.java create mode 100644 rene/dialogs/ExportPictureDlg.form create mode 100644 rene/dialogs/ExportPictureDlg.java create mode 100644 rene/dialogs/FontEditor.java create mode 100644 rene/dialogs/GetParameter.java create mode 100644 rene/dialogs/ImageFilter.java create mode 100644 rene/dialogs/ItemEditor.java create mode 100644 rene/dialogs/ItemEditorElement.java create mode 100644 rene/dialogs/ItemPanel.java create mode 100644 rene/dialogs/MyFileDialog.java create mode 100644 rene/dialogs/Question.java create mode 100644 rene/dialogs/SearchFileDialog.java create mode 100644 rene/dialogs/Warning.java create mode 100644 rene/gui/ActionTranslator.java create mode 100644 rene/gui/ButtonAction.java create mode 100644 rene/gui/CheckboxAction.java create mode 100644 rene/gui/CheckboxMenu.java create mode 100644 rene/gui/CheckboxMenuItemAction.java create mode 100644 rene/gui/ChoiceAction.java create mode 100644 rene/gui/CloseDialog.java create mode 100644 rene/gui/CloseFrame.java create mode 100644 rene/gui/CloseListener.java create mode 100644 rene/gui/DoActionListener.java create mode 100644 rene/gui/FormTextField.java create mode 100644 rene/gui/Global.java create mode 100644 rene/gui/HistoryTextField.java create mode 100644 rene/gui/HistoryTextFieldChoice.java create mode 100644 rene/gui/IconBar.java create mode 100644 rene/gui/IconBarListener.java create mode 100644 rene/gui/IconBarPanel.java create mode 100644 rene/gui/IntField.java create mode 100644 rene/gui/KeyDictionary.java create mode 100644 rene/gui/Keyboard.java create mode 100644 rene/gui/KeyboardController.java create mode 100644 rene/gui/KeyboardInterface.java create mode 100644 rene/gui/KeyboardItem.java create mode 100644 rene/gui/KeyboardPanel.java create mode 100644 rene/gui/ListAction.java create mode 100644 rene/gui/MenuItemAction.java create mode 100644 rene/gui/MyCheckboxMenuItem.java create mode 100644 rene/gui/MyChoice.java create mode 100644 rene/gui/MyLabel.java create mode 100644 rene/gui/MyList.java create mode 100644 rene/gui/MyMenu.java create mode 100644 rene/gui/MyMenuItem.java create mode 100644 rene/gui/MyPanel.java create mode 100644 rene/gui/MyPopupMenu.java create mode 100644 rene/gui/MyTextField.java create mode 100644 rene/gui/Panel3D.java create mode 100644 rene/gui/SimplePanel.java create mode 100644 rene/gui/TextFieldAction.java create mode 100644 rene/gui/TextFieldActionListener.java create mode 100644 rene/lister/Element.java create mode 100644 rene/lister/Lister.java create mode 100644 rene/lister/ListerMouseEvent.java create mode 100644 rene/lister/ListerPanel.java create mode 100644 rene/lister/StringElement.java create mode 100644 rene/lister/Wheel.java create mode 100644 rene/lister/WheelListener.java create mode 100644 rene/util/FileList.java create mode 100644 rene/util/FileName.java create mode 100644 rene/util/ImageSelection.java create mode 100644 rene/util/MyVector.java create mode 100644 rene/util/PngEncoder.java create mode 100644 rene/util/SimpleByteBuffer.java create mode 100644 rene/util/SimpleStringBuffer.java create mode 100644 rene/util/TestEncoder.java create mode 100644 rene/util/list/ListClass.java create mode 100644 rene/util/list/ListElement.java create mode 100644 rene/util/list/Tree.java create mode 100644 rene/util/parser/StringParser.java create mode 100644 rene/util/sort/SortObject.java create mode 100644 rene/util/sort/SortString.java create mode 100644 rene/util/sort/SortStringNoCase.java create mode 100644 rene/util/sort/Sorter.java create mode 100644 rene/util/xml/SVGWriter.java create mode 100644 rene/util/xml/XmlReader.java create mode 100644 rene/util/xml/XmlReaderException.java create mode 100644 rene/util/xml/XmlTag.java create mode 100644 rene/util/xml/XmlTagPI.java create mode 100644 rene/util/xml/XmlTagRoot.java create mode 100644 rene/util/xml/XmlTagText.java create mode 100644 rene/util/xml/XmlTranslator.java create mode 100644 rene/util/xml/XmlTree.java create mode 100644 rene/util/xml/XmlWriter.java create mode 100644 rene/viewer/ExtendedViewer.java create mode 100644 rene/viewer/Line.java create mode 100644 rene/viewer/SystemViewer.java create mode 100644 rene/viewer/TextDisplay.java create mode 100644 rene/viewer/TextPosition.java create mode 100644 rene/viewer/Viewer.java create mode 100644 rene/viewer/Wheel.java create mode 100644 rene/viewer/WheelListener.java create mode 100755 rene/zirkel/.#Zirkel.java.1.6 create mode 100755 rene/zirkel/.#ZirkelApplet.java.1.5 create mode 100644 rene/zirkel/.DS_Store create mode 100644 rene/zirkel/DragThread.java create mode 100644 rene/zirkel/ZirkelCanvas.java create mode 100644 rene/zirkel/ZirkelCanvasInterface.java create mode 100644 rene/zirkel/ZirkelFrame.java create mode 100755 rene/zirkel/construction/.#Construction.java.1.4 create mode 100644 rene/zirkel/construction/ChangedListener.java create mode 100644 rene/zirkel/construction/Construction.java create mode 100644 rene/zirkel/construction/ConstructionDisplayPanel.java create mode 100644 rene/zirkel/construction/ConstructionException.java create mode 100644 rene/zirkel/construction/Count.java create mode 100644 rene/zirkel/construction/DepList.java create mode 100644 rene/zirkel/construction/Interpreter.java create mode 100644 rene/zirkel/construction/Selector.java create mode 100755 rene/zirkel/constructors/.#QuadricConstructor.java.1.3 create mode 100644 rene/zirkel/constructors/.DS_Store create mode 100644 rene/zirkel/constructors/AngleConstructor.java create mode 100644 rene/zirkel/constructors/AreaConstructor.java create mode 100644 rene/zirkel/constructors/BoundedPointConstructor.java create mode 100644 rene/zirkel/constructors/Circle3Constructor.java create mode 100644 rene/zirkel/constructors/CircleConstructor.java create mode 100644 rene/zirkel/constructors/EquationXYConstructor.java create mode 100644 rene/zirkel/constructors/ExpressionConstructor.java create mode 100644 rene/zirkel/constructors/FunctionConstructor.java create mode 100644 rene/zirkel/constructors/ImageConstructor.java create mode 100644 rene/zirkel/constructors/IntersectionConstructor.java create mode 100644 rene/zirkel/constructors/LineConstructor.java create mode 100644 rene/zirkel/constructors/MidpointConstructor.java create mode 100644 rene/zirkel/constructors/ObjectConstructor.java create mode 100644 rene/zirkel/constructors/ParallelConstructor.java create mode 100644 rene/zirkel/constructors/PlumbConstructor.java create mode 100644 rene/zirkel/constructors/PointConstructor.java create mode 100644 rene/zirkel/constructors/QuadricConstructor.java create mode 100644 rene/zirkel/constructors/RayConstructor.java create mode 100644 rene/zirkel/constructors/SegmentConstructor.java create mode 100644 rene/zirkel/constructors/TextConstructor.java create mode 100644 rene/zirkel/constructors/VectorConstructor.java create mode 100644 rene/zirkel/dialogs/Replay.java create mode 100644 rene/zirkel/docs/.DS_Store create mode 100644 rene/zirkel/docs/ZirkelProperties.properties create mode 100644 rene/zirkel/docs/ZirkelProperties_ar.properties create mode 100644 rene/zirkel/docs/ZirkelProperties_br.properties create mode 100644 rene/zirkel/docs/ZirkelProperties_da.properties create mode 100644 rene/zirkel/docs/ZirkelProperties_de.properties create mode 100644 rene/zirkel/docs/ZirkelProperties_es.properties create mode 100644 rene/zirkel/docs/ZirkelProperties_es.properties - copie create mode 100644 rene/zirkel/docs/ZirkelProperties_fr.properties create mode 100644 rene/zirkel/docs/ZirkelProperties_it.properties create mode 100644 rene/zirkel/docs/ZirkelProperties_ko.properties create mode 100644 rene/zirkel/docs/ZirkelProperties_nl.properties create mode 100644 rene/zirkel/docs/ZirkelProperties_no.properties create mode 100644 rene/zirkel/docs/ZirkelProperties_pl.properties create mode 100644 rene/zirkel/docs/ZirkelProperties_pt.properties create mode 100644 rene/zirkel/docs/ZirkelProperties_ru.properties create mode 100644 rene/zirkel/docs/ZirkelProperties_sk.properties create mode 100644 rene/zirkel/docs/ZirkelProperties_sl.properties create mode 100644 rene/zirkel/docs/ZirkelProperties_vi.properties create mode 100644 rene/zirkel/expression/ConvexMin.java create mode 100644 rene/zirkel/expression/Expression.java create mode 100644 rene/zirkel/expression/ExpressionColor.java create mode 100644 rene/zirkel/expression/ExpressionString.java create mode 100644 rene/zirkel/expression/InvalidException.java create mode 100644 rene/zirkel/expression/NoValueException.java create mode 100644 rene/zirkel/expression/Quartic.java create mode 100644 rene/zirkel/expression/Romberg.java create mode 100644 rene/zirkel/expression/Secant.java create mode 100644 rene/zirkel/expression/Translator.java create mode 100644 rene/zirkel/graphics/Drawing.java create mode 100644 rene/zirkel/graphics/EPSGraphics.java create mode 100644 rene/zirkel/graphics/FontStruct.java create mode 100644 rene/zirkel/graphics/FunctionPolygonFiller.java create mode 100644 rene/zirkel/graphics/LatexOutput.java create mode 100644 rene/zirkel/graphics/MainGraphics.java create mode 100644 rene/zirkel/graphics/MyFormula.java create mode 100644 rene/zirkel/graphics/MyGraphics.java create mode 100644 rene/zirkel/graphics/MyHotEqnFormula.java create mode 100644 rene/zirkel/graphics/MyTeXFormula.java create mode 100644 rene/zirkel/graphics/MyTeXIcon.java create mode 100644 rene/zirkel/graphics/PolygonDrawer.java create mode 100644 rene/zirkel/graphics/PolygonFiller.java create mode 100644 rene/zirkel/graphics/TrackPainter.java create mode 100644 rene/zirkel/icon.gif create mode 100644 rene/zirkel/icon.png create mode 100644 rene/zirkel/listener/AddEventListener.java create mode 100644 rene/zirkel/listener/CloseListener.java create mode 100644 rene/zirkel/listener/DoneListener.java create mode 100644 rene/zirkel/listener/StatusListener.java create mode 100644 rene/zirkel/logowindow.jpg create mode 100644 rene/zirkel/macro/.DS_Store create mode 100644 rene/zirkel/macro/Macro.java create mode 100644 rene/zirkel/macro/MacroBar.java create mode 100644 rene/zirkel/macro/MacroContextualPopupMenu.java create mode 100644 rene/zirkel/macro/MacroItem.java create mode 100644 rene/zirkel/macro/MacroMenu.java create mode 100644 rene/zirkel/macro/MacroRunner.java create mode 100755 rene/zirkel/objects/.#PointObject.java.1.6 create mode 100644 rene/zirkel/objects/.DS_Store create mode 100644 rene/zirkel/objects/AngleObject.java create mode 100644 rene/zirkel/objects/AreaObject.java create mode 100644 rene/zirkel/objects/AxisFunctionIntersectionObject.java create mode 100644 rene/zirkel/objects/AxisObject.java create mode 100644 rene/zirkel/objects/Circle3Object.java create mode 100644 rene/zirkel/objects/CircleIntersectionObject.java create mode 100644 rene/zirkel/objects/CircleObject.java create mode 100644 rene/zirkel/objects/ConstructionObject.java create mode 100644 rene/zirkel/objects/DriverObject.java create mode 100644 rene/zirkel/objects/EquationXYObject.java create mode 100644 rene/zirkel/objects/Evaluator.java create mode 100644 rene/zirkel/objects/ExpressionObject.java create mode 100644 rene/zirkel/objects/FixedAngleObject.java create mode 100644 rene/zirkel/objects/FixedCircleObject.java create mode 100644 rene/zirkel/objects/FunctionObject.java create mode 100644 rene/zirkel/objects/HeavyObject.java create mode 100644 rene/zirkel/objects/ImageObject.java create mode 100644 rene/zirkel/objects/InsideObject.java create mode 100644 rene/zirkel/objects/IntersectionObject.java create mode 100644 rene/zirkel/objects/JLocusTrackObject.java create mode 100644 rene/zirkel/objects/LineCircleIntersectionObject.java create mode 100644 rene/zirkel/objects/LineIntersectionObject.java create mode 100644 rene/zirkel/objects/LineObject.java create mode 100644 rene/zirkel/objects/LineQuadricIntersectionObject.java create mode 100644 rene/zirkel/objects/MidpointObject.java create mode 100644 rene/zirkel/objects/MoveableObject.java create mode 100644 rene/zirkel/objects/ParallelObject.java create mode 100644 rene/zirkel/objects/PlumbObject.java create mode 100644 rene/zirkel/objects/PointObject.java create mode 100644 rene/zirkel/objects/PointonObject.java create mode 100644 rene/zirkel/objects/PointonObjectIntersectionObject.java create mode 100644 rene/zirkel/objects/PrimitiveCircleObject.java create mode 100644 rene/zirkel/objects/PrimitiveLineObject.java create mode 100644 rene/zirkel/objects/QuadricObject.java create mode 100644 rene/zirkel/objects/QuadricQuadricIntersectionObject.java create mode 100644 rene/zirkel/objects/RayObject.java create mode 100644 rene/zirkel/objects/SegmentObject.java create mode 100644 rene/zirkel/objects/SimulationObject.java create mode 100644 rene/zirkel/objects/TextObject.java create mode 100644 rene/zirkel/objects/TrackObject.java create mode 100644 rene/zirkel/objects/TwoPointLineObject.java create mode 100644 rene/zirkel/objects/UserFunctionObject.java create mode 100644 rene/zirkel/objects/VectorObject.java create mode 100644 rene/zirkel/structures/Complex.java create mode 100644 rene/zirkel/structures/Coordinates.java create mode 100644 rene/zirkel/structures/Coordinates4.java create mode 100644 rene/zirkel/structures/CoordinatesXY.java create mode 100644 rene/zirkel/structures/MagnetObj.java create mode 100755 rene/zirkel/tools/.#ZoomerTool.java.1.3 create mode 100644 rene/zirkel/tools/AnimatorTool.java create mode 100644 rene/zirkel/tools/BinderTool.java create mode 100644 rene/zirkel/tools/BreakpointAnimator.java create mode 100644 rene/zirkel/tools/DefineJobTool.java create mode 100644 rene/zirkel/tools/DeleteTool.java create mode 100644 rene/zirkel/tools/DrawerTool.java create mode 100644 rene/zirkel/tools/EditTool.java create mode 100644 rene/zirkel/tools/HiderTool.java create mode 100644 rene/zirkel/tools/JLocusObjectTracker.java create mode 100644 rene/zirkel/tools/JSmacroTool.java create mode 100644 rene/zirkel/tools/LabelMover.java create mode 100644 rene/zirkel/tools/MagnetTool.java create mode 100644 rene/zirkel/tools/MetaMover.java create mode 100644 rene/zirkel/tools/MoverTool.java create mode 100644 rene/zirkel/tools/ObjectTracker.java create mode 100644 rene/zirkel/tools/RenamerTool.java create mode 100644 rene/zirkel/tools/ReorderTool.java create mode 100644 rene/zirkel/tools/Ruler.java create mode 100644 rene/zirkel/tools/SaveJob.java create mode 100644 rene/zirkel/tools/Scripts_SetMouseDrag.java create mode 100644 rene/zirkel/tools/Scripts_SetMouseOver.java create mode 100644 rene/zirkel/tools/Scripts_SetMouseUp.java create mode 100644 rene/zirkel/tools/SelectTool.java create mode 100644 rene/zirkel/tools/SetAwayTool.java create mode 100644 rene/zirkel/tools/SetCurveCenterTool.java create mode 100644 rene/zirkel/tools/SetFixedAngle.java create mode 100644 rene/zirkel/tools/SetFixedCircle.java create mode 100644 rene/zirkel/tools/SetParameterTool.java create mode 100644 rene/zirkel/tools/SetRangeTool.java create mode 100644 rene/zirkel/tools/SetTargetsTool.java create mode 100644 rene/zirkel/tools/Tracker.java create mode 100644 rene/zirkel/tools/UniversalTracker.java create mode 100644 rene/zirkel/tools/ZoomerTool.java create mode 100644 rene/zirkel/tools/nullTool.java create mode 100644 zirkel.jardesc diff --git a/Main.java b/Main.java new file mode 100644 index 0000000..eb59c59 --- /dev/null +++ b/Main.java @@ -0,0 +1,158 @@ + + +import eric.FileTools; +import eric.GUI.palette.PaletteManager; +import eric.GUI.window.MainApplet; +import eric.JLogoWindow; +import eric.JSprogram.ScriptThread; +import eric.OS; +import eric.macros.MacroTools; +import eric.bar.JPropertiesBar; +import java.io.FileOutputStream; +import java.io.PrintStream; +import java.util.Locale; +import java.util.Properties; +import javax.swing.SwingUtilities; +import rene.gui.Global; + +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +/** + * + * @author erichake + */ +public class Main extends MainApplet { + + public Main() { + super(); + } + + public void init() { + rene.gui.Global.DetectDesktopSize(); + Global.initBundles(); + + Global.initProperties(); + eric.JGlobalPreferences.initPreferences(); + ScriptThread.InitContextFactory(); +// Global.FirstRun(); + JPropertiesBar.CreatePropertiesBar(); + super.init(); + + } + + public void start() { + SwingUtilities.invokeLater(new Runnable() { + public void run() { + PaletteManager.init(); + } + }); + super.start(); + } + + static public void main(final String[] args) { + final int PORT=32145; + int i=0; + String filename=""; + + + while (iFkv(p*TkN8w$-*G~ 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 Zj(@#(=V88S0tpJ@>2LhKWbESW{{i`dA~pa3 literal 0 HcmV?d00001 diff --git a/atp/Des14.gif b/atp/Des14.gif new file mode 100644 index 0000000000000000000000000000000000000000..013e4e176fa0a7a999a75e0f03e5dbedb453163b GIT binary patch literal 6762 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 N!#{?-q;2B6{{aJIL@)pV literal 0 HcmV?d00001 diff --git a/atp/Des8.gif b/atp/Des8.gif new file mode 100644 index 0000000000000000000000000000000000000000..f1a2cfb5fc9bd0d858031691396fc1af091c75e7 GIT binary patch literal 6762 zcmai&zmDV96^CiZD~Xb3yfeESAbx=WDYi-<*jOZ3W05R2HV_~cN8(6alOjhXN3$+m z_yt^~%>&qgi&W`cxl5H7$O{BWoi@KuGbh7yNsa~FM)$|_?|%2(OMd^K=+WVWD2je) zqBzOZYWsYXUDo^P{B3fbJWmeI^Ec_LNp_n&{qb*aAAR(Xx6S*}2QQ<^HqAEM=A|Cb z*3I^1^xloeyPHb3W*QTXAE6)u zr{H-!@%v>H&6BFymp4vA5E$b3>n55eb<>+C6n-D$q<&XaPJsin@cSm3U8IfAgcvQ8 zKR40hBHOI8{mL0Zv(VtTZK5aAH2dtB(YieBoEB&1ux+BVjQTpVF$}D}O z`dpNUCi5jEJ1g>EW#W^de%%s(hlw`NQ}2ZmTM7Rz6RV^jrPb$06>zlJ8UMKbT+9_=7pb)W(^-oxV+I6pDz(&QeB5LDxng`ed z24z7ZY?m)ke3JQ$4Sq!8cCpTqqTH=rz!4U@P%BW{`;C z*=3&iU4Ve&009tRmiuHNV`NAK@#42-yUzm9Nf-#x2;=xt_4nzr+I7qh!O#-jDVK=g{}#nGak1n#Ogdxii@?EV1$7Y!FuxQC<$3aK}Ass z*u|@)%9E7`vTI4a#(A%Izptk$3|55fB)Ih$u}q8DMV=<>x+z`V4H7hh_GBC-RtJ^X zef-LR3-h8lRzflS1asSDUzIuw!fnlJnNdjYXoKU@;J`g3qkMp5Gb)mw5$U~jC|p|x zfj!Mf_B@WcPUKsEqIH)@Tu*}bM>Q-ML4Bq^uAAxDUVSR{XBxu$>8q}CDC#G7Vxj(X zGkc$BZ;8#exc`OOzLyU6JBw&~c`uV_hp9RK(_Qa%U zUB*n=G`Ejka*_K^fqe!B#Q$QKG_6ihX9fSzk4EG#b~+P=?k83Xt{uD7A3W?civ-Ab z0p!eCp7icr|H^ES!}!kUNf9YF5sLA}?l2x;=~T5s2Zq zEYgjyrp19m%r5_cA_U8*Kt%s8i)`2SSKUJS7*AFHfC4(pI@jHNG#}A9FPp4L$NdP< zWtDJyO8xSacC10Xba089EI@={Ens0ftJ1xHtzz-a2>0YFcqd}*&45Uqzusm;bu)=j zom3u?ZtX>B{JLiV|M(#hE*Mqe>V<8>WLk*Ms(tETi@Q09(K&(uW6WEc+%c-XYVN#X zgw22#p(-z>ZwizfGhb?|fv*U|x8h-nUs7C~L;qgiMH@z4`ymFkF0$SwJH7>Cxa%9qO1B zvFBa!$f=H0;66J_JC^{zUnq;kD~cEO1Dz0yB6+EItNsSJ&W}he$2FrCIRGY>sR&|pMN%S{m=4Q!?W>AJ{*E1ta?VM9ot)K#)h zd+!V+gq^==i0in%3O~It%Q~ar_AEuPT3v;}Ue;H&zKjGfuZ9X{xHy<7$cuOw$b|UO zR`rlAaelOg=mA^8eOBxB#;p~XWD1EhdhtluRv&uttz^KFiA46SZdb!S3P<8uj#gtm z3JI;aZaoq-ARuR+R$RA(Ww9`XuVNi3iix;3)DIlW_~P2oB>jWkkPyCcvkgBY0Jl|E z053m75$*y+4BWtQ|0L`x#PB5OxYnq?l>xy!ZA!med7NCC7rIOPTL!MkX6zz<#TSO=_#-_y@;HDR48 zfjJYyAGX!-*DPF`IU4lm_qxy|ThvSn=(z1&g_t#CG-a_k__4|~Vp{PZHK8+1nKN;H zdY$aYK7E-rkv*3zyw5OgmIQW;#2?ZuFv)$ZA+#|vc8Vf_ZAtpa0Pr&qiETu~yTl?E z-tjeGavezoi{b|j+VgeqMW3EP&?vZdT&MjzgIVBud`Q>9*R8G(E*%HIiFg=-a3Gi` o2j4>}7AGRpB6)J->&dja7sm0QdUqadn|(n%`!eh$T@%~?0S!taUjP6A literal 0 HcmV?d00001 diff --git a/atp/Fonts10.gif b/atp/Fonts10.gif new file mode 100644 index 0000000000000000000000000000000000000000..b1977735abcb1b96a06932dd54115b66c7dd4880 GIT binary patch literal 5150 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 MPU)47y#)XOJ2LMZ-2eap literal 0 HcmV?d00001 diff --git a/atp/Fonts12.gif b/atp/Fonts12.gif new file mode 100644 index 0000000000000000000000000000000000000000..964aabcb29a340a04cfddff9712dbdf139d18114 GIT binary patch literal 7097 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 literal 0 HcmV?d00001 diff --git a/atp/Fonts14.gif b/atp/Fonts14.gif new file mode 100644 index 0000000000000000000000000000000000000000..81a36e054342f65380fd5d553adb47816e71daf3 GIT binary patch literal 8721 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 literal 0 HcmV?d00001 diff --git a/atp/Fonts18.gif b/atp/Fonts18.gif new file mode 100644 index 0000000000000000000000000000000000000000..0bb1319e37aae80723e8b327f0438ad5ec1b658b GIT binary patch literal 12843 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 J&uJC_06YJgR4f1h literal 0 HcmV?d00001 diff --git a/atp/Fonts8.gif b/atp/Fonts8.gif new file mode 100644 index 0000000000000000000000000000000000000000..12f3869be30dd613641ac140bbb61a107d0aadfc GIT binary patch literal 3793 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. + */ + +package atp; + +import java.awt.Color; +import java.awt.image.RGBImageFilter; + +class a extends RGBImageFilter { + + Color a; + boolean _fldif; + + a(final Color color) { + _fldif = false; + a = color; + _fldif = false; + super.canFilterIndexColorModel = true; + } + + a(final Color color, final boolean flag) { + _fldif = false; + a = color; + _fldif = flag; + super.canFilterIndexColorModel = true; + } + + @Override + public int filterRGB(final int i, final int j, final int k) { + if (_fldif) { + return 0x1fff0000; + } + final int l = k & 0xffffff; + if (l == 0xffffff) { + return l; + } else { + return 0xff000000 | a.getRGB(); + } + } +} diff --git a/atp/b.java b/atp/b.java new file mode 100644 index 0000000..3e5b63b --- /dev/null +++ b/atp/b.java @@ -0,0 +1,1129 @@ +/***************************************************************************** + * * + * HotEqn Equation Viewer Basic Applet * + * * + ****************************************************************************** + * Java Applet to view mathematical Equations provided in the LaTeX language * + ****************************************************************************** + +Copyright 2006 Stefan Müller and Christian Schmid, modified by Rene Grothmann + +This file is part of the HotEqn package. + + HotEqn is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; + HotEqn is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +package atp; + +import java.util.Vector; + +// Referenced classes of package atp: +// e + +class b { + + private String _fldelse; + private int _fldcase; + private int _flddo; + private boolean _fldbyte; + private final Vector _fldfor; + private boolean _fldchar; + private boolean a; + private int _fldnew; + private int _fldint; + private StringBuffer _fldif; + + public static char TranslationC[] = { '\u03B1', '\u0391', '\u03B2', + '\u0392', '\u03B3', '\u0393', '\u03B4', '\u0394', '\u03B5', + '\u0395', '\u03D5', '\u03A6', '\u03C6', '\u03B3', '\u0393', + '\u03B7', '\u0397', '\u03B9', '\u0399', '\u03BA', '\u039A', + '\u03BB', '\u039B', '\u03BC', '\u039C', '\u03BD', '\u039D', + '\u03BF', '\u03A9', '\u03C0', '\u03A0', '\u03C7', '\u03A7', + '\u03C1', '\u03A1', '\u03C3', '\u03A3', '\u03C4', '\u03A4', + '\u03C5', '\u03A5', '\u03C8', '\u03A8', '\u03C9', '\u03A9', + '\u03BE', '\u039E', '\u03C7', '\u03A7', '\u03B6', '\u0396', + '\u03B8', '\u0398', '$', '%', '&', 'ß', '\u00A9', '\u00AE', + '\u2030', '\u00BD', '\u2153', '\u00BC', '\u00BE', '\u2154', + '\u00B1', '\u2202', '\u2206', '\u221E', }; + + public String TranslationS[] = { "alpha", "Alpha", "beta", "Beta", "gamma", + "Gamma", "delta", "Delta", "epsilon", "Epsilon", "phi", "Phi", + "varphi", "gamma", "Gamma", "eta", "Eta", "iota", "I", "kappa", + "Kappa", "lambda", "Lambda", "mu", "Mu", "nu", "Nu", "omikron", + "Omikron", "pi", "Pi", "chi", "Chi", "rho", "Rho", "sigma", + "Sigma", "tau", "Tau", "uu", "Uu", "psi", "Psi", "omega", "Omega", + "chi", "Chi", "ypsilon", "Ypsilon", "zeta", "Zeta", "theta", + "Theta", "dollar", "percent", "ampersand", "paragraph", + "copyright", "trademark", "promille", "half", "third", "quarter", + "threequarters", "twothirds", "pm", "partial", "deltaop", "infty", }; + + public b(final String s) { + + _fldbyte = false; + _fldfor = new Vector(50, 50); + _fldchar = false; + a = false; + _fldnew = 0; + _fldint = 0; + _fldif = new StringBuffer(""); + new e(99); + a(s); + } + + public String a(final int i, final int j) { + _fldnew = Math.min(i, j); + _fldint = Math.max(i, j); + _fldchar = true; + _fldif = new StringBuffer(""); + a(_fldelse); + _fldchar = false; + return _fldif.toString(); + } + + public void a(final String s) { + _fldelse = s; + int i = 0; + _fldbyte = false; + _flddo = -1; + _fldcase = -1; + _fldfor.removeAllElements(); + a(); + while (!_fldbyte) { + _flddo++; + if (_fldchar && _flddo == _fldnew) { + a = true; + } + _fldfor.addElement(_mthtry()); + + if (_fldchar && _flddo == _fldint) { + a = false; + } + } + _flddo = -1; + for (; i < _fldfor.size(); i++) { + if (((e) _fldfor.elementAt(i)).y == 114) { + int k = i - 1; + int j1 = 0; + for (; k > 0; k--) { + if (((e) _fldfor.elementAt(k)).y == 4) { + j1--; + } else if (((e) _fldfor.elementAt(k)).y == 3) { + j1++; + } + if (j1 == 1) { + break; + } + } + + int i2 = i + 1; + j1 = 0; + for (; i2 < _fldfor.size(); i2++) { + if (((e) _fldfor.elementAt(i2)).y == 4) { + j1++; + } else if (((e) _fldfor.elementAt(i2)).y == 3) { + j1--; + } + if (j1 == 1) { + break; + } + } + + if (j1 == 1 && k >= 0) { + _fldfor.insertElementAt(new e(109, ")"), i2 + 1); + _fldfor.insertElementAt(new e(17), i2 + 1); + _fldfor.setElementAt(new e(4), i); + _fldfor.insertElementAt(new e(3), i + 1); + _fldfor.insertElementAt(new e(115), k); + _fldfor.insertElementAt(new e(109, "("), k); + _fldfor.insertElementAt(new e(16), k); + i += 4; + } + } else if (((e) _fldfor.elementAt(i)).y == 115) { + int l = i - 1; + int k1 = 0; + for (; l > 0; l--) { + if (((e) _fldfor.elementAt(l)).y == 4) { + k1--; + } else if (((e) _fldfor.elementAt(l)).y == 3) { + k1++; + } + if (k1 == 1) { + break; + } + } + + if (l >= 0) { + _fldfor.setElementAt(new e(4), i); + _fldfor.insertElementAt(new e(3), i + 1); + _fldfor.insertElementAt(new e(115), l); + i += 2; + } + } + } + + for (int j = 0; j < _fldfor.size() - 2; j++) { + if (((e) _fldfor.elementAt(j)).y == 13 + && ((e) _fldfor.elementAt(j + 1)).y == 109) { + int i1 = j + 2; + int l1 = 0; + int j2 = 1; + for (; i1 < _fldfor.size(); i1++) { + if (((e) _fldfor.elementAt(i1)).y == 4) { + l1--; + } else if (((e) _fldfor.elementAt(i1)).y == 3) { + l1++; + } + if (l1 != 0) { + continue; + } + if (((e) _fldfor.elementAt(i1)).w.equals("[")) { + j2++; + } else if (((e) _fldfor.elementAt(i1)).w.equals("]")) { + j2--; + } + if (j2 != 0) { + continue; + } + _fldfor.setElementAt(new e(4), i1); + break; + } + + j++; + } + } + + } + + public void _mthdo() { + _flddo = -1; + } + + public int _mthif() { + return _flddo; + } + + public void a(final int i) { + _flddo = i; + } + + public e _mthint() { + _flddo++; + if (_flddo >= _fldfor.size()) { + _flddo = _fldfor.size() - 1; + return new e(99); + } else { + return (e) _fldfor.elementAt(_flddo); + } + } + + public boolean _mthnew() { + return _flddo == _fldfor.size() - 1; + } + + private char _mthfor() { + + return _fldelse.charAt(_fldcase); + } + + private void a() { + if (a) { + _fldif.append(_fldelse.charAt(_fldcase)); + } + if (_fldcase < _fldelse.length() - 1) { + _fldcase++; + _fldbyte = false; + } else { + _fldcase = _fldelse.length(); + _fldbyte = true; + } + } + + private e _mthtry() { + + final StringBuffer stringbuffer = new StringBuffer(""); + new String(""); + new e(); + while (!_fldbyte) { + char c = _mthfor(); + switch (c) { + + case 9: // '\t' + case 10: // '\n' + case 13: // '\r' + a(); + break; + + case 32: // ' ' + a(); + return new e(25, new String(" ")); + + case 33: // '!' + case 35: // '#' + case 42: // '*' + case 43: // '+' + case 44: // ',' + case 45: // '-' + case 47: // '/' + case 58: // ':' + case 59: // ';' + case 60: // '<' + case 61: // '=' + case 62: // '>' + case 126: // '~' + a(); + return new e(108, String.valueOf(c)); + + case 123: // '{' + a(); + return new e(3); + + case 125: // '}' + a(); + return new e(4); + + case 40: // '(' + case 41: // ')' + case 91: // '[' + case 93: // ']' + case 124: // '|' + a(); + return new e(109, String.valueOf(c)); + + case 38: // '&' + a(); + return new e(7); + + case 39: // '\'' + case 64: // '@' + case 913: + case 914: + case 915: + case 916: + case 917: + case 918: + case 919: + case 920: + case 921: + case 922: + case 923: + case 924: + case 925: + case 926: + case 927: + case 928: + case 929: + case 930: + case 931: + case 932: + case 933: + case 934: + case 935: + case 936: + case 937: + case 945: + case 946: + case 947: + case 948: + case 949: + case 950: + case 951: + case 952: + case 953: + case 954: + case 955: + case 956: + case 957: + case 958: + case 959: + case 960: + case 961: + case 962: + case 963: + case 964: + case 965: + case 966: + case 967: + case 968: + case 969:// GreekLetters (unicode) + case 65: // 'A' + case 66: // 'B' + case 67: // 'C' + case 68: // 'D' + case 69: // 'E' + case 70: // 'F' + case 71: // 'G' + case 72: // 'H' + case 73: // 'I' + case 74: // 'J' + case 75: // 'K' + case 76: // 'L' + case 77: // 'M' + case 78: // 'N' + case 79: // 'O' + case 80: // 'P' + case 81: // 'Q' + case 82: // 'R' + case 83: // 'S' + case 84: // 'T' + case 85: // 'U' + case 86: // 'V' + case 87: // 'W' + case 88: // 'X' + case 89: // 'Y' + case 90: // 'Z' + case 97: // 'a' + case 98: // 'b' + case 99: // 'c' + case 100: // 'd' + case 101: // 'e' + case 102: // 'f' + case 103: // 'g' + case 104: // 'h' + case 105: // 'i' + case 106: // 'j' + case 107: // 'k' + case 108: // 'l' + case 109: // 'm' + case 110: // 'n' + case 111: // 'o' + case 112: // 'p' + case 113: // 'q' + case 114: // 'r' + case 115: // 's' + case 116: // 't' + case 117: // 'u' + case 118: // 'v' + case 119: // 'w' + case 120: // 'x' + case 121: // 'y' + case 122: // 'z' + case 37: // '%' + stringbuffer.append(c); + a(); + for (boolean flag1 = false; !_fldbyte && !flag1;) { + c = _mthfor(); + switch (c) { + + case 39: // '\'' + case 64: // '@' + case 913: + case 914: + case 915: + case 916: + case 917: + case 918: + case 919: + case 920: + case 921: + case 922: + case 923: + case 924: + case 925: + case 926: + case 927: + case 928: + case 929: + case 930: + case 931: + case 932: + case 933: + case 934: + case 935: + case 936: + case 937: + case 945: + case 946: + case 947: + case 948: + case 949: + case 950: + case 951: + case 952: + case 953: + case 954: + case 955: + case 956: + case 957: + case 958: + case 959: + case 960: + case 961: + case 962: + case 963: + case 964: + case 965: + case 966: + case 967: + case 968: + case 969:// GreekLetters (unicode) + case 65: // 'A' + case 66: // 'B' + case 67: // 'C' + case 68: // 'D' + case 69: // 'E' + case 70: // 'F' + case 71: // 'G' + case 72: // 'H' + case 73: // 'I' + case 74: // 'J' + case 75: // 'K' + case 76: // 'L' + case 77: // 'M' + case 78: // 'N' + case 79: // 'O' + case 80: // 'P' + case 81: // 'Q' + case 82: // 'R' + case 83: // 'S' + case 84: // 'T' + case 85: // 'U' + case 86: // 'V' + case 87: // 'W' + case 88: // 'X' + case 89: // 'Y' + case 90: // 'Z' + case 97: // 'a' + case 98: // 'b' + case 99: // 'c' + case 100: // 'd' + case 101: // 'e' + case 102: // 'f' + case 103: // 'g' + case 104: // 'h' + case 105: // 'i' + case 106: // 'j' + case 107: // 'k' + case 108: // 'l' + case 109: // 'm' + case 110: // 'n' + case 111: // 'o' + case 112: // 'p' + case 113: // 'q' + case 114: // 'r' + case 115: // 's' + case 116: // 't' + case 117: // 'u' + case 118: // 'v' + case 119: // 'w' + case 120: // 'x' + case 121: // 'y' + case 122: // 'z' + stringbuffer.append(c); + a(); + break; + + case 40: // '(' + case 41: // ')' + case 42: // '*' + case 43: // '+' + case 44: // ',' + case 45: // '-' + case 46: // '.' + case 47: // '/' + case 48: // '0' + case 49: // '1' + case 50: // '2' + case 51: // '3' + case 52: // '4' + case 53: // '5' + case 54: // '6' + case 55: // '7' + case 56: // '8' + case 57: // '9' + case 58: // ':' + case 59: // ';' + case 60: // '<' + case 61: // '=' + case 62: // '>' + case 63: // '?' + case 91: // '[' + case 92: // '\\' + case 93: // ']' + case 94: // '^' + case 95: // '_' + case 96: // '`' + default: + flag1 = true; + break; + } + } + + return new e(1, stringbuffer.toString()); + + case 46: // '.' + case 48: // '0' + case 49: // '1' + case 50: // '2' + case 51: // '3' + case 52: // '4' + case 53: // '5' + case 54: // '6' + case 55: // '7' + case 56: // '8' + case 57: // '9' + stringbuffer.append(c); + a(); + for (boolean flag2 = false; !_fldbyte && !flag2;) { + c = _mthfor(); + switch (c) { + case 46: // '.' + case 48: // '0' + case 49: // '1' + case 50: // '2' + case 51: // '3' + case 52: // '4' + case 53: // '5' + case 54: // '6' + case 55: // '7' + case 56: // '8' + case 57: // '9' + stringbuffer.append(c); + a(); + break; + + case 47: // '/' + default: + flag2 = true; + break; + } + } + + return new e(2, stringbuffer.toString()); + + case 92: // '\\' + a(); + if (_fldbyte) { + break; + } + c = _mthfor(); + switch (c) { + + case 92: // '\\' + a(); + return new e(8); + + case 123: // '{' + a(); + return new e(109, String.valueOf(c)); + + case 124: // '|' + a(); + return new e(109, "||"); + + case 125: // '}' + a(); + return new e(109, String.valueOf(c)); + + case 44: // ',' + a(); + return new e(113, "3"); + + case 58: // ':' + a(); + return new e(113, "4"); + + case 59: // ';' + a(); + return new e(113, "5"); + + case 33: // '!' + a(); + return new e(113, "-3"); + case 913: + case 914: + case 915: + case 916: + case 917: + case 918: + case 919: + case 920: + case 921: + case 922: + case 923: + case 924: + case 925: + case 926: + case 927: + case 928: + case 929: + case 930: + case 931: + case 932: + case 933: + case 934: + case 935: + case 936: + case 937: + case 945: + case 946: + case 947: + case 948: + case 949: + case 950: + case 951: + case 952: + case 953: + case 954: + case 955: + case 956: + case 957: + case 958: + case 959: + case 960: + case 961: + case 962: + case 963: + case 964: + case 965: + case 966: + case 967: + case 968: + case 969:// GreekLetters (unicode) + case 65: // 'A' + case 66: // 'B' + case 67: // 'C' + case 68: // 'D' + case 69: // 'E' + case 70: // 'F' + case 71: // 'G' + case 72: // 'H' + case 73: // 'I' + case 74: // 'J' + case 75: // 'K' + case 76: // 'L' + case 77: // 'M' + case 78: // 'N' + case 79: // 'O' + case 80: // 'P' + case 81: // 'Q' + case 82: // 'R' + case 83: // 'S' + case 84: // 'T' + case 85: // 'U' + case 86: // 'V' + case 87: // 'W' + case 88: // 'X' + case 89: // 'Y' + case 90: // 'Z' + case 97: // 'a' + case 98: // 'b' + case 99: // 'c' + case 100: // 'd' + case 101: // 'e' + case 102: // 'f' + case 103: // 'g' + case 104: // 'h' + case 105: // 'i' + case 106: // 'j' + case 107: // 'k' + case 108: // 'l' + case 109: // 'm' + case 110: // 'n' + case 111: // 'o' + case 112: // 'p' + case 113: // 'q' + case 114: // 'r' + case 115: // 's' + case 116: // 't' + case 117: // 'u' + case 118: // 'v' + case 119: // 'w' + case 120: // 'x' + case 121: // 'y' + case 122: // 'z' + stringbuffer.append(c); + a(); + for (boolean flag4 = false; !_fldbyte && !flag4;) { + c = _mthfor(); + switch (c) { + case 913: + case 914: + case 915: + case 916: + case 917: + case 918: + case 919: + case 920: + case 921: + case 922: + case 923: + case 924: + case 925: + case 926: + case 927: + case 928: + case 929: + case 930: + case 931: + case 932: + case 933: + case 934: + case 935: + case 936: + case 937: + case 945: + case 946: + case 947: + case 948: + case 949: + case 950: + case 951: + case 952: + case 953: + case 954: + case 955: + case 956: + case 957: + case 958: + case 959: + case 960: + case 961: + case 962: + case 963: + case 964: + case 965: + case 966: + case 967: + case 968: + case 969:// GreekLetters (unicode) + + case 65: // 'A' + case 66: // 'B' + case 67: // 'C' + case 68: // 'D' + case 69: // 'E' + case 70: // 'F' + case 71: // 'G' + case 72: // 'H' + case 73: // 'I' + case 74: // 'J' + case 75: // 'K' + case 76: // 'L' + case 77: // 'M' + case 78: // 'N' + case 79: // 'O' + case 80: // 'P' + case 81: // 'Q' + case 82: // 'R' + case 83: // 'S' + case 84: // 'T' + case 85: // 'U' + case 86: // 'V' + case 87: // 'W' + case 88: // 'X' + case 89: // 'Y' + case 90: // 'Z' + case 97: // 'a' + case 98: // 'b' + case 99: // 'c' + case 100: // 'd' + case 101: // 'e' + case 102: // 'f' + case 103: // 'g' + case 104: // 'h' + case 105: // 'i' + case 106: // 'j' + case 107: // 'k' + case 108: // 'l' + case 109: // 'm' + case 110: // 'n' + case 111: // 'o' + case 112: // 'p' + case 113: // 'q' + case 114: // 'r' + case 115: // 's' + case 116: // 't' + case 117: // 'u' + case 118: // 'v' + case 119: // 'w' + case 120: // 'x' + case 121: // 'y' + case 122: // 'z' + stringbuffer.append(c); + a(); + break; + + case 91: // '[' + case 92: // '\\' + case 93: // ']' + case 94: // '^' + case 95: // '_' + case 96: // '`' + default: + flag4 = true; + break; + } + } + + final String s1 = stringbuffer.toString(); + if (s1.equals("acute")) { + return new e(22, "\264"); + } + if (s1.equals("array")) { + return new e(15); + } + if (s1.equals("bar")) { + return new e(14, "bar"); + } + if (s1.equals("ddot")) { + return new e(22, ".."); + } + if (s1.equals("dot")) { + return new e(22, "."); + } + if (s1.equals("frac")) { + return new e(12); + } + if (s1.equals("dfrac")) { + return new e(1001); + } + if (s1.equals("grave")) { + return new e(22, "`"); + } + if (s1.equals("hat")) { + return new e(22, "^"); + } + if (s1.equals("int")) { + return new e(20, "int"); + } + if (s1.equals("oint")) { + return new e(20, "oint"); + } + if (s1.equals("left")) { + return new e(16); + } + if (s1.equals("limsup")) { + return new e(24, "lim sup"); + } + if (s1.equals("liminf")) { + return new e(24, "lim inf"); + } + if (s1.equals("prod")) { + return new e(20, "prod"); + } + if (s1.equals("right")) { + return new e(17); + } + if (s1.equals("sqrt")) { + return new e(13); + } + if (s1.equals("sum")) { + return new e(20, "sum"); + } + if (s1.equals("tilde")) { + return new e(22, "~"); + } + if (s1.equals("vec")) { + return new e(14); + } + if (s1.equals("widehat")) { + return new e(14, "widehat"); + } + if (s1.equals("widetilde")) { + return new e(14, "widetilde"); + } + if (s1.equals("quad")) { + return new e(113, "18"); + } + if (s1.equals("qquad")) { + return new e(113, "36"); + } + if (s1.equals("backslash")) { + return new e(2, "\\"); + } + if (s1.equals("langle")) { + return new e(5, "<"); + } + if (s1.equals("rangle")) { + return new e(5, ">"); + } + if (s1.equals("not")) { + return new e(110); + } + if (s1.equals("atop")) { + return new e(115); + } + if (s1.equals("choose")) { + return new e(114); + } + if (s1.equals("overline")) { + return new e(116); + } + if (s1.equals("underline")) { + return new e(117); + } + if (s1.equals("overbrace")) { + return new e(118); + } + if (s1.equals("underbrace")) { + return new e(119); + } + if (s1.equals("stackrel")) { + return new e(120); + } + if (s1.equals("begin")) { + return new e(50); + } + if (s1.equals("end")) { + return new e(51); + } + if (s1.equals("fgcolor")) { + return new e(121); + } + if (s1.equals("bgcolor")) { + return new e(122); + } + if (s1.equals("fbox")) { + return new e(123); + } + if (s1.equals("mbox")) { + return new e(124); + } + if ((" arccos arcsin arctan arg cos cosh cot coth csc def deg dim exp hom ker lg ln lo" + + "g sec sin sinh tan tanh ").indexOf(" " + s1 + + " ") >= 0) { + return new e(9, s1); + } + if (" det gcd inf lim max min Pr sup ".indexOf(" " + s1 + + " ") >= 0) { + return new e(24, s1); + } + + { + boolean found = false; + for (int i = 0; i < TranslationS.length; i++) { + if (s1.equals(TranslationS[i])) { + found = true; + c = TranslationC[i]; + break; + } + } + if (found) { + stringbuffer.append(c); + return new e(2, "" + c); + } + } + if ((" alpha delta epsilon iota kappa lambda nu omega pi sigma theta tau upsilon varep" + + "silon varpi vartheta pm mp times div cdot cdots ldots ast star amalg cap cup upl" + + "us sqcap sqcup vee wedge wr circ bullet diamond lhd rhd oslash odot Box bigtrian" + + "gleup triangleleft triangleright oplus ominus otimes ll subset sqsubset in vdash" + + " models gg supset sqsupset ni dashv perp neq doteq approx cong equiv propto prec" + + " sim simeq asymp smile frown bowtie succ aleph forall hbar exists imath neg flat" + + " ell Re angle Im backslash mho Box prime emptyset triangle nabla partial top bot" + + " Join infty vdash dashv Fourier Laplace leftarrow gets hookrightarrow leftharpoo" + + "ndown rightarrow to rightharpoondown leadsto leftrightarrow mapsto hookleftarrow" + + " leftharpoonup rightharpoonup rightleftharpoons longleftarrow longrightarrow lon" + + "gleftrightarrow longmapsto ").indexOf(" " + s1 + + " ") >= 0) { + return new e(18, s1); + } + if ((" beta chi eta gamma mu psi phi rho varrho varsigma varphi xi zeta le leq ge geq " + + "vdots ddots natural jmath bigtriangledown sharp uparrow downarrow updownarrow ne" + + "arrow searrow swarrow nwarrow succeq mid preceq parallel subseteq sqsubseteq sup" + + "seteq sqsupseteq clubsuit diamondsuit heartsuit spadesuit wp dagger ddagger setm" + + "inus unlhd unrhd bigcirc ").indexOf(" " + s1 + + " ") >= 0) { + return new e(19, s1); + } + if ((" Delta Gamma Lambda Omega Pi Phi Psi Sigma Theta Upsilon Xi Leftarrow Rightarrow" + + " Leftrightarrow Longleftarrow Longrightarrow Longleftrightarrow Diamond ") + .indexOf(" " + s1 + " ") >= 0) { + return new e(18, s1 + "Big"); + } + if (" Uparrow Downarrow Updownarrow ".indexOf(" " + s1 + + " ") >= 0) { + return new e(19, s1 + "Big"); + } + // fall through + + case 34: // '"' + case 35: // '#' + case 36: // '$' + // case 37: // '%' + case 38: // '&' + case 39: // '\'' + case 40: // '(' + case 41: // ')' + case 42: // '*' + case 43: // '+' + case 45: // '-' + case 46: // '.' + case 47: // '/' + case 48: // '0' + case 49: // '1' + case 50: // '2' + case 51: // '3' + case 52: // '4' + case 53: // '5' + case 54: // '6' + case 55: // '7' + case 56: // '8' + case 57: // '9' + case 60: // '<' + case 61: // '=' + case 62: // '>' + case 63: // '?' + case 64: // '@' + case 91: // '[' + case 93: // ']' + case 94: // '^' + case 95: // '_' + case 96: // '`' + default: + a(); + // System.out.println("Scanner invalid tag: \\" + + // stringbuffer.toString()); + return new e(100); + + } + + case 94: // '^' + a(); + return new e(10); + + case 95: // '_' + a(); + return new e(11); + + case 11: // '\013' + case 12: // '\f' + case 14: // '\016' + case 15: // '\017' + case 16: // '\020' + case 17: // '\021' + case 18: // '\022' + case 19: // '\023' + case 20: // '\024' + case 21: // '\025' + case 22: // '\026' + case 23: // '\027' + case 24: // '\030' + case 25: // '\031' + case 26: // '\032' + case 27: // '\033' + case 28: // '\034' + case 29: // '\035' + case 30: // '\036' + case 31: // '\037' + case 34: // '"' + case 36: // '$' + // case 37: // '%' + case 63: // '?' + case 96: // '`' + default: + a(); + // System.out.println("Scanner invalid character: " + c); + return new e(100); + } + } + return new e(99); + } +} diff --git a/atp/c.java b/atp/c.java new file mode 100644 index 0000000..3ff42c2 --- /dev/null +++ b/atp/c.java @@ -0,0 +1,43 @@ +/***************************************************************************** + * * + * HotEqn Equation Viewer Basic Applet * + * * + ****************************************************************************** + * Java Applet to view mathematical Equations provided in the LaTeX language * + ****************************************************************************** + +Copyright 2006 Stefan Müller and Christian Schmid, modified by Rene Grothmann + +This file is part of the HotEqn package. + + HotEqn is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; + HotEqn is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +package atp; + +class c { + + public int _flddo; + public int _fldif; + public int a; + + public c(final int i, final int j, final int k) { + _flddo = i; + _fldif = j; + a = k; + } + + public c() { + _flddo = 0; + _fldif = 0; + a = 0; + } +} \ No newline at end of file diff --git a/atp/d.java b/atp/d.java new file mode 100644 index 0000000..d79a168 --- /dev/null +++ b/atp/d.java @@ -0,0 +1,176 @@ +/***************************************************************************** + * * + * HotEqn Equation Viewer Basic Applet * + * * + ****************************************************************************** + * Java Applet to view mathematical Equations provided in the LaTeX language * + ****************************************************************************** + +Copyright 2006 Stefan Müller and Christian Schmid, modified by Rene Grothmann + +This file is part of the HotEqn package. + + HotEqn is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; + HotEqn is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +package atp; + +import java.applet.Applet; +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.Rectangle; +import java.awt.Toolkit; +import java.awt.image.CropImageFilter; +import java.awt.image.FilteredImageSource; +import java.awt.image.ImageProducer; +import java.io.BufferedInputStream; +import java.io.InputStream; +import java.io.ObjectInputStream; +import java.net.URL; +import java.util.Hashtable; +import java.util.StringTokenizer; + +// Referenced classes of package atp: +// a + +class d { + + private final ImageProducer _flddo[] = { null, null, null, null, null }; + private final String _fldif[] = { "8", "10", "12", "14", "18" }; + private final Hashtable _fldfor; + private static boolean a = true; + + public d() { + _fldfor = new Hashtable(189); + } + + public Image a(final boolean flag, final boolean flag1, final String s, + final Graphics2D g, final Applet applet) { + final StringTokenizer stringtokenizer = new StringTokenizer(s, "/"); + String s1 = stringtokenizer.nextToken(); + s1 = stringtokenizer.nextToken().substring(5); + final String s2 = stringtokenizer.nextToken(); + int i = -1; + boolean flag2 = true; + while (flag2) { + if (_fldif[++i].equals(s1)) { + flag2 = false; + } + if (i == 4) { + flag2 = false; + } + } + if (_flddo[i] == null) { + _flddo[i] = a(flag, flag1, "Fonts" + s1 + ".gif", applet); + final String s3 = "Des" + s1 + ".gif"; + BufferedInputStream bufferedinputstream = null; + try { + if (a) { + getClass().getResourceAsStream(s3); + bufferedinputstream = new BufferedInputStream(getClass() + .getResourceAsStream(s3)); + } else if ((!flag) & (!flag1)) { + bufferedinputstream = new BufferedInputStream((new URL(s3)) + .openStream()); + } else if (flag) { + bufferedinputstream = new BufferedInputStream((new URL( + applet.getCodeBase(), s3)).openStream()); + } else { + try { + bufferedinputstream = new BufferedInputStream( + getClass().getResource(s3).openStream()); + } catch (final Exception exception) { + } + } + final ObjectInputStream objectinputstream = new ObjectInputStream( + bufferedinputstream); + final int j = objectinputstream.readInt(); + for (int k = 0; k < j; k++) { + final String s4 = (String) objectinputstream.readObject(); + _fldfor.put(s1 + s4, new Rectangle( + (Rectangle) objectinputstream.readObject())); + } + + bufferedinputstream.close(); + } catch (final Exception exception1) { + // System.out.println(exception1.toString()); + _flddo[i] = null; + } + } + Image image = null; + if (_flddo[i] != null) { + final Rectangle rectangle = (Rectangle) _fldfor.get(s1 + s2); + image = Toolkit.getDefaultToolkit().createImage( + new FilteredImageSource(new FilteredImageSource(_flddo[i], + new CropImageFilter(rectangle.x, rectangle.y, + rectangle.width, rectangle.height)), new a( + g.getColor()))); + } + return image; + } + + public ImageProducer a(final boolean flag, final boolean flag1, + final String s, final Applet applet) { + ImageProducer imageproducer = null; + if (a) { + imageproducer = a(s); + } + if (imageproducer == null) { + a = false; + if ((!flag) & (!flag1)) { + imageproducer = Toolkit.getDefaultToolkit().getImage(s) + .getSource(); + } else if (flag) { + imageproducer = applet.getImage(applet.getCodeBase(), s) + .getSource(); + } else { + try { + final URL url = getClass().getResource(s); + imageproducer = (ImageProducer) url.getContent(); + } catch (final Exception exception) { + } + } + } + return imageproducer; + } + + ImageProducer a(final String s) { + ImageProducer imageproducer = null; + try { + final InputStream inputstream = getClass().getResourceAsStream(s); + int i = inputstream.available(); + byte abyte0[] = new byte[i]; + int j = 0; + for (int k = 0; k != -1;) { + k = inputstream.read(abyte0, j, i); + if (k != -1) { + j += k; + i = inputstream.available(); + final int l = j + i; + if (l > abyte0.length) { + final byte abyte1[] = (byte[]) abyte0.clone(); + abyte0 = new byte[l]; + System.arraycopy(abyte1, 0, abyte0, 0, j); + } + } + if (i == 0) { + break; + } + } + + imageproducer = Toolkit.getDefaultToolkit().createImage(abyte0) + .getSource(); + } catch (final Exception exception) { + } + return imageproducer; + } + +} diff --git a/atp/e.java b/atp/e.java new file mode 100644 index 0000000..52e99c8 --- /dev/null +++ b/atp/e.java @@ -0,0 +1,64 @@ +package atp; + +class e { + + public int y; + public String w; + public static final int k = 0; + public static final int _fldbyte = 1; + public static final int o = 2; + public static final int r = 3; + public static final int _fldlong = 4; + public static final int j = 5; + public static final int _fldelse = 7; + public static final int _fldfor = 8; + public static final int q = 9; + public static final int s = 10; + public static final int B = 11; + public static final int _fldvoid = 12; + public static final int _flddo = 13; + public static final int t = 14; + public static final int _fldchar = 15; + public static final int i = 16; + public static final int A = 17; + public static final int u = 18; + public static final int _fldcase = 19; + public static final int C = 20; + public static final int d = 22; + public static final int m = 24; + public static final int g = 25; + public static final int f = 50; + public static final int v = 51; + public static final int _fldint = 99; + public static final int p = 100; + public static final int _fldif = 108; + public static final int n = 109; + public static final int _fldnull = 110; + public static final int a = 113; + public static final int b = 114; + public static final int c = 115; + public static final int D = 116; + public static final int l = 117; + public static final int h = 118; + public static final int z = 119; + public static final int x = 120; + public static final int _fldnew = 121; + public static final int _fldtry = 122; + public static final int e = 123; + public static final int _fldgoto = 124; + + public e(final int i1, final String s1) { + y = i1; + w = s1; + } + + public e(final int i1) { + y = i1; + w = ""; + } + + public e() { + y = 0; + w = ""; + } +} diff --git a/atp/f.java b/atp/f.java new file mode 100644 index 0000000..5423b29 --- /dev/null +++ b/atp/f.java @@ -0,0 +1,134 @@ +/***************************************************************************** + * * + * HotEqn Equation Viewer Basic Applet * + * * + ****************************************************************************** + * Java Applet to view mathematical Equations provided in the LaTeX language * + ****************************************************************************** + +Copyright 2006 Stefan Müller and Christian Schmid, modified by Rene Grothmann + +This file is part of the HotEqn package. + + HotEqn is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; + HotEqn is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +package atp; + +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.Rectangle; +import java.awt.Toolkit; +import java.awt.image.CropImageFilter; +import java.awt.image.FilteredImageSource; +import java.awt.image.ImageProducer; +import java.io.BufferedInputStream; +import java.io.InputStream; +import java.io.ObjectInputStream; +import java.util.Hashtable; +import java.util.StringTokenizer; + +// Referenced classes of package atp: +// a + +class f { + + private final ImageProducer _flddo[] = { null, null, null, null, null }; + private final String _fldif[] = { "8", "10", "12", "14", "18" }; + private final Hashtable _fldfor; + + public f() { + _fldfor = new Hashtable(189); + } + + @SuppressWarnings("unchecked") + public Image a(final String s, final Graphics2D g) { + final StringTokenizer stringtokenizer = new StringTokenizer(s, "/"); + String s1 = stringtokenizer.nextToken(); + s1 = stringtokenizer.nextToken().substring(5); + final String s2 = stringtokenizer.nextToken(); + int i = -1; + boolean flag2 = true; + while (flag2) { + if (_fldif[++i].equals(s1)) { + flag2 = false; + } + if (i == 4) { + flag2 = false; + } + } + if (_flddo[i] == null) { + _flddo[i] = a("Fonts" + s1 + ".gif"); + final String s3 = "Des" + s1 + ".gif"; + BufferedInputStream bufferedinputstream = null; + try { + getClass().getResourceAsStream(s3); + bufferedinputstream = new BufferedInputStream(getClass() + .getResourceAsStream(s3)); + final ObjectInputStream objectinputstream = new ObjectInputStream( + bufferedinputstream); + final int j = objectinputstream.readInt(); + for (int k = 0; k < j; k++) { + final String s4 = (String) objectinputstream.readObject(); + _fldfor.put(s1 + s4, new Rectangle( + (Rectangle) objectinputstream.readObject())); + } + + bufferedinputstream.close(); + } catch (final Exception exception1) { + // System.out.println(exception1.toString()); + _flddo[i] = null; + } + } + Image image = null; + if (_flddo[i] != null) { + final Rectangle rectangle = (Rectangle) _fldfor.get(s1 + s2); + image = Toolkit.getDefaultToolkit().createImage( + new FilteredImageSource(new FilteredImageSource(_flddo[i], + new CropImageFilter(rectangle.x, rectangle.y, + rectangle.width, rectangle.height)), new a( + g.getColor()))); + } + return image; + } + + ImageProducer a(final String s) { + ImageProducer imageproducer = null; + try { + final InputStream inputstream = getClass().getResourceAsStream(s); + int i = inputstream.available(); + byte abyte0[] = new byte[i]; + int j = 0; + for (int k = 0; k != -1;) { + k = inputstream.read(abyte0, j, i); + if (k != -1) { + j += k; + i = inputstream.available(); + final int l = j + i; + if (l > abyte0.length) { + final byte abyte1[] = (byte[]) abyte0.clone(); + abyte0 = new byte[l]; + System.arraycopy(abyte1, 0, abyte0, 0, j); + } + } + if (i == 0) { + break; + } + } + + imageproducer = Toolkit.getDefaultToolkit().createImage(abyte0) + .getSource(); + } catch (final Exception exception) { + } + return imageproducer; + } + +} diff --git a/atp/sHotEqn.java b/atp/sHotEqn.java new file mode 100644 index 0000000..e70e310 --- /dev/null +++ b/atp/sHotEqn.java @@ -0,0 +1,2027 @@ +/***************************************************************************** + * * + * HotEqn Equation Viewer Basic Applet * + * * + ****************************************************************************** + * Java Applet to view mathematical Equations provided in the LaTeX language * + ****************************************************************************** + +Copyright 2006 Stefan Müller and Christian Schmid, modified by Rene Grothmann + +This file is part of the HotEqn package. + + HotEqn is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; + HotEqn is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +package atp; + +import java.awt.BasicStroke; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.FontMetrics; +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.MediaTracker; +import java.awt.event.ActionListener; +import java.util.Hashtable; + +import javax.swing.JComponent; + +public class sHotEqn { + + JComponent PC; // container panel + + private int width; + private int height; + private String _fldcase; + private String _fldint; + ActionListener G; + private final b S; + private e D; + private Font d; + private Font b; + private Font _fldnull; + private Font _fldlong; + private final int j[] = { 14, 12, 10, 8 }; + private final int _fldfor[] = { 3, 3, 3, 3 }; + private Image s; + private boolean Q; + private int f; + private int H; + private final boolean K; + private int g; + private String z; + private String E; + private final f _flddo; + private final MediaTracker B; + private final Hashtable w; + public boolean r; + public boolean L; + public boolean q; + private boolean A; + private boolean t; + private int _fldelse; + private int _fldchar; + private int J; + private int I; + private int a; + private int m; + private int R; + private int l; + private int F; + private boolean c; + private int p; + private int o; + + public sHotEqn(final JComponent PC) { + width = 0; + height = 0; + _fldcase = null; + _fldint = "Helvetica"; + Q = false; + f = 0; + H = 0; + K = false; + g = 0; + z = "left"; + E = "top"; + w = new Hashtable(13); + r = false; + L = false; + q = true; + A = false; + t = true; + _fldelse = 0; + _fldchar = 0; + J = 0; + I = 0; + a = 0; + m = 0; + R = 0; + l = 0; + F = 5; + c = false; + p = 0; + o = 0; + _flddo = new f(); + B = new MediaTracker(PC); + S = new b(""); + } + + public void setEquation(final String s1) { + _fldcase = s1; + S.a(s1); + Q = false; + } + + public String getEquation() { + return _fldcase; + } + + public String Status; + + public void printStatus(final String s1) { + Status = s1; + } + + private void a(final String s1) { + Status = s1; + + } + + public Image getImage() { + if (Q) { + return s; + } else { + return null; + } + } + + public void setDebug(final boolean flag) { + q = flag; + } + + public boolean isDebug() { + return q; + } + + public void setFontname(final String s1) { + _fldint = s1; + } + + public String getFontname() { + return _fldint; + } + + int i10, j10, k10, l10; + boolean bold0, fonts = false; + + public void setHAlign(final String s1) { + z = s1; + Q = false; + } + + public String getHAlign() { + return z; + } + + public void setVAlign(final String s1) { + E = s1; + Q = false; + } + + public String getVAlign() { + return E; + } + + public void setEditable(final boolean flag) { + t = flag; + } + + public boolean isEditable() { + return t; + } + + public String getSelectedArea() { + return S.a(p, o); + } + + public Dimension getPreferredSize() { + if ((width == 0) & (height == 0)) { + final Graphics2D g1 = (Graphics2D) PC.getGraphics(); + if (g1 != null) { + g1.setFont(d); + S._mthdo(); + final c c1 = _mthnew(0, 150, false, g1, 1); + if (K) { + g = 5; + } else { + g = 0; + } + f = 1 + c1._flddo + 2 * g; + H = 1 + c1._fldif + c1.a + 2 * g; + } + } + width = f; + height = H; + if (f <= 1) { + return new Dimension(100, 100); + } else { + return new Dimension(f, H); + } + } + + final int ff1 = 8, ff2 = 6; + + public Dimension getSizeof(final String s1, final Graphics2D g1) { + if (d != g1.getFont()) { + d = g1.getFont(); + final int fs = d.getSize(); + b = new Font(d.getFamily(), d.getStyle(), fs * ff1 / 10); + + _fldnull = _fldlong = new Font(d.getFamily(), d.getStyle(), fs + * ff2 / 10); + } + + S.a(s1); + final c c1 = _mthnew(0, 150, false, g1, 1); + byte byte0; + if (K) { + byte0 = 5; + } else { + byte0 = 0; + } + return new Dimension(1 + c1._flddo + 2 * byte0, 1 + c1._fldif + c1.a + + 2 * byte0); + } + + public int getAscent(final String s1, final Graphics2D g1) { + if (d != g1.getFont()) { + d = g1.getFont(); + final int fs = d.getSize(); + b = new Font(d.getFamily(), d.getStyle(), fs * ff1 / 10); + _fldnull = _fldlong = new Font(d.getFamily(), d.getStyle(), fs + * ff2 / 10); + } + + S.a(s1); + final c c1 = _mthnew(0, 150, false, g1, 1); + byte byte0; + if (K) { + byte0 = 5; + } else { + byte0 = 0; + } + return c1._fldif + byte0; + } + + public Dimension getMinimumSize() { + return getPreferredSize(); + } + + public synchronized int paint(final int cc, final int rr, final Graphics2D g2) { +// g2.setStroke(new BasicStroke(1.0f)); + if (d != g2.getFont()) { + d = g2.getFont(); + final int fs = d.getSize(); + b = new Font(d.getFamily(), d.getStyle(), fs * ff1 / 10); + _fldnull = _fldlong = new Font(d.getFamily(), d.getStyle(), fs + * ff2 / 10); + } + c c1 = new c(); + g2.setFont(d); + g = 0; + S._mthdo(); + c1 = _mthnew(cc, rr, false, g2, 1); + final int hh = c1._fldif; + c1 = new c(); + S._mthdo(); + c1 = _mthnew(cc, rr + hh, true, g2, 1); + a(" "); + if (z.equals("center")) { + } else if (z.equals("right")) { + } + if (E.equals("middle")) { + } else if (E.equals("bottom")) { + } + f = 1 + c1._flddo + 2 * g; + H = 1 + c1._fldif + c1.a + 2 * g; + if (f > width) { + } + if (H > height) { + } + Q = true; + notify(); + return c1._fldif + c1.a; + } + + private c _mthnew(final int i1, final int j1, final boolean flag, + final Graphics2D g1, final int k1) { + return _mthtry(i1, j1, flag, g1, k1, true); + } + + private c _mthtry(final int i1, final int j1, final boolean flag, + final Graphics2D g1, final int k1, final boolean flag1) { + c c1 = new c(); + final c c2 = new c(); + boolean flag2 = true; + boolean flag5 = false; + int l1 = 0; + while (!S._mthnew() && flag2) { + D = S._mthint(); + if (A && flag) { + l1 = S._mthif(); + } + boolean flag4 = false; + final int i2 = l1; + final int j2 = D.y; + switch (D.y) { + case 4: // '\004' + case 7: // '\007' + case 8: // '\b' + case 17: // '\021' + case 51: // '3' + if (c && flag) { + if (l1 > o) { + o = l1; + } + if (l1 < p) { + p = l1; + } + } + return c2; + + case 22: // '\026' + c1 = _mthbyte(i1 + c2._flddo, j1, flag, g1, k1); + break; + + case 5: // '\005' + c1 = a(i1 + c2._flddo, j1, flag, g1); + break; + + case 15: // '\017' + if (c && flag) { + flag5 = true; + } + c1 = _mthif(i1 + c2._flddo, j1, flag, g1, k1); + break; + + case 50: // '2' + if (c && flag) { + flag5 = true; + } + c1 = _mthgoto(i1 + c2._flddo, j1, flag, g1, k1); + break; + + case 3: // '\003' + c1 = _mthtry(i1 + c2._flddo, j1, flag, g1, k1, true); + break; + + case 123: // '{' + if (c && flag) { + flag5 = true; + } + c1 = _mthelse(i1 + c2._flddo, j1, flag, g1, k1); + break; + + case 1: // '\001' + c1 = _mthnew(i1 + c2._flddo, j1, flag, g1); + break; + + case 110: // 'n' + c1 = _mthtry(i1 + c2._flddo, j1, flag, g1, k1); + break; + + case 108: // 'l' + c1 = _mthint(i1 + c2._flddo, j1, flag, g1); + break; + + case 12: // '\f' + c1 = _mthfor(i1 + c2._flddo, j1, flag, g1, k1, true); + break; + + case 1001: // '\f' + c1 = _mthfor(i1 + c2._flddo, j1, flag, g1, k1 - 1, true); + break; + + case 115: // 's' + c1 = _mthfor(i1 + c2._flddo, j1, flag, g1, k1, false); + break; + + case 2: // '\002' + case 9: // '\t' + c1 = _mthif(i1 + c2._flddo, j1, flag, g1); + break; + + case 18: // '\022' + c1 = _mthif(i1 + c2._flddo, j1, flag, g1, k1, false); + break; + + case 19: // '\023' + c1 = _mthif(i1 + c2._flddo, j1, flag, g1, k1, true); + break; + + case 16: // '\020' + if (c && flag) { + flag5 = true; + } + c1 = _mthnull(i1 + c2._flddo, j1, flag, g1, k1); + break; + + case 24: // '\030' + c1 = _mthfor(i1 + c2._flddo, j1, flag, g1, k1); + break; + + case 124: // '|' + c1 = _mthdo(i1 + c2._flddo, j1, flag, g1); + break; + + case 118: // 'v' + c1 = a(i1 + c2._flddo, j1, flag, g1, k1); + break; + + case 119: // 'w' + c1 = _mthlong(i1 + c2._flddo, j1, flag, g1, k1); + break; + + case 116: // 't' + c1 = a(i1 + c2._flddo, j1, flag, g1, k1, true); + break; + + case 117: // 'u' + c1 = a(i1 + c2._flddo, j1, flag, g1, k1, false); + break; + + case 109: // 'm' + c1 = _mthtry(i1 + c2._flddo, j1, flag, g1); + break; + + case 113: // 'q' + c1 = _mthfor(i1 + c2._flddo, j1, flag, g1); + break; + + case 13: // '\r' + if (c && flag) { + flag5 = true; + } + c1 = _mthcase(i1 + c2._flddo, j1, flag, g1, k1); + break; + + case 120: // 'x' + c1 = _mthchar(i1 + c2._flddo, j1, flag, g1, k1); + break; + + case 10: // '\n' + c1 = _mthint(i1 + c2._flddo, j1, flag, g1, k1, true); + break; + + case 11: // '\013' + c1 = _mthdo(i1 + c2._flddo, j1, flag, g1, k1, true); + break; + + case 20: // '\024' + c1 = _mthdo(i1 + c2._flddo, j1, flag, g1, k1); + break; + + case 14: // '\016' + c1 = _mthint(i1 + c2._flddo, j1, flag, g1, k1); + break; + + case 25: // '\031' + c1 = new c(0, 0, 0); + flag4 = true; + break; + + case 99: // 'c' + case 100: // 'd' + c1 = new c(0, 0, 0); + break; + + case 6: // '\006' + case 21: // '\025' + case 23: // '\027' + case 26: // '\032' + case 27: // '\033' + case 28: // '\034' + case 29: // '\035' + case 30: // '\036' + case 31: // '\037' + case 32: // ' ' + case 33: // '!' + case 34: // '"' + case 35: // '#' + case 36: // '$' + case 37: // '%' + case 38: // '&' + case 39: // '\'' + case 40: // '(' + case 41: // ')' + case 42: // '*' + case 43: // '+' + case 44: // ',' + case 45: // '-' + case 46: // '.' + case 47: // '/' + case 48: // '0' + case 49: // '1' + case 52: // '4' + case 53: // '5' + case 54: // '6' + case 55: // '7' + case 56: // '8' + case 57: // '9' + case 58: // ':' + case 59: // ';' + case 60: // '<' + case 61: // '=' + case 62: // '>' + case 63: // '?' + case 64: // '@' + case 913: + case 914: + case 915: + case 916: + case 917: + case 918: + case 919: + case 920: + case 921: + case 922: + case 923: + case 924: + case 925: + case 926: + case 927: + case 928: + case 929: + case 930: + case 931: + case 932: + case 933: + case 934: + case 935: + case 936: + case 937: + case 945: + case 946: + case 947: + case 948: + case 949: + case 950: + case 951: + case 952: + case 953: + case 954: + case 955: + case 956: + case 957: + case 958: + case 959: + case 960: + case 961: + case 962: + case 963: + case 964: + case 965: + case 966: + case 967: + case 968: + case 969:// GreekLetters (unicode) + + case 65: // 'A' + case 66: // 'B' + case 67: // 'C' + case 68: // 'D' + case 69: // 'E' + case 70: // 'F' + case 71: // 'G' + case 72: // 'H' + case 73: // 'I' + case 74: // 'J' + case 75: // 'K' + case 76: // 'L' + case 77: // 'M' + case 78: // 'N' + case 79: // 'O' + case 80: // 'P' + case 81: // 'Q' + case 82: // 'R' + case 83: // 'S' + case 84: // 'T' + case 85: // 'U' + case 86: // 'V' + case 87: // 'W' + case 88: // 'X' + case 89: // 'Y' + case 90: // 'Z' + case 91: // '[' + case 92: // '\\' + case 93: // ']' + case 94: // '^' + case 95: // '_' + case 96: // '`' + case 97: // 'a' + case 98: // 'b' + case 101:// 'e' + case 102: // 'f' + case 103: // 'g' + case 104: // 'h' + case 105: // 'i' + case 106: // 'j' + case 107: // 'k' + case 111: // 'o' + case 112: // 'p' + case 114: // 'r' + default: + printStatus("Parser: unknown token: " + D.y + " " + D.w); + break; + } + if (flag) { + if (A) { + if (!c && i1 + c2._flddo <= _fldelse + && _fldelse <= i1 + c2._flddo + c1._flddo + && j1 - c1._fldif <= _fldchar + && _fldchar <= j1 + c1.a) { + m = l = _fldelse; + a = R = _fldchar; + c = true; + p = l1; + o = l1; + } + if (!c && i1 + c2._flddo <= J + && J <= i1 + c2._flddo + c1._flddo + && j1 - c1._fldif <= I && I <= j1 + c1.a) { + m = l = J; + a = R = I; + c = true; + p = l1; + o = l1; + final int k2 = J; + final int l2 = I; + J = _fldelse; + I = _fldchar; + _fldelse = k2; + _fldchar = l2; + } + if (c) { + m = Math.min(m, i1 + c2._flddo); + l = Math.max(l, i1 + c2._flddo + c1._flddo); + a = Math.min(a, j1 - c1._fldif); + R = Math.max(R, j1 + c1.a); + if (F > k1) { + F = k1; + } + switch (j2) { + case 13: // '\r' + case 15: // '\017' + case 16: // '\020' + case 50: // '2' + case 123: // '{' + case 124: // '|' + flag5 = true; + if (i2 > o) { + o = i2; + } + if (i2 < p) { + p = i2; + } + l1 = S._mthif(); + break; + } + if (l1 > o) { + o = l1; + } + if (l1 < p) { + p = l1; + } + if (i1 + c2._flddo <= J + && J <= i1 + c2._flddo + c1._flddo + && j1 - c1._fldif <= I && I <= j1 + c1.a + && F == k1) { + A = false; + c = false; + } + } + } + if (flag5) { + m = Math.min(m, i1 + c2._flddo); + l = Math.max(l, i1 + c2._flddo + c1._flddo); + a = Math.min(a, j1 - c1._fldif); + R = Math.max(R, j1 + c1.a); + switch (j2) { + case 13: // '\r' + case 15: // '\017' + case 16: // '\020' + case 50: // '2' + case 123: // '{' + case 124: // '|' + if (i2 > o) { + o = i2; + } + if (i2 < p) { + p = i2; + } + l1 = S._mthif(); + break; + } + if (l1 > o) { + o = l1; + } + if (l1 < p) { + p = l1; + } + flag5 = false; + } + } + c2._flddo += c1._flddo; + c2._fldif = Math.max(c2._fldif, c1._fldif); + c2.a = Math.max(c2.a, c1.a); + if (!flag1 && !flag4) { + flag2 = false; + } + } + return c2; + } + + private c _mthbyte(final int i1, final int j1, final boolean flag, + final Graphics2D g1, final int k1) { + c c1 = new c(); + int l1 = 0; + final FontMetrics fontmetrics = g1.getFontMetrics(); + final String s1 = D.w; + if (flag) { + l1 = S._mthif(); + } + c1 = _mthtry(i1, j1, false, g1, k1, false); + final int i2 = Math.max(c1._flddo, fontmetrics.stringWidth(s1)); + final int j2 = c1._fldif + fontmetrics.getAscent() / 2; + final int k2 = c1.a; + if (flag) { + S.a(l1); + _mthtry(i1, j1, true, g1, k1, false); + final int l2 = 3 * ((i2 - fontmetrics.stringWidth(s1)) / 4); + if (s1.equals(".") | s1.equals("..")) { + g1.drawString(s1, i1 + l2, j1 - fontmetrics.getAscent()); + } else if (s1.equals("\264") | s1.equals("`")) { + g1.drawString(s1, i1 + l2, j1 - fontmetrics.getAscent() / 3); + } else { + g1.drawString(s1, i1 + l2, j1 - (fontmetrics.getAscent() * 2) + / 3); + } + } + return new c(i2, j2, k2); + } + + private c a(final int i1, final int j1, final boolean flag, + final Graphics2D g1) { + new c(); + final FontMetrics fontmetrics = g1.getFontMetrics(); + final int k1 = g1.getFont().getSize() / 2; + final int l1 = fontmetrics.getHeight() - fontmetrics.getDescent(); + final int i2 = fontmetrics.getDescent(); + if (flag) { + final int j2 = (j1 - l1) + 1; + final int k2 = (j1 + i2) - 1; + final int l2 = (j2 + k2) / 2; + if (D.w.equals("<")) { + g1.drawLine(i1 + k1, j2, i1, l2); + g1.drawLine(i1, l2, i1 + k1, k2); + } else { + g1.drawLine(i1, j2, i1 + k1, l2); + g1.drawLine(i1 + k1, l2, i1, k2); + } + } + return new c(k1, l1, i2); + } + + private c _mthif(final int i1, final int j1, final boolean flag, + final Graphics2D g1, final int k1) { + int l2 = 0; + final int ai[] = new int[100]; + final int ai1[] = new int[100]; + final int ai2[] = new int[100]; + new c(); + int i3 = 0; + final FontMetrics fontmetrics = g1.getFontMetrics(); + final int j3 = g1.getFont().getSize(); + if (flag) { + i3 = S._mthif(); + } + if (!a(3, "ARRAY: BeginSym")) { + return new c(0, 0, 0); + } + for (int k3 = 0; k3 < 99; k3++) { + int i2 = 0; + int k2 = 0; + for (int l3 = 0; l3 < 99; l3++) { + final c c2 = _mthnew(i1, j1, false, g1, k1); + i2 = Math.max(i2, c2._fldif); + k2 = Math.max(k2, c2.a); + ai[l3] = Math.max(ai[l3], c2._flddo + j3); + if (D.y == 8 || D.y == 4) { + break; + } + } + + ai1[k3] = Math.max(ai1[k3], i2); + ai2[k3] = Math.max(ai2[k3], k2); + l2 += i2 + k2; + if (D.y == 4) { + break; + } + } + + int i4 = 0; + for (int j4 = 0; j4 < 99; j4++) { + i4 += ai[j4]; + } + + if (flag) { + S.a(i3); + a(3, "ARRAY: Begin"); + int j2 = 0; + for (int k4 = 0; k4 < 99; k4++) { + int l1 = 0; + if (k4 == 0) { + j2 = ai1[k4]; + } else { + j2 += ai2[k4 - 1] + ai1[k4]; + } + for (int l4 = 0; l4 < 99; l4++) { + _mthnew(i1 + l1, (j1 - l2 / 2 - fontmetrics.getDescent()) + + j2, true, g1, k1); + l1 += ai[l4]; + if (D.y == 8 || D.y == 4) { + break; + } + } + + if (D.y == 4) { + break; + } + } + + } + return new c(i4 - j3, l2 / 2 + fontmetrics.getDescent(), l2 / 2 + - fontmetrics.getDescent()); + } + + private c _mthgoto(final int i1, final int j1, final boolean flag, + final Graphics2D g1, final int k1) { + int i2 = 0; + int j3 = 0; + final int ai[] = new int[100]; + final int ai1[] = new int[100]; + final int ai2[] = new int[100]; + final int ai3[] = new int[100]; + final int ai4[] = new int[100]; + int k3 = 0; + int l3 = 0; + int i4 = 0; + new c(); + int j4 = 0; + final FontMetrics fontmetrics = g1.getFontMetrics(); + final int k5 = g1.getFont().getSize(); + int l5 = 0; + boolean flag3 = false; + boolean flag4 = true; + boolean flag5 = true; + if (!a(3)) { + return new c(0, 0, 0); + } + if (S._mthint().w.equals("eqnarray")) { + flag5 = false; + } + if (!a(4, "BEGIN: EndSym")) { + return new c(0, 0, 0); + } + if (flag5) { + j4 = S._mthif(); + if (!a(3)) { + flag4 = false; + S.a(j4); + } + } + if (flag5 && flag4) { + new e(); + for (e e2 = S._mthint(); e2.y != 4; e2 = S._mthint()) { + final StringBuffer stringbuffer = new StringBuffer(e2.w); + for (int i7 = 0; i7 < stringbuffer.length(); i7++) { + switch (stringbuffer.charAt(i7)) { + case 108: // 'l' + ai3[l5] = 1; + if (l5 < 99) { + l5++; + } + break; + + case 99: // 'c' + ai3[l5] = 2; + if (l5 < 99) { + l5++; + } + break; + + case 114: // 'r' + ai3[l5] = 3; + if (l5 < 99) { + l5++; + } + break; + + case 64: // '@' + ai3[l5] = 4; + ai4[l5] = S._mthif(); + final c c2 = _mthtry(i1, j1, false, g1, k1, false); + k3 += c2._flddo; + l3 = Math.max(l3, c2._fldif); + i4 = Math.max(i4, c2.a); + if (l5 < 99) { + l5++; + } + break; + + case 42: // '*' + a(3, "Begin *{"); + int j6; + try { + j6 = Integer.parseInt(S._mthint().w); + } catch (final NumberFormatException numberformatexception) { + j6 = 0; + } + a(4, 3, "Begin }{"); + final int l7 = S._mthif(); + for (int j8 = 0; j8 < j6; j8++) { + S.a(l7); + for (e2 = S._mthint(); e2.y != 4; e2 = S._mthint()) { + final StringBuffer stringbuffer1 = new StringBuffer( + e2.w); + for (int l8 = 0; l8 < stringbuffer1.length(); l8++) { + switch (stringbuffer1.charAt(l8)) { + case 108: // 'l' + ai3[l5] = 1; + if (l5 < 99) { + l5++; + } + break; + + case 99: // 'c' + ai3[l5] = 2; + if (l5 < 99) { + l5++; + } + break; + + case 114: // 'r' + ai3[l5] = 3; + if (l5 < 99) { + l5++; + } + break; + + case 64: // '@' + ai3[l5] = 4; + ai4[l5] = S._mthif(); + final c c3 = _mthtry(i1, j1, false, g1, + k1, false); + k3 += c3._flddo; + l3 = Math.max(l3, c3._fldif); + i4 = Math.max(i4, c3.a); + if (l5 < 99) { + l5++; + } + break; + + default: + printStatus("P: begin: illegal format 2"); + break; + } + } + + } + + } + + break; + + default: + printStatus("P: begin: illegal format 1"); + break; + } + } + + } + + } + if (!flag5) { + ai3[0] = 3; + ai3[1] = 2; + ai3[2] = 1; + l5 = 3; + } + for (int k6 = 0; k6 < l5 - 1; k6++) { + if (ai3[k6] != 4 && ai3[k6 + 1] != 4) { + i2 += k5 / 2; + } + } + + if (flag) { + j4 = S._mthif(); + } + for (int l6 = 0; l6 < 99; l6++) { + int j2 = 0; + int l2 = 0; + for (int j7 = 0; j7 < 99; j7++) { + final c c4 = _mthnew(i1, j1, false, g1, k1); + j2 = Math.max(j2, c4._fldif); + l2 = Math.max(l2, c4.a); + ai[j7] = Math.max(ai[j7], c4._flddo); + if (D.y == 8 || D.y == 51) { + break; + } + } + + j2 = Math.max(j2, l3); + l2 = Math.max(l2, i4); + ai1[l6] = j2; + ai2[l6] = l2; + j3 += j2 + l2; + if (D.y == 51) { + break; + } + } + + for (int i6 = 0; i6 < 99; i6++) { + i2 += ai[i6]; + } + + i2 += (2 * k5) / 2; + if (flag) { + S.a(j4); + int k2 = 0; + final int i3 = j3 / 2 + fontmetrics.getDescent(); + for (int k7 = 0; k7 < 99; k7++) { + int l1 = k5 / 2; + if (k7 == 0) { + k2 = ai1[k7]; + } else { + k2 += ai2[k7 - 1] + ai1[k7]; + } + int i8 = 0; + for (int k8 = 0; k8 < 99; k8++) { + while (ai3[i8] == 4) { + final int k4 = S._mthif(); + S.a(ai4[i8]); + final c c5 = _mthtry(i1 + l1, (j1 - i3) + k2, true, g1, + k1, false); + l1 += c5._flddo; + S.a(k4); + i8++; + } + switch (ai3[i8]) { + case 0: // '\0' + case 1: // '\001' + _mthnew(i1 + l1, (j1 - i3) + k2, true, g1, k1); + i8++; + break; + + case 2: // '\002' + final int l4 = S._mthif(); + c c7 = _mthnew(i1, j1, false, g1, k1); + S.a(l4); + c7 = _mthnew(i1 + l1 + (ai[k8] - c7._flddo) / 2, + (j1 - i3) + k2, true, g1, k1); + i8++; + break; + + case 3: // '\003' + final int i5 = S._mthif(); + c c8 = _mthnew(i1, j1, false, g1, k1); + S.a(i5); + c8 = _mthnew((i1 + l1 + ai[k8]) - c8._flddo, (j1 - i3) + + k2, true, g1, k1); + i8++; + break; + } + if (ai3[i8] != 4) { + l1 += k5 / 2; + } + l1 += ai[k8]; + boolean flag2 = false; + flag3 = false; + if (D.y == 8) { + flag2 = true; + } else if (D.y == 51) { + flag2 = true; + flag3 = true; + } + for (; ai3[i8] == 4; i8++) { + final int j5 = S._mthif(); + S.a(ai4[i8]); + final c c9 = _mthtry(i1 + l1, (j1 - i3) + k2, true, g1, + k1, false); + l1 += c9._flddo; + S.a(j5); + } + + if (flag2) { + break; + } + } + + if (flag3) { + break; + } + } + + } + if (!a(3, "BEGIN 2: begin")) { + return new c(0, 0, 0); + } + S._mthint(); + if (!a(4, "BEGIN 2: end")) { + return new c(0, 0, 0); + } else { + return new c(i2 + k3, j3 / 2 + fontmetrics.getDescent(), j3 / 2 + - fontmetrics.getDescent()); + } + } + + private c _mthelse(final int i1, final int j1, final boolean flag, + final Graphics2D g1, final int k1) { + c c1 = new c(); + final int l1 = g1.getFont().getSize() / 2; + c1 = _mthtry(i1 + l1, j1, flag, g1, k1, false); + if (flag) { + g1.drawRect(i1 + l1 / 2, j1 - c1._fldif - l1 / 2, c1._flddo + l1, + c1._fldif + c1.a + l1); + } + return new c(c1._flddo + l1 + l1, c1._fldif + l1, c1.a + l1); + } + + private c _mthfor(final int i1, final int j1, final boolean flag, + final Graphics2D g1, final int k1, final boolean flag1) { + int l1 = 0; + new c(); + c c3 = new c(); + c c4 = new c(); + int i2 = 0; + final Font font = g1.getFont(); + font.getSize(); + a(g1, k1 + 1); + final FontMetrics fontmetrics = g1.getFontMetrics(); + if (flag) { + i2 = S._mthif(); + } + c3 = _mthtry(i1, j1, false, g1, k1 + 1, false); + int k2 = c3._fldif + c3.a; + c4 = _mthtry(i1, j1, false, g1, k1 + 1, false); + int l2 = Math.max(c3._flddo, c4._flddo); + int i3 = c4._fldif + c4.a; + final Font font1 = g1.getFont(); + final int j3 = (3 * font1.getSize()) / 18; + l2 += 2 * j3; + if (fontmetrics.getAscent() < i3) { + l1 = fontmetrics.getAscent() / 2; + } + k2 += 2 + l1; + i3 += 1 - l1; + if (flag) { + S.a(i2); + if (flag1) { + g1.drawLine(i1 + j3, j1 - l1, (i1 + l2) - j3, j1 - l1); + } + _mthtry(i1 + (l2 - c3._flddo) / 2, j1 - 2 - c3.a - l1, true, g1, + k1 + 1, false); + if (c && k1 < F) { + F = k1; + } + _mthtry(i1 + (l2 - c4._flddo) / 2, (j1 + 1 + c4._fldif) - l1, true, + g1, k1 + 1, false); + } + a(g1, k1); + return new c(l2, k2, i3); + } + + private c _mthnew(final int i1, final int j1, final boolean flag, + final Graphics2D g1) { + final FontMetrics fontmetrics = g1.getFontMetrics(); + if (flag) { + g1.drawString(D.w, i1, j1); + // System.out.println(g1.getFont()); + // System.out.println("5: "+D.w); + } + final int k1 = fontmetrics.stringWidth(D.w); + final int l1 = fontmetrics.getHeight() - fontmetrics.getDescent(); + final int i2 = fontmetrics.getDescent(); + return new c(k1, l1, i2); + } + + private void a(final Graphics2D g1, final int i1, final int j1, final int k1, + final int l1, final int i2) { + g1.drawArc(i1 - k1, j1 - k1, 2 * k1, 2 * k1, l1, i2); + } + + private void a(final Graphics2D g1, final String s1, final int i1, + final int j1, final int k1, final int l1, final int i2, final int j2) { + final int k2 = j1 / 2; + final int l2 = i1 + k2; + final int i3 = i1 + j1; + final int j3 = i1 + k2 / 2; + final int k3 = l2 + k2 / 2; + final int l3 = (k1 + l1) / 2; + final int i4 = (int) ((double) k2 * 0.86602540378444004D); + final int j4 = k1 + i4; + final int k4 = l1 - i4; + if (s1.equals("[")) { + g1.drawLine(j3, k1, j3, l1); + g1.drawLine(j3, l1, k3, l1); + g1.drawLine(j3, k1, k3, k1); + } else if (s1.equals("]")) { + g1.drawLine(k3, k1, k3, l1); + g1.drawLine(j3, l1, k3, l1); + g1.drawLine(j3, k1, k3, k1); + } else if (s1.equals("|")) { + g1.drawLine(l2, k1, l2, l1); + } else if (s1.equals("||")) { + final int l4 = l2 + i2 / 4; + g1.drawLine(l2, k1, l2, l1); + g1.drawLine(l4, k1, l4, l1); + } else if (s1.equals("(")) { + for (int i5 = j2; i5 < 2 + j2; i5++) { + final int i6 = j3 + i5; + a(g1, k3 + i5, j4, k2, 180, -60); + g1.drawLine(i6, j4, i6, k4); + a(g1, k3 + i5, k4, k2, 180, 60); + } + + } else if (s1.equals(")")) { + for (int j5 = j2; j5 < 2 + j2; j5++) { + final int j6 = k3 + j5; + a(g1, j3 + j5, j4, k2, 0, 60); + g1.drawLine(j6, j4, j6, k4); + a(g1, j3 + j5, k4, k2, 0, -60); + } + + } else if (s1.equals("<")) { + g1.drawLine(j3, l3, k3, k1); + g1.drawLine(j3, l3, k3, l1); + } else if (s1.equals(">")) { + g1.drawLine(k3, l3, j3, k1); + g1.drawLine(k3, l3, j3, l1); + } else if (s1.equals("{")) { + for (int k5 = j2; k5 < 2 + j2; k5++) { + final int k6 = l2 + k5; + a(g1, i3 + k5, j4, k2, 180, -60); + g1.drawLine(k6, j4, k6, l3 - k2); + a(g1, i1 + k5, l3 - k2, k2, 0, -90); + a(g1, i1 + k5, l3 + k2, k2, 0, 90); + g1.drawLine(k6, l3 + k2, k6, k4); + a(g1, i3 + k5, k4, k2, 180, 60); + } + + } else if (s1.equals("}")) { + for (int l5 = j2; l5 < 2 + j2; l5++) { + final int l6 = l2 + l5; + a(g1, i1 + l5, j4, k2, 0, 60); + g1.drawLine(l6, j4, l6, l3 - k2); + a(g1, i3 + l5, l3 - k2, k2, -180, 90); + a(g1, i3 + l5, l3 + k2, k2, 180, -90); + g1.drawLine(l6, l3 + k2, l6, k4); + a(g1, i1 + l5, k4, k2, 0, -60); + } + + } + } + + private c _mthnull(final int i1, final int j1, final boolean flag, + final Graphics2D g1, final int k1) { + int l1 = 0; + int i2 = 0; + c c1 = new c(); + int j2 = 0; + final Font font = g1.getFont(); + final int k2 = font.getSize(); + final int l2 = (int) (2.0F * (float) k2); + int i3 = k2 / 9; + if (flag) { + j2 = S._mthif(); + } + final String s1 = S._mthint().w; + c1 = _mthnew(i1, j1, false, g1, k1); + final int j3 = c1._flddo; + int k3 = c1._fldif; + int l3 = c1.a; + final int i4 = (j1 - k3) + 1; + final int j4 = (j1 + l3) - 1; + final String s3 = S._mthint().w; + final int k4 = (k3 + l3) - 2; + final Font font1 = new Font(font.getFamily(), font.getStyle(), k4); + g1.setFont(font1); + final FontMetrics fontmetrics = g1.getFontMetrics(); + if (s1.equals("<") || s1.equals(">")) { + l1 = k2; + } else if (k4 < l2) { + l1 = fontmetrics.stringWidth(s1); + if ("([{)]}".indexOf(s1) >= 0) { + l1 += i3; + } + } else { + l1 = k2; + } + if (s3.equals("<") || s3.equals(">")) { + i2 = k2; + } else if (k4 < l2) { + i2 = fontmetrics.stringWidth(s3); + if ("([{)]}".indexOf(s3) >= 0) { + i2 += i3; + } + } else { + i2 = k2; + } + g1.setFont(font); + final int l4 = S._mthif(); + int j5 = 0; + int k5 = 0; + if (S._mthint().y == 11) { + final c c2 = _mthdo(i1, j1, false, g1, k1, false); + j5 = c2._flddo; + k5 = (j4 + c2._fldif) - (c2._fldif + c2.a) / 2; + l3 += (c2._fldif + c2.a) / 2; + } else { + S.a(l4); + } + final int l5 = S._mthif(); + int j6 = 0; + int k6 = 0; + if (S._mthint().y == 10) { + final c c3 = _mthint(i1, j1, false, g1, k1, false); + j6 = c3._flddo; + k6 = (i4 + c3._fldif) - (c3._fldif + c3.a) / 2; + k3 += (c3._fldif + c3.a) / 2; + } else { + S.a(l5); + } + j5 = Math.max(j5, j6); + if (flag) { + S.a(j2); + final String s2 = S._mthint().w; + if (!s2.equals(".")) { + if (k4 < l2 && !s2.equals("<") && !s2.equals(">")) { + g1.setFont(font1); + g1.drawString(s2, i1, j4 - fontmetrics.getDescent() + - fontmetrics.getLeading() / 2); + g1.setFont(font); + } else { + a(g1, s2, i1, l1, i4, j4, k2, 0); + } + } + _mthnew(i1 + l1, j1, true, g1, k1); + final String s4 = S._mthint().w; + if (!s4.equals(".")) { + if (k4 < l2 && !s4.equals("<") && !s4.equals(">")) { + g1.setFont(font1); + if ("([{)]}".indexOf(s4) < 0) { + i3 = 0; + } + g1.drawString(s4, i1 + j3 + l1 + i3, j4 + - fontmetrics.getDescent() + - fontmetrics.getLeading() / 2); + // System.out.println("2: "+s4); + g1.setFont(font); + } else { + a(g1, s4, i1 + j3 + l1, i2, i4, j4, -k2, -1); + } + } + final int i5 = S._mthif(); + if (a(11)) { + _mthdo(i1 + j3 + l1 + i2, k5, true, g1, k1, false); + } else { + S.a(i5); + } + final int i6 = S._mthif(); + if (a(10)) { + _mthint(i1 + j3 + l1 + i2, k6, true, g1, k1, false); + } else { + S.a(i6); + } + } + return new c(j3 + l1 + i2 + j5, k3 + 2, l3 + 2); + } + + private c _mthfor(final int i1, final int j1, final boolean flag, + final Graphics2D g1, final int k1) { + int l1 = 0; + new c(); + int i2 = 0; + int j2 = 0; + final FontMetrics fontmetrics = g1.getFontMetrics(); + final String s1 = D.w; + final int k2 = S._mthif(); + final int l2 = l1 = fontmetrics.stringWidth(s1); + final int i3 = fontmetrics.getHeight() - fontmetrics.getDescent(); + int j3 = fontmetrics.getDescent(); + if (a(11)) { + final c c2 = _mthdo(i1, j1, false, g1, k1, false); + i2 = c2._flddo; + l1 = Math.max(l1, c2._flddo); + j2 = c2._fldif; + j3 = c2._fldif + c2.a; + } else { + S.a(k2); + } + if (flag) { + S.a(k2); + g1.drawString(s1, i1 + (l1 - l2) / 2, j1); + if (a(11)) { + _mthdo(i1 + (l1 - i2) / 2, j1 + j2, true, g1, k1, false); + } else { + S.a(k2); + } + } + return new c(l1, i3, j3); + } + + private c _mthdo(final int i1, final int j1, final boolean flag, + final Graphics2D g1) { + int k1 = 0; + int l1 = 0; + int i2 = 0; + new c(); + if (!a(3)) { + return new c(0, 0, 0); + } + while (!S._mthnew()) { + D = S._mthint(); + if (D.y == 4) { + break; + } + final c c2 = _mthif(i1 + k1, j1, flag, g1); + k1 += c2._flddo; + l1 = Math.max(l1, c2._fldif); + i2 = Math.max(i2, c2.a); + } + return new c(k1, l1, i2); + } + + private c _mthtry(final int i1, final int j1, final boolean flag, + final Graphics2D g1, final int k1) { + c c1 = new c(); + c1 = _mthtry(i1, j1, flag, g1, k1, false); + if (flag) { + g1.drawLine(i1 + c1._flddo / 4, j1 + c1.a, + i1 + (c1._flddo * 3) / 4, j1 - c1._fldif); + } + return c1; + } + + private c _mthint(final int i1, final int j1, final boolean flag, + final Graphics2D g1) { + final FontMetrics fontmetrics = g1.getFontMetrics(); + if (flag) { + g1.drawString(D.w, i1 + 1, j1); + // System.out.println("3: "+D.w); + } + return new c(fontmetrics.stringWidth(D.w) + 2, fontmetrics.getHeight() + - fontmetrics.getDescent(), fontmetrics.getDescent()); + } + + private c a(final int i1, final int j1, final boolean flag, + final Graphics2D g1, final int k1) { + int l1 = 0; + c c1 = new c(); + final int i2 = g1.getFont().getSize() / 4; + final int j2 = i2 / 2; + int k2 = 0; + int l2 = 0; + int i3 = 0; + if (flag) { + l1 = S._mthif(); + } + c1 = _mthtry(i1, j1, false, g1, k1, false); + int j3 = c1._flddo; + final int k3 = j3 / 2; + int l3 = k3; + int i4 = c1._fldif; + final int j4 = c1.a; + final int k4 = S._mthif(); + if (a(10)) { + final c c2 = _mthint(i1, j1, false, g1, k1, false); + k2 = c2._flddo; + l3 = Math.max(l3, k2 / 2); + l2 = i4 + c2.a; + i3 = c2._fldif + c2.a; + } else { + S.a(k4); + } + if (flag) { + S.a(l1); + final int i5 = (i1 + l3) - k3; + _mthtry(i5, j1, true, g1, k1, false); + final int j5 = (int) ((double) i2 * 0.86602540378444004D); + for (int k5 = 0; k5 < 2; k5++) { + final int l5 = (j1 - i4 - j2) + k5; + a(g1, i5 + j5, l5 + i2, i2, 90, 60); + g1.drawLine(i5 + j5, l5, (i5 + k3) - i2, l5); + a(g1, (i5 + k3) - i2, l5 - i2, i2, 0, -90); + a(g1, i5 + k3 + i2, l5 - i2, i2, -90, -90); + g1.drawLine(i5 + k3 + i2, l5, (i5 + j3) - j5, l5); + a(g1, (i5 + j3) - j5, l5 + i2, i2, 90, -60); + } + + final int l4 = S._mthif(); + if (a(10)) { + _mthint((i1 + l3) - k2 / 2, j1 - l2 - i2 - j2, true, g1, k1, + false); + } else { + S.a(l4); + } + } + i4 += i3 + i2 + j2; + j3 = Math.max(j3, k2); + return new c(j3, i4, j4); + } + + private c _mthlong(final int i1, final int j1, final boolean flag, + final Graphics2D g1, final int k1) { + int l1 = 0; + c c1 = new c(); + final int i2 = g1.getFont().getSize() / 4; + final int j2 = i2 / 2; + int k2 = 0; + int l2 = 0; + int i3 = 0; + if (flag) { + l1 = S._mthif(); + } + c1 = _mthtry(i1, j1, false, g1, k1, false); + int j3 = c1._flddo; + final int k3 = j3 / 2; + int l3 = k3; + final int i4 = c1._fldif; + int j4 = c1.a; + final int k4 = S._mthif(); + if (a(11)) { + final c c2 = _mthdo(i1, j1, false, g1, k1, false); + k2 = c2._flddo; + l3 = Math.max(l3, k2 / 2); + l2 = j4 + c2._fldif; + i3 = c2._fldif + c2.a; + } else { + S.a(k4); + } + if (flag) { + S.a(l1); + final int i5 = (i1 + l3) - k3; + _mthtry(i5, j1, true, g1, k1, false); + final int j5 = (int) ((double) i2 * 0.86602540378444004D); + for (int k5 = 0; k5 < 2; k5++) { + final int l5 = (j1 + j4 + j2) - k5; + a(g1, i5 + j5, l5 - i2, i2, -90, -60); + g1.drawLine(i5 + j5, l5, (i5 + k3) - i2, l5); + a(g1, (i5 + k3) - i2, l5 + i2, i2, 90, -90); + a(g1, i5 + k3 + i2, l5 + i2, i2, 90, 90); + g1.drawLine(i5 + k3 + i2, l5, (i5 + j3) - j5, l5); + a(g1, (i5 + j3) - j5, l5 - i2, i2, -90, 60); + } + + final int l4 = S._mthif(); + if (S._mthint().y == 11) { + _mthdo((i1 + l3) - k2 / 2, j1 + l2 + i2 + j2, true, g1, k1, + false); + } else { + S.a(l4); + } + } + j4 += i3 + i2 + j2; + j3 = Math.max(j3, k2); + return new c(j3, i4, j4); + } + + private c a(final int i1, final int j1, final boolean flag, + final Graphics2D g1, final int k1, final boolean flag1) { + int l1 = 0; + c c1 = new c(); + if (flag) { + l1 = S._mthif(); + } + c1 = _mthtry(i1, j1, false, g1, k1, false); + if (flag1) { + c1._fldif += 2; + } else { + c1.a += 2; + } + final int i2 = c1._fldif; + final int j2 = c1.a; + if (flag) { + S.a(l1); + if (flag1) { + g1.drawLine(i1 + 1, (j1 - i2) + 2, (i1 + c1._flddo) - 1, + (j1 - i2) + 2); + } else { + g1.drawLine(i1, (j1 + j2) - 2, i1 + c1._flddo, (j1 + j2) - 2); + } + c1 = _mthtry(i1, j1, true, g1, k1, false); + } + return new c(c1._flddo, i2, j2); + } + + private c _mthtry(int i1, final int j1, final boolean flag, + final Graphics2D g1) { + final FontMetrics fontmetrics = g1.getFontMetrics(); + final int k1 = g1.getFont().getSize() / 9; + int l1 = fontmetrics.stringWidth(D.w); + final int i2 = "([{)]}".indexOf(D.w); + if (i2 >= 0) { + l1 += k1; + if (i2 > 2) { + i1 += k1; + } + } + if (flag) { + g1.drawString(D.w, i1, j1); + // System.out.println("2: "+D.w); + } + return new c(l1, fontmetrics.getHeight() - fontmetrics.getDescent(), + fontmetrics.getDescent()); + } + + private c _mthif(final int i1, final int j1, final boolean flag, + final Graphics2D g1) { + final FontMetrics fontmetrics = g1.getFontMetrics(); + if (flag) { + g1.drawString(D.w, i1, j1); + // System.out.println(g1.getFont()); + // System.out.println("1: "+D.w); + } + return new c(fontmetrics.stringWidth(D.w), fontmetrics.getHeight() + - fontmetrics.getDescent(), fontmetrics.getDescent()); + } + + private c _mthfor(final int i1, final int j1, final boolean flag, + final Graphics2D g1) { + int k1 = 0; + final Font font = g1.getFont(); + try { + k1 = Integer.parseInt(D.w); + } catch (final NumberFormatException numberformatexception) { + k1 = 0; + } + k1 = (k1 * font.getSize()) / 18; + return new c(k1, 0, 0); + } + + private c _mthcase(final int i1, final int j1, final boolean flag, + final Graphics2D g1, final int k1) { + c c1 = new c(); + int l1 = 0; + final FontMetrics fontmetrics = g1.getFontMetrics(); + int i2 = 0; + int k2 = 0; + int l2 = 0; + boolean flag2 = false; + if (flag) { + l1 = S._mthif(); + } + final int i3 = fontmetrics.stringWidth("A"); + final int j3 = i3 / 2; + final int k3 = S._mthif(); + e e1 = new e(); + e1 = S._mthint(); + if (e1.w.equals("[")) { + a(g1, k1 + 1); + c1 = _mthtry(i1, j1, false, g1, k1 + 1, true); + a(g1, k1); + i2 = c1._flddo; + final int j2 = c1._fldif; + k2 = c1.a; + l2 = k2 + j2; + flag2 = true; + } else { + S.a(k3); + } + c1 = _mthtry(i1, j1, false, g1, k1, false); + int l3 = c1._flddo + i3; + int i4 = c1._fldif + 2; + final int j4 = c1.a; + if (flag2 & (i2 > j3)) { + l3 += i2 - j3; + } + if (flag) { + S.a(l1); + int k4 = 0; + if (flag2 & (i2 > j3)) { + k4 = i2 - j3; + } + g1.drawLine(i1 + k4 + 1, j1 - i4 / 2, i1 + k4 + j3, (j1 + j4) - 1); + g1.drawLine(i1 + k4 + j3, (j1 + j4) - 1, (i1 + k4 + i3) - 2, + (j1 - i4) + 2); + g1.drawLine((i1 + k4 + i3) - 2, (j1 - i4) + 2, i1 + l3, + (j1 - i4) + 2); + if (flag2) { + S._mthint(); + a(g1, k1 + 1); + if (i2 >= j3) { + g1.drawLine(i1 + 1, j1 - i4 / 2, i1 + k4 + 1, j1 - i4 / 2); + _mthtry(i1 + 1, j1 - i4 / 2 - k2 - 1, true, g1, k1 + 1, + true); + } else { + _mthtry(i1 + 1 + (j3 - i2), j1 - i4 / 2 - k2 - 1, true, g1, + k1 + 1, true); + } + a(g1, k1); + } + _mthtry(i1 + k4 + i3, j1, true, g1, k1, false); + } + if (flag2 & (i4 / 2 < l2)) { + i4 = i4 / 2 + l2; + } + return new c(l3, i4, j4); + } + + private c _mthchar(final int i1, final int j1, final boolean flag, + final Graphics2D g1, final int k1) { + c c1 = new c(); + int l1 = 0; + final int i2 = g1.getFontMetrics().getLeading(); + if (flag) { + l1 = S._mthif(); + } + c1 = _mthint(i1, j1, false, g1, k1, true); + int j2 = c1._flddo; + final int k2 = c1._flddo; + int l2 = (c1._fldif + c1.a) - i2; + int i3 = c1.a - i2; + c1 = _mthtry(i1, j1, false, g1, k1, false); + j2 = Math.max(j2, c1._flddo); + final int j3 = j2 / 2; + final int k3 = c1._flddo; + l2 += c1._fldif; + final int l3 = c1.a; + i3 += c1._fldif; + if (flag) { + S.a(l1); + _mthint((i1 + j3) - k2 / 2, j1 - i3, true, g1, k1, false); + _mthtry((i1 + j3) - k3 / 2, j1, true, g1, k1, false); + } + return new c(j2, l2, l3); + } + + private c _mthdo(final int i1, final int j1, final boolean flag, + final Graphics2D g1, final int k1, final boolean flag1) { + int l1 = 0; + int i2 = 0; + c c1 = new c(); + int j2 = 0; + final int l2 = g1.getFontMetrics().getAscent() / 2; + if (flag) { + j2 = S._mthif(); + } + a(g1, k1 + 1); + c1 = _mthtry(i1, j1, false, g1, k1 + 1, false); + int i3 = c1._flddo; + if (flag1) { + l1 = l2 - 1; + i2 = (c1._fldif + c1.a) - l1; + } else { + i2 = c1._fldif + c1.a; + } + if (flag) { + S.a(j2); + if (flag1) { + c1 = _mthtry(i1, (j1 + c1._fldif) - l1, true, g1, k1 + 1, false); + } else { + c1 = _mthtry(i1, j1 + c1._fldif, true, g1, k1 + 1, false); + } + } + a(g1, k1); + if (flag1) { + final int k2 = S._mthif(); + if (a(10)) { + final c c2 = _mthint(i1, j1, flag, g1, k1, true); + i3 = Math.max(i3, c2._flddo); + l1 = Math.max(l1, c2._fldif); + } else { + S.a(k2); + } + } + return new c(i3, l1, i2); + } + + private c _mthint(final int i1, final int j1, final boolean flag, + final Graphics2D g1, final int k1, final boolean flag1) { + int l1 = 0; + int i2 = 0; + c c1 = new c(); + int j2 = 0; + final int l2 = g1.getFontMetrics().getAscent() / 2; + if (flag) { + j2 = S._mthif(); + } + a(g1, k1 + 1); + c1 = _mthtry(i1, j1, false, g1, k1 + 1, false); + int i3 = c1._flddo; + if (flag1) { + i2 = -l2 - 1; + l1 = (c1._fldif + c1.a) - i2; + } else { + l1 = c1._fldif + c1.a; + } + if (flag) { + S.a(j2); + if (flag1) { + c1 = _mthtry(i1, (j1 - c1.a) + i2, true, g1, k1 + 1, false); + } else { + c1 = _mthtry(i1, j1 - c1.a, true, g1, k1 + 1, false); + } + } + a(g1, k1); + if (flag1) { + final int k2 = S._mthif(); + if (a(11)) { + final c c2 = _mthdo(i1, j1, flag, g1, k1, true); + i3 = Math.max(i3, c2._flddo); + i2 = Math.max(i2, c2.a); + } else { + S.a(k2); + } + } + return new c(i3, l1, i2); + } + + private Image _mthif(final Graphics2D g1, final int i1) { + final String s1 = D.w + j[i1 - 1] + g1.getColor().getRGB(); + if (!w.containsKey(s1)) { + final String s2 = "Fonts/Greek" + j[i1 - 1] + "/" + D.w + ".gif"; + final Image image = _flddo.a(s2, g1); + final int j1 = S._mthif(); + B.addImage(image, j1); + a("Loading " + D.w); + try { + B.waitForID(j1, 10000L); + } catch (final InterruptedException interruptedexception) { + } + if (B.isErrorID(j1)) { + a("Error loading " + D.w); + } else { + w.put(s1, image); + } + return image; + } else { + return (Image) w.get(s1); + } + } + + private c _mthif(final int i1, final int j1, final boolean flag, + final Graphics2D g1, int k1, final boolean flag1) { + final FontMetrics fontmetrics = g1.getFontMetrics(); + k1 = Math.min(k1, j.length); + final Image image = _mthif(g1, k1); + int l1 = image.getWidth(PC); + if (l1 < 0) { + l1 = fontmetrics.getMaxAdvance(); + } + if (flag) { + int i2 = 0; + if (flag1) { + i2 = _fldfor[k1 - 1]; + } + g1.drawImage(image, i1, (j1 - image.getHeight(PC)) + i2, PC); + } + return new c(l1, fontmetrics.getHeight() - fontmetrics.getDescent(), + fontmetrics.getDescent()); + } + + private c _mthdo(final int i1, final int j1, final boolean flag, + final Graphics2D g1, int k1) { + int l1 = 0; + new c(); + int i2 = 0; + int j2 = 0; + int k2 = 0; + int l2 = 0; + int i3 = 0; + final int j3 = g1.getFontMetrics().getAscent(); + k1 = Math.min(k1, j.length); + final Image image = _mthif(g1, k1); + int k3 = l1 = image.getWidth(PC); + int l3 = image.getHeight(PC); + if (l3 < 0) { + l3 = 2 * j3; + k3 = l1 = j3; + } + int i4 = (int) ((double) (l3 / 2) - 0.40000000000000002D * (double) j3); + int j4 = i3 = l3 - i4; + final int k4 = S._mthif(); + if (a(11)) { + final c c2 = _mthdo(i1, j1, false, g1, k1, false); + k2 = c2._flddo; + l1 = Math.max(l1, c2._flddo); + i2 = i4 + c2._fldif; + i4 += c2._fldif + c2.a; + } else { + S.a(k4); + } + final int l4 = S._mthif(); + if (a(10)) { + final c c3 = _mthint(i1, j1, false, g1, k1, false); + l2 = c3._flddo; + l1 = Math.max(l1, c3._flddo); + j2 = j4 + c3.a; + j4 += c3._fldif + c3.a; + } else { + S.a(l4); + } + if (flag) { + S.a(k4); + g1.drawImage(image, i1 + (l1 - k3) / 2, j1 - i3, PC); + if (a(11)) { + _mthdo(i1 + (l1 - k2) / 2, j1 + i2, true, g1, k1, false); + } else { + S.a(k4); + } + final int i5 = S._mthif(); + if (a(10)) { + _mthint(i1 + (l1 - l2) / 2, j1 - j2, true, g1, k1, false); + } else { + S.a(i5); + } + } + return new c(l1, j4, i4); + } + + private c _mthint(final int i1, final int j1, final boolean flag, + final Graphics2D g1, final int k1) { + c c1 = new c(); + final int l1 = g1.getFont().getSize(); + final String s1 = D.w; + c1 = _mthtry(i1, j1, flag, g1, k1, false); + final int i2 = c1._flddo; + final int j2 = i2 / 2; + final int k2 = l1 / 4; + final int l2 = c1._fldif + k2; + final int i3 = c1.a; + if (flag) { + final int j3 = (j1 - l2) + k2; + final int k3 = l1 / 8; + final int l3 = i1 + i2; + final int i4 = i1 + j2; + if (s1.equals("")) { + g1.drawLine(i1, j3, l3, j3); + g1.drawLine(i1 + (int) ((double) i2 * 0.80000000000000004D), j3 + - k3, l3, j3); + g1.drawLine(i1 + (int) ((double) i2 * 0.80000000000000004D), j3 + + k3, l3, j3); + } else if (s1.equals("bar")) { + g1.drawLine(i1, j3, l3, j3); + } else if (s1.equals("widehat")) { + g1.drawLine(i1, j3, i4, j3 - k2); + g1.drawLine(i4, j3 - k2, l3, j3); + } else if (s1.equals("widetilde")) { + int k4 = 0; + for (int l4 = 1; l4 < j2; l4++) { + final int j4 = k4; + k4 = (int) ((double) k3 * Math + .sin((4.0840704496667311D * (double) l4) + / (double) j2)); + g1.drawLine((i4 + l4) - 1, j3 + j4, i4 + l4, j3 + k4); + g1.drawLine((i4 - l4) + 1, j3 - j4, i4 - l4, j3 - k4); + } + + } + } + return new c(i2, l2 + 2, i3); + } + + private boolean a(final int i1) { + return a(i1, ""); + } + + private boolean a(final int i1, final String s1) { + int j1; + while ((j1 = S._mthint().y) == 25) { + } + if (j1 == i1) { + return true; + } + if (!s1.equals("")) { + printStatus("Parser: " + s1 + " not found"); + } + return false; + } + + private boolean a(final int i1, final int j1, final String s1) { + int k1; + while ((k1 = S._mthint().y) == 25) { + } + boolean flag = k1 == i1; + while ((k1 = S._mthint().y) == 25) { + } + flag = k1 == j1; + if (!flag && !s1.equals("")) { + printStatus("Parser: " + s1 + " not found"); + } + return flag; + } + + private void a(final Graphics2D g1, final int i1) { + if (i1 <= 1) { + g1.setFont(d); + } else if (i1 == 2) { + g1.setFont(b); + } else if (i1 == 3) { + g1.setFont(_fldnull); + } else { + g1.setFont(_fldlong); + } + } + +} diff --git a/base3D-es.zir b/base3D-es.zir new file mode 100644 index 0000000..98f4439 --- /dev/null +++ b/base3D-es.zir @@ -0,0 +1,139 @@ + + + + + + + + + + + + + diff --git a/base3D-fr-modifs.zir b/base3D-fr-modifs.zir new file mode 100644 index 0000000..637c530 --- /dev/null +++ b/base3D-fr-modifs.zir @@ -0,0 +1,101 @@ + + + + + + + + + + + + + diff --git a/base3D-fr.zir b/base3D-fr.zir new file mode 100644 index 0000000..91f5a49 --- /dev/null +++ b/base3D-fr.zir @@ -0,0 +1,139 @@ + + + + + + + + + + + + + diff --git a/base3D.zir b/base3D.zir new file mode 100644 index 0000000..21c0362 --- /dev/null +++ b/base3D.zir @@ -0,0 +1,138 @@ + + + + + + + + + + + + + diff --git a/baseDP.zir b/baseDP.zir new file mode 100644 index 0000000..14ef4d1 --- /dev/null +++ b/baseDP.zir @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/builtin.mcr b/builtin.mcr new file mode 100644 index 0000000..a526c36 --- /dev/null +++ b/builtin.mcr @@ -0,0 +1,1446 @@ + + + +=O +=X +=Y +=Z +A + + +Point +Point +Point +Point +Point +Expression "1" à 7.67962, 0.46849 +Point +Point +Point +Point +Point +Point +Point +Point +Point +Point +Point +Point +Point +Point +Point +Point +Point +Point +Point +Point +Segment de P5 à P4 +Segment de P5 à P19 +Segment de P5 à P13 +Segment de P19 à P3 +Segment de P3 à P16 +Segment de P16 à P4 +Segment de P19 à P10 +Segment de P10 à P11 +Segment de P11 à P13 +Segment de P11 à P17 +Segment de P4 à P12 +Segment de P13 à P21 +Segment de P10 à P18 +Segment de P3 à P2 +Segment de P18 à P2 +Segment de P18 à P6 +Segment de P2 à P15 +Segment de P16 à P9 +Segment de P6 à P17 +Segment de P21 à P12 +Segment de P21 à P1 +Segment de P15 à P7 +Segment de P6 à P7 +Segment de P15 à P9 +Segment de P9 à P8 +Segment de P7 à P14 +Segment de P12 à P8 +Segment de P8 à P14 +Segment de P14 à P1 +Segment de P17 à P1 + + + +=O +=X +=Y +=Z +A + +Point +Point +Point +Point +Point +Expression "1" à 1.58512, 1.00354 +Point +Point +Point +Point +Segment de P3 à P2 +Segment de P1 à P2 +Segment de P5 à P2 +Segment de P1 à P5 +Segment de P1 à P3 +Segment de P3 à P5 + + + +D +E +F +B + +Point à 57.39831, 21.2484 +Point à 57.39831, 25.15035 +Point à 55.04322, 25.86185 +Point à 60.6315, 25.66861 +Segment de E à B + + + +=O +=X +=Y +=Z +A + +Point +Point +Point +Point +Point +Expression "1" à 7.63134, 0.50283 +Point +Point +Point +Point +Point +Point +Point +Point +Segment de P4 à P9 +Segment de P7 à P3 +Segment de P6 à P2 +Segment de P5 à P1 +Segment de P1 à P9 +Segment de P9 à P3 +Segment de P3 à P2 +Segment de P2 à P1 +Segment de P7 à P6 +Segment de P6 à P5 +Segment de P5 à P4 +Segment de P4 à P7 + + + +=O +=X +=Y +=Z +A + +Point +Point +Point +Point +Point +Expression "1" à -10.46236, 0.03579 +Point +Point +Point +Point +Point +Point +Segment de P7 à P4 +Segment de P3 à P4 +Segment de P2 à P4 +Segment de P1 à P4 +Segment de P1 à P5 +Segment de P7 à P5 +Segment de P3 à P5 +Segment de P2 à P5 +Segment de P2 à P3 +Segment de P3 à P7 +Segment de P1 à P2 +Segment de P7 à P1 + + + +=O +=X +=Y +=Z +A + + +Point +Point +Point +Point +Point +Expression "1" à 4.00164, 0.41236 +Point +Point +Point +Point +Point +Point +Point +Point +Point +Point +Point +Point +Segment de P13 à P4 +Segment de P3 à P4 +Segment de P13 à P11 +Segment de P13 à P5 +Segment de P13 à P3 +Segment de P8 à P4 +Segment de P8 à P7 +Segment de P8 à P11 +Segment de P4 à P7 +Segment de P4 à P9 +Segment de P9 à P3 +Segment de P7 à P9 +Segment de P1 à P8 +Segment de P1 à P7 +Segment de P2 à P7 +Segment de P13 à P8 +Segment de P1 à P2 +Segment de P2 à P9 +Segment de P9 à P10 +Segment de P10 à P3 +Segment de P3 à P5 +Segment de P11 à P5 +Segment de P11 à P1 +Segment de P5 à P6 +Segment de P11 à P6 +Segment de P1 à P6 +Segment de P10 à P5 +Segment de P2 à P10 +Segment de P10 à P6 +Segment de P2 à P6 + + + +=O +=X +=Y +=Z +p + +Point à 1.03933, 0.46474 +Point à "x(p)", "y(p)" +Point à 1.01578, 1.45964 +Point à 2.00625, 0.46247 +Point à 0.78533, 0.36384 + + + +O +M + +Point à -2.57, 4.13 +Point à -0.67, 2.7 +Point à "2*x(O)-x(M)", "2*y(O)-y(M)" + + + +=O +=X +=Y +=Z +B +A + +Point +Point +Point +Point +Point +Point +Point + + + +l1 +A + +Point à 1.20702, 2.09123 + +??? + + + +Intersection entre perp1 et c1 + + + +=O +=X +=Y +=Z +P1 +P2 +P3 +M + +Point +Point +Point +Point +Point +Point +Point + +Point + +Point + + + +=O +=X +=Y +=Z +P1 +P2 +P3 +M + +Point +Point +Point +Point +Point +Point +Point + +Point + +Point + + + +A +B +M + +Point à -3.98502, 1.73034 +Point à -2.41199, 2.26966 +Point à -1.87266, 1.16105 +Point à "x(C)+x(B)-x(A)", "y(C)+y(B)-y(A)" + + + +=O +=X +=Y +=Z +A +B +C + +Point +Point +Point +Point +Point +Point +Point +Point + + + +=O +=X +=Y +=Z +l1 +C + +Point +Point +Point +Point +Point +Point +Point +Droite passant par P et P1 + + + + + + + + + +Point + + + + + + +Conique passant par C, P13, P14, P15, P16 + + + +=O +=X +=Y +=Z +l1 +P +E2 + +Expression "2" à 0.0, 0.0 +Point +Point +Point +Point +Point +Point +Point +Droite passant par T et P1 + + + + + + + + + + +Conique passant par P11, P7, P10, P9, P8 + + + +=O +=X +=Y +=Z +A +B +C + +Point +Point +Point +Point +Point +Point +Point + + + + + + + + + + +Intersection entre l1 et l2 + + +Conique passant par A, P8, B, P7, C + + + +=O +=X +=Y +=Z +A +B +C +l2 + +Point +Point +Point +Point +Point +Point +Point +Point +Point +Droite passant par G et P1 + +Point + + + +=O +=X +=Y +=Z +A +B +C +D +E +F + +Point +Point +Point +Point +Point +Point +Point +Point +Point +Point + + + + + + + + + + + +Droite passant par P6 et P5 + + + +=O +=X +=Y +=Z +A + +Point +Point +Point +Point +Point +Sphère de centre A de rayon 1 + + + + + + + + + + + + +Conique passant par P5, P6, P9, P8, P7 + + + +=O +=X +=Y +=Z +A +B + +Point +Point +Point +Point +Point +Point +Sphère de centre A de rayon d3D(A,B) + + + + + + + + + + + + +Conique passant par P5, P6, P9, P8, P7 + + + +=O +=X +=Y +=Z +c1 +l1 + +Point +Point +Point +Point +Point +??? +Point +Point +Droite passant par P1 et P2 + + +Point +Point + + + +=O +=X +=Y +=Z +c1 +B +C +D + +Point +Point +Point +Point +Point +??? +Point +Point +Point + + +Point + + + + + + + + + + + +Conique passant par P11, P7, P10, P9, P8 + + + +=O +=X +=Y +=Z +c1 +c2 + +Point +Point +Point +Point +Point +Point +??? +??? + + + + + + + + + + + + + + +Conique passant par P12, P8, P11, P10, P9 + + + +A +B + +Point à 3.92161, -13.62031 +Point à -4.98046, 17.29785 + + + + +Droite passant par I1 et I2 + + + +A +B +C + +Point à -0.3038, 2.25823 +Point à -2.47089, 0.61772 +Point à 3.28101, 0.21266 + + + +Demi-droite d'origine B vers E + + + +A +B +C + +Point à -5.89698, 0.72469 +Point à -3.7087, 2.54352 +Point à -0.12789, -0.49734 +Point à "(x(A)^2*y(P4)-x(A)^2*y(P5)+y(P4)^2*y(P5)-y(P4)^2*y(A)-y(P4)*y(P5)^2+y(P4)*y(A)^2-y(P4)*x(P5)^2+y(P5)^2*y(A)-y(P5)*y(A)^2+y(P5)*x(P4)^2+y(A)*x(P5)^2-y(A)*x(P4)^2)/(2*x(A)*y(P4)+(-(2*x(A)))*y(P5)+(-(2*y(P4)))*x(P5)+2*y(P5)*x(P4)+2*y(A)*x(P5)+(-(2*y(A)))*x(P4))", "(-x(A)^2*x(P4)+x(A)^2*x(P5)+x(A)*x(P4)^2-x(A)*x(P5)^2+x(A)*y(P4)^2-x(A)*y(P5)^2-x(P4)^2*x(P5)+x(P4)*x(P5)^2+x(P4)*y(P5)^2-x(P4)*y(A)^2-x(P5)*y(P4)^2+x(P5)*y(A)^2)/(2*x(A)*y(P4)+(-(2*x(A)))*y(P5)+2*x(P4)*y(P5)+(-(2*x(P4)))*y(A)+(-(2*x(P5)))*y(P4)+2*x(P5)*y(A))" +Cercle de centre P10 passant par P7 + + + +M +N +P + +Point à -6.74, 2.9 +Point à -5.50775, 4.13336 +Point à -4.56, 3.86 + + + +Cercle de centre P6 passant par P4 + + + +M +a +b +P4 + +Point à -1.0, 2.0 +Point à 2.0, 2.0 + +Point à 4.0, 2.0 + + +Point à "(windoww/(windoww-d(windoww)))*(x(P4)-windowcx)+windowcx+d(windowcx)", "(windoww/(windoww-d(windoww)))*(y(P4)-windowcy)+windowcy+d(windowcy)" +Les points sont alignés +Les points ne sont pas alignés + + + +l1 +l2 +P5 + +??? +??? +Point à "(windoww/(windoww-d(windoww)))*(x(P5)-windowcx)+windowcx+d(windowcx)", "(windoww/(windoww-d(windoww)))*(y(P5)-windowcy)+windowcy+d(windowcy)" +Les objets ne sont pas parallèles +Les objets sont parallèles + + + +l1 +l2 +P5 + +??? +??? +Point à "(windoww/(windoww-d(windoww)))*(x(P5)-windowcx)+windowcx+d(windowcx)", "(windoww/(windoww-d(windoww)))*(y(P5)-windowcy)+windowcy+d(windowcy)" +Les objets ne sont pas perpendiculaires +Les objets sont perpendiculaires + + + +o +a +b +P5 + +Point à 1.0, -1.0 +Point à 1.0, 3.0 +Point à 5.0, 0.0 +Point à "(windoww/(windoww-d(windoww)))*(x(P5)-windowcx)+windowcx+d(windowcx)", "(windoww/(windoww-d(windoww)))*(y(P5)-windowcy)+windowcy+d(windowcy)" +Les points ne sont pas équidistants +Les points sont équidistants + + + +P13 +l4 +P14 + +??? +Point à 5.0, 0.0 +Point à "(windoww/(windoww-d(windoww)))*(x(P14)-windowcx)+windowcx+d(windowcx)", "(windoww/(windoww-d(windoww)))*(y(P14)-windowcy)+windowcy+d(windowcy)" + + + +Le point est sur l'objet +Le point n'est pas sur l'objet + + + +M +A +P3 + +Point à 3.0, 2.0 +Point à 3.0, 2.0 +Point à "(windoww/(windoww-d(windoww)))*(x(P3)-windowcx)+windowcx+d(windowcx)", "(windoww/(windoww-d(windoww)))*(y(P3)-windowcy)+windowcy+d(windowcy)" +Les points sont confondus +Les points ne sont pas confondus + + + +A + + +f1(x)=0 + + + +=Hz +A +B + +Point +Point +Point +??? + + + + +Cercle de centre P5 passant par P3 + + + +=Hz +Premier point +Second point + +Point +??? +Point +Point + +Cercle de centre P1 passant par A + + + +=Hz +Origine de la demi droite +Point de la demi droite + +Point +Point +Point +??? + + + + + + + + +Cercle de centre P8 passant par P5 + + + +=Hz +La droite +Le point + +Point +??? +Point +??? +Point + + + + + +Cercle de centre P5 passant par P3 + + + +=Hz +A +B + +Point +??? +Point +Point + + + + + +Cercle de centre P5 passant par P2 + + + +=Hz +A +O (sommet) +B + +Point +??? +Point +Point +Point + + + + + + + + + + + + + + + + + +Cercle de centre P13 passant par P11 + + + +=Hz +A +B + +Point +Point +Point +??? + + + + +Intersection entre c3 et c2 + + + +=Hz +Axe de la symétrie +M + +Point +??? + +??? +Point +Point à "x(P1)+c1^2/d(P1,A)^2*(x(A)-x(P1))", "y(P1)+c1^2/d(P1,A)^2*(y(A)-y(P1))" + + + +=Hz +Le centre +Un point + +Point +Point +??? +Point + + +Point à "x(P1)+c1^2/d(P1,A)^2*(x(A)-x(P1))", "y(P1)+c1^2/d(P1,A)^2*(y(A)-y(P1))" + + + +=Hz +Centre du cycle +Point du cycle + +

Si le centre du cercle est sur l'horizon (à l'infini) alors +le cercle devient un horicycle

+
+ +Point +Point +Point +??? + + +Cercle de centre P2 passant par A + +
+ +=Hz +Premier point +Origine de l'angle +Dernier point + +

Renvoie la mesure en degré de l'angle AOB

+
+ +Point +??? +Point +Point +Point + + + + + + + + + + +Angle P3 - O - P4 + +
+ +=Hz +Premier point du rayon +Second point du rayon +Centre + +Point +??? +Point +Point +Point + + + + + + + + + + + + + + + + + +Cercle de centre P13 passant par P11 + + + +=Hz +A +B + +Point +??? +Point +Point + + + + +Point +Point + +Cercle de centre P7 passant par P5 + + + +=Hz +droite hyperbolique +droite hyperbolique + +Point +??? +Point +??? +Point +??? + + + + +Cercle de centre P5 passant par P4 + + + +=Hz +A +B +P2 + +Point +Point +Point +Point +??? +Expression "Argcosh(((Hz^2+x(A)^2+y(A)^2)*(Hz^2+x(B)^2+y(B)^2)-4*Hz^2*(x(A)*x(B)+y(A)*y(B)))/((Hz^2-x(A)^2-y(A)^2)*(Hz^2-x(B)^2-y(B)^2)))" à -0.80377, 1.37092 + + + +=Hz +A +B + +

Les centres des horicycles sont orientés par rapport à A et +B (pour maintenir une continuité des constructions)

+
+ +Point +Point +Point +??? + + + + + + + + + + + + +Point +Point + +Cercle de centre P10 passant par P7 + +Cercle de centre P10 passant par P7 + +
+ +=Hz +la droite hyperbolique +un point + +Point +??? +Point +??? + + +Point + + + +Cercle de centre P6 passant par P4 + + + +=Hz +Origine +Point de direction +Valeur de l'angle + +

la valeur de l'angle est une expression

+
+ +Point +Expression "48" à 0.0, 0.0 +Point +Point +??? + + + + + + + + + + + + + + + + + + + + + + + + +Cercle de centre P14 passant par P12 + +
+ +=Hz +A +B +C + +

Etant donnés trois points, construire le cercleou +l'équidistante passant par ces trois points.

+
+ + +Point +Point +Point +??? + + + +Cercle de centre P10 passant par P7 + + + + + +Cercle de centre P5 passant par P3 + +Cercle de centre P9 passant par P6 + +
+ +=Hz +droite 1 +droite 2 +Point + +

Construit la droite du pinceau défini par les deux droites +et passant par le point donné

+
+ +Point +??? +Point +??? +Point +??? +Point + + + + + + + + + + +Cercle de centre P8 passant par P6 + +
+ +=Hz +Droite 1 du pinceau +Droite 2 du pinceau +Droite 3 du pinceau + +

Attention le produit n'est pas commutatif. Ne s'applique a +priori que sur trois droites dont on sait qu'elles sont en +pinceau

+
+ +Point +??? +Point +??? +Point +??? +Point +??? + + + + + + + + + + +Cercle de centre P10 passant par P9 + +
+ +=Hz +Pinceau 1 - droite 1 +Pinceau 1 - droite 2 +Pinceau 2 - droite 1 +Pinceau 2 - droite 2 + +

L'intersection de deux pinceaux peut, dans certains cas, ne +pas exister. Existe toujours si un pinceau est à centre.

+
+ +Point +??? +Point +??? +Point +??? + +Point +??? +Point +??? + + + + + + + +Cercle de centre P9 passant par P7 + +
+ +=Hz +Droite 1 du pinceau +Droite 2 du pinceau +Droite orthogonale au pinceau + +

La hauteur d'un pinceau peut, dans des cas particuliers, ne +pas exister. Elle existe toujours si le pinceau est à +centre.

+
+ +Point +??? +Point +Point +Point +??? +??? + +??? + + + + + + + + + +Cercle de centre P9 passant par P7 + +
+ +=Hz +Droite 1 du pinceau +Droite 2 du pinceau +A + +

Construit le cycle (cercle ou équidistante) défini par un +pinceau (2 droites) et un point.

+
+ +Point +Point +??? +Point +Point +??? +??? + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Cercle de centre P10 passant par P7 + + + + + +Cercle de centre P27 passant par P25 + +Cercle de centre P30 passant par P28 + +
+ +=Hz +Droite 1 +Pt idéal 1 de Drte 1 +Pt idéal 2 de Drte 1 +Droite 2 +Pt idéal 1 de Drte 2 +Pt idéal 2 de Drte 2 + +

Attention cette macro ne s'applique QUE sur des droites +orientées (pour l'orientation des points idéaux)

+
+ +Point +??? +Point +Point + +??? +Point +Point + +??? + + + + + + + + + + +Point +Point + +Cercle de centre P13 passant par P11 + +
+
diff --git a/com/apple/eawt/Application.java b/com/apple/eawt/Application.java new file mode 100644 index 0000000..5c8a02b --- /dev/null +++ b/com/apple/eawt/Application.java @@ -0,0 +1,50 @@ +/* + * Application.java + * allusionsApp + * + * Created by Matthieu Cormier on Fri Jun 20 2003. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +package com.apple.eawt; + +// This is a stub interface for non Mac OS X java 1.4 environments + +public class Application { + public Application() { + } + + public void addApplicationListener(final ApplicationListener listenToMe) { + // I don't feel like listening today!! + } + + public boolean getEnabledPreferencesMenu() { + return false; + } + + public void removeApplicationListener( + final ApplicationListener dontListenToMe) { + // don't worry I haven't been + } + + public void setEneablePreferencesMenu(final boolean enable) { + // yeah, like, what-ever! + } + + public static java.awt.Point getMouseLocationOnScreen() { + return null; + } +} diff --git a/com/apple/eawt/ApplicationAdapter.java b/com/apple/eawt/ApplicationAdapter.java new file mode 100644 index 0000000..00af08b --- /dev/null +++ b/com/apple/eawt/ApplicationAdapter.java @@ -0,0 +1,50 @@ +/* + * ApplicationAdapter.java + * allusionsApp + * + * Created by Matthieu Cormier on Fri Jun 20 2003. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +package com.apple.eawt; + +// This is a stub interface for non Mac OS X java 1.4 environments + +public class ApplicationAdapter implements ApplicationListener { + public ApplicationAdapter() { + } + + public void handleAbout(final ApplicationEvent event) { + } + + public void handleOpenApplication(final ApplicationEvent event) { + } + + public void handleOpenFile(final ApplicationEvent event) { + } + + public void handlePreferences(final ApplicationEvent event) { + } + + public void handlePrintFile(final ApplicationEvent event) { + } + + public void handleQuit(final ApplicationEvent event) { + } + + public void handleReOpenApplication(ApplicationEvent event) { + } +} diff --git a/com/apple/eawt/ApplicationBeanInfo.java b/com/apple/eawt/ApplicationBeanInfo.java new file mode 100644 index 0000000..084fc90 --- /dev/null +++ b/com/apple/eawt/ApplicationBeanInfo.java @@ -0,0 +1,39 @@ +/* + * ApplicationBeanInfo.java + * allusionsApp + * + * Created by Matthieu Cormier on Fri Jun 20 2003. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +package com.apple.eawt; + +// This is a stub interface for non Mac OS X java 1.4 environments + +public class ApplicationBeanInfo extends java.beans.SimpleBeanInfo { + public ApplicationBeanInfo() { + } + + /** + * + * @param iconKind + * @return + */ + @Override + public java.awt.Image getIcon(final int iconKind) { + return null; + } +} diff --git a/com/apple/eawt/ApplicationEvent.java b/com/apple/eawt/ApplicationEvent.java new file mode 100644 index 0000000..ae11a47 --- /dev/null +++ b/com/apple/eawt/ApplicationEvent.java @@ -0,0 +1,37 @@ +/* + * ApplicationEvent.java + * allusionsApp + * + * Created by Matthieu Cormier on Fri Jun 20 2003. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +package com.apple.eawt; + +// This is a stub interface for non Mac OS X java 1.4 environments + +public class ApplicationEvent { + public java.lang.String getFilename() { + return null; + } + + public boolean isHandled() { + return false; + } + + public void setHandled(final boolean state) { + } +} diff --git a/com/apple/eawt/ApplicationListener.java b/com/apple/eawt/ApplicationListener.java new file mode 100644 index 0000000..466ed92 --- /dev/null +++ b/com/apple/eawt/ApplicationListener.java @@ -0,0 +1,38 @@ +/* + * ApplicationListener.java + * allusionsApp + * + * Created by Matthieu Cormier on Fri Jun 20 2003. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +package com.apple.eawt; + +// This is a stub interface for non Mac OS X java 1.4 environments + +public interface ApplicationListener extends java.util.EventListener { + public void handleAbout(ApplicationEvent event); + + public void handleOpenApplication(ApplicationEvent event); + + public void handleOpenFile(ApplicationEvent event); + + public void handlePreferences(ApplicationEvent event); + + public void handlePrintFile(ApplicationEvent event); + + public void handleQuit(ApplicationEvent event); +} diff --git a/com/apple/eawt/CocoaComponent.java b/com/apple/eawt/CocoaComponent.java new file mode 100644 index 0000000..5d6cf30 --- /dev/null +++ b/com/apple/eawt/CocoaComponent.java @@ -0,0 +1,56 @@ +/* + * CocoaComponent.java + * allusionsApp + * + * Created by Matthieu Cormier on Fri Jun 20 2003. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +package com.apple.eawt; + +// This is a stub interface for non Mac OS X java 1.4 environments + +public abstract class CocoaComponent extends java.awt.Canvas { + /** + * + */ + private static final long serialVersionUID = 1L; + + public CocoaComponent() { + } + + public abstract int createNSView(); + + @Override + public abstract java.awt.Dimension getMaximumSize(); + + /** + * + * @return + */ + @Override + public abstract java.awt.Dimension getMinimumSize(); + + /** + * + * @return + */ + @Override + public abstract java.awt.Dimension getPreferredSize(); + + public void sendMessage(final int messageID, final java.lang.Object message) { + } +} diff --git a/de/erichseifert/vectorgraphics2d/DataUtils.java b/de/erichseifert/vectorgraphics2d/DataUtils.java new file mode 100644 index 0000000..5e3e018 --- /dev/null +++ b/de/erichseifert/vectorgraphics2d/DataUtils.java @@ -0,0 +1,103 @@ +/* + * VectorGraphics2D: Vector export for Java(R) Graphics2D + * + * (C) Copyright 2010 Erich Seifert + * + * This file is part of VectorGraphics2D. + * + * VectorGraphics2D is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * VectorGraphics2D is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with VectorGraphics2D. If not, see . + */ + +package de.erichseifert.vectorgraphics2d; + +import java.util.HashMap; +import java.util.Map; + +/** + * Abstract class that contains utility functions for working with data + * collections like maps or lists. + */ +public abstract class DataUtils { + /** + * Default constructor that prevents creation of class. + */ + protected DataUtils() { + throw new UnsupportedOperationException(); + } + + /** + * Creates a mapping from two arrays, one with keys, one with values. + * @param Data type of the keys. + * @param Data type of the values. + * @param keys Array containing the keys. + * @param values Array containing the values. + * @return Map with keys and values from the specified arrays. + */ + public static Map map(K[] keys, V[] values) { + // Check for valid parameters + if (keys.length != values.length) { + throw new IllegalArgumentException( + "Number of keys and values is different. " + + "Cannot create map."); + } + // Fill map with keys and values + Map map = new HashMap(); + for (int i = 0; i < keys.length; i++) { + K key = keys[i]; + V value = values[i]; + map.put(key, value); + } + return map; + } + + /** + * Returns a string with all float values divided by a specified separator. + * @param separator Separator string. + * @param elements Float array. + * @return Joined string. + */ + public static String join(String separator, float... elements) { + if (elements == null || elements.length == 0) { + return ""; + } + StringBuffer sb = new StringBuffer(elements.length*3); + for (int i = 0; i < elements.length; i++) { + if (i > 0) { + sb.append(separator); + } + sb.append(elements[i]); + } + return sb.toString(); + } + + /** + * Returns a string with all float values divided by a specified separator. + * @param separator Separator string. + * @param elements Double array. + * @return Joined string. + */ + public static String join(String separator, double... elements) { + if (elements == null || elements.length == 0) { + return ""; + } + StringBuffer sb = new StringBuffer(elements.length*3); + for (int i = 0; i < elements.length; i++) { + if (i > 0) { + sb.append(separator); + } + sb.append(elements[i]); + } + return sb.toString(); + } +} diff --git a/de/erichseifert/vectorgraphics2d/EPSGraphics2D.java b/de/erichseifert/vectorgraphics2d/EPSGraphics2D.java new file mode 100644 index 0000000..c3e7294 --- /dev/null +++ b/de/erichseifert/vectorgraphics2d/EPSGraphics2D.java @@ -0,0 +1,459 @@ +/* + * VectorGraphics2D: Vector export for Java(R) Graphics2D + * + * (C) Copyright 2010 Erich Seifert + * + * This file is part of VectorGraphics2D. + * + * VectorGraphics2D is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * VectorGraphics2D is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with VectorGraphics2D. If not, see . + */ + +package de.erichseifert.vectorgraphics2d; + +import java.awt.BasicStroke; +import java.awt.Color; +import java.awt.Font; +import java.awt.Image; +import java.awt.Shape; +import java.awt.Stroke; +import java.awt.geom.AffineTransform; +import java.awt.geom.Arc2D; +import java.awt.geom.Ellipse2D; +import java.awt.geom.Line2D; +import java.awt.geom.PathIterator; +import java.awt.geom.Rectangle2D; +import java.awt.image.BufferedImage; +import java.io.UnsupportedEncodingException; +import java.util.Arrays; +import java.util.Map; + +/** + * Graphics2D implementation that saves all operations to a string + * in the Encapsulated PostScript® (EPS) format. + */ +public class EPSGraphics2D extends VectorGraphics2D { + /** Constant to convert values from millimeters to PostScript® units + (1/72th inch). */ +// protected static final double MM_IN_UNITS = 72.0 / 25.4; + protected static final double MM_IN_UNITS = 1.0; + + /** Mapping of stroke endcap values from Java to PostScript®. */ + private static final Map STROKE_ENDCAPS = DataUtils.map( + new Integer[] { BasicStroke.CAP_BUTT, BasicStroke.CAP_ROUND, BasicStroke.CAP_SQUARE }, + new Integer[] { 0, 1, 2 } + ); + + /** Mapping of line join values for path drawing from Java to + PostScript®. */ + private static final Map STROKE_LINEJOIN = DataUtils.map( + new Integer[] { BasicStroke.JOIN_MITER, BasicStroke.JOIN_ROUND, BasicStroke.JOIN_BEVEL }, + new Integer[] { 0, 1, 2 } + ); + + /** + * Constructor that initializes a new EPSGraphics2D instance. + * The document dimension must be specified as parameters. + */ + public EPSGraphics2D(double x, double y, double width, double height) { + super(x, y, width, height); + writeHeader(); + } + + @Override + protected void writeString(String str, double x, double y) { + // Escape string + str = str.replaceAll("\\\\", "\\\\\\\\").replaceAll("\t", "\\\\t") + .replaceAll("\b", "\\\\b").replaceAll("\f", "\\\\f") + .replaceAll("\\(", "\\\\(").replaceAll("\\)", "\\\\)"); + + //float fontSize = getFont().getSize2D(); + //float leading = getFont().getLineMetrics("", getFontRenderContext()) + // .getLeading(); + + write("gsave 1 -1 scale "); + + /* + // Extract lines + String[] lines = str.replaceAll("\r\n", "\n").replaceAll("\r", "\n") + .split("\n"); + // Output lines + for (int i = 0; i < lines.length; i++) { + String line = lines[i]; + write(x, " -", y + i*fontSize + ((i>0) ? leading : 0f), + " M (", line, ") show "); + } + */ + + str = str.replaceAll("[\r\n]", ""); + write(x, " -", y, " M (", str, ") show "); + + writeln("grestore"); + } + + @Override + public void setStroke(Stroke s) { + BasicStroke bsPrev; + if (getStroke() instanceof BasicStroke) { + bsPrev = (BasicStroke) getStroke(); + } else { + bsPrev = new BasicStroke(); + } + + super.setStroke(s); + + if (s instanceof BasicStroke) { + BasicStroke bs = (BasicStroke) s; + if (bs.getLineWidth() != bsPrev.getLineWidth()) { + writeln(bs.getLineWidth(), " setlinewidth"); + } + if (bs.getLineJoin() != bsPrev.getLineJoin()) { + writeln(STROKE_LINEJOIN.get(bs.getLineJoin()), " setlinejoin"); + } + if (bs.getEndCap() != bsPrev.getEndCap()) { + writeln(STROKE_ENDCAPS.get(bs.getEndCap()), " setlinecap"); + } + if ((!Arrays.equals(bs.getDashArray(), bsPrev.getDashArray())) || + (bs.getDashPhase() != bsPrev.getDashPhase())) { + writeln("[", DataUtils.join(" ", bs.getDashArray()), "] ", + bs.getDashPhase(), " setdash"); + } + } + } + + @Override + protected void writeImage(Image img, int imgWidth, int imgHeight, + double x, double y, double width, double height) { + BufferedImage bufferedImg = GraphicsUtils.toBufferedImage(img); + String imgData = getEps(bufferedImg); + int bands = bufferedImg.getSampleModel().getNumBands(); + int bitsPerPixel = (int) Math.ceil( + bufferedImg.getColorModel().getPixelSize() / 8.0) * 8; + int bitsPerSample = bitsPerPixel / bands; + if (bands > 3) { + bands = 3; + } + writeln("gsave"); + writeln(x, " ", y, " ", width, " ", height, " ", + imgWidth, " ", imgHeight, " ", bitsPerSample, " img false ", bands, + " colorimage" + ); + writeln(imgData, ">"); + writeln("grestore"); + } + + @Override + public void setColor(Color c) { + Color color = getColor(); + if (c != null) { + super.setColor(c); + // TODO Add transparency hints for PDF conversion? + /*if (color.getAlpha() != c.getAlpha()) { + double a = c.getAlpha()/255.0; + writeln("[ /ca ", a, " /SetTransparency pdfmark"); + }*/ + if (color.getRed() != c.getRed() || color.getGreen() != c.getGreen() + || color.getBlue() != c.getBlue()) { + double r = c.getRed()/255.0; + double g = c.getGreen()/255.0; + double b = c.getBlue()/255.0; + writeln(r, " ", g, " ", b, " rgb"); + } + } + } + + @Override + public void setFont(Font font) { + if (!getFont().equals(font)) { + super.setFont(font); + writeln("/", font.getPSName(), " ", font.getSize2D(), + " selectfont"); + + } + } + + @Override + public void setClip(Shape clip) { + if (getClip() != null) { + writeln("cliprestore"); + } + super.setClip(clip); + if (getClip() != null) { + writeShape(getClip()); + writeln(" clip"); + } + } + + @Override + public void setTransform(AffineTransform tx) { + if (getTransform().equals(tx)) { + return; + } + super.setTransform(tx); + double[] matrix = new double[6]; + getTransform().getMatrix(matrix); + writeln("basematrix setmatrix [", DataUtils.join(" ", matrix), + "] concat"); + } + + @Override + public void translate(double tx, double ty) { + super.translate(tx, ty); + if ((tx != 0.0) || (ty != 0.0)) { + writeln(tx, " ", ty, " translate"); + } + } + + @Override + public void scale(double sx, double sy) { + super.scale(sx, sy); + if ((sx != 1.0) || (sy != 1.0)) { + writeln(sx, " ", sy, " scale"); + } + } + + @Override + public void rotate(double theta) { + super.rotate(theta); + if (theta != 0.0) { + writeln(theta/Math.PI*180.0, " rotate"); + } + } + + @Override + public void rotate(double theta, double x, double y) { + super.rotate(theta, x, y); + if (theta != 0.0) { + writeln(x, " ", y, " translate ", theta/Math.PI*180.0, " rotate ", + -x, " ", -y, " translate"); + } + } + + @Override + public void shear(double sx, double sy) { + super.shear(sx, sy); + if ((sx != 0.0) || (sy != 0.0)) { + setTransform(getTransform()); + } + } + + @Override + protected void writeHeader() { + Rectangle2D bounds = getBounds(); + double x = bounds.getX() * MM_IN_UNITS; + double y = bounds.getY() * MM_IN_UNITS; + double w = bounds.getWidth() * MM_IN_UNITS; + double h = bounds.getHeight() * MM_IN_UNITS; + + writeln("%!PS-Adobe-3.0 EPSF-3.0"); + writeln("%%BoundingBox: ", + (int) Math.floor(x), " ", (int) Math.floor(y), " ", + (int) Math.ceil(x + w), " ", (int) Math.ceil(y + h)); + writeln("%%HiResBoundingBox: ", x, " ", y, " ", x + w, " ", y + h); + writeln("%%LanguageLevel: 3"); + writeln("%%Pages: 1"); + writeln("%%Page: 1 1"); + + // Utility functions + writeln("/M /moveto load def"); + writeln("/L /lineto load def"); + writeln("/C /curveto load def"); + writeln("/Z /closepath load def"); + writeln("/RL /rlineto load def"); + writeln("/rgb /setrgbcolor load def"); + writeln("/rect { ", + "/height exch def /width exch def /y exch def /x exch def ", + "x y M width 0 RL 0 height RL width neg 0 RL ", + "} bind def"); + writeln("/ellipse { ", + "/endangle exch def /startangle exch def ", + "/ry exch def /rx exch def /y exch def /x exch def ", + "/savematrix matrix currentmatrix def ", + "x y translate rx ry scale 0 0 1 startangle endangle arcn ", + "savematrix setmatrix ", + "} bind def"); + writeln("/img { ", + "/bits exch def /imgheight exch def /imgwidth exch def ", + "/height exch def /width exch def /y exch def /x exch def ", + "x y translate width height scale ", + "imgwidth imgheight bits [imgwidth 0 0 imgheight 0 0] currentfile ", + "/ASCIIHexDecode filter ", + "} bind def"); + // Set default font + writeln("/", getFont().getPSName(), " ", getFont().getSize2D(), + " selectfont"); + //writeln("<< /AllowTransparency true >> setdistillerparams"); // TODO + // Save state + writeln("gsave"); + // Save state + writeln("clipsave"); + // Settings + writeln("/DeviceRGB setcolorspace"); + // Adjust page size and page origin + writeln("0 ", h, " translate"); + writeln(MM_IN_UNITS, " -", MM_IN_UNITS, " scale"); + writeln("/basematrix matrix currentmatrix def"); + } + + /** + * Utility method for writing a tag closing fragment for drawing operations. + */ + @Override + protected void writeClosingDraw(Shape s) { + writeln(" stroke"); + } + + /** + * Utility method for writing a tag closing fragment for filling operations. + */ + @Override + protected void writeClosingFill(Shape s) { + // TODO Omit fill operation if paint isn't a Color object + writeln(" fill"); + if (!(getPaint() instanceof Color)) { + super.writeClosingFill(s); + } + } + + /** + * Utility method for writing an arbitrary shape to. + * It tries to translate Java2D shapes to the corresponding EPS shape + * commands. + */ + @Override + protected void writeShape(Shape s) { + write("newpath "); + if (s instanceof Line2D) { + Line2D l = (Line2D) s; + double x1 = l.getX1(); + double y1 = l.getY1(); + double x2 = l.getX2(); + double y2 = l.getY2(); + write(x1, " ", y1, " M ", x2, " ", y2, " L"); + return; + } else if (s instanceof Rectangle2D) { + Rectangle2D r = (Rectangle2D) s; + double x = r.getX(); + double y = r.getY(); + double width = r.getWidth(); + double height = r.getHeight(); + write(x, " ", y, " ", width, " ", height, " rect Z"); + return; + } else if (s instanceof Ellipse2D) { + Ellipse2D e = (Ellipse2D) s; + double x = e.getX() + e.getWidth()/2.0; + double y = e.getY() + e.getHeight()/2.0; + double rx = e.getWidth()/2.0; + double ry = e.getHeight()/2.0; + write(x, " ", y, " ", rx, " ", ry, " ", 360.0, " ", 0.0, + " ellipse Z"); + return; + } else if (s instanceof Arc2D) { + Arc2D e = (Arc2D) s; + double x = (e.getX() + e.getWidth()/2.0); + double y = (e.getY() + e.getHeight()/2.0); + double rx = e.getWidth()/2.0; + double ry = e.getHeight()/2.0; + double startAngle = -e.getAngleStart(); + double endAngle = -(e.getAngleStart() + e.getAngleExtent()); + write(x, " ", y, " ", rx, " ", ry, " ", startAngle, " ", endAngle, + " ellipse"); + if (e.getArcType() == Arc2D.CHORD) { + write(" Z"); + } else if (e.getArcType() == Arc2D.PIE) { + write(" ", x, " ", y, " L Z"); + } + return; + } else { + PathIterator segments = s.getPathIterator(null); + double[] coordsCur = new double[6]; + double[] pointPrev = new double[2]; + for (int i = 0; !segments.isDone(); i++, segments.next()) { + if (i > 0) { + write(" "); + } + int segmentType = segments.currentSegment(coordsCur); + switch (segmentType) { + case PathIterator.SEG_MOVETO: + write(coordsCur[0], " ", coordsCur[1], " M"); + pointPrev[0] = coordsCur[0]; + pointPrev[1] = coordsCur[1]; + break; + case PathIterator.SEG_LINETO: + write(coordsCur[0], " ", coordsCur[1], " L"); + pointPrev[0] = coordsCur[0]; + pointPrev[1] = coordsCur[1]; + break; + case PathIterator.SEG_CUBICTO: + write(coordsCur[0], " ", coordsCur[1], " ", + coordsCur[2], " ", coordsCur[3], " ", + coordsCur[4], " ", coordsCur[5], " C"); + pointPrev[0] = coordsCur[4]; + pointPrev[1] = coordsCur[5]; + break; + case PathIterator.SEG_QUADTO: + double x1 = pointPrev[0] + 2.0/3.0*(coordsCur[0] - pointPrev[0]); + double y1 = pointPrev[1] + 2.0/3.0*(coordsCur[1] - pointPrev[1]); + double x2 = coordsCur[0] + 1.0/3.0*(coordsCur[2] - coordsCur[0]); + double y2 = coordsCur[1] + 1.0/3.0*(coordsCur[3] - coordsCur[1]); + double x3 = coordsCur[2]; + double y3 = coordsCur[3]; + write(x1, " ", y1, " ", x2, " ", y2, " ", x3, " ", y3, + " C"); + pointPrev[0] = x3; + pointPrev[1] = y3; + break; + case PathIterator.SEG_CLOSE: + write("Z"); + break; + default: + throw new IllegalStateException("Unknown path operation."); + } + } + } + } + + public static String getEps(BufferedImage bufferedImg) { + int width = bufferedImg.getWidth(); + int height = bufferedImg.getHeight(); + int bands = bufferedImg.getSampleModel().getNumBands(); + StringBuffer str = new StringBuffer(width*height*bands*2); + for (int y = 0; y < height; y++) { + for (int x = 0; x < width; x++) { + int pixel = bufferedImg.getRGB(x, y) & 0xffffff; + if (bands >= 3) { + String hex = String.format("%06x", pixel); + str.append(hex); + } else if (bands == 1) { + str.append(String.format("%02x", pixel)); + } + } + str.append("\n"); + } + return str.toString(); + } + + @Override + protected String getFooter() { + return "grestore % Restore state\n%%EOF\n"; + } + + @Override + public byte[] getBytes() { + try { + return toString().getBytes("ISO-8859-1"); + } catch (UnsupportedEncodingException e) { + return super.getBytes(); + } + } +} diff --git a/de/erichseifert/vectorgraphics2d/GraphicsUtils.java b/de/erichseifert/vectorgraphics2d/GraphicsUtils.java new file mode 100644 index 0000000..48b742a --- /dev/null +++ b/de/erichseifert/vectorgraphics2d/GraphicsUtils.java @@ -0,0 +1,125 @@ +/* + * VectorGraphics2D: Vector export for Java(R) Graphics2D + * + * (C) Copyright 2010 Erich Seifert + * + * This file is part of VectorGraphics2D. + * + * VectorGraphics2D is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * VectorGraphics2D is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with VectorGraphics2D. If not, see . + */ + +package de.erichseifert.vectorgraphics2d; + +import java.awt.Graphics; +import java.awt.GraphicsConfiguration; +import java.awt.GraphicsDevice; +import java.awt.GraphicsEnvironment; +import java.awt.HeadlessException; +import java.awt.Image; +import java.awt.Transparency; +import java.awt.image.BufferedImage; +import java.awt.image.ColorModel; +import java.awt.image.PixelGrabber; + +import javax.swing.ImageIcon; + +/** + * Abstract class that contains utility functions for working with graphics. + * For example, this includes font handling. + */ +public abstract class GraphicsUtils { + /** + * Default constructor that prevents creation of class. + */ + protected GraphicsUtils() { + throw new UnsupportedOperationException(); + } + + /** + * This method returns true if the specified image + * has transparent pixels. + * Taken from http://www.exampledepot.com/egs/java.awt.image/HasAlpha.html + * @param image + * @return true if the specified image has transparent pixels, + * false otherwise + */ + public static boolean hasAlpha(Image image) { + // If buffered image, the color model is readily available + if (image instanceof BufferedImage) { + BufferedImage bimage = (BufferedImage) image; + return bimage.getColorModel().hasAlpha(); + } + // Use a pixel grabber to retrieve the image's color model; + // grabbing a single pixel is usually sufficient + PixelGrabber pg = new PixelGrabber(image, 0, 0, 1, 1, false); + try { + pg.grabPixels(); + } catch (InterruptedException e) { + } + // Get the image's color model + ColorModel cm = pg.getColorModel(); + return cm.hasAlpha(); + } + + /** + * This method returns a buffered image with the contents of an image. + * Taken from http://www.exampledepot.com/egs/java.awt.image/Image2Buf.html + * @param image Image ot be converted + * @return a buffered image with the contents of the specified image + */ + public static BufferedImage toBufferedImage(Image image) { + if (image instanceof BufferedImage) { + return (BufferedImage) image; + } + // This code ensures that all the pixels in the image are loaded + image = new ImageIcon(image).getImage(); + // Determine if the image has transparent pixels + boolean hasAlpha = hasAlpha(image); + // Create a buffered image with a format that's compatible with the + // screen + BufferedImage bimage = null; + GraphicsEnvironment ge = GraphicsEnvironment + .getLocalGraphicsEnvironment(); + try { + // Determine the type of transparency of the new buffered image + int transparency = Transparency.OPAQUE; + if (hasAlpha) { + transparency = Transparency.BITMASK; + } + // Create the buffered image + GraphicsDevice gs = ge.getDefaultScreenDevice(); + GraphicsConfiguration gc = gs.getDefaultConfiguration(); + bimage = gc.createCompatibleImage( + image.getWidth(null), image.getHeight(null), transparency); + } catch (HeadlessException e) { + // The system does not have a screen + bimage = null; + } + if (bimage == null) { + // Create a buffered image using the default color model + int type = BufferedImage.TYPE_INT_RGB; + if (hasAlpha) { + type = BufferedImage.TYPE_INT_ARGB; + } + bimage = new BufferedImage( + image.getWidth(null), image.getHeight(null), type); + } + // Copy image to buffered image + Graphics g = bimage.createGraphics(); + // Paint the image onto the buffered image + g.drawImage(image, 0, 0, null); + g.dispose(); + return bimage; + } +} diff --git a/de/erichseifert/vectorgraphics2d/PDFGraphics2D.java b/de/erichseifert/vectorgraphics2d/PDFGraphics2D.java new file mode 100644 index 0000000..ab1c1a0 --- /dev/null +++ b/de/erichseifert/vectorgraphics2d/PDFGraphics2D.java @@ -0,0 +1,637 @@ +/* + * VectorGraphics2D: Vector export for Java(R) Graphics2D + * + * (C) Copyright 2010 Erich Seifert + * + * This file is part of VectorGraphics2D. + * + * VectorGraphics2D is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * VectorGraphics2D is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with VectorGraphics2D. If not, see . + */ + +package de.erichseifert.vectorgraphics2d; + +import java.awt.BasicStroke; +import java.awt.Color; +import java.awt.Font; +import java.awt.Image; +import java.awt.Shape; +import java.awt.Stroke; +import java.awt.geom.AffineTransform; +import java.awt.geom.Line2D; +import java.awt.geom.PathIterator; +import java.awt.geom.Rectangle2D; +import java.awt.image.BufferedImage; +import java.io.UnsupportedEncodingException; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.TreeMap; +import rene.zirkel.objects.AngleObject; + +/** + * Graphics2D implementation that saves all operations to a string + * in the Portable Document Format (PDF). + */ +public class PDFGraphics2D extends VectorGraphics2D { + /** Prefix string for PDF font resource ids. */ + protected static final String FONT_RESOURCE_PREFIX = "F"; + /** Prefix string for PDF image resource ids. */ + protected static final String IMAGE_RESOURCE_PREFIX = "Im"; + /** Prefix string for PDF transparency resource ids. */ + protected static final String TRANSPARENCY_RESOURCE_PREFIX = "T"; + + /** Constant to convert values from millimeters to PostScript®/PDF units (1/72th inch). */ + protected static final double MM_IN_UNITS = 72.0 / 25.4; + + /** Mapping of stroke endcap values from Java to PDF. */ + private static final Map STROKE_ENDCAPS = DataUtils.map( + new Integer[] { BasicStroke.CAP_BUTT, BasicStroke.CAP_ROUND, BasicStroke.CAP_SQUARE }, + new Integer[] { 0, 1, 2 } + ); + + /** Mapping of line join values for path drawing from Java to PDF. */ + private static final Map STROKE_LINEJOIN = DataUtils.map( + new Integer[] { BasicStroke.JOIN_MITER, BasicStroke.JOIN_ROUND, BasicStroke.JOIN_BEVEL }, + new Integer[] { 0, 1, 2 } + ); + + /** Id of the current PDF object. */ + private int curObjId; + /** Mapping from objects to file positions. */ + private final Map objPositions; + /** Mapping from transparency levels to transparency resource ids. */ + private final Map transpResources; + /** Mapping from image data to image resource ids. */ + private final Map imageResources; + /** Mapping from font objects to font resource ids. */ + private final Map fontResources; + /** File position of the actual content. */ + private int contentStart; + + /** + * Constructor that initializes a new PDFGraphics2D instance. + * The document dimension must be specified as parameters. + */ + public PDFGraphics2D(double x, double y, double width, double height) { + super(x, y, width, height); + curObjId = 1; + objPositions = new TreeMap(); + transpResources = new TreeMap(); + imageResources = new LinkedHashMap(); + fontResources = new LinkedHashMap(); + writeHeader(); + } + + @Override + protected void writeString(String str, double x, double y) { + // Escape string + str = str.replaceAll("\\\\", "\\\\\\\\") + .replaceAll("\t", "\\\\t").replaceAll("\b", "\\\\b").replaceAll("\f", "\\\\f") + .replaceAll("\\(", "\\\\(").replaceAll("\\)", "\\\\)"); + + x+=getTransform().getTranslateX(); + y+=getTransform().getTranslateY(); + + float fontSize = getFont().getSize2D(); + + + //float leading = getFont().getLineMetrics("", getFontRenderContext()).getLeading(); + + // Start text and save current graphics state + writeln("q BT"); + + String fontResourceId = getFontResource(getFont()); + writeln("/", fontResourceId, " ", fontSize, " Tf"); + // Set leading + //writeln(fontSize + leading, " TL"); + + // Undo swapping of y axis for text + writeln("1 0 0 -1 ", x, " ", y, " cm"); + + /* + // Extract lines + String[] lines = str.replaceAll("\r\n", "\n").replaceAll("\r", "\n").split("\n"); + // Paint lines + for (int i = 0; i < lines.length; i++) { + writeln("(", lines[i], ") ", (i == 0) ? "Tj" : "'"); + }*/ + + str = str.replaceAll("[\r\n]", ""); + writeln("(", str, ") Tj"); + + // End text and restore previous graphics state + writeln("ET Q"); + } + + @Override + public void setStroke(Stroke s) { + BasicStroke bsPrev; + if (getStroke() instanceof BasicStroke) { + bsPrev = (BasicStroke) getStroke(); + } else { + bsPrev = new BasicStroke(); + } + + super.setStroke(s); + + if (s instanceof BasicStroke) { + BasicStroke bs = (BasicStroke) s; + if (bs.getLineWidth() != bsPrev.getLineWidth()) { + writeln(bs.getLineWidth(), " w"); + } + if (bs.getLineJoin() != bsPrev.getLineJoin()) { + writeln(STROKE_LINEJOIN.get(bs.getLineJoin()), " j"); + } + if (bs.getEndCap() != bsPrev.getEndCap()) { + writeln(STROKE_ENDCAPS.get(bs.getEndCap()), " J"); + } + if ((!Arrays.equals(bs.getDashArray(), bsPrev.getDashArray())) + || (bs.getDashPhase() != bsPrev.getDashPhase())) { + writeln("[", DataUtils.join(" ", bs.getDashArray()), "] ", + bs.getDashPhase(), " d"); + } + } + } + + @Override + protected void writeImage(Image img, int imgWidth, int imgHeight, + double x, double y, double width, double height) { + BufferedImage bufferedImg = GraphicsUtils.toBufferedImage(img); + String imageResourceId = getImageResource(bufferedImg); + // Save graphics state + write("q "); + // Take current transformations into account + AffineTransform txCurrent = getTransform(); + if (!txCurrent.isIdentity()) { + double[] matrix = new double[6]; + txCurrent.getMatrix(matrix); + write(DataUtils.join(" ", matrix), " cm "); + } + // Move image to correct position and scale it to (width, height) + write(width, " 0 0 ", height, " ", x, " ", y, " cm "); + // Swap y axis + write("1 0 0 -1 0 1 cm "); + // Draw image + write("/", imageResourceId, " Do "); + // Restore old graphics state + writeln("Q"); + } + + @Override + public void setColor(Color c) { + Color color = getColor(); + if (c != null) { + super.setColor(c); + if (color.getAlpha() != c.getAlpha()) { + // Add a new graphics state to resources + double a = c.getAlpha()/255.0; + + String transpResourceId = getTransparencyResource(a); + writeln("/", transpResourceId, " gs"); + } + if (color.getRed() != c.getRed() || color.getGreen() != c.getGreen() + || color.getBlue() != c.getBlue()) { + double r = c.getRed()/255.0; + double g = c.getGreen()/255.0; + double b = c.getBlue()/255.0; + write(r, " ", g, " ", b, " rg "); + writeln(r, " ", g, " ", b, " RG"); + } + } + } + + @Override + public void setClip(Shape clip) { + if (getClip() != null) { + writeln("Q"); + } + super.setClip(clip); + if (getClip() != null) { + writeln("q"); + writeShape(getClip()); + writeln(" W n"); + } + } + + // TODO Correct transformations + /* + @Override + protected void setAffineTransform(AffineTransform tx) { + if (getTransform().equals(tx)) { + return; + } + // Undo previous transforms + if (isTransformed()) { + writeln("Q"); + } + // Set new transform + super.setAffineTransform(tx); + // Write transform to document + if (isTransformed()) { + writeln("q"); + double[] matrix = new double[6]; + getTransform().getMatrix(matrix); + writeln(DataUtils.join(" ", matrix), " cm"); + } + } + //*/ + + @Override + protected void writeHeader() { + Rectangle2D bounds = getBounds(); + int x = (int) Math.floor(bounds.getX() * MM_IN_UNITS); + int y = (int) Math.floor(bounds.getY() * MM_IN_UNITS); + int w = (int) Math.ceil(bounds.getWidth() * MM_IN_UNITS); + int h = (int) Math.ceil(bounds.getHeight() * MM_IN_UNITS); + + writeln("%PDF-1.4"); + // Object 1 + writeObj( + "Type", "/Catalog", + "Pages", "2 0 R" + ); + // Object 2 + writeObj( + "Type", "/Pages", + "Kids", "[3 0 R]", + "Count", "1" + ); + // Object 3 + writeObj( + "Type", "/Page", + "Parent", "2 0 R", + "MediaBox", String.format("[%d %d %d %d]", x, y, w, h), + "Contents", "4 0 R", + "Resources", "6 0 R" + ); + // Object 5 + writeln(nextObjId(size()), " 0 obj"); + writeDict("Length", "5 0 R"); + writeln("stream"); + contentStart = size(); + writeln("q"); + // Adjust page size and page origin + writeln(MM_IN_UNITS, " 0 0 ", -MM_IN_UNITS, " 0 ", h, " cm"); + } + + /** + * Write a PDF dictionary from the specified collection of objects. + * The passed objects are converted to strings. Every object with odd + * position is used as key, every object with even position is used + * as value. + * @param strs Objects to be written to dictionary + */ + protected void writeDict(Object... strs) { + writeln("<<"); + for (int i = 0; i < strs.length; i += 2) { + writeln("/", strs[i], " ", strs[i + 1]); + } + writeln(">>"); + } + + /** + * Write a collection of elements to the document stream as PDF object. + * The passed objects are converted to strings. + * @param strs Objects to be written to the document stream. + * @return Id of the PDF object that was written. + */ + protected int writeObj(Object... strs) { + int objId = nextObjId(size()); + writeln(objId, " 0 obj"); + writeDict(strs); + writeln("endobj"); + return objId; + } + + /** + * Returns the next PDF object id without incrementing. + * @return Next PDF object id. + */ + protected int peekObjId() { + return curObjId + 1; + } + + /** + * Returns a new PDF object id with every call. + * @param position File position of the object. + * @return A new PDF object id. + */ + private int nextObjId(int position) { + objPositions.put(curObjId, position); + return curObjId++; + } + + /** + * Returns the resource for the specified transparency level. + * @param a Transparency level. + * @return A new PDF object id. + */ + protected String getTransparencyResource(double a) { + String name = transpResources.get(a); + if (name == null) { + name = String.format("%s%d", TRANSPARENCY_RESOURCE_PREFIX, + transpResources.size() + 1); + transpResources.put(a, name); + } + return name; + } + + /** + * Returns the resource for the specified image data. + * @param bufferedImg Image object with data. + * @return A new PDF object id. + */ + protected String getImageResource(BufferedImage bufferedImg) { + String name = imageResources.get(bufferedImg); + if (name == null) { + name = String.format("%s%d", IMAGE_RESOURCE_PREFIX, + imageResources.size() + 1); + imageResources.put(bufferedImg, name); + } + return name; + } + + /** + * Returns the resource describing the specified font. + * @param font Font to be described. + * @return A new PDF object id. + */ + protected String getFontResource(Font font) { + String name = fontResources.get(font); + if (name == null) { + name = String.format("%s%d", FONT_RESOURCE_PREFIX, + fontResources.size() + 1); + fontResources.put(font, name); + } + return name; + } + + /** + * Utility method for writing a tag closing fragment for drawing + * operations. + */ + @Override + protected void writeClosingDraw(Shape s) { + writeln(" S"); + } + + /** + * Utility method for writing a tag closing fragment for filling + * operations. + */ + @Override + protected void writeClosingFill(Shape s) { + writeln(" f"); + if (!(getPaint() instanceof Color)) { + super.writeClosingFill(s); + } + } + + /** + * Utility method for writing an arbitrary shape to. + * It tries to translate Java2D shapes to the corresponding PDF shape + * commands. + */ + @Override + protected void writeShape(Shape s) { + // TODO Correct transformations + +// if (s instanceof Line2D) { +// Line2D l = (Line2D) s; +// double x1 = l.getX1(); +// double y1 = l.getY1(); +// double x2 = l.getX2(); +// double y2 = l.getY2(); +// write(x1, " ", y1, " m ", x2, " ", y2, " l"); +// } else if (s instanceof Rectangle2D) { +// Rectangle2D r = (Rectangle2D) s; +// double x = r.getX(); +// double y = r.getY(); +// double width = r.getWidth(); +// double height = r.getHeight(); +// write(x, " ", y, " ", width, " ", height, " re"); +// } else + { + + s = getTransform().createTransformedShape(s); + PathIterator segments = s.getPathIterator(null); + double[] coordsCur = new double[6]; + double[] pointPrev = new double[2]; + for (int i = 0; !segments.isDone(); i++, segments.next()) { + if (i > 0) { + write(" "); + } + int segmentType = segments.currentSegment(coordsCur); + switch (segmentType) { + case PathIterator.SEG_MOVETO: + write(coordsCur[0], " ", coordsCur[1], " m"); + pointPrev[0] = coordsCur[0]; + pointPrev[1] = coordsCur[1]; + break; + case PathIterator.SEG_LINETO: + write(coordsCur[0], " ", coordsCur[1], " l"); + pointPrev[0] = coordsCur[0]; + pointPrev[1] = coordsCur[1]; + break; + case PathIterator.SEG_CUBICTO: + write(coordsCur[0], " ", coordsCur[1], " ", + coordsCur[2], " ", coordsCur[3], " ", + coordsCur[4], " ", coordsCur[5], " c"); + pointPrev[0] = coordsCur[4]; + pointPrev[1] = coordsCur[5]; + break; + case PathIterator.SEG_QUADTO: + double x1 = pointPrev[0] + 2.0/3.0*(coordsCur[0] - pointPrev[0]); + double y1 = pointPrev[1] + 2.0/3.0*(coordsCur[1] - pointPrev[1]); + double x2 = coordsCur[0] + 1.0/3.0*(coordsCur[2] - coordsCur[0]); + double y2 = coordsCur[1] + 1.0/3.0*(coordsCur[3] - coordsCur[1]); + double x3 = coordsCur[2]; + double y3 = coordsCur[3]; + write(x1, " ", y1, " ", x2, " ", y2, " ", + x3, " ", y3, " c"); + pointPrev[0] = x3; + pointPrev[1] = y3; + break; + case PathIterator.SEG_CLOSE: + write("h"); + break; + default: + throw new IllegalStateException("Unknown path operation."); + } + } + } + } + + /** + * Returns a string which represents the data of the specified image. + * @param bufferedImg Image to convert. + * @return String with image data. + */ + private String getPdf(BufferedImage bufferedImg) { + int width = bufferedImg.getWidth(); + int height = bufferedImg.getHeight(); + int bands = bufferedImg.getSampleModel().getNumBands(); + StringBuffer str = new StringBuffer(width*height*bands*2); + for (int y = 0; y < height; y++) { + for (int x = 0; x < width; x++) { + int pixel = bufferedImg.getRGB(x, y) & 0xffffff; + if (bands >= 3) { + String hex = String.format("%06x", pixel); + str.append(hex); + } else if (bands == 1) { + str.append(String.format("%02x", pixel)); + } + } + str.append('\n'); + } + return str.append('>').toString(); + } + + @Override + protected String getFooter() { + StringBuffer footer = new StringBuffer(); + // TODO Correct transformations + /*if (isTransformed()) { + footer.append("Q\n"); + }*/ + if (getClip() != null) { + footer.append("Q\n"); + } + footer.append("Q"); + int contentEnd = size() + footer.length(); + footer.append('\n'); + footer.append("endstream\n"); + footer.append("endobj\n"); + + int lenObjId = nextObjId(size() + footer.length()); + footer.append(lenObjId).append(" 0 obj\n"); + footer.append(contentEnd - contentStart).append('\n'); + footer.append("endobj\n"); + + int resourcesObjId = nextObjId(size() + footer.length()); + footer.append(resourcesObjId).append(" 0 obj\n"); + footer.append("<<\n"); + footer.append(" /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]\n"); + + + // Add resources for fonts + if (!fontResources.isEmpty()) { + footer.append(" /Font <<\n"); + for (Map.Entry entry : fontResources.entrySet()) { + Font font = entry.getKey(); + String resourceId = entry.getValue(); + footer.append(" /").append(resourceId) + .append(" << /Type /Font") + .append(" /Subtype /").append("TrueType") + .append(" /BaseFont /").append(font.getPSName()) + .append(" /Encoding /").append("WinAnsiEncoding") + .append(" >>\n"); + } + footer.append(" >>\n"); + } + + // Add resources for images + if (!imageResources.isEmpty()) { + footer.append(" /XObject <<\n"); + + int objIdOffset = 0; + for (Map.Entry entry : + imageResources.entrySet()) { + String resourceId = entry.getValue(); + footer.append(" /").append(resourceId).append(' ') + .append(curObjId + objIdOffset).append(" 0 R\n"); + objIdOffset++; + } + footer.append(" >>\n"); + } + + // Add resources for transparency levels + if (!transpResources.isEmpty()) { + footer.append(" /ExtGState <<\n"); + for (Map.Entry entry : transpResources.entrySet()) { + Double alpha = entry.getKey(); + String resourceId = entry.getValue(); + footer.append(" /").append(resourceId) + .append(" << /Type /ExtGState") + .append(" /ca ").append(alpha).append(" /CA ").append(alpha) + .append(" >>\n"); + } + footer.append(" >>\n"); + } + + footer.append(">>\n"); + footer.append("endobj\n"); + + // Add data of images + for (BufferedImage image : imageResources.keySet()) { + int imageObjId = nextObjId(size() + footer.length()); + footer.append(imageObjId).append(" 0 obj\n"); + footer.append("<<\n"); + String imageData = getPdf(image); + footer.append("/Type /XObject\n") + .append("/Subtype /Image\n") + .append("/Width ").append(image.getWidth()).append('\n') + .append("/Height ").append(image.getHeight()).append('\n') + .append("/ColorSpace /DeviceRGB\n") + .append("/BitsPerComponent 8\n") + .append("/Length ").append(imageData.length()).append('\n') + .append("/Filter /ASCIIHexDecode\n") + .append(">>\n") + .append("stream\n") + .append(imageData) + .append("\nendstream\n") + .append("endobj\n"); + } + + int objs = objPositions.size() + 1; + + int xrefPos = size() + footer.length(); + footer.append("xref\n"); + footer.append("0 ").append(objs).append('\n'); + // lines of xref entries must must be exactly 20 bytes long + // (including line break) and thus end with + footer.append(String.format("%010d %05d", 0, 65535)).append(" f \n"); + for (int pos : objPositions.values()) { + footer.append(String.format("%010d %05d", pos, 0)).append(" n \n"); + } + + footer.append("trailer\n"); + footer.append("<<\n"); + footer.append("/Size ").append(objs).append('\n'); + footer.append("/Root 1 0 R\n"); + footer.append(">>\n"); + footer.append("startxref\n"); + footer.append(xrefPos).append('\n'); + + footer.append("%%EOF\n"); + + return footer.toString(); + } + + @Override + public String toString() { + String doc = super.toString(); + //doc = doc.replaceAll("q\n[0-9]+\\.?[0-9]* [0-9]+\\.?[0-9]* [0-9]+\\.?[0-9]* [0-9]+\\.?[0-9]* [0-9]+\\.?[0-9]* [0-9]+\\.?[0-9]* cm\nQ\n", ""); + return doc; + } + + @Override + public byte[] getBytes() { + try { + return toString().getBytes("ISO-8859-1"); + } catch (UnsupportedEncodingException e) { + return super.getBytes(); + } + } +} diff --git a/de/erichseifert/vectorgraphics2d/SVGGraphics2D.java b/de/erichseifert/vectorgraphics2d/SVGGraphics2D.java new file mode 100644 index 0000000..700535b --- /dev/null +++ b/de/erichseifert/vectorgraphics2d/SVGGraphics2D.java @@ -0,0 +1,371 @@ +/* + * VectorGraphics2D: Vector export for Java(R) Graphics2D + * + * (C) Copyright 2010 Erich Seifert + * + * This file is part of VectorGraphics2D. + * + * VectorGraphics2D is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * VectorGraphics2D is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with VectorGraphics2D. If not, see . + */ + +package de.erichseifert.vectorgraphics2d; + +import java.awt.BasicStroke; +import java.awt.Color; +import java.awt.Image; +import java.awt.Shape; +import java.awt.geom.AffineTransform; +import java.awt.geom.Ellipse2D; +import java.awt.geom.Line2D; +import java.awt.geom.Path2D; +import java.awt.geom.PathIterator; +import java.awt.geom.Rectangle2D; +import java.awt.geom.RoundRectangle2D; +import java.awt.image.BufferedImage; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.util.Map; + +import javax.imageio.ImageIO; +import javax.xml.bind.DatatypeConverter; + +/** + * Graphics2D implementation that saves all operations to a string + * in the Scaled Vector Graphics (SVG) format. + */ +public class SVGGraphics2D extends VectorGraphics2D { + /** Mapping of stroke endcap values from Java to SVG. */ + private static final Map STROKE_ENDCAPS = DataUtils.map( + new Integer[] { BasicStroke.CAP_BUTT, BasicStroke.CAP_ROUND, BasicStroke.CAP_SQUARE }, + new String[] { "butt", "round", "square" } + ); + + /** Mapping of line join values for path drawing from Java to SVG. */ + private static final Map STROKE_LINEJOIN = DataUtils.map( + new Integer[] { BasicStroke.JOIN_MITER, BasicStroke.JOIN_ROUND, BasicStroke.JOIN_BEVEL }, + new String[] { "miter", "round", "bevel" } + ); + + /** Prefix string for ids of clipping paths. */ + private static final String CLIP_PATH_ID = "clip"; + /** Number of the current clipping path. */ + private long clipCounter; + + /** + * Constructor that initializes a new SVGGraphics2D instance. + * The document dimension must be specified as parameters. + */ + public SVGGraphics2D(double x, double y, double width, double height) { + super(x, y, width, height); + writeHeader(); + } + + @Override + protected void writeString(String str, double x, double y) { + // Escape string + str = str.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">"); + + float fontSize = getFont().getSize2D(); + //float leading = getFont().getLineMetrics("", getFontRenderContext()).getLeading(); + + /* + // Extract lines + String[] lines = str.replaceAll("\r\n", "\n").replaceAll("\r", "\n").split("\n"); + + // Output lines + writeln(""); + for (int i = 0; i < lines.length; i++) { + String line = lines[i]; + writeln(" 0) ? leading : 0f), "\">", line, ""); + } + writeln(""); + */ + + str = str.replaceAll("[\r\n]", ""); + writeln("", str, ""); + } + + @Override + protected void writeImage(Image img, int imgWidth, int imgHeight, double x, + double y, double width, double height) { + BufferedImage bufferedImg = GraphicsUtils.toBufferedImage(img); + String imgData = getSvg(bufferedImg); + write(""); + } + + @Override + public void drawPolygon(int[] xPoints, int[] yPoints, int nPoints) { + Path2D s = new Path2D.Double(Path2D.WIND_NON_ZERO, xPoints.length); + write(""); + writeShape(getClip()); + writeln("/>"); + writeln(""); + } + } + + @Override + protected void setAffineTransform(AffineTransform tx) { + if (getTransform().equals(tx)) { + return; + } + // Close previous transformation group + if (isTransformed()) { + writeln(""); + } + // Set transformation matrix + super.setAffineTransform(tx); + // Begin new transformation group + if (isTransformed()) { + double[] matrix = new double[6]; + getTransform().getMatrix(matrix); + write(""); + } + } + + @Override + protected void writeHeader() { + Rectangle2D bounds = getBounds(); + double x = bounds.getX(); + double y = bounds.getY(); + double w = bounds.getWidth(); + double h = bounds.getHeight(); + writeln(""); + writeln(""); + writeln(""); + writeln(""); + } + + @Override + protected void writeClosingDraw(Shape s) { + write("style=\"fill:none;stroke:", getSvg(getColor())); + if (getStroke() instanceof BasicStroke) { + BasicStroke stroke = (BasicStroke) getStroke(); + if (stroke.getLineWidth() != 1f) { + write(";stroke-width:", stroke.getLineWidth()); + } + if (stroke.getEndCap() != BasicStroke.CAP_BUTT) { + write(";stroke-linecap:", STROKE_ENDCAPS.get(stroke.getEndCap())); + } + if (stroke.getLineJoin() != BasicStroke.JOIN_MITER) { + write(";stroke-linejoin:", + STROKE_LINEJOIN.get(stroke.getLineJoin())); + } + //write(";stroke-miterlimit:", s.getMiterLimit()); + if (stroke.getDashArray() != null && stroke.getDashArray().length > 0) { + write(";stroke-dasharray:", + DataUtils.join(",", stroke.getDashArray())); + write(";stroke-dashoffset:", stroke.getDashPhase()); + } + } + if (getClip() != null) { + write("\" clip-path=\"url(#", CLIP_PATH_ID, clipCounter, ")"); + } + writeln("\" />"); + } + + @Override + protected void writeClosingFill(Shape s) { + if (getPaint() instanceof Color) { + write("style=\"fill:", getSvg(getColor()), ";stroke:none"); + if (getClip() != null) { + write("\" clip-path=\"url(#", CLIP_PATH_ID, clipCounter, ")"); + } + writeln("\" />"); + } else { + write("style=\"stroke:none\" />"); + super.writeClosingFill(s); + } + } + + @Override + protected void writeShape(Shape s) { + if (s instanceof Line2D) { + Line2D l = (Line2D) s; + double x1 = l.getX1(); + double y1 = l.getY1(); + double x2 = l.getX2(); + double y2 = l.getY2(); + write(" 0) { + write(" "); + } + int segmentType = segments.currentSegment(coords); + switch (segmentType) { + case PathIterator.SEG_MOVETO: + write("M", coords[0], ",", coords[1]); + break; + case PathIterator.SEG_LINETO: + write("L", coords[0], ",", coords[1]); + break; + case PathIterator.SEG_CUBICTO: + write("C", coords[0], ",", coords[1], " ", + coords[2], ",", coords[3], " ", + coords[4], ",", coords[5]); + break; + case PathIterator.SEG_QUADTO: + write("Q", coords[0], ",", coords[1], " ", + coords[2], ",", coords[3]); + break; + case PathIterator.SEG_CLOSE: + write("Z"); + break; + default: + throw new IllegalStateException("Unknown path operation."); + } + } + write("\" "); + } + } + + private static String getSvg(Color c) { + String color = "rgb(" + c.getRed() + "," + c.getGreen() + "," + + c.getBlue() + ")"; + if (c.getAlpha() < 255) { + double opacity = c.getAlpha()/255.0; + color += ";opacity:" + opacity; + } + return color; + } + + private static String getSvg(BufferedImage bufferedImg) { + ByteArrayOutputStream data = new ByteArrayOutputStream(); + try { + ImageIO.write(bufferedImg, "png", data); + } catch (IOException e) { + return ""; + } + String dataBase64 = DatatypeConverter + .printBase64Binary(data.toByteArray()); + return "data:image/png;base64," + dataBase64; + } + + @Override + protected String getFooter() { + String footer = ""; + // Close any previous transformation groups + if (isTransformed()) { + footer += "\n"; + } + footer += "\n"; + return footer; + } + + @Override + public String toString() { + String doc = super.toString(); + doc = doc.replaceAll("\n", ""); + return doc; + } +} diff --git a/de/erichseifert/vectorgraphics2d/VectorGraphics2D.java b/de/erichseifert/vectorgraphics2d/VectorGraphics2D.java new file mode 100644 index 0000000..a737ab7 --- /dev/null +++ b/de/erichseifert/vectorgraphics2d/VectorGraphics2D.java @@ -0,0 +1,957 @@ +/* + * VectorGraphics2D: Vector export for Java(R) Graphics2D + * + * (C) Copyright 2010 Erich Seifert + * + * This file is part of VectorGraphics2D. + * + * VectorGraphics2D is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * VectorGraphics2D is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with VectorGraphics2D. If not, see . + */ + +package de.erichseifert.vectorgraphics2d; + +import java.awt.AlphaComposite; +import java.awt.BasicStroke; +import java.awt.Color; +import java.awt.Composite; +import java.awt.Font; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.GraphicsConfiguration; +import java.awt.Image; +import java.awt.MultipleGradientPaint; +import java.awt.Paint; +import java.awt.Rectangle; +import java.awt.RenderingHints; +import java.awt.Shape; +import java.awt.Stroke; +import java.awt.font.FontRenderContext; +import java.awt.font.GlyphVector; +import java.awt.font.TextLayout; +import java.awt.geom.AffineTransform; +import java.awt.geom.Arc2D; +import java.awt.geom.Area; +import java.awt.geom.Ellipse2D; +import java.awt.geom.Line2D; +import java.awt.geom.Path2D; +import java.awt.geom.Rectangle2D; +import java.awt.geom.RoundRectangle2D; +import java.awt.image.AffineTransformOp; +import java.awt.image.BufferedImage; +import java.awt.image.BufferedImageOp; +import java.awt.image.ImageObserver; +import java.awt.image.RenderedImage; +import java.awt.image.renderable.RenderableImage; +import java.io.UnsupportedEncodingException; +import java.text.AttributedCharacterIterator; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; + +/** + * Base for classed that want to implement vector export. + * @author Erich Seifert + */ +public abstract class VectorGraphics2D extends Graphics2D { + /** Constants to define how fonts are rendered. */ + public static enum FontRendering { + /** Constant indicating that fonts should be rendered as + text objects. */ + TEXT, + /** Constant indicating that fonts should be converted to vectors. */ + VECTORS + } + /** Maximal resolution for image rastering. */ + private static final int DEFAULT_PAINT_IMAGE_SIZE_MAXIMUM = 128; + + /** Document contents. */ + private final StringBuffer document; + /** Rectangular bounds of the documents. */ + private final Rectangle2D bounds; + /** Resolution in dots per inch that is used to raster paints. */ + private double resolution; + /** Maximal size of images that are used to raster paints. */ + private int rasteredImageSizeMaximum; + /** Font rendering mode. */ + private FontRendering fontRendering; + /** Flag that stores whether affine transformations have been applied. */ + private boolean transformed; + + /** Rendering hints. */ + private final RenderingHints hints; + /** Current background color. */ + private Color background; + /** Current foreground color. */ + private Color color; + /** Shape used for clipping paint operations. */ + private Shape clip; + /** Method used for compositing. */ + private Composite composite; + /** Device configuration settings. */ + private final GraphicsConfiguration deviceConfig; + /** Current font. */ + private Font font; + /** Context settings used to render fonts. */ + private final FontRenderContext fontRenderContext; + /** Paint used to fill shapes. */ + private Paint paint; + /** Stroke used for drawing shapes. */ + private Stroke stroke; + /** Current transformation matrix. */ + private final AffineTransform transform; + /** XOR mode used for rendering. */ + private Color xorMode; + + /** + * Constructor to initialize a new {@code VectorGraphics2D} document. + * The dimensions of the document must be passed. + * @param x Horizontal position of document origin. + * @param y Vertical position of document origin. + * @param width Width of document. + * @param height Height of document. + */ + public VectorGraphics2D(double x, double y, double width, double height) { + hints = new RenderingHints(new HashMap()); + document = new StringBuffer(); + bounds = new Rectangle2D.Double(x, y, width, height); + fontRendering = FontRendering.TEXT; + resolution = 72.0; + rasteredImageSizeMaximum = DEFAULT_PAINT_IMAGE_SIZE_MAXIMUM; + + background = Color.WHITE; + color = Color.BLACK; + composite = AlphaComposite.getInstance(AlphaComposite.CLEAR); + deviceConfig = null; + font = Font.decode(null); + fontRenderContext = new FontRenderContext(null, false, true); + paint = color; + stroke = new BasicStroke(1f); + transform = new AffineTransform(); + transformed = false; + xorMode = Color.BLACK; + } + + @Override + public void addRenderingHints(Map hints) { + this.hints.putAll(hints); + } + + @Override + public void clip(Shape s) { + if ((getClip() != null) && (s != null)) { + Area clipAreaOld = new Area(getClip()); + Area clipAreaNew = new Area(s); + clipAreaNew.intersect(clipAreaOld); + s = clipAreaNew; + } + setClip(s); + } + + @Override + public void draw(Shape s) { + writeShape(s); + writeClosingDraw(s); + } + + @Override + public void drawGlyphVector(GlyphVector g, float x, float y) { + draw(g.getOutline(x, y)); + } + + @Override + public boolean drawImage(Image img, AffineTransform xform, + ImageObserver obs) { + BufferedImage bimg = getTransformedImage(img, xform); + drawImage(bimg, null, bimg.getMinX(), bimg.getMinY()); + return true; + } + + @Override + public void drawImage(BufferedImage img, BufferedImageOp op, + int x, int y) { + if (op != null) { + img = op.filter(img, null); + } + drawImage(img, x, y, img.getWidth(), img.getHeight(), null); + } + + @Override + public void drawRenderableImage(RenderableImage img, + AffineTransform xform) { + drawRenderedImage(img.createDefaultRendering(), xform); + } + + @Override + public void drawRenderedImage(RenderedImage img, + AffineTransform xform) { + // TODO Implement + //throw new UnsupportedOperationException("Rendered images aren't supported."); + } + + @Override + public void drawString(String str, int x, int y) { + drawString(str, (float) x, (float) y); + } + + @Override + public void drawString(String str, float x, float y) { + if (str != null && str.trim().isEmpty()) { + return; + } + switch (getFontRendering()) { + case VECTORS: + TextLayout layout = new TextLayout(str, getFont(), + getFontRenderContext()); + Shape s = layout.getOutline( + AffineTransform.getTranslateInstance(x, y)); + fill(s); + break; + case TEXT: + writeString(str, x, y); + break; + default: + throw new IllegalStateException("Unknown font rendering mode."); + } + } + + @Override + public void drawString(AttributedCharacterIterator iterator, + int x, int y) { + drawString(iterator, (float) x, (float) y); + } + + @Override + public void drawString(AttributedCharacterIterator iterator, + float x, float y) { + // TODO Take text formatting into account + StringBuffer buf = new StringBuffer(); + for (char c = iterator.first(); c != AttributedCharacterIterator.DONE; + c = iterator.next()) { + buf.append(c); + } + drawString(buf.toString(), x, y); + } + + @Override + public void fill(Shape s) { + writeShape(s); + writeClosingFill(s); + } + + @Override + public Color getBackground() { + return background; + } + + @Override + public Composite getComposite() { + return composite; + } + + @Override + public GraphicsConfiguration getDeviceConfiguration() { + return deviceConfig; + } + + @Override + public FontRenderContext getFontRenderContext() { + return fontRenderContext; + } + + @Override + public Paint getPaint() { + return paint; + } + + @Override + public Object getRenderingHint(RenderingHints.Key hintKey) { + if (RenderingHints.KEY_ANTIALIASING.equals(hintKey)) { + return RenderingHints.VALUE_ANTIALIAS_OFF; + } else if (RenderingHints.KEY_TEXT_ANTIALIASING.equals(hintKey)) { + return RenderingHints.VALUE_TEXT_ANTIALIAS_OFF; + } else if (RenderingHints.KEY_FRACTIONALMETRICS.equals(hintKey)) { + return RenderingHints.VALUE_FRACTIONALMETRICS_ON; + } + return hints.get(hintKey); + } + + @Override + public RenderingHints getRenderingHints() { + return hints; + } + + @Override + public Stroke getStroke() { + return stroke; + } + + @Override + public boolean hit(Rectangle rect, Shape s, boolean onStroke) { + if (onStroke) { + Shape sStroke = getStroke().createStrokedShape(s); + return sStroke.intersects(rect); + } else { + return s.intersects(rect); + } + } + + @Override + public void setBackground(Color color) { + background = color; + } + + @Override + public void setComposite(Composite comp) { + composite = comp; + } + + @Override + public void setPaint(Paint paint) { + if (paint != null) { + this.paint = paint; + if (paint instanceof Color) { + setColor((Color) paint); + } else if (paint instanceof MultipleGradientPaint) { + // Set brightest or least opaque color for gradients + Color[] colors = ((MultipleGradientPaint) paint).getColors(); + if (colors.length == 1) { + setColor(colors[0]); + } else if (colors.length > 1) { + Color colLight = colors[0]; + float brightness = getBrightness(colLight); + int alpha = colLight.getAlpha(); + + for (int i = 1; i < colors.length; i++) { + Color c = colors[i]; + float b = getBrightness(c); + int a = c.getAlpha(); + if (b < brightness || a < alpha) { + colLight = c; + brightness = b; + } + } + setColor(colLight); + } + } + } + } + + /** + * Utility method to get the brightness of a specified color. + * @param c Color. + * @return Brightness value between 0f (black) and 1f (white). + */ + private static float getBrightness(Color c) { + return Color.RGBtoHSB(c.getRed(), c.getGreen(), c.getBlue(), null)[2]; + } + + @Override + public void setRenderingHint(RenderingHints.Key hintKey, Object hintValue) { + hints.put(hintKey, hintValue); + } + + @Override + public void setRenderingHints(Map hints) { + this.hints.putAll(hints); + } + + @Override + public void setStroke(Stroke s) { + stroke = s; + } + + @Override + public AffineTransform getTransform() { + return new AffineTransform(transform); + } + + @Override + public void setTransform(AffineTransform tx) { + setAffineTransform(tx); + } + + /** + * Sets the current transformation. + * @param tx Current transformation + */ + protected void setAffineTransform(AffineTransform tx) { + if (!transform.equals(tx)) { + transform.setTransform(tx); + transformed = true; + } + } + + @Override + public void shear(double shx, double shy) { + AffineTransform transform = getTransform(); + transform.shear(shx, shy); + setAffineTransform(transform); + } + + @Override + public void transform(AffineTransform tx) { + AffineTransform transform = getTransform(); + transform.concatenate(tx); + setAffineTransform(transform); + } + + @Override + public void translate(int x, int y) { + translate((double) x, (double) y); + } + + @Override + public void translate(double tx, double ty) { + AffineTransform transform = getTransform(); + transform.translate(tx, ty); + setAffineTransform(transform); + } + + @Override + public void rotate(double theta) { + AffineTransform transform = getTransform(); + transform.rotate(theta); + setAffineTransform(transform); + } + + @Override + public void rotate(double theta, double x, double y) { + AffineTransform transform = getTransform(); + transform.rotate(theta, x, y); + setAffineTransform(transform); + } + + @Override + public void scale(double sx, double sy) { + AffineTransform transform = getTransform(); + transform.scale(sx, sy); + setAffineTransform(transform); + } + + @Override + public void clearRect(int x, int y, int width, int height) { + // TODO Implement + //throw new UnsupportedOperationException("clearRect() isn't supported by VectorGraphics2D."); + } + + @Override + public void clipRect(int x, int y, int width, int height) { + clip(new Rectangle(x, y, width, height)); + } + + @Override + public void copyArea(int x, int y, int width, int height, int dx, int dy) { + // TODO Implement + //throw new UnsupportedOperationException("copyArea() isn't supported by VectorGraphics2D."); + } + + @Override + public Graphics create() { + // TODO Implement + return this; + } + + @Override + public void dispose() { + // TODO Implement + } + + @Override + public void drawArc(int x, int y, int width, int height, + int startAngle, int arcAngle) { + draw(new Arc2D.Double(x, y, width, height, + startAngle, arcAngle, Arc2D.OPEN)); + } + + @Override + public boolean drawImage(Image img, int x, int y, ImageObserver observer) { + return drawImage(img, x, y, + img.getWidth(observer), img.getHeight(observer), observer); + } + + @Override + public boolean drawImage(Image img, int x, int y, Color bgcolor, + ImageObserver observer) { + return drawImage(img, x, y, + img.getWidth(observer), img.getHeight(observer), observer); + } + + @Override + public boolean drawImage(Image img, int x, int y, int width, int height, + ImageObserver observer) { + int imgWidth = img.getWidth(observer); + int imgHeight = img.getHeight(observer); + writeImage(img, imgWidth, imgHeight, x, y, width, height); + return true; // TODO Return only true if image data was complete + } + + @Override + public boolean drawImage(Image img, int x, int y, int width, int height, + Color bgcolor, ImageObserver observer) { + return drawImage(img, x, y, width, height, observer); + } + + @Override + public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, + int sx1, int sy1, int sx2, int sy2, ImageObserver observer) { + if (img == null) { + return true; + } + + int sx = Math.min(sx1, sx2); + int sy = Math.min(sy1, sy2); + int sw = Math.abs(sx2 - sx1); + int sh = Math.abs(sy2 - sy1); + int dx = Math.min(dx1, dx2); + int dy = Math.min(dy1, dy2); + int dw = Math.abs(dx2 - dx1); + int dh = Math.abs(dy2 - dy1); + + // Draw image + BufferedImage bufferedImg = GraphicsUtils.toBufferedImage(img); + Image cropped = bufferedImg.getSubimage(sx, sy, sw, sh); + return drawImage(cropped, dx, dy, dw, dh, observer); + } + + @Override + public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, + int sx1, int sy1, int sx2, int sy2, Color bgcolor, + ImageObserver observer) { + if (img == null) { + return true; + } + + int sx = Math.min(sx1, sx2); + int sy = Math.min(sy1, sy2); + int sw = Math.abs(sx2 - sx1); + int sh = Math.abs(sy2 - sy1); + int dx = Math.min(dx1, dx2); + int dy = Math.min(dy1, dy2); + int dw = Math.abs(dx2 - dx1); + int dh = Math.abs(dy2 - dy1); + + // Fill Rectangle with bgcolor + Color bgcolorOld = getColor(); + setColor(bgcolor); + fill(new Rectangle(dx, dy, dw, dh)); + setColor(bgcolorOld); + + // Draw image on rectangle + BufferedImage bufferedImg = GraphicsUtils.toBufferedImage(img); + Image cropped = bufferedImg.getSubimage(sx, sy, sw, sh); + return drawImage(cropped, dx, dy, dw, dh, observer); + } + + @Override + public void drawLine(int x1, int y1, int x2, int y2) { + draw(new Line2D.Double(x1, y1, x2, y2)); + } + + @Override + public void drawOval(int x, int y, int width, int height) { + draw(new Ellipse2D.Double(x, y, width, height)); + } + + @Override + public void drawPolygon(int[] xPoints, int[] yPoints, int nPoints) { + Path2D p = new Path2D.Float(); + for (int i = 0; i < nPoints; i++) { + if (i > 0) { + p.lineTo(xPoints[i], yPoints[i]); + } else { + p.moveTo(xPoints[i], yPoints[i]); + } + } + p.closePath(); + draw(p); + } + + @Override + public void drawPolyline(int[] xPoints, int[] yPoints, int nPoints) { + Path2D p = new Path2D.Float(); + for (int i = 0; i < nPoints; i++) { + if (i > 0) { + p.lineTo(xPoints[i], yPoints[i]); + } else { + p.moveTo(xPoints[i], yPoints[i]); + } + } + draw(p); + } + + @Override + public void drawRect(int x, int y, int width, int height) { + draw(new Rectangle2D.Double(x, y, width, height)); + } + + @Override + public void drawRoundRect(int x, int y, int width, int height, + int arcWidth, int arcHeight) { + draw(new RoundRectangle2D.Double(x, y, width, height, + arcWidth, arcHeight)); + } + + @Override + public void fillArc(int x, int y, int width, int height, + int startAngle, int arcAngle) { + fill(new Arc2D.Double(x, y, width, height, + startAngle, arcAngle, Arc2D.PIE)); + } + + @Override + public void fillOval(int x, int y, int width, int height) { + fill(new Ellipse2D.Double(x, y, width, height)); + } + + @Override + public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints) { + Path2D p = new Path2D.Float(); + for (int i = 0; i < nPoints; i++) { + if (i > 0) { + p.lineTo(xPoints[i], yPoints[i]); + } else { + p.moveTo(xPoints[i], yPoints[i]); + } + } + p.closePath(); + + fill(p); + } + + @Override + public void fillRect(int x, int y, int width, int height) { + fill(new Rectangle2D.Double(x, y, width, height)); + } + + @Override + public void fillRoundRect(int x, int y, int width, int height, + int arcWidth, int arcHeight) { + fill(new RoundRectangle2D.Double(x, y, width, height, + arcWidth, arcHeight)); + } + + @Override + public Shape getClip() { + return clip; + } + + @Override + public Rectangle getClipBounds() { + if (clip == null) { + return null; + } + return clip.getBounds(); + } + + @Override + public Color getColor() { + return color; + } + + @Override + public Font getFont() { + return font; + } + + @Override + public FontMetrics getFontMetrics(Font f) { + // TODO Find a better way for creating a new FontMetrics instance + BufferedImage bi = + new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB_PRE); + Graphics g = bi.getGraphics(); + FontMetrics fontMetrics = g.getFontMetrics(font); + g.dispose(); + bi = null; + return fontMetrics; + } + + @Override + public void setClip(Shape clip) { + this.clip = clip; + } + + @Override + public void setClip(int x, int y, int width, int height) { + setClip(new Rectangle(x, y, width, height)); + } + + @Override + public void setColor(Color c) { + color = c; + } + + @Override + public void setFont(Font font) { + if (!this.font.equals(font)) { + this.font = font; + } + } + + @Override + public void setPaintMode() { + // TODO Implement + //throw new UnsupportedOperationException("setPaintMode() isn't supported."); + } + + @Override + public void setXORMode(Color c1) { + xorMode = c1; + } + + /** + * Utility method for writing multiple objects to the SVG document. + * @param strs Objects to be written + */ + protected void write(Object... strs) { + for (Object o : strs) { + String str = o.toString(); + if ((o instanceof Double) || (o instanceof Float)) { + str = String.format(Locale.ENGLISH, "%.7f", o) + .replaceAll("\\.?0+$", ""); + } + document.append(str); + } + } + + /** + * Utility method for writing a line of multiple objects to the + * SVG document. + * @param strs Objects to be written + */ + protected void writeln(Object... strs) { + write(strs); + write("\n"); + } + + /** + * Write the specified shape to the document. This does not necessarily + * contain the actual command to paint the shape. + * @param s Shape to be written. + */ + protected abstract void writeShape(Shape s); + + /** + * Write the specified image to the document. A number of dimensions will + * specify how the image will be placed in the document. + * @param img Image to be rendered. + * @param imgWidth Number of pixels in horizontal direction. + * @param imgHeight Number of pixels in vertical direction + * @param x Horizontal position in document units where the + * upper left corner of the image should be placed. + * @param y Vertical position in document units where the + * upper left corner of the image should be placed. + * @param width Width of the image in document units. + * @param height Height of the image in document units. + */ + protected abstract void writeImage(Image img, int imgWidth, int imgHeight, + double x, double y, double width, double height); + + /** + * Write a text string to the document at a specified position. + * @param str Text to be rendered. + * @param x Horizontal position in document units. + * @param y Vertical position in document units. + */ + protected abstract void writeString(String str, double x, double y); + + /** + * Write a command to draw the outline of a previously inserted shape. + * @param s Shape that should be drawn. + */ + protected abstract void writeClosingDraw(Shape s); + + /** + * Write a command to fill the outline of a previously inserted shape. + * @param s Shape that should be filled. + */ + protected void writeClosingFill(Shape s) { + Rectangle2D shapeBounds = s.getBounds2D(); + + // Calculate dimensions of shape with current transformations + int wImage = (int) Math.ceil(shapeBounds.getWidth()*getResolution()); + int hImage = (int) Math.ceil(shapeBounds.getHeight()*getResolution()); + // Limit the size of images + wImage = Math.min(wImage, rasteredImageSizeMaximum); + hImage = Math.min(hImage, rasteredImageSizeMaximum); + + // Create image to paint draw gradient with current transformations + BufferedImage paintImage = new BufferedImage( + wImage, hImage, BufferedImage.TYPE_INT_ARGB); + + // Paint shape + Graphics2D g = (Graphics2D) paintImage.getGraphics(); + g.scale(wImage/shapeBounds.getWidth(), hImage/shapeBounds.getHeight()); + g.translate(-shapeBounds.getX(), -shapeBounds.getY()); + g.setPaint(getPaint()); + g.fill(s); + // Free resources + g.dispose(); + + // Output image of gradient + writeImage(paintImage, wImage, hImage, + shapeBounds.getX(), shapeBounds.getY(), + shapeBounds.getWidth(), shapeBounds.getHeight()); + } + + /** + * Write the header to start a new document. + */ + protected abstract void writeHeader(); + + /** + * Returns a string of the footer to end a document. + */ + protected abstract String getFooter(); + + /** + * Returns a transformed version of an image. + * @param image Image to be transformed + * @param xform Affine transform to be applied + * @return Image with transformed content + */ + private BufferedImage getTransformedImage(Image image, + AffineTransform xform) { + Integer interpolationType = + (Integer) hints.get(RenderingHints.KEY_INTERPOLATION); + if (RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR + .equals(interpolationType)) { + interpolationType = AffineTransformOp.TYPE_NEAREST_NEIGHBOR; + } else if (RenderingHints.VALUE_INTERPOLATION_BILINEAR + .equals(interpolationType)) { + interpolationType = AffineTransformOp.TYPE_BILINEAR; + } else { + interpolationType = AffineTransformOp.TYPE_BICUBIC; + } + AffineTransformOp op = new AffineTransformOp(xform, interpolationType); + BufferedImage bufferedImage = GraphicsUtils.toBufferedImage(image); + return op.filter(bufferedImage, null); + } + + /** + * Returns whether a distorting transformation has been applied to the + * document. + * @return true if the document is distorted, + * otherwise false. + */ + protected boolean isDistorted() { + if (!isTransformed()) { + return false; + } + int type = transform.getType(); + int otherButTranslatedOrScaled = ~(AffineTransform.TYPE_TRANSLATION + | AffineTransform.TYPE_MASK_SCALE); + return (type & otherButTranslatedOrScaled) != 0; + } + + @Override + public String toString() { + return document.toString() + getFooter(); + } + + /** + * Encodes the painted data into a sequence of bytes. + * @return A byte array containing the data in the current file format. + */ + public byte[] getBytes() { + try { + return toString().getBytes("UTF-8"); + } catch (UnsupportedEncodingException e) { + return toString().getBytes(); + } + } + + /** + * Returns the dimensions of the document. + * @return dimensions of the document. + */ + public Rectangle2D getBounds() { + Rectangle2D b = new Rectangle2D.Double(); + b.setFrame(bounds); + return b; + } + + /** + * Returns the number of bytes of the document. + * @return size of the document in bytes. + */ + protected int size() { + return document.length(); + } + + /** + * Returns how fonts should be rendered. + * @return Font rendering mode. + */ + public FontRendering getFontRendering() { + return fontRendering; + } + + /** + * Sets how fonts should be rendered. For example, they can be converted + * to vector shapes. + * @param mode New font rendering mode. + */ + public void setFontRendering(FontRendering mode) { + fontRendering = mode; + } + + /** + * Returns whether an affine transformation like translation, scaling, + * rotation or shearing has been applied to this graphics instance. + * @return true if the instance has been transformed, + * false otherwise + */ + protected boolean isTransformed() { + return transformed; + } + + /** + * Returns the resolution in pixels per inch. + * @return Resolution in pixels per inch. + */ + public double getResolution() { + return resolution; + } + + /** + * Sets the resolution in pixels per inch. + * @param resolution New resolution in pixels per inch. + */ + public void setResolution(double resolution) { + if (resolution <= 0.0) { + throw new IllegalArgumentException( + "Only positive non-zero values allowed"); + } + this.resolution = resolution; + } + + /** + * Returns the maximal size of images which are used to raster paints + * like e.g. gradients, or patterns. The default value is 128. + * @return Current maximal image size in pixels. + */ + public int getRasteredImageSizeMaximum() { + return rasteredImageSizeMaximum; + } + + /** + * Sets the maximal size of images which are used to raster paints + * like e.g. gradients, or patterns. + * @param paintImageSizeMaximum New maximal image size in pixels. + */ + public void setRasteredImageSizeMaximum(int paintImageSizeMaximum) { + this.rasteredImageSizeMaximum = paintImageSizeMaximum; + } +} diff --git a/de/erichseifert/vectorgraphics2d/package-info.java b/de/erichseifert/vectorgraphics2d/package-info.java new file mode 100644 index 0000000..0649ff0 --- /dev/null +++ b/de/erichseifert/vectorgraphics2d/package-info.java @@ -0,0 +1,25 @@ +/* + * VectorGraphics2D: Vector export for Java(R) Graphics2D + * + * (C) Copyright 2010 Erich Seifert + * + * This file is part of VectorGraphics2D. + * + * VectorGraphics2D is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * VectorGraphics2D is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with VectorGraphics2D. If not, see . + */ + +/** + * Main classes. + */ +package de.erichseifert.vectorgraphics2d; diff --git a/default.mcr b/default.mcr new file mode 100644 index 0000000..c796c04 --- /dev/null +++ b/default.mcr @@ -0,0 +1,69 @@ + + + +Point on first leg of angle +Vertex of angle +Point on second leg of angle + +

Angle bisector of angle P1P2P3 as ray.

+
+ +Point à -4.1, 4.26 +Point à -0.53, -2.69 +Point à 3.43, 2.79 + + + + +Strahl von P2 in Richtung M1 + +
+ +Line to project to +Projected point + +

Projects P to the line g.

+
+ +??? +Point à 1.68, 2.47 + +Schnitt zwischen g1 und l1 + +
+ +Point on first leg of angle +Vertex of angle +Point on second leg of angle +Rotation center +Rotating point + +

Rotate a point P around Q with angle ABC.

+
+ +Point à 2.85, -3.27 +Point à -3.69, -3.32 +Point à 2.35, -0.91 +Point à -3.94, 0.61 +Point à 1.2, 2.71 + + +Intersection w1 and k1 + +
+ +Center of rotation +Rotating point + +

Rotates a point P around Q with a given angle.

+
+ +Point à -4.22, -0.48 +Point à 2.24, 0.46 + + +Intersection of w1 and k1 + + +
+
diff --git a/eric/.DS_Store b/eric/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..02d999961de669049e23b8a35760a8dccc377a07 GIT binary patch literal 14340 zcmeHOTWlO>6+XvylG)wZ9y@X3+~}rmqBJpK)5Nh|TC%>Ri5mx7v17+c8nc(NGs$|! z-5Fof)U9a|4Fv%OAu2&ZBBfLasUXxR1PBn&2W}57Y90^|RH*O*2=P!}!gv0eUC*w) z!KDFIn33kc%>3ufKj;7E%=ymF5)pULWDgJ}h)BaOwZ0z3Q$%s81Dl+eec4uxBaHnp zcC>Y(9NCnn6zaicqn973!Xc5b!M>Ruq+=!Wc`|4MyVMqCP&%}qE zki=!H-a!5AO|_w=j?n|C_XLhrtC{5kl4@vJgcb-b5LzI#Kxl#gGYiPO7n>II>aYwg z5LzI#K+yu?AL7`hPWtttS1Z?nLPB^sFCo0z&_+P6j>Y{t>DP;1twbTCL{WR9>{AT( z#Bn?>!%-*wdeN&rabi!L*uOIS429LzAs1J}iIZL(mZ1eg3oN(5b{yKiD(>9_ZZG^k zUx|fRUxKb63*WIyy))41+*0$O%QSCWmF8YG-$~4OLTR50aDTXon%Q@#b;VqSC`Ba&tt|V=m#J!I~gGE`i z<|JY}vzWPLWGc*|>Oz^0hN6xll$_GF6Reet6Dtp5q}-=VAH-~@Fw+Y2tOlM+q-CB%YF!N6ud6go(+p->L4#nY zL_Nacs%K`6wBH^~xfcuVVcX6X+o|-3Y0Qo58+&ZaO_`RF z4~U*0HLa{Y*KN;OS?Bzar*G8Ex);awrop^13(>)pWsI1PnKpB#dqs;xB3fizZ@zl< zP+MDT{7_qBp*4QBy*+{U!NUs+`gKj)c6VFX$+78$r@wOj`LDk4wHJT%V|DYy{(GD@ zc>QAela)CHuRK{y|8p>_{ucKY+O2^)E&zk zhNbikOiVb2duCj(cQSc9mm9Pl(=}~tEO2)0yo06dbB(D!Yr@7A#i|3-GRzq<@($`{ z@@K|U`FzTnG`g=mluMyRJQT#?083H}iU>7F~a#T8@av#MY8LQE2S(8alOj z4G=$_Tap8dsyl4imJw-54tgge2*>tO7aYI{U8YCq8G4RhqVLcv^c(sUy~XQT=R0{H zAL9G@2p{J@KEcC0#%DR>DX1!}?+&kDC^?JP3ee9vvx6S=s|E|}`#LW{e|=YDw5OuM z#HdSmKdv`qQn}1bF6A0sxty5D8O_+anJLRDF85i-&bwGb930p68OJzfV7xhN^g_xh z+E(X?_VwCL+wQpQ?)?Wl?tj(8STuST4~XTO6Q+?rJtt4eSjx#5Ru+gFos~xY~%n`6=QS?E4#XGJWlzpQy@wl~LO=j2RJ-awhvG$jz<8H)}(n7f|x2kzP( zjSgSNW2!s8(!KklvC|3^dN$&Ty)O}sjm~;l(ogsY54A;OXEOHG6z1$SaI1f~^WIqO zf?T;j<+uaWhJ{(Zg3CA5>vgf_SW?r*8E(5{epf;zoHxTdwP@pK!2pa(oKd3;3(H~12^&p-p)I@ zh412BydRi4%4pVMpf2K|Np z4vejZpK9iSRUYgda5ljg+2l*? z@C?uKJYV4__#^yLeu}U0GyEC;EPs)oE5qIKGTgneGVW%F@>b5aCUI7L-Z#f~4woUs*&V7Vcm#L41) z6ig`+#e-$WtOMjsm7o}gF_k%Q^=2wDY&AYUIZb_~uvedz2smqt;8ddmMtyhD^m`7p z7crhV49ebl@E*|gYyTom_l*`@8~;#%t$(`!yIZsMrsl@2+g4`l!iY-=UXjGzCe9vY z=*#%`zlXC2QxHYAz7+J9vh*@?UL^HCNgo3JdYBgJ^K>1g>j$7)zoWl_V%72{MbcZj z4FPWwgsMkTb@3|LiiAmWz=4g=q2n)P*(0_F518k%$~=|I{RTZ%6T;DM<<;g8j7iS0 zAAWrXzAl4Y;w^HB5}1`dnwy}hN97+St0vhwk(NxVV-Kpk zkzll9n5f=j&jvj3`VtKlzerQ>wV<5jCy(MfV!wZy1!h^HptR(23(n1}Ju6hWZwb~* z>1{_iNh+mY}7SNQ&aHLAifp#?$HN8W<-I#pgH{0_2kZ StartupFiles=new ArrayList(); + static private boolean isStartup=true; + static private ConstructionObject thekTortue, thekTortue3D; //Dibs + + public static void addStartupFile(String filename) { + StartupFiles.add(filename); + } + + public static boolean isStartup() { + return isStartup; + } + + public static String getCurrentFileSource() throws Exception { + return JZirkelCanvas.getCurrentZC().getFileSource(); + } + + public static void setCurrentFileSource(String s) throws Exception { + JZirkelCanvas.getCurrentZC().setFileSource(s); + } + + /********************************************* + * Simple file part : open and save zir files + *********************************************/ + + public static void copyAppletTag() { + String tag=""; + tag+="\n"; + tag+="\n"; + tag=tag.replace("@width@", ""+(pipe_tools.getWindowSize().width-2*themes.getVerticalBorderWidth())); + tag=tag.replace("@height@", ""+(pipe_tools.getWindowSize().height-themes.getMenuBarHeight()-themes.getTitleBarHeight())); + tag=tag.replace("@file_content@", getWorkBookSource()); + Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); + StringSelection myclip = new StringSelection(tag); + clipboard.setContents(myclip, null); + } + + + public static void HTMLWorkBookExport() { + String str; + String content=""; + + if (!JZirkelCanvas.isWorkBook()) { + saveWorkBookAs(); + } + ; + + if (JZirkelCanvas.isWorkBook()) { + saveWorkBook(JZirkelCanvas.getWorkBookFileName()); + String targetpath=FileName.path(JZirkelCanvas.getWorkBookFileName()); + String sep=System.getProperty("file.separator"); + BufferedReader in; + try { + InputStream input=FileTools.class.getResourceAsStream("/eric/docs/applet.html"); + in=new BufferedReader(new InputStreamReader(input)); + while ((str=in.readLine())!=null) { + content+=str+"\n"; + } + in.close(); + } catch (final Exception e) { + return; + } + content=content.replace("@width@", ""+(pipe_tools.getWindowSize().width-2*themes.getVerticalBorderWidth())); + content=content.replace("@height@", ""+(pipe_tools.getWindowSize().height-themes.getMenuBarHeight()-themes.getTitleBarHeight())); + content=content.replace("@file@", FileName.filename(JZirkelCanvas.getWorkBookFileName())); + content=content.replace("@workbook@", FileName.filename(JZirkelCanvas.getWorkBookFileName())); + try { + File aFile=new File(targetpath+sep+"index.html"); + Writer output=new BufferedWriter(new FileWriter(aFile)); + output.write(content); + output.close(); + } catch (Exception e) { + } + } + } + + public static void HTMLWorkBookExtExport() { + String str; + String content=""; + + if (!JZirkelCanvas.isWorkBook()) { + saveWorkBookAs(); + } + ; + + if (JZirkelCanvas.isWorkBook()) { +// saveWorkBook(JZirkelCanvas.getWorkBookFileName()); + String targetpath=FileName.path(JZirkelCanvas.getWorkBookFileName()); + String sep=System.getProperty("file.separator"); + BufferedReader in; + try { + InputStream input=FileTools.class.getResourceAsStream("/eric/docs/applet_ext.html"); + in=new BufferedReader(new InputStreamReader(input)); + while ((str=in.readLine())!=null) { + content+=str+"\n"; + } + in.close(); + } catch (final Exception e) { + return; + } + content=content.replace("@width@", ""+(pipe_tools.getWindowSize().width-2*themes.getVerticalBorderWidth())); + content=content.replace("@height@", ""+(pipe_tools.getWindowSize().height-themes.getMenuBarHeight()-themes.getTitleBarHeight())); + content=content.replace("@file_content@", getWorkBookSource()); + try { + File aFile=new File(targetpath+sep+"index.html"); + Writer output=new BufferedWriter(new FileWriter(aFile)); + output.write(content); + output.close(); + } catch (Exception e) { + } + } + } + + public static void SaveJarAndLaunchBrowser() { + + JZirkelCanvas jzc=JZirkelCanvas.getCurrentJZF(); + if (jzc==null) { + return; + } + if (JZirkelCanvas.getFileName()==null) { + return; + } + String targetpath=FileName.path(JZirkelCanvas.getFileName()); + String targetfile="index.html"; + + final String sep=System.getProperty("file.separator"); + final String mypath=Global.AppPath(); + if (new File(mypath+"CaRMetal.jar").exists()) { + try { + final InputStream in=new FileInputStream(mypath+"CaRMetal.jar"); + final OutputStream out=new FileOutputStream(targetpath+sep+"CaRMetal.jar"); + final byte[] buf=new byte[1024]; + int len; + while ((len=in.read(buf))>0) { + out.write(buf, 0, len); + out.flush(); + } + out.close(); + in.close(); + + JBrowserLauncher.openURL(targetpath+sep+targetfile); + + } catch (final Exception ex) { + } + } + } + + public static String getSwingOpenFile() { + String name=null; + final JFileChooser jfc=new JFileChooser(Global.getOpenSaveDirectory()); + jfc.setDialogType(javax.swing.JFileChooser.OPEN_DIALOG); + jfc.setAcceptAllFileFilterUsed(false); + JFileFilter filter=new JFileFilter(Global.Loc("filedialog.js"), ".js"); + jfc.addChoosableFileFilter(filter); + jfc.setFileFilter(filter); + filter=new JFileFilter(Global.Loc("filedialog.job"), ".job"); + jfc.addChoosableFileFilter(filter); + filter=new JFileFilter(Global.Loc("filedialog.macrofilefilter"), ".mcr"); + jfc.addChoosableFileFilter(filter); + filter=new JFileFilter(Global.Loc("filedialog.compressedfilefilter"), ".zirz"); + jfc.addChoosableFileFilter(filter); + filter=new JFileFilter(Global.Loc("filedialog.workbook"), ".zirs"); + jfc.addChoosableFileFilter(filter); + filter=new JFileFilter(Global.Loc("filedialog.filefilter"), ".zir"); + jfc.addChoosableFileFilter(filter); + filter=new JFileFilter(Global.Loc("filedialog.allfiles"), ".zirs,.zir,.zirz,.mcr,.job,.js"); + jfc.addChoosableFileFilter(filter); + final int rep=jfc.showOpenDialog(pipe_tools.getFrame()); + if (rep==JFileChooser.APPROVE_OPTION) { + name=jfc.getSelectedFile().getAbsolutePath(); + Global.setOpenSaveDirectory(FileName.path(name)); + } + return name; + } + + public static String getAWTOpenFile() { + String name=""; + FileDialog fd=new FileDialog(pipe_tools.getFrame(), + Global.Loc("filedialog.open"), + FileDialog.LOAD); + fd.setFilenameFilter(new FilenameFilter() { + + public boolean accept(File dir, String name) { + return (name.endsWith(".js")||name.endsWith(".mcr")||name.endsWith(".zir")||name.endsWith(".zirs")||name.endsWith(".zirz")||name.endsWith(".job")||name.endsWith(".jobz")); + } + }); + fd.setDirectory(Global.getOpenSaveDirectory()); + fd.setSize(dlogW, dlogH); + fd.pack(); + fd.setVisible(true); + if (fd.getFile()!=null) { + Global.setOpenSaveDirectory(fd.getDirectory()); + } + return canonicFileName(fd); + } + + public static String getOpenFile() { + if (OS.isUnix()) { + return getSwingOpenFile(); + } else { + return getAWTOpenFile(); + } + } + + public static String getSwingSaveFile(boolean export) { + String name=null; + final JFileChooser jfc=new JFileChooser(Global.getOpenSaveDirectory()); + jfc.setDialogType(javax.swing.JFileChooser.SAVE_DIALOG); + jfc.setAcceptAllFileFilterUsed(false); + JFileFilter filter; + if (export) { + filter=new JFileFilter(Global.Loc("filedialog.allexportfiles"), ".pdf,.eps,.svg,.png"); + } else { + filter=new JFileFilter(Global.Loc("filedialog.allfiles"), ".zirs,.zir,.zirz,.mcr,.job"); + } + + jfc.addChoosableFileFilter(filter); + jfc.setFileFilter(filter); + final int rep=jfc.showSaveDialog(pipe_tools.getFrame()); + System.out.println(jfc.getFileFilter().toString()); + if (rep==JFileChooser.APPROVE_OPTION) { + name=jfc.getSelectedFile().getAbsolutePath(); + Global.setOpenSaveDirectory(FileName.path(name)); + } + return name; + } + + public static String getAWTSaveFile(boolean export) { + String name=""; + FileDialog fd=new FileDialog(pipe_tools.getFrame(), + Global.Loc("filedialog.save"), + FileDialog.SAVE); + if (export) { + fd.setFilenameFilter(new FilenameFilter() { + + public boolean accept(File dir, String name) { + return (name.endsWith(".pdf")||name.endsWith(".eps")||name.endsWith(".svg")||name.endsWith(".png")); + } + }); + } else { + fd.setFilenameFilter(new FilenameFilter() { + + public boolean accept(File dir, String name) { + return (name.endsWith(".js")||name.endsWith(".mcr")||name.endsWith(".zir")||name.endsWith(".zirs")||name.endsWith(".zirz")||name.endsWith(".job")||name.endsWith(".jobz")); + } + }); + } + + fd.setDirectory(Global.getOpenSaveDirectory()); + fd.setSize(dlogW, dlogH); + fd.pack(); + fd.setVisible(true); + if (fd.getFile()!=null) { + Global.setOpenSaveDirectory(fd.getDirectory()); + } + return canonicFileName(fd); + } + + public static String getSaveFile(boolean export) { + if (OS.isUnix()) { + return getSwingSaveFile(export); + } else { + return getAWTSaveFile(export); + } + } + + public static String canonicFileName(FileDialog fd) { + if (fd.getFile()==null) { + return null; + } + String path=(fd.getDirectory().endsWith(System.getProperty("file.separator")))?fd.getDirectory():fd.getDirectory()+System.getProperty("file.separator"); + path+=fd.getFile(); + return path; + } + + public static boolean validPreferencesFileName(String name) { + return name.endsWith("preferences.txt"); + } + + public static boolean validZirkelFileName(String name) { + String nme=name.toLowerCase(); + return (nme.endsWith(".zir")||nme.endsWith(".zirz")||nme.endsWith(".job")||nme.endsWith(".jobz")); + } + + public static boolean validImageFileName(String name) { + String nme=name.toLowerCase(); + return (nme.endsWith(".tif")||nme.endsWith(".tiff")||nme.endsWith(".gif")||nme.endsWith(".png")||nme.endsWith(".jpg")||nme.endsWith(".jpeg")); + } + + public static void openFile() { + final String filename=getOpenFile(); + if (filename!=null) { + if (filename.endsWith(".zirs")) { + openWorkBook(filename); + } else if (filename.endsWith(".mcr")) { + openMacro(filename); + } else if (filename.endsWith(".zir")) { + openFile(filename, null, 0); + } else { + openScript(filename); + } + } + } + + public static void doLoad(final String filename, final InputStream in, final int mode) { + JZirkelCanvas JZF=JZirkelCanvas.getCurrentJZF(); + ZirkelFrame ZF=JZirkelCanvas.getCurrentZF(); + final ZirkelCanvas ZC=JZirkelCanvas.getCurrentZC(); + if (ZC!=null) { + ZC.setMode(mode); + ZF.setinfo("save"); + ZC.getConstruction().BackgroundFile=null; + ZF.Background=""; + ZC.grab(false); + rene.zirkel.construction.Count.resetAll(); + ZF.doload(filename, in); + PaletteManager.initPaletteConsideringMode(); +// PaletteManager.fixDPpalette(); + ZC.getLocalPreferences(); + rene.zirkel.construction.Count.resetAll(); + + pipe_tools.setWindowComponents(); + SwingUtilities.invokeLater(new Runnable() { + + public void run() { + ZC.JCM.readXmlTags(); + PaletteManager.refresh(); + PaletteManager.setSelected_with_clic("move", true); + ZC.runOnLoadScripts(); + } + }); + } + } + + public static void doLoadNew3D(final String filename, final InputStream in, final int mode) { + JZirkelCanvas JZF=JZirkelCanvas.getCurrentJZF(); + ZirkelFrame ZF=JZirkelCanvas.getCurrentZF(); + final ZirkelCanvas ZC=JZirkelCanvas.getCurrentZC(); + if (ZC!=null) { + ZC.setMode(mode); + ZF.setinfo("save"); + ZC.getConstruction().BackgroundFile=null; + ZF.Background=""; + ZC.grab(false); + rene.zirkel.construction.Count.resetAll(); + ZF.doload(filename, in); + PaletteManager.initPaletteConsideringMode(); +// PaletteManager.fixDPpalette(); + ZC.getLocalPreferences(); + rene.zirkel.construction.Count.resetAll(); + + pipe_tools.setWindowComponents(); + SwingUtilities.invokeLater(new Runnable() { + + public void run() { + ZC.JCM.readXmlTags(); + PaletteManager.refresh(); + PaletteManager.setSelected_with_clic("bi_3Dcoords", true); + ZC.runOnLoadScripts(); + } + }); + } + } + + public static void openMacro(final String filename) { + try { + + FileInputStream o=new FileInputStream(filename); + JZirkelCanvas.getCurrentZC().load(o, false, true); + o.close(); + } catch (Exception ex) { + } + JZirkelCanvas.ActualiseMacroPanel(); + } + + private static void openScript(String filename) { + ZirkelCanvas ZC=JZirkelCanvas.getCurrentZC(); + if (ZC==null) { + return; + } + if (filename==null) { + return; + } + ZC.openScriptFile(filename, true); + } + + public static void openFile(final String filename, final InputStream in, final int mode) { + ZirkelCanvas ZC=JZirkelCanvas.getCurrentZC(); + if (ZC==null) { + return; + } + if (filename==null) { + return; + } + if ((filename.endsWith(".zir"))||(filename.endsWith(".zirz"))) { + if (ZC.isEmpty()) { + tab_main_panel.setCurrentTabName(FileName.filename(filename), filename); + + } else { + tab_main_panel.createTabAndCanvas(FileName.filename(filename), filename); + } + } + doLoad(filename, in, mode); + JZirkelCanvas.getCurrentJZF().setComments(); + JZirkelCanvas.ActualiseMacroPanel(); + + } + + public static void New3DWindow() { + InputStream o; + String Filename; + if (System.getProperty("user.language").equals("fr")) { + o=FileTools.class.getResourceAsStream("/base3D-fr.zir"); + Filename="base3D-fr.zir"; + } + else if (System.getProperty("user.language").equals("es")) { + o=FileTools.class.getResourceAsStream("/base3D-es.zir"); + Filename="base3D-es.zir"; + } + else { + o=FileTools.class.getResourceAsStream("/base3D.zir"); + Filename="base3D.zir"; + } + final ZirkelCanvas zc=JZirkelCanvas.getCurrentZC(); + if (!zc.isEmpty()) { + tab_main_panel.newTabBtn(); + } + doLoadNew3D(Filename, o, Construction.MODE_3D); + ZirkelFrame zf=JZirkelCanvas.getCurrentZF(); + if (zf!=null) { + zf.Filename=""; + } + SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + if (zc!=null) { + zc.JCM.fix3Dcomments(); + } + } + }); + } + + public static void NewDPWindow() { + final InputStream o=FileTools.class.getResourceAsStream("/baseDP.zir"); + final String Filename="baseDP.zir"; + final ZirkelCanvas zc=JZirkelCanvas.getCurrentZC(); + if (!zc.isEmpty()) { + tab_main_panel.newTabBtn(); + + } + doLoad(Filename, o, Construction.MODE_DP); + ZirkelFrame zf=JZirkelCanvas.getCurrentZF(); + if (zf!=null) { + zf.Filename=""; + } +// SwingUtilities.invokeLater(new Runnable() { +// +// public void run() { +//// if (zc!=null) { +//// zc.JCM.fixDPcomments(); +//// } +// } +// }); + } + + public static void saveFileAs() { + //if (Media.getMedias().size()>0) { + if (Media.checkMedia()>0) { + JOptionPane.showMessageDialog(JZirkelCanvas.getCurrentZC(), Global.Loc("media.saveas")); + saveWorkBookAs(); + } else { + String filename=getSaveFile(false); + if (filename!=null) { + saveFile(filename, false, ".zir", false); + } + } + } + + public static void saveFile() { + if (JZirkelCanvas.isWorkBook()) { + saveWorkBook(JZirkelCanvas.getWorkBookFileName()); + //} else if (Media.getMedias().size()>0) { + } else if (Media.checkMedia()>0) { + JOptionPane.showMessageDialog(JZirkelCanvas.getCurrentZC(), Global.Loc("media.saveas")); + saveWorkBookAs(); + } else { + if (JZirkelCanvas.getCurrentZC()==null) { + return; + } + ZirkelFrame ZF=JZirkelCanvas.getCurrentZF(); + ZirkelCanvas ZC=JZirkelCanvas.getCurrentZC(); + String filename=(ZF.haveFile())?ZF.Filename:getSaveFile(false); + if (filename!=null) { + saveFile(filename, false, ".zir", !ZF.haveFile()); + } + } + } + + private static boolean ICanSave(final String Fname, final boolean ask) { + if (!ask) { + return true; + } + if (!new File(Fname).exists()) { + return true; + } + return (JOptionPane.showConfirmDialog(null, Global.Loc("filedialog.savemessage1")+Fname+Global.Loc("filedialog.savemessage2"), "", + JOptionPane.YES_NO_OPTION)==JOptionPane.YES_OPTION); + } + + private static void doSave(ZirkelCanvas zc, String Filename, OutputStream o) { + try { + if (o==null) { + o=new FileOutputStream(Filename); + if (ZirkelFrame.isCompressed(Filename)) { + o=new GZIPOutputStream(o, 10000); + } + } + zc.save(o, true, true, false, true, zc.getMacros(), ""); + o.close(); + } catch (Exception e) { + } + } + + private static void saveFile(String Filename, final boolean restrict, final String ext, final boolean ask) { + if (JZirkelCanvas.getCurrentZC()==null) { + return; + } + if (Filename==null) { + return; + } + ZirkelFrame ZF=JZirkelCanvas.getCurrentZF(); + ZirkelCanvas ZC=JZirkelCanvas.getCurrentZC(); + thekTortue=ZC.getConstruction().find("kTortue"); // Dibs + if (thekTortue!=null) { + ZC.delete(thekTortue); + } + thekTortue3D=ZC.getConstruction().find("kTortue3D"); // Dibs + if (thekTortue3D!=null) { + ZC.delete(thekTortue3D); + } + if ((!Filename.endsWith(".zirz"))&&(!Filename.endsWith(".zir"))) { + Filename+=ext; + } + if (ICanSave(Filename, ask)) { +// SetMacrosProtectionForSaveProcess(macrostree.JML.MacroTreeTopNode); + OutputStream o; + try { + ZF.ZC.getConstruction().BackgroundFile=ZF.Background; + ZF.ZC.getConstruction().ResizeBackground=Global.getParameter( + "background.usesize", false); + doSave(ZF.ZC, Filename, null); + ZF.Filename=Filename; + if(!JZirkelCanvas.isWorkBook()) + tab_main_panel.setCurrentTabName(FileName.filename(Filename), Filename); + } catch (final Exception e) { + final Warning w=new Warning(pipe_tools.getFrame(), Global.Loc("warning.save"), + FileName.chop(32, e.toString(), 64), Global.Loc("warning"), true); + w.center(null); + w.setVisible(true); + } +// ResetMacrosProtection(macrostree.JML.MacroTreeTopNode); + } + pipe_tools.TabHaveChanged(false); + } + + /********************************************* + * Workbooks part : open and save zirs files + *********************************************/ + public static String getConstruction(ZirkelCanvas zc) { + try { + final ByteArrayOutputStream out=new ByteArrayOutputStream(); + doSave(zc, null, out); + return out.toString("utf-8"); + } catch (Exception ex) { + return "Error"; + } + } + + public static void saveWorkBookAs() { + final String filename=getSaveFile(false); + if (filename!=null) { + saveWorkBook(filename); + } + } + + public static String getWorkBookSource() { + String backup=""; + try { + ByteArrayOutputStream bout=new ByteArrayOutputStream(); + // save the workbook into a byteArray stream : + saveWorkBook(bout); + // then save it into base64 format : + backup=new String(Base64Coder.encode(bout.toByteArray())); + + // Make the base64 encoding url safe : + backup=backup.replace("+", "-"); + backup=backup.replace("/", "_"); + // remove base64 paddings : + backup=backup.replace("=", ""); + + } catch (Exception ex) { + } + return backup; + } + + public static void setWorkBookSource(String s) { + try { + // base64 encoding is url safe. This restore the + // "official" syntax of the string : + s=s.replace("-", "+"); + s=s.replace("_", "/"); + // restore base64 paddings : + int reste=s.length()%4; + if (reste==2) { + s+="=="; + } else if (reste==3) { + s+="="; + } + + byte[] b=Base64Coder.decode(s); + ByteArrayInputStream bin=new ByteArrayInputStream(b); + openWorkBook(null, bin); + } catch (Exception ex) { + } + } + + public static void saveWorkBook(String filename) { + ZirkelCanvas ZC=JZirkelCanvas.getCurrentZC(); // Dibs + thekTortue=ZC.getConstruction().find("kTortue"); + if (thekTortue!=null) { + ZC.delete(thekTortue); + } + thekTortue3D=ZC.getConstruction().find("kTortue3D"); // Dibs + if (thekTortue3D!=null) { + ZC.delete(thekTortue3D); + } + if (filename==null) { + return; + } + if (!filename.endsWith(".zirs")) { + filename+=".zirs"; + } + try { + saveWorkBook(new FileOutputStream(filename)); + // set workbook mode : + JZirkelCanvas.setWorkBookFileName(filename, true); + } catch (Exception ex) { + } + } + + public static void saveWorkBook(OutputStream output) { + try { + // Create the ZIP file + + ZipOutputStream out=new ZipOutputStream(output); + + // Save the workbook : + + Progress_Bar.create(Global.Loc("progressbar.workbooksavemessage"), 0, tab_main_panel.getBTNSsize()-1); + + for (int i=0; i1)+"\n"; + file+="showstatus="+(tab_main_panel.getBTNSsize()>1)+"\n"; + file+="currenttab="+(tab_main_panel.getActiveBtnPos()+1); + file+="\n\n\n"; + file+="** APPLICATION SPECIFIC PART :\n"; + file+="\n"; + file+="window_width="+pipe_tools.getWindowSize().width+"\n"; + file+="window_height="+pipe_tools.getWindowSize().height+"\n"; + file+="\n"; + return file.getBytes(); + } + + public static void openWorkBook() { + final String filename=getOpenFile(); + if (filename!=null) { + openWorkBook(filename); + } + } + + public static void openWorkBook(String filename) { + try { + openWorkBook(filename, new FileInputStream(filename)); + } catch (Exception ex) { + } + } + + // OpenWork book from Application : + public static void openWorkBook(String filename, InputStream in) { + try { + + ZipInputStream zpf=new ZipInputStream(new BufferedInputStream(in)); + String prefsFileContent=null; + + // remember last tab button : + tab_btn lastbtn=tab_main_panel.getLastBtn(); + // remember last tab position before adding new ones : + int last_tab_pos=tab_main_panel.getBTNSsize()-1; + + ZipEntry entry; + while ((entry=zpf.getNextEntry())!=null) { + + int size; + byte[] buffer=new byte[2048]; + + ByteArrayOutputStream bos=new ByteArrayOutputStream(); + + while ((size=zpf.read(buffer, 0, buffer.length))!=-1) { + bos.write(buffer, 0, size); + } + bos.flush(); + bos.close(); + + if (validZirkelFileName(entry.getName())) { + tab_btn curbtn=tab_main_panel.addBtn(entry.getName()); + curbtn.getPanel().setInputFile(bos.toByteArray()); + } else if (validImageFileName(entry.getName())) { + Media.createMedia(entry.getName(), bos.toByteArray()); + } else if (validPreferencesFileName(entry.getName())) { + prefsFileContent=bos.toString("UTF-8"); + } + + } + + // set workbook mode : + if (filename!=null) { + JZirkelCanvas.setWorkBookFileName(filename, false); + } + + if (prefsFileContent!=null) { + applyWorkBookPreferences(prefsFileContent, last_tab_pos); + } else { + tab_main_panel.setActiveBtn(1); + tab_main_panel.showActiveBtn(); + } + + // if last tab canvas is empty, then remove it : + if ((lastbtn.getPanel().getZC().isEmpty())&&(lastbtn.getPanel().getByteArrayInputFile()==null)) { + tab_main_panel.removeBtn(lastbtn); + } + + // I know, this is weird, but it work's (for palette display) : + pipe_tools.setWindowComponents(); + pipe_tools.setWindowComponents(); + Open_left_panel_btn.setmode(); + Open_middle_panel_btn.setmode(); + Open_right_panel_btn.setmode(); + JGeneralMenuBar.initToggleItems(); + tab_main_panel.initToggleItems(); + } catch (Exception e) { + return; + } + } + + /** + * inside the workbook zirs archive, "preferences.txt" contains properties with + * following structure : = + * @param prefs : content of the "preferences.txt" file + * @param property : the property we want to read + * @return the value of the property + */ + public static String getPref(String prefs, String property) { + Matcher m=Pattern.compile("\\Q"+property+"=\\E(\\w+)\\W", Pattern.MULTILINE).matcher(prefs); + if (m.find()) { + return m.group(1); + } + return null; + } + + /** + * Read and apply workbook preferences : "preferences.txt" inside the "zirs" archive + * @param prefs : content of the "preferences.txt" file + * @param last_tab_pos : last tab position before adding the zirs + */ + public static void applyWorkBookPreferences(final String prefs, int last_tab_pos) { + + int tabnum=last_tab_pos; + try { + tabnum+=Integer.parseInt(getPref(prefs, "currenttab")); + } catch (Exception e) { + tabnum=last_tab_pos; + } + + tab_main_panel.setActiveBtn(tabnum); + tab_main_panel.showActiveBtn(); + + Global.setParameter("comment", "true".equals(getPref(prefs, "showcomments"))); + RightPanel.showPanel("true".equals(getPref(prefs, "showpalette"))); + LeftPanel.showPanel("true".equals(getPref(prefs, "showleftpanel"))); + if (pipe_tools.isApplet()) { + themes.setShowTabs("true".equals(getPref(prefs, "showtabs"))); + themes.setShowStatus("true".equals(getPref(prefs, "showstatus"))); + } else { + themes.setShowTabs(true); + themes.setShowStatus(true); + } + try { + int w=Integer.parseInt(getPref(prefs, "window_width")); + int h=Integer.parseInt(getPref(prefs, "window_height")); + pipe_tools.setAndCheckWindowSize(w, h); + } catch (Exception e) { + } + } + + public static byte[] copyToByteArray(InputStream in) { + int BUFFER_SIZE=4096; + ByteArrayOutputStream out=new ByteArrayOutputStream(BUFFER_SIZE); + try { + int byteCount=0; + byte[] buffer=new byte[BUFFER_SIZE]; + int bytesRead=-1; + while ((bytesRead=in.read(buffer))!=-1) { + out.write(buffer, 0, bytesRead); + byteCount+=bytesRead; + } + out.flush(); + in.close(); + out.close(); + } catch (IOException e) { + } + return out.toByteArray(); + } + + public static void open(String filename) { + if ((filename.endsWith(".mcr"))) { + openMacro(filename); + } else if ((filename.endsWith(".zirs"))) { + openWorkBook(filename); + } else { + openFile(filename, null, 0); + } + } + + public static void OpenStartupFiles() { + for (int i=0; iyNys3 z2#5pXWAMK684#Q}Be?ScxN<80U2h`CO|J-{9cgxEcV~9(U-l6bky6`h6p1tt}jMQljM~tis1IC?ucSWUsh~qGf|5APM|y1lZoq(kv~LL3QYG|N2{&>s#n$ zN5c*1g##||h$hIPE$noUf)#fp@+*skW)2QmU_8?51T8V!}xK{z+}LrJAG6UQdi zY%ZVA=knU=+s_kx<)zQ=1$!?uLKYKF~$zvlby&^N7h$L`d%sU_bFO~2H*ep)|M2NEe`!*19CA4$?7)11 z6NA?Xwppubd37P0rhV~ z>Z*Et1Wg?Gm>*&c`~=Li-EOhGSkN!cS4te%<%Lo~U#ygSJ>bj&+VuI^t2fuo$4~lC zpW(3~Ls}=I`mlTsFY!79Vq>@@sGR~e2Wn$ovsLYbV1Sjr1D5+_CMbT#RPhy_M@|#D zyU-)EQV$YY$EbrjJ!)XK&gcxOpNZJ1cq}a;V;4`$_LL0`k9yMdPGX!%x{KZG@D<|I z_UNqXUx{c`hawiKnjf}EM-q?(B!P$kJ0El?vsGdHk>y7R3jPTIn?W-d`0Nh@%h83c z3fqq?dLT-a3LB*=;uAxO($TJqxT>)I$VTa;@R>1=m{}2DC<>n)?K%%9r5agTN&=F= zD1mfT)!6-i{pj!i(Ii=u1SEm~ihzd=Q!CM>QWS)PJIT*usD fSMdy#3;J~Cz*dFrM;0v*`A2|bkcA}hR|)(9S1S`x literal 0 HcmV?d00001 diff --git a/eric/GUI/ZDialog/ZButton.java b/eric/GUI/ZDialog/ZButton.java new file mode 100644 index 0000000..0b10641 --- /dev/null +++ b/eric/GUI/ZDialog/ZButton.java @@ -0,0 +1,55 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.ZDialog; + +import java.awt.Font; +import java.awt.Graphics; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import javax.swing.JButton; +import rene.gui.Global; + +/** + * + * @author erichake + */ +public class ZButton extends JButton { + + @Override + public void paint(Graphics g) { + super.paintComponent(g); + } + + public ZButton(String lbl) { + super(lbl); + setOpaque(false); + setFont(new Font(Global.GlobalFont, 0, 11)); + addMouseListener(new MouseAdapter() { + + @Override + public void mouseClicked(MouseEvent e) { + action(); + } + }); + } + + public void action() { + } + + public void pressed(final ZButton button) { + class pressed implements Runnable { + + @Override + public void run() { + button.setEnabled(false); + try { + Thread.sleep(500); + } catch (InterruptedException ex) {} + button.setEnabled(true); + } + } + new Thread(new pressed()).start(); + } +} diff --git a/eric/GUI/ZDialog/ZCheckBox.java b/eric/GUI/ZDialog/ZCheckBox.java new file mode 100644 index 0000000..4ada973 --- /dev/null +++ b/eric/GUI/ZDialog/ZCheckBox.java @@ -0,0 +1,70 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package eric.GUI.ZDialog; + +import eric.GUI.themes; +import eric.JZirkelCanvas; +import java.awt.Graphics; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import javax.swing.JLabel; +import javax.swing.SwingConstants; +import rene.zirkel.ZirkelCanvas; + +/** + * + * @author erichake + */ +public class ZCheckBox extends JLabel { + + private boolean selected; + + @Override + public void paint(Graphics g) { + + super.paintComponent(g); + if (selected) { + g.drawImage(themes.getImage("chkboxON.gif"), 0, 2, this); + } else { + g.drawImage(themes.getImage("chkboxOFF.gif"), 0, 2, this); + } + + } + + public ZCheckBox(String lbl, boolean value) { + super(lbl); + selected=value; + setFont(ZTools.ZCheckBoxFont); + setFocusable(false); + setIcon(themes.getIcon("pixel")); + setIconTextGap(20); + setVerticalTextPosition(SwingConstants.CENTER); + setVerticalAlignment(SwingConstants.CENTER); + addMouseListener(new MouseAdapter() { + + @Override + public void mousePressed(MouseEvent e) { + setSelected(!selected); + action(); + } + }); + } + + public boolean isSelected() { + return selected; + } + + public void setSelected(boolean b) { + selected=b; + ZirkelCanvas zc=JZirkelCanvas.getCurrentZC(); + if (zc!=null) { + zc.repaint(); + } + } + + public void action() { + } + } \ No newline at end of file diff --git a/eric/GUI/ZDialog/ZDialog.java b/eric/GUI/ZDialog/ZDialog.java new file mode 100644 index 0000000..a9deca9 --- /dev/null +++ b/eric/GUI/ZDialog/ZDialog.java @@ -0,0 +1,263 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.ZDialog; + +import eric.GUI.windowComponent; +import eric.JEricPanel; +import eric.JZirkelCanvas; +import java.awt.BasicStroke; +import java.awt.Color; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.MouseInfo; +import java.awt.Point; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseMotionAdapter; +import java.awt.geom.RoundRectangle2D; +import javax.swing.JLabel; +import javax.swing.SwingConstants; +import rene.zirkel.ZirkelCanvas; + +/** + * + * @author erichake, lightly modified by PM Mazat + */ +public class ZDialog extends JEricPanel { + + private ZDialog me; + //private RoundRectangle2D roundRect; + protected RoundRectangle2D roundRect; + //private int cx=0, cy=0, cw=0; + protected int cx=0, cy=0, cw=0; + private Point origin, winloc; + public int D_X, D_Y, D_WIDTH, D_HEIGHT; // Dialog width and height + private boolean withTitle=false; + private ZDialogTitle title; + private boolean withCloseBox=false; + private ZDialogCloseBox closebox; + //private boolean boxEnter=false; + protected boolean boxEnter=false; + protected int THEIGHT=22; + protected int MARGINTOP1=THEIGHT+8; // Margin top for first component line + protected int MARGINTOP2=MARGINTOP1+26; // Margin top for second component line + protected int MARGINTOP3=MARGINTOP2+26; // Margin top for third component line + protected int MARGINTOP4=MARGINTOP3+26; // Margin top for forth component line + protected int MARGINTOP5=MARGINTOP4+26; // Margin top for forth component line + protected int ARCCORNER=20; // Round corner size + protected int LWIDTH=150; // Label width (for textfields) + protected int BWIDTH=90; // Button width + protected int CWIDTH=350; // Component width + protected int CHEIGHT=19; // Component height + protected int MARGINW=12; // Margin left and right + protected int NOT_EXIT = 28; //at least NOT_EXIT pixels will be visible + + @Override + public void paint(Graphics g) { + if (JZirkelCanvas.isPaintCalled()) { + + Graphics2D g2d=windowComponent.getGraphics2D(g); + + if (isTitleVisible()) { + // draw the title background : + g2d.setColor(ZTools.backTitleColor); + g2d.setClip(0, 0, D_WIDTH, THEIGHT); + g2d.fill(roundRect); + } + + if (isCloseBoxVisible()) { + // draw the close box : + g2d.setColor(ZTools.TitleTextColor); + if (boxEnter) { + g2d.setStroke(new BasicStroke(2f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND)); + } else { + g2d.setStroke(new BasicStroke(1.5f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND)); + } + g2d.drawOval(cx, cy, cw, cw); + int dx=(int) (cw*(1-Math.cos(Math.PI/4))); + g2d.drawLine(cx+dx, cy+dx, cx+cw-dx, cy+cw-dx); + g2d.drawLine(cx+dx, cy+cw-dx, cx+cw-dx, cy+dx); + } + + // draw the content background : + g2d.setColor(ZTools.backMainColor); + g2d.setClip(0, THEIGHT, D_WIDTH, D_HEIGHT); + g2d.fill(roundRect); + + g2d.setClip(0, 0, D_WIDTH, D_HEIGHT); + + g2d.setColor(Color.black); + g2d.setStroke(new BasicStroke(0.5f, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_ROUND)); + g2d.draw(roundRect); + g2d.setStroke(new BasicStroke(1f)); + + paintChildren(g); + } + } + + public boolean isCloseBoxVisible() { + return withCloseBox; + } + + public void setCloseBoxVisible(boolean b) { + withCloseBox=b; + } + + public boolean isTitleVisible() { + return withTitle; + } + + public void setTitleVisible(boolean b) { + withTitle=b; + } + + public ZDialog(String ttle, int x, int y, int w, int h, boolean withtitle, boolean withclose) { + me=this; + add(closebox=new ZDialogCloseBox()); + add(title=new ZDialogTitle(ttle)); + withTitle=withtitle; + withCloseBox=withclose; + if (!withtitle) { + MARGINTOP1=MARGINTOP1-THEIGHT; + MARGINTOP2=MARGINTOP2-THEIGHT; + MARGINTOP3=MARGINTOP3-THEIGHT; + MARGINTOP4=MARGINTOP4-THEIGHT; + THEIGHT=0; + } + D_X=x; + D_Y=y; + D_WIDTH=w; + D_HEIGHT=h; + roundRect=new RoundRectangle2D.Double(2, 2, D_WIDTH-4, D_HEIGHT-4, ARCCORNER, ARCCORNER); + + setLayout(null); + setOpaque(false); + } + + public void init() { + setBounds(D_X, D_Y, D_WIDTH, D_HEIGHT); + title.setBounds(0, 0, D_WIDTH, THEIGHT); + cw=THEIGHT-8; + cx=D_WIDTH-cw-MARGINW; + cy=4; + closebox.setBounds(cx, cy, cw, cw); + fixComponents(); + } + + public void fixComponents() { + } + + public void doClose() { + } + + public class ZDialogCloseBox extends JEricPanel { + + @Override + public void paint(Graphics g){ + // CloseBox is painted in the ZDialog paint method, + // because it needs backgound in order to render + // the antialisasing of strokes. + } + + public ZDialogCloseBox() { + setOpaque(false); + addMouseListener(new MouseAdapter() { + + @Override + public void mousePressed(final MouseEvent e) { + if (isCloseBoxVisible()) { + doClose(); + } + } + + @Override + public void mouseEntered(final MouseEvent e) { + if (isCloseBoxVisible()) { + boxEnter=true; + ZirkelCanvas zc=JZirkelCanvas.getCurrentZC(); + if (zc!=null) { + zc.repaint(); + } + } + } + + @Override + public void mouseExited(final MouseEvent e) { + if (isCloseBoxVisible()) { + boxEnter=false; + ZirkelCanvas zc=JZirkelCanvas.getCurrentZC(); + if (zc!=null) { + zc.repaint(); + } + } + } + }); + } + } + + public class ZDialogTitle extends JLabel { + + @Override + public void paint(Graphics g) { + if (isTitleVisible()) { + super.paint(g); + } + } + + public ZDialogTitle(String ttle) { + super(ttle); + setFont(ZTools.ZDialogTitleFont); + setForeground(ZTools.TitleTextColor); + setHorizontalAlignment(SwingConstants.CENTER); + setVerticalAlignment(SwingConstants.CENTER); + setOpaque(false); + + addMouseMotionListener(new MouseMotionAdapter() { + + @Override + public void mouseDragged(MouseEvent arg0) { + if (isTitleVisible()) { + Point current=MouseInfo.getPointerInfo().getLocation(); + me.setLocation(winloc.x+current.x-origin.x, winloc.y+current.y-origin.y); + /* + * the ZDialog window doesn't have to exit the main window + */ + ZirkelCanvas zc = JZirkelCanvas.getCurrentZC(); + if(me.getLocation().x+me.getWidth()-NOT_EXIT<=0){ + me.setLocation(-me.getWidth()+NOT_EXIT, me.getLocation().y); + } + if(me.getLocation().x+NOT_EXIT>=zc.getWidth()){ + me.setLocation(zc.getWidth()-NOT_EXIT, me.getLocation().y); + } + if(me.getLocation().y<=0){ + me.setLocation(me.getLocation().x, 0); + } + if(me.getLocation().y+NOT_EXIT>=zc.getHeight()){ + me.setLocation(me.getLocation().x, zc.getHeight()-NOT_EXIT); + } + /* + * end of code + */ + } + } + }); + + + addMouseListener(new MouseAdapter() { + + @Override + public void mousePressed(MouseEvent e) { + if (isTitleVisible()) { + origin=MouseInfo.getPointerInfo().getLocation(); + winloc=me.getLocation(); + } + } + }); + } + } + + public void send(String msg) { + } +} diff --git a/eric/GUI/ZDialog/ZLabel.java b/eric/GUI/ZDialog/ZLabel.java new file mode 100644 index 0000000..5cdcd8c --- /dev/null +++ b/eric/GUI/ZDialog/ZLabel.java @@ -0,0 +1,24 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.ZDialog; + +import java.awt.Graphics; +import javax.swing.JLabel; + +/** + * + * @author erichake + */ +public class ZLabel extends JLabel { + + public void paint(Graphics g) { + super.paintComponent(g); + } + + public ZLabel(String s) { + super(s); + setFont(ZTools.ZLabelFont); + } +} diff --git a/eric/GUI/ZDialog/ZMessageDialog.java b/eric/GUI/ZDialog/ZMessageDialog.java new file mode 100644 index 0000000..f7d776d --- /dev/null +++ b/eric/GUI/ZDialog/ZMessageDialog.java @@ -0,0 +1,30 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.ZDialog; + +import eric.JZirkelCanvas; +import rene.zirkel.ZirkelCanvas; + +/** + * + * @author erichake + */ +public class ZMessageDialog extends ZDialog { + + public ZMessageDialog() { + super("essai", 0, 0, 400, 300, true, false); + } + + public static void showMessage() { + ZirkelCanvas zc=JZirkelCanvas.getCurrentZC(); + if (zc!=null) { + ZMessageDialog zmd=new ZMessageDialog(); + zc.add(zmd); + zmd.init(); + } + } +} + + diff --git a/eric/GUI/ZDialog/ZSep.java b/eric/GUI/ZDialog/ZSep.java new file mode 100644 index 0000000..2b22191 --- /dev/null +++ b/eric/GUI/ZDialog/ZSep.java @@ -0,0 +1,45 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.ZDialog; + +import java.awt.Dimension; +import java.awt.Graphics; +import eric.JEricPanel; + +/** + * + * @author erichake + */ +public class ZSep extends JEricPanel { + + int percent=100; + + public void paint(Graphics g) { + + Dimension d=getSize(); + int margin=d.width*(100-percent)/200; + g.setColor(ZTools.backTitleColor); + g.fillRect(margin, 0, d.width-2*margin, d.height); + +// Dimension d=getSize(); +// g.setColor(ZTools.B_TextField); +// g.fillRect(0, 0, d.width, d.height); +// paintChildren(g); +// g.setColor(ZTools.Bord_TextField); +// g.drawRect(0, 0, d.width, d.height); +// if (withback) { +// Dimension d=getSize(); +// g.setColor(ZTools.backTitleColor); +// g.fillRect(0, 0, d.width, d.height); +// paintChildren(g); +// } +// super.paintComponent(g); + } + + public ZSep(int prop) { + super(); + percent=prop; + } +} diff --git a/eric/GUI/ZDialog/ZTextField.java b/eric/GUI/ZDialog/ZTextField.java new file mode 100644 index 0000000..90d08b4 --- /dev/null +++ b/eric/GUI/ZDialog/ZTextField.java @@ -0,0 +1,127 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.ZDialog; + +import eric.JEricPanel; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Insets; +import java.awt.event.FocusAdapter; +import java.awt.event.FocusEvent; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import javax.swing.BoxLayout; +import javax.swing.JTextField; + +/** + * + * @author erichake + */ +public class ZTextField extends JEricPanel { + JTextField field; + + @Override + public void paint(Graphics g) { + Dimension d=getSize(); + g.setColor(ZTools.B_TextField); + g.fillRect(0, 0, d.width, d.height); + paintChildren(g); + g.setColor(ZTools.Bord_TextField); + g.drawRect(0, 0, d.width, d.height); + } + + public ZTextField(String s) { + setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); + setOpaque(false); + field=new JTextField(s){ + @Override + public void paintBorder(Graphics g){ + + } + }; + field.setMargin(new Insets(0, 0, 0, 0)); + field.setOpaque(false); + field.setFont(ZTools.ZTextFieldFont); + field.setForeground(ZTools.C_TextField); + field.setBackground(ZTools.B_TextField); + field.addKeyListener(new KeyAdapter() { + + @Override + public void keyReleased(final KeyEvent e) { + actionKey(e); + } + }); + field.addMouseListener(new MouseAdapter() { + + @Override + public void mousePressed(MouseEvent e) { + actionMouse(); + } + }); + field.addFocusListener(new FocusAdapter() { + + @Override + public void focusGained(FocusEvent e) { + focusOn(); + } + + @Override + public void focusLost(FocusEvent e) { + focusOff(); + } + }); + JEricPanel panel=new JEricPanel(); + Dimension d=new Dimension(1, 1); + panel.setOpaque(false); + panel.setPreferredSize(d); + panel.setMinimumSize(d); + panel.setMaximumSize(d); + panel.setSize(d); + add(panel); + add(field); + } + + public void actionMouse() { + } + + public void actionKey(KeyEvent k) { + } + + public void focusOn(){ + } + + public void focusOff(){ + } + + public void setEditable(boolean b){ + if (field!=null) { + field.setEditable(b); + } + } + + public void setHorizontalAlignment(int align){ + field.setHorizontalAlignment(align); + } + public String getText(){ + return field.getText(); + } + public void setText(String s){ + field.setText(s); + } + public void selectAll(){ + field.selectAll(); + } + @Override + public void setForeground(Color c){ + if (field!=null) { + field.setForeground(c); + } + } + + +} diff --git a/eric/GUI/ZDialog/ZTextFieldAndLabel.java b/eric/GUI/ZDialog/ZTextFieldAndLabel.java new file mode 100644 index 0000000..6937d7a --- /dev/null +++ b/eric/GUI/ZDialog/ZTextFieldAndLabel.java @@ -0,0 +1,132 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.ZDialog; + +import eric.JEricPanel; +import java.awt.Color; +import java.awt.Graphics; +import javax.swing.BoxLayout; +import javax.swing.SwingConstants; + +/** + * + * @author erichake + */ +public class ZTextFieldAndLabel extends JEricPanel { + + private ZTextFieldAndLabel me; + private myTextField field=null; + private ZLabel label=null; + private String InitValue=""; + private int labelWidth=100; + private int labelHeight=20; + + @Override + public void paint(Graphics g) { + paintChildren(g); + } + + public ZTextFieldAndLabel(String lbl, String value, int labelwidth,int labelheight) { + super(); + me=this; + labelWidth=labelwidth; + setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); + setOpaque(false); + if (labelWidth==0) { + InitValue="<"+lbl+">"; + if ("".equals(value)) { + add(field=new myTextField(InitValue)); + field.setForeground(ZTools.C_TextField_OFF); + } else { + add(field=new myTextField(value)); + } + field.setHorizontalAlignment(SwingConstants.CENTER); + + } else { + add(label=new ZLabel(lbl)); + add(field=new myTextField(value)); + ZTools.fixsize(label, labelWidth, labelheight); + } + } + + public void actionMouse() { + } + + public void actionKey(java.awt.event.KeyEvent k){ + } + + public void focusLost(){ + } + + public void focusGained(){ + } + + public String getText() { + if (InitValue.equals(field.getText())) { + return ""; + } else { + return field.getText(); + } + } + + public void setText(String txt) { + if ("".equals(txt)) { + txt=InitValue; + field.setForeground(ZTools.C_TextField_OFF); + } else { + field.setForeground(ZTools.C_TextField); + } + field.setText(txt); + } + + @Override + public void setForeground(Color c){ + if(field!=null){ + field.setForeground(c); + } + } + + public void setEditable(boolean b){ + if (field!=null){ + field.setEditable(b); + } + } + + private class myTextField extends ZTextField { + + public myTextField(String s) { + super(s); + } + + @Override + public void actionMouse() { + me.actionMouse(); + } + + @Override + public void actionKey(java.awt.event.KeyEvent k){ + me.actionKey(k); + } + + @Override + public void focusOn() { + if ((field.getText().equals(InitValue))) { + field.setText(""); + field.setForeground(ZTools.C_TextField); + } + field.selectAll(); + me.focusGained(); + } + + @Override + public void focusOff() { + if ((field.getText().equals(""))) { + field.setText(InitValue); + field.setForeground(ZTools.C_TextField_OFF); + } + me.focusLost(); + } + } +} diff --git a/eric/GUI/ZDialog/ZTools.java b/eric/GUI/ZDialog/ZTools.java new file mode 100644 index 0000000..f50e7f5 --- /dev/null +++ b/eric/GUI/ZDialog/ZTools.java @@ -0,0 +1,39 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.ZDialog; + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import javax.swing.JComponent; +import rene.gui.Global; + +/** + * + * @author erichake + */ +public class ZTools { + public static final Color backMainColor=new Color(100, 100, 100, 50); + public static final Color backTitleColor=new Color(0, 0, 0, 200); + public static final Color TitleTextColor=new Color(255, 255, 255); + public static final Color C_TextField=new Color(50, 50, 50); // Text color of ZTextFields + public static final Color C_TextField_OFF=new Color(150, 150, 150); // Disable Text color of ZTextFields + public static final Color B_TextField=new Color(245, 246, 255); // ZTextFields background color + public static final Color Bord_TextField=new Color(50, 50, 50); // ZTextFields line border color + + public static final Font ZLabelFont=new Font(Global.GlobalFont, 0, 11); + public static final Font ZCheckBoxFont=new Font(Global.GlobalFont, 0, 11); + public static final Font ZTextFieldFont=new Font(Global.GlobalFont, 0, 11); + public static final Font ZDialogTitleFont=new Font(Global.GlobalFont, 1, 12); + + + public static void fixsize(JComponent jc, int w, int h) { + Dimension d=new Dimension(w, h); + jc.setSize(d); + jc.setMaximumSize(d); + jc.setMinimumSize(d); + jc.setPreferredSize(d); + } +} diff --git a/eric/GUI/icons/.DS_Store b/eric/GUI/icons/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..a25601ede4a26353b7b345973c5f7b8a4cfdd7cd GIT binary patch literal 10244 zcmeHMZEO@p7=GVUV3*}!3KS|I=HQ~KP^G1D^M5Dx*Xe53m{_rDWqDKAUKPCD{Vj{jXvsbQn5E6eFjXTNA zJ0I^mGyBXl@6F5s0H#Ka27ovKC=|J5vne@8;O#t?g^I9d4oM_?fF20I1rN+lyG%Q( zh!BVnh!BVnh!BVn_%|Rxzu7z}nv_u*ArK)DAux#m_YZN3TqZ*~A*FB~l!z+;$x5mg zf%0?@5H|5pCPO(Pr7)#F1P8EWMlY9qzkGa^t9U>amV2d~qfqV-9M zmI60}4`X0~0|vbdj7`HcMkwv(AB1h{*X6lj!N0KFb_SvjuIg6X=#>dPUGrS(6fktGhjOluWyI z$LzCwD`VMKu#c8fRn#=AA^ck!>f%k!Egb)~YwIcBc;)ywdsb1FT-MyWWiUT}-!soX z_xuYl9(wP6@!@AzV7@F*rYFi_DaOA9Un@HrQVl;WAod+&MVQTw&6&%p=FP8KP*uIK zdQr_qi+OC(fN6a0=o@Mmp^{nL#4+Q3|L63EtnP&4!RJWSO z(AlcqeRw9Hy1LTjuaRqWCkFSd|{o)D-09KyYnL7>$r}oCX(G!OQnsl3R+` z^e7ca3(Nd97CZ`VjM$uw9h(+)UY}-c#5cE^wjNlcX1gAkK1YtDdlrT?tIFzjc7&A7 zR@>%S`Tbef9?3aEd+ItBF`;A$2e$jJ7tnf>VG-)*SUuV(hv(KTTYl-P`sS(w|OR|vRX^TE>W4T^!oIbvWr@6rOJG@cP}|%X?nS~T49E|P4Gxo ztE_R*5K2V1E*f;2Y(3LkG8a~;YnoqOZ zaK5ipltFIMY8a-GNWL;8mOqgU30XwPdPxk%51Y%N9#TZQA@Z~P;C^@no`Tol7`zT| zz`O7e576_1^V&YL=~U%0vB-%IC{!l^E(Ubv_xWOe%_D@uq^%t=8*$uq&f z0>1>qr;?gG>e$6v{CxD;M)Wmr6?|kfKNs4>bxuU4$YO15r9yj!RfwW?d2BV`32d5d z6%032HeI$7xB0GMm9ll6Mx5TPvKg|qRcjMFk%27N#yV8t9xqJW3y}6BqU;Yu*x%qZ z{E0JA!x~&pG+m7?UWE!}v13f=7tFZ{cx#8&BY;;wVDQoTTjy1;R>+-~w^Yto^iqDg%ACvo9ohy9qCnHyb-T!H>jd;Jw{ z%3zD?dYHsccl}p+{8D=Uv$V8rjOvSvjF6I&v9huxcGF^o{!4uM8F1Z8eEWr&rHjTr>Ll2hO1(R`$c*49cjrLX}Umy<&Th%RAg?9jg3Qg>nm7>sHv$e zbm~`p`CozkFLcqOrm2mMjR9rKG*W*eI$VmLx^|B19AK!asi}>dq9JqPW{mZdm6c0- z{3dVZP>|fczree?x`l>_0AR{Qd;NKuzdD4&NO=2Rg8oX0%C@$*ySlfVo19O4{zZ5B zC~@LNdiY0s`pU+^qo}M>egC((xj=XKL3;NudE75_=vaULZIb#4Th|F?&Ie}IRDJ(1 zbnP>C?YX+SH+b=0g8a0#wpfJq9&_6xa@iAU*G+u<4{6F4ZPg@j;3H}1VTSOsv$R@& z{~v4FH+J$pc=9xK?OTEW%YHpex|B;=?29YG~-ng;QEzBQ(^+5lzs5&&pdL!gS5f4wgZa zb~Tiel7=w7vnwl|(4|dcDkUH`GFnE5XrNhcHe$d0tQ(b<@*} z*wCEj6rCLdwb7xVx_}+catA;E5+PPFQ$@Bcf`$1 z9V(`ql~rdhhAPioT3TcQwJ4{y#z+)Z+Ss|Ej7J3GbJO^EZDmwxTb_sr4mF6hLU@$C z8=BiKGLy<(p!P%sU`R7()zxs@02zALg|T6R;%L(995uD^I&5qf9{%|m8LFb_F>RC( z8SY!2TJ4cipDZAbkr33iqoRt#it_`j>I2QhFcXS0cX3!oa(!}OpqUo7gd}RFU6q?F pr^>5^J)w!I@w&L!YcUKC001&aK$OD;mOlUh002ovPDHLkV1hkzq4fX& literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/bar/aimantON.png b/eric/GUI/icons/bar/aimantON.png new file mode 100644 index 0000000000000000000000000000000000000000..504a5279bd5eaedd95f0ad79c8d2cb120a34b2a0 GIT binary patch literal 1065 zcmeAS@N?(olHy`uVBq!ia0vp^av;pX3?zBp#Z6#fU~CBR32_B-2?7Cj_T?T<5M^eP z;^)Gh+N*4G_?WBcB?7w(pJw? z*J5R20&?5i+aX%=^YbB$Nl{)v1}iHokW5KUQxzA5i0_YaWo2f*67M!=?!r1HO?Gy6 zpm?2$T9|>}UM2bYJYu2ZLO_uXR(k9Cg(`iWqoSiXtE!$%^oW$xNYpfd7=lb5j&w*A z6M=|`a_}r!x)jK^*E0f=U7GqkcI>oOl7h%?icLD>V06Sl{j#6+^#u0~8#is_;F&&s z#y%~@t=qQVEegF6;dndCce}XMX&Zyho3~sEw!M`da5L5Cg1gzWr zK^^67{QS4`gLcZw+=zBw_I)=nE*O$ag8YIR7};2unEBbcS;LejW$_d*e04UPPmEK- zz{5CDRyS2`ZtSOjbssG+eNNI5eA6gbFI>A@!@_0eOxxxuoxfl7rpFv${`+o|%r!~E)}oJlWsV@^x=l`r8Bl)6yF$p z_kL{Kn{Th%KUTzS+EXfgL)iCzs&1Fw9B!*WC+in{x!I7o+3i33U#9mfQ=gV(NKXYN NXirx^mvv4FO#oX$jv4>} literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/bar/angle0.png b/eric/GUI/icons/bar/angle0.png new file mode 100644 index 0000000000000000000000000000000000000000..17b96771a1282b7af58492833e940ac54b1b8e84 GIT binary patch literal 1120 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabRA=0U~CBR32_B-2No~_T|%4-fXbLa zh>@9riG`7wm63&+iGhuYm6Mr+n}wT?m6xAYK#)yHm`zxWLqvj8M21^bkylKGUsPQ{ zL`PUyUsTv!Oxs9Y&`LtpR#MGDO4VFSz($teUY^fgLEcT7*Iz|GR9((TgD+NBDO6u5 z%~(0!T&loQv(`zi!$YgcM|Yy1=Cn|wwg{6&(MI#)bmk-&Oh~j|n(VYO)of;}^~@BD zy=mIp(u`K78y`tmIh859IoJGrzS8w_wFgalCpyC(cUfNP4SGJ+`}VZxSF?kj&5e07 zH?Af4=yIU<8%l!wf{}uOk&%fJ2$)z{A%KmYgOihso0pHDk6%DgSXe|%TvA$AK}lIn zQ(Mo##MIK(H9#~byR~oH%xV2yH5J9hW#ymB-@kibUY!3TfCLAD`B}-}UVH!y6a(y|{N57{L6VE{-7)yDG_Cd*kJsYp>;ej=$e{W#!>&*B>=I zZO$K-6(|yG;ZWqboIc@sgo@EY4mnN-9slr&>mDdGzME{{t#^6Jp99CN^}Ezg@}|Un zmQgNe@9=z8H*;mBse{X+(nq51(~EYU_@i3hyx{+HhKV9;_ZNSc`FyjSx%2<5ShJe` z@&;pZ2A}K4UeApFbd9xPgGy)3nmb#czWFru{m$Kb424#PzM*1<-)B^p-e(Pn{~vev z_LVC-@0z2oE#@hgw|Bo=$nCK3`rV638McK96-s_)78&qol`;+0AB5j3IG5A literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/bar/angle1.png b/eric/GUI/icons/bar/angle1.png new file mode 100644 index 0000000000000000000000000000000000000000..1ebdc72cc2d471d9c694e51c24b42afabb9e0d90 GIT binary patch literal 1142 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabRA=0U~CBR32_B-2O(erI*);YnURs1 zk%@(og_V(&or#@`nTv;oo1c|mfK^b4O-O`YNQ^^Ric46IM^u4VREbYiRX{{jNJK|O z#7tD(Oia;SOwB?}%R*e%KwQ{TLefT3*-To zLqjx1TRuux*k4y7!$>K`L^Rt{ywFlJ-&U@{Nh`xetIl1a&0W9ATca{Szc)yGQn2~N zP~Ao0I+G(zrbXyak2IJXX*fB`WM+)%)HsV3u}1xg)>D&hw3`m7lfdm1ZBiVAWvUqAWu^;*)ouTftP zfA-n+<;zy*Z>w#-tXTAQ@h6jopB9?U`!wro+4R2p+>V6rcD{dHe*gaY<>kFw=Wh$o z-)sW3Rn^nQF~s6@>E!$Qw+sXt{=S)hgFmp&LCKj}kyBuiftjz*tBj>tjhT1d*rj{8 z+|0X;ctc#A93RHdpL|JdTY-PrKK*NVfASS@GAcT89QwgC$>N!-=MfG$L4|44X3x`l ztn74T`$2{E94DC`m)~9xYuY(O!^I}$j+w_JUV(1Ia<88uL3{$8_LA!@w=Lx23^lOh zYVH?QSNgS|Ux0IQLFw0``R}>U&k1cPpTlg>=l-r<)1X@7 zyUyKtU;f>a{mJBa2`A=Eh}%~-cafRwHohu$mr(sM_P-D6N-r158XHS*=V#TKxaaAe zOaD@~&MWP{)nsJazOB&#)GK?!4T7SxH{Tsx$AqSUY$*9{1(G+?9B9>$mCIUjJuEO=Oj^Wjs)B z^5`kk#3x@m^QOknG59eb(&`HlBX2c8=Xj{ZqcL-F586yLmUiegFFP+n28&-#x#*`^1v2oF6}a{EV&p z8Tj*OL|X9oN#EZud%5fI&2xL=r(^)5g4NT-F~s6@>6Ekiw+tlOi|?K6OFjB?lCTfc zDZU)x%d7l^9~rEi8WC|U#42K8%7!V+rcB^lp%(Vg!}59=*uU zutA#BePf3~(}Dnoik*e2Jl!k}i|30ccrP|)w57W zhn6EMVGSOqw3oIYHMzn4sA#2zkeH&<{_wy2b5>W_%0HhkaOdsiX9q8cEJ~Y`DWUT? zFe;ok!PI<4Tetn}(D!Q}Px)$c;A>+;%Bg$xa`*HeeRN+Q z6?B=`?PIE*!4!2gPPuvXxP5W6L VyT!KJx-0=DN>5immvv4FO#ltheZK$z literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/bar/angle3.png b/eric/GUI/icons/bar/angle3.png new file mode 100644 index 0000000000000000000000000000000000000000..4ebc5feb42968b7fd3ad3d48c64849c1aba5e1d6 GIT binary patch literal 1124 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabRA=0U~CBR32_B-=>`}X7?>CtS(%tP zS(yddcm&zG1lhTT*m*@bc=$NkB)E8_xp|~`c@_D%m4yVfgm@H1x%EW_jm7!RBt)zv z)XgPDZ6p;frNpeIByFUWY^9~_r4{vMB%EXwJe8!3ltp}1rEE3i!nCDgjpY0-&WvT7W(p{NtJU=IJU5?()T=S*5{@Zgk z&gMz4%XeK-;B&A*ZEL>X*?g&u`Hn}5RL&MFUMNwxSgKf565HERw03sQp5<+)H%~gX zch>2{3oo2ndHU4KTXhlbzzAq43Gxd@i3k=}RyKAnZXRAfK_L+_aS2&@B^7lYeM3V7 z{i$vJGp6ZI=+0`5tk;;(Irr1jhZ_$(JM+=|(_59-HqY-Wn_fMouee)NS#8zQnSJf= ze|-P>^~akZja5&6eE;#Q?05CA-|e@4|D8~O?$4}c`?vi1{^8ZrPv8FjyS+c90~kfZ zo-U3d7N<+6p}tcS^b8Kp{#)04Tr~8|`-YG6M2@-bobj45g&}hSJA=pe9m0wyPBIo8 zwlKA9u5@HvCvLw-KDlOh$$qha>PPq2Yo9n};?q$}0w?yDNIWu z?;7!{IPFtWzPloJ-^WF7^S1Xk9pO3r?d`ANMcgu#+!GXL1PByIh_fd7Qd%fkI2lKb8r5D*j;6dfIHV`F1%Y+P4YmztWInVH$y*(oh8 z?c(AhD=Qlk5)u^^Wnf^Clas^9$f&2MS5Q!(prFv+-YzC4=Huhz=H>?U&SowlB$jhu|3w3W53 zSm_C%)@PnBjv*GO-%g4QW-=6LnRzC~{G=YY&Z)IcN)`8I=B=2+^!fk)KJSmu)b>TE z?*A4(*YkXe(f?nH{tSXjf*j{xF-wVhNv=w=)7EJ?Fnj&$>5lofr#^gOBkkgNah_9vpdN4oVlE Lu6{1-oD!M_YP)b%6C{nY-%;f+7|2J8tI9j47O{FPPvN~O>tGU-%cD8ts z!zNI#fRw~2OP(ZEwj@caCQ!36SFasLp(#_dHCCc5Q?6`-xhGDj|Ns9eQ?vj7{}4Ek zK4rmLgVe;+@KJiqDpRgkf71Q_|5ks}XOP>#&+k%t%t&s_Xp-AVaK?k9;9!Z@V2Rc} zWx_IAw!hBqQhUu$c+g65%~^ug!_x0&kK0Ui&h_~GH(yysPZ(n)g6R)5n| zd(mc)+GCB`V~p8giP%kb&PQ&`U53_Bc+mg<|6LroN&o-=By>_vQve$X>ax$cSf^D( z(8}s##X5|4Lw?^C6+^ZB+|X#Db%7?ny*JR0!84kHvPvPyj?H!QI_k z>h4}zph^{o;+g~!lK20MzO*BYd(LbI0Q`1iBo#5*{rFQ*TdhCrAJ?nepo$*dTB~&< z2;0K0&I1JW#o28BGgn*G2N3Iu;^FGcX0v%DirpAOIa$6Yg!G6k_YOixoHyDT%2%Y_ zSb0hyJmI!>D076{c%Fn|`{4PGd|8}e-M-QHVnMSv^0`@n@kR@$>Fi1VGwNm31B@wd)huhQaTD`@ ikWHEmO9pe2j`0hr{5F?8T1MLd0000IMm>gocjnKNe&kj%@=n?8N|?Af!^)6;u;dVnH1 zIXT(c*{P|ilP6EEuC7i?OUup8ZEtS}k|iZ2Sy@>?E%EX3K=mh1oVa}X^1_7+8yg#e zvOvAb$;p5J{sr1qTU!eh0jdNF{`>b2sJ*SajT9x~D=_#Ox{Y!%Uf*Dkh0E-Hvtcr?)3Y!X$Qc>hr;Zxz1RAE-(QBh&$lvfc~ zk(K9B5m8Z*kl|F}5K>W8k&+VRQ&C1Tfg^JbFVN_Vo-U3d9M?_zj}|c-im*ISP4(8+ zojr4=Wtw_h!N32-i+WGrUA}JCX$FVgJ0#}1cPB~zU!$cfX2N`J)tW;()$cD(NSjib zx}dDb-nK(N`$W3z^IxVjzf?6oPWfyhV)0*5$#2f*LyU&c-ap?}d+WDd_rh6$uNFm5 z43eLzRWwat|NLShm6i=f5qv(AXR2jNO6wT!1@9cfs_P4Fp{)L*= zNswPKgTu2MX+Vy&r;B3<$Mxg{2d0?SVQZrpl%1WOJ5?r@C^9nK*(T;-7+Q1>sEonW L)z4*}Q$iB}4M!d} literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/bar/cblue.png b/eric/GUI/icons/bar/cblue.png new file mode 100644 index 0000000000000000000000000000000000000000..16344b2aca06a4ce17d679750c6cf35491281fb6 GIT binary patch literal 118 zcmeAS@N?(olHy`uVBq!ia0vp^B0$W~#0(^7eq%odq&Ne7LR^9L>NSrT7&gh2DP{sW zj3q&S!3+-1ZlnP@(w;7kAsp9}6C9XgR)?*PVo-K=cJ5S}Sfa?taA%vCgJEdVJ)klM MPgg&ebxsLQ0NU0aXaE2J literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/bar/cbrown.png b/eric/GUI/icons/bar/cbrown.png new file mode 100644 index 0000000000000000000000000000000000000000..a4cd67dae59aef6b15ecb0cf715678eaa052b7f3 GIT binary patch literal 118 zcmeAS@N?(olHy`uVBq!ia0vp^B0$W~#0(^7eq%odq&Ne7LR^9LjgzaVr7--?<2(!G zFqQ=Q1v5B2yO9RuNPD_ChHzX@PHOn!<}tn4u+vc_khY6 NJYD@<);T3K0RTb-9_9c5 literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/bar/ccyan.png b/eric/GUI/icons/bar/ccyan.png new file mode 100644 index 0000000000000000000000000000000000000000..41cd76180c02e654f1f17c0b729c3a081296e48c GIT binary patch literal 118 zcmeAS@N?(olHy`uVBq!ia0vp^B0$W~#0(^7eq%odq&Ne7LR^9Lq@zbw`}&l0cl-l# z7)yfuf*Bm1-ADs+q&;06LpZJ{Cpa+0tPWcn#h~o$?A)m`u|$!P;m$TO2gA^!dq8Cj Mp00i_>zopr05wM*!vFvP literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/bar/cgreen.png b/eric/GUI/icons/bar/cgreen.png new file mode 100644 index 0000000000000000000000000000000000000000..741f9de361ffaff8d8964edaf27a9ae0aaf183e5 GIT binary patch literal 118 zcmeAS@N?(olHy`uVBq!ia0vp^B0$W~#0(^7eq%odq&Ne7LR^9LstcOn!<}tn4u+vc_khY6 NJYD@<);T3K0RSo<9+?0D literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/bar/chidden.png b/eric/GUI/icons/bar/chidden.png new file mode 100644 index 0000000000000000000000000000000000000000..64ecfff284330dd4bc55baeb5352d360f03363d5 GIT binary patch literal 612 zcmeAS@N?(olHy`uVBq!ia0vp^B0$W~!3-oXyUC|BFfh6Y_=LCuxf)s~PEJmYjEq1w z9O&p-Xlk1Z3JStS;0!i4HaMG=l~q7cR9IM;mzP&kQnIP32`HtlYhh_=sjRH5sHo`W z<;BI#tD|QrDk99oE1;!o4phLz$e^mKDlae3$;rvg%$%8-SzKIPUS7WK;5$P@Lu+em zQw!IE{G6)Fvikb^_V)HCPoCI01-W=c1P1!W$HyN&eE7(bBg>X8GqZAk_3G8ejT>d< zls!D$`}+E(O`F=))s+|@o1T`uckkZ)`}cQucc-VNEM2;E`SRtfw>`+pO!M*av9R{E zcL@y$2#AP?*t~i3)&p-YU%q_x>eY!8CvHFdVds%g=g*(Nbm`L3qeoAlKD~bZ`s2rs zuUN5S-@bj$&d$%CJ$wE7wY9zf+U<`Pth)IB|Nm86?>)G->N3z{Iwe7V!3gTe~DWM4f?ym40 literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/bar/cnormal.png b/eric/GUI/icons/bar/cnormal.png new file mode 100644 index 0000000000000000000000000000000000000000..d6a157a641f35a5902e5e63abc61039444a4c486 GIT binary patch literal 589 zcmeAS@N?(olHy`uVBq!ia0vp^B0$W~!3-oXyUC{msc!*3A+A7rSb{zW?Rah3TUiYM zXPEupR`CBotDTInjtH-(qS*gcQCA$E{RDd3qa?^Ln1P*zSyFDPL8SGev2KsBuZO-uCQFC|V>P2r$kcED^bfaeJ)-_# z_s!|Q*)5ooG+xYKt}(-cA?9V~nV!r_{-sKZ%wNH`S@IT^z!uDr}l11YArh?qrM(snd-YK@A0O)-~GAfF5lkB zJ$2KsS?P{JYwPBEet*By#wg&ZbhhdB)Sf`E$hT2yiGRZ5Z#i$0lW{UQ*79b#gUmi= Xb}4cH71zG~10@PiS3j3^P6<_b literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/bar/cod0.png b/eric/GUI/icons/bar/cod0.png new file mode 100644 index 0000000000000000000000000000000000000000..21464ed8158389c44b743ab21a05f93b7a065b31 GIT binary patch literal 228 zcmeAS@N?(olHy`uVBq!ia0vp^azM<_!3-pir1Y-?QhotGA+A80i&^ad!M6W<>;E6_ zmgN!RXHoora@zmHUDE8=MfMssc?EC<*clW-vZ;X2KRAp`x;7%Y-vqB45eP1j?Cux;TbN zTux4qIMdKNx0#bW;n`zW@8a%GuOvn%C7XoIy23vOGeJ3`|UnEdN)80=ZvyHe6ni z4`cvAwUr={{C{%V|Go9cb4`FM)da-D45h3kRbowL&Q!Tw>WpDxWR&I>SQ{uV&nv9R zCvvL9E|+!o0-!eKk|4ie2IDi#et{}m>@TH-U;SmQGU3>SGg~%p**WpdfpeGdd2F#f zbEb$ZS{A50!_&nvMB;LCf`Z(J4UeWydwgX5+;-;mCet;R&1hI;AS~kX`P6|KK3j)ys~?r9Xd42s*?t9ZWl1($S=29Cw_1 n(}StcrXA8gd*+mbDFeg9`P}NUr@kZu?PTzD^>bP0l+XkKN3nXY literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/bar/cod2.png b/eric/GUI/icons/bar/cod2.png new file mode 100644 index 0000000000000000000000000000000000000000..4c5bb9fa5e392d1fc084d9371310e563e90f88ff GIT binary patch literal 373 zcmeAS@N?(olHy`uVBq!ia0vp^azM<_!3-pir1Y-?Qj-IGLR^6~7qi&^gKaD) zG{V7`oefNkEI{t%1^IA62!oM<>HpsP|0k#YKivKQaM$IYgh*Ah|4lryJVMo0g1pSK z((Km!EQCpsZ5xm6cZyOP`x~_up*zxsS>+& zJw{W3rYn~O`2{l=pJ5L4JMin$y<;BdCZ=89Xm1&Qb?2Eg6V7beGGWUW6&2$%PhVgE z3{;-y>Eak7ae3{z<9tmFA})af6P783u4(wP>i_>zHRHmCC%t1TCheYeR^!xqp1GVc z-JVMGIm@cQY1+z!Z!olVIr+EgXNal4lp9-Y{o$It)9hz2HzllGKjX7gZTI$`P4A@} m*D7`<8#wMrWAaV^|B-38GxtA%{fiwy!QkoY=d#Wzp$PzH@qMlU literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/bar/cod3.png b/eric/GUI/icons/bar/cod3.png new file mode 100644 index 0000000000000000000000000000000000000000..e33f736734b8ff129c0a3767b872dd36f9873d98 GIT binary patch literal 379 zcmeAS@N?(olHy`uVBq!ia0vp^azM<_!3-pir1Y-?Qj-IGLR^6~7qi&^gKa}&vvFfuR!$^R=t|L?8;f4EDQM<`O&?Em3zeip_5C#Uf;%Sy9b zS6c~Q?n(IH#B-@L=1i5FwWNxgfVecb!0}v@wSnS5EliAzv8FO%hEnpp!isz%r%LQ( z<{VK0nyXwAWl`5j@jIOjt((CoH}b) ztVv>Evf9PL!y+|{D(uS9)>K_?+o+bPIBB!1 z$@>|lEx2>buZX_2aC|M%AOGRyL_DE@Eak!H7+gZ(Th6E$Pf*!%=FFA}TLgptSpzlndb&7< zNL*gqcb)H$0gvllwU_sVqcmpoSv~k)&!_73E8wIM|D5*K+43ii4xFFTqOK_@Yhg2& z;o`E{3@Yn7W49YQ8D($Y^Hy)yk@LmzUtiUT{Q8x1e^RAP`c?V6u`m8+|L~ZW8FlU6 z{FXevSxVpbRLE|r`s{j8BbD`=MJijvL5)RkC!}X6TlH4BY5wWf&n@QJzCmFARZs|d My85}Sb4q9e0D)zRp8x;= literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/bar/cod6.png b/eric/GUI/icons/bar/cod6.png new file mode 100644 index 0000000000000000000000000000000000000000..1cd8aec68fdde1b0cb83641b13e6f33bd1f94205 GIT binary patch literal 367 zcmeAS@N?(olHy`uVBq!ia0vp^azM<_!3-pir1Y-?QjGyVA+A80i&^ad!8RZRD_~>* zX;GIGVPa$fGLBErlxDa7e{$O8o&Nmr)mDPCJVKGG zW@`h*ttC~?RJqCX3abf-U+RoGo@>I&%*e*faGS5zMvo^vO-X$G;9)}Y!z1gaw{rUwZ%nv){uEp4hK-9lyg56K85!3z2(xf}Xwo$F z4BW6~!=@%NffcK=9UFFO%?O$}na%t3DeX+A##wD@EEy{rHC=fnH*8tJq0CY6+0cnW o-h7IpW7BEQAF~5i1j;io_)g?1`_9Om4s;5Gr>mdKI;Vst0I{-n8vp}Sy))OYV~TMYtN_OmIqR%B|(0{42(>y%xt_OEF65?{Kn#( zIfa+?xlZhkiWDtWg)D*d+bd}Y0L54T?~a9Fg*uc+kErNrjU-PeT}7#Q_ET^vI! zPG1c=UUbMnWJ~B>?R8)7Wj7hV`2Szq$a#b63{O4Fl>AxSZ-tkMKHcxg>d_qF>`)u; z7Gd6*C=h(yqxQ3O-=mM3r>D(s%-4!-Yv8>-u87xw-l4bv-@(T=N|Mo=Rb^MdXc=YzPhP=W^2g$ zFaiFjr{Citu$xWY*CAk-*(sCxxFw& zZ2N4Bdx_Jw-9Efx`#ist-K!6gG9;Ppv?^oZPShM1)1p@=4iKmNWh{frvLC1>@8HgNN^^SGJM#V32 zPWqf|i~s-Edct#X+6SMalZw@s_gvk#DO&5Vxdua~Ko*C_(bN{+sV}Sod3&Zb-QRHA zB4^Qx{rAu6N}tl=I&j?l+kp}XUmZh+e>Lg;SFHFBItVlz-%{5(S!Lgno@L30_OQGv z`uq9ox7OD)H>URA(ok=Z{&RcrImthUoH}zn86F?_n(zNXPrG00rijN~1F`g$85}IUS0)yI$a}XTvY;gKJ+IxW729E5_ugTwQr$<^`se)|F=`8>kpO3;r1J zdfSF&O=}%>>tDUyp(?YgCFj=4)U;gtI};1C@}|8snSTH4*Bf6|Ht)E5#fnsH{Y2UsPXQ(P#$alrRn;CB@;L6My(53J=I9JZ1HDE(FGBB)XV3^Oqu$qCP0W2cJz|hCQ5XZov!N9PVfuR$u04S5qz|g|Lu#ACW zIs=0(1H%dihUE+lix?PYF)++!U|0thnF?00l7V3!14AVkE#~3b+Szq8H0)Gi(WOO; z@2_6-h=F0#>X-K(0*$mP3GxeOU}R!tX5$s%X5r)D;pY@LR+W^IGnBon^Z9GSrUX5Q z0%4uYQ8$%~O15v3y?J}jx&eDAGf4yi?+l^@nYCE4y*qeDTEB>bL)PK?<4JI6>EK{zhw(w4UVHL>R zGevxV;`YKDSF-;8%}cu(5EjT_w{Ii68go`sC*z0b)~5qrTCgxXGRR&2rRq27$0Va! zeVpAwD^7nsfBm-jy7XhyY_k?OG30&7@3%_-aNJ^3fgWQI^Y#6y4`RdQOh0K(*p;Yr zj?*yt^Q!gFY)yiabxv|}CV$=Fv!#dOYkHIPiwzDhPV0&>IVx9Io>+N-X{B}L*~tbf z25G_{172_2u&imVnObpa|_hh};m3Xy#9`j_kbK6$L^EGYqk9T?Z{K7w_Z}qL#+-7b| TSNzUX2F19itDnm{r-UW|_Sfba literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/bar/color3.png b/eric/GUI/icons/bar/color3.png new file mode 100644 index 0000000000000000000000000000000000000000..00396f7f1711b184354e54f47fe8ffb35d5133d5 GIT binary patch literal 657 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dyEa{HEjtmUfZd~z?Faq)q2l#}z z0%`KV)MSQ<2@F$`&~>*(f-!9lJTf}c=4H~m zg00Q#V7^J-7WSu~R_u?p7Mm0*(h&asP2PkHbvwpo4(J>MeDhlU4RD z>1obhyoW`m`0wYh-&$YK+<2`i%0RtA`p@mf=Oq7JTx(%5nZa%L>-+N_#9GOjZqi&} zm7sHu!!UVrRP5QR7fa4WOcE42cIbrqugMKt!kZ$m2J{(BiuPe`^858^g8M?&knNvl zsV90QtZ9F=u*y5pm(}{WLj9|od3rLdSaf%B8f{LKPYbp%H9uX(zxI7qetOlU$UAwD z^mfhll<@0c{&bJ#?YV5nmWi$xo0%5!S!;cxr*gXGmUrQ+>*k8NynBA(pVGJbR_o*0 VZcEQI<*Wxqyr-+5%Q~loCIEpe>1zN0 literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/bar/color4.png b/eric/GUI/icons/bar/color4.png new file mode 100644 index 0000000000000000000000000000000000000000..69ab70d592ccc297552e7367e881eab2775715e4 GIT binary patch literal 657 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dyEa{HEjtmUfZd~z?Faq)q2l#}z z0%oUPK+qgY?B+}0+YmZn%+tJ2k_(%sE#Xb2>MYGiVAITRFt46(2< z>C8;|iV9(GZ#FS8`SNnv!a~KmI)&h^Ab`aUxs?^vBG)*!g0f>~En)D}6 zUV83)#)b`byZ1~wdUVaD%c^~SQQznE0}Zt*3GxeOU}R!uW#biL;pXGu5$ESLR=sN| zr}J4>Qs!&I!-PYZZ^~ZMi_%dpD%m9LkY3=oZquUqx3}-PS>K#!GuL|=0|TS6r;B5V z#p$a-$BPabh#XnjVWGFZ@#>!s`&xpFH~XwE{jqNQ z@pbAmkG@sAR={m1g+!v`CCPjU|tG5>I3|q=N@werc e{T+YfAM(9@@3xd7TT~Pn2@IaDelF{r5}E+Bujau3 literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/bar/color5.png b/eric/GUI/icons/bar/color5.png new file mode 100644 index 0000000000000000000000000000000000000000..8a3c41cf4718da233cd7f59013ab4e4b41c84778 GIT binary patch literal 657 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dyEa{HEjtmUfZd~z?Faq)q2l#}z z0%^*@I!Oam)e&A_mLfuRbFmNGDG=i#~D*?BTF^g?0b z-GvM9uUfT*f#JLSk|RK4txAIYf*BZ@See;)MYvh`IC%Iu#f?=ZW#kNH@9KR1ny@KB z&!IqA=W^6d<)V`9n`Cd^-m~t|rHAQ@=KIw*C;pwa!~fgQ(ssG z^7c#--=Da>@Wz#_zkl=6ZU%$}GT80g$gakmmDI`j;kotcfR`35%#I9lmw&1HP5Lp( zXjUI*x6q2yU(a8^Exs=O*fiU$#Z3%(AM*RH(mx!x*i@j$*u#8%f9iwSFgeptniF;< z>YU>=O#ZxT{WDvWpk$qsoSeyDH~4JnVfdQfB>iH8!;90pVoZ+8)s-h!USL{jU3qr0 zfr>$z@W+7H+cqp~TI;y9;?>&~sxqrua&E1Bl9p?KXJJ8B-n5q{)9-)%dg80f<{fvB zyzCACTvcmmyEWSR<~tJuwcb5hFLotf?ViUx+3no674dvcoBZQl-aWtYPw88It2MWo V+tL-k^OQkx>*?y}vd$@?2>=z~On!<}tn4u+vc_khY6 NJYD@<);T3K0RRw99xea? literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/bar/cshowname.png b/eric/GUI/icons/bar/cshowname.png new file mode 100644 index 0000000000000000000000000000000000000000..703b9ba2b654e7c0d923e1d64e2f4d787dfd7349 GIT binary patch literal 561 zcmeAS@N?(olHy`uVBq!ia0vp^B0$W~!3-oXyUC{mss8~!A+A8$0SO>;**JNSWI#+t zCT12^cB}AG%iuy~V`pYob`~~v1_nl;E@fjEi;!abm@0No9`m4F9sx0+O8b~fJ(no+ zz+503s1j%(5Q)lbFtM-#wEzK7vA#>Bp?f?FJC}Jt7SIY)zf4oV43IUPJP zv+dH;Uz<u33AwS^V-p1%LZH>1@lz6NO8vn|D2fY#WR1o;IsI0Ois z=b7JcAb9`%`T_+ZiR1et}w0PTZxW$Ry3h&crAc7R(fvuz54PoB-c0 zp{KG9dq1CeeopWP(4@tlE{-7*mzSP%6*?3kz;dBeP*L&VT_A{cdiF0}@n_D8B-e|x z=T*&?YnXp1;E?&J4j#)xZ*$gMu3an}Xs9hdpDng?U%y0e*Id>UEzi3D9@coydFsW6 zg$#>|O>fWZ_v}5hz@>LW`=uw_Y+k;0Jaxz_YNCTozTU5|H$Oz2Q1T5lx^#6`;eA{F zysIYcn^MlOUG&nw#8a{Je13Q9v}tmy=E(m$!~HBqRA`>;{X|gsdb;|#taD0e0s!C# B!fF5j literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/bar/cshowvalue.png b/eric/GUI/icons/bar/cshowvalue.png new file mode 100644 index 0000000000000000000000000000000000000000..47f5d83df9e47714378ad96d60957f9ea175bc3c GIT binary patch literal 208 zcmeAS@N?(olHy`uVBq!ia0vp^B0$W~!VDzEwtY$iQn~>?A+A8$foPz3Gw}>i17Asy zUob=c{Qc_%63z!Wyf^5-zn*3BZlH{dr;B3<$Mxg{1x}OIMg|Gi3PJ8=tGtV>5erC)aLbdB5joQHJjw0$~#!R|)~m OWAJqKb6Mw<&;$T+C_Qli literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/bar/csolid.png b/eric/GUI/icons/bar/csolid.png new file mode 100644 index 0000000000000000000000000000000000000000..d8689df8dcdec52918a8c53fa4b797661423cdc1 GIT binary patch literal 794 zcmeAS@N?(olHy`uVBq!ia0vp^B0$W~!3-oXyUC|BFfcX*_=LCuxwHd}KwDr4zb#;8 zj7*G7tW3=8%&a`DTtXcDqMX7qywZvS3aTQiS`ykuvU--vMs^w|PP*o9Mz(II&R(`Y z-Y((3zKQX{L0KW5g`uvsVOAZHCexyI7AI(}O;p~Up>i}!;dHM2g*@3S1=3dwq;C{S z-!74QSSkIeQtEM)36EpJ;&Z*lpZ^q2|`xh?QynMmx84C{2TzGWBstfa1ou3aRSDv4@;@sTj zXJ;)w5fGXIM(GenP-tpkXc~ka9ugfAk`Nsn<`K7RiC;lrEP zZ$Ewc^A8CA{Q33!*Y6)czJ7Z9;{KKMdw1;HzWK*^S+ac9w*6(4p5Jes}c`JU#JU!y9onDst9QU5cTeO~gx+1mG%SD*T{{Zq{8Ctj=HaY*c$ zcgp+d3ztk;|GRwd`zBNtu6w>QPin4Bf|myOkvH!{p6tqu-aBcA&}^glGmG@MY`f^~ z)0uhkVuadU$6d#!NVGle*s7u;USZqYe?wu!HO!R^>- z&t)!rO_kWY_pzAPP5Hk24Sd4IKRc?c_~OOpN0u>XH=E!4>@m+76tJGIelF{r5}E+y C$s;xZ literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/bar/csuperhidden.png b/eric/GUI/icons/bar/csuperhidden.png new file mode 100644 index 0000000000000000000000000000000000000000..bad48a550f7b942be13d23450071eaec0381ec45 GIT binary patch literal 535 zcmeAS@N?(olHy`uVBq!ia0vp^B0$W~!3-oXyUC|BFfg(P_=LCuxl{xK0s`UT;k$S5 zR#jE4uC8uuY~&`?`jTT@eW*REY^YHG2uv7(})W@cuxva$*a3K9|$($dm4Ha0CS zEgc;l-@kwF?CgB|_AMJ5TW@bKH#hgDO`GP=pa1C5qix%^&6qLc%9Sfej~-pVe0g(o z^Q>93HgDd1>eQ)EpFaKn|Np^*2SC3sSatDop=CUfB~=pS7tAoXxADm8#Pvmalg=I6 zyfMM^zSY77S2x(t(9O}(c?MLq+|$J|MB;Mlg{yo_jyw(*_1=NNrZta^{`_BVz+P93E_}Z5rK7XfSkBF# zOS5ZJoWw)(yzM_D7)%UJPu*~kp3STM$F+HO-J$sRv`0=EI3%;4$j K=d#Wzp$PzKX~ww# literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/bar/cthick.png b/eric/GUI/icons/bar/cthick.png new file mode 100644 index 0000000000000000000000000000000000000000..b0bfd1fe5341ed41c69fa374551c90693d41602e GIT binary patch literal 694 zcmeAS@N?(olHy`uVBq!ia0vp^B0$W~!3-oXyUC|BFff`1_=LCuxg!=lD_~F+-e!&ckT1P(EK}| zE{-7*my;6|xDA{bW}G~!ta5~hY0aihYs!4y%yBTx3rw^WGgAG$$ek{RO3ZwMu7gPx;JD@wj07dkmh1`soWESMG>to%(di5|)St2ZzWRQ)Qnd p`pM;`>6MkKsi_63sp+NV$uW5Fs;hjq377>+eV(paIX#byK_WwYuos6)jqS*gcQF|P=RRR6!ToU9L%)rjV#w@@qWWp$8AjiiqDWYtv zrq0TvsLCWRAuMgLWh3P+rt8cVU~U{4>ZRbO$IT(DsUdHt?QUkR;%gWfl9XogMO7~f zXxu4J7sn8Z%UjQd7BM-Bv_8Cj&oqL*hsiIHnE&HD{|7g$X zT(I9lamF!*E}O0=oPzeQEi9Qqn#uuF=6|b<-e4o%^Yr-p17?ni&p%9doi#VrZS%~z z<-L(iTsMDJRGXLEM}5`!RZ}nF#jAC!`}(WXyT0FfdoAnx>wmA^nALf$<9i$L&GcCL zy6ENJpSdq)`dy7}y}W9hgrwUG_PoLnC);x~j-I}=$)}t1AeYdw)_F0ze{$O%nUd6_ e`FC!%Ntk%KywH&>fxr$>V(@hJb6Mw<&;$V08jJM+ literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/bar/filled.png b/eric/GUI/icons/bar/filled.png new file mode 100644 index 0000000000000000000000000000000000000000..cdd41ef764243e816ce41bf25e23a1e1a06726e0 GIT binary patch literal 1007 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dyEa{HEjtmUfZd~z?Fk)a}YzXiP zaRrJ~9Wa6b6C)!tGYcCt3p+bICp$YoH;)hxpEMu8ynuihzn~JopfU`p@C&L!kf4y1 zfRGvx2?}cpiRy@o$%}{^NJy$kNUDlSnn*}nNXgpDC^*R~x+o-?7ZmMbAP~Wnlp>=&j>$;}4 z^(`G6I(jzuOxQMY>h9^Y_RpMqWcGX@IzDH?aS#7FZho_!eP%g(&vf*f;pjQT0f;;x zXu5+31WmJdp8`fx?cJu>xlID1GNq0+zzE1K3GxeuM+74a8#@Ol4S?z?C8}}VMr+DN3t4~s&WaYpA0K)G-zI^`j>D$lmU%!0*@aE-< z7q7p3{rB(R-@kwU{QmX*^OI{kmrZVOZfI!fp1u6+-k0}I&zbNRmD zJ$$sg&i?J~Tj6=hzJ>p}1Rk-juV@Jns#vLUvRUiIq!%+K5(-Oycxsx;&u258AkoQi zWO;kM&Rfa5>k>=i9mQ%7{``5-dMUqbZPLwa9{I1gvp?WI7ysY!?C*)G=TFV*nR~5I z|Cz#9x3lMt#7%jcVJ>lr(ZNY~*5)GV-4S9F_#>E;Wlp|*pH|y#I+J;ym+##!rs&|$ zn{_SLAD-|{ZR4G?tB=%{JX5eWdA~+QBi(Th^TzzLH!3&OBOWnd@N4>9#1Z$8;Z~$3 zOLIF*!7Q&r#!IG)W&eA8cRHzW7u4{)?9H4xuOD-9))hBT&#Dr!ShwoUqz4Nk_+R)h zKUWkN?xkXrrQ)$;>CXF({}!+GQguIcI_Wy^?eN}ZudVK7tu0(NB~mVKySYKb_j6ZI zvuS^IvD6Worq9bGtn?se;i8IAy(b=G?rwS8+IcLzJ?z{&#E-X?nSE1YI5yLVE!m^* l@1utdYbq>W&%d|o7we|1y#WFU8GbZ8()Nlj2>E@cM*00db{L_t(o!_8OUPZU=e zJ$G4WyG-RrsC7XXqLG*=rUYDGSkh>Xm4`0An5YQ}e}E<$^}(kSVj>!C%)S^Egv#1QcGmGDN^@i|((q zsBN&Iu&|SvnIU#`yrHQER8)#xQNsB^rFHG)(AGb=LzY{)b!!WafFono_V(>D0u4NN z>={k-07*W5`ql4m-~QPL?EO660tiuOtF1i{URYQ}Ma3=vbvD58ekk0zQU9GmI_5?^CL)hY9$2>eO>a#AdD;ea4KuQ^!P! zkR&c$dP%D_z;ow*AyB{FT>XA$c6K|h)@A~so$+#r5rFYIDi4&DWFRGF3pzXB0g#>g zwb$tN`->(fCVoRfK|09Nu)aUuo95&RS2s?enfdvT2-GB-t?ydJ%e0^w zUk(h+op-sq2sHBAwIN3OTl3uR9s)jIzWj=@HYN!awn!A3I=$Z41pLg)>tKC-m_SSM zg$pk!Ni8fY>LQ>N#*1>@09HGJ0D{ToqSN^!-R>UBa)1s;khgA)Y0+B}oir{0 z^|>kM=+P$x6aqe`raoj<)c^rS()I$I0U&ByuKpTaDW^g-mYg}W_wn4^5?rn{oIU$% zF6kN7|CX`N0~i09fN?FXLe|R>k{Q&xUJ( f`d=JQH)4MStSoB|(r5H300000NkvXXu0mjfzj#3L literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/bar/hide.png b/eric/GUI/icons/bar/hide.png new file mode 100644 index 0000000000000000000000000000000000000000..4e1b83989ec00df194b7b5f3e55d00d3992d763b GIT binary patch literal 902 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dyEa{HEjtmUfZd~z?Fk)a}YzXiP zaRrJGGvMv*ZDwX>XlSUZsmaO7+0fA7?CiX3*|L_FmfgE|fB*hHEG(?BuuwrkAvQL4 z-n@B>7cZ8OkO&VC@9*ztW@fgtvs<}xrJ9;rV`HPXwziFpO+-XQc6PR^s%mw0^??Hi zIyySIxw(aegm&)S`S$HwHa0dH8JW(`&febMZQHiZm@#Ai{P~X_J=(Ns)AHrZuUxru z^yty%=H~zZ|IeB=YxCyKr%s*v^y$-s2M>V3zF^hGt?faXK$crckY6wZBQq-#3mc~Z zzaTrGEC;u_5SOB^j=UVNl8m^5wY{0tvRf03gg0u>J*LrUny7DMtY&Fgw4TRGy+w1z z<|8rZBs@*TiWi70Y$ycAZoH?9V~EA+yOTnL4?BpsP0rc&v2EAsD}}o60`ApjMEu77?zcW=2J%g_D=7Ho}vObk5k(zbk(%H9)Ad?)Fgci8iA=Q$bS zdX5TDrmXY@62_t@_n){U_e9-d(!s59_vdNWoe(jumQL#KKE7q2e&r|4&C_(2Ury3L z&a_oMDtPsKqwwF~mj-#}Y!2GWz}5NS+q>Cko_+nbxW!^Emq*=`FCRkFQXMNM?dU17 zc)P)BzkS)hKQRw;{w>nsaQazs#o8h{#IDo$?5ST#-y9e1koX>9;kA5Cr{qz6){Oxg zcTykEO9yv3I(h>aQ0kK!GT2|ITS)0cP?HyPs9ECv+Mp6 zv%m6MXYReFd|}>-JV6Qm(%+hE-3^r9Y%4Jh{m{BdP5g9*Z4C zWo2cZot{k+1UjI1jNL|!otFYg@u9MGz$ON4x|i9 zg8YIR1ld@bm}R&a`2^H8#MN|JM0q$Q_=UAqJgyU$-F)n3IOB$c!i0O({4YaZ|F>7Svpjk1+XlaT zVc+*$^zfg0YX798tjRMv4G*rJw96qi`^1vBRf|t?GaTQ(`up_BuV-KHU&-Dj%CXQ- zKIoK*ckm?L(6jpwy?OfioI;1}c6;?n7fwVQ)NYh`^Go*T?V^rbaj{PrTFx&&5Wo6h zRfWfsyc=sc&Maf%ds?_P#ajQ_;lVr+Hq z&U@>1ueY3j)?l#o?Ey(I&B>QMm257RPhJ+Q5EFD~Wohqiml+e48G8#I7F=bx?Bd>; zmUci*s%o300M{XbDF#e3p_^Aum~E_mBjZTRR;{Zu*VtDU#HZyePCivzv=)?%JYD@< J);T3K0RUl>yrBR9 literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/bar/obtuse.png b/eric/GUI/icons/bar/obtuse.png new file mode 100644 index 0000000000000000000000000000000000000000..63e8ea86e3c0eab535bd980df123e286a57fb838 GIT binary patch literal 921 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dyEa{HEjtmUfZd~z?Fk)a}YzXiP zaRrK#3Pd;=fm-b3IF04BA$p%TXf_m1n78WWlXe@R$p6(b+gELBw&w`Um?y}=vdE9^ z*S7K>yP9)Mc;wWqEF~p=Pc%5aeZw>#Q41-~mZ|%IS{!WRAx7mI>pscl(zlHTa=Cbg zEu@*X6%Bvv>;8A7-$PCZDEMVXx{|hYoG#nT!X#@Z9u85Hy+1WRF1#|Pbd#oO(9dahRTB>F zjn{~)*wQfN=;u1I7~Npc*j~@rzJ=?rJk96b6v|m_Dm8iOxx$Wpz@Tu8>a_MQ3RBg! z^(*g~eWGpViAf&Z?dhiifNlye3GxeOU}R0<_9P0CaUk8krZC<^LgsxT;GK`zSkcGFqg23tz5dSps&89Q+OBC`J8-} zc~z5icQGxks#Z98;>6h_$Bv!RnY#ASnKNgO9XoQCBUoUD63>+9X~NtB4<003JmZ&` zn0RsXqr@~PjSEQ$DUWz3>uPncXKlLkY0ig331V_)GnnpYCAz6y+py@#mm4dj6jpSd zIMLA~BKn|J^TUd5=}A+2{LLRddX&`8lqsviD)cjJ&7`dl-D3J`oaO{9c;ArHnzygR zC2tMy^eq#18*+;%SWmim)JS)`K})y){G&6cOL9%v!&x%lrKnL$T;85tTUa^Gh4HEC zW`|#er#@#*7k@A`9$t%Ex+wO^>bP0l+XkKeFIMp literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/bar/open_left.png b/eric/GUI/icons/bar/open_left.png new file mode 100644 index 0000000000000000000000000000000000000000..3422bb91e56f6db8f5b389f6ca97fe72d796e90f GIT binary patch literal 349 zcmeAS@N?(olHy`uVBq!ia0vp^!XV7S1|*9D%+3HQwj^(N7l!{JxM1({$v_d#0*}aI z1_o}RQf^^JhFNnYfP(BLp1!W^ciC9EEV(Ro95(`mWHUn|N}Tg^b5rw5fLsO!=c3fa zlGGH1^30M91$R&1fE2w{cA)q{PZ!4!i_>qX81gkG@U-ri5|)tpcd+GXV`HPTg+)Io|gLQ-f7F_n{-%P&cDjvqM1D-QX_NEvDr4~{TX~O-_S`7?s*(> zpiXQ5yv+|5X>=@F!T#oTHk;!Ci#{ErW#8itBx?QNwrSToQy%66AGK3MLp6Pa8Be-j m+p*b`iD%L|{n!8WGtBgoc6^^6Azg3)qXY~*To5O7IvKGe8uw^FN8!y$1_|5 z3nbbSk}k5nn3sC~@7OYw&&hT@Vn2GR?si`N|z2;E(b<}vmoHbjot9Y9E hzj!?7-1?94H>4RuPwmv#tJMMd&(qb%pQu@9o^-7mNBLf2u8m>u!!5e@MI@YPhm+A(7%jK z%LI+L#=KUIf&dw8>&=n36FRtle_B(*$(ok;m&*SMqbn_ zr~7_85r5R{pQy}zzB&yC1}0`t7sn8b(^Dt^4i*ZOIlA}!-rsTe6b|<|OnT77b}M6< zz+#pu=Y4$+&Il4YsS|9FdZd1DuZ(NL?9BSV^M2nwZ~Oet#EJiZF*FD;yf##cnWlWf zi&5bF+6o;5rZvxg7}Q$-cREn8gQ2KBd;cnK#`ac*M_yHVw&H&cV;ClAh+AL%)OcLm zn1$`5X1wOFzyG!_ew=#t+O5L zNUiSH5&O)2vpip1T-tC)-(l+F(_imoEewtO+A?XDR)@$pE4~v&duDxpp}uy#c3kL$ ziiwYdZj}59Jg`6VRC~?LX}8lSYdC3Ge=G|TIP3FnyMoS%O{-ehn|;zUK7a7db3cn^ z23{}kKTtT>^YK*icjM^mt|!#2mdE)T_Pk${-5JT$!clfgFLKc{&J+D&%bM@qJ+|of zL63gPJ(ClYlmawEZ(J`of4}Y2EQjhhN>c=8Nj;ytD)5H6QTbNc`D@)1{&6x)`8&h# z)ylK{`nT=3r!B4&@1M7<>D6s<@wa6!pS{sB+Gdox`TO&>8`a-aayOQU-t>H7ced~M zWcLV9w%5J0Pxw4KJ>~RCUK8e`pf~*gBAobF+Q_~!cX;fUyxXk$0VmIvM|G~NQXaiN zxFjhsR>jZlTa)t#`Q3ldiFq7j`zX&c<)&=c5yjWf-8XhFVdQ&MBb@0Q&-?+5i9m literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/bar/plines.png b/eric/GUI/icons/bar/plines.png new file mode 100644 index 0000000000000000000000000000000000000000..009bf8efd8334cc6fda3b6ee3fb543d22e051a8a GIT binary patch literal 975 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dyEa{HEjtmUfZd~z?Fk)a}YzXiP zaRrK#4er%yA?wu;(1df(EuVO$L=M7zy}7j{t_H}qm*>FWlT}qp+=ki4JU}&)oN5BBAk*fzbkFl)2QpLz zIhVFhez?4(+=6FfStn3LmKP-cW^3!QMKh|h3whaCQVqDiPO|1_kp_xKyXFB&E+!!$ z2?SDHB3q|40vTzB9O}aCkIRKPnFK5pRL*sKFYlcv&cz3m;$RYz;blG)&*Y&D3dD`m zrl*DYUZ0$<&2ItZx+}41D~O(1Jc*f+Da_itKD9@K*S^hO>{f?Qs{?z8vT2Zh%B589 zIP;WfEuR^+GiJIeNpWa?o8xUK9rSB`_PuPjx9xh15`*>bXC43=ms=9#7tFxO%*4vV z$-&OU#w#c#Bd#vM&DWifGV@{tk?Or?)o@W1Mfu4K2rv`khx^!go*IN?99g)Ru4 z)isl8d94jh1dX09jv*GOw+0^%VhR*^vX?iX+0t9!D9e-vB?S&wog*>*j>PhXsmmOZmlU5wKb~QON+x}Y5t1nEf7CL;}mz~QEQ#~)_ zXs2-`=HB*WtJFN_9-A>~t+SEEf7_h~OTsouDE{0gpmr`l-(X&`r9@;N|BT%kRi8hK za{Hg2-2L0c_gT=rO=c?vpS}}3x9e+?;n$)iTh~fjtk|9N`C$EzxK+18t(fL8KH7BF z;X&@1&$k&2>>uS_le&ITa5tO54do5*q8>lCdgHmvfss{db#K+~yK)@IIeZ?Zy*|D4 z>)r)XH`^7C`1$NxVU|8IjX}uZrdf38Ea`~`4^*|6#9#QlXr8FVs`J~w?Bk635dVPP Yt=_c%soSB2z*NBC>FVdQ&MBb@0C+=3&Hw-a literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/bar/showname.png b/eric/GUI/icons/bar/showname.png new file mode 100644 index 0000000000000000000000000000000000000000..203b29329d7ac2a1a2c6c3a42dfc386423ceda89 GIT binary patch literal 751 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dyEa{HEjtmUfZd~z?Fk)a}lnU?( zaRrJ~0xW}aZNiI@O|Xq9fpBdiO3eJyEdsNFTp3L>WHrRFZNs7FAS+febGM5uvx_Q6 z7DQ%i*#_#nMngn^Ds94wkY$nC>K0y>K{?H{x7bFO*+!NE6}QaUdg|Wi%_r_d%=c07 zZUSluEeY}qW?*DyV&mjy;bj+>5D`%2;NxdiDY8nIPgd_1{A8&e zUa<-I~{Uw60%k^ER0lC@p(IP3e8%wbq7OA(@nf<^Gx-vpwdB0HZ

|y5A|9QLaYu(gcQ&01% zGBh7&naGpC@Yr(xD;G|Is`{-W2C+*SVx>jf!!lNh9FY-B+8B9RgzG>^fLJ;Ax|Iw; z2ajyN(U~pf#dv0Z_sPeZAHTc^n#uHH^@*Uouo*s%H)idKi_PrsPQBfs!et{gJMK+o z^rNGEDY6#TM#W`Ww{J^-7F{gQ&|$JYq^S39!Yjo$^*$1-@2%PYzO`~y@cf^GPVeUw z|NHy%>#-820Dtpa+ABW!O{)3e6sC96-133v_SqkH9e&b%=&${PjFoXezinT1SX!$g z=97+YDC>o8r@c2aZnA~WZOXKm_EbWx=~ay8WfM2SEB_zP@0Jg%WB6pIrt_-pZ6_%5 NJYD@<);T3K0RXKU+Zg}= literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/bar/showvalue.png b/eric/GUI/icons/bar/showvalue.png new file mode 100644 index 0000000000000000000000000000000000000000..d40efd43730b851c0fea6a6cec6c57dd5d08b6b7 GIT binary patch literal 1059 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dyEa{HEjtmUfZd~z?Fk)a}YzXiP zaRrJG4!}sfGk{8&7#W!vnV6ZFS(upESy(t(*|^!**x5M+xwwV+_{I77`2<81M8ze< zB*Y};)nw$AlvHJv)U{RARkRH?bPTi&%}oqV^^7g_OsveT>}=e;ZT*7n1H+4g>|#Tl zlS5q`!y=s`qMagR!lS&LqcfbNvxB4k8>8J^W71t?lH6iq-D0EMVw1Y#JU!xLJmZtR zvqiU+&I5)&7$c`SI%F)apjU7o7NsZxcG`ih(|_EeY}qhJ*kkGb->i9^wQT;YY4K0$9{S(Rak~_0chb_sa<9GB zrWJGN{QCQ6_OiAAzWn|7<=5kj2j6_S@$cWudpFOXK5*vh{g)qp{QdV&YL3eEak-aeD9M^VzozM2=Sr*(hIFI8FKHq@;2`HsK$W3`*i9wM#5{SiHR@J}R)-lo>{6 zdc3Z$J#X*!Snx(>wfe&M$LsEYcNU*s-`V}2eS+Sx<-!dCYz&Nts}C{R7SYhJh60_Oo z&HC-^;fEhC+_`^m&+fd?sV6$VUo`CsJNxkG&kHqs&)v!wwmevx@MY=M9EMe^ulxyf z*FN4RGT*rQb6fCM_7@37sZZu-@e6#2U&ZAu?0vX5I3qYQRVWr{aePUT zUoZnB6ALpd7dtN-Cl5adpSYBmB)6cbfXK#qvnSl>QOo&y?ao2pNx50FcSJ>!rzr@1 zerm8rxl%jdprP}%nt-d<^GNY&GCGoa(u>Qzbgr1{y2@C~)d_^26;X=b*XS73_oWM% z8W>l2x;TbdobH{R?$6{X&~~?I`}G$`o053SHo7LimwnT<*Zj>5QI30mO8Jiz$dzCG zx#gtI%(>s^&YU!Vzqb@!Zb3MYr}`cl9B zXE(7-bU$x3O~$DGldUwP*47MFsoS{{iC#@xkKE7~daE79xx7AkiTxGMfaoP1AJ!eX z8t2NfX=2liCGW$FJ6WW6SrwoB{rHTs!}bHB3|nM>``M{qE|*`mD$e=HO7?BVq4$Lf zP31K$N>00cKg_V_?#k8^4jCuZU&=ThENYm}G@<3iu0t=YRcf>y9;wT-&nWv4@}4oR ztk>gtWAuzWAG=HC=W-JFU&*9@p8+2bUKtR#Lirbc^O* zfwfh)vOa&jQd2r}`OUk=KLq9(>o4q7^!f1CUT51@k1I*lhUz}OcUxkAWlDW9s;@n} z&U-(5 literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/bar/thickness0.png b/eric/GUI/icons/bar/thickness0.png new file mode 100644 index 0000000000000000000000000000000000000000..e0b38a008740760de366386504df8e999652d785 GIT binary patch literal 281 zcmeAS@N?(olHy`uVBq!ia0vp^3P3Et!3-oF?)7E^sqg@w5LX~g9=Mgo@PAvu{~2a| z4%#{*ymm6e@!GQg548SY73HZY_Wbk5LZG?AB|(0{3~YkxGOSFD%v^i|>=OJ6QmW!= zl2i5orQdprnzTLik!H{Jhv$5Xq+cuHu>kdT9&kp+1&oE)>g=tQ^!bAGk?EATv YIi8VyZ}jS~xgZaEy85}Sb4q9e0QyQxRsaA1 literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/bar/thickness1.png b/eric/GUI/icons/bar/thickness1.png new file mode 100644 index 0000000000000000000000000000000000000000..83b57311dc489d7032ef2a6d6105a5a8a90c4105 GIT binary patch literal 349 zcmeAS@N?(olHy`uVBq!ia0vp^3P3Et!3-oF?)7E^spW?%f)0NS7|F%L2gxk`5t@i5H-ncW6mdYGekLr{%^_6Gg1=g6u#T$;&W_u zBG7KJk|4ie1~x$@b7n3kRz_Y?76CqGd1+lO6Uk|N7K0t?>EaloasKRulR`}fJPnCT zDw?{#wYr(Q4*j-QWKXbq+uAI?Kl|UzC8cxf9~yHpswqzRTioXmSYg~M$SB9^T>JmV zsxZ$7whpiEtzKJyw5x!h>1I#-?JsA%CFdMWj>!4EhFL{4y)|9SXm69_Dw9HA&sF_< fYMwoH|C_>mI$glxZJL|~D3Cl|{an^LB{Ts5Hl<^s literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/bar/thickness2.png b/eric/GUI/icons/bar/thickness2.png new file mode 100644 index 0000000000000000000000000000000000000000..0bfc5e1c158b1340e8c4cd438d50397018ad95be GIT binary patch literal 250 zcmeAS@N?(olHy`uVBq!ia0vp^3P3Et!3-oF?)7E^DfjxWR-Zoqu?Y^D%#V+;g%uK6K^s@5u{JPoPdJL?KIpQ~1fqdZU>gTe~DWM4f D5y(I` literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/bar/thickness3.png b/eric/GUI/icons/bar/thickness3.png new file mode 100644 index 0000000000000000000000000000000000000000..6af1b90e25cfa5f6359661a48f1b1e8c6d9deab5 GIT binary patch literal 665 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dyEa{HEjtmUzPnffIy<}iu6bbMN zaRrJa11&ABFJHbOixAKL`t|Gg@86Nt>*(k}xX#Yb@$vBx_PTZJmMvR0dGchSUC4@o z?EU-qmz9-Gn>NkD!eYXN2~tv0+S=L>H3bC)K!%2fhNhCPoVe!&dP?EFe|u8P_+GO@66 zaq#l7a*B&^3z%44xvV8CBR55!r@hZuPiKY6ECnGcNehK)|#lj7k84BHQA=p68L4HJCA z#$B4K92~~8Kr>%S_Y8N4g2sYmHNAt4j4DT#rXHQqz$Ni>Mr-PsNP~uHJsV~Sm}{u) zoLTXcb%tRBgT216xwwX2!^DFp&Ytby+_A&L(*3g5L>G2`j#=d#Wz Gp$P!>$JV0& literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/bar/type0.png b/eric/GUI/icons/bar/type0.png new file mode 100644 index 0000000000000000000000000000000000000000..23e448dde5a5a6e51669e86cc985f5b35fdcd2e6 GIT binary patch literal 543 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dyEa{HEjtmUfZd~z?Faq+Q1o(uw z0%`KVh8?G^TobI_k^&N1J;N(QQhOSDS6jNq>zaC*+J`&%X1fL#@7RA~&*96{7Vau) zSh#7|nf2RGNy=$SE9mSzaG`J3miEaT!ZRkg2ABB9HAiMnwDCv@OYhe(a84+gmQ^{Y zqHWps{TDP1T~=*6wq?&*3+LFCn~tgK*lyf;#?U%QRo5=Rc7D%{%@gNrTe|M>ij7AX ztU6HDvAm{h#jGWJ6x7X9OJ?pqbjdHaQA|o@nsAp2(38R?L4LsuY^;LJ0*p*td`hC` zx+c={yviR>aJd7ek9)c}hFF|_d+}u0AqN503nBb3-<{#qP+~f_z=ENxfs1R_#{d88 zZFc!SeX`-$_S*8m=EOhg&u26VGBLCmBqrH1ue4Y?MVpgHkm=Lqy2q~{TWh}&aFH~y zJTYH?vW0e^a`Yx6g;z=cw#oYO%O6{}o`dPfr_{+u-0z;-Dqg_CVEcPdWtGj0*v#XL z8XCX-e3CaYE0*)x_qESfuVZPs-{%*$fA6t$g;n3@{rf6)zsb|O$o6=ljrjiNh6~@A mPj6z9-=FeUKWqQa>pvNbIz^T4NfZ}=qSe#Y&t;ucLK6TwKFn(X literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/bar/type1.png b/eric/GUI/icons/bar/type1.png new file mode 100644 index 0000000000000000000000000000000000000000..5ac0c83d4c32ae734215b9caddcd28e8baf487a7 GIT binary patch literal 581 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dyEa{HEjtmUfZd~z?Faq*_2Ka=y z0%;1tE zIPD+TtfXmq;Mmngs}C+&dw9;WeGR><^(}n0jNG)0-2)Tb#bwm3ToW=Y=9t)pg`{+E z-hI~4I%v(76Ge@SnkTH?y62pZsb@*k;=Wm13hEX(`R6(XYWGLWrQg8Me{dXWR z>;Hd=O)`p&#;)=4*ROo}5~1^7DjoGkmzfJfUFSXQuHUK{&=Q~$m2$;-4Hzf79OzOUnX(T-{F z9*Z1{3uIf*=4&56{b}S!lj9QBF}uE*If`AM8JwU0gd(Is=c2!JDrDfte9)1y^h`B=;kh^s4p3KrIO?|7TE!d%H=mIfQR8qOD zx&_F#^+;W?bW>C3Ocfm)AXidO3rGry$pJ}CL)U$WFQt{v(lzs5vEis!M76B4fr(w% zw!P;k&)aTlA5qk>Ff_H-FSg0lKHNL1X4U57K=bz>yV^BvQ-0k71vOKj=z5?B6AGp! z7EarL^h##MoXE_HHC-z@r*7PJ@Z$D;=XdPCuzJghh>U*s(6YsA4^?$6cksT^(Y674O{npe0??s8B|(0{42(?7 zY%JWY9PDDeJp7#E8eDvWv$lK|Rx_1WGSm`?mk{+VYE*f=eXF7VQvUBoU!HyYlP#zJ zJAd-YE7?MlA0%W7&CFKFTk9{AefRi4nKKVCjtxCs978NlCnrd-N;FLDoH@6(b?(eg z!QD2(+Um16Z^?CE{)~~>+Zc?+%a&#g>3^rLyE@An}y8QQxQ^g-Q7$lxB zeqC`qW!jarmSsP?cNT8kxJdfoiKKaRLxZHF14QCto<7n#)0xL2Jin?hJ~wBje`I3l z+*u6!6^v&wrJ1ch^`Pt0lMQHI-{W!kC}F?oAcFapCTP6Pj-#WQ1fHCVihUMeMo5cUEO> z>HS;9J?;g#1Ra<*TUJ?PW<-m~mMN|_AyZOVmQ)xvF^Wu?bEivf6%&)tx<7kl&h*?+ zn(aCvd``D_OkZ#7OhNaegoh6vKTb$II#r<|OJe4Xg42A!Or9`d;2wS viaW%-)Xx8ZAY?~``|hKU_`1E{t$DzI#(?GW$~g(oK_TMl>gTe~DWM4f%bst0 literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/bar/type4.png b/eric/GUI/icons/bar/type4.png new file mode 100644 index 0000000000000000000000000000000000000000..984428cc538b7b103b8109beea871e3a7c3e89fc GIT binary patch literal 758 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dyEa{HEjtmUfZd~z?Fk)a}3<&TE zaRrJ~5m~Ke(*&~TuiOvR7?C+4 zI%o2tHHW++s)Ccdw2a*ByfX}~gT$m&9sP1W!pdv9R^(LA&8?nSSif-jhNG)CA1`iP zv}VhRmWk`k9HSh3v(Webl9!C|7729He5J4&?z@$L9GAL)4hLQpFjEWp!ePUy)4 z%br#&pU;@+wdiEyUtimdd0}e`eIo`IhDG!jL9^9lq?$&wuURZcXG{E-*`N kS(iqXUOod)gVu+@I>wU=<@erNoDWVEp00i_>zopr0EsK~+yDRo literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/bar/type5.png b/eric/GUI/icons/bar/type5.png new file mode 100644 index 0000000000000000000000000000000000000000..dae0b40848916676a802f4128c941545f9c807da GIT binary patch literal 929 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dyEa{HEjtmUfZd~z?Fk)a}YzXiP zaRrK#1nivsrq18iH)B038;6Rv4Lb+7yqc-7n4Gwbx|*K7fUtC4X)7le--1;KgvAw_ z``4H|MN2E{_RZX)sBWHJ+Bb3bW}tP9j7$(qr_I|erJw_30~Lr$DnkUBnOPLnOnpMq zfZVo8>o~c1Vsa+dw$0(@6;e<)>z}zkJT9-ceLhfD-@;Ex-Aq_ap}B7|l(lsZtm|6I#Ult*KYhUtNm>XKC*}iPviv7+3`Pr3o-9yWK zqZ{Td+m}&3E46ec51-#Xpt)HkL4Lsuj6e(7S-Chxc-c7k1*McPpHoWpdb)JcKU=wg z-wS_z-}dXg@na=nA(iq=vaiZ5L^WJ^1U^cfZ_)nMtX|0d%U>%}|6i|5)l=>F4)#3x zGx>k{iCtLzMnqeY=TCwOn=xMn*Hrn7an0{?k1my%1dN6-PZ!4!i_^&o5`_(d91}82 zGS$Q$TZpN-xh+#k7E4p(QSCW%r_PV@%^IDYOMY5`GC2}j5;wP`u;#K>yj>z}d#3is zjhh!l4Su$TT;WP}t5RzVovL|c)&`@6+8i6Mo?S2Cvz0-~T-Tn`gkA6|>-m*2b)^A!$UgoNKOWF91+ss4P_`WWRd2+#Uk0B7W6hOnaNq=dkCAZr@vaD^s`3=_zj6zCW~a+jd6lT};yo1gkkOa+ucD zC5F42JNuQe@|=-*#dj~uYEDdyRNu5ie`Y*9a3uG5`hk5#m`+p`48OoMK z^MCW_%}n3xFt4T40U)E*<2f({&|@mL`Yakk&ueZ)EB5F~v1`omiY3nQM)dd#4(Pob zV2Tn89-H^?`MM~llcJoEp^wKE^K@;&8qg>Eokz(GcRW>mCW=Em8GC_;`YA~?a+7F! zc;Pq&pQy$$;dOF-w>%nk-@-u?omD3<*+VkV@QQNRYEXi@ZEy6)?ylaq}T@WYG^#9U^aN+4(!!|U#kUg?*IS* literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/jswindow/comment.png b/eric/GUI/icons/jswindow/comment.png new file mode 100644 index 0000000000000000000000000000000000000000..359f4772c48375d3b0c5b171e659f4a08ae69393 GIT binary patch literal 1952 zcmV;R2VeM!P)9stQ;pgv}wlG%$spiFaRrHM<@_rOOFynW9RT&}(?ypRKM5 z4*5gj&ZEBocqm=1Ol8sCOt{l5I2tw_n_*QMC5e zgloRl+`au^Q_n-yHTQQws}2F~DnM4(Pzqf?HA8v)gv>eQL|#p^$%bH=ya1jslG$cp>FLyqP8@L6Rh>q0I<2 zwj;EC$hGCl*rCh+IQHrDqi0{vYKWM36l0;&X;>RJWB}lADo6XZg1xhuMLr@Sq zPb2%mU?K}i-1wZMcSs1uC{0bHdEfxH?b`W`M1~)jUbZV|Ad=?BSGOxqeyrW?gEa^H z>PtvkVH8Xq9uK1h1yUr{;B5)3dZUk*%m zqwT?dxo69j;lEyq|ApSluLIz7qh)ss`=rZ9C3U%onTB#vRIm3 zfyy$d(lc0$q)9j#3Peaqi9Uk`TrvU`t(a6)qp4JCnWB@$frzfC0ztyt(c=ITpiQ8S zG9c4LE_;Y;QxHqXz_R05m`ftML|kDO;?W`&=Zg^Jf;Jfy(HmH~09IU*GbUUWIgl+1 zyGT26U~vlO;OOXPI6J~IH^j3T&L7JK$t@HmE6SMB_Q=TWUkjBc8&O<`C*Y~ zWaAt{w;<94L?pmgW)M&2Gp1nqiU1bUB62Ox(hmskl_XBcWz;nQ{d*)Llz=Y?>>iYm z$q?CSzN|P7NFYe_HrZxV{Q~^nMY!BDG(|yQtDr=3NI71%Yeob;zligBODt9dkjV3? z;}`kZrygX3s*l5>I@?5sV2Fay-KMD3#A+W6&Ob1~wff00{4()_e84d!GA!N8%9Cu9 zT+&t`NPgqjtO>G7X^-q~Q04N;MKf%t7LNI-fPI&P%Vr;1uk6;2 zd_~H_^(9y<3E|Akr_E<#xx{ndf1DreA8b^ldSalW zQvhjg$70p{8Ezt=ZiJP8rf0KAW}3j{+2!2WRPvXeI{QTuM(oz$ckBmfiFbZ~&OS0Z zAAkFavBH-g-M_M<>wyqt2MC>xP+eu>5!cps?EoUClj&HC30%FnBu2)gCuWm{U+4;Z zBS7XL`1%f<-P)Er$83d5Qzdk@H?pC@E@kh--9~qNtM9(LI*%Tx^CH;MN+lvtl4hI2 z?is4@--d;etB58?pYh&j{hUz~;i#Ce@zti?>qH$gNd&v?{|kT{Cb(mGC%$*&iH6S% z^oDECor=KIyS&R&D@Hl5oYk#^_Qp$a=lYbp=dnMG;OTd#BY%8!V0qwkgPI6?S90000KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0 z?2xS?_ve_-kiKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$ z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4 z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=00004XF*Lt006O$eEU(80000WV@Og>004R=004l4008;_004mL004C` z008P>0026e000+nl3&F}0008lNklDD*->i=h`?7D-e$a&w!|q(a*IF(%HQ?(b}|51a(*_Q@eAoIy!N0_~4}V^(CLN6#@j<>)0rF zZ2u|I+y9bqD^Q$*@+{OWa4fJbta8oy@TU9m4>l(r3BnX8MJC+y%1Cn88#$F9V`*xJ z6dv)o0j7!aH6$NHmZq@gEZuiYzj-;}41f%p!Qa|CnCR`xQ5a|LZiV^5lhoFC!{Qv; zaR>*Fpoac{j%P_rEk0}Fn?`5@kl`Y$<>t**)< z^J%zo4JBc7lC@h5b_2+XtjHNH%}+5?0M{jLl}KGYi)?=y|J$>O{? z;PQDQfczCI6VuGQPz;E!Dt>ve2GG^OHZvz(z4J+J9(Y%WueR#wd31df+I~5!YajIL z*<3=8WYEK_&^smPf$YN{e85`?_8;ruc#}XnF$g6D3cNZjSuh`fAHt7y^52KN2aEz3 z%Ywf{#xGX6nT0KBP1f_E>VoNl>A{STKUC+!>4;C3kN?$R83}EjlGisG^gJ$DV=KH# q#msfZuT{7JEbu=_0m=Ug+#dk#(^X5jT|j;S0000@^n6%eUcTRAu~=Chs~%+t zI$8NeX2wvL(Jdx*m#mr~Z&)L%>(s!ga#@jAK3DlRS(*sP(*US8Q%y}xYiVhz)z#gF zZ(e&H^Ie?~MFE1Cfa_8te)#y1GKxZi$V8mF`X-Ki`36q?euT(GhzSu1BBy(Fotcw6 zL}i{(Mpbz-+a=TkdYw)OK@hOiegj`_{WDgg2x3^dko2zsV4qc|~?-+=a?d zbhvYQ4Z>mJQ9{68I(hP)ct^*t3ocjqs@>j10Wc~$RJ5N)(cR0aXnaorM4c!#KLs2$ zLE?B-1~k3&JPtL*&_9<4p2!$%gn=%yrklyI|Jbp!GZ!ynadB~vV|La`0VuAb$Ju=^ zVyLhX`Z9~+LK-{Mfewt_w2`qvaWB2~_$y~HGHN4Z0}`rC!62(hm{iuJbBU59NoZ?p zYtFBzD7&_IFNU1X@ON`_Qwji^&923{$2Aiwr~&pM&nOJys7|bX=(XK>N_17o{u9O=1|3bZ5q7KV4&OO{JHmf583jt**}VK zA$V6Kh($PU@fuk;*`uSTxd>j@ha&Zaoe!#z8RSS$`&@``dpH}vcGp&#{$gLeCQ za%_SyrvVW5Ou#qNg~04>&4sp55a&Aofce&dMjl>Yhks=aGw!g)bVlG{GVsuw^RQ0N z7{opp-B;jo6yU~~duVvc*GH`<;F7G?A{}C@PU4B6Mv>VQfuX+|fn=jb{&0F4Q9Fdc>b$f!=I5;(}ZK`P<;>#27k#l;HeI&76Ge+ zEF}>L1dzvHK-t0#Opb9gWJtGub_G856@~mx4B#5pqqVgaB_$=OtE&V3 z(xP3)b=qGs|Vcj;~PG6p$ sGk@cZZU={QL^-$n&**;z;7Zih+@Z1=$E@Al{{R>#;Yw z*(^95!pz9Pz=|sLA80-!0}HCb3`{^*F@o&IVg@#YnHcB{MlBq*aPV7*H6Q+mVstT_ z;6Jc@AhN{5Y9SLNFzK5``K7tJ(Cn5G;s}DFISGlly_#AD7uwO{GAK@_|$V5G#;WJs}4v&=7kdhB24a0QF?mu#fYd|- zGI#@;*a9FHz#>i+3&AN6=&O39poGQo1*%&JjGu)->Hx@MXwZT!0*W`%vbJb|2H^!L zoj}v-3Fw=H(0Bt|PAFB9oh`7$)-zjtW1my|3Lh||Nb+4|M8pQ=BhLX5q=JYLPkc0Z$}O>JWq^bU}QltiW!J^ zsoi?)O_YTo4U7y7tf)f&f#x$Zu%H^uzyx#^Bgk$nW{k`@9JO%NLh5Av|4@uBh7DhffX(dDR7#&ziVUQDCffrk2VxC;wk5ZbA`79GHIU#5iYoRL6C)Dz>d z(NsEW;i!e==R;^dBUC_8&q5MQ8=Qb~*!P|Q0t^6(vq5B=432UD0000U7h@0@#UBuRqpyi9EKwe0}xjT7&F z^2Ot9CR5k3y9F7`gk@PYOqiw#Cu75=yKNeJ9)^jGoxYQy|J#nO-^=i@E!Z?H!_?om zw>GQh#{7qS+gdL^6~N@oT<+74-p{^s>I8~q7Y6;4DncA5P)b43J&t3#$A}_@1Uw(F z&POz46rtj+n4TetQCKL#55))p*!@%hltCQD3X`*sFfly~%d`jrt-*`Y;=J%i;~Itm zlLs*)2vkhZjkV8d2q{r0yXE1bfu~ELQByX&V8*ryKxz{XDk&4DxNe67n`q~E_=<=b zAtQL9(7`M76>vfbVk<%zM%6vQc%x0SU|OHc=g`%*3;Fsic90)f+eBwa!GjQm;xg{d z%xgKA4Gzju`F^0k=l7}t;Gppunk#zOXLn$*uM4@l>=TPHBRpD~8el4cJ5%#89Y-@0 zP;fUOW=PgRsv64BSP9C8qrpJ<_s)jgy5P&D623fl4uAeNy6*G--hG%JzXK752#6I9 zE<`{;T>9--2f(i9jM)cR5rK7QEsMn^%+JkXp-{lpYro^~+hY)kwP67RerXAdi;ECc z0RidH@|1n4y-oq_9lICJK0oH%xP-M2mkxj#LF z% zqxS2Q7lf7}-lVjv0HA{8z$!gpxOzuZM16$&^N(@u+EotzFGO_GiH5Qfx~y_7?XdIBG#BbQ*AIyusRK$WbT?#4 z_&Y`O%z&9VwE-~nA%nDxq^4a5=Zrk2lpHP7`j$bu&wF&|?0srFTo68&}s?RRM6hFaXyVC=>M_Wgc?oY$z^2S&<|SlAae7pF39?7|_?%AqV@qvA?@B zIsg6T4+aN%ORv3jB>wTYKQ2`TuyXWARpsze0%xVi+q4(P&PSTskBrXbhSVIo&eC@ z*7A9O=PTZWM~lbUNXG~FfP6IB!TOk!nF>O8Aa_7lpv)+5gqIB|S(Iatfd*KRoY~oZ z^V?Z4SglrrKGVov-hTP?N**CTm*2lF9`xnS=Z~-DF(#c-WRH+-bcFWSz8JKU8 zUDU`DiyYA!101W)zO6Gry?Z6kh&-Yc3Ex7hhQumY@D$$4Qo;jSVNIXZqlw6}8rf9% z5mGrPY-hmcY~rxNb7QK9CV54vkx_d1G>6CbmH8BTDOhX35*|*xg$w0V8Wk2H;a$Rj zT0$x~0PtnA21jMsFZXz-a9-S01C~Ou2Wpc-R7_5IW1KkA4)3K%r=mfYc`{3(0oNYL z0blM%pdiqxC|(fYqQ!ql}6WDng1VOJFnBg9^ zQI_!Dp(&lBnN^6|4ClT@!-024jmVDAF(OwY66bBO3=eQZg+>%x$Z@15C^pUE*t#z9 z9i1ZUzS9=`p$1qnMbt54s|z$Z$0r8mycK<@(V?#2{w}m9O;AXd3QGbX)y(7cJE0;i z5AlBMA{G!U**K8rPn-%RjEU*p?pM}19p(QV@0&(eb9H!95w}gDl%57GL)wIhijD}p z%xjWJQI2v#?;Ap^q(22cse%G&&P8v{px72O4d`<&`zW<%>eGU8)U;vPh VP}13Yv>gBd002ovPDHLkV1o9wXWRe) literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/jswindow/js2.png b/eric/GUI/icons/jswindow/js2.png new file mode 100644 index 0000000000000000000000000000000000000000..a64da25c6f7abd7b67c82ef4c63886c2e052f85c GIT binary patch literal 884 zcmV-)1B?8LP)Gj7X-Gxo6BZGQxWV??Tr=W=#B3 z<;m{__Eeb#ol)tTkZ(xkJss-vP45A%O=RRUrn*Rk?!lkSNWs@JR>fs}S3`|2zu#ef z0i$AlCw`2*Y|j!#+3%R-=X9R0!&2m~OzEK)5w-3TUeJwh!B2%hvqeyT0uMjG5MeVg zdtvUnWiGME5!E`tvFhv}Z3d`!@8s#oBT7#A7E(1N(s@;$!dn?6JS8ja>63aik-4;G zE*8E6lrz%p0=nh4aInU6Bg%($^A$lOC3yHWhsU;^^T~M-Y&BpB4=3Knh4KkTg+)ks zw=kfU0EHY1_;a&0j!JP}=JC$qyl7nx7=$8EsRlxnOu6tzs5owe_ojeTv1Tsy<_tms z=N>4BewiPEf|Q<$;58{+w0LzwSj;J6tZa()PXx6;_Jo(GbcV_M`BJp$)AWHb43DaT zHG1!2fQ0t}P3auXtU}agsQVU;9J~i=L{>gWh+K(CT<&7Ppo0@CG@{5tj*^-n*%ZT( zbzS1;R7L8(v#s(>T@0{fa?~*+%L_EPoGS)l-jaTz(V?!tH4S%^8zYen3QJPnwX9?K zol=sPUA*5V2Uc=$D9>N03MGt*=-uvD);V*+{~Yg4BWt-j>@^3b^fbj%z-EG|=y2er zc00utB!i4a%ylY9ul=9Ey}!Aaan-eq>KFvCOrrQ_z-HX*ADS+WOq4p=;!>vTmc_Ta zq;_s(!=4703T`XJ%)1W?x?KuGWs%jvs3~q{a$%2{MlAIw48x zR3ub^Dx@F*st6L5DnRf7K2&_D0EtJb1X!RdQbB=;G;KnZBDt!iJV?{Vu^roS{o44o zuGe12>)F|vow+l7SU32w-nj6Q9_f6Td(XN5-<*5z%mF^J|94~l*98te`CLc1eCNf7 z#c3J!`dn=IV0ZUfW$ie(4Gji>T`1tQ%?wYC1Nx~j60D9mA92&gy{j^HkckC#U7{b7$6rv~~c5k*s zbQfKi92-cj&0lv2JyM`OT35T<=@gLB3;;m?-~?{p?tk_28^61d?+pOJq!g$B{N~Nr zP;Yy8_gTduNX=#CksmZRR09B|x7-3rcDDoqMabv|R4t2zdaQ+7Pai5p`jZei35O=N}cKH>6=?fu0YkY$mj+Ffg(tF$xqj|wJSdtZ2|o6C%$ekywJE8@CGqY-NUS+)gBxFcnWiGYsgO3Bq#zjdAO?z@jv1Sr#nY zhN9^p91p=EY%1G!OmGN$2**RwbXc|x%d%imnk)!FsS%^535GBrgn{IeA$dHl{|$iT z@w7@V8H6xk2m@-Gpwx&J1TgeWZ&ud<04zr!dt}INZ(GOFQ%xU7yyNJpCfV(6lRYw6 zE+>)Ibr^c4w;(`TRj#Uvnwwx5h>`>0NF?m_`A>cv0I$z~G8~D7Macoe=2{L_QIS@a zs|5j6RqINA7$3}PSuhL(mM8E9eej3ECyzh#!m;g$AAjbBWByS1q%Y_L%M&mRgRGWC z^27L`s%l*ui#>K^vV@Iqummm;%A()yVdRSwS~(gA#bq< zg2aOm2Gq2$yr^KLx9{zlvGK28zWm4OhXMe=m%jY`lchUrUfx+Bt#%bjU|9m&wsRmE z1L%G2uHxO40s0z$tA+$ccUoigE!!T>=EG*Ij}4PF#mb;snN0V_`TRq z&i(b*ujkX*5&!@hx^w*lmn%3)b+e2RF+x}tEXRTYzz_y3N5Jv~gyf27TQ(@Qp{6t} z%qB5DIB;!bsPCtj&j0=mfPXjrsWGJph?CzOw52 zb^x$S>;NDFkO0U4T&qy7)n_MiKQnVxBn?1W6;f88RR9`*>}mx*u}$`G^={OWLAi3{ P00000NkvXXu0mjfPAyQP literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/jswindow/run.png b/eric/GUI/icons/jswindow/run.png new file mode 100644 index 0000000000000000000000000000000000000000..6366689d00668e12efc417480ce7f60eac3118ce GIT binary patch literal 4154 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 Eg2e08zW@LL literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/.DS_Store b/eric/GUI/icons/palette/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..15a7489f432fae41daadf19b07a8684e3b925934 GIT binary patch literal 22532 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 literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/Mvalid.png b/eric/GUI/icons/palette/Mvalid.png new file mode 100644 index 0000000000000000000000000000000000000000..8543f4434c1f1dae05583697ada177d683faf20a GIT binary patch literal 765 zcmV7nEUN6qy1VK>gaWXbGmd<9g+Hk&S_$84@ zY{p`-t<}}lhm(_&FYinySHa0f4B9TbY z>-CELe>@L|!@-4xg=N~swNj}h=(@f?5Fq&e%F4>~#l^*C$8qq#n4X?a5E84^YNsUf zL*kkPfxwegD)oqJ6*`^HKM-vj4XX~rZo#n}OiWD79vmF}qUXNYZny6ylgUj{6a`M? zFijKvxnUTnR4VXY7cuo93f*jgbLZ#h*O~Qjr^m;~6;2)<^v@NM6d*V&Bmb!Y+vtF# z5sgN#FzX6XSN%Sp&xN|(F0TNO#{=88VashOH)he+Z4^FMK;?q+L8lUS1sG~Jo1mHy zzdD8BjEvTA6Z&xrqAcL{<0Z5-17BVpqJFBo3k(mDO+relBuQx77G{>>Q0`rXs;Zb< zzkphyj??`!lrvQ}6gZEA8D?Dps`DFfSvzi^lqtg(^y1F5n~20iaN1p*rB%@R4`2>v zTmkCxheDx{rn*f|%Dg*)965)}sY?i)58&|45kyB~GYwz@O=g&t=*TRxEN#FOCATGo zo`CP~k6{@WN=FrFM|BtG#`c36xI;$TE*6VlT_>`m=n*B6PAC*od|scY@w16$&H$ed zugV||lWe?`%jI_IBwqe?7ueg>7>(3bzu(`Xa{LrQ2FaajqtW=B$z--QP229n?oAyv v51A@L0(_m7k?WkLa?{mnwKkmpM}PqUY9f59jmi_~00000NkvXXu0mjfn&xQx literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/PaletteTriangleBas.png b/eric/GUI/icons/palette/PaletteTriangleBas.png new file mode 100644 index 0000000000000000000000000000000000000000..76083143e1a458d3058637ff974f34347c7766b6 GIT binary patch literal 184 zcmeAS@N?(olHy`uVBq!ia0vp@Ak4uAB#T}@sR2?f>5jgR3=G$9T=9=E0`etGTq8a>QWZRN6Vp?JQWH}u3s0un02O(8x;TbZ+)DcM|Gz!+%7)HH9tV40 z9fP(_n~WUK-`!h1UGV6#>hJFiA6;(HIp5;VG~Ys4ku`#s>8S9w9YH}szxus(9~<<< cG%zqT2>({+GnjOCE6`L1Pgg&ebxsLQ0O$)oLjV8( literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/PaletteTriangleDroite.png b/eric/GUI/icons/palette/PaletteTriangleDroite.png new file mode 100644 index 0000000000000000000000000000000000000000..960ded78766f118c582c196b45cfe62268526d3b GIT binary patch literal 189 zcmeAS@N?(olHy`uVBq!ia0vp@Ak4uAB#T}@sR2?f>5jgR3=G$9T=9=E0`etGTq8a>QWZRN6Vp?JQWH}u3s0un02TRrx;TbZ+}d;LG%te!2XnwHjSc_3 z)&xC1D-rS`LAX!9hRMUr)K^YO$yk|TruJ3O(4Qvv_~OdD5?%>t`zV&XbFO{RrBvWz gZP1jTe}z?ofsbFjonuRWJJ4tbPgg&ebxsLQ0NxHdf&c&j literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/acolor0.png b/eric/GUI/icons/palette/acolor0.png new file mode 100644 index 0000000000000000000000000000000000000000..8e9c77b30e85f33861cbf2e73e9b4d7bb660e3c5 GIT binary patch literal 520 zcmV+j0{8uiP)RLHjsIc}iJd@dG(= zOTr8K6pj?8H0;KN;*#PTI@!}DejrI@ery1^Cz(^c1LO^nNvrdfSUkK=BAiEiY#9+j zJk7gh5JSt2ya~WGG}{r=Zp$7mzOv?1c$hCF?`-idH$Ai9 z3mgYXxYee22oPJ%aVx+fcHdqfMy?&%Dru`D{^Qw${0ES40R{kT9l&xp7Z?fv0000< KMNUMnLSTa5gVD?Y literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/acolor1.png b/eric/GUI/icons/palette/acolor1.png new file mode 100644 index 0000000000000000000000000000000000000000..9a51fa49f73f4c24c8428e93d7559574027b7c63 GIT binary patch literal 520 zcmV+j0{8uiP)!gI0h%+1c>)M<`5i#tMJSk>B<$(F{G zO`b3ROvaH#QHVnrjyRBEK`e*`u^@ei$CH%O#9FfAc@z~th$0N&ia=!K$7Cazi#T$v zB1S=Y1R^PYC@yGTkuBkKs8dr&@}_4fH69c=B9PZ#cS3PR^P&q#fk?cOgp6yYYyshv zoRFOn%uDTw4j={MAiv8&K9L3>1>%;ns@x7WLUBp+oPj*;>lyt)`#42vG3PCye2YiG$sSZ-$;W?B@03o+b z$p`>9D8w<=Uf?Ao_@wRgHQ&&_3(?ioh?@XZL(>&e?KbPt;&W}i1TXW6;GHer6kpBSkCBOiu_^f46)=I?y0000< KMNUMnLSTX(%iwj-%gLfBYK)I1Ma^MfeD0D`RJ0S71X(9}rR0jP$iE27$M(V@kc+Ikrt<`cnNTfEIfPZfNQ&prZf zb?Eg0qI>n(2++sr+v&x~wjx^vH7ep>o*l@40QnMN0ME{(*zjWU`Tzg`07*qoM6N<$ Eg3N8(ng9R* literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/acolor3.png b/eric/GUI/icons/palette/acolor3.png new file mode 100644 index 0000000000000000000000000000000000000000..a339ba534337346a137d3f44aa996bc0154ea24e GIT binary patch literal 521 zcmV+k0`~ohP)Fc5{~#7PAd79a$7;TW6%i4_~fWe^Jvz*Sgt4Um8|Zd00=8R;2WCP{zdh9cS0 z^d)KJ`SQjYM`*31T^Mn+BO`zWkN^@u`VPrILI@vo2}gNoM+b3)0h0Ucs3ILvWQYWL z#8O9mg75*sDAt?D=!9fJF^AT0=a)l*H$6|Kk#Jy-Kwj-X2(Idr_COZ-5R%KXp(a7!|wcn8QEB9~U@tFU-@ouoKVH`p># zf_QQO?l5=3Nhv;{3fF&1Q{%z}=Y`c3*MVRso-KeYTwfq5C;x=z$Wz)N8aGejgaU+E zvm_Y+F0c?sn0tnY%%Q67_4VG+un-f=jiL#_G&I{0({8ICExxwqQ+Sv!B=2nTJ~utH z;7c6GNVw9bw+#?m&2cNhHg?}$A4a|%St)6&BjMvYfcyuLZvh4X4*9j`C6nlM00000 LNkvXXu0mjfGXK{i literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/acolor4.png b/eric/GUI/icons/palette/acolor4.png new file mode 100644 index 0000000000000000000000000000000000000000..1a57097195af25a11a01e375a502b2aa4582bdaa GIT binary patch literal 523 zcmV+m0`&cfP)JNRCwC# zmfuaoFc8M;#7PAd9zY0oU|IKlw&)nrnV4k=PZ zj67ncBR)a+fM68s%XoZ7vZPo*E4cH^A;FuTr_x9`a6llh_8$avK{9UxG9Us^Bw*u8 zD;q$#Bu5k{1oQ0P&<12cBGh-$#~V@yWI(vKsi|#WgMiLSW(*{)wWZ5{uoF)fz%8yXk(85vLNnwkY!Ho`XK+FR zLTp%)6ad#)h(pXh$3tdN)%5y$Z)jMEvE@cy2VfeS?TBf&Wrr4DS@S78%omckws@bL zo>}k(jw2*oYt!2Wh^^+h5nva)Z>J9<-;S)6w9%39@f<+@1IV`k0|1~mzowgNkzoJ; N002ovPDHLkV1k8J*9QOq literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/acolor5.png b/eric/GUI/icons/palette/acolor5.png new file mode 100644 index 0000000000000000000000000000000000000000..e181846ffeb3856346cc7d7b4b61a7e332fbc018 GIT binary patch literal 514 zcmV+d0{#7oP)Fc5|9#7V{P0)*fKoPsN`;{==laT|`n0k{NfuE7RE+@>@!GvXOpCP{zdh9cS0 z^rdNJe||F=R~lo)E{sI%$cP{jB!Wbcp+oV9lrqFz(o-JB(@`8@fb>a-nsh>uBT}p* zmpT#>gf9q2vtA2vO0uAsLmRmB%OS~!UZB({IIu?`ukH^7bWSqs1F|3zJCd+*sg)fd zoRR~IV}g0{ALs+JAPMq2AL9*a1F|5T+uY`MtU*9$BvS@b&fAm!LHjsDdTQlY{76pR zi0^{lha;8p9=IgApg5s8+|VW7kfJm{v;f?ZeDw7ZuG|{M!*!D3d$z%mkrBkB2XK$M zONxTx4XSbfCp8UjSlZI*it9kI6VDF7E$%O{C@=mFEwE1If*3qJg%cVOa?O-7!Z&`^k}<3`yAU>ln2h;6s^fEM34^J#466N~q@_>hO5E%*x82^L)G z(Ax%xtMm3Jpg%^T9a(A7PDkRO=Lqs2K)wVR0MQbp)D4=ub^rhX07*qoM6N<$ Ef{9<;m}%Az2$Bjy zq=Lv~z?hl4@liy@3ueP5OY1Fi^G<2;^7Napv@737gJ)Gw!r#{&~IQ-Q4Kkih2!v8Oz#mY8W z$YlV?#StZ8%)s?ys5M=%Yb$$jd=PDymX@w-rStbrPCt3*@N-vOpN=-_l>&|xwY5EK zzz8DxaKs3-odBFx8JuQGjt`&}loOJX@BGKpv(FCiKX`GaWQ~+-F0`tPa*YgtqDA`J z%w6F65%F+pqveB(06eEk)ch>xoygC8dHMN~#}1sYG`%6S>48~Z1*^84*P_q$rG!Dm zz(e|NL=pNH#DNFBXg~Mu{E^2G9Q-b%e5j7VS4u5tmTw_@>v;`)UpmlHDbA&F5S;C_ z&E!i9GnW>|9vL3_EQ(p7ZHKT{v7oZP3|4&=BEL;Cn9F8BKck5J%aLyR?l_;FyE=}} zKaVIY*lq;nnhlF|Wivp?Ry`ynmsUwRV0<%oed?ioLsLOWJ3Ge2 z9dj3>Z<=f1TPDPz3#xF_>vsmQ<&Z+>Ib!Td@AK)Ig;SjD9&gz`L|8LzCxjA4zh1S$ zv#JoGb0OG$odw(Y5+L*(l8NK9lMS1VTV5L|<5;v5B>nZ42bR@>D6oOk=)Mo5Z3Ur4 z(n-$Or$0D-WbB=1b`2C?k%ASY$-5s!vgpuxjB9wey6KYv!zlctwg`Z4d6_6L{T!Y- zacttnu@4)Cf#O??#R@3LynDENDD=~9Wl1p*A$BL*aYMBQq>g1tNi=`%?Gxq2AK&%b z)mT=1=(d1H2!PQv1NYRD?bIF#9RQm9%lsE->ubMFVA1)q>LmjV^RMX#x#ylR33|gD z@AfzW;G@~Mu3xxRUA}RQ#=c48009KZLY(+7W(AlDAjGP6{0IWi!HRaEvlq8tTph0x zgtPkl_t#3de|VYE@HS^`Ck5@zKojM(Qg^_v-|YyBI?cLuH(Z@^flLS1!_DPiuN>t( zzP5>(Y|ayX1E}LkRx?f1@)hu%I`pWCgozFaw^b^w|GDrQs@O#(Ls?ihgx^sy|3H|FzEw? z0-vzRrSE)33YgaYh8loaqf+#!3#Q#km+{OL=zE-NJzO$Q`)JAay5K1Q&<_BfLQhg3 p6{62Cqn=+;`5tonuU~%)FaSV!quA<5Y}x<-002ovPDHLkV1h0MYYG4W literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/allforward.png b/eric/GUI/icons/palette/allforward.png new file mode 100644 index 0000000000000000000000000000000000000000..b5f149ca3e16152ed2fb831ab3f12baff7cf8923 GIT binary patch literal 1262 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 literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/angle3.gif b/eric/GUI/icons/palette/angle3.gif new file mode 100644 index 0000000000000000000000000000000000000000..5afca782dc2860dd3ad9f0de60fc91633f900496 GIT binary patch literal 546 zcmV+-0^R*bNk%w1VIlw`0K@sxF z`O|6`@7Ke!)Uw#m%bZOd@$l@hjdEBoCGhR&k9m(b7%hWSP~M0|F%d*_d~f#m`279- z`S|wl@b9p)tA08nA^8LV00000EC2ui03rY)000I5pdgN9X`X1Ru59bRBv){-+Id;# z6^l`$9fWWQ;B0=SjRz5EGy(_@@{~b1oruilI6ZEv*G86m+M3Vk?XvldD$?+{nUEL` z3-XO(&+q#a3laf20SgNW9B+P$jC%6#t{z@*aQdP z4BF8K02Kk>=;_}E4;BOJ2k+_H4;L2^=<@pU1{N0I`vwRcIKY7g2@ftMh)0m1K?w~b zwsJtB0tF8iK3p=ukl=&?7Ai=bK$7HviWw%KK!EVDo&g3ON=`6Xfq+bsDISa>t-{61PetIBp`R{ zSSk+~B-DaMNdcw13N{hgnt%a=M-lAe%}c9MqosZSc4f55FeA2V$yvZaL676h3LtRh kiU30Z%%CSIjbH$Rf&(2ugWizHvIf<#W6PdRn^6b=JJ#pvOaK4? literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/angle3D.png b/eric/GUI/icons/palette/angle3D.png new file mode 100644 index 0000000000000000000000000000000000000000..fbf7ba92a4f7f8bf6e3d2500c89dcfe91dc50ee2 GIT binary patch literal 1704 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 literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/avancer2.png b/eric/GUI/icons/palette/avancer2.png new file mode 100644 index 0000000000000000000000000000000000000000..572347f2171b8447c17c41dac5d917eb9f93d423 GIT binary patch literal 739 zcmV<90v!E`P)aA*Rt1Y6?`h_Cs!K)&O2R#X1#GCj21%d~$_M$g0dJ#cU=}8d$DAG%zpi~eGrC>jH zliirijL*Pp4STSg-9#^a;m2lYnB>VbZ{By9*4p}8Ozj?P9^#-E41ogp0p`F8SijlX z`43hrA*^&^gG*on^Z*GQFb%GQPe~E21Wzg840vEJG}HH$t#0D?DgGV=cfj71_e&*U z3%FohV-~v=lxsH@`@T)qOSSV{@_QIR1y1KFU?&*kiqF)G{$szqy3LNo0a#(?UVs>k z0G5}45Uj!Sq6nRmQ}+fmR~IqX4R%mI`FT3<9XtbrOtW#=KFT9;gei6zV^=`{-lk2$ zv|qt1IPhLX;#$x0)}OK}7jS(Jrem1h#{8SK4s0lZ>BN?5HY-JRC3fQpJGPJ7QdFc+ zVeB^UVs;!vnF|ODjXz=(x5DmV$uC!*I}OL@_ztBlUFk&c;6iM*5gQ6v>0N4eWCU-2 zOgeH^T2jHEE(ke+sTnYzc@lDICn>;%VGMf^!hnr!F>k&P47B4w+Dh05Mk(XhGlPEj zgHoOX%ytce3KgAX)WIQgA~yl%!6&I8HAhUv$n*p+F9CZ%KXpKl)*Aa=>JtIEuqzJ% zMR1t<{~DMDHP8jVfR9uIhA0_%)&lye+f9K<@RA-_AOR1F&(sksS(aj#4kAy$Yp@K4 zY5ey+7KyLmI60G<07XZx>85qbrsGj^8V43=O=bdO+V55)$g>b-9-9K%6`&G{#?qbx zvk!RC)5A{002ovPDHLkV1hb*K0E*b literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/avancer3.png b/eric/GUI/icons/palette/avancer3.png new file mode 100644 index 0000000000000000000000000000000000000000..027c938c21c39dca23dbfaeda33ef57290a74fcd GIT binary patch literal 974 zcmV;<12O!GP)6KJ7Hn`9Fw{IW@QHuInV_szGnR0u)JwFg7nNriR>B*7Cfxn_r#lVrWdNbPMK zI1GB~_>Y;{{`CeZai1RMhGAg3JI*-QaRHR}M#Dgg(YDL~G?1r&h?LZBPOn;}30 z10bpfrz#9vYIUJn0llD2T~}Ja(ur2EALxw~Ap4#Gwi>k5gmOX(+tEk?GRC`rxnlOE zR#0I%sKod#Kn^+xf@RKoN`TCda3cg5;FyXruOLE(r@tB(*arJ_s>&xnTS^dBq0m)L zVCp!yMu^I`jbyE~y-ywGpl_9cPF0FOf$z%xUX>5BQ2nmpR#gtj>^=p?x#o?4dxD8y zf(j0FFv}SqF$CzVrmJ7B1|VgT<=cs~A(d5k!rY{t{PASE0B@!CXu-W!JtPxR=jCC_C7(m6qmz{htPEhq1YOoOjB-FBamd1l(Vz%X1mM>)HZm~JijQU{RP7=xFRaX>A@5eza7 zB1kr?XcY2pDEA)UKjK^hbRcy2%6-2Vcq_{C>Pjc5EI={Uhc}`W%ZwgX$BUFxc~f%X zkYl(;z{&&$;gl>wDOG@ct%Rj}{uuZSYx_crk#;2CglBj;(=pFOL=WPh!TI48PWdW; zsGZLRaMf_F(|W;d!Jv7})j~k#@%t6xaJ** zd9607{t1v}cU4iuD;rCXXQE5*I1{M#A{bhXKDIN#r>Frn?TRZ3$i|je|A5q5PAtl$ zX;493xztb(XeOR6Emwa9EVaz7;fh9Jy}ZuCXUnzodOnz|`N?RV5NKt!ff*?RPGo8M we!eGRsXYf@R2}(I&$A(|^myKk_D_HT01Xs7Xz^_}Pyhe`07*qoM6N<$f?t)iiU0rr literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/avancer4.png b/eric/GUI/icons/palette/avancer4.png new file mode 100644 index 0000000000000000000000000000000000000000..d691fbb3366752ed292d17d5ad2fbf3bdcee1d2a GIT binary patch literal 1067 zcmV+`1l0S9P)sCeU&K>xq|4B{nRml9Fec&$mQ}7$uHJ=x0b(B=F}Kv z^eXx;L;`b{3obdE1nDWP7v zVjh4ZU1HuV@JNONJn|2Nhm0^?W$LHxg;sySQ_w?LIOn@aMl@~8-X4`0gY_bzQs;Bx&bv9ao zKBQY{F&5trX{rz}m;5e9Q)qS+4XdZ#v!K2$2)3aMMW`FNkTnjM!4}9J-2L@z!F*1` zufQFVmT>_uLJ!55oYT;wURY)y!0EjRy&r-N@t=PnUO_N^MuR@qa0QwxDS|+AQ+B*J zZJQ*YnrL?wFT?d#CjZkBP>6VA<%Bun>QV*PlyQk{i*+NMP;>h0rfD zR_Z5s;kBeK@V&YY%iTwtfz`8?!ZW%{J-+{Iz*g{wj7r!fZaf(*je6je$CAYnK9DP? z7wc}!fb|RT^Ey~t>w#2H7Hs2p%^Bcj!BUvE87c$SB2S-42f!XUr^K9x*4l^#{c8jkZ$u zYHO)!_Ri371>Up``U>zsSAl6Z#@ybzEcJP}2W zkzzbqgIu&NUZ5KZ(N_Liu-kUa{?6{q?#%dp({J=+m|1pG!$+tT@JKwYK`@GNl zu4LObp5~JAl-K_RRPO~zlAO)w-v3lAuJ%-)&m<0+Lu!D4`+qBA}$E7LDD> z4V?{=u=(K(H4gWE-6eU;kW!$~79N|N)2>{fhizHVbpr*hhOTu{jHTw$y{;9r=@R0x z5Eio)Bzt1mzBPs;Z|~Vm-_AMJZik(V<#{M`)O z+6ir}vUn<_C$i#$uO=~imHlAnSLQ z>E**0{RN_^*#GXQKaC8(x0BwMISluCHOp`+$Ecb3@z+^)siheLPRT4SrSa0B1WhZW zqE}EgYUBkL8Iz5kAt2H21h2{?QRQI7Ynhx4nbHsmDfsO+yNnP&+^q()9s$QrPaS=& zoAwT#Kev?J2(d#eg4@|*3Ey2X(7!o?kSZfva>`%vSbALzhzH~eOI%%n%QXCgSa3D2jyMO;KcvIy&1-jIY&9_{#3}uq@MQ(H+sS(@Fa_wZUV> z_G(1H(Zk*s`?_e4vrhQ&>4~d}juvd`lksJ};e-taBA#Hn4)Yew{G*SJ2_Jqk${x6j zz~+OEye}x?xqcJTN;M$!hle>LJi-$9in1`OS&y5Dnx3+S9J~Ht2;OfBw!LZ^uszdp zRWLAnEkx+;Cz6lo?A7uCtn{Ch8Z<7i)%sh20RY^@z^n$_>G1#n002ovPDHLkV1l5H BCG-FQ literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/background.png b/eric/GUI/icons/palette/background.png new file mode 100644 index 0000000000000000000000000000000000000000..b9df666fb47895038f27d4eb27d0090dc0ec2b12 GIT binary patch literal 2432 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 literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/bi_3Darete.png b/eric/GUI/icons/palette/bi_3Darete.png new file mode 100644 index 0000000000000000000000000000000000000000..f6bd85cc3bf0992d80c714de263443a8f000bcbc GIT binary patch literal 585 zcmV-P0=E5$P)q$gGRCwBA{Qv(y!$1Nih5-hn4q(A1 zXdhi+2Bb29*a?Vl0P*yLOFK3YYbYuD8PO9VRP#wJYLkJ6%p=lrqV;170g%fX0({&V zbTrf$9zA`|uxR-jnD{&*0)Qm_*wO$f*ua_v1o#>Bv^8MjCX9@X41_Q~{lq51n;-(@ zau9g-{3T5M36V*FB>mW;U^)=HLW2zsKEHdhjTqZsKe};1R89j!Kh#{pAplG$>w#1v z5TAkyJ^1|g`SkNU7Wx6%HU#Xqxqf70?)&HW+mQ7GaXHZ3HllI?iX zSmOH&J)6b%Y<>fi2jU|zO@xYi781$~kfEWfQbM5oEQ};B2gGhp`tl$5U3}<+Y&k7T z!Xp{phTx#pw{l|eh)iQJcku&DgxPC7C)ILNLjVj!__?$}w4}TW0~Ze;7=r*O8;b_L z>H=^!d;j_cnDg=ND^jy5@gaaM0WB)^1838ddp2QYGjiG%B!@s;_a;y_P5S%q|2gDr z1{7~2Cj=PDZ4m*pC_j*T2-Ghy+906>kQD`>I{)9_Kl#6Zeve@1;@v}PgM}goP}*Rj zxFDiJgN0%Tpfor@7+-^fW+fp74Hk++0BeH&I^8>Qg3y9cI1&oJ&1RWf@VyA5q}pJ!U*(G5VIO--PycbF$!v$yFXoxd9MV@* zTT7{Z214Gh2loER;&44k(=@Ns8{||X*=lpR2X2pEdnw1HufaMN2Css%0;!CQDWj;- zXd6scTc;qDu;9eaAC~yyylUM&L8u66{ef-YYHaU*rn`50_KB~3ouo9R>GGuurt|Oq z)1qY)IqOCttk+Onu_UB7@`dOslbeaAnUQp^5CnM!p{POrx5EKiOg4K{DjxkSGMqyO z--Cc+fZ6JB4QMEheBkI|FHYw?*<6Ai7_7x2cbr)GcG}wHch$P}227`=%9fWz3CnUE z7g=Y&1EB?{MAG>{BIQv)$~(Pr0QEbp7qu=4i)mb^xE9a>$MhBQ58ymkNXoLDMuNhoWTYf4 z0)qFkhL-lHFJpL4bey1l!_}whJtK2(DlHcmkqSp8eLpCwK6}e z1Rh^3iLuG>>P3nq-Ax{QcWaI7!40;+#?skgbciw%Wfo8*QT`P~i9?D?)%>M;WQW<< z>$6%O3g-n$XQaKkOlB=KGkFZYWsy7y$gRF}bLItLm$biU+gBbR=z2cE=pD5V%dR%JtzC~xg-DvYvI)J)9^CwD>SkMw>rkW19^m+r97?3$ zQ`VGOP$-pHh0FC$t3O-h^P#o%v#N-_J8$5a9-?|i;|Si7fW(az3+hCWM~}?MgIjZPmw576=9-ptSMnSINtjcJI7;YvS1!DJa= zeYnA8YqT2mt>Y{4)2Ql6D#~hf2IG!_ef$66^wmBVjxPOegJDOK*?dq%Q)!F%As{FV zfLeE}&()X8v8%y&@*M&R@RBUAof^G;EK}gPo(A9Gq3vxyLjh^1bT=@p+q(Kr7>u-; zBydeQk-0DvS^bNOInsT)q_UnhCLaV{7`UNMITV55QG|uqM)u;{!_y}KX6)gv=BEz! zwf!94+fZ+(@i#U<O7P~9-j=7I+|&Dtjw0&_ovyp7v-by3fUu>x=~tk`c@M$P2Icp{hiI`VnQ->VQ+KYqh0mhA(Kvr@g)IMYW-p&eIv4-8A&qvIY1`Kiy}|q zgvO}Tx;<99Yn#tC)aG>!S!unNf%fgK8&k)|7Gtkg(lvgczTVK>)%Q|kYv(th#xvLd zbLMjrUs{4xI=G|B|0HmE$Z4j%5TKYstCApMJPbjW1OmfJC>S{8d`t;imglixGNHkxwibLLLcV7*EEfrs_{zXmQS-=nlz>%#Q- zbLd`IM7}0f5v~LoO%enRjiny{klL~!ii*24@IQl;5vqHH^l_I{ElNI>U{bf$vPyX+ z(h1e2L*BHvxT&&!qT6w$;~`ZQZ7aTi+ztD_N$P(B3;=bjIwd(g-zNY7002ovPDHLk FV1ka`iQNDI literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/bi_3Dcircle2.png b/eric/GUI/icons/palette/bi_3Dcircle2.png new file mode 100644 index 0000000000000000000000000000000000000000..9464714f3d2a9b336ab8e52bc958c8f30bb3d43c GIT binary patch literal 2222 zcmV;f2vPTmP)?VbzX_F>22L;-KMEOx6Q3T45(jN!}ln5kLwMD43mZA#!qk^<0N+G0> zCQXfx*iIbZj_vh28+)_&&Ym-~!~1P#&0w0kKdg-OYIo+FnfLkL<9Xg8vClsUFbYhP z&z1i-<)AiLCkc|Y>W$_uNsJWZL3zHkoXW{qpYd`vpLfip7=HW&a=3spLFC5V-7o(*WRKV4cAU!U4Z#027Aa z3>XhqkfR~VRt8qy6uMU2sA%yoSg0(Roi!LcaEu_iWbB`4K}Ay{Z>Q4%r* zJ`&|Jfz^0wW-b)Dyby|h1c3bV`$R>=J~sm8Fe2v|t7aOu`zpR(@3Nl^TD7(5j16m~ z?_xHb!t$aR%JD+HC`kf|d)c>Kp1Ubw}JViN5P9wZq^ ziJ8?@dd!Ah+dR$#4IX3$;Y_~J*8P<;MNujaUAb_uCLm0Bg=` z9hQ^N^tAm!t70_gN2XqVcWC_iR4zXzKY)y*7{+dOR2)*N*&PFdQV%gL8H>WJ2?KUE7J=< zf$M2S;fNYm=c{Yp`9q3kJdG_anwr`zxokFT(3`E@4wttd07Y_X4lCqyWgsOdydXw( zDpg&xucCD+93NXrr23R?SnBhKo9kY1n+>)LV>5s1oAtjW=cpXo(&6-0J*Lv?yax^+ zS#4}-tz~sOdoU1K>HXa+CYq+dW}vJ;GnmZS$kj_&KAR~6D81)yikn9lOsvMYo{Djs zo^5Zfc0Ce^#8*DNIrmFNrIwuIIF8Yb3Nu)2l?H=>@7&WJqbMo@*F(*%J2AJ{%R@o< zBnUi22dIktKT20Kv=${B!q2TIB7BR}+O1QoiAxjn?*W_5DcB2MNMp6zwquN1i)plM zJe5q~u}CD_(9}GI?pe7LEW)`8?n~V9&tuWh9W2YGlp92*udA@_0aC)2qlr;P*OUN| zc0F4IJdXwAsq1pS*AA$B4Ac-~RB24$3m43G=aIL2-yk0S>M@>%9=~wzeKO5)xPNBi z@3$A`K8sVR8oT9SgWIty5RNb0{uBUJ_Vek4vnC%>8TDG;ivSGev!b#FGg_=85cXe( zLaX0Hc}KScsAOn)@lA0455>+(A_k_`Fm&Ug2e-XQlLYqh^y2GcQ3@%U5CIUv$@DxZ z9_FzacTL_7y`@mQ(v9)RT`c~|CCut{VK$fdtSIn987|cZ{ci-&RzVQ-NG-uqa{7>S z204Fncgw3=oR-?FGyZ>FUkbjh(1rijfmNs7`_mKqg%^(OjT$xT9)w(;e25Jc)7IAg z<%KOen!bgX0hX#nBu zpAB4k|HkxhNQTug8dU{EOoF^oZQPw zm0XJoa?9s(MLZk!w|bn%kG40T?%3kpmlt^PgVE`i&yP->vbn3DXztwoio@+Y>8Y)I z769O>c=RgrjVpAYq)F0yV8_;MEatNbKur+;RfePQV(53;FVsX1&Ss5MoHg wmRf_M+hnyr4!WYfFCVz;{?p2@@Baue0ErLnJMHRpPXGV_07*qoM6N<$f_YXxp#T5? literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/bi_3Dcircle3pts.png b/eric/GUI/icons/palette/bi_3Dcircle3pts.png new file mode 100644 index 0000000000000000000000000000000000000000..be6dad0e43ae808935fab6146d4c4f18b332cda5 GIT binary patch literal 2230 zcmV;n2ub&eP)Do2co2#hBkFV;{!uNNc0v9nx5N z*`%)3(k^ZKvZN+WnmTC`$8YDii_iDwd*iwET#hu^Isw{AfBEiw&-4HNf6xE<{r?Ya z7zXrNUho$0kPZLomi^xWn2u3kI566J7J#*YslXIqhHaejzXY)E9L2D%p5D~6bVu+p z^I7D%rEKQTSy>YAf@j$RVP{6OJsbZG0NixGWA7J!LU#m4Y1%8}1OZhmWrx^o7H;2| zcv%*OS&I?XX1e9ru)wq#GCmCe^OuPB_I)?Leb%{_s+S;-#zCAZoy4eSucTy1Li9lhLbaS^qS4aB(kjo@r*GYS)rDi6mvn|Yz3zeT z4tk`^OAn0nMvo39B1aE%{F%v2_K#OHD{lz0QlMyWit^A=RZ;l0T4h>O)vV>Ooy-pa z;5dqO#c5?9By!}HiyvrTf9g!0rhL^8FJ6#~D+Q9TG$vNc_1D3-bt@7lu#TXI>f6yB zI=&|!IrX`KH+f>H|9i<$VC*utc8zq!BQT0OU<5X_mb{#qnSP~Ft6Z{zZ#`IhV2%T+ z*v}5^=>5T6NL5Obe>D`2vJR(1FXnTEC^U1k*RTAP=Ni-2K*Iu$wi!ebq2`RCNHMZTG~Wqv#3A3TGLXV#iiGll955{-Q^9QOL2 ze&HFiZ`XF;$lgOD0wetV+^k>MGzl!nWP6+$g%R<2c86#xuv}pm@8-*|K~R|~t!5Ai zhIK>NIa@NRo9rar(g*WD496X!Dxl?HWS{B}B;#y7gQ1x0Ajz;LbPuxM z@VUtdfngBXTIN2_0c(JWO29b-?nMiL-FcgO*qRJ(GomW33W_08aV6J;MJnSD^z#^| zVz=in^eSqL5_!J%@Gda!zkuO&Kz8llN=&rTRO}1@317=(e`C#K0)Um4T&$G}<4zZK z>eW|%D-Ms2E)*)al9|Z~7eUCON@;a!qYl9JrpPF&1_j(y3WO3c?o-;@1OVd1v7pOI z1cPpBZ^TdUzPXtDlcwuUE2+%y)#bahuVFYrsjb$R=jY}S$k6i$Cw6R%+(sE9>8dO=7uQq!->eVfY#&^Q=hBz;_Y^l z+CiwgE}D)�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 Eg5-#ZKmY&$ literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/bi_3Ddode.png b/eric/GUI/icons/palette/bi_3Ddode.png new file mode 100644 index 0000000000000000000000000000000000000000..19d948b89a76bf939a8bd0bb5ef50194cc5b6e50 GIT binary patch literal 2817 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 TAz=w%00000NkvXXu0mjfk{nrR literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/bi_3Disoc.png b/eric/GUI/icons/palette/bi_3Disoc.png new file mode 100644 index 0000000000000000000000000000000000000000..f0660d4484d29c90b517ba6c171bd66b429bad07 GIT binary patch literal 2831 zcmV+q3-I)bP)y>Lhx? z3=aT_0~)*eB7;h`5Pg=9ezF+P*G5>FQS5U)g5fv+Gx=Q+4=L60801&u5LQtb$i;bH zE8!Tx;kZ@EaalA)2_-5GX&|`usa{{~_XfaW7?_YNl@x$m3COP?Aj~E(AeAyzJze6(61)9v_>2iOPEWxW+O z2n0(7JhypRp&ZL|yWadx04}T4%B-X`SHSBEaI-U_!phZ~3ZmmklB8Rg)1-iB8vrF}rt(V2s<_luEXR9$jC#Z8 zmpTj+7dw|2XU%!JV%aT)8Tp5m8eNJ|B#~Srsl6eNuj5f#B`;e6Se)36QcQt3@I1sY z`?y^3*`fd-;ylh%bV#Yyo#c5wO%f9i7@T-s0=YyI11gLn#|a#JY^vuZ==}5Z089+F z(X>EL3k4St8BdZVUMwjnZK$lj69_3feo(HwGYGNGB+uoI$`yNW3V`OhM;Vf87R!`Z zapRSV6QdW`Dgk>eOw*G-oZRh+z|TpJ+h(Bgx%2auW9Mha>paeD(faP*x70F;>C&mr zuHn&fP*T1!u6pfeRs{JcD+FS5m==|bd2T)8L)y1;U_nq2t6gec^2?g2*xH^mt+XKE z-ZSck&v^X7VwHrf?HX}aiwUromI@k{{kqEz!|x}Bk+zB9fn zXFojPgZQETG3WkaQ()Zg3hVqF0E|dclU-0+_kP!8(no!k%%iZm~$fP8p`(i?Ey!Wk7l;%(U9P z%syPE<)swNNLFI^E5zg)636nQ6qGM$Gvp;g@Nh_~aHr*#1YCA&$y6kmqz#2m-3Y;u zLfL>~Bwk>xK`gfFG78UbY`E**m)vgv&}RY=;0A?CEg|RFsu}a_WuY>*u&93X9-N|+ z*r4x%zPIgVlhxL47m0z(;r~P|AaWB_^!6wrRw@n!mB-tUcO#ODDTv1v00IDC2xEAgUM|0g6Vz~WR$-HcWpd-R>XG97>?D6EQYsb;3A<%P%i-c{xm9-@ zDzB)@&dx{$y%z@SaFWcMIQ#CCOeFj|4?%-3#2uZw78+TaDEdH3VNw<&&ZF`+tBOf< z#HD6c+Yq@a0=UTkkS_`qlo&*aXr71TE3yk$N9mH{T^`TeU8{ZsmQ^lWyYaytAN9Gy z{R%0WfXkK$Qqr=rw`{xv$mJ4{mYfJ?W@ch>fs7I3;dHMT3@at%BZaYo7yS@>ohIp& zoO$Qtx$Cw7-O3Hc1Dz-CHD8-8FgEHuf5L<$oQ=Z6^v`1}C?(XpH^4`5jqa4Z`iim=icm0Y(1jG3EYqr$z-YFDS;Od=pvN((OHjp$ zApF&-310>B1rwwUoe{&Kvf=LfV8B0qvgP1%5DugPl0J6>07nuR9i#m}ZLt{J6Rp#K zPv`ing3_vgK#~?o1XRug+wQK}xvQ~3{JA(S>w?y#XNKR=k2hWgyjt};WMB;F^!Bew@xmn1 zf(MWm>`n7}Qw9|(or+}-kZ${_Ww{EgSMPt==3>rSY>sZHpX1!Vkg;NkOfQp4MOW-h zBPk*sAmoxV3`<5wX_A!+`B;oLDz>fVm_Foj`WE~p(gAe{U@!bnQ#vMB9HV%yEQjF} ztDblnSU9%&(}S=75(ItA%>md?5cs$=$e9!rxJw}-JO|Fr*W9;dQ|8u z_KQWk;vh~uD`6tLrzbAk@`}opLXm9Gpjs_O#$9EgArFvhN^wB(n~E@shc0 zWrZBsbR+gkH8&#>IVi*9;#dUW+ z?Qz(urbjNQ=B>tjq6Rc8e;f`1;vA?Jbqi7wkQC|Sdz&q zwNI+jGRA5BJkLaUw3(g7@G;aub)$_wM!w(peVWrn^@c@G2a5#)!pm-FCOV9zz~}S* hU%TTUa{OC>0RT~7II$Dz|JMKj002ovPDHLkV1g##RMr3h literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/bi_3Docta.png b/eric/GUI/icons/palette/bi_3Docta.png new file mode 100644 index 0000000000000000000000000000000000000000..17c8e138d75129e2fe35fbec15be546f4bf801b5 GIT binary patch literal 2033 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 M07*qoM6N<$f$_@Q za4jGpBFaPLAtE4z5C!tOxk+ySn}r!4;A6(=_RgG{d(OG{{IBo-zyI)9mWBWKhj?nv zd!2`qFCm-~2t^rkr7E8wNe$zp@8g>P=?_H`Dfk)YwJSg>)RAvZOwTHsnmsdL6|Gt9 zqiNaDBS-P$O6U_!5UGiU{@(7_>w6xL7oD6oy?Jxt0rqCUm;LWN=*o~TeotdJ?f7vfwwmaON705fEWq9my-!LxWVzAAMDOrJ3ea`NWS{&w!%6)96Q zzpn^aP7MV7I`oRL??JbZp}lU2JS-=9O2+5bw2YO}y0}G%9rJ+0UX15C;Z+blUMX2f zv!GzY<1(ZQS=RD`wZ=D>E)&r-4b-s39Pr$3H#~aifX?=IM@?mU%eC?{UFOUj?UJ|O z0b6eme75aVD7$!egZ)A0Cu4=+8TZKegzycc>X%E+k%f`Yj@sths^q<&Zuz;RzaN5u z0C-R+HyBhvC=`MwRtM8(&Q>j6xjJ2;QfpJwrh+O$4HJ?rkdQPEgc7NBtPpU*#UhDp zwoIYQBPlYLq3H)qkac%C>Enhlv9i-iH;^3aoqfGArj+anlTsoX#`k!rAQ%jWyupoI z*Q?=vM>`}Uc3PY6K*`1P(B4$P*W(pI!3$BoSOcz&JZW)LzmsYQN6vpz2$w} zvvb;UwQ{j3>U5lh%)T9EIJ;rz`Nd)hAAEk_GZt}*G&R)0!99hc(D?m+=0SVw(Yv?n z)^ghjPDQ})AHa8KXwIQ^d`eo;(p3fW!t{jQi{Zq@FcStB$#SRCNuCcrt3C-@S!Q$f^`QUkB9cSJVS1$$C*j{ zHue4cAN1KHe}-xA6+rxq_aG3U!5{RG)D9pC5@K|E&UgJ$8f^^i^)AvUnSVbwf1x2Q zBNP5pQmnmr^4N~sHI?%zzmLA-u=P}(Id(L|{l*+9y<8lMOV+F$%9u2cA_zjlMG6m& z!LxzSqu_3t5Wf8AFL2>k@57|G>cP7DL#z`@42k<|V38y|wA;aCnPfgvQhA`X#4LGjZ`|Js2my4w?r&GM_odO~*ArUPLa4`%4 zivu0w^MTjr1x0K+#Lim)jJ*Zw4u1hX*Diq4A_rCElu$?rk^oyz4@jg^o>r#=pO1#> z^72r4qcvK%UR42ArB{Z!@3n0S6(R&hufz7>DCX&5gE2v~Z0$Phh&xAn0zn3(LOH}` zqmeS^R=h4MIu=&0Qy;Ve=N~ym}21a%RAUUu=M(E&*6l zQ=z`L#=n2()>9?_I<*IX;ftg)oyX;D^tzm7IH!4|q@{7=pSE9GvZ^57qynghHD21EuubGfLn(N9<%c+8&n+j{UP}=e?GuN*Tp#)`yAPm_YEy$Sr>euxy)3B&ac~rH~vU z1uc4IEIJmbqc!WN=g!-N`A?cGR+u|~0mK^Oz=Z-XoH%}e|E{fjn(J#1;+#7JQfD;6sl$hW4FtiMnApE>$Cjd-6=i?J&sv93P0}8B$Ns*pHHc{z z9A;VedhZZRq6d-M&(QwhV+;y_o*7*MnL?Rswx%dnta%s2LIH>+64>_9CR<%)>2hF$ zBMs@uX#!1L!p0zv2xSdsQ24lslXu>^S-lwhh7L|vb?+b;!bD)i;eRT#MpYo-XB>k= z17Nq=uykrdW!2~P^q_Fgg-@Uo+pRckyH+iEdo_PXZZ33o+~@uAcfXz1b+;u4yXVhB z6pb=ZH1|Q6hzh;GNCDoU!+x^y#`UFJKiQnALTYWOz2WKW>e!BZgQND&1VM>JqEKA9 z?uY{_u08>9&T@z6*?YrSASAg<2zIseNQ$p^4L&NvxK<2X|8zm2bP40POv#@0E=RTP zt*ub;RdGY(^{aVUL+%atGh>(Y=d80Yu{P`io-$IaUn7w#GO(TN?Cb8>?xVf+BY68? q-XmZ6-pKo=Z^y(pef9pY00RJgjFv~&3`sZu0000pe*T literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/bi_3Dproj.png b/eric/GUI/icons/palette/bi_3Dproj.png new file mode 100644 index 0000000000000000000000000000000000000000..65bf617d2809add50f7e267ac2ea226dc73f91bb GIT binary patch literal 414 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dyk|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5XR04cLT&Jzv@$voZ;}@=Py>u(Dtw$|5?A*46_Z~mLa%|_a z+K3A`@Bjb*zbw)+5U8G~B*-rq$b|t0q5J2~0mXlKx;TbZ+&U6`v*?Hd&t!eR_y7Or z=ibP3W`3DGcP5Wy%fuAc_4Zt^)g5_D*d}D!m9QKLVK^+fKrP7iD~Cb0O46?aR+j}8 z3YM?@Hr1`>p1Et{&cN+VX0O5=Rw>6{S2%xt(;-N|=$ zuC9-N@yEjkTJPVh{;WCU%IB2)v^h0*sY%yS1M|hr-xUrmZQ7bvVvsz|j@z7X{hqYi zMa`BSrfJt-B#3Xmu4;AT=$q?0?+mMdeErAzLG=K`KIzjMxa&c!uN!~UOx zLjQ0af6(_vzo4a_@znQ`6M1}PSYdJ5ONuPd0VTCCC1o_=J{1zF&C#a?#EcUJ0~-^X zqM(fhkRgyn>K!#U6e)sNcdDxTXGNBjj2j~t+yen*Bne{6a^w`xnzx{&V(!CUchMB9 zZIYcKNfM98V{)jgGttu65UQ^`?Qd&txD4yN%I8)dHrwoT8ooSJEF=uYb zv!MD1KV1CSs;6BpPZ34aw5(|=8d}%6?*+4#-}kC<+S@(M}Wo~S$L^$uL7DUytpRm>oN_wgsy?y1GgVL6jRcR~Zu zv-LaAzp& z_AE1YrKt^*jV2y*?;Y0=m6L(@Lf^)c*&ur96Uw z!DzM9EIZxn^O*ovDWlTS3j9V#(XCNuh*3Q+p{uW_Vw3 zZ=pHMRtC?9(A-ECFgjg!(KMfpB1rjesh6f+wDHI9@1DHxgZCzjf8H)t?9x_B*_Qc8ogTa8(QM`qoBo~Oyjf6ERvw=@XD)X?%2B+)I;x|+ zozv-by>}qMMWeCY{QRy27vlqieph}$0j)O~HDDIRHyBA!8i7*~RIC=b<~Kl8>m^wt zAXxCbAcX{%6@}>Q4PpH^Zw`2iOL_#6?@yyVVn8(9AMOrb=NBzoezUu?BhnQN=73x5 zmaHrtGy+qJ`{jshzMR9sINO4`o_}bzDbU3agyE90TkL3i^L2K|9soqapZUr zi)*9=3UgwRA`pH*YNkAK^d%B)qH`%tp@tQN6*NZ52wVdDLhufuB2nk=D8P zhVy3C^hz>M;!ybEWGb+vY&4r?P^Q3lR5y@uIM_v?RMhDW^uLZD?cifv@D3NC(b{zN z;>qJjmsYJ_lLe=j(UO?JvBD5%$nzCwP+u`emRYly45}Ui!{sgti)x&Lbto?}4cHlC zW>_f*IhsolefNbz#NR&sQyubn+5lo4yM^|=_1jaoZry@JpfN>LaI3*4*b6;_{+1ve zj>hmnM~L9~q^6(li%7CSK}wNO@emIXs;uB(7oLd+bUHoz$)5MyI|JA1QccMn2B1kf z(0Jvw;mhcmQBeSaZuRGY$;{OLs^W!fk6Sd`N0?Jc%&Egd+?VDbHwY0!f zNJDQ3En-r;+jR~x9%K=jNFZN2aFu2TCvr_X3p+5AFW~1;N~t{I#bo}{7316DN}a)Yt~22OeS6cDt*JYL#bR^#X3m>mQ8D{#Znzm` z*&GfX35w$}P6~B*aV?Ek`!3d&31PyZo>vFeB$Zx&Bg|Zfpr}%O^<@a z$6ZFr)J4MxmRdjn3fbMJn1@r|rj9b*#Hkl}*()73f%tpaKM? zWo)#ij5Z`~u1;bT$4MN=x5V-F_V- z?UwHC5=Jbpsj6*wZ0D0tp{Ayqe{r9vqNcX)*jG2T1qIakRY~$&5MK11%jI}J3lYcV z@(LJ+5s9UMR4ykN{A?sVbs|Rt&z(M5xVXAj^6eeldHaN0)Z2OG9>-9Bxr8_nPp6Vm zpWCf2&}c+H_as)fv>4Xk*JdC^*Ee=e!oeV>y*|Vu33z*6Lt@AZQ8o+pDl>|j9)_ww z2~)))==4PbPzd}Iu!}?t!r?G3p8qGV^z@1BG%qw080B+ZKun_|$v7Jxb&Rga zD=HG*zvUrFq*7#Q@oXl81j}NuuLomx2V@F4CQkeYtknwhwg+Ka*$Bt!voJll9@1PP zuG$7MM&;rqu-k^xhyL`^cvt&n%b3lwCzDFqKCu~@V%;;pe&P7n zcYN0*kx2485QL3I(cj$#olcMXrWI)4w-Y%!l-9j}fl8_aLo|8kx$UT2y9V_S`~++= z47+s*K93vb<~yL(6+uR(nezF#rylv{GXq_nM`_s*J;}V@8vw{o-E1`K(CH1=l+#0| zLEpz8!BoBoEo<*a$NnFIBjp=@egtxf0;z12{xcBEWymH|$fPrQ+c%n5p>}yAdTDMl zkpLTsV($+h+ega(O5NTY$_0_kVr$%L>FuRsUnkg&C;Qt524E;D#fqji=zjfKgeF|r zy#EZbjt7_Hgi|A&IV6H16qt?w*RPo;M%)Y_ z!Nwe8qjrCiY%j21E>)xF{O`a{Pod@U=b<-h!3W*}qh?T4q=!bMgSWjCOYd3>y`dBa zqY-806)+SV1y4vaVkWFqsT6l_+T29T8$J^N$&7t)z>!X*kRm%uWl~ICYDd$S2cTBy z;f>hv;eo#)JAMHYMu}nfY0Nk$P}cSXq%&;Z<`kmfb~-Zz#NV*eELA9!HN_>RD`iSm z&`~UIrQNH_@}v|q zVz|f0vkH~crz_H@vgr)3DJWB_O8Q;c>fij701=mX^h5Wmypgqa4K+W|kY=MoaJgjJ|iQGI1` zk~kpg>1+>D4d7fT0M_Xk>AkCM)1A%$?JPTmDs3}jiXb{(+=cMC6C3uu2DMC!P&fd} zq9avHtNRNy+LTl(<%kP8I({J#F%-}kzsIAvcVXvx!<@smf zZD_#w2kj_YQiY8#yg@FhB_6~u?ejUS>*{(7bww#*9!cKr9LMDsQmWMAvnP&+Z2jFA z<}H)vYIIMG+meYWxAM_nBCJq@r*zu7>-+f1PY;s^sE|yta13Ad7MGNKTv(_}35>t4 z{1Z_Z6o|U6w95`3_~R+cD5EGY zlsTEu%uL8N=5V>jMyy;WZKL_=&wDSpNyv>VYnoQS+F)+pkjZAyu)HyO`t`%RN34S{ z&#?jK^C(=9(BaWk5eghV76rBP_KT4;1Saw&~m zB9+~iJKUTch=qd3KX~`w-=bK)IzlDd$YB2~*-U!qcHRx=;z7AetJ_3bEEJE1g-FKE hRnz_7-;Vz)zyO*92W`j7SOfq7002ovPDHLkV1hPFAxZ!M literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/bi_3Dspherepoint.png b/eric/GUI/icons/palette/bi_3Dspherepoint.png new file mode 100644 index 0000000000000000000000000000000000000000..5be3038a287878688abc5c740500b0abb2a80984 GIT binary patch literal 2233 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 IM6N<$f~eU1vj6}9 literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/bi_3Dspheresphere.png b/eric/GUI/icons/palette/bi_3Dspheresphere.png new file mode 100644 index 0000000000000000000000000000000000000000..5613e71f4cdeca48130df36eb3e09267bdaa85ac GIT binary patch literal 1991 zcmV;&2RQhNP)wn^tcGB~W{quFukE#$_0G)B?A)jSS)0}o3Pe$&JTxO6?d&;c|MQ*i|NhIO zAP9)h@*#=O`1u?F`UGsWgr(TJc(SIMWjWDtY*JH{MP>0?+O@6ous-vt0H8w5*4wxC z-nac5ef1kQ^^_AeH5x@xUP)D$!nM3GJvAks9eSG>eErq4*~#%E@RQMx3m^hRfZ@O> z5F{ydeqqax_dU9QQ}110Pm7UA&U0Pg^E@)}eFDc+8*~43I1t1nnBzLagwE6bcU2El-9H(s4^e?`D&QM3sv^;X)p;+&O2VXYKQV0&F zZ@3lupIMS5UB_{RfBm)pONS0VHZY&P`YV_&e<%Q!5AWRlork}B@7{-;*0%O6!*V*< zbCtYGzxKPI?B;TFYvG1^e9IkguGw*5fDvf8Y;aR10Z;%y{L?4?(R=Wx2Tm1ovrqlk zl`A*KQ+3~e?CED8-1nnLN91@s~+P=Vn%7cJj>Dj>dCO-fGl-&38L(lEm*|&S3Z0J6m zO(RsX;9s4Xl8o%B9?5m1>%X>tLXz68>_C4i++9srT9_m$R0I}Cpqd80DbNJz`97*p zgOCrm4+s+TKm-lV&3bxlbX#U3eFBcPujhf(w|}^Q?~Yx4Lxx_e{18+XfI*}b7em+P z^YvlFOoUT4s^fUbD!UXHmn~v+LavgNZECT&(f9oZu(Jvecwgn(cB5G~R%xnI2kWw~ zYMcYWs^s|WH}BgchFJcq_~43w>YLl{xqt7zMO{m{u|#IQ)Jt3`TlUaU^m7CgdA(lo8G;EGCZL5Qr7?g!XD2SSZFmgVcEk_BuO zx;AuAw{~`I8+&i~ZUn>uGfzJs75tXZWj^pY=@U*nA!E8ww zK%#X`XNnhu2pk$>7{;$)uUHCvvs`8=iWE@bQ@$AXEUScUw@h*|(F-8<8I}R2=&)s) z;>{{+#T*EOVc8&AQ_IvhH78&?NfU^S)-|l+SeC^U-B24m-=kTMrF_>T95LZvKK|=i zti8#y01N=Y8V!Io8eGGElne?tBUqMkuQG)43tkU^&!$aBw5B~sX@C^781ZDEDKLj9XV8(Fmz+!mbDNg4sMxNDaIz%cn z3j)m9JTID-V?aI%nG_EArL2gq*96~j2}ou>gtP@L>L5Y|A|`U>a$1EgISjxXJbm)5 ziS(r%E$!{^gCPUvAQO2A03lHPLS|xyWhJqJDCv%zsGjv)pEL`L5k``9!_cj{nXD#B z(FK)I{3Rh)B#gz3{bbX?4$t#e2y_Nc_AXx<>lhn3I}Gb)MReEZX8K=z?l&|d$SBTS zIIAIwM1Yj2u1T4kz|L6=s~fX9ks@gXUJCTt9GB`?U4-z{A#z4yvU~+1DJz7-(_t}^ zjY!fAMAZTeMTkU9a3jV=LWX6|ym~^;&t^}q?1+lT{`C82UjF0r-F!G4!gc++2tizA zePjK?g1}`KCa*|tV3N9}gp7PXY&NYk77MvtGF3YVK7g$h0Rt_I8QaD#!DSj%Y>}ih zdVXZ>@xQ$EHmqIvKrMjOn;9B-y~yz4yVq^pR0hgaf2qF1jalD!s?_nH$05mh#4Rc!0CS;Hsek&(pCv}#9ee_&v>U1+}+eY?K5@A09kq@2Tr z7t?%$t)(8ogR)9r7&+JZ{Gq3$(|0iea~X@y^~ycHVn`)rO5d zGx20H4;rw*m=`P+Aqt1`^p&YP5M1K;D@XpFolHLqE7?!7D;9vI-p1C|TiZIino#ZiB3(+~gv002ovPDHLkV1fiUzZd`j literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/bi_3Dsymc.png b/eric/GUI/icons/palette/bi_3Dsymc.png new file mode 100644 index 0000000000000000000000000000000000000000..1a2209cf7bac9a5631641b010875cfcfe9e2be86 GIT binary patch literal 372 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 literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/bi_3Dtrans.png b/eric/GUI/icons/palette/bi_3Dtrans.png new file mode 100644 index 0000000000000000000000000000000000000000..b6bf28a704eadf3c40c9153c835820d814d48ef3 GIT binary patch literal 930 zcmV;T16}-yP)lO2P;juu$p;+1O* zyY?M|$u-bA4S<6kWVyJQ2pGd0f)pi#I}uXkfWLo!Z-fQ=%U5r}7{o?OjI>LHjEsy1 z?A(0o&HXbKC`p7&WLgeNV0(Xl{nQAu2#7)SH5SHy@41k7f7!I;>$ps0@U{fBTuHK2|*nvIcwIeza%F@ zq=Ka$r$=?dPA_SyOgAg{HUv zG%JWemb0-iKjCHm6UV{ymkShqz}!;D&B6M(J<(APWEYUnNXP-J$thSs2D36Vfum2; z*owg=BoT~3Y!DFU<4lK!Hije6qhJ;&(Sd>-TA`rJ;VT@#(I>5_&cG)q3>8#oxPJB+ z0}C@_Fp$#@iUlD4hcg7Ag$KM~VP*RFgPrN`93l!9M*L+B*dBHuW=2SLq9Ef#+A;F0w@o@q%sAw*D_xXp@zKaia-+uZ&>DQmX z_rCxB`|QE%ud8Nnzu>;_!hiwPQ~Y)A=? z0qXOgK>Q1c|A0aPxj@3{0DKM3lN+W#`uXis5K!+~gi&Coem)s_!gXRQ?CL;UCn(KS-(lKP=u!EsAkAIGI`5{BX1_U;yOPzfk-SCOG68 zrDW9$BscHKNrWV|`N$0c^m+k`8>wkI#eG9+0Du4k0G93y5qFyz0000007*qoM6N<$ Ef-LWx!TVDSg#hY^JsoSML<1_e#y zrelma*t)q<`nB$(9jUpNHEWB zfdDP<5CoyP=+pg=l%vNB2)o3gFA?m|esp@|zY-wui!d7j(Re^=nMvmWD9nOQ*TML@e4F3XYwvww>ui z%Qyr+i_mQm5M;;3i;RoJp&Eg}rGB@nyUn3mZUigtF_SA8^V%I1g(mm-;l`7_u90I~ z4h^_uMEF}Jfa5{X6s5~>oZ^BM$@mVo^DiyZ5;au@zOH^rSHnYAs(LBQzEM-6t^f5^ z_HaY9_Z(W9&I(h01Uz3KZ1lK?DDP-UkR5w2g#fqkbh6bQhHi`tqu~3ilYqVQC%JvY z=h%Iorx|E0g5((T_EV4dbM#0^ zgnu9BTnHbhIm!tkzq`IXvz8&~y>G2A^dIP$8j>03XCr{6C)Kp}xe4dR2knl)@K8M1 zynW*u)}+^NLx}<-u~b{T(|_!{E>}QyC?TGwI^Gxiu~?&lMhz_2tF>E94EYQIQ%zYf zCCrtEWa|g7)fqKp%P*%+T0V15H1~#LN5l;&(c^>|*Nn^?QX+uBU^LxZxzB3UzU&Fd zz1?H6=UWD^T}0z?aWAi=fZ#pP(f9iXT$Z1GiJ?%8`&MRrT09^rGcH#^B7x_)&XM#t zg^X!iiX)a2fV&Tk^+|J*3Q8fMB9Y9x!OI>Hh;qM;PbdB2ri5rbu3#L7V5)6pM9YHv|A*htUx3RYF(2MOeNtZ@i0mHam#)P4J=ui@Q~zF1+Zunt}YlnNH; z0I5<}GJ3-+RkaP>Yc@YwnuqZlBnX1sfq!7*i_1y`NJJ=#eq1pPHM*ibxmX*@DzQiJ z%xOJ7@YMUSomwUKwv)FUjhsO#c{OM2sElu00000NkvXXu0mjfseU=n literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/bi_biss.png b/eric/GUI/icons/palette/bi_biss.png new file mode 100644 index 0000000000000000000000000000000000000000..a2800480d0afc38255c56e198eeeb7db772a1fee GIT binary patch literal 1333 zcmV-51uKL=+Vie9-z2 z2zk(#KKYQQSX&XXv1lL(L1UV3O}6dk!)>$O>})ohotZl`o;%zr*U8Kzn+Cjan0xQs zx%ZskIlptyaF%7E|FengfaAEG?7=Zlr*Bbl`pC~veiw`&hYIFLXk7ac4P6*OO)w6T zIYy!FA;4~$d^6d^3;ZCU^0IA#X?<5Nm50usKEKFVXB&}zTjkE`F9_c>MbkuLK#LwQ~DX0 z+5=*MsN3!zB~D4z*&#uf6fD+vaxwEHp5-7Y0_FOi1@Z#{r z1?nO@S$QEqV8oZlFJA}w68c|LpOZ$cED|dRI$NGCs&c(%m~(LW6$-i9nrJ-@SmBPMGh4k@$ zxp6>IB_X?xMl)+lk#0uT>R7`g#Pj4yB8^5r%rU zRm<0xzm0Xp-V0!mKMg$?vFX<9jvjuxq{{c1mbo;(lA2`Fu8qLd=+uI`p+4fnparU^ z!vb#ve6p6UfMG;VteXNV;o|q$#7>N;Oaih37^FCEbdVLRx%b;5hZ-xo+zU~z&6m<= znK*HR%CU^23{t7j5nZ!E*@XiU@Tv=7`73G(i}}Cw>9s{8m(wyg8R#`;Q$Ge7bPc9` zv?&w1TwvD)k}NIIbc!&>$j}X>RSYyU@#oRyYs)uiVp^lt8LkqIca>?TI~4~az}5wA z?QIAshEg*rG;wJH#UG9*L4i}u#ba*4psH)a|I`K1d!i_MZxkgSN|20(_SNn?N)Iqt zNc|c?+Dn2ExKkGpFA;MDK|pZBAt={ah%J}pRkc6_oVs8>HHQkfS5YBfK7{At=4qPNw{k(X3T&q?xaCSNyQ%E raG_&XL&2T6z`ZfP8@~Ise+3u-rn-#Ls`74?00000NkvXXu0mjfG+J`Z literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/bi_circ.png b/eric/GUI/icons/palette/bi_circ.png new file mode 100644 index 0000000000000000000000000000000000000000..8cdc0be205baec5bbb0619d662def275e453e713 GIT binary patch literal 1611 zcmV-R2DJH!P)nr*m&+$q37`^bt?;WoGBjopa7N=gv1vK?uRKG#Wf(WBsFyIkHFydsec;)ZTqb}%~f~wfCwFD1~#=*O-`1YnSjw zA1j(W2PVqboN(2m$36rJK?$b_>5j^MX|&}2*wK74|I>>@O=g=?(P3BW!Q&^C!nPN# z&s$O!BMK$zV$F^2s_K>}DmyI-q&s*x>V@M!q4N%vP?#hxTM&7>G*bM3(NoOs?asz%rrO}1pATWtRj=9ROx@$Uz z!7m<}Ly6ZJsNR)kviXx3|E-S^U}yW|Ito$w;z+=(4HaUdQ9FNOz?P0gwA zQ_hZgg-(v*Qw5eSL}L;7%a|(284MJc6{lS2AKUhwT>#^&3lcNe7ni1IrN?3iZj3-d z$(U9J_a*#Hn|J)?U1Gr(dNW-?H^t<)GDAKl$H>03U==m0GU2GJmX zl>KsceNI76G|p5a_Hw#G{7ee4GU(U;rRbA@qR`85_Omm<@!WQ`&3h#eY~H?EgW6Zk zwAA$O9L|FU;qP(KxBXl!a7%15&YU6Z;Hd!6IiRUqdS*I^iI35s_Elq8W>Xl>X9U4V z#!4Qj1Cu^#s>VnL!WJVG91PPrD0pXoGEjvHC1j>x^tfvnj6(e&c1q%D2A~2@t8J&H z6O7tNHK={nWLZ8FwsTdkDe4PVG`)~o*iOX*DX%Qmn30m zLdADFK>L$Hy9Twdn&fq#SJx&Jm@dZ@{ze6a$czOmilcbL-WWbMCpE)l6`~@l#yq2^ zPS#Z34RR(>l}CPD>Qcb2pIUD34wibq#k{Jkwe}%CRW%lZ-3MrVTImqP6#ddd9V31a z#l@{jO-Ti&4C8%6y!a<4uuTdrwFx=_Cd4JKWEm#kG46V`rLH~mdb=4YsfHedDUGKY z#_e-Es|S1TRP@}ce~6Fi01H7cBmow997Lpndv1xqh-Dn5+YrgdnxfbQuF*Gt`p!+YbO|X_kj^#U#~}Yp7%q~IiKRPVP_sJQUM*2XWIf&BN)8r>UQYWR%8-0 zX^P3G0G*9mbmyau5Xw*newzYi3j}hT41L$VilYlVkO-9wD5p$bNJ3u8aKZ675M2;C zg+b(es*tfmH*V*3B?CkTkdRwH4u~TJg(BudVxEt1>?diTPXOc}44IHwF33%HdY}^F zSec&reEu0J(-voN5TODf+mIp_t{TE=6wgq#X>-ERCwC# zmt9O-Wf;fbbNa=)4_0kEIur#rhsz>C#br^Oph683$(-9v#9e4IFO1&p!V5{fP~(ls z67P)BETZ0s5;IA_Fr5o-7KcOV_$X|x8^b~A3hil2dwP7H`W*7|?zE{%lU?XZe(Cvm z`#%5YeLmiEBu&%U?L1_5n~(nmn2SA>;4r$c35iqcI71soV`xGh6F(=AL-fgMtW5Ai zR2r`p6H;gebi*yc!*u;A5CO7eILC#t33!^uT?7VcoXQC)EeAM{(D*692|N#c4%h$- ziIX_7eZYN0FVG5DX`EarM0%XoLB{dVAJSyiKpT0n3)l*5pw*K}&~Cs1Y@-!;mxOPk zxg^n!j$CAA8i7&rVw~{Z<0^a3K`)qNFmExchuEGGSt)$={~mFUwJe zk|2T!l_7Jvfb*OH+JR0WrdI%$TKqg~&k6~^hd%-bfR8B$@Hk78)B?`}UjrfFBcKC# ziNd9qtJdf{x_y(w{fZ=;4nokSoSN-fiT?G;#ewdtSRuFc0T8Mu;r+l*z@I=3@CEQb zunN2myg@>mfgT`CV;Lo4*8`7tI9)aM6Gk2`geU4Ro$U>o3wV#}XQ&5YjV}X#P)*~r z2H+&E;23a3NKEV(vZLzWSMj3tNiS>Iv-=-qV*%Dbc!pKF?>+{X?-UAwN=tnM=oc~` z1$gn#biG84hfhu%W3pJS2XO!z-{yAaC%|(QV7AyWWFMG~`ZsmCEZxc(WP6QJ1#8vR z>3ej`n}?cx?v3V-w+7R7*AhjO++;4aiEtuRL4fY1-iYM3eGl4?ceb@uRoV|*l98tp zGeeeN0s)p%8Z_o=l5pAi5a5wcEcY93MqJwz%a88^Xx!R&qRZ#rVn4u=v1gWN$2SMZ zM%WOz9EhaOEh^blX-D07-M)?#KXCp!4(Wcc>oLzATMtQTr9FCi`p)SKel~I=#-^k3(Z%Fy-_3O9yI4BAK=~nU z-`VJ?-u1|fHv48D&X-EW2Ii(my62`YV3Mz_3DAvKY^(?yDQ@=cIq9+4TO*-xRnYHe zmzI{;mDtT-B$et*WHP<6)$~=$7nKWLj)chEwvP8Qs0AajE(g$a{B3%oiS4N0k-rz5 z2r~cAes*T)*Q4{JVK$dsx*kg_y=gV`{qm|ZB^VXaw_?fQT_KNI2!DRr(YV9uVEQ=< zNVw#c;f2e`m8^1()Mo_48Nqvg1;qAl*ouqpS|+P03dVn@PME~y6Fe1{T`T34Y~60C zs_HlTvPT!AdGH*Mcr1PzeiR@fkR(u87Hq0OPAl<)gHJ-)+wQG(Rl9;l1BXu!`$ChU zNz7allKD5DmLdQ{VAPx#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2igoB z2O|qK#!too00w1AL_t(o!<|=aY!p=#{_gC|mfdbCRit2~1c{IWfmjqlDyUc?1_b=k z#Q6N7!PEc|4G%F{${Pg)f~y7%34}mE3}Au}LK+@o>r!Y->DpF6Tb91rZacd(vom+D zKe$td?X+Dy$<0h=?%Z?Fch3FJH-s^URE!WZ;G9svx45CrJT=E3X8?2n2ESVOCIFM! zoC>KpPQ^L5c_XsOasW{P-2h?$GyoKU<@CPAMC)e!&!|vQTGZ9o zp*h};jzs4zMOV)ojQ$xnlnUK6lx45FbKiPiTJ_ZO*t7^>iFk2=Q^JUI}cb0kRu1qG;6dwtJ7#~RLrh(8QEIXszP(Y z<`c0cHokCiSnUq&WTOI59~n%#2mu4oYCHdqq$V=P7$HQs87m7CB2JCbrY->9AIsq0 z_>S)rK2NtfwOB2|A&v8U-Abb*lH&mO0`L#WbDRex03HD80DJ%j0T534y^93`bMD&s zE*q2z&oAwR8G1z=`DG*VYAq0JPa<#IKd5ZEmwqb+R%8l?I{|=r)1Xol0)Q4CDRqL> zZa-{%kIa}f8l4TB{QxlL;n#}Is|Qe7Q-{+xfc%jHDqHRmp=cEaAw;#oD*!OkL~?kD zk9-ZFt3RiIAKQRTuLL*K;8NP*o4>}k$^B~qVDd15w8t63-94{dJyh)2?Hr&4yIcJi zzWWrThGikmWkOV=Fxu*%)nCBH8&RBZq^NE+5z!b9`#mhTNG5$y_#gm=*k@R*hmiaL zAY}WCJ(2*4Dxi06AztE1CJ%FC>_ZZUdW8P;f!_+iW-b6;z6qgM3d(kV1Yc$*l(t*w zsJ@6R4INle7-Mg)qog}wB9<@_mi3hSvqNhqHtsPU5!f~Rajc&97+%cD#1mN_jLb+w zDBvsSi#@P~0zPIFKN62z z$iifC(rW`ZI%7@?{=}KBxDRK7y_>FIwj^`P_}p0@w|lm#9xqg7bx76uUwg#K$c(|$ z!m?W0|1orck{>BzYe<%J9NqoZ^mLEsB}<&#uB}Jil?q&s-of@2O(<9)oJkTVGJv?4 zBBX-J*p-rv-f1taiC3g5PBdx+6Q&-FYr@LH+3NlsClY@pixY8xJPLd=(WvK4dgjRG zNA`RivBXKq*|YtM6APWjHqV7w6J7Z`PT;Doi5UQ>=-||8nHm z=A@;ub^JTlmn`okPAu94M7RV{4q>0pY=c^imnQbe@%v=C69N+NRQHJ!0L=e-+SrBD z#I;W@i_K4h((aJjB4h*U2d7SA^2IE<)y4nyI*Si!zqmN|DSGOJJ zeks$b2zhZyw)4tt8|#79_K(N#Kh22=?F>hfkVy&F2eJPE^eD{=3$(Ko00000NkvXX Hu0mjf*Ap|s literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/bi_function_u.png b/eric/GUI/icons/palette/bi_function_u.png new file mode 100644 index 0000000000000000000000000000000000000000..be5da1fefc4bd6e418c463f10c80ae6231dc3a01 GIT binary patch literal 812 zcmV+{1JnG8P)l&ywc57>nFzHb@W$?jX= z2^ZYYzH72887B?|kFQgwAIzpv)p!@O_yoWLP?Nqp;2qcsmV$fW7w7{y_za%&jC-jw z0*1g3umhY2Z$ROJpA&JD%7QgupFAH1+en2+;62$4PJlCD1=tNvk%e?_h&o%i16jPL zO$1LJ+z^>7^stN1?zTL8e^~J%2>m;F*`ZEB||?aMgK~MI2)`zShJD@A(+{$=`Ea zye6?R#`FJ9M%lNWa}7|gAx4y6$0b*>SS8bd qm2bmvJZ>63EKTR*wA}{$7GMBseGk;MX-^^m0000Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2igoB z1qmgD|5{G~00uuvL_t(o!^Kx?Y*a-UJ#$}syWQ?~w=df*tu3WgLaoqL8;zw>HH1(C z0TR%Fl7Of`8WSIwsENcHH5wlwYNGxqXb_`1(D1zJk!((kB zT<@t*b{XjSL74>8X6h(&;k0=s;RpBb@?G^W6yyUCH9+nd00F=a*1o&kB$3^)*S>yw z?>o7d>|H|<+DAP@81)Rn*>w#7;OgzU^=I?(9C@sFXJMM~aoY=-kIlu#Y$D_a4plFg zsrRk0t)}$t<2U;nuB!(UlT(^Eueg6-G{isu*0MQ;x=WX3@oOHNFIj_v!RF{6tzNd* zTMr-zAPhi_MTFdyJul~SVc(16E#H*Bc66}W=2B~}xYY&>+#srOxqM~G{PkvoyaE75 zCIUz6&UfvvZM`uBpjD;Z6^U1#eqdgp#H=G#?=9E$?yL`VXhf;b27mzI3_5A6-(g#^ z`@~@1S*KcKA5t4xd#L_GcTfF=?soxHYX&83Jn_r(p2 zm}+WN4UjXRJXaVVy|wX7QwvUA47J`JkMEo9lx%z!9~+X0~D;Sy}xz6qPQZ$in#B>;e| z1zAtd5j+}*Q1>|Zdq}jv7Zx&D=Db!1QveV`HUL0gK_1M>W|))B$ScSL0Pq68CWheC zLHMP3i_=fzy2pZKQe#>MVm2c}2#ql~%AVM11f@$sNQaG3pQGi+cpnvlEU30lWq_*m z2LN!`9q_n4@VGs2*c|`>MNtmK7+eGp03po)1_P9Yf{LmWb+XBtUu*&p(k3#60q?l? zt9WDl8@2`;Yz?+41G`=Bnz@{f6$60b$CsDUqQ#2 z`$lwZ-!W%@Pk+8L;;-R-N{II=P@H2e_BMNQ zbPZV2bF$#SE8}yhicd5DYP5|gqTW#F=-~eT3GazONM}v5WbIhDboDB>lL@mhK|tvO z0QY}b_4?UC*MKD>HydT!HZ}tIG#v1GH8E&3J0@(6$^hc?6Bbn%CDTi0$+9FnKg%f_ zb^C|?o_*ic?YSCdPau0f`g(y^#dF`b{$4eDt{p_+5qGz>Q%FqM2;f|w-9|gx>Y)Ko zqn!shCXzS+hD`l}@;KhG%_t@<%g)S3R=)KQQ?lWtC=1Oh7rrRR$uuP?b+N$nrQ;*s zM_Nx^E;xJH1}bo&ga-<*@}jsU=$p87v%8&kUuw{@uFiBIiLf9s5b-AQuK6-=STB;e zRq=u)%P6E^;k`LXNwW04GyvM?tR@z#8`5bM-{xx5`ow%S`wQ&Y VzG}H0ooWC8002ovPDHLkV1h#@A*BES literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/bi_lineIP.png b/eric/GUI/icons/palette/bi_lineIP.png new file mode 100644 index 0000000000000000000000000000000000000000..ad839d2f5d77a8a7915592c446fbe2a3f2b59bc3 GIT binary patch literal 1082 zcmV-A1jYM_P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2igoB z2N@$I+Bro400X*7L_t(o!|hjVXcSiz{$^$;*-bQw%|j#g5wv1UXhj+#o2l!LyE{9x zb5H-=*-kdQ**v!7hrMuMnH}!=9_OAjS0EzH<`OZ>>wf^V4#4qWZY~IdkmxztDql#) zDd34F3IHG;ruCbM$dSh65?53LAT=J}w!C1jGe_5T@zu;gNml>$IhQ)ZKYwu*g8-r& zNO~-&`SdO4?wucBkzBd&2->r37$JZdz@k9V2Y9aI;=}NhsvD>WAOm1L#ww7+vXrZ$ zwj;V>iR=3XMTMI|1kzuCOal}NVz}3X>h>sZ_lvcoVJ36ZM#37HCIA6I1^`#X-pP&YT!qc=sAE80F8rSv0gw# zv6w<~2|&iRnlIl}em!=7@X%7)vswtE%s*^0*J4JBl9c@v zPl3f;?sA{56i0fFv@~3jYCF`{9=}l;)R`LRv$YumpaY2T|4ci8$yg9$y?1+g{-5<{ z-PgX_NfoOK>9u*zY5*$%EC;X%KmmYUE_F7KEC5d4fJA#fB1)-%Rcwy)#||wkUA*wJ zr|GBCy0*^HeMPMtP_-7$Rs#^Wv1IY{$KL8Bb0}<2kb6+(ccIHXFOl0#o0RC@3ialtiU3FbIJ9ahx{u`bK`p+p5|4A-+#FkvQ zHJ1s`a!LU0yNk!YvBRAc8jTDeRE_6XllUFAx7Miw7}EzHE4kxd7z}y0YfSCt^INlp zHPhLQ28o60==!px48Fe8zQ}f#C*}8)6=)lnun7ed43o6nXapj{8@X#!ZuTH>FT?&l zH=SgYIt2+nCdV|AnXpY+gmKAUj*E%#(%+8%0r!3$7+Z{5nE(I)07*qoM6N<$f?;~# AJOBUy literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/bi_med.png b/eric/GUI/icons/palette/bi_med.png new file mode 100644 index 0000000000000000000000000000000000000000..3528bb61d1533c35ff7cfcdb1327ff3c363cc995 GIT binary patch literal 1248 zcmV<61Rwi}P)pT1k}thI=jQx=-}_vGWmzznLj3Ou z%()03rMEG?Z!xMU)>SRxem>!JEnI5h^gwS@%|s%g_S4n*GV9=*;*Yeo+<%5s7AX-2 z+!SRy=K)CYXA5S|?|CPE#_+SFw=PwA8z??(2SeOC4V4kaIDoetyuMNaik>eBE)4&1 z6P!8Mi}t>W2R?g#_qUSCE8EVgo54XHp}J&ZN4a$|w4NsbVi5?sod?g($^_^c5?C99 zfIzi#(}J=UxyRTM)#_T+0Nr{E)LfZl8{j^V89?C|J?tbisA}>uCH~WH?Y^a7cUc_$ zMz-RHl^KAR)9~F;?F(WY*n-?{nX(0yf5!L1T|U;nceT_veOceUbLocWDSfwrS;K)3 z!hITA9>5Y2B$b4lrQL6oH(cw&!Hw!4tLgFK@6NWJ0{eAdwcZ}sHsfb~5X{dh$*Gr9 zevLvT5-P(NSiN_>Z1Cj_k=sPk;HCWiE_>^)t+L`}PaSbx)4bc**#mwvc=p_|Q3s%R zX$bCx1pGL7+&&O4$KPHknJ*@^@`b|E01Ym(ii*z`q@|rOYK|?h>od4@7V`7E4*vi= zHvp~0!D$>kVFJ9=mSto;o+=uW=N06n<|%wSW#haf*KG!all;`;rcChgK$y!BIE#ZP zLm(LMp8D_iG0uCNyMAo}Jx2Sj>sHTu9*RcsrlQ1~iFV)vgV$D7rk4~J9Q^z8@8!RA zX#mCgLGfZKrL(v;w%(o^j2G`@2?XoAt-ek!6^oU+Hf5o5Naz03;oPFg$t-zNI)9^x zAf^W`vwL=v!{;572!(>T za-VHjoR(I~y*S)&o+!I&F*{Mb*|5t-q6C8R?mT?r3-g`Pnzoaz!mHNN3wCn0lB6jQ zig&IoGi62A(;YJDqGzmGOGaE7PYChJ*>ilyL^1@3?G@GOFFsfF)5yi44?51M!CjZJ z-bOn1hSfJ8YqGRx)hmMKMe1mi6Oo8SKorU4hj$&4rwCI|wIA&+?z`FNp7L6&oRsq{ z1V{BvqGS^k6qY1AIm2fGv3u(eis?yjf5VQZV)d|Q+~hHrbKqLIPr)pAbLt6|89}VU zCnv9n2zHr?D7XiR*Yek8cb>ddX}gRD?)x#TN$3fh%QNQH_rFSd zgx(hdjlRjYNG$)Dv*=3~WvycYBfu<2z@g@XWjUX4+j+O+A&4?Lqb4B%XZAc!Q=p=R z^I^>;G)@sd=Yg2lw^&ISPCx`nNW!j8sH+9=evX$pB=N5cY$9byK#PT#q8?6TlPn~O ze$+%GKw!O^z=)uACejppSOlUqqlh07|J9e#BLRv>V9w+p0R{l)e?RVD)POz!0000< KMNUMnLSTY9?p$F2 literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/bi_perp_common.png b/eric/GUI/icons/palette/bi_perp_common.png new file mode 100644 index 0000000000000000000000000000000000000000..f0ff9bcb4c48bd4d3295304b661b99d1cf92c370 GIT binary patch literal 1458 zcmV;j1x@;iP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2igoB z1Q#~d!cKVr00lBhL_t(o!^Kx?Y!p=#{_gDTwq2lQ4Yk$)6>B95!2}Y6 zjV2m`{#X(;q9I0N)Wi}6GzL_nQG)~#F(#S-ML{qT(>78%ZMrQiur0LOZny2W+kMT> z?9Ss}e>mGrhv`Ee@gyfRxih)nIo~&OthX2zz{LjWu^^g#f2S5eDd^OG^0C3>A zvgwX9KnMXL1OOBO6aWJd0Pyr}r+_gw!KX4`jgwj5zg6dE5}e8Y*i!2{cc)80tmQD) z$Q_xOspzo;#WTikdl_arhJ-Pu8TZnbTG#Wpy#%Jtw>~F~F=|?C0k9?a{;m3S4CF@8 zYzF{5YAVk1shBgI1K==p$B|160J)*wc0FKS+qlZXK=3#S7zn~3c-I1&19Y|@-cb=d zvuj(n{?&T@qx-HuQi37?`9?4te{-FS?25(Qy0)wI-z*3yfcF7#KkfE;RxMjp<#uuF z^O@u&@xROH#d>sH?!s?9!0H9u%8p^$Z0w}+b}Bf{8Y!Je&X>+3tJ|(p9soDTo!7m8 z`?Fs?RasHtkVn_*J!cW`YR2j76z4-U5sa}`Sw+*R#2N-ttQUX_fCfODDFeh@&*HhI zC!@*8p2#n|j`5kqsy&B}dpdtVR^bllXzbT8JCS38-qhNhxx(|rL9Uv5EDCoe& za2p-V+0pvk28aJ-lYUK<#y39=V7CPjM?c)TaN#{AUNsS`?rT1`wKza;OIVEIuO;D&RBox`I1rmTHfb?Wz z$XUjU?AZEx(Xz!$t6Wa!IxVAmM+YKh-Tolbv%f=cuo&H8JtV7{Mvdt$k|z6As?A6X z>;f1UphNq23ik%v!=ARrix`acA+AP{*5ZOjRY7BlAnRfPfFmY4yz@)Qn>VWkb__U{ z%z3gptEW!Iwf=sYCL4673M!R4bf((Ts{3l3tzVx|m)d}uuVy_M?1<-2$0Eyk9m0Q~jp8x;= M07*qoM6N<$f{MVNT>t<8 literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/bi_pinceau1.png b/eric/GUI/icons/palette/bi_pinceau1.png new file mode 100644 index 0000000000000000000000000000000000000000..d2f214babeba913438a7dbeafa4cf6896ff265c5 GIT binary patch literal 1212 zcmV;t1Vj6YP)FTZ!TuOS%(D3rbyK4gP-jG01_mNa z#}Zn;RthaGrO-k@F1@$6y}e(aGj9!SfYW3yF+ItXd-C3U&hxy_dCxglA_xMwolO!K z5El>^aJvQER5Lkw$&8zCxfOHEt`Ar|JiQVGWmN^ziC9dI0VO5{jRqTk&gNJ;-ddCW z#&(ldx4n`HABQ0x6+`DBP7i(6xeT8egcP|C!AaK-G+5~_GR!IniavGr;sO?nGc2cD z3$ZnZ(JOdg&!<1#1i1_1O^6~9sP8)Z)RUFw&z@}$d{Ew9tp|D-(`<0Swj6v_E|WF$ zf>7ZPcu@u?Q9K%D4)_Q*Yvke&Lw>J&{%>4G<3K}gH7MCz^yd;zPJ{k|AyA@E9?o+A z3NDS$fkGWNJhZ@dZ*ZWs>JHK|Z*3=t5Hv`B;>4MeEEEsZbiF4|T@6KC<74-cLHE^u8?8kRLztpSNq%?=Z zk*)!grvoRb17n5(4@HrqgXh19t|LX`6<@yn!o7FvGnx|R;NV*Wc!7)D+?o(jc?>SD z3wDDLZj_sBvk#&D&qY|a7GUybr_19Z8EKBqZ0zy6okpa(rLIc*L{nXTdWzf+ATfnIRI<^;I37=WFn*KA+E1gKF#{~)S!2;^b_0+(#HkVlSx)1I8F`!Fj_86Kau zD7~h>_m4DI1QQk5{eTLU`)o6E``9Qjt_H!3pCFb)w1r|g6PK9gzNg{w*EXBeHa56_ z@#n=rJNp-zSlUgH@NO+EAzQ;WaA5RbWI^cU2f`<@dgntpge)L#g z!LIy=RkDOeE=*UtX6@?9->(1%u?m(bKkbVU<|xljhFSV5!*ck zOfgbK7!jRd*O6|27sO7)J(~LtF+APvjV?^mJT;rKD>s^5RN88u81t!iWXhCUosJ5) zPcIrToZ2EwcB?G6Yq8T#iZiPLobmKf9DbPt(fP824^%7>pb%fS{mcXGql6tfO_(aB zSecyu3F)4*iVjd>#@s(8jx{~ zXCgeNEXH`h|0&!vj?g z`>;GmM6~sI8WRF|0R#aN2PANK_&Se2*4Xm-r(pf&vm-s$ug_*uTSHM)rtNC0HaE*` zG}^kk=<&Mdt4_6EMzzlPLw#p6t*cHRspL7Wh)Ovwz@1*J z-MFR19pi-xHLZOXutd2Wqngdzc07N+y%la=zj(}T8)#W-ZVJ>X?@hdz>N#Ceu&cD} zP=t%=gczq0rMNns>hU>UsW)ysSXhv+a*w$Zebgh5^_gO(KkerVVW9mZa&wpc$|nQy zDZ<1QMX(Whwi*5GN5<$Zp+d{rRyKd)CCGV5AAm4Hy1~xCz?1~R7)&Zx1hOK4djEnq zLQ&p}t^k)4Mq(CVNbA4`W5K2@CT|B4C5VJWKt{kNdRv|DsJY&58~QqBgWMqmR!Id5HS zS;jz~AV8qBz^6_MP==Bw0zrhpPcXX}H76RL%Q6-p|E0GNyyHV3mhOGA%pOhFb6Vl0IE9fcgO({|AB=Wi(3|$LT#Wx#rO_TXJXsNs3|*~S zc10_@;&gbu_Jhi&550}`CFPiAHd#{dy;j>4$}2m74cqrH^Blc(?|x0bNl@+@1R~sjEPfNnE1I+e_x^kaGeAE(jP2 z3tjcQzRxt@HUDHoGCN^|czA{cEB&`?P-}liYXbiF0)7`@0BB=L>nf5FkpKVy07*qo IM6N<$g3I9wEC2ui literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/bi_pinceaubiss.png b/eric/GUI/icons/palette/bi_pinceaubiss.png new file mode 100644 index 0000000000000000000000000000000000000000..13cf560e98df1d0fb54a49080c4d492a33054c44 GIT binary patch literal 1315 zcmV+;1>E|HP)jf{gn$pxXnxu6b zl5HhvE}L$5+hk{VySMD@&dizdOqjqV-A$WpYe78l&0%KFIp24_^Z)0}5TOH$;^IwJQa6==OMI1FchJudTt z=<9g;E%~kq7@AB-6h-YRXv97_qp$A!qZhh={ydnB&m18L;?tpXXOz3*K>wv{H6%&B zuBgUqp;*4Aujdq;>;562WK$OL7Z?3!QK`OV3F!7utOkPYOwVesjD}Ovxt^lile-CtlX&#&!@&CS@v6dy^_$mJu zO-G%PXzIl?7bYPzbQ+>l7r&-R@oSk|vg!FZOya?(OtQus zrrZtt=!#WRnOsB>lokM<$HqWv*h7eQ>joHaAB-EHKc*QD!rr9&er<`p)XJ5hIF`!a%nQ zLc%d4+CfBrb#U+cRn_jb63_Z1j`j%*xt;~RiOeS}^kf9|u}R3z1mS!P!ARVI(Kv!g zhQVimc0cZKZO5}qWx*NO?hO~U4 zJ`oN>B61C)!5~C)IfyDbh${*t3;DF7>oW?{qZ%?InqkN)LUJDIG22=Vqky40>NLg; zdkHeubBnu}0C7h{d-l3=9g^yekZP)NWS|%_k*u3~STnR4!!+`^o$esY+azj<`-0<|l zW|U5#n>V6j0<1`9?U_^dVEQ7mc@neSov>II7;k^{%`RO>!AvGI{?36{Q{@sZxpNh9 z06Gr5XX29%kYNDJ&?-aI0p8`B<~Ub`=eU3<@ClLUMtP18b?n+Im*W6Y?7x8Uwx57p ztPYU61th9VpsBs;|M$cqxkU(F|M1u&y>2$2W4Euv!qMHg{DmTi57;rj}OlKC}Uv zn_A$$Y7wd>4mg$q5}T?b2*k6Hcyb-FW7z_3RXo0p5>3;sE*ICt31XeVi(9b38Z6Gs z3zAQCS5`6%3%S`WeEIPq;*Nh6hsTGrxboY$sXV&1-O8vo7cVrfXbJu^|AzkyC{_Lu ZU;rFLUOr_BIobdK002ovPDHLkV1m{eZK?nO literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/bi_pinceaucycle.png b/eric/GUI/icons/palette/bi_pinceaucycle.png new file mode 100644 index 0000000000000000000000000000000000000000..02a33c70b766e3d0af38df3360d2d4ccbcb5c77a GIT binary patch literal 1610 zcmV-Q2DSN#P)`6pHRCwCdS9?rTXB0oZ?d=sPwB;!( zpc6=jMujayF~T&uEHiNr-AHDlF?&S!$R5VXqT?Uqrg1ZxjA0zx>NcIj$0kN#P91d0 zbWsN?P6ZT7!P*yn-`?K#-hE&Fx?G`!YD~;-^5fondhU0A=kcBMArnOr9_1zbUlFKS zUNr&T-b8qrhz=m^Zr!_O@SzZp$z(AV%U@lOjSs~5d7^&b*83)bZ7c3WAA1hZEGUPW z(~H7_jw@H;_$fUE1OE5X>ox=dfk)uTT^MUoDo*2A?-l%jjb~-1hY=x?pTVpXo7S4e z!>g?5bt(dmmKK2-%LWyPVZ4YoFO_~gmXg_Oho(K-A<$kA{8#fY@;@xSiNuBR5K)X_ zJTcI=%Pp9%fv!mpeK02+c4-RmWwbaNpKB41uP$MCJejSB$|4GUyB4;g+(6%)QI8=jWYijeU(Z}JB&9f8k|v_s47M3B#36P0PF{_rxJvCEAfRS21HKcT2yTtLB7 zc`7j4yfCYdD@XEM2o_QwV-_LyUgb0X1794y44cmcs{vd>vh#c4v6A^SlC@c-Kv5x7 zd<|B^bsaKpLi#j90wz#%A^3dF1(@{r>s$@X%fn?t46`GO6SIgw>b<%CBk}rbjW|D# z#y@O8Sb;DPVG2T8l)OgjC5`CJyZD+qyvF_)RCtXgM9xTUQ?b1Fm~X?^?L7S6$0P4y zh=j0*QxKPZnZ5Wx2@H&iZK zwDRLrm!Dr^AIeza5AaXBoenL}v4Hj?DClvs(x(=$dvAL~^Ue>Kv`V7DOV$g;)d@M2 zGbJ@{g#5QXo9r8EjwGCE@0oq;e51^1>c!LX5}lA#s?MC8tC^5rMadOaGZ(KhbsVeB zj(iuS)es0pZ#hw=ZjS(JWeSjRDI;O4+EIV-ua0XkcAjYh@12`EBzxCqGkB7+^5uTR zwMC}htBZwDV42U-mn|uBniCkXvqB^VBWLokMwGU`Y@xWWbb(k|Farx;A`^~DnYC18 zvZuKfDdQ{SoTALn+jfc{l*|(gHR*V*w-Dx%W)-s$@mt$Yl(>8{kcA5tG6__!_Cs>c z=PnMqOh3gr!d0ezE1VlN!3~FXBk2!5Qd=?m09JB1ks2i?!?QW1_cjoxp*v3R>AhQa zTmNW03kJ6%vZXC#DsrO{2se=ZJtxcjD0hr370V_Oq{VT__-`iM8Fav9+W;87mTGB3 zlSUv~5k?w_$>L#wrj)R9&Kotk1v#+kyXtbXxQpmWCmThIRdrO?Xzjk-1ND0jz<|#j zY3F!8n8PMUU(ktaYVlLN(br$e$v1)Fv2%SeZ0CEn1#=$cU{?1w{j zjd07`32xpFPTpEg=13Ugk;#$5-3*Gz zp`ge?NDP1{WZp;$&MOIf)Fatg1n$Wz*#+ZCR5D0}ghZ5CRYN8bRPuT>lC%0FOb>01hix6951J07*qo IM6N<$f+W7}4FCWD literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/bi_pinceauhauteur.png b/eric/GUI/icons/palette/bi_pinceauhauteur.png new file mode 100644 index 0000000000000000000000000000000000000000..0e07a3774f09152fb5c0c2d8535c746191dec7fd GIT binary patch literal 1168 zcmV;B1aJF^P)1RCwCNS8HrjRUH4{bMB+tI^?C! zZ7LFQOWgP}Bx*)9ASm!bkq-zGGc*n~Hes10_()7hNYprj?t^Tygi9cc;Bv8V z9FCZZ7z!wvsE~~Uyc}>b9UcZEDJZ4w`Np@b6|n7Vd#b!-!RxwCK-F}>7z4|)z?wBj z@#D!Z2nL3WB=H~@Od_aR`P#bjrOT>oUZ}nMY-QDiAXtc_Kb-E%vUD6~K_duaDFmX- z99~<6j<1(XB}|q;%Jfekugae-?ref^49zNQ<7v-&5Ek!bn*4~$7`lA z%fj9-Um@SEv65n*X{7B{6eUv*INiCjaYB$(46>Hh6j>6`*fa?OOny`GR7t6bDu5{o z^6f)WfMJA$L`m?N`GhuCQ#_IBoG3d5SV&Pb+?)2=j{lDHMnF`k{E87`lRmI*`_8#9 z)xPZL=-2D=qkv*K;iMZaTD+v_{f~CrJ;7AXFUQ+=f41Mw=iCYZx*f-=My8Hlx_g|C zg5o*zEDd}1edF?rl_w6{T%-RCukQKdf}C>&h^~B$Ky{w`(_fu70gZqZ#T#3;f8dEI zm4})>b-M@pUUhc=8pwGVHlOO{S&Tj`6xa${JAXLV@qOaV(X;}QBzd~i-VzA<2H%Q? z{3ElH2W%Uc$y*wmm+P9^RQk+w^-s>{8e|YareWy4(HHaGxzU)2g#)vi2Yzm{P1p}K z?2x3yn(Kq!R6=HGHpGw=6E0PjqIpR~t*5&AvW11a`ulHMM2Vy`A+pR_QTyhO_6>D= zUYu0|Kb>{(2=rs!PS=Kk%fE#+jZGRR2>ac^p^=di5fz#oe?udObB?OWbx7+RtD}QPD!u}Tm2!epghV?eNWxQ{5 zrWRsxs^a{aukqW1-R66BCp`k!Zs8|*o@>0&8G2LxmiqOsKmyzu>T77Z@FOezQcKWE zP{{$9bOJq&kl8*G0da!-^pee26~q%eu3c^fnBUXT`|bW$h_9YEzq?ksNK(y}i6|$V zfceyC{l-P>bSYj@MG(m?Zl|+g3FyI(>?o_v5C5@qpySG%JGiKB84K+j^ z%Zv&+QGi+rDme(+oBM^f>L(RX-=~JCHdd|3e!sr<#r#b5>x!7SD*W3qaB?6BTKz(j z$zPC_K=VX6Q)v)2ZWbhaT+*1x1WH7x_WcX77MUp80$$8T?EH<5G*TuMWxplU%KYGb(Y}>NF`%G36OJ; ziC7)Ya@V*dzDTK^wo%eKGclxhW%q$2^L2*e-)9t;%wTB>P($sJmBo3k=xCs#>*5t~ zGw1<#5|}r^($@)=wn9;eOT!2Wa*Iod=H?es6`S{US=z7a*s!aD#a(i?i_=P1FNDc( zITIQ_dv69$TwBedgGaaO^@YbWlL@uGqZf2`T7ir3G7&n~NkQfY4H>7Tmr8pZO&gA- ziBNf_T{T1$I}NeHZiu^<|I@x5TY_Di_GFn>nd(p!-RpM-mo|QR5{!~gKxi0%=IO(u zk;oB-B{BJ2NgKn{#uMp;q9t&$rxDEG1W2qFK!JVG!U0MP7U!1fR^9gaoOxl^mCBx} zS0dRtT0w-#>4nBD6x9y)w48mLjEBAHa1-e$$VT9JLj4;VE5%VVq)HM%5n_gIXrZ>b zWSOZt;B&@8?typEoPsr|ZkDlN&WgFBC>$rkqoK6dvd6-IEuG_a00!BvV^UjGxuUu@ z4%L88Q5_5!Z;oQ4Jv^dr!0YvfM!@9JL?*dhxsm_sEvQpIMmo9k}x21{4v7AT()a3ej0&|Oq@|2K@ oJoHx!^7v)+n85#@z@GvP03=g{NiQ415&!@I07*qoM6N<$f-VQ5wg3PC literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/bi_syma.png b/eric/GUI/icons/palette/bi_syma.png new file mode 100644 index 0000000000000000000000000000000000000000..e7a67b01598b58467d0e94be0a6883253f0cad27 GIT binary patch literal 1137 zcmV-%1djWOP)pb^oS zz!m`?5u?T!m+^<${KqZJGKo>Mj7*~;G0}*F;7l<3R~3Vgi4K+c*ccW_ixpHVqM#xY zsQAR`1st!I7Q8Ke-1gqv>$x}QCf7nA)W&*}U)r9pJ-^@gIN#R`IgSI7Trv>h6>$L( zUob*kTu=fsH|NhqFWV8a@Kz;4X;Zm!a1x|&6Sv}M|9N>D;z5;vC3jqEE2w~^R6KBr?;(IJ0%Z~t==5WsR zZMU+_=5d6jO2rUZr5{@ zrv-b?dKaO;K2Rx!-8gI(z`vK;yhGlrJ+^+DYqYgXb$CIxYPjnr;n{%5A7ML-J!d3^ z2*Oc>0(pPkp9O4R=b>9QSHKy)v#x7|**E6qT$s#_Kp{90_&r(_@v+xXR&^vVZe`m1 zGV5dAPnT-%g6o9i=yNk&ilfV7awitxmXd!=BNFo6R(?D+PR>^K>n<-YX(sG?Bek=e zbhltTgT0lKvr_U<1qdP6SC+2hNaH^p)n)NzPs{{ip>`PU^Z-7b@d~*}&PmBb^<3Vr zDl2GI<}vxJlDYJRsr6G8@(i?}j*yCwf{=tT10e?AG+8)i0W8kXja|KT(b@l7?{BQW zp#!ak(Gzd2_EW*;J5&KezH3gGBu`T))cP9rQgw&k{)V*dG1whe?oxStLm$y=u-kG-m$Nq<`G$dtt@ixCyA7{@N_e zV2B0hk~Eib_xs}BAN)>Ee?{mmAPS3!_WJ82b~VP={l+53P0q<&Lx??=OW?s^!;x>F zolfErln4>`J>i&QlWj&&f=}|q@+qH?KCg$<_W}$6(aiv~Jt;g-00000NkvXXu0mjf Dzk?jS literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/bi_symc.png b/eric/GUI/icons/palette/bi_symc.png new file mode 100644 index 0000000000000000000000000000000000000000..e88a33946ea781ad018809b57d17c92418460d13 GIT binary patch literal 397 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz$r9IylHmNblJdl&R0hYC{G?O` z&)mfH)S%SFl*+=BsWuD@jQXA~jv*DdlK%YvZ-3ZS=fIHqPB#YtE!GB7K0wR~75WYoI|_8f5n>ItkFJmcQfWXO3Kd!n#Ip`A?RbV_ z7kU~1S|kY72m)K6G|VxJfa>oNY57we($dI|z!n19P|NlJExU^3C>J0G8GMh3004Wy z&B=~IUq=fpaPi7DhF$v(!Q>k7CBm~H%b_&La*$(;p>ofNi~(@4gDe*p69HqGLy)2b zdk8=i+Yz+r06AhaF~LvmZ0G{Dd^OPWvm}_i8W!v?U%dfi5F1$zXCg#PkRadx0IFF; zimwz6?2Y8KEzc5@2njg=R1Ulcs(DYWF}(>vLZub(Ibxs5=44T>Adu^eXzU~A2s**aJ9+s8McYS|g6=Ofh$ zFmwmtYt6j4cUk-9@vYZr-6q7D&n1*}!${5NkTJ|{U5lG2)?NeJA( taPZu>Pj3~dmCvbO5{`&ONLK(5U;usrN_4STphN%w002ovPDHLkV1h!h{hj~- literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/bi_t_app.png b/eric/GUI/icons/palette/bi_t_app.png new file mode 100644 index 0000000000000000000000000000000000000000..b2ccf3618e7ad56fa940e2e375cbb6d517b93692 GIT binary patch literal 1048 zcmV+z1n2vSP)NzenLf-!&`OuXoc#ETK*#TXChQ4sHzo#7(~Zvorth_x=C;GqWoghCvqd68>uef*@?f<{0=%|4aZ7 zZv%4#uoSx}`8)7!T5thC?gUeXw@=VAF}J{ffcGz{yqJUj$FZvcQ2*vm&3CH;_Jb(} zykHTV^>O5*3EsUf84-4qzBb+hIgNZb_Qk(2mZ|bX#bnp^t+9@d&TjJjRU;d_G?xG| zzJnGUjgnfNjUUDPM?$;&S(0MnGawa^0(=zqNoQxyO{wO};x zskT%ER6r_#YZKrQwpRjtfb3M?!(g|dIUDd2BB%Sr5a0p4Xx#ELu#ka#`WS~^z)66^ zN(QV5*bygyp&^04fS^m>hI@|#l(p1RYB%HqLdaJf8U92jdRxeAk3!nUmB4^s zZk7dA%V#R9j~*=C>ky1`LkjE*k9~7abvG0DkdL^% z5%R?^yJltG6#|R~l`fofN=8#32Fw6L2?Zb_J1@j*7tT5Jw`?v+6U8!7i5?D3jOTiL zK9auve$q8LOFRK-WGX7ZjcWP_e?)1QR88W}8cITUNd*w0#E7uj2MLSR_OR|ok;85; zGgS3}G#x1Z-q%k)yW7dvz!Vt{&IJ4ssa4VR_aRko2`cggt89D~CDafqlFNt)LjFYn zl8e{R*PO^)kySe};&pbuZzn^(QR0<+WI8(Il63{3x`Ilm3zw6?MadH~QfAHCx|smm z9%n_Fqz9k*q9em0b+%C_sw=96J5)n4ODj(pPs&>+PDdEOtpXH~mLaar6a;%-NE@St zl0kPlBsNQ{nN>MbodeyRjD)8l697mDECVdZHml%7X;n?4G?33o`Z#7&fDxzT=a?Pm zSx+{tMhcsYX%V7`G$a?f`A#aWfBR#?A07fXlyq9>^WRV~7WnUV(f^Kr3NQenqyTM* SuC9In0000a>Qe6lVTx6kE+=vDhTR{jINEM5uVo0pf z8ZBztnq)k8xC29&NoJ<`JUHAp?@i{McYiYx6-5zRIV7RQ!(DAt6vZt({Q^%FnkE3m zyI_t1eqJhIZ3-e@HCzCQI+>hClr3E!!d@04Qf3c3IC`-cCJc<|en0Uday4t}<;o-k z$smydPqh;pt(lN#On7875k?`1>n+GB4E?;8t>R5Oxo~*sfUsxxPIV!Xd?!4Kz0~$D zS*ij`HaaC)4#zow?4xS#*W6Cz8#k<1p$XB2#9kG!+sOk_kk7QD575a|7RjTU+rQ?% ztDt#BGS^N*gFcYQJ^5PfPLr^ffH3F9L@fchSN63Bk^@K2+;n-o#~qj9Dg<1EDdFC6 zTS-6yoB(4RFvRmNU;*f{`yBTw61WF=hLcmj_zc{~1LvFhHvG+&n$$^P5MoXP-ew6X zRa^&w+d!mQ0#*#xZUCco`yQw<3KjD)(wvxz9TAp8 z(B^fkU2#YMK0)3bRM#?dAB6YuX+iD|jN$S!CuXq`RUk@|cuIY%fP8Idw+c;&&*KV_ zMm~_(2multYx>}_qDcJR;I>=ZmOZevQhcbneKEhFg61^l^M9VhPzQ9`^?>CZNX+H# z?AS=fIHqPB#YtE!GB7K0wR~75WYoI|_8f5t>H<&>}&oSWMP+o@IC)-ze12x@T*+@A-^hUqFrayVNiq=R z08%j!YzN{HBtA0`Zv^6LB%4L116~2K9GVy?yPgE%A|x?gX!g{ingf791zJ0zi%SD> zG7x_RrBfjO2E@04cqv5=fCjGw5>0K^M{xDu%M zBd(l6Y@NYEWKIEDGzI7oQ1E^QMF|i;1o9UH<#MrTf!7(Zq8e0SLCX%1Tm!jnLXc^X zftCgVX;mQJheI9Fbp{Kug%8N(Rw4PRfB*dA2J#z#RWm3)*VDXJj1-^sENmQ7z{CYg z5A`51s2nyxbe%y=2oN2g#MBv3Ig1-Zc literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/bi_t_para.png b/eric/GUI/icons/palette/bi_t_para.png new file mode 100644 index 0000000000000000000000000000000000000000..75eb83e8dc08f88c7a84082d0f5f6e478ae35635 GIT binary patch literal 1232 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 Ef-LWx!T7y U;RkSF3*YxYm&>K|4G7OX z4;Yant*T(aA?Mw*0EjPhfXGJ`-+RIxaz=MihGq8i?s=!P*-YWjT_S!|{D+k!ZC{3L zeCDgwN+I0uC){4@g#J$gM6#W-5vt$|l~9}$(MSLv!F)b-Bp?U^Ido((LY~S_2=dN4p*<2xch)hGUFvFsZzd93-c0@pYs7 hFQZ<-zZdW$zyP|301;&OwpIWD002ovPDHLkV1f~s<=g-O literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/boundedpoint.png b/eric/GUI/icons/palette/boundedpoint.png new file mode 100644 index 0000000000000000000000000000000000000000..57514d851da6eb1781446a29a7feb1413b971e1d GIT binary patch literal 1068 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 literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/chaine.png b/eric/GUI/icons/palette/chaine.png new file mode 100644 index 0000000000000000000000000000000000000000..37fa6507e942a04ef29ef2a2e88753aafe6926fe GIT binary patch literal 526 zcmV+p0`dKcP)i1t>l#b4#ZEH!=FYw6 znfEj>7Aiv*Fp-_n0?KUS~ z=qd5LuSb3S3CD+y{Y6kfj`=L26Pf&0CmO1fj}To QQ~&?~07*qoM6N<$f?_x9T>t<8 literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/chaineOFF.png b/eric/GUI/icons/palette/chaineOFF.png new file mode 100644 index 0000000000000000000000000000000000000000..84da09e6ea4f0c70bcd74c606625494666dcc1a3 GIT binary patch literal 459 zcmV;+0W|)JP)`u#p#E*Dg*RisiWn5K!{ zZU@J400~h!`Fx%hiv@X}N2OAUMxzlOk4LK2YNQeUNe5?KV$Kx;dRr z>X1+tA<1M?eeGwn8Oef9r^BwKmdhmy zg@QUnYPDL?;c(#TBoYa@t}C4h@%imP5Cy#i7y!>&nt^bECmsL*002ovPDHLkV1ls; B%K`uZ literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/circle.png b/eric/GUI/icons/palette/circle.png new file mode 100644 index 0000000000000000000000000000000000000000..e436caafd94d111cff50b8d396cddd41a73d38cf GIT binary patch literal 1933 zcmV;82Xgp{P)@nS5v}J3%TVh+k|=QeIgnMEXxCq z6M-x$fPx&&qzS}|91XxS7pz^~0oreD&8_1)Hwb<@b`q3V&wCm^?nb7_;%2&%2{drJ z=l$(#iY#ElyueMj^ z7SZlC0wxP{KYZK=r>vO*`9)y@NOr1c|MoRj8ocK7oLzo#EaIOGCVKtB_zxF6VGmkJ zpK6p%PT#haOu`TC1w&0yZ17S9CkLm1d_l=0fTSni*!}c;8$)&ZJm;1VUhtpxc%uhS z|K&N3*lQAs=w3#0Qlh{eu@sebX|m%c&_-!GCbc{28(seK6nr!xhtym_r3*+;Ii2>- z_$ANUaZkkWotOdFfO#~txB?pKMA-L9b$wfxCb>58QI}0PN@|?zAc0{-AghNbY21DH zp3RFCDZSnw@Pj}g(fddL40syO6uNSVh=BeRpqINN-oYEPTxy>pOJj;8j;CVb&##XT z9;#p{P*Kd>)6vwr0KRKRBuEX@r~p-2S-hG}OxA}Z$&0=~{0Ag8k3c!26Jg3J!>5k; zkhgauAZvO1qNbL%g-c{vY^*6Sy#@X@fK0FD5}7nCLXxDsf@Nbc)VRLk(Xa=TUO?cg zZYs2s+>YLQu5%&E8Jbx#aI$d5j=2V06k|DMD>4JdVroa=COwfE2~esmwxv=$&_WF@ zCL$8}&Z)0^UU{Rd^Pzc~cOU59^*sa_Qul#3vgGF0s|;^@8)> zVE5O@`w!ysqHpB>kx?&gh8rf;ykbV?T6rs7OitMc#Djc!@z|kl)QLm6@!E`(Z z(wq<<@`jEhaKca(Rhptz+C)J#)#$kS{Q!IoSmDd_>nm%okfMn%_r3J274TaF!7zx# z*tnv|bM9Qy^ig|5ZABr{9ZMJ1X(Fn5!IMuwg$R>2#tdrgB?}7G{dc!+Xcc3VZ;oDY zgZ`1p?(a^XeT+@<-gHLDa6*>D%%zhc9QI0BJvkuCQoz_Z(1ssi5GX@sjHS7{qG&OE z?!`PdM|RtL-wf^8bjR}(;Y8Ju--dEFKQrokoD(E&)ISx%vZTI2s)VsDj|9_z%VtLm z3aLf{3YX&kv{{SR*~@Gz*Q{)4_@&Q1h!N0srtCR*;tP1S=r(t`LvaL}#nNn!z&kHK z)kMldM=Y5JEXTR@HS$t1A|U&`k>jLFd#g&U^Ov+-w+>4-H0IeNN=|xu)>AZ(<%^s@ zH`LlUa?xOOC^qd2#glz{WaxFoNI=>9$y03!^0Hq8Ib1U3nF1YmCPzE7wu2^r$ zkjzf&-E%RuH~0ZXMoU^)%FQP$^+ zu}6o)vEIKYB3=ZZ!K$jPw`2v|azuhgN@zrw^-EiBtSPhI&X}mhW{PT|09mVl3L8AY ziDDovh$Ha~@AAb{eW%}fpSg2+(U_C-q{9G{W zg9!rGn+fVF1Z1pn)qxd!=d&X4KaXarfdGD0)hhrIvpt^A@^G40!quw){3E~s$7Hyt THJ%qm00000NkvXXu0mjfMnjZ* literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/circle3.png b/eric/GUI/icons/palette/circle3.png new file mode 100644 index 0000000000000000000000000000000000000000..17947218b8a192967c7f7a206a0bc608aa7e8c43 GIT binary patch literal 2186 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 literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/color0.png b/eric/GUI/icons/palette/color0.png new file mode 100644 index 0000000000000000000000000000000000000000..aa72a69cb80c789d1b9903b06402ca6a3f16ffcd GIT binary patch literal 765 zcmVK@f%a?2uqEh$09gr2!-w%DBNz3Ys7kIyZ=h!X*+VJ->k31wX(Iq5ujg5F#{2 zDIgz=%>9b}EIL3W!*-vUjxtVleQo$-fHFUP{8VU>&T26>y1dcEBch2cCm{ z@C)=QWO7AhGAJ3no(H$Vvk9fPya0E=BB=6NTdA?Uc>*-~J@7Fgxv~u&fD7P^5%GtB zxt!8V+1J2Ba8>_kG#ai}tGSCyOT*uLySuK_>9}^gtxYb2``|k(GI4T7w&$J?Nb+;w z3CG=4t5w%*Hr@4lJyr4hjSbgowOqH`)myJwi9K+@c`*p_0qy;|CYQ)cE+PL(8xuEJ z!3u|=?9YW#&XQZTWzR}(MMzr{^3X|eB5g9}RbWML$e4$Q*Y+A%pn$0>pzC}z;X=Y| zyKItARe@RVOeK>%NPsgAH(F|;;kEtpH|GIeubX;9)_G`nZMV25#A!Z|B_O7^4?|2w z)_Gn?8)HZkA3$%?=9DF1z>Vdl-V~F`5}`(9;w^Xsj*N&PCyY3A#XxR>N3_>aE0*{S z9)nll8+XW`6q1bcW^6`f3Rt9_ZcnipeWGabkt=*hh3_28o3$52JTHieoCY_+UD|6_ zNZFsV^!wz1!_e0u(7ag!bdIQqQ{X(ky-tT)HcM@b6HXF;Wm4IdewgI3e<;lp5SdEM z)6*-wE*O7ze0h(_4msY3=43Rs1T}BokxU=xo0ZYy%dNdSa}Mm0pd(qxnb1xyO>%Uc vhf?1g;-Ze_enn>gVN%4Ga^at5zXcco^eaMRdLfG100000NkvXXu0mjfHCtIH literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/color1.png b/eric/GUI/icons/palette/color1.png new file mode 100644 index 0000000000000000000000000000000000000000..c9ef3543245ccdaac93a5003bf7e672a24040f44 GIT binary patch literal 834 zcmV-I1HJr-P)ZVg7FcF?CZ%JJnAg#p1bk{O?#W#BNklR!R_tLGqd1Cl7{)0Y9Vhow z%E-rOH1QTytl|Y8;~h5XX@lC95a}5aCyt=uJcFw^g9EsXED?yqKRm?-?%@tr)JTZ* zB9TPERnD*B0&=)cD?V(sUt9P{ByQn0?$hWGwK_i~U%oW~Sv{}(EDE@3I-j4JN9j-r z6ZuIs{$Bfr@_HG|@0X(_zTgH?ctWF^K_alt0axughh3Z(h6-3Xwty4GlM%zIv1!$c zqeU#eSwgi@<(a23fr}`jjEYLkmXW0KIv}g}RKgj1-p#oQ{*P@!d z%$+Di`p9v%8)1)gZjxZz5C_38<)~#lj%^|VPaQP@@3}1^wj($~zr#YnOGCg7&pDx; za5jk8W+@A{ou`U`v&S{Z?KW?GF=B-i@KLix#I}L;eyX7^DlD%8KIgWG*w*ktj-PK7 zD=PxN(sluh%*)DJqI0&12+{^#({Izz0c!#+RajWt1uQagB=|qJ3Gtg|c!uYqf^8C3 zN~j~iRjovYWs;PTl#LZ`@zo+KGnHg1uH!3-@k9K;Pbo^xZV`y91)iu^9+yZ`$8kl; zs}0!sC)~vYA^`kSvC#FPLH=6lijfwPJkC>5Vr^%6jRS|BSN=$aep6b{Vq{m2HHi_D zlyRl)EU&C^T4eN5<80@I<2~15XQ$P^%khp2iQbN!6qcMJuWqOsdY|jE=YMy7A=z;y z+a{9jkXIO`wkfUcxc@8JZZ4(mKIu~Gr2RJB>ub5Q|8Y8K0{;aV0PW36Irk=om;e9( M07*qoM6N<$f|Vz7umAu6 literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/color2.png b/eric/GUI/icons/palette/color2.png new file mode 100644 index 0000000000000000000000000000000000000000..f3de0b2a24153141b24ab64bce1265cbb4e242b1 GIT binary patch literal 839 zcmV-N1GxN&P)Ws#j&{l-;$p#$x>%gl&BaB>f`fxl2XRs8U=YG2&`C-ftRQGxV%sFmo$q~rdfy$FyDv8MeDLo0?q2eK-~01>-#MP=Ax+63Wl0@C zpSf@xXU`n#)c;=*uoNdk#ik;(rvMxkv25sW0&q#&p}V(R0D70?@X9c7b`lsm1N5J! zN5`ef_7c$e2>gBrJbMW&tkc6LzfeFrM#M3BAfgDha{@Yh9@u{s$W6xMt-l7A=YU&p zXt8Ag34qXklK^C-^SR4F;Wq7f%r0BaZ$R|{aPuiGHb@%^gxd`Oz4Hm+;62m%#Y;yp zK7IhBqXS~SveHDQvW6GWe}q7Mz5`6ZqQxHrgl7Wiizg}0Ifq?3FBG!4cKs;I<&l74 zsWd3GSj^+`qh-|Voc4hdy_o_|R)DYVP;n+Qp(;8qI6vo6&Q0NWY~#zwIbe!v2ZM}A zb&g{TAS0{Y4||+*69n7(a=1*FJZXQZZEYgJttN$YZYx3C;Ztvy?_*=z-En_exPD2#| zo@y6pu$&lUW@CoCKeL2d&4!9Ms=$YNp!Q1*rB+k~;$}fsvDZFehA8#e4N0#y!p=WE z0q)Lo5ssBI~=I+EF(3C&ZkcGB3(LurT`#Gj^eEDuMd_a7!{d?}~?Y4%ru0RXHwLkc6a R2gLvY002ovPDHLkV1gPJevtqG literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/color3.png b/eric/GUI/icons/palette/color3.png new file mode 100644 index 0000000000000000000000000000000000000000..11e5c24441160d3daecae6f2334a0dc93b2686d2 GIT binary patch literal 881 zcmV-%1CIQOP)RlXqvWZjz#MKuLvlL=AzC^x#&OvXgp$i*Hs2!Gi`NU+ZzQS-cmn#1c{^jkc);f zVdxmwHKfU)W#dbuiTSlUUd_zoN%0e^Y`ej<$$|8Yh$i!ZOA!j^#?>>(#v?cvHjwi| z`^Us=xq|7b$9T$?>k^O-5W=q?01B~jJ&&`oFfQvMjH%?xYNE7M!L4frJRnR=O%B5D z2Y`6<$wUk{WasHar!l(sFk*>a&bnSL z!O1yyb1n9ukRYkTPj^ZG@L^y!{A|TE=i6}S~k!`~|Qj+t&A~49#6q1}P0f1mQ@tcmCs>rrx z6HEUx4>+tv^eQ&!oU4j#TdiY(A3xiTlDz=f#O-2(NaknhwXbuskqN21iZ{edy_%C3 zfEG0t;&!n~B;y5w?vagKyK&aFJIe-5h_wGDHfh{Xc*LXi@ z2r5=?Mw~?A7qXZnZYO&6a!z5VH@`pUgucqPXERc2#~j2K)>yU^w-db*!*P;vjv7@v z6&&T9hn<|(Hqwqe1`?i*C~quLiC#q^+dR)E&v{*CAn_Z?#2>^1THHy!i(VnMT8pdF zNTxCq%2TdzVs7S8+QAL{p@EF$-4Pl5he;4$%7K5H{S{yUcBN}eR}dXF00000NkvXX Hu0mjfB=3xU literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/color4.png b/eric/GUI/icons/palette/color4.png new file mode 100644 index 0000000000000000000000000000000000000000..24227f5d79b1161d2da2dc35dc3a288e553461d6 GIT binary patch literal 906 zcmV;519kj~P)frW#KO>}QC0B=&=GZG=*HBcj0_#Jb*f;f)Tt~1 zMKB=528vW9N-HIb_$XFolSY@NC99PG1)cp04$=WYqZY_fbCLF&CMl~)6?^k zs@}z+&}}S9Q;uiTtlEZA>NXnhj*G=Yvs7x3S3IUP-y1KeS zrY)j61z`;XfbBddClXJ1=QG(Xx{*$!R5a$ykF*y0ba;qfS1LUqv~v0J_qDYbWO~Yh zuz3J}IUvEAJ7K5JV~T?AUAvBMjgR*jUP>e#y%@iMo`2p!EyF-qQL>RtWUbWI`wDAmR8k_j1k)yaO91ByuyUTyB;;Mu~>$&B3AoB*=C??0(L95Mawh85_Gp z1{EG%*LH9O;Ht3&ICD|qZRL3UCK)0Wz;F>@_Z);JoQUwYSuFrlyjx3fhc89xy44s8DJ{^aECQK9gLvY^2gCb0-WRfEC;vCxe7*P_5XBHQ8!0kYl$=DCrADGmM=Au``m0E+UP)jD#6Y^aybE2PTQ`*A~^iKn6%iR$f{f9{q gU&?`hn*9-A07)®iJP&Hw-a07*qoM6N<$f|PZmL;wH) literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/color5.png b/eric/GUI/icons/palette/color5.png new file mode 100644 index 0000000000000000000000000000000000000000..7f6ed24b6c263af62e605738c980c708654d09f3 GIT binary patch literal 840 zcmV-O1GoH%P)_WsPp(Q67KGXcL6Q@~r`=-E-%c4g(L&;A7L% zC{IivKR(_KxW0~Ny^iloOFKY(1n%7dmgRBN01?>MK!#_|wCmvR=qQfP&f?JIrGjts^YB_N8RnJfL>(vf#`!?-krMzN3#e$=rn*sU7+A zfQ&r9slJ^^L}AOZ+Re1b1vf#^SKAR_ib;}@i?nSb0GF+%7kK8jX8M+aGcpwv05=VQ zjP7%qE;t)AeI;_m2%ahf&K_${rq_34#fS{I-B!|Swr2VY6MY>-4MRa8z3K(_xviPL zKY&%$e!d}ARsei*yIvs4{90K_3{D@Dkc5`s%G5DS`F<+Baw+#m>>8es4bz`}h2Adf$p9Hj?a630_8J_G!w)R1E*hH)^O#4!%GbpQh75-=MYFbu&)BLIey zzek^Xx}Vv}Y^dG+@I?y~9`YLCj|2e`GBJAI!~js43a(2%&kOYp-@nG0>9;c8$#@&% z6hurnw_}-a&`Ya&ThnQ+Q|BHGf|zBIXp_?9=_27+=DQK>nes$So(f`yf!HUhRDf`z z@|}IPry}3qrY1Pcbm`tm$gn07(-;Yg3?SBbM?&2t>?e4>g#pMPygXOc<2R4GxV(7x z9hXI)lF|NKT3rTWFB8j*3$QRn6r6~|iTAHA<DI$t%~%Q2%*y;r1XObf$NpLg)QJ zFNkKC5{v^@(>CM>jk`2$1hBR;OFFualebTLNcWA$>-~Ydq^dTG-GJ;@TLYm3=Htuf zA&+G$=F4enKe3+-Kf6Ox{tn(g-E$Lx$lw2fdulA|N ziL|9d4mumTNMvAw#z!Vp!?j;V5Z+XC3!k(aLHI#Wq(i14H(wioAAgRL_O>zzFkm9p zxXG|p1l+&hYe-CL^Xq}hFT42S;?uKLF1~?|94=Pqe;9hrWoKu{<^VW!Y(Z)*81-!o z+bzPvTn#D6gj$RKl=$?KsZ=>xrr>ABsB@t8D@ir&=HFvu<2n@&tE3=C1mRRv7RCIx{w3u>es0?4D$q9{_ObwH}t z19*LIhguNZNejb1dg@9M@UUN7sz;@ugvbd>CkB9$6mGuo;+EwUC-NkzdjpV&u|ZV0 twFR*5;bQp;iUJVpWt8~uU&sFh7yx__kXRa8_t*dc002ovPDHLkV1klTg7yFa literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/crayonB.png b/eric/GUI/icons/palette/crayonB.png new file mode 100644 index 0000000000000000000000000000000000000000..d61b623d3b36eaaf22f261e4a1eca7c65fc03455 GIT binary patch literal 1951 zcmV;Q2VnS#P))fqka&dfe$cWrMH zyNRvXfjFiKq)wBxP?v->h^m!BP^pkwRVXUq(Kc#TA*!k>NUca{O9g3T5rjar6iO90 zL;{3_M1F)mNLx@75DnV2ab8a1x7TaW?#|48^t-cmx?m@EmX35iv*Ve2&Ue1^efJJ~ z_t8i3|2Q~fPTaPaghHHw)?kdy`OeA*9sqmlV*)eFf@Ryyi|XonY|hsZ>;cd7ejJ41 zSw07eua!!$)0;Nc46Z5CQZC1{@%V4OAo#rR`$#7ecV=5!ZV^H7!--+TRbZB}c6T0$*Ho z?|r|py1EdMoIwyk!rTUi3k8gO-dzp#^?!Dg$(xN@vnp`v?H6myJv8%m@|{AwV=dzx z!>_%9-tKOMLqkZW)37LFq8O>Npsr48DR)kK-ovDXtX6=Dqd%>Y0KPB7!tODdMxlNS zShfRR?kJA!+J*ju2a%u@#B4iCi7_L210oF9(a(QQ&v6G4u%)(ZfnTpx`4JHokSHAm zoA?Wax(DesU%|rXUO=vUH$K?=Bubu#cq$c%VT2*g zSvm=p`wsN`-vi_%KK0-(d|}@{q*kp$F`oyOBtj{F9td%q2Bt?11W0%-cFJI+Qv`zu zg8?Y%ksB;3NdSMDMRW97BazGua+nG-|zXx z{QfNSesVqpsN$jSQsL;=P1J&<*D%qxz?e|WqG`&ArP^UCUy>S%2x%n-C9nJTLhpGj z#B-G(W*pz86hO^IV6hUDKQpq21V|o0%x#ZIC;~UbNw&dq7E}mDDGBI3^&tH@r^zFR z;H3^yKwUn1?LQ&I;U+V=iQb7XrqwTl&_7S$6Leii#=DxXC#S$EdL8Vim!JMn3NJxQpw$Jq&I+^#VGpaFePXrH}57g*HzRoMvSBnjxn(9VDoEmq=2}T>#tX`@aqaV z)q6OO)WXdKDk|V&f+D{P+^&x*!hjPAMWpT_@WOoS+E%m3Lw8&)3wuN`oQO(}2qfy) z!HQ)Omd;SkPm=4?l>1glQ6ONFUIvETUdHXWE^lc?Rt^70z}L+)A7boQj{eWe;5Y&H z!bvP6saKN+DDT3HOcl?pjHK7o(rf=;B>j(Om!3ty77Gw+7w5toFe=-zIZ6R_tr?kT zxK=qGU{02*nZd1F6SZ6^Dz1;YS5psgNtuhTr+%#Nrmpy*#YRur&j1UZz^QNp&IUJN zLNycNit_eH+v61DC5+MQiB`my?tl*ZpbAGR`aG3e1Er!dDo1KgQ_+Ve^1sc`cR-)$D{1o}#= zDB^V(7oVu?)LHq8wm4RI_a0nxO$W}LK1HUINT*!0%l*cQ)BWgq`OWCdXXB0QCAXdZ zw&Q$DYW8@(P(FX=TpsUTSVG{RhOcPfNABiKT@m=|)vIA`-MSTxjg4q;Z$~bdgOqX; zrQ}wNGjokM|9a%`Et|XUOl7i<{pa-P+4nvez_H`~I5$wDrjn@%xSBvzgXMA=&CSi& zwrv}FdU}=((cXUP(xq>-wY5F5V#SJ=doO6595{(knDQb!Q15VTQ+E;{_n2-1Df+5u zXl-pxY}l|NO~0QccE5LBmysuK_x*sIFB`{>npPbRcb2)#CLnJ%0#$3UabjWWo>w&r zQzQB)Fb{Uo_%bQcvUcs-q-9yI5aL(#J4N^7mF5&ZXBaqD#H$ZEMM72WK*SWFIh!_3 l?GuAE%!2h2jpBa=7y$oA!lY(&m16(^002ovPDHLkV1n2Vw8H=Z literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/crayonH.png b/eric/GUI/icons/palette/crayonH.png new file mode 100644 index 0000000000000000000000000000000000000000..b6397d2dfa90ccafb1c48dc9a4507a0fd13b8401 GIT binary patch literal 1952 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 literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/ctrl_chkbox.png b/eric/GUI/icons/palette/ctrl_chkbox.png new file mode 100644 index 0000000000000000000000000000000000000000..73c9d7cdb799adf85e9246660e3b273723a0e556 GIT binary patch literal 719 zcmV;=0x zQd=&E$RSQx$w$K8`)B`qt+jXHEX%_G3~p|~O#=@eK0fu^U09gx*n>b zYjj=5hl4Ek_TB)pg3BA5SY2Ji?z0yd)%_D2FbxC0TkX;FrioIih+Hm*Mx%lB+9fQ- zHJDaMJ8tvI4A2JVnE86MiG2PeDwXdDN1{lkR^avdYz@;o1@COY0MBzatd9)6O=U6d z?;H)4O9g!W@(H3O;=;;BG7;{tXIiIl%z$C&eV0FKH5?x1p{Oe2@nzbCN4Z!){kV?v zsT4F#gGZ81X=Mu_MmQA2W`}$$lIlhD#rJmh{vnO}?78pZM$70mDyCq--1jk;T zoq^s<_%GqgOUNFe+xNET|BB}Z<_6{lW)^=07yxX03arBLUP}M~002ovPDHLkV1g+~ BNs|Bo literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/ctrl_edit.png b/eric/GUI/icons/palette/ctrl_edit.png new file mode 100644 index 0000000000000000000000000000000000000000..eb22def02c3d21fa13627d9547815e89c0a84eab GIT binary patch literal 783 zcmV+q1MvKbP)r3L9pp$GpG{{!);|ArtUh~B&?_~YO~{R6~fJ>=NlN~x97q)y)pZ_5}q zu8EQy>cW?qd6Ufh?0d5>FI))09`aGx13!C!J%F}ulf!e}CU*SUXg1C{MacwNf*Bc> z_mKj0s)obi3mBcG1GE8za$f+N-|uIqr>8$)?gr@uvNH(9W={(Q0&F&$u~;nj71oak zWM>d|2Phto=V~&UOqgL9=j$N2#j|Y+xXb1GXP8c>%Jp_ux<8eWIMx)Wd`3dL=MdT_PD}L4h;17EcAd|_6e!nls z@dwZw&>1@IbUGrPPUGGyv_~QloWBFbyk4)U*Xy`GmLTv_@l64ave_&yUV>he&giWI z-ELQ;QYn#4CPgBV5YcE<1cO20^Z5ii*L7WJnkH(s8lK^&i|g1FK&2c$MrY*oIp`@J zgazVRtJM+|_P6-v=p4rPI7jE@av9eV`h72@b|V0VXmxUkI-<3ME+5+blxqXS4u#81 zLA+EdnfCBqBEY4>azJuWWK8=Z<@UH*t*(TfoSP}T{T+}XR%8(&6XK*&smRU^>Au|l zE7(L*By=+pQqIHDo9kw2zJ3PZw!xtar&5YsG@`Rh5SHa%H2$&brnGJUoZ_LtfF05W znJy_ZOPZs7c~dLLch%xinUz~OK@e+OIKIms^Da#+-~Vs;-vj&=U;wmt#o20#@G$@Y N002ovPDHLkV1jVBWqkku literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/ctrl_popup.png b/eric/GUI/icons/palette/ctrl_popup.png new file mode 100644 index 0000000000000000000000000000000000000000..40fb0517f150f1a2225678e12e97eb6a551ab5b2 GIT binary patch literal 633 zcmV-<0*3vGP)|!nGndlnR)Zu_j%^cuI9Qfx;Y5CJbC~J#4z2&lD>@0I@em#^Q0OW@cxnx>@`K;#S#;5cwvpAU;A*nD#= z)`w(b2-p0C)M}S7IiP7-$fS}O$)s^sK1cby0?T4pU0U?b83MotA)Z|C=I5j&gb;2< z9WGBKfP{5KJi-ks-ZPVP_N2kCS|#;esDjO!-GGQ)_+2k`gk7#e>qf5^855PQQ((9&RG{*BaH z=r06j%$DPbXFRCwAfk4;X)Fc5{Gi{UO^d&?rb zELn#Gzy*4Y-Xmwot_PqC*nq00kfyP*aeio<*7<9&QJ*x@Xx_~GG-Mn{tWxa}LV|v{ z__b-Vubb#_YQl&6>4Ln)-`?Hr&71(N>j!6|IGj-(&9bV>8Ev~Euqg~yw#V_@;%C3fh$)=?uW`8HHMWis0`ktJ}8S1oOY#J&0WJoB<74wOj!s~I`-{q<$> aC%^!jN}M^QprO_P0000{(1HoKfnJlxZ0WEwS3#&;U!1VtQgMg4I!IVFHLJK2S2khRx8?OVte*MaD z<=Rb#(^u~T9Z`#9c{78lwlaf`mO2ABH#b2CxVpMBl2s6a@U2_7{?DGb@V|Fh(*JcQ zAA)HRA0$qyStJ)kAfT$M3Ud8_5SrCp#}Mr0$Y5_{2@|JnU4ZTgc^N4N1qB7NEyqX$ nqwRrF2aGyk)Bytl00ImETliRyOljOJ00000NkvXXu0mjfF_+zo literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/ctrl_txtfield.png b/eric/GUI/icons/palette/ctrl_txtfield.png new file mode 100644 index 0000000000000000000000000000000000000000..2321570fee71e9a75cfcd7a5b65ef44ad346a96e GIT binary patch literal 847 zcmV-V1F-ywP)>7|IEq6907MKO}{hMR6kl3iUjQ3RnxDZC+N z=*#YGJ7eek>x{dryHATfv_Jg2=X~?e|9$8D|D4$s78e)sFHOWhwy=P(fUtlF@5zno zx-~fzs!H;NRR!=vso+#jNJyMc2cn`35JeHHs>0=x5gl!W<#|)!9Z(eovg=Ps1ax)U zF!$>xa!%% zj(|O&C@QJ^K0Zo`xCw%1h1_=R+QaIYspI2g-{{(g#3WoUuSB%bi1ln-Z+WcW!#@Ra zIS1zmxC3stnlJmxEZ*9c>l*4))m*Aa) za|AB|Lo_D=UUSVqz3;;G)C3M3JmiBj9wyR6JL8fao*WG0i`QcOOW-GfH6h>fCHDjf zKG;BC53DVX$Uc#a#H5Wr*HY87aPIsCOixZ=W@?f!K`Y~uD}IlmZx6T?omex$OH7~r zGuoP8qJWWX-IlD!aGcxD-Fq=IJVaxY$+Wx(uN<5sNE5nQ=L&e;VTG;TN?6T9@bYu+KO61+$cq;k}QNm1wp}us0eP{Cky|CuKW!NxD<OODQzG#)gHV3{#+}J*ex#%u=1tJ1d#>}e^<(`({l&wt@QDkbcuYc1vkF*w zZe;)GsP*QTl9pM8R<1Mo?t?g6wM$IBOIwdpfc{=52z1#SM-8*Oxa64&lgD7--= zq3*jK1eG7281unI%v}B&40)V#Zlq2CV;;M@y=Ic$WCZkWF#x83Au>H6m~ia&^>0ld zI7hKJTl1nSw8$i+jTr_(vgY`?G7;bE;G-VMRNh>D>Xc z+!bMQ1R+}}wPg>8>x6z{mdoX&PRP?f2De%4bgYO%WD|j|R36)k!Lp+ehSgfF*0WrC zfUO5y5XyakawU>AoUpy~Anr6&BC`XEd8}5e;gIn@hXCiuBUvJ*hYqB^$FXFbMA)k9 zfOi1&$X-gqToMAAV592A&r3+)2;e?ohMsQ$&I(sgkvGCd_Pq}zJtDEDzl-NJz@n&# zRlxgD!%Fo+g5`A=@Ptk|i)z0UYEX_y#8e4z{bT&E0LB1YqC<8?UvR@E7 zFqTRs`7PHtD*XvqBCl*xckB>kt4`zr-&Mt8v7ZOH1-C_)QxWC7<1YBG)6k?^#$JAq z%8D-$EZkzz(%&?8MES-lOyU7Wmb8VHnFs<7DQ#0ITs&UWxRxtnA&*9=nJAH5vGGlG yg^Kc0#HB=wARs%TQvZ3q)_4D$4x7MV0R{lm9evKiKpn3D0000Px#32;bRa{vGf6951U69E94oEQKA00(qQO+^RV3kDGj14`4n5&!@Qr%6OXR9M5+ zS8I$_)fN8sIs2S*Uvux=dxyusFn0hMiv` zZDP`-HkF9dKNU#p+o2^|n}&jbk1B{3%fo^~ff*QvnYs7u_c?d>$7KkE(6lr*=}LCa zKIiPc*06O0xNF6OtNuRe$}8C5+ODGq z(Ad=ap8+_0aWDJOsXP14;??TuWV-z;WOwJmj)DQH`Cq8;ZF%ue_@5jhp9u=M6%L9Ms$0 z^;e8+oIDgjQ&R>BW4`In9lcJIHsQf93dQEAkO3?@z-jUWi%`+@a+ zm-v*z^C+n2fKnHM@8RI5C+)WFdx%m7*-QrQQzv{nyJN=gOscSL?6|hhwySPB1OV^6 z`y!@Kn?E!J%a?z<(AU@fsF3~h7>kDO*#42%-(L&owDxiM%B)G&4+7%*6rS&bQVP$j zJt=h&cpi=%@5d9XJ8`OK0Eq;}{CP7mckY)#;P6x?eI%JFJT|U%_J&epOZ=G}m^y9Z z<<+X*naMcmQfU-im)dG%kWL0<*zh89xg>nws}0Ws^(Z__K`Djnx^Srj0tfx&3WQMb zsE3AzoXr<9gi;D)3~bfkkjXSIZ=ZTw@1R{eIN>t3N^;%bS4judMeBqyWc2tJ)Yqrs z2Oa{?gXeqjJRiRAf>N(``ZFPL90$Z97(TKdo=cHVrQrJxQOcmgh2<tjqrCB`KxT;XI-KL7$_B8(f~j9h&N z$y5O9I`CWy>JoUKi&Q#=y1F!|MpQgaj8HTqePVM)&d4FeZi&0;QG_DCBdY5K2QS1Fd6lA#w6VFZ%lW!3D#Xtsmh22iD+`mFsZ)*lB2`p-lvBA}FaLrG}6a zTnK0#TR*73Fo4;!XB*%5djUXc3l=IccE$@rK}rLqG_=+*M#GpYjvYINCsuc2^PhL& z+2^+4!#xL}wExu(qbZR2qiH z#ypN6J%w#M_M)L7i&BdX&(}-OxE}!Ex~>Fp8o-Ei7rBmuz#|x70zu#-B@*CFLP~{d z97CNcG{zX*yYv=(wC5AdoH+@-rv~t+&F|yAU7uj=*wIkNwE$qPJ!_K=K|`rH4}b+g z@&y;#D6o)&B?F|G01r7h7pTS-S{g`I3r*{UMl?0mBP=uYo+{&S`;J)vgg6eU7vS6j z4@p7*Xm4*HC=?0@&sjhKSjG&(kb^OfO31*tLdX<&s35ok;{uG;0I`rEtVmQU(h6aa zN(RJn2+=ELeb* zD_6=BCrFie`vBmDm)7Hj=U=&aQ~KnSPh#1!WdMMkJ9icDymQg= zuCDGyQ&0a4_b&b3rSXFG>(^uP;>9&a^z!q?M^~-7 zJu;OQT9;eLwlt!>?Q*~&AWniM66xQhGQ*yG_@SR}9xOHk1Kr5wMqWBG8I=3(TZ%Pn zo(2HSoBxgWa$nC<*NvA<7~h03rP3xs6Kk%U`OR(D%(%V+0DJfD#KehT`tO<1xw3ux zR?M7PV@W?*^@HrOuEW>X=j!U(+a_cJy)a*Q-t3RD00000NkvXXu0mjf-snKc literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/dottedgrid.png b/eric/GUI/icons/palette/dottedgrid.png new file mode 100644 index 0000000000000000000000000000000000000000..79557710a28d85ce7f0c8fa5c99ee359c8acd871 GIT binary patch literal 688 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 literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/exporteps.png b/eric/GUI/icons/palette/exporteps.png new file mode 100644 index 0000000000000000000000000000000000000000..669d59754052b40b43abe4dbae1fc3f57101e169 GIT binary patch literal 1451 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 literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/exportpng.png b/eric/GUI/icons/palette/exportpng.png new file mode 100644 index 0000000000000000000000000000000000000000..37f47e6b652cf0361e3d3c39cf1b046556b79254 GIT binary patch literal 1446 zcmV;X1zGxuP)$-3yn+#XD{SQE?Hz8qToe&?Ww8nlup&aq-x@(Y32|1h{8bOH)kplqS zz+trj*x^J7#jTt$5cM>`4vPGG0hzPjB@~SlroCGmZyc8fD?`olMmdoKfRo7E(JR~31()3|F^YS zm^pa>&gE}oe-kJrAvzM#Mjkp1$AMxc4h|(N#vM`tr;-O+UIJRW$i>djz_i{6saHnf z$ndt$gc;gV7<;1#LT(spAQ-pk@iE<%xr1d8>=RD?pqUnqVNB zm{$q+UN;BO)uMQ)2_+f_Qe3Rw9+`*Z1RS#rk%;G>lva2@`dq5I9zmShdFU9kNhLr= zcijN;#ZDkb2Fg|&*o9e76Al5%#f!+udbXe9ZK1Yb19#r4p=k<04b+mM!Osgf`5sXa zgftt{04G;v4lFl{HcrFH>u*-ahxWY)Bd@*zPd@V~|Nr69Z(zr^0XX{gJcEPM4I8@o zRI?aRgvn_`$;d_x@IL2x!JffKJX5gXgYCVyKC14b#Ctss+?|96H(S20qk+SrVGTHT ziIa=D8Efyq^NBY>Y~DRJJOu9^dRqYK@#b23;ES;=K4kneq9U(Imj!^IhpxujuI;yj zn(P-j2X}31zZ4rBZ)}bZ;O`&Mok&37_R?wq8KlMPzIziaq=YUk}iqdMC65nAeYyRM+2Q<^7&}u~Cjsfp>YN8M2I*?-R zptN>Y*HEJXrTj&Z(QSYED+ynHcRe3JKXv%v_dlE-!^bIZJE*Ozp^8hRYBC`18T-Wg|VuN=i|nSi!8g9soq7Qz8H;^`e>&K!$i>{LksLzfT-~ z9uLopbwzOz4#1BCp#W;gNCN3p3M*zQWR6eHjGro2&i^A~itkNKNU%JU{>!gp5nLjH z1SAKvNNNvXS2DVc=6@MELR0?NlCxT2`mX>30C>fj-b5GCQ2+n{07*qoM6N<$g5Btm AUH||9 literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/exportsvg.png b/eric/GUI/icons/palette/exportsvg.png new file mode 100644 index 0000000000000000000000000000000000000000..759bb73e4f7045c430c7f297ccb63e19b970d476 GIT binary patch literal 1431 zcmV;I1!($-P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2igoB z2p0`)(_T3M00kFGL_t(o!|j(_h*eb>$A4>|%iNrq&fF+etQ4tWf)byiATX?#u!kl= zGczFz34E%+3}1|>&>kW&kRk=0f~-)~AcM>ziwXlvCY@$R=jdF{eV=_u*0bWV5(j=8Gr_)9SYDhfv6P$0mObiu-G>Sv@y6|BLG2|q~xXuWFubK zFzw>?JC1Y#9^lUac2)p!1KiWoM>3fNAd|@ua|D6_f^nojO5j~Xg)W3;RG8!Ri5~%O z0dh71>P9%=0C5aRDM`d53gmL*#DoBqN60+jqrw#RFKmB}eQ&+X<`*{r@X^6J0 zg}6<*njZjfH2Td%D%iB;sVEhpJB3B@mPNohdLC}W&!#y$1lGpmwfHt`HPm5|Y|ufN zi&C(E?_u`uJq$98^qOd@0?-wmGv8+U%O==nE}t^_cF ziwRt`Umz@wVk&M}ycP{N2VsF?sfh1IM89ukijIb-w>+}yiEitN_0^G>Ed|on^a6km zN|p;_pbf^)<1{pbjv{D;!J!^m8e?p{6@a>=VA=A8ZT%N}w)gaOy1l*oj#c#t3NX$L z0F=Gin{S`zx}j}eG)wMGuyon2Z8EoN*T!eJJygwynh`L@7$JnV_UT1A&iy+t%ZOwn zPN{yvS&ddGEs4du&|ah*r9o+dQi4?5g0}vFzRYA#s42rL5COp1;pNj+i%Dw)p}NZ7 zgLOEqpaQr&Aj#!jPW|xex{H^78<L~Q1|_JjigN)VZ8?<|K)jZ#RRB1&gRq=rt z0ZbyJtSYBsre;<#di2uJg%gGH`772_Dr)ioS>2wA|MKhDnoF#z06A4rl#^dRr($#i lN9D^%+elTumh^Ou=|5P#qPcdE43-Y|#n4S8${ z2nQWNVI=72zG*ZU>Zau?#n=mVvmYr zDTebba-LnKxgUVX;2`)0j(~gM73hF&n4)-`4=sS_pe0n>5eT75h_sk{C%`DU0UF>I zxCCC?1%(N&xX*`b;20R=y%n*#Yv5`^=Eu1*JEl4B3&?`)V3Bcxz6^-en^ZjoZ^2z~ z2;^+hQ27h+5oCmuVg}Jpq0RC6GvFlOnQB8L;5)bu_VZqqfja!%y!be{AVk~DOglAU z$60U_JOndBWS;<^>AnIcsr)q9%XCR+ddC=`-%1L|7j;zHzw*}jvp}=M%64zdT?;(Qv2`IZ|Yrz2diHV5? z+H#dbp|HTtdYH}{F>}Kd>v+!o$`!8X6Q4I?rlzJ;qtWmxm5Ns?mFC!Ccgd~w6TSsD zeSwq4^qijR^ezX7xalb|Ol3!8#ARrpR`H-P{uUnOC zVZupOJIAYy9z fb2@ARzXccopafAD2L0+n00000NkvXXu0mjfvm~UO literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/fastback.png b/eric/GUI/icons/palette/fastback.png new file mode 100644 index 0000000000000000000000000000000000000000..42609da3108604f40330cf2cfdb3556c5f838b25 GIT binary patch literal 1647 zcmV-#29WuQP)|y&s;_oSM5juw6{};Z5G8ZO%E* zbDsBk-@cd9bsZk(V}k$lgVlfR3RuRukBW)EFBKE9d-VT;07blm_nJxIM?;|+B9<(~ z5Yxv)03T$j*j6*4q`b1;;pSiL9%TAmZV#t~1lrkqduK=E_Y6546Ec;*aX39|R`Kp{ zKHmJ9fuuGb1tQ?Dzga!8Y}1Z@urHtYySzTS`*3%2Lx`Li0pGOkK<50S z)eT((42Qm-LlKTu!jcGh$txSv*Keu*!R3=zw)eQ9_rZN&=^mDKc2+xkoBIrMo44(% zol?ANHHSaSE?Za8plC4HALPOAl*08P`t`)QD+U_z~!T3ocky8qax7sN1ZVAvpZ4|;&Hw}(8A zj-%+nCd19e>e^Ft3YRT!5F|BE*A)=ZCO6B&u!{p^PLKr-G*yn9K%|B@?>uqD%gGz$ zun4q=2RGvZ*FejMLDqqDE|HuIS$VVd>9ZGJ^7y1Yijp84)_|8}@cKnyyj%oaRiuRH z0jj?4^E3T+cVnNOg<%>UByy0M`_!hSC@BZF24vAH4}IEuq*)2I)L*G zMylXZ1Y%R5lXe+G?7giwzOGai`A(8G4N@{DL&oH3&lSJ+-nsP5yiBYVQBCe|`>Cs| zxnYYe20Adff&!66YN!c&Kqu1TJPQHO5Yu+!d}TPqt{wWlrC)C@ub zgGfqP^7Xe~JA@QC4-xxP8aYReRe_3k7$H)pAp>URFIxSr65^kgr2tj}FSu&A-Ks|U z4-o&DiAmFP@(cGOBQIm@f9@bnj3*VOj#Y+nkw~2|^@;2mi%v;`FQBPm-IA1|n#|UQ zVcX5C(Yb(-z%zg~XJ)}XdZ49~bkYzZnGgXZi6k=Jq>@_#NtHzEJ4C)m*GK1oXiAmn z^n?i{GL%LSFn*Q{^M15VYlf*fTGo_dbk~eNNJN3y_k!p<0c9vLH3lSh4jA=LkZ20V tGB5Rz!{d78PBaCv>412F9`*bszyPB-j!@*t^PB(x002ovPDHLkV1i;66*2$- literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/fastforward.png b/eric/GUI/icons/palette/fastforward.png new file mode 100644 index 0000000000000000000000000000000000000000..02f405c57f6ebe816fbfd803cd33fed9a64448b9 GIT binary patch literal 1633 zcmV-n2A=teP)wS9WMtIt!OE@yMw3jV<#-tz0( zdwIT}=llCTFUQ2=ad?^s3s3v_-#cI&7YU* zhC_WE2t5bbuj?ANUHtvjv5V)9hG~O|_;A;eoZ?w!Kbd($9xzOH7{!Y04x!=f(Y-Z& zoj3jX9z-Ex=|ZqN4j9H~WmGO-U331WrE8wSzcX;~1opdqn*#Sc+xLhPDv-i*5sE6n z8u%rP-mE<{A#Y|bzQ>A#qa9-%93J<>7M{942z@+b`C4+`QiK zmctbg1ThQ|6a$XScy-~b9mlQX^K$6DX+!9Z0+wZfG4n>qvRdX&7cG3_v*Xt6DHAjhhOr>@9AKle!V(IeGl0o#E}dJs zzP_M%>2nl%x*R7)1zM$3jNt#Kj9%?ff1)k&_OD zEShQE!mnP{uhKU0I{Ax#1aq+$ixj4f{5e= z$u|fA!8XO5Iq_`n)E8&d;YMb`@XZScuQ+>dY&7vKB1Md0L5@hvrj}M5GH|AG$)P+p zK>X2%f&maxAb_h}5*;AAdO&b=f-ulQzUOi#OC85sGU#J6j?f?V`x|Wcn`$FS#;}i` z2?+M(Ie9ZaN=|6nsotpX03@s@br1+4@C$?B9qa_pz&*^RBq;;fiO=O|XgG5uOT{mg z8=fsHtGU}{1K-dC2zu=hSCtmg{qVG=_sr<4Ar>e34@G2f3R0riZhQOi^p5uso{-sS$dwqFpg{ z9U$|&D5>BWa)aB}1}NlxB(5r5IG;OlarNP!Wc8Csqos3SHf`K~;FQA?u59hFfxYt@ zgafV?DlXuA0u&adu9Ug}{y+o7X9wZHx%qizKZ9i~w zNQhM3YO_Ia>qYWR3$@)##e)<;PECU@fLjd5-3}Wrybe$mnM9-L?A?PQ1g-e2vW5Km z+OO&y0$SE`*ACscFM#u5^GM=Ry?uf{fZzww*$qKF=5a&kMQ6``oO@BzAex+CWO!%u zm&XP@Xyu(wd!pyg-oI~Q@$Kn~j|32xd_!?u`UwHkw8{r;{nztmy=zV?9i(J*|zYUJ4Y=|KYUI zNCL_9yP|o2kTtzddsm$5K}x7!81uI?FvNz?jdB02xmK{?D&wBfif* fuE=P|KLQK@928&#jc$S800000NkvXXu0mjfL&p5$ literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/filled.png b/eric/GUI/icons/palette/filled.png new file mode 100644 index 0000000000000000000000000000000000000000..1f976f31d96b52bc9914cb179cd3ec5f8a259b2f GIT binary patch literal 1288 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 literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/fixedcircle.png b/eric/GUI/icons/palette/fixedcircle.png new file mode 100644 index 0000000000000000000000000000000000000000..697df141fa68e06b4d6f8835ad6dcdf93614c911 GIT binary patch literal 1898 zcmV-w2bK7VP)Ej7a;1e8W0K~r=pq(R`x=j024 zNVI?Ni4U%zbtNRK0R&;tX6dK~j5sy(`mSf&+>NeBOR};x6^kxP#gibNR)8$40IC{b z5JsNnfXE8K!C8UL<^T-G`*XR%k)dm22M?V;eHHCfG=P}dxDkNzso6d6?AT-#*cao` zP**Sz2GLmh>h!dHE}K&>r_ywGtf;frbk+*CHmk)7R0vLm zCSrfsKXBp{+OL3tlt?CK0l>Uz6l>bi6J`S zoJ{B9_STL@_k#-@wOj0*)vc=VYyZ?_?}785mO&^O2sA)k2LMygy!rZ5i`|X&zYh4W zbPatco%i|U2hLyg^<$eFbe5_Cz<$L&e9yZ3e^l>!LS!v>r?dIfUkAr`ed4|BMc-t+ zM;U}}jsulVnwwpZrjo&~YrdG|56&nrFUljyBFW&snpD31?d<2rC-a&8jKD}%k>Aid z-_?!AMI<~1N?jL-@agH@zj}7LR?2Oa!V(CFQ+;0!&M41e1vz{Qg|KT8|5os~%G`aY zP99T$`k@8c(r)25Z|bFsq2pb0h)$u(&+@cYVx_^k&43=iPM&_ z%?*2VctifX-g{RNn^V|73V-iEGYoikz$$V;;Mo;;4QB*0GXO@1>auKB0p+WPH&Lsc zno*ARym{!QwJqqkHG1^bmv6Hr2Tyc^#|azjczv;;t6y2I7QnI85+agT{D3txplNEe zqLe@)k@w;aN9j4=&psz4~OgyYFf z=G(T~8bmMEgaObuVt@i#320CQL1|ht-S-&)e?3096Wj!>>bp1 zAN9h6B)tZJLGOs4<MX|~ZMyl&&#nj1G+;rK+ZNR~Rm)FhIq=JOo(TqE&!K-y;Gg4a z(w`FNHCpHIZL~V;s)1g=>W+nF5_O>6G#lzjL&zrb?YFob9q9j%IqyH#_0-ajKN|kU z#o-GeB!_kvpxj?4xb_xcDX%~%6Xr5NP;OWKGMI{?+)xUeYKQ9pR2HBN=W&Wc`+_=a z`O5SW9$R7SPbc5?xcRlurQu{l1|}*tPb#@bpk9=VdNyi=S)$@%9HOu~7Rdp*SoE5U z7TN?rle6*#8_HxZr>%2SXKO1FG>o~LR2+CO1B1WEkufD}Q)5Lv9mEl^NILA>FF(1M zhK2QsOb(=F`7-`y$SeRb;E(mwI_qz6SlU)DX?&0fHZ0-UMx@ITIUt9}jCfJ;=hh}y zw;YeOM-$V5Xfkt-sF+|?2732>d?laBAF*>BXl`(9d12d{`_Z@s$8f`BB~$D-a)V0H z&%EEeb2BARZx2K!K_rN!t*iTc=K2!er7zH=rcuCSgjtQG3DaVwy*th%lw*GZ34HF zWjQHRpg+7cK5_VWM?V`T9Bo!Tu;-O07vJh$&`sr1+ofyc&4a$^MNfF@x2HY+FNkzr zW=t&?B~=R&Y;$qvLu)oQ*Eyc9u?ia;79P;NeN?6RflN{RDiY6pd*+)FKf^G3*WGt6 zT!^k3nzNcxmGykQ zwhMeqttbGyXaOuQ0-9k_d}mPTh5#xkfn~EGJe>pncsdYBq>l|xB>FA|V}7hWf76o8 zT$Exa%0R@etCrk;i_^AFsEB8gW&NgyOlE<<%Z0STT!x<|Y6jQMek4=l(GHUp~!@`+lRR k88z4E`Ty&2`n>=H0Jq`5kkZAPT>t<807*qoM6N<$f|L)IYXATM literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/fixedsegment.png b/eric/GUI/icons/palette/fixedsegment.png new file mode 100644 index 0000000000000000000000000000000000000000..a6a177a9a6fc2d661a1970ff1721123d771816f9 GIT binary patch literal 994 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 KMNUMnLSTaT#j>pc literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/grid.png b/eric/GUI/icons/palette/grid.png new file mode 100644 index 0000000000000000000000000000000000000000..2794fb169aff952eb653b1aed5ee82c4c7901980 GIT binary patch literal 818 zcmV-21I_%2P)f$M-wC@)`^l$?vQBKS)m+(DdqW`TrQ1Oj0U zgZUWSsUp=;jbk$gOlFgko|^8qyB@E9&x+@HLQxbE5Q?wF@OiJx&s8 zNSo1UG$uH=mSu^-V1Vu40tlQOdXNIOT5WcBcPDgR7u{}`_kRVv0$6|zTN}rRZw2GO zN&;R2-j>T{j}jn00p4Rf^(UnYIL5IElF_Brz9s4ZYG=D4_C@H?z?j5dEEc@aCfRN3 zk7XSjC?F4Fj^psb5`+u7h@t?G(#uMvvWD^n;ELM+_z9g6 z&`6O4xu5IJX2S_w(I6|TCnHX=VVb7M<#MCxbc$E`lCE=vE$0T4C+hXOWf+FAZClJ{ zGcg*C#C$$KNb__$E%N!iz;V{=^=^z-t0g*}j(p@D;GVG5xeIEy+hVm^31mDR4n?om z6O+m0AOhKJRul>akxV9cZmQq!3!jo`YTigwBNfs6J)*$I8i{=f4CP05*zEoPE`AJOBUy07*qoM6N<$f(rh1{{R30 literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/help_panel.png b/eric/GUI/icons/palette/help_panel.png new file mode 100644 index 0000000000000000000000000000000000000000..da1c4259714d358411aa3ba07e17918e644bd2a5 GIT binary patch literal 1261 zcmV4(1QvFV%(~s0dIk3tZXW=$W4v`hmVs5p zKr|eYI<%=7hBO{+$}%-!&;}Pz2LLO;AiNfX4+_E{klAu*JdQc4ENvN&b7vxt&CN#H ztpRBdKv@EY3joXci6{KW11Ch*JGU1;`{Bh&76M0#`P%S}g<_D5_YcODShqN*>g5YB zPaYzEM64QF8c($x5FI1H30(lb2(YXlSRT(uu_osyrp~7m@zhLqzB<-75adSg?}tYo z9ky*sMJ2SHEsd@&G3k?2UzX<rnsP(>>1tlpi_tM2cwKRVoCMvruLiwa&L#Bysv%q>f>`@w$rIUe|-x~n77+c z-WmZ-p2x`&ngS#SxVd^w7!5~6w=)nFpf?$YrECR`9p49EefpC-CROVo_^b?NMvJm! zhs#J^g^wpfph?6z51s>K)2n8bFR*MN-5n2cEZeA)!Bmgkj_gXp>=&0Io@nrfWg*ND zb*oTbxa6=Q1%jB3K1?=wkhl~)b$sSPz@O|H*wGCfPKD3UL%cT#`Beop)o5%4hyF&U zh>xNA=WFjgJC3`GR22e--_q-4jfQP*&t!j{-ZS>}scTmk)4jG|hng zN)>V|6)T<)u6_I6%oLs@Q^$J82y7;d%}O9pRtuke^Ye*l_^$m@#TZ(=Ubc&(@1CxD zAk1WP`F}3G`@xInsB==;64n|4K^|N;3&2T(K)Ia&33^C|b4rQkT%|j&IhPSB4RRSV zH~Vqwy^g62$9I00000NkvXXu0mjfMf*7u literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/hidden.png b/eric/GUI/icons/palette/hidden.png new file mode 100644 index 0000000000000000000000000000000000000000..f827bcefa9988c364d3bd9390ee3e35cb850a268 GIT binary patch literal 1503 zcmV<51t9u~P)t{epuWk* ztp^cMFiw3Z;zp_&Rh&pNs32K}jA(3p!6FJXq}jR<53(3p!mb`B3Yf7Bl0>H1mF`ux zA`22BGRXKM#EaA;4ahP?VyghTT#gJ)qtnKa2;y`&90KPD3tEZ7vU`~ECS)bzXCjuM zA@_}uNPA>r%9oyz!6DlI?CNYgjN=Yn*M;ipYKt>madZgyA)09&vI1F+w2%lKCjnAo zD&@~)70K7=1wjzt^!XvkndZ>ObuC}w^S|tN`$$bqO_Xhi#vHRE0nN-f8E!*bam*Kq zPd5C}f7Uy2F;qi_H+Qzfmaa~a7J1;x^;@88`ry+Y&7X^+cnzPANRpIbj%jcqdS3!M z*v#9J4!mzgeo^H87K$$<;#kUF%lSp``|-*B}5{Emr`F zX&)*P@me_U>Gz_LlGvdf4l>xGs+9SKmERUczC!f91e>I z4<58tDxf&g)7dc3;$b*~VVHSL!+>WtbV4etz4l%I;0M8A&>08>?A_hnwn_vTESXT2 zQ&51m`KdPQLvSbr(bz;D>Qj4Sjn7CyvkiIj>e|z7D-DXk(MEu&cckM!HJWnKvU%2EB(DY z(JyEcCVoFxQ5aGb;2!%&$72mY{&LQXd+x$9;mODR>WdrOCzm(W#V`Yo{Sg{&4ulsTl(1@!uuA}G@DUGBW5~DQIsmYr@hxO z+)_@bGlH>yTUFKDhmM?jHGDhza%=0F{C1e=A6CwSz_|-xXbOqwVOu+=2ogYNKrIu| z#Im5@FpNgz5yVZ7M<2p{ok9^2WCR7=85lsSS0W{MuU*@LBFTZRyboUrUcN68 zB%lz2MTZg2x*iSH;?>QnCK51>*Zg6Gs}sXEdFQ!*# z=B@2rufGdS1f3^EB5W*e>TH=PmBx`#b<@fuuE|*JAr_=J#nIn59 z;?b|8(HJ_RHj8ihauA(WB;o)|cp@L7Ha6=Vw-OmvaKw4;s literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/hide.png b/eric/GUI/icons/palette/hide.png new file mode 100644 index 0000000000000000000000000000000000000000..dedb617dadb77b4c0e48ca8cdf2f0d78961fc4b4 GIT binary patch literal 865 zcmV-n1D^beP)e85+kibGn8e??p^OhITZjk}lTJ&=5)3 zY%s1;2g4{KA^b={KwqqraKqnY92H(c_4OWFf-nTtyVRY6M!~95CZx*W9rexrw|q z?aYeL$X(*dpwE%&3yMWw7_BS>*nB6)!IAF0@jBy*Z{fGof#KKAaxe%Z`zlc2Y zdcACWdz%f1LreH)+-7HIhsm<6Md>hH|<57H`u?3;BwCM}BfKb^<)K^LNO~ydnt( zgRs87e(Kq1G@3lCR;&Bud_eHL$TXBRX-@c8UcLD=w@M%0zjZ3){eFKE_C}+T;}ImM z-wqS2bvQBf*S$6;_LM~My>=L9v(ueR0361pW$uMDt5vLyyTJhly5!fQ(-^t z#d;KTVF5na9K7i`UyujL9VCL>K(5m07H37%t_?*Ry*?6hnciTMO{5g+>mP(n_loV# z=cGXY(GlH`$=19ZJpw9)c}$Lv>HBP6DrX5$4TUo{yhH?>0 z_(?>e;05m@jbKS7woTgIBu&;d$zHRY+3e2lTs-facf)40vyCOtFL~kc&d!{f^PJ~A z=gh3+x-K5)lJS_=E`VJCy8x6%CnZT5-GOIIV&{W~=FK||z1SeCH(H~vSdL@4b~)!3 z(|^0G|9o7FBlC;>Dm&lko~9*m>>`}<3T!hAtCU1#ZE-tUD~3_JvXU`= zqvIf%PUd4q%*xx=fGq-3_OL6fWO+Kyct>7;I4h}s^UsC1a+%UdCSkA}TE%(BicEge zwg9kLInQ*4Db@zYotaCvZBMMwR_dwKXWgI?(PuU+jY#% ztst?qih$pTI}=O4R2dRF*d#`85t^Be;0(0v3qV%Gji^^A#vf!^umi&#$mL3yji%vK zWNwS|E4VfO;5_*SL`P_~AUpvu>MvgUvKoy%RSu%Q<+_CRhoA1R_8nlFJ38k_EK1F&Xd@s7)DQyz)@Js&|J?B^GPRC8vm41Nl_xR6IOVc?13PTpYRKDIlG_Z&#`{p0tBQ7+68 zRCNnURRClK8aTuA^SNkznstGNy`5pSw)v6InS3JZB+Qpi?mtDoY@V0NDop{{W(t=t zg-|x;xcb>7tb2{Sqz^|tj0>f|zipVdw$DEL>&Eq8V>o-^Srqan(&++@9P4K;#TsJ( zY)=3~uZ~@9^5z?@>jp`TSw8a<3oD3D#_{RpJcgd^McbYbMvf1hstIli_8K$b`StSf zS8;Iab|QQIrx*r@da*E{#B6LCufI9M+}4C`WY1XKk#9ow;ZzkD8^4F2i{SLxL+Fll zU|^^RM~_8bW;zi7HnQj7cj~{PV1czkcw&4pQOK8&%@%Ry{8KN8z^sRJ;<)UJL9^2U zRPoYbGe0DLJ0fT;1Dt-(ui{6ogeZe4L|G97#}%DoirsN*vX*x8@3~;1D#+@`hg&mz g9HEzu^`8I(0RJl@FG9aEDF6Tf07*qoM6N<$g6v>cZ2$lO literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/hour.png b/eric/GUI/icons/palette/hour.png new file mode 100644 index 0000000000000000000000000000000000000000..be6e1232dacd0b602893cc741c00e28b584797be GIT binary patch literal 1321 zcmV+^1=jkBP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L04^f{04^f|c%?sf00007bV*G`2igl2 z4<8y-0<(+&00gN?L_t(Y$CXx1Xp~17er9HOt9F|-rp8(miAk(Khb4zdJlR7Jl90Lw zF&+ZNSV9R{1RJCf&_is%TM6c;r65*{7|>Xvw6zv$H-bw+nuM4}q#N6;YuxPSceDHL zeBV4hn5-M~V|^|&%)ImdJnuX2jKHfQ0Js6X1;7J90?+^wN~w9rarmmkYrzMg8bG<< z@82P%++^FfDkvzJ>FMbijmP670Dc4z05FgL3%A>y3!tmKygWKIG-QWDA*R!5o;r1k ze!rh284ic}@Zm!qKYn~3z;6IPTuGN}g|)qTd3l#>YimmZu&k_%N+~F%P+D3_kH;eb zVDsk9kWzBz&YkQ0e*Xu_WO8315NJv!lkEUjrLD4}qT+ESwrz7IXstOj zGh?*Y84r#fJ4OH>uVmw5dwV;z))|Gyn2fjCbH{N=lG%ohG1OX{Xf#Ryj{$67Le2jD z`=@GZYD_~zgRv}&*_33%aU9ySv;3>2WeHs*&DE<{SyWWyG&eUp0Gjji@&uGp0zm77 z2M;(kHRbg8_cNVNn^g^H%{wPg@;hMJ-lIp47!HR`G#aJP=j#LTw##vx^&2*9D9_2s zf!FJmKA(?{;|L*MToIBGLOdU(#6}WjSFSAKmn2F`O0aN{M~)oXH!v`;Q3A+mY;4@M zb?a6rr9e_Fj4y7Z5HRMs5o_QNZGBV=6efu^J9z2N3 z%F1QswMfy=J^$dVpw-=7%;N?n7rBVbSNJ1$U0T5g4 z?RW0py{kJrJ9+x_X=tsvl6O){2&Ew0Zb0iLQ3xS$?b)}F$>8yFSP?Y#_;il3yj~pmz~_j;xNO*!vt_s2(fM%1s;#5PmJ-w0t+V`HqXt25`%pLar`5Q~e8M*)uyYFDxv?;NT$Q z@i-12K8!#6`vD;Nb!X?Vv3UG@DP^xQCh@wz3KxKU0Pnip?!8{GcZZbHW7~FQdU`qt fAOv7ytsljIl$x_xR!Wl100000NkvXXu0mjf1e0J@ literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/image3.png b/eric/GUI/icons/palette/image3.png new file mode 100644 index 0000000000000000000000000000000000000000..0edfb8769f5597837a39ee71cebf517b6f9ccd10 GIT binary patch literal 1852 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 literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/inter3D.png b/eric/GUI/icons/palette/inter3D.png new file mode 100644 index 0000000000000000000000000000000000000000..1484bd655bc09e545a57f73f923a5536c17775b4 GIT binary patch literal 1525 zcmV_-C~YaFz0lGZ+&*~RTl%=(+nu`{Y731UdXrzcoZNH1 z@AsYa`+cVz&j0*y|04`8ghfHY;jJ+^!eCsltb8n4AaLHsFpq!IytM|euc$~*=JTbA z9#4@(AZYC~8s}jp5dT>eMLlqUEO{T6md0+0Px#q^TQ?}?7p%W(G>h~&ACU8Xi#+rV zrymA9H#1YXKRf$}1*2h`Y{sHI*L&v;o!w6PZvnan;7n5dnzFJltQfXirqkgK{r#`2 zW@Z@ay-=)904&J$s~GB@diS&r1m0X*d(5cUzbe;iN$Kcl`LMxYqQ~8IEP=mXwhE9C zN{BbxaCl#SM!1N67l1wF0YHDE=*3gDFWD{jlQQkJr(HEs)uUDq0br62Cmk+^0Gq(7 z1RPf@N@C&?TU+0J^m0KuM?#N<0TL)g!Uuk?x^5>i$2~u)vT%AQbf-JyBewuJ0fKq= z(AZwMR92K<*WacjWi3|D68T)ii@YoOY25YnxCkP_Y$LDsgW4=U71^ZG%nD`tsYdBv zo%JAF0%Xt1Pp#Mq*{x+yGb8&~&!D;aX~<6-B9J&6LG@MLbRTLS^O(V+RN;Z5=-oL5 zH`H>?7Uk6F@3#i8zwP$8NdUeG2rQF+RRVwn4`eE;cwCTGw2j}C8i^!Ll0xN|WNwF7 zBz}tdEM1f)j4+5()Kh9z%Wzu>K5xYV@FJA`KfpsFfB+SkeHXpFRk-P3PSoY5=v^BF zZQJl4veGeyVt{^KpkvN&->E=zR_g=IBoA1Gb45;SmbT~IpeG&4+nvYB$jb12G_Dxu z^mg=eQnQoy0s=1R#0LdmwF;Undm_it3 z>RT5n-s9_*xT7mfZcd2i3G*|fQcjD|2&!4FXogJ3O)vAW%8)e}!Kvz|@5fcBLH4EOR3(HWg;9$f71?J0xCFzH6kPwYdu%p_?c5{E?k_H z&tc>3Wi+^+9(T}Tp~DEmB-PzLfjNk?_#(;=N8)RqPI~eXXxprRApU0}paPJ)@h^N_ zUqToczEzHoc{<0sj`V8>x$5xM;346Bduv zIa?Uci-`dw5jb%)&;{gJ**i(Gg0Lp7QYIP06w=l^Ep;GM0?q<%Gz2TcDhhgPC7^d*MQn^BL zH<$z~HB;8X=5e8hBsft}kZUD~tTWx+H-S{}ZPpE6CLi{%V+5$d2Ul+d5OBfewiZ7i b{}x~Xff7baQk>Dc00000NkvXXu0mjfxv$1} literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/interactiveinput.png b/eric/GUI/icons/palette/interactiveinput.png new file mode 100644 index 0000000000000000000000000000000000000000..cd0d2c7e0776c0bdfe690b130b8157aa4ffea0cc GIT binary patch literal 1338 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 b{}x~Xff7baQk>Dc00000NkvXXu0mjfxv$1} literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/js_abs.png b/eric/GUI/icons/palette/js_abs.png new file mode 100644 index 0000000000000000000000000000000000000000..cab94f511b0c804d8b9ba47b937a81681d8236e2 GIT binary patch literal 543 zcmV+)0^t3LP)LtEl{^A8CPfqRexBfzHJNZMeR z;9MN^fpyRiEZ_r&XTRJYh{GAM57M-Kk)YHjo6M|+h(i~QgInH9K&1tDxz^>qQ7nKw zoCSB_1Du08%F+bJ7-W-4h-^3P$ug*=-AL+z1e^lXbhH8amgmn(=M_dfOjwo z>e&xZq%&hpYyoRvj^)afoG_zSunl&({)tj$z#!OTa*>IO2as$Yz%w_!vV5s@0Gu(i zUU1C)7vK;qve_OhQ1JkA-NthVSfKL_YTpg6!35|8JK&U6zJcLbfWl;j-)+jU#K=dK z;svaN9_lR5uD~Sd0$a2x?rjInoTP#*bS|&8%?W7W)L5*>%3^lm{5zV%ER)Le zd1Q)Yah~PowPyKR$zjky)7d6+{mH$4(x*btDyL0?(g=ept_y8pFa3!A3GYGh(`#SW h=eqjSFLrzjFaQ}A0w+JXsto`D002ovPDHLkV1l_Hm8|bfXp9n8yl6(T@pD za!mc|Luc?IjH6Fi+fFg4QL70(Y)*O%l>?NMQuIzW%McK7gj6XA#08R1qba4#vIR19( zZZGCQfwuiO@2VW?Qd=bEDd-WfC7^|s^|EGHZv?A$G`GB3zCy$^Miy(w&ILEm}9ErhSUjn_T5ddmfM-|{zF4f8I#1d15d0!*cct;-F%#VTZr^e~5_W`S4zTkzwEF@ZJee z*E)so`BJk?X%eGbL!hk~dq+e01IY@edv%vx@9^v|F>1KJF3bA;!fUSQWjpi^T{~&b xuv9T|&Z^|8ceWmxzd20JYudr-Kfg2H_qv$&NObC=Q^0U$@O1TaS?83{1OQD%xYYmv literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/js_array.png b/eric/GUI/icons/palette/js_array.png new file mode 100644 index 0000000000000000000000000000000000000000..de5a2849cf9cbe00cd6bf065dba28927dfdd0c70 GIT binary patch literal 197 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjjKx9jP7LeL$-D$|*pj^6T^Rm@ z;DWu&Cj&(|3p^r=85p>QL70(Y)*O%l>?NMQuI#tCMFknzntsKl0fk&WT^vI^jwdH9 zFidE<^glDzjJv12R*JuCP1-f_t|JKzo!1hc+}^l@3F;14QL>Pr>mdKI;Vst0N~R(`~Uy| literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/js_asin.png b/eric/GUI/icons/palette/js_asin.png new file mode 100644 index 0000000000000000000000000000000000000000..aec6717aba4d978c3d4da253c947f7c3f39a4ec0 GIT binary patch literal 518 zcmV+h0{Q)kP)vJtC^1>+A93-*#s+4x=w#a0=L#@u^6hv(>ZN2$qOnOnb^ zb5G}-_q^}DXGUqQohUEYiTEl6_y++z^P!Z=cXNs~1%H`A9b};aiWn&8Qs$uLnSm!{ zh1?STkd-I03rMlg6>TNP*?IcgJn>VZnCgP4X%cE+0Iu1$4SQ@)z#QDbF^sdl1=UdM zhIXES7HEPrTtOAgzz(cJGt6_&1B}8Y)IvX`AO@9CVlyy{4|A7|Fbj{+!38Jb1p1&8 zmf@W3INR&c0~fHydG)e>)7)h_C#G03;{bMHk>h*ekaadYZR33_18&;qCg zx6y9yV@*#ilwqfQb#*9!4h5Ctbg2I`aMb_Fs_>`(+x0HM0Eq&9&t!dkg8%>k07*qo IM6N<$f`QKM$p8QV literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/js_atan.png b/eric/GUI/icons/palette/js_atan.png new file mode 100644 index 0000000000000000000000000000000000000000..f5b587c750e90f847739cf0685bf881cc43011cb GIT binary patch literal 509 zcmVYaEB)hsgk&67Ey&J;gpKlMGu6_y0Z^ko_~u9fBLzuF98Ms5r=5T3;Q1h00000NkvXXu0mjfZtK{b literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/js_ceil.png b/eric/GUI/icons/palette/js_ceil.png new file mode 100644 index 0000000000000000000000000000000000000000..fb3239d07869a20f7ff5fab19dc258c84edc8aad GIT binary patch literal 553 zcmV+^0@nSBP)D=bZnX*;U3EubLy~Re97L{J#U=-YBIi6>ywaX-{2F2Flq`0!@H5@BwZ? zz1aLRBi^K=G*|#_po?=!Q1IlS{qe9#^mU*Cw1RuE2zo#V=aT*pi+!gFv?Gg(kZ26_ zf*ft1;2i`}HHcG7c_9xbzyLT0Z(t8>fJcy})-&K5JQrp8UMm#*h{$F0anMa?68%0n z1{ajz1Y|%HXau9+%*i&eS%))_BCUX3N+d6(n7$Nk9&Ce4Fh_?nKLu{snuhCC*n!;7 z(s1Y4QjEF}?0{h~#0*9A5x(~dR=G|^Igp8d&;r`QGFWFf9D!4?1g* literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/js_cos.png b/eric/GUI/icons/palette/js_cos.png new file mode 100644 index 0000000000000000000000000000000000000000..4f716cf10c68a26c673221e34e962ce0fbb730c0 GIT binary patch literal 472 zcmV;}0Vn>6P)!K<&1xa+-8>)T9 z>`k3O*t}`okHG@$8^1|dRrKd@4Sn#evQ|Xe5OsSH1O`>tV7P#FWmJ^yRt+!%H?lp# ziuSA5mfqPPj{EM@cIZ-+VWY}QIb_kMAj&4vR{4edS9noJ#f>)E>)|&!qz}egFX);` zATlkPs9is+F*!_ O00007pw)p235-5uu*Ig*$QMDcYSE@B-Zwx)B8N46a11Xst>7M*hH~O`2Gnh0wr95@z!M zZ{B+|txJ+5sPd`>6<=$EwZT6y2p0`H=VpVci!`vv@UvrQH*VP#c+oD5;2qvz2nVpC zKwajS-Z2j&egV&L4sAGs7r22v*wnl^jj$kcA5{k~;TZ0q2~Y3{Exk`f^s5>ug{OM% zXN>nW$K|D{jKLv1zzM|g0iPO6^!}9=c^LyA*}f5fm4Pz`ndvFhMP6V4+bVEcmovD9 zsmyX$P}D_!g*$L9fs}i=f?ah`n5X9!{i3naYU*<@vIPwpM2gy{XKd;)x6z7f5Gw^^ z2{cUZBaKZpFIc9?frMk->!uxJb4>inz^-Jqhutdvaa4X>e+w`G5R;n%OY&nn00000 LNkvXXu0mjf$rG;x literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/js_ex.png b/eric/GUI/icons/palette/js_ex.png new file mode 100644 index 0000000000000000000000000000000000000000..800c49106d54e1fb524cb81d7c56011dee6c35bb GIT binary patch literal 521 zcmV+k0`~ohP)=A*UNK}8)D z+eO6De;^`)pi4JDRt0s^RS^6S4lWK(t`0744mt{A|A1R{5u|GUh)u5Vsc+y?k{fO8 zX5b-BLe9DOoSR!)DV6CYJJaFgKS5^_Se6yC!2!2Lj%PdV494IA=AppzCu~9&IBhLG z?a09%RA2=Z&m+(e`Lr{Tfcww~$FL69EPWvUqRG=xf-2lHc!Q<#?Sv+Vjm$zG3ee5c zh&eccRk(w)1ZD6>^S7bK7Pznrk1U5cg#p;+^)gJr64YRd_0N76F+PFI(cQoTSIicJ zO41^mIm!~1cyAbbIm2d^ZJsaJ_K)&{c{`iPX5U_bQ zo?Y#JLo1JJH-XaX>v0AapZOFd*58mIOyZlCVA~~X+4EB!UjhsOASEv!%XRMP00000 LNkvXXu0mjfNrU0| literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/js_floor.png b/eric/GUI/icons/palette/js_floor.png new file mode 100644 index 0000000000000000000000000000000000000000..b8597d6700900153c4a8f11d6b6b88bcb0aa6499 GIT binary patch literal 636 zcmV-?0)zdDP)Dv_<5? z5)>DT<;nyFF(D9Ymr&Zmm2IL$Nt+g}0*S~!KoNHaxp5_0NnjA7NN!S)B9RDm7yZz2 zUNiIh9{4=C4ux+-Y14%d^SJlUIrsZL_nt%;hTd_K@Q!)>Pw?*(_7(ji#c&m1SH5Ewgz^xAu%h`qE7UQ zCDzTFU)bZ7s=y?7i(0WvvMXX${J`%5`%)Y%$Gq>@7CN=@BLxYhw~6m!gCNaffxu_6 z>YG>-=R`R*`bfPdMTHm>S zXT-dCBc6$RQ7PVuo5-EQiZ3X>i>go5$HofkY&@~sm>`=4J1<^vC0oRzxGo07PlBEz zfYqs;y=LbH>|Ga4;x$$VQG!lvF#mT&14*xmEm0$?#C`FSy&l0%bBJ*Y-%4;xz7t*3 zOX4lX%1~5Gd`C=(YED(jn}~{f8Cze8QB*cDX9vyr-1%(^HN&6n=A4A2^Jem_XQ@k? zpdRx92TSt3Yel}u<^?1M1jypO?>xlN+2i4VitoUA<_IMWD~{WXb{t3WRRLa>fknh3orn2 WJnk=Dq%b4^0000mXeK literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/js_ln.png b/eric/GUI/icons/palette/js_ln.png new file mode 100644 index 0000000000000000000000000000000000000000..6c04e372c3f6813a1ab02b896242148f2cab3359 GIT binary patch literal 482 zcmV<80UiE{P)bu#6%#~P?k7cdZ&%!LKP6VM zpNnO2B(}u?DNNNU%qj4ycp&U8?1$nQTOC_9s|m6M>_Zz|JArxbUqxGdidk$gI20BY zu=YK!YZPyZ{J(MdhnN%Z;?^s$DJrl={u{h(Q*7+seHryQq4Bk%? zfosWWitcPN6cSjZYwCEqiT#HBcW}V23ooK>s+he$narYywj1+ikc;e#8W{E?M4Q;V z{w&J+l4Bl@dkPnNU$a{+4sCmmdIu%6rOBGIzX>D-W?9nrup9K>m~R0F Y0J8vlRSC_ZDgXcg07*qoM6N<$f~(xjegFUf literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/js_max.png b/eric/GUI/icons/palette/js_max.png new file mode 100644 index 0000000000000000000000000000000000000000..3a71af3c4f1aadafc29aa6a7b6ded2bfed393d6f GIT binary patch literal 513 zcmV+c0{;DpP){QzJ>8gewtMQ+ zdAaBOU!LbYr|bE?Z^GO%Ovqb0K{`P?fia%5x5+a9NNSh+mzb3Md@+AK_Y=GrYq~Ij zQ#|R|?iWyiTueGa?ez-m;}MmZ)^B6>{-BCp+~~LmdkR>BTO@QogKCuF1()cFkUf>A}nGaO^Br?uv?+3 zIzR)?@t_;qu#P(ns?u8}jH|0TY$;Y;UD)xD1}$c(^;j@5YTwtntvup%>+71)tNX5N zqv+RsO<^fW5D79m5BknK|J(ZToFbA=F?OPxag9#TS<#-e4-$AO!G2q$?qZ8-t;AGR zBI2}ZH0J-=J{9Xj3BJ4#K0WRy$2XyW?85%r@-4ss3d|k$X<#XDT+w;h_W$~;2_2i9jOo>lJ<~8B?yUFJ>eHmV8~3!4I+!r&HhvRDu)*OP8q3 z3=Exybo>h5!25Rsh6X{2h~hHDcLJVAbZ!+<9#tZ7-U!xtVGf*td+z0P35RV6z|x2EjJi z1VfB$1hj)yigYo%9HXA+z5_H#Fuqe?k4F385%hvXFbXcf4eLG(&S@ip2jBq=fDH!g zd(K0~0)5~Nv@q2yXr;gk=md3+z$tiPKytRoH!bLt2G9+5K@XkWu|uQ;YjiGa0c2Q? zJ&@*a8J4eTn^u6TxC2zrTYk4{a*b-wNVRX8XHQZ#S0JRLl&1N700000NkvXXu0mjfs+-?X literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/js_no.png b/eric/GUI/icons/palette/js_no.png new file mode 100644 index 0000000000000000000000000000000000000000..3ff9ff29a1ecb33724b41065ec15fdb904392f3f GIT binary patch literal 359 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjjKx9jP7LeL$-D$|*pj^6T^Rm@ z;DWu&Cj&(|3p^r=85p>QL70(Y)*O%l>?NMQuIzW%McK7vm|k_S1`0j*ba4#vIR193 zVcsDJ0oVKMbeoh}G9UGEX+HPxJLsrUG$E!{s8etHLWPMAaWdBPn;eT8d1ojr{ooOQ zdCjx8|7Kpa^1NegQ{KmSfibWD#~sG!bGCO^9GJ=SM{a3bYLRbu+R^F*%}-Y_{a`Fx zwn$8AW!P%f^_QpUCj?(KQ#v{GtoQ*538uo>UbpUf_kXac9S}BPnq=~{@Y|%?J^9yc z6Bt;6SIco|ob4;vFonb4Es$mNn;Wz3UpnUO%y(t}z?-A`G@RMbXX1K?J$v;Sb}rc@ y`hev^=$eVWnKw@@;&yo9!+5>cLiWLb=5NW2jdD}}o!JNUGJ~h9pUXO@geCybHHw4) literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/js_or.png b/eric/GUI/icons/palette/js_or.png new file mode 100644 index 0000000000000000000000000000000000000000..d9682fd9759bd2082c6c5f0fc993e4f966b3ca55 GIT binary patch literal 475 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjjKx9jP7LeL$-D$|*pj^6T^Rm@ z;DWu&Cj&(|3p^r=85p>QL70(Y)*O%l>?NMQuIzW%McH*Z!V6Cd0!@kbba4#vIR19( zes8Bhk>mE^y7MFzMLb+1_;?#XX7qTpPwP1LujL<8`@ha<%QA8@Gf%KPPI258k|(&e zqa(qYmG!62>FMvc#ccm{x6Z;v&Z1!F_X4{)#rxW|mrU7mxn|2vtA=_8ju$MPibveP z2RT1p6x!qUCVVQ_QwE`e#n z@Cxi#<=8NN_FW){2b`C(ZX?$1i!DCw}tT z9}Ld!DshZP!7AG=O87*p51w+b3DG}aAme=2xr+A|_k|l?#l};gG%ijywx40Jm2(qv>a9mg}bYFA(-jr3FGfEdM zI@fbP0l+XkKz;nCU literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/js_pi.png b/eric/GUI/icons/palette/js_pi.png new file mode 100644 index 0000000000000000000000000000000000000000..ea2c31811970662b1b2b79614be57b541c4eb0ad GIT binary patch literal 434 zcmV;j0ZsmiP)&1@)6Ml5!8WW zM}i|4A&$ibxB*w-5?q5T$Uq#q2`7T!R8gmX5=q)mmG{AED3b0Do!GM!9J;9P-21BD zd);v%grv^VNNOGngN4ETqg8anITr_E&oy%bvL^bC2orr}3wbb1^bDaq9>k_t;n_)@ z5(C@9VTri$BzDBQSjsaf%Yhl}i(SzZH{w8ChynBCEb_`ZV4RCJ(G~9^6(og!w%?y2IdBY*3=@$h?w)Be~ZIj>Hvb|12&MZx$K2qAwbq+~&-?1T$h6mgrUH zeS)y6^5c5b%G5`qSyctrhODI|I?S>IN8~Pg_XO4&W7X!fPOh?pP|!er?zicG{oAPh cd+;Z~0BLNi!u&s+f&c&j07*qoM6N<$f@Czood5s; literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/js_round.png b/eric/GUI/icons/palette/js_round.png new file mode 100644 index 0000000000000000000000000000000000000000..f0c461a5ea69c4d1c825f80ee8869d31dc923e4b GIT binary patch literal 526 zcmV+p0`dKcP) z1{*I6VqrOwvanJl7L>B2Y{eJAH?Xy4kDVecq{Jv2eI)B_M0scRLr#niiINql?=mh&goEgXq>tP?>VHv6&*#|N0 z1(}UAn1B{&f|MKMT24V5obuR*f>&k^HD#Qa78<_+NvnbZID#bP;6u0(BiZD|893oX zudo5De0T+F`LcDMTZC&4MxKAO1IUF*xaaW_gUO9oFa)=72Q^R!YtR7g@XR%En3-S9 z^?Q*OM>NkVkPP}D&Eo|aW`7#yAPcQ9&hu%mLyDyuxzT!I7cQAT2U(gKPH9PD*cnJ_J#fH<%kf3$T#IJt zgdKQz>%07*qoM6N<$f;?N|5dZ)H literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/js_sin.png b/eric/GUI/icons/palette/js_sin.png new file mode 100644 index 0000000000000000000000000000000000000000..8f053e6fbad02242ea4962e6a775ea447e777dd6 GIT binary patch literal 479 zcmV<50U-W~P)IrG=p+(_5Yc!5jn)H*XmmbGofkkNUO*HI1!0x6$`yiLGuQtnzm=OcW-~#zH~D4m zy_tLd=bSm`j_sie=G`gCHSr*>#1ivk(IYx=BK;$K zp00=!@haxUsu&Sfu^{fmkeCz~q67g^C0P+T;W=?FCd9CqC4wo|Ww9&9m~V?d(Mth* zd74&=ZvRZ2iggT6W2l0s19;xg{1C^&##E%G=TR(*XEB4optvP;XYh##M@iQfDa&p& z1dhZ$>kR}-FGGWuo)YW)Vbc-%ttWopzlC`WY>jKXzk-cyxwGSc= z6nO?1ONh>Rm14aHH0-@$JpM_*c+C`g4P?E$DDdv0pkXie@29+1MeB$2_v2H50Ra6z VtzAONw}=1$002ovPDHLkV1j_1&T{|& literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/js_sqrt.png b/eric/GUI/icons/palette/js_sqrt.png new file mode 100644 index 0000000000000000000000000000000000000000..f3bc4ff05540ed5a8bf30c28fd6c8de16c24f84b GIT binary patch literal 596 zcmV-a0;~OrP)$-<9hHKH^#X68NLqwlRV&wJyISh)3> z`{vzy&pG$}dd79#vcDXWvOgaGUqMWMj4@%25u$P=V2=axoLz};tc07cf=LP&{IX-5 zvuoFlXbEwHa&Q6Gz?HIA53&3mq(D~wmvVy!&;hP#eU`#pk9%^~Jq0lc;hs@&%x4jt z0cjsM*%*|pU>F=yK!$Ee|5lnx)=Yp?T4xELrbUMMyNmOq3T%|dxe7;TPca3?bHfq( zU*6Y(Eiez3xu*^6gB!2^y)KgHW-tS)nVMq25IEz(XRtzrQWHtA1D*m4klj=krok-* zO@Vq)2kyWiXl1&_K|l9x(1lH)${W*9*-Ak(1)P8f&CenS%SCz zqCme$vQSnjXd8@ya~{ldU1$NDG-R3XEceYy^}&hIx<;^07hF+cH{Z+pBB?03)kvszlTY^H zX6H9IGyk<=7@EI4Y#NXTqyeVlTbi|BmlEjy9ijaGA9w+-<4rVU1toDu#tSxHsP*pM zfXeP1B!s$WIZWaSO{hT&4)BHo=CF=eY+*ys-MJc-uCI82RmU&r!y0xJaD)>~tL-x; zaE)=?<3XL*YLM2rDT*k-{jh*53}OJ=*hdF;ag2V9YD$(B;;v`Wjz+h}NmFDs`crgb z9*a0f6-IEQw!_Hd0yBDkt7*0-wpjjxjp;=<$9Jel7E9>W%Wm=8aE2nf@QA(mf|`Vo z225d9BhRbDyxI)m5Iwlm!ndMZ8{uoPN!v85MXig~Nmc_2^m4Ryi@LXJW3;o}CMYBY zWYjR{b>{E?Ahy@bUO+UUl0u3}0Z|2K5(+6^VDakqi|w<}eyZg3Yx;iy9|8;jq~4KN TZ-6o900000NkvXXu0mjfgp1V; literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/js_xn.png b/eric/GUI/icons/palette/js_xn.png new file mode 100644 index 0000000000000000000000000000000000000000..b815ada8b33b4c364bf38250a9e4b19dcd2ff077 GIT binary patch literal 546 zcmV+-0^R+IP)`96|A(;f1!nijlaM`!N$U$Aoe1ng&+ni5d;;)LWv(S-tGEMco!GBcyebt z7aqdw<#uM?nb|}cW4wAU->dWbcaXS(v@a^9svit8N5s}3B06gZa_9*-2Cv{2EQ40i zP<<|Kng*_3AjU2j2TQakL5DaAGS+VlJb^XJQ{uBSXaw(BB$5LQ;F|Ua9Tvee15iPY z;<*L1L1?CL_eJATa0o(1Jp>MHfs=~d1s=dAXkp4dPEiNJ6gU?tn1N`21}d~8_5Ch# zGRT7!u*!oj!5*K@gGWZGcwpqbC;M+gl7l{Q3XVWK?L}}!Ny?Nbq?*_B4>b??Kqx{+|D_Fc1`k?PZF$m$vqnEGZ}BEU1fXtq=3SM=vD( zzMNZ9CZ&XHng>_5n}Dke;4XuhGJQc9(aaiVvRUB0lnxor9mzGRkK;K$9}*xCg@&3c zlm=1P1DePmkH_g|vw`Ju39Ho#*6THtWeL4r4}9N;G)-Z*+re}?eNy8yg;XKe`cH{) z6~Hy|WHNy;3@dVK-EOxMg7&EpkWfh_;%GRyW1@0RI-AWj`3s6Nt`=(bOu-ur25&g$ z14Re|S*HrTq9`giBYBA~juj%rUWMS9%(+*%!$q>XAz*PFg9fff$9S)hpcfdDJy_p1 z3G1Qgzm?(lV9t$z5{Yw!sfvy*{M72tYDE2hABMvrSS8uPm3I*DR$0npu|L}bLWrvD zlovvs55^-w5I__~Re2H{nO;DWu%3X$Vo{YLH7#U5pW8!67?wTeN^!~y&H}dEt+{>0 z4;DyJk~m9zHVK+GCICwih-))K0AwF1X(!b0PVEWK0+J-50#d6C5AFp>E*eQf>;Y6j zf{iG@=x%6CXS(I)st+iRtd#=^$${2SM0PWwn~Q8i09cJA#}J6Nj$|gQANAIc?=sTm zE-pZlQWL}rMH3-#6;P5Z{C3DV$C%5n895dI5GEV=uVc4=!+$T}OMn3YhBq6N8(khf P00000NkvXXu0mjf;70{L literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/lg_ar_TN.png b/eric/GUI/icons/palette/lg_ar_TN.png new file mode 100644 index 0000000000000000000000000000000000000000..d498b97f19fc03699b9f596a2c1af4d491d5b382 GIT binary patch literal 563 zcmV-30?hr1P)x7%B@p8WQyj?4i)m8AE5Kv7@1~(9&3`9hD7<38El~?BhCDKww?P7qM}Y z$;_R-J7>>4vWgG_!&C)BmVbbOqIDc1+G8{G3ppRSxr=WASmsVLnZTrBc)y#usVLS_ zr4sH7cE*Y2;yRr!l{s|RR_T}8_Ey^QaZ&boT7J*Hj>>o|Wp_+_8Q@7#%(0#`b!aXu zK##|v5P|%Dm}h5bWU~|(J+eRUQ3($dREe0oepPif?f>eLi)a|4=~ zfI2%1gTK1AvV!LJHegv$=jXq+2jl>fN#OGVwOZ?WCOzkmP8GW5@%KMdQpZNsn$j6qCCN5}sxEG+*) zz99#L%z$B-xh&W$gIY-4H~@jkN(>BdKLIWJM`pMK@pYj7?0YyY;0C6t-^@UTjO1AW zau*LX9v>hFBDp^Jk1vS+{{gzFebcaY)S1)v>&$q%Bd5AawZWJ<%r4pumg f)(3RA03g5s;@7+kaPa)e00000NkvXXu0mjfSh0o9 literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/lg_en.png b/eric/GUI/icons/palette/lg_en.png new file mode 100644 index 0000000000000000000000000000000000000000..e51963175a4b531c98543e0599a8bf94bba4a430 GIT binary patch literal 778 zcmV+l1NHogP)EhjwGmw1PP6yYoKwNZ!;r6U%L ze*q-FQ;P=`4BRN?L~0z{7$iFNAP*F=boP$%ZP0||g$BW9Wil(r>3n^61IJgaXO&_J zLxGzqH2PDu_p(bSqTiL~7af#~H)9Nnp#54Q!M&a2Wh+TbUN@%%s^n?jN z!h6jcE*0FPsqw9QK+68DWbBNgRT|0a)-J~NM#j{SIhwMPxM&4ds}0Mvh-g0vo1RxN zsoF<)*&RkKcCJ49#PK7E>`PB{-(*`&HRFB#PTgjAjd*gv$mgP)Gn+{w&z-?5G7Pb8 z!o|*046i!c*M!vbVdGE87(`M8B0CyRPy`@+`_qk-S zL=iM6`k(S=1};-{-4IN_UO*=EA@@W)f&MI6LWwZpS~|l zHPkb@MM;T9&*-R`k7J|mn_N|?CSqpf@^h2mVKr@`5g4R0cGOLy8=jgilT=KbPEUAh zA@4l`kY#6My^_zds(f}u*?3U-(mfzydjhFx8!>6yu+-HOmX$&2(;iGF%bZ%r+( z7AE?1+_UDw&8UO$Q07*qo IM6N<$f}%xgQ2+n{ literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/lg_es.png b/eric/GUI/icons/palette/lg_es.png new file mode 100644 index 0000000000000000000000000000000000000000..6791a134c69a58ff6d8cae278a6fc7599a8bfed7 GIT binary patch literal 448 zcmV;x0YCnUP)(n$DXs#xP1>YJPG`?N9z`*eDA9<$!`NQyU+cpL<28J6j3s{ilKOa2E@agbjhW~&6 zlIv=QD`;XU76?uK&%porKS(7s0Ko{!0Q?q!JpSYokdcAI0v1h#0LZMnj~N(lpI~5M zlVo79uwY=|W+7|=>mNKmKnBk)3o$&~@{!@$S0M)GYpM+2pI&G14u6m0BVqs(P8k6s zhR;>p3_3fE8E*Zb&%nW8K(gU@EnvRzfZ?ABGeh_7w+uh`wJ-==`ao91;|!u-CPEC7 zRo@wc4_{??cjPR?e@A7gd;XDc!5?5&`}-LZ!!KVwU=ZQ`$-rSK&miLQg5mbpFAQIg z12r(=kL2Ii@L2FJ^FPDKL;t|ZQIz2o11L9eGJItC0;FX@5f4pWI4uC;xA=Sj%4ooR q%Knj literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/lg_fr.png b/eric/GUI/icons/palette/lg_fr.png new file mode 100644 index 0000000000000000000000000000000000000000..68978612804204121407cc160bb81a6d4b82392f GIT binary patch literal 270 zcmeAS@N?(olHy`uVBq!ia0vp^5DSr z1<%~X^wgl##FWaylc_d9MH@U_978H@CH?vT-=0~QQJA^+;0jh2M(&=2Cr)@=y}_m? z=O)7K@Zikl?-8QX-kb@d|BK#ng%!pn$NI=0Xz;uvsdCSrtf~n?)g$=(*Vd($> literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/lg_gl.png b/eric/GUI/icons/palette/lg_gl.png new file mode 100644 index 0000000000000000000000000000000000000000..07bb18906e5b9d07ceee12fe07d72180d458e67c GIT binary patch literal 509 zcmV5jyzw?>|H9x#tXuS9UQZ?p9^ESNwxPsh@*k zndd_WL0caN4_Q9ag9xij;!ZL!{QJ&urjVDxr2jKe0O&JYR&XiMFCd>2F7@u` zABMR74;Y-c++w)%=_h#>{9j`ZbU70PI~zC*!2ES?$_&!ntZ+5^o_%J}TXT)HNG1e8 zNxJ6rGlnTwUm*n3O>h(yv@DB8>w^Ka03g5sk0spBZ88e_00000NkvXXu0mjfo3P&k literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/lg_it.png b/eric/GUI/icons/palette/lg_it.png new file mode 100644 index 0000000000000000000000000000000000000000..b182629594a7fb298096e7e19ff750ea763ecafc GIT binary patch literal 190 zcmeAS@N?(olHy`uVBq!ia0vp^5DSr z1<%~X^wgl##FWaylc_d9MG2lRjv*DdlK%YvZ_ljDD9qe@a0M$1BX`fi6DK^b-e6Oc za}(iqNH{g~W`tn-C?NO*PA@<{XrgGv+8-YA2tg9#fN1j8O) mSf!IBv-Tp}9i|2bW(Ecm8MR84WyL_d7(8A5T-G@yGywoB`aW|2 literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/lg_nl.png b/eric/GUI/icons/palette/lg_nl.png new file mode 100644 index 0000000000000000000000000000000000000000..19b73688618a9de759f69ffa5210b6452ee75e23 GIT binary patch literal 231 zcmeAS@N?(olHy`uVBq!ia0vp^5}1{rUgjo>`Ysn7Q}h z3RV_I?w*4uPIz3s!KNnXCc^FTpz6NJDv5QGQ<`5gXGIqMIzBy7?Bs$I2@TJl{lCI6 z+bs7NzbSXly9_sFyTy$Mj;J1&P}8$>o7i|iE?(L}KB1U#X@g+c!wai)l4RCiWV^%E bz`)EPHM#76l%J^q&=Cxtu6{1-oD!M<{WnnX literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/lg_no.png b/eric/GUI/icons/palette/lg_no.png new file mode 100644 index 0000000000000000000000000000000000000000..bc8b2c9ca877240387db0f245fde73820e0f603b GIT binary patch literal 459 zcmV;+0W|)JP)4!!B} zUhY2cd*62nd7g)H4w?e~4}ggNl*IO>7~s_~g82-Q{|3dNxhg9O-iY!h{T4am&$6}S$pg+-vz;G3M(QQ;%{ zQRgrZxgL~{YbaN1zi*+teLi3u3L+ku=ch2wPJ+3t=RwR+<>E53_+w`~*#pPL)4Y~! zvfX}1=iw1>9CVuZfMuaDvdQz+HIU8n0j!H!g?ut#C{dON_kbv#%Vd~5nSV5b01~C| z0se)7%NF?efm0<$dOe&=G4+%A7ES*L69aq-FaSji!XYL@^BMpE002ovPDHLkV1l&9 B%4Prn literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/lg_pl.png b/eric/GUI/icons/palette/lg_pl.png new file mode 100644 index 0000000000000000000000000000000000000000..078926338b499534402b56e6ae7d16a0665dcbe3 GIT binary patch literal 175 zcmeAS@N?(olHy`uVBq!ia0vp^5DSr z1<%~X^wgl##FWaylc_d9MS-3!jv*DdlK%YvZ_ljDD9qe@a0M$1BX`fi6DK^b-e6Oc za}(iS&=g`Q^Ww%u54oO|94z-t{1PiJ8&sNfxalewh9B-?kDBV*v)J@jLo|ax0z*@q Wg!*=G`P)HhMQFrd?x$1jKG#0<)@;rI&d48Yg`F?-*9MN?hwG0k5j(sW2T~z?7V6v5zO=P?7XiQ)!qCuIfLugY) za#_Twi=b|iFPW^O$@vgd`-T1_=%Ik_y<>P370!AaY~D^hxD_;Lc5ocZ?!0W7S~BSx zK}e>!XqBNnsgR#l#F8&K8kEu8C*pM|g)jSapQ_)1o`qZ{DLhgm1c5SFkW$m=^*11$ zNQ2L8zfk)s9+>56F5;+;`BmRKiZ!IJ_Hy5Ym~4otDIS700000NkvXX Hu0mjfYoq>V literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/lg_pt_BR.png b/eric/GUI/icons/palette/lg_pt_BR.png new file mode 100644 index 0000000000000000000000000000000000000000..c4c60bafef106a9982af418ab53ebc461b694056 GIT binary patch literal 684 zcmV;d0#p5oP)rTde1h&H8yvVbmI%(vvJP%eV+Gyp6`2(qU$>A87k`>8w6`c#mXN=QU0mh za(I+H0wW#-{Y4YfvNXAvB&|Xz4c>CVU)Vve4<3GK&AXG3zLN6WR13}Z(62$qC@jUH z%4B5Z3J|e3#hk?@`a4nr924Z7R%qKR0FeePGdhO^aaY|eo%73t7PACqr3?>NhbG`@ zNjkF?t~Eec{}C?VyC6p*1(hmZZ;+=KpU@ZmN&6TqN+(veOaepeI$1Z|a99XNBS(4s z{wys%J2s0#&pVZY0WY2I5n4~bVZRw(%)+xdk!&pjL+_>x#zn0?+ z1=Ec6HnMxWnrT-T(_cylJ>MX%Wmm~Tvq{x=zr&>v1Sa9mi2$zZA*r@X_)OH)Tk*KV zY;y(~mX5EFi%+sQ{2MH4c9kSBrp+NFBckbTNxu0dL05A-_m2l~Mm0`04)XkJ8{_r~ z&JV(CseX$&J0E&3zpP{GkS9rzpl<;_YfJc!b@TC5H&Ze24U74rzcKrEQz2+k0$ut^ znesOnUe5{G6_Mef4BJFhj-?=)bD61CgO)OB1q8~<2WP$BMasq(?Y|TJ5nuo-0m2&p SB1p;r0000Gab>Sw>mYEz zL@qW%k3{8=nV?M&SrFC2DKtD42B#ug#9%a;Os|7_7=d-LUWe#Y5EE|D<1h>kK9J%~ zWD4*s!ZGMeIhmm%S@z;Oo!{@*`VCq^EYu+whN&ESeTrg{B9-zo6-eQw2}2A7E72n7 zl{tY2RYodb@X2OKQTiwZkC!AL6Z6twqLh^B0+d&WXknelqsBF0Ey-Ez6B*C6ma)%hIz;d^P@&W^3fACAbs#2GZ!+3o1hK=Z2AiEg36mZ+I$%3y z9Kt$zNv3$3Rh_C>?gKOT=t}85b^EyKmBZt)VR>a%L}e&WrLFM;z;KI`uw)0?Z>~R6{XHD>!J5t!XXmC} zdf?nw9+@2fe(x3EmHB~)suR^)UPvAj;trj%eH{7ePETy&L98S#WPH*dO;djK{F1A8 z-|MZFHV31I^W9PY^8PTe>Yv>cPmbGXr-lQ-Jn>EykyVmoOISq80L-BnkgwsC_ya;rB8 ze6td$Iu*BK-~E_RPIg=le0amH$y;j~-Fv?0#p;M0#CqKGM zAhk6+T`_H=iu%IV%{p|9>KR|Z_S~QGxl39uht5pO?btTkau1lbD?Nx4b90-6KaIS` zRPSFH8B$x@cx+wocTt;;u1sj~wRUCR1-%)mxvj3M@K=JJ+)ER+g*%dt{1*Fm0`_s! zwVtS>J^I!oz2;4Cx!Bfeh4<=yG~V!qMIR#*I^&!T!PVZH_|Lx`dEv4c0<>M!tU~?T zkcP37!!Nk`^=@~#MU2ucOMvSZw12&S=hj!FrM8aW$6o)T(eCdL>yN+fDjx>aCTjYp S9N4{C{XIMFbBKCtUgdw5>peRF literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/lg_sl.png b/eric/GUI/icons/palette/lg_sl.png new file mode 100644 index 0000000000000000000000000000000000000000..469676197f8248f96e4b741427edcfcecab8209e GIT binary patch literal 304 zcmV-00nh%4P)b}*IQbYJ zp1;cQ>n{@n3p*bJ!#@Vb z4Gka`#Ta5N#N5%ch;Xik6%Vv3ix@|1v;nsOAiw}MF>v)CY8I^k0000DSr z1<%~X^wgl##FWaylc_d9MUy;T978H@CH?vT-=0~QQJA^+;0jh2M(&=2Cr(t%oyEp1 z+^^Qfs<5Hrc_nX7*WRn^8eXp5UeaM?bM5X2wl@9;leqsS?n;Z)aas3D$MNvprFy-~ zlrAODW{ir7sV}cL?D00+xBI+o%8k+)41Yf{>PRMeYyO`u>HNt{WaG+==NVc`at4RA mWTK|J_AEBN)ey}fkif8Tel|zPy}uy8F?hQAxvXt6ZZXZz; z6($pMCd5}5kc<7kvb)tGNp`49hU9J#|II+UEk>RlYvaYqmm|qvmwFkZyX?$4*e#des(`&>b1uB154ucy&w=?!jd#&cIT+$D h65}83<^~@E3;^cfd*h8)=34*&002ovPDHLkV1jI|qcZ>i literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/line.png b/eric/GUI/icons/palette/line.png new file mode 100644 index 0000000000000000000000000000000000000000..b5413128ec4f20325cf4c2badaec30bb6bed5888 GIT binary patch literal 1068 zcmV+{1k?M8P)7JEqQP4;}b3=bkyk@0{;^-~XOL8HPdr z>xTXV-ZCb(iC~sRyt;YP3w)ALIJSv!ht}MbkTVCRA5}?+7CejCvCV+vK;q%DJ28gx ztD2#BjJdQ2Re&*HAlHpLV+`(24CFjnnU|3<2Rge&fZaL!86gWp_J-^>k98_~keYXmNbi=&YUP)LRxo7X z!`WwhRRPY1o$au2Umq{CxP^$_d_&*u`@ZcOX3&nx3Q7v&F;RP00YR z1oIbo<+rYv5oa=ZT=Z$zxTwg-lkLsX#g%nPnK&AD2O z07{VJ%hsIDZGS}fP-U(LhMRLXz0eu|tzp(m48!nq)|}1J#a#wL6yH|Y3Kv=cSKlOo zW6svI17#po55dOuz%3WBRNr~&IadN5Nk6O3rkN9RHk&RGW_b9qaOc>V*bGIB;^Nze z8pKs56a3L&Yt8X-WqTiVHple;)c*>#RqCir%H8_`gKTy51kjg zxQBy@4Dj??0L~vDXd48-(LlIiJ)!3>fOwdieFUe;lESQVpCL`#_%Fjug4U$&w=fUR zT=ceNy-*oq^4k8o&aO^!jQT2HG|gT!(9{gvnPrlhEMya$YwZ18;zb7Kpa`}D^!PVL$V7)B#}HdwsPOtxhBTJP~(pW7|H mQM7JEqQP4;}b3=bkyk@0{;^-~XOL8HPdr z>xTXV-ZCb(iC~sRyt;YP3w)ALIJSv!ht}MbkTVCRA5}?+7CejCvCV+vK;q%DJ28gx ztD2#BjJdQ2Re&*HAlHpLV+`(24CFjnnU|3<2Rge&fZaL!86gWp_J-^>k98_~keYXmNbi=&YUP)LRxo7X z!`WwhRRPY1o$au2Umq{CxP^$_d_&*u`@ZcOX3&nx3Q7v&F;RP00YR z1oIbo<+rYv5oa=ZT=Z$zxTwg-lkLsX#g%nPnK&AD2O z07{VJ%hsIDZGS}fP-U(LhMRLXz0eu|tzp(m48!nq)|}1J#a#wL6yH|Y3Kv=cSKlOo zW6svI17#po55dOuz%3WBRNr~&IadN5Nk6O3rkN9RHk&RGW_b9qaOc>V*bGIB;^Nze z8pKs56a3L&Yt8X-WqTiVHple;)c*>#RqCir%H8_`gKTy51kjg zxQBy@4Dj??0L~vDXd48-(LlIiJ)!3>fOwdieFUe;lESQVpCL`#_%Fjug4U$&w=fUR zT=ceNy-*oq^4k8o&aO^!jQT2HG|gT!(9{gvnPrlhEMya$YwZ18;zb7Kpa`}D^!PVL$V7)B#}HdwsPOtxhBTJP~(pW7|H mQMVXS4H~}}r1#yVP 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 XA~|ur>-*y300000NkvXXu0mjf`Fbb zB|nNW@A}^HeL8b`h>eAJ>r-#;J#)|Zo_o%DGp;el`O6V;{&<7}LII(GP(V~qxETJU zm`=A#6VNt=z4MvPSHqR|+{}{2=(s|F2U7H5l)bde5G!o_Lz#>{lmP3r8uU|u!1eA@^dBF1qs^Rf&tJYBC-ccDJ*7v z>MC$WW%Pn^insw?U=VDA5zqm~xRD*XJe7^WD7Xhh;DU#U^O|BJ$DAMme!|qz`7)RR z^_-soYv2$x3IRFX?-cBSYkqzK59CbbR&W`LF%6DHVkJ1=P3KnJmJl3KQ4A{QZyS+c zZVr_{fk$F9_ykOX4TgAL*uRRqPO4{{6D?p-R8nRiV7xl=O6VO=M9>oYfG#Q5<-AUC*-^dETCuDKqc+nC=BN{zZv;59Tc!{Fo1f+S1@x1l nUsi7TzaSJ43i$T|-UJu`9@W^j5K0%V00000NkvXXu0mjf;5r*$ literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/macro.png b/eric/GUI/icons/palette/macro.png new file mode 100644 index 0000000000000000000000000000000000000000..545ed588fb19ddef8c58beffb7666d8dda204c5e GIT binary patch literal 986 zcmV<0110>4P)RCwC#S51fb53vm%o{*k>Y zF`F!+1mn(b{+#WqdR9%QL(}%GY(V$m6ns?i>eYK+f3Lc#8;FSQWJ9*YZAf59U`Sxt zppQX~{);_u19M}e?>;)xHV?I$^N!g4X`}UEGo=TbjWho?0qzjBIRq&(QO8+l7YW`6 zv1JlNQLUT7z$W_WIVGWNF;vW;o^gaY;w;%J*!ybA5!!ouYd-=z=6sc*eP6Dwedopx zPqdE#u!GkBtTFVyT`|+EAF)ME^o_0KJ1&O3_&%}YXHTuJtrZpUETqF|=(WyynzQYjY`-oz9<+0BdkCLOJ1GU9vGY@&z!lqn zY)u`G@FsGc2Y~0xCGc{LM}SSP7g9lNyyne@Xzr1uPx)YaYMorUc>Iqm*NzJ?KM1Dp zbv7Sq4oQD@;>_$kq`_9OtY)q&BtRfExWd+^Rv#4k0bo(V~%ZcRXH0(7>Vt0>H-@R?#K z&v#ZMQ0<6iY;kq{oGY^+bry}9sv^(>W>>)mK+klSW0vido1H!}&dOYjB6lWn)bX(m$6s;f>vTS+d3knvD*l zue=DKgg?!)1cq@0tgf*gg^(&@6GDqU>iU-yavvA$OLE}AUC~Rv-7A{dy10J8$bZ*tjUe&X1dTn&RmExh{UumHs7}#w@Cbtt&xr zR5s$>A_+P&33~y)?dYST7Az&r__;8R9>dsYSPOb{U;o-&zvRiM{Uk_(dU)8Y1s|MP zx%NW&BpfTgiUUqR=-W-fCr7TJDU5Sp*SlJ6_WK-EEP?79un-&u5TL?hDv_lsRSQI@ z>fv$%rj&Hh*pw1di5x2_nG-MtB7Y;0RUDa6k-RD?t55?!4?HAl0LN>C{0O=O|5B3(Z&)) z5X6>ZnkWcLsZ~^H+6Yo5FDh+QLk$rtNr%=S*goO`6@dX|XREILw_h z_sscb&Y5p!G|oA0XVGz+%MySk080Rjg_N46_1tPlf^W7K>bOco>EWt44&$~t!&Bh_ z9veT)RUd9dirE;&P&;-CoF(B{aj^6RtmNPSPY9^kW(1CK&h50UZ7V8tQ$+_8q0^{R zl3V0O0iYR+se?OANJaoL#fqd0IfZgcN$paSn+xg1Z+aFC&pUvM00=?jVob8*0tC0O z+B9lVEzhaZ_5RP%fuS%~R(jFi`OHe8vs9l)fw6_1Os}HbkR|^ClVM1}aZKUNfXiJm z-?&|QsLO>c8~81Z*1b<6l?u^sl|okRZ0g;j`h5zBOW7A+0hfC@P*MS1_dqwi zVkP|ZW9{DAbS@DL`q8qzFT|LQy8;2sOj}r9c|Z2=J~?DDjFNbM9 zBHV~McntLRjpFcup7FMhtpODZMj#3TprvnYIfWC)nrO;G3=yv!02%iq$Dgg*?dc0` zN>?KuGtvFgPcZZdTzVX~Qx4|%5v*AQ#w=8=7)D#iwnv3ssSr~MGp@ByUursrQy=ez z44H1^Q#dtBOw*P#C+F)P)=|6mA=Et>#PF|w;P;_1{BmIgWo4_fc3zbOCCc6^d=|_m zDa9Kbx4fg~t>7vb}` zk$s3)4<7fSwohM~n7&6YF_jFv z8RD8QP^WWm)~edx_ENx4qQ(;fS}`M%dLaIxh` zw_eC|o$cRb``6O{%C1Dtbumvfbr$GqKYP_7Lk#En{P^j?k+FZ_Usi_gdtQD*#XGy~ zNp%*aRol@P`!>uw4c$sglw_GsQ~8nwke_@q0qIEAZsu{i(0xFOI}d=R5{_l>1L{s9 zsaCt$*YS1Uh)A4;ZbaIxe4ZD%6LMa_(SHIA00Mc50LX~p(f|Me07*qoM6N<$f<8`X AC+VO2^1VqR_$Bf4f% zT85Bt-0dXssKFe@``h~_XQ?U)_2G$Ox3j}}S!z8NiTTeD&*Ms~075-5I^c$cgP4Qc z;pSIIS3v@vAnR{c5vU|C7=oYMqcg3sK*B-H+1@O%4`QFv1mNJM*^y2gDKV3YWI4h5 z${3;RhnK+O%5I7sZWNI)G2=OBuzhku#KGHarNw1Ge(zmgk0!}9Q$(V6Qfy=5(%0`t zt}ZWqcbhmvC;NM-+hwQX!VWihIPyUM{Wa96+sOd%R=a~5C(>-qi3@YLrs8v~p})ih zQ&1jjB?J&89C!O``iUCMVLUT&k(Em+ahabQboaR0ONz^C_}IS@y^KSBLz$7Yjan0+ z;xaexb3?*G%)#w&^X-G{AOTNsaBvnDIJ|&BrIN`D+n?f+UxvahnMn7-O3PpXm_2`q zizxVy2SmFUezStAC?mzvO{qxt!Ud+1xKz`Y3w19t0wYa8q z$Ow!q0io_iMqsKTP*Z`C{uYRIFSQ1jmSU`+gZ&m@0JMyiTad(8H2?qr07*qoM6N<$ Ef>!rO-v9sr literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/midpoint3D.png b/eric/GUI/icons/palette/midpoint3D.png new file mode 100644 index 0000000000000000000000000000000000000000..4af0ac90543884efef5dd28fe1b12c0100c788f2 GIT binary patch literal 714 zcmV;*0yX`KP)V9vFkzAn@bc*Bvy?1;8}O zWbYNAAR;bt7n}U$)5ooDUAcIhrnvwV)s{}~3ZMiBigQq~gM5DP#?_@j%kKl_zmnwu zLWRqJP~=0@FhL7DHc)~C#W_^%Um*So#J@;(0Lb8psjf0SoNQ^#%)nIs??2=3zyH=f zc=d5^>#CzqpoafLa|AOK!_wS8s5;ULBADd@+#Fa7m$P?Ys88B_`XP|{2h9;ULyP2s z2;_4Rt!Zk-Ag!nl7JGXCCd2j9#~4(l1i^(1)bM|>=s>a*1CW{x8NtC01R%@#1ckvE z<`6D+R)3_pW+cWyk{tkwbDV|Ce@Nj1HJ2t1U;rgJSg?P3{}zlvY!LYH^~VmHHb_8) zOLdsFf|`^N*1~1Qk!x1l&)mHY%HN=D1~mI0wH*L1T=INP6+j6N6z8B|2l;&Or3Xua zmfwe24hpRQL>P|Z076*?DcbNBF38!CXa^9}dVysvLWK*lmct!DZ0iN)Gn8C`qbMf1 zQA$kf1y;ZiDqKhbOr*44NGV`Qb^tN07g7osQXN24>xE`LBVt=Gq!ciuI)JFw3n>K* wIS!y|0Yh?KKuqg}+Ln`C6#u6|3l<>20JI2}WkRL{4FCWD07*qoM6N<$g8XPMng9R* literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/moins.gif b/eric/GUI/icons/palette/moins.gif new file mode 100644 index 0000000000000000000000000000000000000000..95f1c33c60e993131c312fe1a462b053a8c9c814 GIT binary patch literal 45 qcmZ?wbhEHb+?9vU10+8oc}|{v80RRsz~MoTT#?W-ylHT}GBCw(YJ?+W13gI& zy~OL+NWS@?!TbF&@L-^blGxBS??DjHlg!dMzBo7uTuU(oRp3sRHJ%;gFXRPZo%Ptx z6T^Hlu~9>MI3H)oI%s0dXKo8g^L-H+GyY1V#wzpvf#j;_a*T`zePm=nlTj#iK=iM_ zJkIx0^i@HP@6fsEI6Y;C{;o(B%#B-xi#jV#fb-LLvf{w?3|qOXRs?en;0e4;I^Xcf zrlC2gjplt{GjX!vU$mFeF(xpP)sdbGfHSdNS8yq90Y~p}oKJ9g(?DhGR@Ip>!@B=m zW-N~^@y|Gu4iVA>HqI7!s@{XjF;H}|m;%a6=Z5b10hWvK!Tdx*w(lmF)5XU``R{IW zj2D<>L9#Lf6)IVFZ5NyMqtWH{Kza5c&BnKn=+ADd-;3eCPKB=NG7?IZ|z4GG+S?i>?R9_6P)}Zp<>mL8NgNPp0B!vgAnMhguKIa}isgQxHx&Q*y3eu0~ zSCSx5Km|2_gqV;Zg?G1=OjV#KuHncngE~k&MDbK) zComq*`MMG`C#Rh1!*ztumhCdDLgdyxQC~POeU;nr=@*{5XEBK7rsACmg*7u;6Yv2f zNAt){75#{2&#A=Y8(PuO7@^4TUn90vMBlY>ob4XKRHi_Ms`@FBtjU5+C&*60{mAl^ zRYZ4T<~gOkeGW7^bx5cHzeR6rt-M?6If9uPx8PEtEnCxwP1_eD8Z+S$hmziVg;Q7! zO%cqQUybBg4k;2zqCxeNBInYk!dWe)g?7^m&N|$D@v*19_&KK+C);jE&@wPUR7xmd$5furkYDL01Zg zR8Bs9;bOYQgh?}^uAChDAoJPMR)y6Y8qr+SiKX+lKvPVNWd_i5vx_F?u&>!t-+_+# z&q9HTOm+kx-#&&*Ny z0tJkXW>LsHWe`-DJQ%KcM-K!u(l1ZeQ@#V@Mbl6YP#$$(QIslI=CiJ$3LSGliK9o} z!%I6pg7W+Eap21ltmDy;@bM{48Cd z259ilQ8fjz2Gdv238_M}x9C_nd+qnwu=Y!M|GjP;KKy4a?^uCnwyng`3qL|E(uD8- z@Y`6vq5~5X6WF(JADEscFh>cDN-WUuGBs4!2mHk~Qwx;jgVX|XwsY4mC|aRYubBFI zxJp|csnVH6g9Dy|HS61C@4^u_YAffXqwQHl!ZE~CH*x;jyRe8IPtaAUat>CtZ%4?C zVK{LESNe`1XQjxwj!Y_t3ukUoN=th$6}PPXly}IQsQfa7l4h^Gx}BDZ2P5o$P7kWT zk@Yv-mRR^$6DlGmjo3;50wPo65jNLz2)tgN1M<5dAe<{iGyI_=_d$JQC2n0G#mG>y z6n*I`G~rH)4UDkMTaf-uHLDsJfgJ`Vt}E)Hvz};5DEui7y*h- z@yD?=tkUwA&TTrseKU#iL=H8LQA}p?80t^>9mVdhX+tsi9WCUZQA2cND$127kqCZ~ zcKN#UmLlq>@|24`2|NnFPr~&*- afB^s#tFeTNds7tv0000VGd(JLVhR$s?Xv7mS&V%FdPvi z2DjdO!fU`1z@N|O`S$iU-`w2fYinyf7!2~|mdb!8r;kvGKSin4)OyV3qTDW}@ zw|T}8P>A_cOh!px0-n=EZomt$g@-~RPL^z7a%ewcACo5%3A}$x&wI#~8=<@p#;d8~0H_5(>*4K_g|XI4-bffWXnw(SYof+_Ee{ zzniD$?Fk4Z1~5V)i^S65;h~s(Rah@p@_tPi$T5z99RwwGO9{bqLwIxDD$T=lNRu9L zXiF(%k&{|XhE)qo=O1c&qdrXPq~CL#6gc45@PtL- s#vb9MX`V6fa~_ap{|*0p0)GV<0OTaWHa@XsQUCw|07*qoM6N<$f)|#B!vFvP literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/nail.png b/eric/GUI/icons/palette/nail.png new file mode 100644 index 0000000000000000000000000000000000000000..5db5bafb00b05759bc6d43b088379336b4fb423e GIT binary patch literal 1303 zcmV+y1?c*TP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2igl2 z4mBkE$_O|B00fswL_t(o!|j)CY*SSj$N$eQYhmlgURuR5ECND=NnDV)Fx&_sm>4nQ zKtgot$PA0lgcuWIbecK&&>0m_!h{UOsOVZCb}+@4LG9Sa?6wXFL$)MGn#hFe#!UJ_RR-~$p4=K z9R23R#|}r&+k?X+02EM%D}9R=Xg6-#w%I&gfLT-d=;EKY@T!Y-EzR~$Ed)Ri1b`Vs zBmS^U4R#{{?Q{Wz$zGZ*RbXbdrLy)`cfUtV0x|KZa0CEMUY}3X>F7%QR{+wUOve5L zUstF*Ft^7}9{ z=)wuZ4=-+9zoF9a_a_2?$z-}WfbQObO{8EBBwcXx5fPgIYJkJh0ndO7E$yvOq^GA} z&dkjGJU%`?4geY(o2CaK%F;68yJ$Ze!LGh;^!0V4%h>@z0EmbrNkT?>Hz1>6`9^)ADDvA&cqM^)LP4-nk_(9gXif00NYPfC|f5o~Mnmoi?4M)YP<{TCEnMC0@=;{c$h zwmx_c6df~Mw%>3jk}#$Lb6{odtZLZzC6h;S8FJ+|WY?c1I|7!<%@EP3B{^+ujTV90@^9aW!D zHJb&`ZhCHkUa#+%Y(I@g;{zonCBK=?=H(F)ksPOqrx=X}>d3j66CTAXm6BF0eelEk zG;tqn*}8dR5*F+&@(y@Llwpc63=Z_8?DsQ>iBWd!%*swn-?F87s;!lqoBLElL&K4} zy1IC^I+``w`zbnBgUF~D?z-u?Ra#OUvwQb$==J)sL8pKE70eu!_ff&gr(f7=U%hH= zUG97DlqQnUa#?T)cQOCnc?x6IZV0MGr6G{QUfbLC=Doo?d7)aUuKV zE-WlWc6K%j3JUgAS69ELR4T5|o~3fm*Xc&Gva(*)>2%`E#bl;t>TgHt`zI$DM`Hj0 N002ovPDHLkV1m`jWZeJ& literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/new.png b/eric/GUI/icons/palette/new.png new file mode 100644 index 0000000000000000000000000000000000000000..27ff51945a473c523a757b73c0efe256135123a3 GIT binary patch literal 1145 zcmV-<1cv*GP)7Zj)0UsapewN zI1mVtNFqQan?%aSn|185=c8wus-7NY)_A-&8)*;F^3$|uy1QOi)vKN{q?9$pvD)CoTxD~EYILn_oZAhtL+8G*{G$**!urG0;z^z(A1PTq=)qY8?t`> z>SUPT2*MhIsDhE-!JgmUH~7O(zS*Els1Y&$rAe^IW}$apBLcG6(p1PK8p`S5h8%5w zD+jl~kUZwgPe0&ErwJzr4T8fSo458X%mvB0&pT-{MH=lP37=SD?wiM+pu~JtDN*CRHF9VZrs=}8J=#w@ioLiB(cTmk$BUa8@8nStd=D7H0>o zk`SRW8LtqL7G7H4DAp1ym*c$ZxWs8F)$Vz&)O{U%J~IfkzG*2!w%dc#c?;cCT%8MZYl3-jsZKK4r9wflBL(%gjatB^-dpu{krvwRzt0ExJ zb3m|RD!<`w#+d$dtTXSVB*8A4>zCoRPQ!3&Sx9)>-Pa+a5h?c+{K5No>&MQX)Td>v z3)6B0SOFp!=>9~>&dBwy^5Rbj|91?xo3PjVXmnmfwS5l$&QBQa+)y$;b@AF}nIi1+ z%*#qAS2lHn^vwmypk(7pm=9C=!N)4ePsBsWa1WKn%NRYmi3thl%*AVOFDl84JfPg9 z%j(SS=pTb!ig4$|0B>xzAtN7QIK`PaKYE9c6v9NiUliT1#5C^}&d37k>I`lbvv`T) z-55Un;rq3XE0^?Hzy!wn$|RCvJt!lP7ZEn30d}%YP{%=(|K<{i@p_%|NPhS-vSH(D`FHKE9D@X00000 LNkvXXu0mjfAcG;< literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/newmacro.png b/eric/GUI/icons/palette/newmacro.png new file mode 100644 index 0000000000000000000000000000000000000000..3d6da156a3d6e8932948a4de424e0b7421cc5368 GIT binary patch literal 1563 zcmV+$2ITpPP)lke#Ax-SEm z6qgGvWn=>zX#}_;?YGbFvVt2$D~_UVAZsR(HYwadEgtr~_a?$rTfD3$4Oq?mcsI@F^0M2Z~5hL?xX~LDw`H31P%v zG%e>TBr&)S3F_g|kPkCoMxnk!xpJZSvpcxfVjTF?_SSZo4VEPz1N+oJ9?ZwI8 zm*I_d$LeVLD2ayv6A_sbbw~#A{5s|p0$_W$at;rbq5+Nej3mL-O6)qc5SE`r!7WF_ z=_}Z{V+lI4t$Yh!Fe+C)bGS{?Gu9iN`d|^@0943h1a*ZM87dQsS^{5T*s@K>%=uN= zeXs_u<6_F>iRfrAVq(=atXX;B2iIXRSQ(yQcDVK9uU1Z=9SQ-nIXDM3fYY!yLAddZ zg17N43-cbDgcWNSpkU5Lrqjap>lxg<(SeyYqcPP=@p!{1(Q*9i3s|>ycgqL+U!5QU z$-~L?A=FCYJ+G{OFel|6^YPB6D7J5HBIUD@&Dz-W-U-?{Lun~MWig6V0yC?pQ2H2H zq8a=5Z+Jk`)0W~69s#19pdHUY38RS6X#>}`U|B^H7oBMfd*45S*$JmnestUF%kr*&!`kf)9fOzj&0))H}k#@LD!GVJ@H2>X|b2H}%&*#jY zC6x2Q{~1NA;nc6l=aWz~6R~#nuAh??rP#i6^%QA5%!vz>K<$PHNS6L9%AtrO5JJb=*&Y#ATlHam}?Rf+NdPoAWF87 z@@Ck%e=vHyf}PvG#CJz72=MWo|5SUr$69{P@AFZ}7hvj*h{p|t8l8S=*j=^w0VHlv z-BDej)xC?(=g{szL;iCCC`D4Af=Jz#K=>p-08=j!8 zI>Y-9gaJYPy7Nx&_YRL0M zMHH#AWjJ^GGW66{?A^D17Cq`9;U*ROGazV4qLMlRZM0Ac=l9|-y|}MV$&M2t7U*K* z5Mc>8Y6iA?t?OlCfJ_0e18FHaaZ2{nk||P|A-zw?(=925*Z46clSryxS@RKJ^a#n5 zYgX^_Ut9IPPn6^L7Lz>o`ub1!{C<+@BzMX~$`HQx*F_J~mUpK?MyMo6)1KYO>Khwd zkh-HBo42fbSoQ)%`Jb0(L2%8K|N3z%)1*m0N2EtasM0AC>2}a9hrlNQ$opJnBwxqU zh#+0zZ-_|904MlnkcW^bdlJDiWu%|yp?)v?F{6cE36!$FI--9C7y$f{|4?KBvQGd2 N002ovPDHLkV1oWG?ce|a literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/nextbreak.png b/eric/GUI/icons/palette/nextbreak.png new file mode 100644 index 0000000000000000000000000000000000000000..4729a77ea227a20ce5ffb2fb8eeb45a44134dd86 GIT binary patch literal 1312 zcmV+*1>gFKP)o=Zn`%N+?nJtpkyg2Z|?#?&!|DALG z=gce@h9Ruw!NVFK{{u7y;PANG0AdqiF2+Ee8irTFv3!C!KYr}=$U_I7TaTY51}fkw z{=X1Ki?@oCQlt<!0?m%Vi4j=Arb*RKR^f{f`EW1 z@(l<suV@7c#0MC(d3kqCggX%`_}%mQtH3c(AFfThlj-Q&CNJ$!IA%8>-X z5fY|o^gcr1=Xrk;;)Cbbc`4O?q<84R82-2})~5d&BDtqglM4F?LA^ki@7ds58dzEp z^lA>Ay7o*@@9-+-Y8_fVmIQ8TNK41L*o=;>>_142Twrc!twTQ3ujoQl&x6y4oO z1RY$ATr(Y*npGkD#}81Pn!v8fM~2s_d?(~WhSi0 z#Hpdgsa)YwyCGoNY^YXijc$=M--B&d7sk6|PP43YR~kg2smdWnOpSM3EoPoZahauD zjTz5l?kAtW_tF`3{Evlv7E05sIaUntW-D1b&%` zYcX*jJrUg~)N2Lj&xzwtDaA}yEoZ?{W*2Tqg5Ql=VVq@cz76TYEq>3$ve5cSJ8vDi z<@~oFWLUijyD*A6VB-I{hPGK-=jN`C4c()jtqszBzUTa8RA;`#?MAG8bcA~J9?Jpn zOjL}ym5TXn1&hZi>uG`Yc$)Ql^pp%4w9PUQ4&OtCtTxfBx|M&!0DMp8Wdt z`_pHj@aK;o-u(FS{qNtu&!6A@_wV2PcQ3wv`_4cFQ2faPR;2?XL3T2*Zb(q*OUay< zv1(n;>wN_}=Sy>9Poc}vyVyxq53cGUQ-zx}#{EXYRbYLJJoyUb1xAQr?xTRGGAU*RJ2VdF%F_ySEe>tO4bsr;q>u literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/null.png b/eric/GUI/icons/palette/null.png new file mode 100644 index 0000000000000000000000000000000000000000..ca8e74af0a7fc65467fa7923a16a841de36ca5dd GIT binary patch literal 142 zcmeAS@N?(olHy`uVBq!ia0vp^N+8U^1|+TAxeoy;$r9IylHmNblJdl&R0hYC{G?O` z&)mfH)S%SFl*+=BsWw1G2A(dCAr-gYoHJx(VBld|aMOOv>W7S+9=D?f1ku36-V@vg Z3{D?X_s*QRdlpbHgQu&X%Q~loCIE&4CPn}N literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/numgrid.png b/eric/GUI/icons/palette/numgrid.png new file mode 100644 index 0000000000000000000000000000000000000000..48e9952705fd12b032bc1463c8f1b7bff04a96e1 GIT binary patch literal 430 zcmV;f0a5;mP)h z3i)**RYx&G+VcqXnokTU6JUw`OXp9RAZ7HI6L3Q(l}s$IFB_6_F=M-tazb$NZX_;g z|L#b1^Qgd$$?>cm0}LU;62c{vKDYm`o|-jq=2*ky8Sn@^0Oz5Eq?E`d1WjK6_rMDY z@*fpjpdh+%A?ockR7LPguPv&VhpLD#GV;gjTS63>RFR0Hahx~F^oa$%X>FkS9>6nj z%dGF{{G-9SD}VB)M>IIE{4)L@vG5XL Y0KwC2-?@j8J^%m!07*qoM6N<$f={BbO8@`> literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/objecttracker.png b/eric/GUI/icons/palette/objecttracker.png new file mode 100644 index 0000000000000000000000000000000000000000..0df56e16aa2d37f96ea90c9faa23cedcaf37ef7a GIT binary patch literal 1564 zcmV+%2IKjOP)g|RPUVzZ@h7{MHoslZ%=O$gjhjX z9zLQ0EnxtlE)Sd?p(44eENY7($ewGVIm@VWyqTeS8WO%l z1n4;7JGa)C=dhM7kfzq-4N+3Q>f@cQl~s>CalXB0^TF?0)Ii+(Zd46^h>itBJVgWu zqx+q!vOUniGI=ku78_$>>DD-i?rZlR_#U0b2@opb8tR?R50w|@bA4uJIn*@;{CNB) zB_#Rw@M>@m+KOS}7z8xS`+(fn!O{hitR||pxMhyhS+uyid|p|ZV~Wr>a^bp>HN*Z&~u>+IPF>C1EVl)X`7scMNfVBJD;wYa@vfG9rt*wPN7ju6hF1=Ra%x!G zzSdPyy0*mS099pWVD{9y*^ zi<`43t}YC`^9DWc8MFshAP-E!Kf`}3@0}E{zq^qAt@kpzR-I(_$2$N+A^xzgwLl8T zG8hxU=^${h$-Fw`L8}i@6XE|<5PL(FE&vK!FP=UDFp*DdXYXfd86z?&l|}G2MZ^H3 z5~S$h#!=sJB*KewGs=Xxm4OZ=p+yEmd{a}~rG_@Q?~3kwQNOR9li5 z)D%Dfj_E-sr`M1a08JZTS15|AMthfu@AS?|r71vyG=LcvRBlng{sf?ds6o_*Xt%L< zJGzOrU|Ou0TAMK#AO%^pyoRVjH=&C5wq)R8BUow-8L5J}tR__0m<)(bfU-G->~Xw%EQRR*mNiy~?q3*RC}D00I~YV`zV; z6Ryu;#hpM2f||(!SUtHEx225KPatD9522zc(@EiWr#-ok-!TBzLTy-CDQvJw!@w83 z25ed2DRlfbPEDf{(tGxv3Ji=2XSzc?6_piQcTz^982(+s(tD;t8)G#)_lIO@^_v%a zQO>A>l80hZLv>*+nIQ%MZTn$&3tGQH#1gY0onZ{X<+8FZ7l5tU?4%3uGscViPY#53 z>E&3^3zL=}d>BlYE}Y4rOplv*t7@w%W-prkv)N&LYx^3%$KRt5AtF%~Q}Y02Qv2n< zLV>|R1VZ=)m%~Xkqzko#7LJCaP40I0tKM!eZe*iGJC=>=NSRbIDlI)ToqP=|VhdUc z3#!B@XQW~3pPqj@@0)>uY4JmL(;IpLWmX>lHi8=)*0?cGGZFT?00RKFDy9zWPtq^| O0000`+9CU7p~IWMs}efJMhcl=KjzB z_dDnRaW2v{4GwZR;DE<70nY>+xBzF%mcM@C#lLgYey%6M|C`OeLw?@BqswH+V#xDG?Uj{2Xf44GP^_ijc4MnKVj zhmJsBPhq$S+H{nlGp2Z6g1X@BGyWqm>?pDpS(agqk-As55onr&-h-SXWo$SzHiKeI z#q`UEWcZ7N7w~h3X{}0t>jz|gwidu*2ozArl`)a)M9#6>i|0idy@B!e4krS~%OFX* zZ*AACg6B7Viu2TtP}yd9s52E{YXxAL0y7gCe3AImECnzP%%!#COclHF<0>I{U7MUg zUuLwy)m#-a*=?wnH-KYGAc+lZj|CvKyIz)f5E?rm3M@zhho2ju$fEwzO-^CI6F?a! zczO`^|*l3v-#$g z>xp2ltc2zkRv?`m8%V`}95r@AVyf;VKqYpPVQ(p5b8}}(q&)AaN{9c##bMV*L4G$m zzX<8XjnI=nZjBNr0*3e>1elXhrL4MSyV8{}RT{6Jcg{uVxUov!J79PZ}hc+MIA0b2y6R~7CwBvig zC^c7j_)buG?)V3DNg5yfP20&0vc1Tim%fb!w<_x3!_;rEl$;2yFU4#pZzjO`$yd=} zv8G;HfBZWpRN*efe_nD-ZTWJn~fqwvZ=&uBX8CTjc%n8L7J)C*-F0G37D^2 nWD=mY*z0W{2>$QmZvh4XhQ%bUzl%h000000NkvXXu0mjfiQg2v literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/oneback.png b/eric/GUI/icons/palette/oneback.png new file mode 100644 index 0000000000000000000000000000000000000000..c88a22de5c7ac62b136534f067beb6068760a498 GIT binary patch literal 939 zcmV;c162HpP)cU}mc4qGPo$sD=?zx<0 zS+JFZhb%ycj**aOBuq9hu>Dt_bPm z0!W#t;PRgLH4RNZhU!7vEq3pymI_wkerMJWXa1-C3xc1C$3aHnhZnphxhVj&Nhn4lRLnEY9>2$Cd% zp~+xkV?*^s@RIM(y6^Thoo{dC1JxIGL;z7^S5-4u&{1$iy*F2?##Ky!Z6s_{nVosB zQEP8%d9V}=)m$Y6v4JK6@{$E?X12J-c>nc#$;hXh#e52}h}RVnut5nB zyix(*2{>g{nHleUnvH#Jr$MK(sAmcgy8f0)JV$<61nm9XvQ=!OBktX zj5JC>qbeW=zh;#zs;m&XNFbX;Vd2}msl?pJ3k2(PCLwMGHm4H3poE{Pb92TK5xvN4a)9-c2NuOIoNoXUiVVlNv)do1#8X0ReChDt7X70YEB>E zq%JdJtx+T@Zp-azNn8bsTT#H)^pNxGaO!Hm-2`C0a{>3ypN@YEFaV@Y0Pw~(-}wLl N002ovPDHLkV1ldetH1yN literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/oneforward.png b/eric/GUI/icons/palette/oneforward.png new file mode 100644 index 0000000000000000000000000000000000000000..b67d1f540e4cbf91d74b1187e10a1b834c106f2d GIT binary patch literal 946 zcmV;j15NyiP)8`o%4|jHU=l9GzJ@5FA41%%m?wW@hcwuICmhb2JK0oFi!Sg)W z$wP!4KK=tV1R&tiDu8GM!a|6FRk^1YMIRy(k&^p5k3H!h zx_N~`Bsz|@r+UEPECS$D*O z?r3@xuj_k219x2yOv{0qW`S18gHl}d#WkgXKstSNcz@UNOkwfMLs~kxoR$E<`tbK1 zP<0zB@*2qbIVdg9f~mwf?aznJ?+tzj{OAejh7BcI135Pb#q11N zy0Y;MrsR1gzc7WT)C!mKZ1vKL@^=9N3)`@)7*JTvLLoaH7I!S8I#n%YU*WmR04xUK zwIl_m<$`LOu$-?zG4lEZPdUcQBLJRS$$1ztExb3C!omaMI@IbK6W2rH zb#2w6d@~S;p_V;eD?cjdemrLPOcu2kR6OdEZP}Dk08L)Kvo!r-o(&knM1x}E689^+ z-VH6=^F7y U;RkXud|C8Ix_uh5J@W7Az=FPkJoO|y%=bjrD2n1ZMDPdxOFUO<%eIGCqB!Vc=jqksL zci;gi20op^dZ#~gwb4{O8Y}_RK`)1IMfnAA0NisL*vWtaU@Mrfyn72CgEHWkRRldj z9EbU-A+sc4(U?!C=bJ*+V$~TY!>cJd3 z>OTgoW_t?U{|`y;4#?$mrrCf72SdSNKI@1v_B3usqXA<q?B#6YJhR7eReP)hW_HC(^i0TKKo7I zMo@V^&yEcY@elmJdsBJ9sW=E{TW`t{wR~qKeQCHPxCWyXPz|Utt%Q}ltB z0NTu2!7Rm$e_6Q|JQa=as@2o5f~`j*wQd7hU_FzH+t^RaCvXv*05_Bw8xqU5Ts5GG zZ88UJurXpg`>g>3`OeSTo?#?Z+H7H>s?#vwHuq7i8>V=wmB=a_Vg$(EzXBgM@<%-T z{9tBm^no`#a>H3n=!lPl6lyAW@r-fvsD5vbg57M>m}FX7hO^L7b^T>P0WIqY_L`DM zs1m_3<;=JQt~6zUJ|`G?p3b(Gbwf~Bvl3n`QkWkmf>Fdu>X?G}v8)g2YGy=7 wF7Yrz5=@uVFH9`5I=AS|`nTiOls^It03j>V4FsJz>i_@%07*qoM6N<$f(=Nu>Hq)$ literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/palbackgroundpx.gif b/eric/GUI/icons/palette/palbackgroundpx.gif new file mode 100644 index 0000000000000000000000000000000000000000..713c272168278525706f6acfbc378f4f2943c290 GIT binary patch literal 43 scmZ?wbhEHbWMp7uXkcLY`ST|O1B2pE79h#MpaUX6G7L;iE{qJ;0LF_3<^TWy literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/palettetitlebar.gif b/eric/GUI/icons/palette/palettetitlebar.gif new file mode 100644 index 0000000000000000000000000000000000000000..a91a971d140885ed1b7108cfcf72e56336acb7e9 GIT binary patch literal 96 zcmZ?wbhEHbWMmLz*v!E2?Af#P=g;50d-w6<$4{R=y>jKsfddC_-MaPt`}h0z@Avif zUAlDX_3PIUA3nT({W=2!gW^vXAj!a>10q0XFtG4mP+((_)a`tHimOqGk--`OK58xr literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/parallel.png b/eric/GUI/icons/palette/parallel.png new file mode 100644 index 0000000000000000000000000000000000000000..cb5e322e4a0592d363576954b338a8a6402f5611 GIT binary patch literal 1531 zcmVx`lNulHTNGW@qlq z`Of#<@7!69D2m|!9NM`i&`2Zrnuw^z=8{+%8065V#A&N2VcA zomF~e3%5=B9i;{_CnbQyQ{>jV{51)^Z;Vj2>2kX(H1E|8VW$MhBHASEqDxn>!#fUZkjpsb^x@98EE+X(6y zB%^~=a}c5!q&Qq3z|^$M2Xbn zi5w(R$^GzLCDtfzxG)BXi&k|+4Hkx*Mdp2w^GsT7Qk0r@_oQ2ad@c{K$J+);QPn(> zWqh>y!&UvCJ=;?98c2je$X$eKAJx~jUw@xXyS)XbpX+rXV}Vk08R)Q@tyOXykeoqO zM-=T`|5Wz67Ykz?o!dJ9=mai5R&0n7-gO3)xq@~k4=?)k^VFx~l1j~2dRLgvw}4^7 zb~)NJuY6g0+ABJ}Zk0UWNBCMTeU>WQplw+CNh0LRI|geD)<~vwh-@`Wbjlb8y$& zhOAd#DAGE5H+P!qz>#ar(2!I3WaPeJhHFDzBMce z3`aLwuV*;u8%~0AS2@0MLHl>G30NXWuRfh~9SaoH|@odWND>!?iLD%aVB>xV$54sso z4Wb%NcUY=t3;-e57UdpDjgL({+Iz*kqNU9QY`)P;e$Km>;wi^$RX-{KZADRKj>qN8 z`{lbcx?BD}l4PCvUhaM)V!y$C{aC6)1%R#3*q+S!qPlNdy7hONp(a`&@>wA;8KSQR zaTb3t{}q62L<#syt4V%h5y6k0gC#-h&CFKyqXN)EC&Uq-;E+W&Yt^Ct9jj)feo8Tj hG4W4IH9GzgU;r|SvGshQd#V5c002ovPDHLkV1hv4(G>sy literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/parametricfunction.png b/eric/GUI/icons/palette/parametricfunction.png new file mode 100644 index 0000000000000000000000000000000000000000..809d2d7da0462e47c0a30e60b7dfc6e9285aaf29 GIT binary patch literal 1349 zcmV-L1-kl)P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2igo7 z4;m)^>{#Xi00hNJL_t(o!{wK4Y*SSj$A71{w{L5=!d_upw{>hKj0wyUV9OH0C?bgv z5)B`W`az~fj3g!|z9c3*HTBK}3?Ql002TukYF&-WgJU-P6p&DA*nnqczzXgIJb-Rvz);TO zN|ylF6a%HoHfY;z5}2_0PE5yuwR=&j%cp-UV;BG&J__J@LU-K-A1A2ySSa{dBEAwk(#6b#FR2JTQ`w z3xP{3tLl@j6?rYC;o_saI=lCs>AP+K=BW+(#yL&PihVD1tp^g>$}qjuQf|#RRuU>c z4U7PeUvEYodr$X#=h8>rx-+p@2$pI>>u)VPcW+C6V~)T72x4gToyo3F+Jagtnw1*s!*_so6WI@zlHD zcJ`{o`!n+gMfVlN&@eYNZ1z{cI1iahh*dhbo(#+2(NAdR~M zApYuP(vdWhx~dG9VkcoS;@6#snblVQcolPQ_1&3ECv>DyZ|_)|iK)dCakolNUHvv% znXeh!R=6LDG*l0_Z@Dn^%;Ghh7nGJ)C_A45q1|Ti4*yvhkhTtH0B%Dj#L(|Ux^gOj zL_?9=`+BSQ4S#vn@T!ipoud=7Kj>+$TppU!p~>-AyRY4d+Gc^_athO-yK`#Ars`f+ zx6?p+qJyyrpci{R^6|Md*RKp~ttE5k9)5I3*Kg6WL>n;Ld8Kyg)^jObKfm($go`at z?)>6Bum*StxD0#>jI63DuU%d1d%332xZgqaNLe6W7M?dRFyya$Hr&4Z^zCUZvjUhj zjKYDsqUO5Vszs5!;n((ja?&+GmztHcpb0;I0x*JQVvaF(+;$$gG(3CC8fN1SF>Omv2rC-%e|nVn@lUv_9}6bUv_u)oB3Y9 z@7q}hLJ0oP!9}x(K|{MG*IqAR6yC5yRg4B+qeF=KYH@lJaYCoPer5)c&9OY!dFtcW zgdg5Ky1Kx%9X-clV}|O?kPM)e+t2TLCsQ9jz~1?3#dq~=Nmc?#q@(bxIDj|S*(&y| zO$ym|+`D)%ZRa(m#_9oPmjJYsL^m*Ro(AH1?5$(lUjMu7Lu<`j1~?;EXU<7t7NU6* zLJmR-Nd-I5e*M7>BJ4Q7aS0r^x~Hye%xBfg%?EDyql1TbD(sqUFA;}Q4NQMoqL|T` z-dOrUaYh2SDjo>Ms_0`9^$<#8$ju8lL=WtravmA>bnbWW)n7aU=s$4FKHif@-}3?0Wx_dH}5x5Re2= z2O9Rzx;H6x-{&8^ZUgoHbUz!4ORBMnzjX6TX6M5GLz& zVBE|+-C}f~jgW>APn=?+AtBRraP2%@cjJ3Es?2FStL3r|A1t*6U^h^i?V$(KES-LM$QDpr(7Y&x8Fwse z03+jKGtqOfA9y#_pna#0Ch zB@ql$M2Ac?r($FPZZ7&f!}MZN4a`=7T!?1JzFagVeeR?Q?9r3Q!2_S`dRUP!NGgAo z>YhB+H+oBXI0kTp<+%SREMK^6;+$!-J~?~XTv+S8UF8zJdr2en5d^6wrf6SGF4}_> z0roM+gpryb9RYk*b_+Mkg|%m~f&|NQ5aBBIu&wGWs!*N5ptI+hRfFBuG0u{Qn@U;y** VPHu28%iRC~002ovPDHLkV1oN9;W7XK literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/pivoterB.png b/eric/GUI/icons/palette/pivoterB.png new file mode 100644 index 0000000000000000000000000000000000000000..fc7c226147ca35e1f5fe6e7468a5f6679316f454 GIT binary patch literal 1096 zcmV-O1h@N%P)PbXFRCwC#ms@NURT#&=o!jp0r90D> zrM9-zw22bIv_YvPG{j552h&Idg3&ZYqd^j*F9tNhSEI&PU+{%!)L=AyK!b*8P=VN5 zTWJXDcBQSbu*=@>J3BMS{|sAgX{p`T*q1$Utf z=g`QRuZJ#WmoU9GvKs-Adbru5J5Y zJp4wWwcV@h6^!FZbh_+0ZiN42zy0#l*i`W1XzY48luIYVgsXlaXl}WazqmwI10#&y&+7lkD-?_YDLm$NU8Hf=Hqy z+3(>GLO{~WW&2tx=Cxuzm(QjWu}FC4kMpNb9>01y__1K6>&oTe_rH!0-|25$*CI+z zH&(?}vtTmoWo3Zp1qhIprhwPuYgiE6YL+OgECPh^f+BxL zXVZ~mZyp)?ePZ;~^()ig;r6l)qg{7+>6uQ&uBgt~7QBgCV;w6vxQwMb2ry@tPoy5j zWv!G#IgNT%7wrgmsDj;O-gMMw;79PbP@{m`24C+Is6XJQ`&F6R+yXh_5$qn@#nvjz z2Ag&BHqZl}w*{~EEVm}#iS$0%-ax9v6O2VVK#dpc-U2=XM`umCDgmvsK!bNFc8WE` z%j@Q?<+8SOrTV!SoB$ty4_EUnum?Tb;-x(u4Wx)16^(gEe-qdTHi6ebJ9rj60p11g z&GSsH!4;(WV7L1Bs^WmWf*?XElJZfZF9_qHR&JTJcXl@(|8<&UfDDd*A1MzQdWON&n~Ias+Y& zas*c6B`@AuPPGLVQjH~>*$Q+5`G5yF0W2(E%l}6k+Yg)q0>BV(C*TGemp>@3Mzpzv zM)gih_HrZeGO!D{l$m=KI0SqIYz9KvhlRfz#NjNuU9wo6Nj2eHeox{#+ES87TDk(= zKo8I>V%`eq>G}RlCT<4$R$Ky$)#hq{`0-C3dh)2dwsHLv9LH5@&-eg*=8M;BCz#Lt^=pG(C|9MX*_e;ATi@fpvc=*&{bm^j6heRDW6;eZ?tx?g9 zsnLiUk~L!qfkIvooIJ;iCczyHBWVDb*Rq0z23%zoRkuCTb?mLmHFZT=QYEY*i!F~5 zibA#%PtyfU<<}P`ec#Bw=@B^`oQ_AM0aZ6*5vnR((Bnesk(o{|r~KwMEdsWF)n zafQ@)oRu#Q#G;XK$UpC&o1dK;8yy}vJAU=bd#nu&P16#n9fuvVm!pI{%K=~zBa@0D z2pnooEO@GN%t1Nsw|$rfwuR?4ElC_Q!?Kc>Ux0Nfo!g*98#Ys{BoZ~TsJz8t&#wc4 z(~C>sk}Q@IUJz~I!kg)#F$Sp+C=Cb{mR3|X-23R^V{03lZ%C?YIy^6ss3pkS^BhI) z?xF}Mk$>{~%-rncWMIxawGi-6hl2CoU?@0Spvq%@>&mQl+a=kYh4Ua8095!|qi?qACaI3S- z?i(rrIRepE**Sf4t2!F6EV) zp56pU;fyo2mfESks(@_-MVRR+E!-w^C;bl2-G)iIt(;_d8ViTN00m5)!~bu zLRbU1Wge<4BBxavi0kH_UDdYJ4aIi)Vp^v4E*rJLC84A}G2J}LJdLG3p0Y=CWj+7_ zmP7plv@x@!$8i!KU004EW|Nur`(`Lv7WuSR6NY(X=6tw6v!o6fTagp80bgMDA}^o6 zr`k#N1y)L$rWcnx*r^BQo?{iroCC}Q>NB3woeAz+mD5l_E3S1|Sn%u=JN3TG1pAB` z9MA!51KNOVi_e08O#pU|gJ#LpIB*y667V{u+lrlp+q1i74YjJ@1Ap*Q$9jBU#%aym jM`?~gj=*1yUj-NdZ&xTx5%ZgX00000NkvXXu0mjfl(|!Q literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/pivoterG.png b/eric/GUI/icons/palette/pivoterG.png new file mode 100644 index 0000000000000000000000000000000000000000..4542fc718b7757adfbf548c2ca23c2c350b503f2 GIT binary patch literal 1247 zcmV<51R(o~P)v!#EMO|A2d;n5Hun7i&kSblE!G&sIex-Z<>I%k$%uLG)*iR z=tGRO*tA+6LUjwvK494QYi4#lcbO%CpSCp74|_Mi&Cb1h@BQC%&OK)+RaN1?Y*ax& zK|n#kS{JCd8R4MI1}SC5LF`B;vK5h#VdNO%Sv{X#s{jctxat&Eqz_?`!^nq-1v#e) zBF&KdGqYv^85J7rCg5laG#h-3M35H{H!_LzA_{T{*@%dUH!ln5^oA`o&DdA>&!rUj zZ6OH;n$DSi5Ap_iAfgy5Yaa(vhwMgmR>(_Nxv{qz%%^559GW&i)+Ate989bMWK_ z0d|%0_j43A9hMchocXr^(=w|l8e}C^>*vkICEMB$f7IiwskIXUC{Wjqbn<0{@yIxB##-SuE+{iBaJ8%;t9 z!!Rr+Csk2oS&?K(!7uX6uq?})1aqllgI%y#0mqkR6AJxLfwB8-keb>-c2q(lyg=Nh z#G~POG9HV@BB5Y7xFGrizM0t>_jUK!)iW_MFvODiLa}XQ`CXf<_#(l;avZ8!G>l3< z88!Qh!YF51j@$-7ZP=w|H_o*T&LLe&B8vZIz+$yQiQR$6VFik!1YBZ0$-2o@5>O2M z@b%~02YOHLU+#i318;KRCOnOeoElB1;CD7+Q2=W&nk?(?sMy~8+{>@sxw*zJOX;P_ z3@-qG{0Kx{yCG7!6N1w>g7ZF)2ZMArB+k!<@JSTsy-Ykb=J$Kup>TK>M<%7itqKJvADY zBMH0`Y(5*)3}e~*Z2NZ&d-hdHQVODxApCi4w?|NE#k0GeNbWhp3#nH(Q)kxFTtZo60i> zti!<2;|-YBuI5sEwb}+dON^Ki)lW$3#f6{2gp^ISvbtC^uzjyp#&>V28e-7-ar2w2 zH@E5-xVuQ7+k`A$kH6YTi6(y5`rkpE$fqj~bvs@v%p46Q_b={~t#nTz-)M!2yaVje z5?M16yX^v0jb;A4tX00JwF-F@IiqFO!aHF>KtaI&OTa$@3;^$A5V7k*--!SK002ov JPDHLkV1f`6PH_ML literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/pivoterH.png b/eric/GUI/icons/palette/pivoterH.png new file mode 100644 index 0000000000000000000000000000000000000000..bab2f2f3ccd6bec69d682876425d4f34d393bba6 GIT binary patch literal 1104 zcmV-W1h4yvP)ENotf5i>Of4N)_8GrBrR`QxWWg(if3}2>RfQpbx(IAf*aYsG(ZafI*uq zF-=Wu(>66RX<3sd%_jSs{hOJc8NWMDXj((u#7IDL;2UNR_n!ORbG~!$xGc+})il>? z6A)|`E?3DDDkYxY-&RFl-bLm=b7z4U9mV}e8>G;Z7eIA^Iqd*f|aFpMF`l1 zM>p)R4bZdIei9IdWn+=KtF0uo8k$52|M#-K!7@m(;ixiWq1G{Di42?WY3 zcRjW5)sGNjr00jTCnqAK?QkbcZQE98<>~c)kg&D#Fx;O3+m}>=GFfSCee<1fwzWLD z;c8#^9~XXVZyV_C`aG9O|5D2Q1JKHg_sgUjme(ZehimV0G_da22cKSQ-2T{ll!KxZ zW9H@FaQH%J`Vk>SDE!1>M}Zwz1UPE1dYWM@-TnwpR6nwG-cERbUh zZ9y-*R3D-Ziq~Zm*!swhw|DM2*jnaSDqI}rX7V*mqi7n2ZWN0Uv1M^Q&wIQ+f5p0L z#V0ES|D7iqHsKZ}!Z<4GIu-I+Qu8^=XES)sx8yU6FqI(`{&?e3rJqCeaYQjI`+*n!hAe0kY5f^AXLc+ zc`(X@5Fyhv>U33Y&ZLvO+fIB^8~*Ne*ZdMFSfGj*1fR>r@peed!ulpFg9TE8C`xig z)xDcuIP}`_hUQ1>mVw$0lZzv8mZq;ubKT zj7^Vfh5QgJ@%-B`jezOfLH}-rT$a+wcsMZ=J<4`z3Wl8(l!_+DZm5HOKX*fr-;P}$ z>clSDksDvp>zL#C!1J#hIR(8u#L}IP$LQL{^Zotdj<(^;eP2O{gUk9OD%ENp*m$U^ z(y(%0Sb`;}kMLRh^{r!3Ew@=u7g2ceg$|J6_F8i6$eYXsH^tU7@|1sDLf Wb>O`-Nb>?M*N#6$v$X7WhU48V4Qeousj~z$Q6}srHfXS0M-WN_#~JZxduA#%~fV8394bJ|M~M` zZD=Y#UteW+w0z|H#91iqPey{EC!m2Y5A4K*j%%Eae?sUHs zd=vt`V-yS}X`sTnHD?H@7hyv~@pSj$Jx7%B;WyfbwCNMKl-)v_78!~bboHBvQkD@g zS&#X<>+t@x=W0XCr7`JOpR#KpsNP7()bZj1Mh`9#@tKKOQUN_Ud-MC&%^>7Gc&ht~ z);A{adn9Q0^!0B4Q#|Rgb2ssM3PUC$M3&f)h>!iH?XwL_#MtTX^WDrvpLE1GtNu=u zE+=Fp-g@RPoI@%aCS$-hmN7|j^6tA{nya?iozj|rrdabHO2~zViK4$Ie<0PVNaQegh z&m8Y+|M)#ryS(J#G8Gd|yONd$I)A&^%jgP8+st z*|w_Ix!OiZ>fkzBzpN7@u@jwL7r~wI%%N~9b(z>pB9IpnJSzdC)Q**|nh)Np-)n5I z2X{5O?1=y2e8+`?!BFtrR7yBQvXw~odTHy&gRCqH}#FqjECJW z_m3Bjoqe@`^1)z4OngDSZq8hN#^Z}25Emq-%u!xgy=wi@4eM&-J)OPo>tXNsv=rN` zAt>c5y7>^8vy6~bXuDkl$s~Gnbi@a|6M;ljiZv-v5lK&12-JLoKTm{IQc~$?Gz9{_ zFz}CufT%*rVXNF&$QCUzy;x|3Ox}advA?6~umA#6Q84s_j@F z=cdx$=7btu^hZT54WK`6JcKEE7DSamP(|qg7Iy#vcpn#MM1-@$M0ksTnaEr^Vnfcs zRaYdnDPDq6idc~%WfutyA*%oGY58d&7Xg}VBs_u9*EN&)%mRd#ErFg1=73DTR!tiU zB+yLf$kHXq*bB_N88VC1AZxh>{&!!;{|GPuEA)bxydH|@00000NkvXXu0mjfLNYj8 literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/plumb.png b/eric/GUI/icons/palette/plumb.png new file mode 100644 index 0000000000000000000000000000000000000000..3a7a1e9d001baed9c0bd05b54dfe9846c7ccfa86 GIT binary patch literal 1540 zcmV+f2K)JmP)p2*C?BG@I-o6DDDAbq_O93a+WXe`$gP%w4U3oj(z|=#d!OI) zd!F}spW?DCV=wX|uorxheGTB?f|SYS;S1^%MP-dWmQdCm;x0E(CtO>#yeKp?5(3KvX&%{+4PwQ%$7<_8n+-?`Kt zEeSHh7+gpM2s}!fzX)dDn+x)>yeX4{gAL6snBli7Y}knO_2BUFtDWyDUyzS(c*GE$|UzA+>{k>21m<=VZI3NWYZ=SNiZ08vIpdnz9S=mtpS@qxiO~wSUykb27xih3oV;Wl*_xe16o4^!sHFo8M-`RC2U<5&S*%pZ*p<0iljde+7@ST@*JyWayw+i@ zIRDL-{F$TU_p)`TM;^Ij;cs>Dz-zIT6J7q2kko!9-r?H00fj)luMZS$&zPPwZvT_!#^u-bdaSzBR@cq?zh-#J zxguxTF`nVa+gRJ>yN>$pV7?2$gOm`%osuLQ2om5A=GyXX}oP$>VZ=H2vAM&|olN zO-@UVC&2FX@_q}7E02z2&Fr-0n>C{L6N>M$cKBKrdj*#ry!R;us^1WVdR=zt_fO$jM6KpVhk4|;xtJKx$$%KZlP-eE4a(L0;a8qfL}Q$`aF(R z#>wKMeYvAj(o2k0>>Ex{h`D+Nv4B`=wv>+mOec3IUY$BqO?{ZtlqjL1s_*MY>GGJ~S>M zdj(Yy;=(BqN`NSsy)HxW#Tf6KjEP-=hk8!(?BXT1CrmZtL;FC*0Tpnh4BuDJ_zVG9 z;YMrcETu(jnnyHWLyLsQTk-nYef@L|1-PnLl=|HTs!mvopyY_4DklAQzp8^v{ht!+ qw+^5WmBxZpc_6AVsDDoX6<`2)Qx@g>H+%a40000%zu)S~^;5Tj%&$QF6KM87s^gXw{EL)q$Vh6V6v+|HNC}Psn(h8VF>MMW sS`@{Mqs{VB2aGyk)BywS0Du4k0R6q2)RQ%FsQ>@~07*qoM6N<$g0SJb=Kufz literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/properties_panel.png b/eric/GUI/icons/palette/properties_panel.png new file mode 100644 index 0000000000000000000000000000000000000000..b5a97473d657b7c4ef881501d7dccf562aaab5ba GIT binary patch literal 1086 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 literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/ray.png b/eric/GUI/icons/palette/ray.png new file mode 100644 index 0000000000000000000000000000000000000000..915820f3f7236db11eb7a15283dbf80e6ad04249 GIT binary patch literal 1018 zcmV@s31y$%1EM!km#Wo zeXvYRa!ESM!tJ`<&FP#U8=Iw5=RR-eT+XHI?OJQz+(QR`+_UZ6`}>{W|KpzFEX!i? z90V5Up;$;V9E`XKK*Tt5oOd0@K0+)IIpm>k9lum~_sB&W%o6~V&;Vkg$m`DC*qek= zx*?lw>9LjDbw~iI_(w5@SCYrm>YLSGhx@FBHecVNO zpen$$97Gt$!feyd?2_WZfVd_ymsN#a#vtH zjrKS>+l$Z|IETYG>3buzohRp>6H5{b>-%xdm95Hf;EB=jHAT;cB-a~07_<(v12!Np z)B`vpF}Gqw4(+C%*IupiPq?dTnkJ2X&UcK{b0@1{@h(l0MvHddY^Uw@fSf^@A4Dzq z=kua8(4Ngn2X<_DFgDy@ZZ_Mn-hS7;MqN)WdN@QFA%NgRv7cps)B=RbcKz~+ zy!@QZ7sEEXh-QYT4VICrw$IiU5n%{{7sAhHk=yx$ylP)@wnjx&5U93if}w`o)$1^|nmui^m`PKg z`~BNaYvqXB`yK6Avc#eat#BPro~Twzwp6cz0`Yb~YG~`N5fMw4SWG7(xN~@2U$O=( zSeD0qXJV|F?xP-?@_1VT`F&)u4`nvL>kxAJuj*RdigAL#_rnP!Pfttbzza#$Pf?6~YnzRssfZoGxz{NE+k5;X+hZc0^HdxPM_%%_d&a(TfO9y;rvlA_nhwsFTq+5P zqgz(wF3Cu=N-b{av~BESTqZD`fDV9r!}C5%h^qj$*u$myxj7k&DpX2xHw?-6bl`QT z*;(JwJK6_+pG5WtSs6|}cv-!LYegb}i4jB? zXd&X5Xqm_nkL32bOGS52ou;6j1|dZm5G@yZ%QelB3?S|uvpF`N-Cov<1(1TKfRkf% zC0RVxG-!NI*HxM_0Na$iy=T-?>zSXOfzRdz6M)F~9Xg&bk)_o@vl^zDU}DjZN|mZ4 zWS`hWk65D?&qQMvJ=6lX2N5}hUl0K-xlFEb@IB9QIDF02CD$$M5L}2SImd2e4-;I(7ZD7TyYDVk9C25fQ2g$%U|kIC0TH&OLpnKv`U=NY7AX&$}EZs&&+2G-GlUg)qY*Ou##Y`|c5-)rw1x{v2OLKGu};m5gO6#k?IaEq2K>>G@H*i^61OkgwveEL+g}OLB9sXN#z9JNzDc`ExkehDd+uWwJ?bp(7 zBQ(FG2*CeF1w9ww{+FEGU8r22yQ)SeB@d&Nc>SSQpUso4{l*C^d_K!JQiT*C!nJ`u z8fAFy16=vRRNF1-lM(kdi^0}Oj5AsVAy0M`6P$y@k|Xt>JsbWP@I!zB023npr-=)# QmjD0&07*qoM6N<$f}Bmk6aWAK literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/reculer.png b/eric/GUI/icons/palette/reculer.png new file mode 100644 index 0000000000000000000000000000000000000000..617692e21e8d75bc59ffb32ec7c3adcb40cc15af GIT binary patch literal 483 zcmV<90UZ8`P) ztPA|1hOP$UOVF&xfRqS-L)m;loCeLJebfwrmq45Y#FK$I3W#NqEd2q*0zm8pwX_3> zRe<<4HA7$n5XS>C_{5F;ZJu-k z#U+oj(MUL#F9wSp4uqt?At_9E*MGN{DZZa8&NWj?dNTBuy?d_kOR!A(F341am^>H^ zD%k;7@Ibm^hAEZ_D!~D++?)9OUbw`GNlidv(mrq%E_hT8E0;^%v&Dr%X+Zd5m}#~L zuO7A;geL0uQN-WST;Ec@c&1!622q2Qg2%x|o14;*^4t`oMa03KC|8>jOOeXdf-;13 zQ9-g|0prvn2|sFrO?u*OIJf3|t{k3LT@Al#1V zI8TNFM0XZH0g(; z75qX)P!V;Z(uF7}NH;}sC%AR38yAA;#*Mge<3jf?+_)8`#ZRraC@LZqtCiBKX`3dm z`MmFVuG~WHCvB3KI&jG2%_R5Cxp&T;NTrncpCh!EMGv|+uQat2*a7&!6!3PrMdzN4 z*GHhj*bDRm7Vu#u0(C3k>)x{OrLV=MlI=_&S!r!u1d`J&%LNzZM8UPrlo=bDzh(>z`Hnx`DYj#EV4mrf#|6!CnMP(lTr0)Gi7rKzJ~%jj*&rgkgM zFKeD=#mx=7ypa1j@DwZ>B*%G3ej{Xu(;+8pp$;Ozb_9=N?iw)MNCIbpn@al1iCXXM zsBP+w9y6@SHr);PU~Uu84U`%|KnE^iw+TDqTrH%`87JZ#lS)iR3bDRartOrk`FpVD z0PqTMSNlP&ir`e+TYy$n`-qh&4LF8VLhea+12sXpzeCT!N&XZ;5}034D&&MzizTMg zw-+cCTn*ry{|x|n$MBg&)$cb7v4c>+b`8gZDVTWIfw?nGFFIP!cGv}hGidtr@9+*bM4c@4LkJ{uw!L5AMD7}@B1OI zRrB@B(PE+_Qi_#?k};_?0TrkpT!cyG@~t!ElrSq*KLJQdIo)WcbJW%{iP_{W1e?GK z=!M2zaK3Q_9f}s?cj1oD&6cbvCg&uoHjVU|l#Y6jAyxE=V)NW6&i{K*`U!u$4f(No zaT)|BbWeZih24H~%|a^Q1wu#gok741$_EUj-~tjcSZp@?P-+?Y0abmG;D@~gQbi_2 z!H@G@p}*4Zt06$`_Azh>=mC)~uJkrG8x(-pik8%g=fivw9s$3Dazg4x-xy)42fm2V z?g~Hx*vCFm;`PIIGx6%`c}(*tyVn8 zxzAT1QDmj;Mi5Zkt$i&I2FsVU7?(_E?@Ke)P;`1ke~;`BUOOYZ9-;PUl5v)~j- z4obvEs%@{ejMo6%P{ddXozp_~;jIS&%JC?BfX+%x123!np;`&dtMHX>$m|JZQZwsG z;0qI=G)&gA`+5lo-t`na-=~KCJFYNDffuz%KR^BmFaQBmVob|@_R9bO002ovPDHLk FV1i@P%=rKS literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/reculer4.png b/eric/GUI/icons/palette/reculer4.png new file mode 100644 index 0000000000000000000000000000000000000000..3d32179f3b29ef090cebaa7eb0a5d2c7ff2f1f3e GIT binary patch literal 1089 zcmV-H1it%;P)Y_ zzX$#$#y;)K$M0O7D>0WOL9`?q;tgJhATb17uyB~>%zfA+Io13hYH_=9n+6c zY%aD`AziHHN>`zsb!Z8;(oDW75Y-i%m7|%+u}&@d9ptPfrEuxvYE>zLJCAjpc_8jK z2Hvb2q#+4h1oo1txph^zfYrHq&V68rjP$|8Lw{qyqF+h4DHO6xEqWO!iKfYS0lx=j zflU}*k_%)Z<=!RdpH3$i;`HBL`BbJm+xZ!+&}nTSfCWbVw!l6T&T(B`uKqL^&s;?0 zhafaG8(+FwX{ny!O;a3npIz>$*A8%9HXhX^Bg}=w5ewXqgbJlbcr*OFf>0p0oCbpT zAlG%%g^izzEaaYM8DhmC6rczl013~FeN%}=oGvCUlM_uXskAQo@iXpd zQvN9b^V;oxuu<=M$kF~+0Vgq6#`v3;QryD46Z!wL#h0ydJ3tD3<@GSvL1;*I8+5A3%Zx)_Hw=Hkm~g5mH)fHPDRuz=yGZ0r<#mHT2Sqb^}`))r*hjBHF-2YUa}0 z)a-Cp)do=gMy!47f&D>r!@*|xWWN+c`XUq=CghYN6{MdXd$$MS0@Y>^`17shD3g-> zIcd{gN>Df~IQE8uP~ff2!2dgA74^Zo#V)fLwv}S$oMZ1)5H7gxsPQL|_unG;I?`HO z3PtD$=1x2IUJF8jF~^geGU7aLJqEl2{}*M4we}}48iWg2qv5bN>(N1!Ua@`!_&&&H zMBjto0RI3-fe)?u3Cjw9du>KuKh0K>Y!}Lv3vNHn{u5vTfJ~b16D_B{00000NkvXX Hu0mjfW3u~A literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/rename.png b/eric/GUI/icons/palette/rename.png new file mode 100644 index 0000000000000000000000000000000000000000..983e592db54fc046049819b6343af3274bc165c8 GIT binary patch literal 1687 zcmV;I259+-P)^@RCwCN zS9weoM;M>o_x3H1>j848fFMy*pHQqPF-TEBZBuE$riZm^Ew*Z#9vahXo3+Wrp1r$YZob`;g7=laH;2=~JN+1zkQCC3w|)7$6!TFo*$6KxK6o zYFhW?mG5E7NhDlpnG43;4c1Fn@&5w_0>I{#Js59E@jx>Kap^ygg5 zK)=}#6h2YV>1l$N0vrG*-3s<`jhG+kcNVnN0KR};z%*K#+jr+I-TG;%91>yt1>R$^ zN@k@#x2rd7QY@Wk#PSUV_%UIj9_G|CSa@PWB^d`unEa+EMaNaW!{p&f>DSz4BB%73b2l2pcV!AZRB z4oOFDn9dylaFarJ)pvDt9W?i}2O~cyIpi9V2N*&!U@UojccCjC*mu{wP88+vsA*)z z{1tOjlIL-WiHp~?{&2!(aSduzE?5i#67eMP%zc{Wk46;ZEPtkj>F2(;XJCi|7YJ+oQ|HJ zL>I@?$_S5{y?n*%-`7ri>`B=#a6&4KMF4^@92!qmp=PcZ0DAx#fFpqC0UrUL@nnVG zOCaOMPgVFrYHO@)jh(Fj6{>~s8X*P+i%dI&th6fkQ+F={bmF%fJPGeH$)`ZJ*qriY zV=}2M$#uJM>$cs-fZ)iLeRn&^+6_Ct3Y!=~L{aR$SlfBbbh$M5Y|+7UOvoiS`B68Z zLOi-js~kRz)h;Fhoj9(~-1OaX)1{M14*LL^nY4!3t$n1j_)EeIKGyC|(-*Q!YBmH% z&XOc43%>2X-By+H&2Y6aZnGBa&eq_-hxJ+IYeK#(|>!&cDK(fn#TlSnNE)Q7gMZG3;u)VQSl?455E18HqXK~w#yzan+b24FZd(S^OTyJ&o;56wf z(zR9b05e}=+M!o6j@PW99V$F5G}sMA5sglK8m-kZC#4f(YUefH4u5}NA_#gPwAg}5 z*syi5!eyrR|D|9E$pZ+3Q!^VpN>bV{o-e;(cW`8C{L&>1SrLZZc$SnnCi4d$sNa0W z?Kf|Axk3B%v0Lt)98NWAS?Ted?n|{ThbK;%8~J$V2Rl(&VNKRMVcEImhnB3|`z~{9 z8Z`92B#cjcG1?Fkam|yI#;TG9H|owcK(`;=Dk%pXtfw1`zzGw8nDXtm{y1RB>j`s= z*ZXZ;VqxAP(%y7&Gn8R2hGN(<6pRZqs1mQbV-DY`P&p`AUD7zH@yEYTqpcPkfN#qz;DhLjTc*#B^Z03WY@Y>w`56unkw3}9#H=Sa;ks8`>tuqN$TM~!F$O1!GFk+C@|t@ hxC`%S{-Xa8U;v-7{hg7#2(m>fvxtJCsU(;pU}2*msEDZ&1QlWx zun0yGg@6Y9FEj{7#2AwpW4xW6U*F8lUS`+a-R26@WZ^M0yL0ot_r1S4Pbmd6`S>uy z&n$o$2arv($-_qvRwB?|il0UiF6~^YMATP#|K1P+@4{-i)XUy6&m-YbyGjoD0v7q4cYW-73rgVX!d#JxB9DLap`|!ATYIr6V9Me&F~&eJRKOKnyt@`o?tD=)^0yyY0y&HUhk;au$SaoLWI`BU za|FTB%H~_EfFQ-=qs%DLL8?a@a5I_!MC(~7E31T3@Ys6v2Lp-#Bts(Bej9`sn4|&#!OsB@^fy+j zEVAIio6ci~0b&k}r=e$;wJX;`-KrW`R##Q111uCk%P>&19ZSqNh0@o)+tdMbAkqGh zGa&5wTDi-LVKUSKt11gZ&lkqG?xS-$2oeD79&Pz#Oyoz3*}|Aic1Gp2>EZwc$^Dy( zsN5;7rVyc@pygJBQKm%)pq6~kkS1-T7Gle-%)(WU|Z8by~b~qaXZ(_ zC+wYoyDsqD8xnS7-7w~VdENQzQ}@|v-|tZQHl0LPAx*U3&|yJD7m_3Z-L2-KEJRs^ zvcRr0DXw0wwSk>;$M4)q$tziO5Q*Gq_ml$=`ITA4u5wlCQkrC-(hKN6m(Qf7Mbka` r->||fc-iZBY5=o;&HnfESAYQkNr!&&$ZVm|00000NkvXXu0mjf-M{k= literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/savedis.png b/eric/GUI/icons/palette/savedis.png new file mode 100644 index 0000000000000000000000000000000000000000..21f182ab176cd928e8b2e22818c9b881e020410a GIT binary patch literal 1045 zcmV+w1nT>VP)G)I$acVntgCv@&RPAT)>l^U)xu8iS!JPab8G*$W0 zxxsfsvtBsN1=C<)EIBYcO-law+1rCH_@HP+1r>luC!kwc#l)KhxcOj@{GzQf5073q zfZPKAQ0jt1T(B(;6wR?+xO;UHF11&KjX(k3_aTTYYG0z*Sj|8Yx`kERCJWY4;;Quk z9p`hA0NU=K2F|_jEp$%JfbDG}1!#`);TB7QKJ$HKaQZ`UH z*Wpm>IE+24#v#e7 zo$H4eLm*4cS`n4!90k{TG1?2-yU!>QdW~t_0L+CcVB`-rxiqq%!ROp%$$%v{jFzFM zrZs!(AyZogyE9vZK0s{-qyz&+Pd1MA=Az~M8f71l8(Jd&Q3jaWUpNo5BAK+k7G0JI zHJ!=ahKHzW(~JR7YeeKLnovz2tA$b?J{f~!xg-E)8LLYXorhYhY((NP%Jwu#XTpR4 zg?VQNmu2fqYh3_{F&CLX8E$|ZC-T9(R3q{ZBkmu^chqsrLU)6r03KIH~}4BuM! zy$hXp2&sge`o}K|T}UJg{)HqCKv&16P}Fv`Eoxrs9_WUg5oJz{avpbHC=!fzojwf>%NroP_B|*Kv!Kp)bw)EKLNLqdLO%KAgRQ`Nh=TsmQ;!w&R+v-}WG}s05JH3yVPj=U zP+?fk$ROHF8nz~qy7>qHGv?;*-0p7QxqR1-*PGt0TfTVU$35G=dw$>do$vddGhUWu zZZikrHhFA0u;~t1&0dg)p-vHW$Oul>RK3+~^13s1J8k*4^MsI-z{O{zOhCK=WV-mErM$?Xn%Snv1g@bun3Utb8OX~2pTre=UfPM?R4xH;j#e&xG?{_kA( zTOa3iIq7e=a4RzZq6i5j;S`-va@P)*0@V?#&3YUjc7TPc4Rag-VxnYI{=KlC8Ilv$ z0jmiWuPl7^Tz#>#qJ(@HnO4#+pbeeVA;!fn-8FJ8LL{frSb82@s}f4{y%W8U_chM$ z*0m4%gSDYRXb`4xKoWQ}IcI<&w|({8sdtg+qhR~pqT8S1qr-f($t6_QItmAK5V*CA?zx97VPX0JYT*o1?CqUCKknRj7&t(NK=>vnR%{}VqFI`dQQ}0 z^ENlTA)L04PuhxJkB){WWARH1qBw+Pq9)CfT4?JAr*(kUb5&T<%js7qgu|R8DqVi_ z{Ds9o73!T6V^@+=DuVmFCUV(eajkM-BR!vcKgo^EjhT(b*DygLjhJ zv>Pcl!&fqTfl$*vGc}`NMbBg6JEqc8+3vTIA|y3OYs#G^&Yyb5fzN@1Agff*qtqXG zSNiLdRNDo#4y)bO<@5r9XE;w!vT!i$fx~1NKF2WqDcOYUl%4|wyCaXeKyX<3$z0nl zDtgQY(iXDiVkSWiK$xJaPjgvfz*Eg`eoPSJ2#g+x_$jFkoy^AIS~JbYp|~~ zf_;TAESmKr98sVn8ee#C$-^1;lKy9Dr;tQ6Yeo z*jQ%QS1aqtO0BxFd7aL(vzNYId;hug>DM27p+5To#o%CuhQfa&8lx!2>HxIzoC%iL zR`gGF;$vW3a%jmifh`a2Jbd=`YxcVz-)}=L`+*kBe_;s?ujkMmfLxx#3YI^=e{Bvh z(PQBH^si{^nsv;lUfe(Y=EvvapMQUUfW|L|&;JvdxKJEGs62mj^en^u*N^AE`}v_C z&Eg+W{vT2-$665KE6*7fMfbgXa(Nmkc%i}l4awJkpixXxwn8t889~)3uJW8;Oi~%D z?kCg%-(fxn#rJg5YChL`7GzwAaz>Ay*h zZ(=2N03naraHT*$MF0Q*07*qoM6N<$g7-GGzW@LL literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/select.png b/eric/GUI/icons/palette/select.png new file mode 100644 index 0000000000000000000000000000000000000000..02e49076a583dde570d214651798bc54f555571e GIT binary patch literal 1431 zcmb_ceM}p57`}qSSO!zWLNQyo9JuMEy$||vJ*nlR6q-?nfPissyWahP3-qpB58ASY z)tQj#$S_-GMl@`OEaMMlCK@9F1Zkq1nk|s%rZ5nuG1E-gfC%Z}yaUSi$Fje?3Sz-0v5~qB9EiDVmk}4HcOXWh1bPQ&~U=yy#vkYdlITI!@978bz#R(m5rm_eM!{Chv zQM`$44OM1$Z1_@6R-{gnycCN1{eHbaOD~AEC~mP>R1SjBDHb|kkeBFyj`yWU8SKEv zh@4mA1RhoyX}8cMSrH}D^%Oi_mur)l_iYHJNQMSzFN*6i)ZqwR~>)d9X#oVL;5Ef&U^-(s(kDgVSaAOu}F_`j9dAJG3 z3$R>co-yBG&Ly&pc?AxPjAEU z1cq#270vz+6;UNTRBfO~8Y+6Fbg8=C91rENIbeWSrb<-CN89?$ISA5pJMFm@fnVJZ zWZ4$ZiP_zziR(_%HVya0#!YB4molpOzGXSmF}1CV9|WX#MicII-D`*MrS3yl<;bip zJXn~fP3k)ORB}iDv+_y=jZN9}ayZgq(>CuMxc=F(AesI~5_#m07s8Y2er?y(X56DOo1poj5 literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/selmark.png b/eric/GUI/icons/palette/selmark.png new file mode 100644 index 0000000000000000000000000000000000000000..be93afeae3a4861cc2424617a54b6ff2985ba627 GIT binary patch literal 320 zcmV-G0l)rk7RCwCd(lL(#K@`Aovk`@>1i>db zA{su3PDSG@XkDfA1w=_LIw2$y9SKp`TIVh#?o=eguK%o8Y~;`~$uBcI@6GJY%P8Bn zJ&&5lIF@L^)CmiWkwy?9Om%Qp`8n%DnrLDpt3TvC8>diY9q5PX;wV@5 z$@p4Hl78t%SjkQH|CM@9&$vG|<5}yIRhyesXRUPPxC;3%tpT00RJDsZgJ5 S`Gyq$0000}=*^e!uzVoA37xVvNE6e6;i*2%%L2 z7mHWmKR;R*=0vI1SZty};@xoq0#K3js-Pk#+|2!`v(TD*iIcy&sykb zu?Az~6E8+@ojJ$H18Ey|%L7Uj1{*Y09R@{(fFP)t80@)%!N=C}=I}#70*L zG@_n^BgYG%X4Romb-}5X!M7{gQsCY20N^0xBq9(b>aGcaXU5yTWQOZFfu3ydI!Y-} z%79VA-=uZWbUeK-=9s4bsu5@cXUXKZS{`6*MQYXs51^#9{wem_5~H-hKuTzu@X_zU zs9gdvsG1O%*mE=`Fi1(%6U!l?EfZY3e)Il;OdwP%YRSn^gZuKxaF|h66*zW%Ebp_!0Sz##$Cu7hsaT;(QnnQZQgRJvY4mJp%|d?tUb zqqH@FhQ9CKcjzcrwe=#m8>R<3&+n6E3yjit-o8OiAK$rs?~(n|%^4g`@nHX6M8fHQBWjgzVnU3(tAP zzb#GWL7(^tmB~*{lTs2s;&NM-N0Az)59Nvlrv8)H0@LYyv2p@-wS<4XyMMYiJDxWy zd9Lq^lkz?O>QqaYdDn}NqGMas(hIx_%JVHMC&43`H|TP!VkV8lvDbIM=lX|^uN~ZW zim!M?tTqbqd&ej~V2p}7&*iNy{`V|>CdBS%?tYa-SeYkE#TH>nqA7Et^wlhNGm0}{ zRvxpQd}rh&p#=6M0Fz_6#L-03PS}Wu^yN1Z*nbPc1urCO`+8#Qh#U*j^}hUerEMf_ za2zWu(E^$vLgXYUb>X0?TMtX5W|Yzl(vBLkL;$r`!$sSu(^oUr>NvF^)bjZyzyS8N V2gsz%RVV-e002ovPDHLkV1oZd_;&yR literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/showname.png b/eric/GUI/icons/palette/showname.png new file mode 100644 index 0000000000000000000000000000000000000000..5c5e1003c44260fd6fbda777b76b2f73ef8160e8 GIT binary patch literal 753 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 literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/text.png b/eric/GUI/icons/palette/text.png new file mode 100644 index 0000000000000000000000000000000000000000..0251c8b622c97454f0450edf0d6f8063d0359604 GIT binary patch literal 616 zcmV-u0+;=XP)?K@fm%?=K-yQ{)xW*#!dn41qu(A%$ID#74o|R=6TwnskD`gH^07tmOn7g@hpF ze#Y5zR+jT}ZY~LFZeZBEz1^8_XLo0g0f4qo(X~BG0Z;&#sso3^A(L4V_P=J&h9Qz?2+-Wm!{D z$n&ZZfLg6~P9YRVjl^nn2_S4V8h5kV>`3hYrT|g5+kH+tO<5rjWYB80KCt~1^GS2v z0+0*{BP?b6tqnki zb;|jNqTlnpY951s5Yua8B&vq5$qB`PB1>DUR^4;VOHkb zN(4v(a-^rgfy(~pI)tkKh$_xE0w^+J0kAFk7GMCW#q>!`Txk6O0000xAq}3yv(D!FNwJ{*>dXzdP!9MZGkC^f216 zGaE2~Pz5{3E%O$Evk501xZ16r^@m^FdeOQew8Y~)^Ql}`yG za_{+*mdAD7H>HHRS4_;9&;CW|O1$(svErTG`W=_f?EJS^W8w*!_RpoOF1Js+qV-Cz zgejwU%Q2I-zP7b17UVFq#H;bF2(9F2P~E$HflRF07GCCAH@0)0%{#DM^}{~i-08FU p{^+pG?~-g_lz8x-F^-9cL9#kQO5@o^L!h@AJYD@<);T3K0RR-xAq}3yv(D!FNwJ{*>dXzdP!9MZGkC^f216 zGaE2~Pz5{3E%O$Evk501xZ16r^@m^FdeOQew8Y~)^Ql}`yG za_{+*mdAD7H>HHRS4_;9&;CW|O1$(svErTG`W=_f?EJS^W8w*!_RpoOF1Js+qV-Cz zgejwU%Q2I-zP7b17UVFq#H;bF2(9F2P~E$HflRF07GCCAH@0)0%{#DM^}{~i-08FU p{^+pG?~-g_lz8x-F^-9cL9#kQO5@o^L!h@AJYD@<);T3K0RR- zHk)~p$?QfLV^C(Ppya{;48Q;kzyRvHLkMxH3i6O5!jJ#qoT%+}3s7(>>A5017Qi{r zNV$gz0Z8-SNwHf1dJ(_Rn-P*h56u={t@US>`dtVCsMR#V|7M1CIg0kL#{;y7HQPEg zs4FK0Lm=P!UzmIjG2I=a0p_}jkF{Ggs^nApkgCv2?d~^zw8r+RqXABrOONyYd%N1} z8PV5+3wiHT5Z5y-4J#0+Ks8Yt(Rh?T=cem5&62a)BdS@Co98bBcsU{ zA`Xloq+r<~ZKTU)s>AvJTGv;`A7Ukqk4%h(r#t`nEUyDErcd1WxnbAN9|G#1PuFoDKPy#s+H$7$6{gTX2lORW7FTWiuW)eX z$r*KO_Mb}j?U?!}V!zYWDaUWE<<9YwJW!P#Ud`;(qMvXuSV4NlyV5V_p~4T%4T7HjK=VQi9v$VAWy^~UI8y) z2oOL@B66o&wk)*Uot>F;{LgIBR<27-e2}yIWoOQuIsfJS|M&mPwAT192giRrZYm%b zE$g~;R*_zzMj$1ai4poTrphnGB$D+OX4Z_sQ{$$%z6#rYrF!X+!C=J-RJeW=Az=#{ z{F*<7-ra@tqZ4jhTc3!xk`g`i>;U0=!dAjB|CRzSVF?(2LMz>6Ns$oXN|S50ojR^h z_Vqh&%(*9Kab6W_-AZd88hYt!Ydwa96g}B^yw-VkXY$h~aq5xMRMnH$g^mi3wFN{!%q#J>B3^;pc5IF)P_t-Qi z$VFEWK72et_=<4Hh#2tv*htfbUdE+f!G;SbptZMl1kpO<4Vp$(t%Fe|7cHr3 z_+fZ0B_23P_tGgWO?0(qa$}LsxSn z93gR?q~1taV@@;j026=PDg>KiJEB8V%9B?~DQ*IhTrUs=iUe{rj;lsXTP9jRIOrpH zb^vY3QRIz^YRVkK3c@>5|1DptP_1HIvUHsjP4s1p7@%MaLxssx8_+RhG^*2aI*xMe z`auY<*F)2pBmxyy%0Vv?)=CwWseqX7Ud`0p{&OYciOA{;bZxAjJ%1wFr!_=@sE8re zMPZ~zx+VrECtzY1tRe+WMl6u7-5=eB%37$DAlEY#3jqROMJYFL(L}Vi*AinT$Vwlj zupd&`QN#v*3BHqr=Q1Q{8_g;%1@k3i<>1kp)sIX&jgFa(xc$xvnBKY!Np~#H=FXsZ za4!!0@ilpjqjS-XMl`7E6-AoFpn$#@Iw(c)CCpr>7c0vuN%@~h4 z?a$yux5C2v7vtM4I}tB+ptY$BZR767{v9Pey!c6UpDR*!ST|ISdC^t3)0uA)f{(sP zIOg1&+tO&rG$R!ojTcuwk8Rt3pft3wapOj$-8NKP6S3mCXR-aq?MQP4&Tgo(AK|Hf z@haI|YrEnvG8$DMM{QkIlzL`3t{eR>U%nh0HhhYzswzX)WVM6PE5hsEL$-(;QDC#^ z=xSa-yLE~oJ}|!~*T+xHpis=CDbtR7XFrI&`}U&omL{xPwHgJv55*vdd9$BDvwsdt zrcHtuR-A?h2`kwnk1eT}vHlHKOwUSZ9Lrd3SvF?Ooj}eA5wojtSNkKVO}4-*4dO_4 z2ljMtrfd zHRAsvMm_p_Pjsy3a~=-w&m!B?Lkf6s9G8NWYJw%<*eozzR5K zv1TAX)HDnmrc|4>R?tW3_O+odX;@1Z6+FF<7ClY%{cW17r|W$>l&^b5{e@34)3fP28~U7BNr(UFs7U3YaKd8Z!vwcKAUQpk^n^l| z-NqFAgsR{cQn-N!I7HVa({PxlRE)M#LT;7PLLx4zmE|T(^-B!0{QYU5Q6& zK+OWq5spzE-RbG@oAvqq+vg`*dMCRX3X$-dO=;HPY9~qF$t#6?NIcM#i=pnky{jZu zr|C}!9>ElsLe$-pZ;e;@RbqqP{BQWbSKvPMNP6c(Sf)a2jbO{bhDQXaFOHm7=E<%UCXviRnuA&IK zR8i4L{66p(9)p*dt9dfi2R`As%ai1HchB>`i!&4oITG2N_W=?ez@=U$-MRnr9XSYM z-_D1V?%*IEV;%!|k%#~r_=aw*;0qe@$W#E;-eV09(S)z~g|{d$5#SJAIM?=-!h=5; zL*3P!yXydI61tIvgB#w@z#A;$rv%NtwhC;t=cq>m%JA%#pQ{l4@Tz$eYk)#@pc$EA z@2S(Tipqm1-x0txKCAJr7*_1RST4a+4C9q-ha|l^ zg+Fj6`@K>V^tK5f#<68t2_v);S=VKO{tkT>WAo(_OTS*-%9ALGZ;V(OP^GtVnFIq-|Q- zCf3r5CNb?cZj#;XZn8W3H?uS2x!a9|MkHC(KDZYS_cHU%z2`gM&&)`^@6(+eGTq@( zCr~F)Cr~G_W}?llo8N3}@7#^G`A=@FtkKR_wLo~so`H{^>woTy)5b-AEuaTwSyntTT-R~kvV%prB9+3p zVFsJq@9%xKfA8D-bu-9dLy{zs$~96LqovdWOQRjC}0M}EC|R7G0qA0R4U{v_g7`A zqL8Zc$}H{+?l_Rjj$N4xd8?GqW-Nqk=F;ht-(MOTI?T$B6CXQs@>njLd9=~o(8N?# z6K;Wohr>PJzjYE6Py@PQG&Q#bbwd=wY63zLhiqcLD(p!H88N$1h^Zwg#Wift9fVFb zL#=}I?Kz+WY&r9*r!0T5DBuN(k?#G62EW+yK<{0SUApBt)DdA2;Xrjz?E2(f?8ek& zeD>yKIx!#3ET&@cd_J4aByu?`(Gw`g9t&%QkYTv&HUjy-twrC@7V}n%rt4fB#t{w$ za%UG)baiZWdi>1rH&@2ae{H4W7gxr4W!LL(Gidickw>^JA4PC?u=S*WII`)<14lkQ z(fMGXkxtCf^@(e9m(QIVx_o}*cyey$lqkh83cGs)rzy)J585?xg<2aJb();EhXd5n z$Q9f3Kgqk^SFpF&MPOS`-@sxr9{u#_;n81yy71j>bb1(<7ldbhVU3=M7}OgIkjZ3< z6&%D)qA-_9S7c&P%<=tj(e*!r`3&%WEqy=(L|MAaU2JEYNl!KF@KO~?60|+<1=pux zCQFG*Vv36LX%m)vfCIoe;4R@jtw^}Fj?(g?y-}q%+C#!)6_RcTb|Fh%!7UYdx9s^r z%pE{Cum!jYppDbFD>r1dw9k#2Lhp5LguDvn%ATm4*Q#C#g+!xywb~7Z)W?9cz;A!G zS4{*ss+TJgmAp!YE&=ZVgVlqd1_prCzxF*)X%MUbXJ&y9fS0OyvbJ|Y{m-aQ;D1lx b4*>=MQ6G%&07;s*00000NkvXXu0mjfVgmk} literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/tournerG.png b/eric/GUI/icons/palette/tournerG.png new file mode 100644 index 0000000000000000000000000000000000000000..f35fc28634d49de6a9763dd75a7dfc9118e1ba29 GIT binary patch literal 615 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 Hu0mjf?4E0X literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/type.png b/eric/GUI/icons/palette/type.png new file mode 100644 index 0000000000000000000000000000000000000000..256940f214a2b7665d27c27a02a047d7ec2f80e7 GIT binary patch literal 546 zcmV+-0^R+IP)CBPf0@P6FOts%9 zAiyi-H63e?kr<kQW8>le?v`RR^1M@GDgtKH zG|+Xu(-%ciNfI5nYcECYjXF~+pQHwa+-6RIx~`$FTjWKFZJL1vB6|T;aaX+>nXC(B_4|}dIAC4%A8o-?6lg@Hd-gj5&pMWQt_D#vSXh63C#2zHsOr8} zeZEk8V=r?7o{~r8iP#fHJ=GOds=uLD^8f)6Q>g!|DX*aIW!SBQ&w?QW+L+h!b36^T k`MY2yFcbLq1bzh=0Kw!6tX>`tDF6Tf07*qoM6N<$f(Z`k*Z=?k literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/type0.png b/eric/GUI/icons/palette/type0.png new file mode 100644 index 0000000000000000000000000000000000000000..256940f214a2b7665d27c27a02a047d7ec2f80e7 GIT binary patch literal 546 zcmV+-0^R+IP)CBPf0@P6FOts%9 zAiyi-H63e?kr<kQW8>le?v`RR^1M@GDgtKH zG|+Xu(-%ciNfI5nYcECYjXF~+pQHwa+-6RIx~`$FTjWKFZJL1vB6|T;aaX+>nXC(B_4|}dIAC4%A8o-?6lg@Hd-gj5&pMWQt_D#vSXh63C#2zHsOr8} zeZEk8V=r?7o{~r8iP#fHJ=GOds=uLD^8f)6Q>g!|DX*aIW!SBQ&w?QW+L+h!b36^T k`MY2yFcbLq1bzh=0Kw!6tX>`tDF6Tf07*qoM6N<$f(Z`k*Z=?k literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/type1.png b/eric/GUI/icons/palette/type1.png new file mode 100644 index 0000000000000000000000000000000000000000..ee017b668509610e27d7ce37175f0d3e53773324 GIT binary patch literal 688 zcmV;h0#E&kP)oXDgS^Sbr2LM2SJ>iI=BiB9Ua8Abm`zCPU0j^f(}wp5z)a( zi*Si;F>OBYM{>W;{l2~@9!m^u$h}R;U=F+-&IxaxU*7XRx#ucbmSL8IVa8()Fb9}9 zK)Gn5LSu9m?90zj24GnH z)!VObsl@Pb{e?;E3dQLn5Uhy!yH8s-qZUZh3~`)b<^JP(Q3#e-{KMxTc1pb#k#HEr z@Pi244{_tpgIW;?mPdT^<9Az#avs8Qeb^3%>-q4x1Mc>5>H3PA7eX259BDQ21&c3V ze{n_GlO%=518Am=y{3Wsz6QOs3(IK1b9#uQ0P45*Rm!m_T#7(AoFYCBz=E*a>Z50-Xt*GZ2Nkd^ z3#PUQt+kDAa~oNj9OQKxwPl(N3PI#iM8~Rt^m*m>-L-lY(wX}XTuX=1twU@6{3nOR zuh3-5m`VkhY$(xKm8&=J)wpND?sZ^vehtoiNc@`o)xD|oz^DuULR`FjOYIv?IQ{OZ zxFrFG#glP=&&njvkHa7?RF_rXvxdv=O5uscCk8kI;>_7|)tYR$ST>uJM?4q6ArJ=- zAR#72c^>iH03#3!(jj7<$|^*8#0vq8yAQ}aNv`{VQuM`SS~ntP{$?}>`0oLJ3orm} WKyA?SCM^m80000qFd-reDi&$95Jc2MgJ7YZjg}T^E!09(5DRUr1d9|35(tQe zAReH4QN=$u{6f_vQOLCD&rF8Dyhfj}i?hih=Gxe2-BSe@2 z$Hqm32t}Qc$fX;%?(aHv`uw9L5iZ)?8`fG36wQhnjpo~hkMC~J&&@94I1dq!n2sXk zF2XKNzj!?{zHk34{9cW_0fb=$K@fuL`BD&xlcNWZpA-g$rt0sXzrpbiO%EwL8{33L zE>2#!R2dr^pT#fL0wnhQ09@Axha(&hEXIK|qgomqeo`Add;sTE5CiF4`bJNuK)Q16 z`c*%S_ok#a5*n5RnqgfDbBY9%Xuk-(q#z4FB=R}Sb|J#mGZc{K zzNr|Q09`l0GFHKAHNn(ZfZMGTIA;jKX+MO$3J?wEj*2`0-w#oM3!2VA)h)0r8_5+U zUjajFWFoNbq1DTq5rIsEqM3Gr8S}gVaQA~@V(3j19HwWhZmGX=@^stVL@ah9@5%@8 zn9YM!KIR~~gAs6S9rKMjw^Y!TpD1Ga&)7JQzT}3~=>!zrgqg#AUYL8Ps4Z7jnxH95 zpf#63Z7#xULbX<&m4BEI)QE9hj*A!`vg;n!#b< zy~Ou*e00f-qD}(->4donAqElELlb8&?VJN`wvb5k+{c?%4gYc%kk+{mIGP00006 literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/type3.png b/eric/GUI/icons/palette/type3.png new file mode 100644 index 0000000000000000000000000000000000000000..986316bd6789b8fb7dc1231ba37b5ab962430e3b GIT binary patch literal 422 zcmV;X0a^ZuP)RWZq%`KjW}ze+OCvkjhBwfN$Hr+O9ml@4NI%H zooygoJV46EclQs~si=`|Kk%~3un0oj-dtblwNguEJkb|`JmdxP&jNAwt^pE6uQOVk z@}8EZmmDDX%T2OJw#%^$6Kuj6vS>kTla2?zY#^j#@``1cVjV?D)^nt9PdMf~bKi)) z)ZZ(h*apEI@#+!V_!)I|GV@L6CD>W=+aHn6Zp!`(Eteeg2^&JniR7T=NMX=-_Ywm0 z+)5so>~^xe=5b@|1y_KU6V3EL>VPePaQT$}WhE5;SL^{ifCu>Z0N(-(0J2?>o$c-X Qp#T5?07*qoM6N<$g20=&L;wH) literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/type4.png b/eric/GUI/icons/palette/type4.png new file mode 100644 index 0000000000000000000000000000000000000000..8d7aa1215f1322298a52b68f94067adecb2fa269 GIT binary patch literal 713 zcmV;)0yh1LP)> z+;DViz^rwpC$%aOrwlxQdAfCY^yFbb3>)EK4CiOBKI>(H&_v`aBwPrv!v~M{_xATb z^45;_8sXY4jTDu@EYQ4u0+fE1B$Ebbi|i{^`PwBDNl6AV+%7N%0EiolH~&<}<%2(Do?>_M80L5gCr13XTWNDJ;o zcy%2lLh~0==_n->c@Fd04a7e>Fz8*uDDG8}|6cIYos%JsWsx1*_lNk zCBmh_vZL8s^%A24$)|c~Q?Ut4chp<{&%3}#GAGB(l1Hv`54aL2t-=)4Vy0GBCg8ce vBdj+8SOnltdasQ@{V1&o)CAT!ehM%EAs9gr&n4Pl00000NkvXXu0mjf5?VS8 literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/type5.png b/eric/GUI/icons/palette/type5.png new file mode 100644 index 0000000000000000000000000000000000000000..730f8306f4286c3e28cdb11c38c9fc38b2de6fe3 GIT binary patch literal 1121 zcmV-n1fKheP)G2+dh^)nP_(C) z@t(ao_;(AOIQ2RI(rYI+c`|SBhP)*YkPRLfzwpD2aY>R(vb6l$FF#FH@f;!@e){Ew zC?Dz=VS`-?e!ofPZEy6pSjijBav<>i#h*WFZ*Tv)qoZ^3>1UpQ``~kjw&M9V+_~{H zXJe7*)}tW6eQVhCC&MosA0aY^c%!8dz>#NP<&Xp4u`Qe7IBs7w8XX%x_~I+uA06y` z{jIV7!N(pyVmZ`=Sde1{F@L~8Xlh&kz8!ciOKiZFNEo14N)W}1-CdDMp68SWZE^6jTD>kRn%O3Z^5#S$4wh0gppd(NO|IlGVE{9DoyQZ86DGEU9u@#3U*g3y zJn_Z(vF*JB?*T~nOH~D7w^NIYiy)Vp221JL%hj@QT~n*`SXU+hblfd$$7zLx4q>!; zZ}yK{s;U<&vH}FLLS?c!P|U|crIfv0lM26L<7upCkZzG|a9b@z-UiOt$&WkxcI+Lo z5FE-1%U~&+!ST+3np6ZfvKWpJJ)X$RS+&$zRyhnoxmHF@@2Z%=GsRJY)V$#gNC zjNb)CApw+n8Q7){90z&1e#f?qD{@)5q14I(UZ)Zu&PsKl84tj(&QCqXa{M9PbkC$R z#ZY`<7UYuCZb?jD!j>79553GVZ5<5D?Z+bu1gPaud-v~RZazso;I0&gKr>ZP(d=Cn z*_c>J=0gkfvml$e?G$qJS1{qOmc-O|mZ?u+<8UxUse_Ax@l-Rk8GMEUFF&~(b&o;2E$?wR1LjuBV-5G{K(Zf(1`!w zp5ZM$y?YL;wbHqK=H4|N;~z2GGgzjPGy^Ob3`Sx*#}TrI6uI<`p(_c~P|Jh|Mk{rI zA|*B0xAVyZQdy8OfDB19os3>%Hh0D%wrxpkJzBy;LiwSJz$Aoa9!DQ$&;5Ih*T|E5q nHE%_5ZSvo_G8eU00000NkvXXu0mjflfn?J literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/undo.png b/eric/GUI/icons/palette/undo.png new file mode 100644 index 0000000000000000000000000000000000000000..f9d0347f70506fb37d3f75a02c664c6a957dc045 GIT binary patch literal 1103 zcmV-V1hD&wP)Yoq?D9Yg(!*Cq%A%0qm|%Pi3_3JP?dA@2eiPkr(US49tu5F zJwzb2MHT7=RjI0~s!B^Q&?-nk5CLL^@FPyl+QG5CyPe&xt z-uvF0G4nhR&vS4*=kY%QEj+;(Yo+}tV}ahV1B`PN7i%CgivndO3dFyU?lqwAG?(D{gBSViF8vipV55uD>Mr&|- z{p6`%ild)hL(=3pw8z5nqle$|f4sa}QvN#alh058dTeY82lw^h4H2bvH6mgeDE`YI zrh|zXXTtgL+rD^6L`woSnW76<%Xqyvi*4PRmbBu4z&B@qUikaQBP8M)`d?1U=HWZH z1r`W_vd1sh@c#bot!c%Qz)yeW5Q{NvNE@iR6-i);)Lfzn7zaN%F*`n?;ncaw0O2t# zszwZl;Hh1(9)Upp6E~}f>oIT<{<*@+9)}!P>C4(v4Ey@aL2#H@%Nd7mXfWd@EGvP0 z{w|c1xy_1@EtD8^jl(ozn3`EsD?=?M@9X2ES@BI%`!&fXQwYnbRia4L(*Vom5uDy1 z?II0dojLzI8ILJMTrylDP0aa~8G^8choqlcGbva;nz!7R6Q&ll+&?b++6yisgZ5SF zgcXHIxYp$@SR*)VB47#Uep`L@r8H*dmcj(Mq6voxA%Xyigcl{kx~%U++k9<1rPrN4JUvmQjep}l_b#JWaRW1ERy@)s&kJCfKppe(-^ip8XdeYJ8 zMI@cce3xm?QR>-^DydeA&{fKZDRW-Sa{nX|Dy002ovPDHLkV1i2V2|EA) literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/palette/vector.png b/eric/GUI/icons/palette/vector.png new file mode 100644 index 0000000000000000000000000000000000000000..bf821aa6a026a4405ff3bd2faaa789765501f562 GIT binary patch literal 1080 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 JPDHLkV1k06D?0!H literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/brushed/PaletteTitleBarH.png b/eric/GUI/icons/themes/brushed/PaletteTitleBarH.png new file mode 100644 index 0000000000000000000000000000000000000000..4d03a48eb716d891c91bec72c9a96a934a804760 GIT binary patch literal 2534 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 literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/brushed/PaletteTitleBarN.png b/eric/GUI/icons/themes/brushed/PaletteTitleBarN.png new file mode 100644 index 0000000000000000000000000000000000000000..505a14065042465d288caf71f9990db248af2a28 GIT binary patch literal 2543 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 MX)Q!t84&;gJGMelEC2ui literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/brushed/createmacro.png b/eric/GUI/icons/themes/brushed/createmacro.png new file mode 100644 index 0000000000000000000000000000000000000000..814eeabc5e298c5d12715275b9157c8013bf72c0 GIT binary patch literal 830 zcmV-E1Ht@>P)@x5f@QXi^7P6YFMo5|SDcMj|AXL7iEwAmBh^c)?e` zBlr4vJi)1$rYE_1_nzrp^L5>MhUayz@em@Nk4w_E3TCG&C*PlIpN@vuU z%Vo;tawIr_oOOI`OuM+eWX1IKG&!A4Inh`cVl1$3xL((m+=?PG?CJCQs8XpgxpJxW zML|v>eDIWBa2jl2CT3pggqzu#*&xrr1)OA#>BE;yCTU}1LyjYn2+hyW)7sh^WilD5 z-`(A1FDDX-7W?l|olf)S`}_M6!#I^n zF$Pjt5TrmJdVIe%?Zq6Bip64-&1TsnXy`+S`Dk75F}uz72wD|(FOyatP3?9&W3a{I zIK-#rWgg>uczDRT5O~V0+Mxs1@g8%zTrIIi$W}hD@E2aNHON3j$Ux@!_?Y{_U{K;M z(mbOGpP2wN=6Bl#s~2oMH#f(`!r^dB{!C6ywVhm5Rch2J-Pi9Qs#4eQCT7=@^mo6j zUp673P>8*?wY5cRttR!=YL)Kp?)W>|^xUsT&Zsq&3t?|>k4d5O(2(d)2{1uke~7+L zCvi9&T#ZQnpQop+Lt+a-2v=8EX>oCpJ}xb>m*HU)2<8ewsLcK1t$(A5;)zw(NS?8kLRxv zy1BWb^w}A602leX5VEP)@x5f@QXi^7P6YFMo5|SDcMj|AXL7iEwAmBh^c)?e` zBlr4vJi)1$rYE_1_nzrp^L5>MhUayz@em@Nk4w_E3TCG&C*PlIpN@vuU z%Vo;tawIr_oOOI`OuM+eWX1IKG&!A4Inh`cVl1$3xL((m+=?PG?CJCQs8XpgxpJxW zML|v>eDIWBa2jl2CT3pggqzu#*&xrr1)OA#>BE;yCTU}1LyjYn2+hyW)7sh^WilD5 z-`(A1FDDX-7W?l|olf)S`}_M6!#I^n zF$Pjt5TrmJdVIe%?Zq6Bip64-&1TsnXy`+S`Dk75F}uz72wD|(FOyatP3?9&W3a{I zIK-#rWgg>uczDRT5O~V0+Mxs1@g8%zTrIIi$W}hD@E2aNHON3j$Ux@!_?Y{_U{K;M z(mbOGpP2wN=6Bl#s~2oMH#f(`!r^dB{!C6ywVhm5Rch2J-Pi9Qs#4eQCT7=@^mo6j zUp673P>8*?wY5cRttR!=YL)Kp?)W>|^xUsT&Zsq&3t?|>k4d5O(2(d)2{1uke~7+L zCvi9&T#ZQnpQop+Lt+a-2v=8EX>oCpJ}xb>m*HU)2<8ewsLcK1t$(A5;)zw(NS?8kLRxv zy1BWb^w}A602leX5VEbRFTKYlA*F96vid zqiVHEf&<8@p-@P#9UpTb8jX_6<&qB$FAUKaxj*HNv613-IAjjr^!xqvv(sU6KRTTk z4pCE3$_UH`AFzUzD&z82W39%Z&H!+d#c#B)TrN{Ko0a|hi;MImou*_mX?oG>>ME;z zcz9?Uzp=4F!C=rtrdzAh>rbEQ_S-ic`}*(^J-&CBoZ(y2&e_>n>+NEA=EY)>KmLAy zU*^y+6bhUJDZCJ*5JwD?_;Pe4#|u)Y&(e|Z*zE#vYEDaeRflSt0AH7N z@@{XB$;4tY?mt~wL1CE+oRzY%7P$w@%l5>kr>95ABoYZ}rRLPQ4RwTV2OkdPGh)#U zL(?>qQp4cfIAT_SJs@G65$Y!riHwZx^?IxrDT-9g)E)z??Mc>{$K#Qg0PKNUsZ@#v z{eg_1pPw@k-0v(ba1GY$b?OfWR4SF|)#fI*VI%G+bUTO~Y&VwCSjA9RSdI8_>0^mw zYinyJMPWC{566wAfz@|vV<&RPu_MIXZZ~ziU2ccNVYbYBP000&U0ssI2y4|4R0000PbVXQnQ*UN; zcVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBUzz)3_wRCwB~R6B0MKoAA9;wuosA_@g1 zsfZAyrgM(LSwhV)#V*eCIA2c07*qoM6N<$f^NX^QUCw| literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/brushed/delmacrosel.png b/eric/GUI/icons/themes/brushed/delmacrosel.png new file mode 100644 index 0000000000000000000000000000000000000000..e7c91921089187c791c970bcc66baafc5bd10226 GIT binary patch literal 548 zcmV+<0^9wGP)P000&U0ssI2y4|4R0000PbVXQnQ*UN; zcVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBUz#z{m$RCwB~RLx4mKoE{0HrN`}))Kr3 zLZt|$2dTb-H_t=N7?NWq)J4oQmc8-t1kg-M#`GaCC43HS&}J zAiG%3Qf#C>FYO`#5D;{Vzz7~S!qqYY5if5rk1f~;1f9wT`-2FC_#V*&KkBqbq<9$L zk(4qm(2X~zYE{--tQtGd@$uoFvf(Wpz;7L#j?w*CttO2i*j6hG9DjCWc^h1Huv4`D z5NbQkvy8Wnbk9w|0R#CjLG}tpyyPB2f62?mfSE3)IlA!u`pQCQQ_|&slx%M2fs!H>-Cy{aUw3ebl_x0NJDR7zz4)h>a^xJ+7=VrmH|Xk&jBNiEik9$4#*NMrp-SvpjNA0Hp#qe)Zj(sq;A zs17)#w0|zC4T1=tT65I>0(Jm6$nv6v{GFEmRwnG6U*rwQh^7-znIlaCq3azxcD`5@EthgoKN+Ubx6Vz% z*NI?TZLDGff!OH8ia@+uIV2sFQ^|0I?IVTA56DCg`|_zTeK}hJd6t>r3lm-&TqR@d zW6tDX*3#&^R2^-kWea^bM;BYOKZ&iC+L#)^z!y8Z&e61L4Yn09HO72 zXwt>zc$TaVK<29|ZHF(Z)KIIqK~eLgq3p``zK%3s@vP!QD0lY3jZlIN#$TS0ez-YalzG%oQF{<`kVrw z?Lr^Xf;p8k6YiE#QiFAKdZ1L&rEka}N=o?4Jw1u=8 zbC4qY^O$JMbKq-jSW=9-{?ZqLKye=u=)?8b5<>+rDct@V?zDMDo}}!2H)7$@)Z|Vl zNvM1k-P=in>60eXu%NFknGwZ1{pw|mj_$rX*x3v(qu$q39-3rKwBROF0;|F;&NQ_i ziM$SJBttFiH5I8mwH~bYRgsYs`dZqWDM?57$m|%>3uR^{3fT$=SX*#dtF{K#;ll!r zFf?^@hDQ(q)_lLfcWH{Y*&!OmyL$ZR`ismrb@=W;#@;=>sI^M7G|>_VH#av$I4XoA zF}&vO5}S}*$&Uu!U@DMiP*{rxowy{OzKZypV0%=2H^`oa_@W?1bzet(=xDP{pY{I*4FeNo9ES zhRb3xa`>JXqSd(mk@jJ!U|hHX&{}H;0EY0zorc)H8ck93`PN4-0xM>nAJ_5@CU|%7 zjY(R+Rk;TtjdE)z{T<1-Q4Rm52~1VjMHR?#^65??Wr4ZF+GGWan#%6Liv0-~A_QHN z@1V)r>h7Ef-lOO>ZxhijM2K=swIyY&7aQX(?EZ<DY(umM*jEulPh3`le>=D17CLZR)llw=1IMY(=Ic?{qxU%2F|7zoVeM zE06B%ww7Ag32aG*hK?Vu23&uw1-NZ>7&Zro?p%reEe|;!t9%*nzs75W4HEiwpBDIx z9oMVP{d7`SDeUqkFRWn^>mHe_{>sKm_(UFewdLeHn6rOfl>61X{~|F|{WW4v*Eqq4 zllx)=O|JD9n4@=td(Z@nI7G*5hPD2(W9II$`m}g-bzrbc2u`h=F^RI^d&6=(KaRKQ l6AV>sb8U*sME;Ke0|0OF>n=Os=gR;9002ovPDHLkV1f>ggFXNN literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/brushed/macrospanelback.gif b/eric/GUI/icons/themes/brushed/macrospanelback.gif new file mode 100644 index 0000000000000000000000000000000000000000..d026d6b1212ef23e54f0130daa4bc814d7f434e3 GIT binary patch literal 108 zcmZ?wbhEHbWMp{3+`z!_|NsBDpZ_WTWMKdS9S{MMVPJA@>F+%F_WhKQ4Tm~=@9HG) zs}#=Y6pEZF@@oa>?Op6LC#CM*WSDomX2I=`P4KQy(1@e8oNym*6^)bnzq&; IkdeU}00`$R-2eap literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/brushed/menubar.gif b/eric/GUI/icons/themes/brushed/menubar.gif new file mode 100644 index 0000000000000000000000000000000000000000..982dc3fd6bf9bc0e9c19e08617c5251d52864456 GIT binary patch literal 924 zcmV;N17rM0Nk%w1VHpDt0J8u9#l^+S%F4C1wb9Yhy1Kf}&CPRjbHTyE+}zx;v9Z0q zy{xRPsi~>e)zzh?rGkQjA^8LV00000EC2ui02u=h000F4Fvv-3xj5_1yZvD3jpSgS zXsWJk}j*pO$l9QB`mI?=%nwy-R z0H2_tqNAi_rl+N-r(RvGuCFAjsk5}TwzrdEm%7T1y&TG)m z($mq^*3^B>%iG-D$=}|{m%+T{=I7|?>bI+9?y#-!^6~Ur_4Bb~xclt<{_CB{2?Hmt zpe2He!f9*95Zkqf4kJpONHLp2gBUYv+&B&xz<(hBL-rfl?w(0`vMPvNNs?v2mjVYK zCGF_U_P`O&4*mL=bTIZ4%?3@TQu;>*W1r9P-n zT`pBh7O6~|2#cy6$~I^-h;V<(owl>CTee5fn%&E{Z&R>T?Z=;%e1lM z$B-kJMVodl(aV_I+VvT?bLY)(>E6w3Ij>&I1}Faw`?d9A!iBZUev`?q}{Y>>#b}aiRqe= z^7`hSjd~jFu)-4C&OtCtTxfBx|M&!0DMp8Wdt z`_pHj@aK;o-u(FS{qNtu&!6A@_wV2PcQ3wv`_4cFQ2faPR;2?XL3T2*iY6%ZC4Euo V3h+5%WzX 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 R(y@(;`y}M#c#8-C06T-!{J#JI literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/brushed/titlebar.gif b/eric/GUI/icons/themes/brushed/titlebar.gif new file mode 100644 index 0000000000000000000000000000000000000000..07f6b98821c95a925421135776d820c467e32ae3 GIT binary patch literal 1284 zcmV+f1^fC(Nk%w1VHX1!0J8u9!NI}v^YhNm&a$$ywY9aqy}i-V(Z$8Z%F4=tfPt>A zuDQ9nrKP3Z+}zdG)v2keA^8LV00000EC2ui02c!o000F45XecZy*TU5yZ>M)j$~<` zXsWJk>%MR-&vb3yTcGcJ@BhG{a7Zi~kI1BQ$!t2G(5Q4uty-_xtai)odcQ;53_&iN z&*-#Tz+SiC@VIdFX%FD&g1kcdX z($fpo)&-QVD2yREF{=H%zAsi2IXn(XWGeCqS{_V?+yy!+n$A=dx{QX5Fn znZbhy6DmZ=prONu5F<*QNb!Niix@L9+sJWYL4hCtLwXbmvShfE;`pgdsSh1JRPbWv zn@O{#&2uaLq1?%{CpeQLM|K=aw5ZXe%Q9Akn6xQUq0O9Xocfd`P;MrD+Q=$UYY3NM zU*2p<)+NkE@8IDa7gp?8u;cz=?Mm0{*133r7K|#DYE`~~1NTk3w6NjBi2eQ@X?3q- z#*pgf@`&M# z9)1YoPeT$J;$~C7EU-I%c9k9@=P^kP0TBn^*qSYy<@@Oimb5>qzDvNRzD(R}MM*66$u9caijtVgP>aDH9s_Ueb zqIxQym`Vxiu%V9X=dZ|Ksj8v7=GrX(u87VmYk6N*J0`Bq7TRL30rm;nw{DGkrzhm% z`6;R3dOKyQmIA6Rx63l?=(Y6nHLbMN+InWT@;=KiuiUmPaJO;_OYFG_8~fj}0~6e^ zk@5N~alh8qYVpMw-;1wO8F%dQjun5bFSY=e3@^kc9|^3wdNQobiQ{^j=fWzcYqQG$ zMx64tDRUXC$RpSLGtfk9ym4(olkBX-KPtVmuMe}pGRy~8y)L^@N9_Wy^E$n>u0tn! z^w_i}O=HtugZ=N*%4R*a!ElRfwcK&HOtaQ)(?GG>eCKv+(MFS9Hqm}h{56b`vh6l~ zc&}VH-3jxj@YM}hZu!!V-kRGBxZr_<4m#mNr)_%TJ)fNQn~n$j_~bW-)_C5j z>fE`~e~0{e=%V)?IO%8yuRH3SudVv(m%r@#>r~GTJM%avpEK>Y7k~Tkx$n;V_P$s2 z@#)rgjeV{vuRMKqtsfV8vEf3#K0a7eFLk?_i$6a2;d{p$H8a0RTJchQQ$f literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/brushed/verticalseparator.png b/eric/GUI/icons/themes/brushed/verticalseparator.png new file mode 100644 index 0000000000000000000000000000000000000000..d379c0b8c6903f44c029fcc4a304a1b1038dd907 GIT binary patch literal 2191 zcmV;A2ypj_P)*$yW473dKz z4ZBcv)(9FfSvKWFC&?1UF}q`0nT>j(5DP{4(_KSnu#t48iL0)uBM#H(8vVGEAxm5X zor+I}&LFO2#w!{bP6xW2yjIErha+pB5z6Urp}%}b`J!>>!c+sgJg=4XT$>e}Uu z_)>H|MtFOBix?s!j}hd)F^+6Z=nS8u5d-m*{qTA52~IZFj<()WFOsNVJGv&UD|R1x zmtRNFMH6!^5kokD+eqKiskQv!NBSI3g;}__F}JRxYdB^5o5jG>(39sYR?3u0&`yrzVdB91)#MY8F} zZB#@}{pOv)=3_stEX}7F!(?0x736$^HbPh4(+18_iiM3A$Urex3`3$f=-%+U-Kfyd zhoP|_p-nTHhwV4og;+iZSmQ5=3u7Ab z&thBimt}uJB96f+Y<&o8hw!~>#+c-1ANxzjOISx;$4GOmn?+5&r0r6A>GkQhC7!XL zNzX{;+GjqI@YA=wL)WAGk@_j71sg_>dmc%@p8d>uk8DIgt2RP3i-_WW#B_n;gfB<1 zb*#O>X2oP%Z0_Cg)?P1o3Y)kP;(RnvNQNo;N6T|7DYgt4k=8yG(E zw!b#9j$_I>Qa&cz)_(W*_nJfdtM%K8zce3I3acuh7GV~lf?9R+inhc}EBUShlVc8D zqaEc`{x|wzj@Q@M0?5uah>`e}@7mshHv9Fwr{#mr-RRemyE#8Y8@(eaRl7qq%xBF; z;@h&E<3fb#h}X`0sOac2hOHQZs7AL}=&Z!+64RcG;!z1cgP4*(#CUJkr;KfpW=ScM zAdoQHUAv26h?b0g6pEJFoX_HjaZB;E|Jc46u~y4p#h;?THe9ODSE3z65XQuK#Q2CB zpk>Ay@Q!>YBCf?>$<=-rw|^%m^X^RY{}{Q-)5ab)~H+`uEC6_ z(0$7hNJ0wTx13~?Ut=8Uy2(2V_9To1hQ#VozXxpcmx3YIPw_$KUUQ4~N_!Pd@qM_= ze)vxzPk!C-I{AcwS7bGOLBeHm6sdv6^gM1J(_T{$LO32dmdoc$9yfG$ez;=LT8wY$;LB3bfesKVkC6-eA`feQ4 zY(lHXvn8(|$NioDDA*WlUMYfUc3dvkWy^WpUohoP<$<@kwAk_vNp$IW`SLlpRz)$Xqlsv3hn! zLu!k#8WIz2)-@tNZ}OL#lPKZhr~TPrQ*%_|*J4xgUg|`4F1nRZJD!Purt|R4d|G=| zp}hafF`f5tDE1R}AFW;J{13nK*A(yZ&sXYMa&LDQCpk#my4>^bE5eS(`z0)+iiHAJg4}J`MjdC@PhvZ7ywwmH4#fd R;S&G=002ovPDHLkV1n^cT~q)7 literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/brushed/zcborder.gif b/eric/GUI/icons/themes/brushed/zcborder.gif new file mode 100644 index 0000000000000000000000000000000000000000..2c0a9e95e3141e8a78c0061c75b98c5338720889 GIT binary patch literal 185 zcmV;q07m~uNk%w1VF3V50K@6rW(?(J$v9*AYJ!^o{Qmj>=XVa)H=jQ; zzj*QJ$9D#EQ%i^x$W~I*fM~vV`-YOL2GqAqOsuS|KqG)`VKKp% zZ=NzorewkOGqbSBE2%zz^61WutK2+%H?LfTXtuC-hO1#@1RBEhpMmkuukR1;++o~w z{0f>^fBpQqck71t@7{o1fvOoEOuv8s{__6iw&e@31Qi=QyP&WLge@j1ji~_W0H8}5 zS=fPWEc)SohJ*!La6$kRBjfik??gldS#W6vIve5<(?(J$v9*AYJ!^o{Qmj>=XVa)H=jQ; zzj*QJ$9D#EQ%i^xt-re@D;dJ(u zTt71li-on_xzi^P@86@Ms=j>De2C_(!cw>zMn<3^O#c}e|NQ#?;LaV!O~d4`ib?*QG002ovPDHLkV1foMBQyX2 literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/brushed/zgrowbutton.png b/eric/GUI/icons/themes/brushed/zgrowbutton.png new file mode 100644 index 0000000000000000000000000000000000000000..cd3c2eb71bbb595c448dbd4dbc977c9f4def2c4d GIT binary patch literal 298 zcmV+_0oDGAP)f_Q*a8F?004J7ORW+YFaQ7m07*qoM6N<$f=jP;0RR91 literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/brushed/zgrowbuttonover.png b/eric/GUI/icons/themes/brushed/zgrowbuttonover.png new file mode 100644 index 0000000000000000000000000000000000000000..60881c6994372cac38f967aea0c6a0bb32448ffb GIT binary patch literal 301 zcmeAS@N?(olHy`uVBq!ia0vp^!ayvzpq x@HEOK-C1JE%M>44$rjF6*2UngFQwbN2uM literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/brushed/zoombox.png b/eric/GUI/icons/themes/brushed/zoombox.png new file mode 100644 index 0000000000000000000000000000000000000000..fef3cce9488d616dd129a8c69175a93ef7970fa7 GIT binary patch literal 492 zcmV5!if%0|LwJV`~{2b|ZH%D))3%_tbcT@p$}ID}w9wT94_b(`ilS zdcCg6Y_(d>xw0(n`q+2}|E%oYZZ}rdY5fcQ>hn&t8WGwLCg1IL!{M;g=~Pv9JRV1* zk??-M7j85f?k7U`44A9cDoxXVzn^8<`FzIqIF7-2o+n8XMG7ZvJH$}v)TOo6BdhwE&~a$B$xsTogW%lM|c_ zi1Zl9l&D1zMEwOVq+CVocKto=TDNqOtB4|6h(wDvIzG`*LTc=#g3c&*br$MmIQng7 zxcC0}&iT$UM59rRv7#sd0QIL*tCh3a+K1GrH^DTaQ8<+rGii~tm{}tTgxo-fkO~vs z++M4g-C=D3F9m6c@N{1N+&|p$R?g)USl)?Qj)62nn1YlpK3B*Scv09i^Dfq8AtcQ( zK%b~~yG?o~u*L4<7VJi&i39<33st3epWj2AO=gae28sf+2nGUzUkLJUKf|!I!UO-; zx2=6I`V;l##rZ_wTY8EUSO(`jopzibZA*rQJ8AablIvIfSO zCRY%`q5sl~@Lef_d4)pjL9%&ky&fD*6(KT?$$=xJ-CwdiW$|%&V|VyyAYJ=IX1=q% z_ne4V%egt~?`KX*I690ZuCHD)PqXqc91fF_$g(V~3Z+7_n2Ia)A3#BfSxu`GWr)RM pnxlNFm=lwd^x0@Mrt-f63;@c2hZtYx>B9g3002ovPDHLkV1hoo;3@zB literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/brushed/zreducebuttonover.png b/eric/GUI/icons/themes/brushed/zreducebuttonover.png new file mode 100644 index 0000000000000000000000000000000000000000..cd790e700e93c9bbc09e59bc79eb2e3b4164d426 GIT binary patch literal 499 zcmVpZ;N9Gnd5T4D@D02YX5AlSWkCq$c&u)q%n zNhW4CW)@b$`XSVTL;LszctoX@Irv3bIe6Ha*;rUunV6Y~(trEz9iV0jWj$_wQ4TI% zpiVY+b_U`A)6btjfqn*R<`t6W;S=KIgvj}%9{LQvh3^}q-qA+|Lm2%jU)?3P?uySW7W_zZ7z!cL2h7UXJ%nRw*2qkzql+! zlVTAO5&ZG>gP^cDilRS%YFfH}|Ne!hnU$3dD8#xN-&fI?XDXD4i(HpOmoA&?z_h;L=XaE2I{|5vh z5{Uo*1>*nz6@RiYGBEHn=r8~Q$P5M+zYixpSMRmR&b4}Z`+2Q!!n|b*)-|x0oLs15 z*gP*!=uORm1AGy$KdzGO?|iuW_!~{}<`pGcwPNdT=zQyZQMEr#ucAj_^8Qn^rM717 KzCV?N!5RQ6BUR}D literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/common/JTreefoldopened.gif b/eric/GUI/icons/themes/common/JTreefoldopened.gif new file mode 100644 index 0000000000000000000000000000000000000000..c6e8cb97617f94f1e0546159bc64274c1012b23a GIT binary patch literal 161 zcmZ?wbhEHb6k-r&*v!CSY;64D>#xN-&fI?XDXD4i(HpOmoA&?z_h;L=XaE2I{|5vh z5{Uo*1>*nz6@RiYGBEHn=r8~Q$P5M+zYixpSMRmR&b4}Z`+2Q!!n|b*)-|x0oLs15 z*gP*!=uORm1AGy$KdzGO?|iuW_!~{}<`pGcwPNdT=zQyZQMEr#ucAj_^8Qn^rM717 KzCV?N!5RQ6BUR}D literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/common/JTreeleaf_0.gif b/eric/GUI/icons/themes/common/JTreeleaf_0.gif new file mode 100644 index 0000000000000000000000000000000000000000..12e4426561063dac8feb76fe501fa88a8f5e9526 GIT binary patch literal 276 zcmV+v0qg!pNk%w1VGjTk0K^{vVt1*kwb$(L_i%*0iJ8b|d%9wEo5RfG+1~DCb&^zS zty^uFy}`_PhMaAEoL+LQWOa|r(AQ36p`otTP-di5YNem7)L(YE%hTv`g}|DnwUM2# zXn2u%hpD~B;s5{tA^8LW0018VEC2ui01p5Y000G%;3tk`X`U!S0qFOL60(R?NfDKl z9mBFHlF>~dKpX-AizT4oj4DNd0b&3U2oO>Xpox4U8o(g?8BhiogI5$W6cmug1A*}* zN{Nde(ph8z1`Hz%1{ZJ+A`24$8-ffQ02gE;2@?cT2~`CdlLiU_1Oo+n7a0UiBMER2 akpK`7a3uyJ5RxK@C>tCNExo=bApkq+jA(!W literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/common/JTreeleaf_1.gif b/eric/GUI/icons/themes/common/JTreeleaf_1.gif new file mode 100644 index 0000000000000000000000000000000000000000..47a2a1a42a51b5f00886d62bc70b3fc08e01731f GIT binary patch literal 286 zcmV+(0pb2fNk%w1VGjTk0K^{v@bUO?guSY@*S*2a?y>GvYO9f*uZft)V|S`zb(`aW z;3tk`X`bj&A?PQG7308VaTHas z1dfA`l>-34SO^3bi=Z$W6^Mw$B!M^_nm`7EL-|lRh(JRW$ZZl`5hd|pLL`jMVoYja z?h}Y3AV>^G0~!}h9U=}E2nK%x1{wetbruIv4OAK)1dtyI1p)^F4|f#DJ4aw_@Bjb+ literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/common/JTreeleaf_2.gif b/eric/GUI/icons/themes/common/JTreeleaf_2.gif new file mode 100644 index 0000000000000000000000000000000000000000..051a653113f9f1de392c74a2e963e7ebe672f0c3 GIT binary patch literal 263 zcmV+i0r>t$Nk%w1VGjTk0K^{vrG;1i{``hrOZ)lp>*d}3{{Qjr=rd-SxX$Cb&*rz# z=eEz~|Ns8}|NsB~|EzRh{{H{qe_9V_y-}9iQK>`(Ga?6g6c~IQe|CaS9UB=B5s?CHiwqK%5(1hRfhP+(4oXl32zN0uFsN-R NtSKh1u(2N@06Uu<|NZ~_@86$) zK~0O~?mBLDyZ literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/common/MCreateDlogBackground.gif b/eric/GUI/icons/themes/common/MCreateDlogBackground.gif new file mode 100644 index 0000000000000000000000000000000000000000..dbcaaf1e9688cf95ca4a34edd1cb39f7830e9780 GIT binary patch literal 185 zcmV;q07m~uNk%w1VF3V80K@&d$!l!otGB z!N)psHmx}t**|_&CAQm z!^6YCz`(k?x~i(HA^8LV00000EC2ui0096{000FxAY&MaW=hg9Z0tr+PrNLazV00N+9u7zyj!~I~s;1B>i^VnrE literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/common/Mcomments.png b/eric/GUI/icons/themes/common/Mcomments.png new file mode 100644 index 0000000000000000000000000000000000000000..cf46a4042c45235431c48f27a59f8cc678708232 GIT binary patch literal 825 zcmV-91IGM`P)*aE(@uFO!ot-VpIy*b3g-p63 zrTi>5HrJ}9-RHEwU#5+XA|(d4Y=aLTGVG<@E)x6EmX?={Z1$154oU(Lni~^)VK?kYOT=Ro6~fbn(7dr1 zcEf%&jjw-n4O0jOU)tCW`{4~3c3~(??1t%J{Gf+VC7c2TL8_?1q;! zIa|&o5TOvune>)3*V81ioS}gEs~96!Fy)o9{~mcfXku-<|fBG00000NkvXXu0mjf D2~v38 literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/common/Mnext.png b/eric/GUI/icons/themes/common/Mnext.png new file mode 100644 index 0000000000000000000000000000000000000000..7ae02977a5e12180e9dc84879f1c7057ddb3a145 GIT binary patch literal 643 zcmV-}0(||6P)hzyXWtMz!<|h!vbO7X zcXqko!F)3+LfSK0+jZSu z50_V$zMbSx0N^sG@RG6K*C$;-YYP2XrxlA_d+#w6Vh)i0==j*7o1dFQKA*QhFElOK z4Dlbun0f;DX}aAm&d$$6+4&L(GYRYUI!;bcL)k=1Ao5>CRAh1AhHTnh&}y};dpnM& z)9HM=3mgR0A1WRm9lKzyBHi d_XOSr7y!J>2M}G1n`!_6002ovPDHLkV1hYL9@+o^ literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/common/animation.png b/eric/GUI/icons/themes/common/animation.png new file mode 100644 index 0000000000000000000000000000000000000000..7730c625f360275251a5602215ba20820c82ab6e GIT binary patch literal 1056 zcmV+*1mF9KP)pP0j<<~;V0z6flDfS%du3PDsG4a5?8LkrJw?q5Em#pRLY^{k`JjpfiMVFl$hqr z@yB|1XZB;3ccuxlQU|%TF^cgKWA$YC!(C%O-#P#mU`?a{^zzAoo$5TO8_8u3Jee8i74 z)49I1v~;%7XugWXKqn7q2x0IFhK3GcmH$kR%-#9E8+Y(M=oL7Wsn4>gp+47WI#t3H zEEp-B=w&Lk%H^_3v;J&Wy-PMoZI9kX^qDhib9E1VGKHDhS$S%rKZFn=%@x$%y_IOqr~?D6Cqa&1hD89@(+u-- zb0`#wI68I|FUv1+@7`Utsia>TRMiM#qE@f{73oeW?*p5M$*4X!9Q9gFnawm!EG#Uj z;^R0r?%esASXrTs19$|`bvb%_dnJe}fvrShpwo@0VSzNyE9(1bVF@A-KIZ4=RoczW z%=~9iVn#|N>%qZ;2P6a6=>1J30L@pOFQp=rM)6Pqp6k*HT>@dN-|6XTI<^173o$Cq zg+c+DOy*Cjj1L9|27*YHaH}xQ7AoQ$4h;<|ZT-MsFG%5fCg{jgR^)Oya*1MC=703(9G{t-M1jnWTP@K|Y^TTKh!1td<&4FO6ES*Uwg~YvuMvv?YM8KBL;> z*3BDewOUxB9G9BcspPg=<_T&xM+iVs2$3QWJWr=m|E{gAy^i<9g+XAnO#rkn{_FU? a00RK(`6M1>DEIaN0000MC?yU*VrzWDI$&F2^IzJ!K` zGN1y*pDbVj9S{jJgMq~$;H2m3y+JR|YW_^{kW9%8a$L3U%7c9dQ_qz6Dpsruc6k4P VN>hQy5}CdeDrqO@xG*qS0|48CIavSz literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/common/chkboxON.gif b/eric/GUI/icons/themes/common/chkboxON.gif new file mode 100644 index 0000000000000000000000000000000000000000..bc86517cc10bcd382a4c1a9f3d40367b11cbdf38 GIT binary patch literal 217 zcmV;~04D!ONk%w1VGaNe0K@|SV$V{DJ3tG|DTq|nyl@bmcO>+G9#{@Kse+A^8LV00000EC2ui01f~S000G6;3tk`X`UjduGm2=q$bM|kT3?h z?Ym@95CEwWXfzxH+@V2wyb1t|1yLkj6buMtGUx;XO@ct75Fi|AQpU4LClp|prDnNm9eq0@bK`})zx2L zU&+bI{QUg>{{Hs%_KJ#%A^8LV00000EC2ui02BZa000DC5J=Xhy?7ZR%);QIjKO$R zptOv|q7BNIHbzh&PF~nl3MV~Aq7=mZECgZ##so4Ryou;RSso>#!GS;!1x~7gbFw3m e1UOX)I(T@|GYWUU48Y^Xx(ts5^Z$St5db^STuzw) literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/common/helpsearch2.png b/eric/GUI/icons/themes/common/helpsearch2.png new file mode 100644 index 0000000000000000000000000000000000000000..4b97a9a99aa1522c0bb05275bb0379258bd2b0e8 GIT binary patch literal 513 zcmV+c0{;DpP)Bj!$3)WBX*=2|} zW88GsLWXE?#QWKZ`12>i;nzl_*XX~y_btEx+F8OgZVjQ z@bU5Sy}iBG*4DnhzQx7GA^8LV00000EC2ui01yBW000C@5XecZMW<-AEFjMih+{%j zAX%2@l&tWmNJ#mO0$|`$#tXSd>Cju{ZmZ&u22%zapWqT{KuVvkSaXunGFseM42<#} KIG%JR0suRzV@*;3 literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/common/helpsearchback.png b/eric/GUI/icons/themes/common/helpsearchback.png new file mode 100644 index 0000000000000000000000000000000000000000..a1fa8acedbfdb4c20766372c625f2be52aecbdb1 GIT binary patch literal 578 zcmV-I0=@l-P)4Tx0C=38k-uvbVHn3h?*&cK5Jj#9p|v+ib%=6phPI2OO`wPlp+=fy(d*rr z9Nb;s-d&>s1;@@EoOBR7IOr}}TAYgDAc8+|68sMeB4|8^*N{O%!3SRWe82F%&+~pC z$e5Otz6Jzg60NQ*8}&xh$bRG`=QzPMiWwCd0-(1PmjHcTaShP#CNcrh26Ve^IUw!>g{Zb#2Jsxow-mnu z^6QEZfPBYpB_KWlX6Se!Xk);F z{(O?A{awg>hW$-@E9(5sONh5{lvaOM8r~%X8pSFX08Dtc4{N}+hw!)rGiz|>3siwx z39VQh9F-ver^;UF29{CrV(DAmBewn@75H0&UINIu;msSsBrr)Cj}Vst3xf(CF%ln( zuG%NS@zby~rTxx4*vl^d^M2yqO909nvKx7=c490^>AMBvYG_|B7;~mM&mZzjhs+}$ z*NOlD04GUAK~xBtjmn`B05A{&FplNf7Kwx(p%rm~B-myWZhLC`^#E|&0m;-uFZZK- Q6#xJL07*qoM6N<$g7|U*8UO$Q literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/common/left_help.png b/eric/GUI/icons/themes/common/left_help.png new file mode 100644 index 0000000000000000000000000000000000000000..612cb4f1ee9cc1d1dd4a6d13baf6f7685eda90aa GIT binary patch literal 578 zcmV-I0=@l-P)`!^!^v>;+*@WA z7PvB|zkmP1k+upSQ0VQuPgzB+safRA89L#nlUko;p=cSiVZ=X7Ol80YRR@qoYQjLj) z>-QgEto(<#?Jt@hZcf$!cRdCMy(?F5zIe|9bS*18&mT}ULRDh12kt`-E> z8-P57GBp2yz=OvhTPAFI`S{xPTMvY#^nSyF3rWu(bUojH|Gx9=+2gynfo#G5OdwbN zA*AQue`ZczaY+SZAREZ|`=9wgK|Mgg${{Eq$^%M{%&dR^G5r09q6Q$q00V{aJdal+ Q`2YX_07*qoM6N<$f=4?M*8l(j literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/common/left_history.png b/eric/GUI/icons/themes/common/left_history.png new file mode 100644 index 0000000000000000000000000000000000000000..905f79bed34fac2c5e284120ed32bdf5e2bf9e5a GIT binary patch literal 151 zcmeAS@N?(olHy`uVBq!ia0vp^f8U}fi7AzZCsS>JiYz@{978H@CH?vT-=2ACLuVsb1M9I4jXV71m%8fQ-AW8| w7?$;E=`HM1>}gg@a8FJ*DRWDB!@wfJu-{)rI;r5~X`mqtp00i_>zopr0GjA8xc~qF literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/common/left_macros.png b/eric/GUI/icons/themes/common/left_macros.png new file mode 100644 index 0000000000000000000000000000000000000000..f33213a47bb0b76acac437aa39b421732eca8411 GIT binary patch literal 720 zcmV;>0x$iEP)wK~NXwMOXb0SpGmHVue&fQfhY*bkU7jBvepAKL$l2j-)YBGo?TU z$HGnL&UQRMZ|D2K>C|~s9~{nkf4=9u@AJIh$A}33x~!W8+aLOAXlxEHXD05q9AfG6 zq_vK7Exu%FL!)!JSyzd8Jd}*rG=5rFI$PaNP2&I^^g8iTi zNbJ&*j)+-7mkCf+F2P&6ALV;J%s={@0^>92_fH`wJAY$!n(z7O*NiMUh{iNgfp=G# z0N`=)CW8h8BZ$dPL>5ZW*!G0-a_zWr=>!uXp-2L)mn#sJH4{V^EtHq-Op%n^mKQ#X zD}<~pJEDpgj18|y>~?ABc+`idZ)XJ`oP#d|BPmjHoBR2a zXzd=h*;VkMyN@QPLvZ9~q50zRw5OQ;kNf1W00RJUwn^p5DEY?#0000EG=|zG6T*22WQ%mvv4F FO#p>79=iYl literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/common/leftpanel_off.png b/eric/GUI/icons/themes/common/leftpanel_off.png new file mode 100644 index 0000000000000000000000000000000000000000..01c61c3267ab7222af12556bccfd477685d1d514 GIT binary patch literal 669 zcmV;O0%HA%P) zHgPd&)5X+LClj}_P$yR~%qDIwq(i$Hjf11RrbE?G8S7x%vHSxjOifyCs_6T5?*p#) zd+ED{2lwHRz#+UB&O7&f?)jc`0ZRx$l}csTw(T{VrIpL&-Fm$)W@*)GRisd9u~?*8 zn~jU>x|GdkrwZ!zdX!3~hQVPNst_Cd4Ea`9Z=1p0ZdX+u z2M0kwSFYU}N$9vf74P4i2yQeQ#5qd_kE^)dZd3Lu(Y-qh+V|=3n0iv7NlI9jrPd>_ z5!~r?WPm>c_I+P%>dm_&?YllVC*!+nO_HV4X|*1CjbO%@3<^fTNX|n}4@;MQYV3WH z^6`maRE!wpHG+|dF$0)!+IqR8eJe}Ls&9W%F=CL{2!dQVIqvq@5;vS_^#?0Jxyj|B@J(B_M`Lw?5p2F%T1j64#>!RYx(>p&@j zB!gC~eNG&#TrNk2LP55~01hS4aa;wBgXiZL)cb#IT*YA8T=oD%Ab%d!PN!uk3Q%=Y zB-6$;pPhZv5>3m{wy5u5+UGycKek$}wR}E5(?0?h$}c@A?K{7myRyq9`i+1#gpLdO zvV_t~`=h()Cm><*_Hg literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/common/leftpanel_off_btn.gif b/eric/GUI/icons/themes/common/leftpanel_off_btn.gif new file mode 100644 index 0000000000000000000000000000000000000000..cecdf70ce5580eccf0e8273979686862262d65a2 GIT binary patch literal 461 zcmV;;0W$taNk%w1VJ-j`0K@U3m+uPOE)wQ*?(b3VqzP`!H$<58p!^6Y6y1Kc!xwEsg zzrVkl>p@@(eg$ zG)=ZpkzfQd6b6Y#Au<`EAUeFlKp?1i0+PdGA<1^V;O^l|E`PUUjHe=iGzbg|Wgr*G z>-W4JpU2zxa~vKJ8Xgyi78e8rhm41hj*N?sl$DkQ9vKY|76uld51yZ+ot~zpq^YW; z4ks7^ude~H7_zgqxVgH!yR<766$-(?6&%LL$j8OT#Ldpn3Md8B(;3#+*xB0K+|(!< z;Njxq>m^D@bU2z@ACHY>+JOV_w)V#?ee{=2e6>Q4=6e)gtBnqhKCS0 zG*l>YqQ#3UHaK{=@u9_t5IcChNK)j(eDOp|mUQS4q|1l_Jq$e9jvh^U6HpTL=dR|> zdkGs#1i16(2bC)H^;GK9UD2X6S8!N{jB2v0Q?XjLYOIBf7%OJD5c@)fSO8%?ga80L D+Y;|j literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/common/leftpanel_on.png b/eric/GUI/icons/themes/common/leftpanel_on.png new file mode 100644 index 0000000000000000000000000000000000000000..128f2d86757db11bd399a5abc481a504b050a0b8 GIT binary patch literal 698 zcmV;r0!96aP)!6%W;P;C@eWPCGacPb?+yW$%1X$Yw~^R zKp;38jnr?m*(6)$9%QrGZO3u$N>GZ$V#L79YyhCc;gEz7>K(wvOeS+Hkw_3mJRVoz z%MJhsL7*5jFaVuYDn(Li0_#;s4YsI@1~f3hn6U|5DwXty=LslRE|>K)YMD|iK(I}x z(+Zda(xldIOcnI{1G-nd5(!+d*9l58W613L{uwYBq9fB-h;Fwlfi1dSxU6&E4%;;T z=hCRaeAB3AZJT9aP}5lG4)W|B9O+!vb!GRb4vmr-^SK`CFwRWIaP@=}hXFm>**cT& z>rb@=QESge;(83stS1E( z)VWWekCZc`fMHV153lhAV@`w_4+aA|`TdJtS3m09#`-#S{&=#X#jeIq!F-ePT;N%Z zh4AU+i>EsG_QL@QX__d;d^SfiW@Am6EAVOe-QGk|5%`hjV&H}5nkO}$PmT|%-|tT` ztX99z1qB!mqkKNU*j%%=0;17qocp-!bUM^(wH6;Ba$oi&BL}R|?J6z_NX_>#1ApoD zdOzgVSmbkb756c=pn32BcwZ(Tx7%&X<#IP=1DC?GEbCfiVu}=~*J`yVl}e=`Z<9^W g^Tb8`=lUza0LOhW$lj}01poj507*qoM6N<$f@dv3hX4Qo literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/common/leftpanel_on_btn.gif b/eric/GUI/icons/themes/common/leftpanel_on_btn.gif new file mode 100644 index 0000000000000000000000000000000000000000..ce638a4b1978c86780c9854d6c720fb5dba357e9 GIT binary patch literal 465 zcmV;?0WSVWNk%w1VJ-j`0K@FMdbyu8rR z(50oNuCA`Cs;bDy$jr>l+S=O2#>VC4Z7Bh z=H}+$;Naom;o{=rA^8LV00000EC2ui04@L)000I5AR$Hxvn*S>QLDtyPLWt#0F&$y%iVU5*|2yV23!^ig`+VDR4VR3{4J-) z5E+&Sn3kFunVX)UpqmE}3>zA!s2T{W zsjaN8u&}Es1qB?nwF0^v9J;={zP!T2#KXD;D;yHM%gn{k64BDr)YQBw1KAe?7a!ag z;NaTfq&<^L>~N3iQGsC5ZgqH+ HLI?mmDSY^= literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/common/leftpanelbackground.gif b/eric/GUI/icons/themes/common/leftpanelbackground.gif new file mode 100644 index 0000000000000000000000000000000000000000..88bac4a79724083df1c7ab0a23a0949d2c9c76b1 GIT binary patch literal 162 zcmZ?wbhEHbWMt4{IKsfNc=6(wFJCTNwCMf&_ix_3xpe8$iMM&o6dA_GN5S*VK^Pbzg`$>y# zT!d`YyI35;yH!mX)r%*qjXJHme3e#~y-mdh1G(Lto9&{mTg%raT>@Mj%p1BG_-cgy wL&$n~OZe@=#vz|&4-?sBI*WNh;~xPA05Dz#pj^wA&;S4c07*qoM6N<$g5I~#9{>OV literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/common/middlepanel_on.png b/eric/GUI/icons/themes/common/middlepanel_on.png new file mode 100644 index 0000000000000000000000000000000000000000..ccbf02090dea002937821359b7d4bf711475fffc GIT binary patch literal 517 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 BIM)CG literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/common/navleft.png b/eric/GUI/icons/themes/common/navleft.png new file mode 100644 index 0000000000000000000000000000000000000000..1286b21c1472a9f93184d227a99706c8a70c1026 GIT binary patch literal 601 zcmV-f0;c_mP)7ltF(ubmX^>$8Wma!r4(BF7=8yIjSuNF7>qF(BIF-U_M5R3H7O(qjTyW< zvoqg*Gov-kOi7aPYPF*EdQIEymgo5pPKkN)Yv-sF(21rnJTtPBn!kkkOh7{h>%Zr3g;u8(5`ht+G z2MjFsR`yW2yaG6ns5jo{drGs6T%LQ-h$5>8lgrO^`uwzH1IC5l_~gb22LcJK4`dXe z(Qxmn0wBm#k1E}}^7Y#ndimlNJ#?vjpA%cYZ88o61f_C*?c5WuPHeI-)zOci-zD&0 zzmr&1%_E})2B3m3?znSI+9CZ@0*7%e#?+4_`v(60^UGVg^cQv`qk_G{qy n>2xZ_EX!&EKre9F8vzCY;}XkrPE{eN00000NkvXXu0mjfD^3o8 literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/common/navleftpushed.png b/eric/GUI/icons/themes/common/navleftpushed.png new file mode 100644 index 0000000000000000000000000000000000000000..ccce760f4df6ca1e95ff42fe46cbb9b19250f82f GIT binary patch literal 750 zcmVOclMRrH3@P# zqo8n-6bfm?&QkEN5CpAkv=bW(8$qx*EQ2W6*lHox(ZWV6W1--Q3f_f?Nj8DYV|Sd_ zzVdK3+1dGKe&6pg-wa`lq1|q?!C-*#c#Qdcj-(MnWG~j_+a^5UEXzU=1fYVvH;Peh zT*2|m32trbB`ilINL9ZH&(HG_?;=EBU&0s;hX|_|;Z{$97@C}@moUhT{)4BD=?o#c z1h)}}Ar7J{!lO8igsdb?a_=?x(u63Ta3#16QS-qJ`1yC1O){n&kt{M5wZdOLx>3NF z9VW>LZYsWQ%fyf20Sc;!u33nP@aN6r+o+$cWB=PesAZ(MTE_}mqz**do<|kP=MIm6F;~EL38;8x zD#eda?_l@rZt8G2Q+VJQuxZ{2kq^_3B(vw4slEka%)bw(jQA1j0OUOq98^s>k_wcG3->Qw~a024HZmIE|vHj&rx3;Pc*fIJP6lTU#_c3%sB3 ze!_zqMZk{Fuv0Q*uryuF@&aJFjIzpJxcdwr9$b@SSC^IKPJmb+af5>?7lDPWL?xbM z%*fJ#Nz{>OT}krN{pWah?`pbl37%veGv(+{q#~oXZ6jJl@O&rDS8WngyPjMR21&EK z{P0BqSE1;gly#MqT zJubD%nbYtCH@D5Jx6LM8WN+r~jY&Ae+^&F#o$hoxtlRCP*Xvr6h)BLJkNuCJ`aUL0Xm%yVz=AX+wB%Al?qg=RVWsVnW5|T8fLQ@ z-vm~qkYLSb6aH%?gyO?6g!z09indJ9#Cne}nW3GlOHNz4T!zVH0*WT-Ez_dES|Vb< z-$O2!W4I!RkOI(LiAf=N)M&k?mS=`&9PG0(Z*P0vx>Ag@P${H)ZJ$yq1Jr;nFvVmj zedrj+JP*SI0}=5Ps!U7RNE6ob1GeK+a8U zf{(`|oKn!ll$1RBesJ#RM+!N1;Gzc`Xg*^LLP7LpE9-72UMq&k~){j zZ`QrJJ}(sKPus$xE2aL7RitvYTET_s)xh_Dg!-S5ed{rD%mwU-4+k)7L2v0&q1|rdy8r_K%!9%)R|dz(00000NkvXXu0mjfr2_hC literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/common/navmenu1pushed.png b/eric/GUI/icons/themes/common/navmenu1pushed.png new file mode 100644 index 0000000000000000000000000000000000000000..744a63ecda0ffbf6d3029f5ec84fde0d448af795 GIT binary patch literal 706 zcmV;z0zLhSP)55pp=hJX`k<-l)}uy zxk;hD@7;6Hx%a+DI-O2)u~;;w(IaZk_ls~S}Ck)$^e?FCC#=;D-gd^Az9j)7s9fcPA);E1ZL7?qt0ZQMv_8*2kRJq zz>}86ioiqw{#~q<&$12W+r%rTxrFvcQY4IFS=OxKVq=Py4}o4&j{xzb2E4ogbI zv6SUhpn~aW6=58aOM@Off05~S_GC%cB&~?#zLfIixm^V3@Hj)>rk8@+7Q=V+? z_uxT{(%n0_=2{m(Nmg`n+3@t8!k?`$`OybG{eW7n2I6^Mv)k=9dc7Wo!y$qo*typJ o$1KZ2xm-r2QbE05Z~YTs0IoX;XRO!t<^TWy07*qoM6N<$f)?sk6#xJL literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/common/navmenu2.png b/eric/GUI/icons/themes/common/navmenu2.png new file mode 100644 index 0000000000000000000000000000000000000000..107f4f794c7fb5324b444fb916143569c266d9d4 GIT binary patch literal 954 zcmV;r14aCaP)<3Q4q$z`)DtvErk}v zB3Pv@VC(`bL5#0Nb`padBbbkSZG|FG+FH^} z-=z=d91s$N3r;hOCTD)oGe!3z_}dt>n46IeeI&#^s(KG#+Xo_#~E=mLba$v|0sKRaJ00od^U1 zNTpI-b!BBGhsz8gk^+H#?35{j^YfT~{~o=)SE1AC5DJB`un}RunB1t(Kam-GORIb||!h(a}*#DB#?=v-Cg?U%q`qcy*P-pM8qM=Dvc5{sgzD zR4PH1B!Vg2W38fa_;&fsi}CR>^xwLHcw9v^8iW7G53VG>uHsj*5iaU}OM@9YkcGuU&^IsQ4aEVR0>kW@|0fh70hL zO}uQba4Sghj;Exwy}cc|d;yOhJ;BV(NA&ge@g!4?3HPpDf}EYh)aUPrri-|6@)RBi zGf1e(?Xnq=fqCOQJ3EJ5E*JDPV@Hp+LRX=~$y1$h*c~)#5@b<^!KjDZeh8EAo?|6# z!ZBMdDvbLPc=iD9Gw1pANF*#4i(%&D45Y5Et|6wB?Y<<*I6(7eu~_&zvdaw2Hc4+V zpsleEo|jJ{7;N;26_XJe#jh{Xe7qeZ-GBS;E&mQk0|Ns?KA(@z8ru>U?80tgs;R+& zyb90f1st?C;iAv{^OAjF7_hs$ cTlgcu0Ba{`kAZ{HO#lD@07*qoM6N<$f*@wLmH+?% literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/common/navmenu2pushed.png b/eric/GUI/icons/themes/common/navmenu2pushed.png new file mode 100644 index 0000000000000000000000000000000000000000..8d5d322699ad860b53ca8d23075740323a83d2fb GIT binary patch literal 1052 zcmV+%1mpXOP){6Mzj>Pt0;lO zZu#MogLuKy30AsLUbJbMFwqrq#v0-)4VDiz6Ov&6T9tj+|`o1f!!YbU8( ziOpgSS~`ttYbYuI(rhC%$IjwyMu)G^(%Q__)K7%N8>p&+)2UHaRYm{V8kRz{gtIA3 zcQ59?WXD9c0E#Lf)2vK%J;?6j_l&+bf?*g$A`wA83999)kOfIR7S$31leQK#wKw}##EZqB=&S!kIzkI=Vd1ZBlM&D_4&B-reXd8H& z>6!0{Jql6bYZbal0wl5lh2xp5+R5uwSe(AWryqU5?ygBJ7ALs8Odu}fjjd5qee`s8 z(b-&sps`KcW3A5 zed|M8Be&Ph(A5#PlOgW^u|zCW6cR!)g@5j&;I|#K6^$flF4rbyZKh8bIDN^v&^B0MI`-NDS(KK1W6;ZB5`yP<3 ziy*un7P^T=r%HR@08Ij@3F|dYu}6m{;jORZ;?-gP3f>{`I7ZL2O&qig5xM@Q*r(dy z%x0L%%1V^6v9XEJpTCoq+&IL9ZitgaRIRQYjaI!|qv5T_lQ#)0hG=eR;X+Rvp?IF{ zUvE=TtB@W|G0@wEluRZk0)fEz{QNvok(c>={vX%c|7p6eQ&(3>nR#R^h6P=^hU1u{xn_!R9O^hu85>uF5~juC9c0-r>C{?V7o;WNAP_QzUP^I9`8}M zcS)isV&3-qJ=<{{XSk)d8;{3WEEag(yk=s`oI)K=n(_0`RBIDcQsPn`ct4e=-%oh{ z^NcT7y|XWz0kqbLqnLs0<@`&g(NV}kPd>yaNlMVwPt)M~X{o{9N0R{lS5Y-Um#&(hb0000J%aX literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/common/navrightpushed.png b/eric/GUI/icons/themes/common/navrightpushed.png new file mode 100644 index 0000000000000000000000000000000000000000..7e56432fa46b354c935733deac8d45e4c9b7b9eb GIT binary patch literal 735 zcmV<50wDc~P)(@|?@?98;L(^r~Y@42^0 zn$n_yLz3^F_xbK&jYdQHzKDz-m&+&=3VX6tD&g|(9jz@$ zmCQhPWV8HE9kGqL{RuJYcX6`+4ONVu@WEgJ#zmrRgDgMFII~Hz#Lp(2eB~-v;a6^g zd~<4#T3dedmBq0ck1O*h5xQXoIySH6@rz*(FKA)tQj{aS-8r3=F2Bb{s<6Y2`F5al6@UqSx!8*`H_G zz!~y+oAokbB>gxJ!|^D>@latnS7v^~71+wK31}a-(fQfIwFhr9xKi=RmF_u1#8S4K z7WFidy1KkbS5k0o25il(Xti3n@%SxWwFHkDWE;yeWE{l-PIW7Cx_6|=S(=eGPK|Co zeYbRzms5yua;nSqAWQ(-9bSIH!^rZ=R%r84ku|>k{5=gM$uh>RU$v+z&1^iJ!gXCp zT1>7hVt3}8ue2uS7c(bmgI95-Go)|APk;R|OHT%F8M8@%txKLYjv2t#uL!kaVc2>E zhW-To_7Pa~D{8eGWW}B1GZ!=bbPiBr^oX=RI63&?CzjmukZa8U;yXuB}wD# R1-<|P002ovPDHLkV1m?fS`h#M literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/common/null.gif b/eric/GUI/icons/themes/common/null.gif new file mode 100644 index 0000000000000000000000000000000000000000..2799b45c6591f1db05c8c00bd1fd0c5c01f57614 GIT binary patch literal 43 scmZ?wbhEHbWMp7uXkcLY|NlP&1B2pE79h#MpaUX6G7L;iE{qJ;0LYaF_y7O^ literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/common/palbackground.gif b/eric/GUI/icons/themes/common/palbackground.gif new file mode 100644 index 0000000000000000000000000000000000000000..713c272168278525706f6acfbc378f4f2943c290 GIT binary patch literal 43 scmZ?wbhEHbWMp7uXkcLY`ST|O1B2pE79h#MpaUX6G7L;iE{qJ;0LF_3<^TWy literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/common/palbackground2.gif b/eric/GUI/icons/themes/common/palbackground2.gif new file mode 100644 index 0000000000000000000000000000000000000000..713c272168278525706f6acfbc378f4f2943c290 GIT binary patch literal 43 scmZ?wbhEHbWMp7uXkcLY`ST|O1B2pE79h#MpaUX6G7L;iE{qJ;0LF_3<^TWy literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/common/palbackground3.gif b/eric/GUI/icons/themes/common/palbackground3.gif new file mode 100644 index 0000000000000000000000000000000000000000..713c272168278525706f6acfbc378f4f2943c290 GIT binary patch literal 43 scmZ?wbhEHbWMp7uXkcLY`ST|O1B2pE79h#MpaUX6G7L;iE{qJ;0LF_3<^TWy literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/common/pixel.png b/eric/GUI/icons/themes/common/pixel.png new file mode 100644 index 0000000000000000000000000000000000000000..f38e9f9100c290bd0e9a0419810c2d0149562c8e GIT binary patch literal 110 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx1|;Q0k8}bl$r9IylHmNblJdl&R0hYC{G?O` z&)mfH)S%SFl*+=BsWw1G0-i38Ar-fhe*FJ$&+O2^$iVT3>EG=|zG6T*22WQ%mvv4F FO#p>79=iYl literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/common/progressback.png b/eric/GUI/icons/themes/common/progressback.png new file mode 100644 index 0000000000000000000000000000000000000000..485214ad7a71d48da556104efb13da4e8f015c77 GIT binary patch literal 159 zcmeAS@N?(olHy`uVBq!ia0vp^j6m$n!2~2PJ^!&2NJ*BsMwA5SryCeDSV}hy0ndH{Q4{b9|<_x^)vH6A#1hnHf_OWv}}I4P)?h^>bP0 Hl+XkK-|IQ; literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/common/rightback.png b/eric/GUI/icons/themes/common/rightback.png new file mode 100644 index 0000000000000000000000000000000000000000..69d5039b6defa73917c679d6de177934a8515a4a GIT binary patch literal 168 zcmeAS@N?(olHy`uVBq!ia0y~yVAKJ!89A7M-L1;Fyx1 zl&avFo0y&&l$w}QS$Hzl2B^r()5S5Q;?|l88wD8@IG9iVv)(AR?Nla5)~YA*(huI5 zu{NxIsB&}ituj8>-`{V_J}K8wZ(MpwSWtJW!pybj7G~VHfAwwAbmN1H2N*PTGHgyR SpS%EQDubu1pUXO@geCyGnmii- literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/common/rightcanvas.png b/eric/GUI/icons/themes/common/rightcanvas.png new file mode 100644 index 0000000000000000000000000000000000000000..f38e9f9100c290bd0e9a0419810c2d0149562c8e GIT binary patch literal 110 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx1|;Q0k8}bl$r9IylHmNblJdl&R0hYC{G?O` z&)mfH)S%SFl*+=BsWw1G0-i38Ar-fhe*FJ$&+O2^$iVT3>EG=|zG6T*22WQ%mvv4F FO#p>79=iYl literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/common/rightpanel_off.png b/eric/GUI/icons/themes/common/rightpanel_off.png new file mode 100644 index 0000000000000000000000000000000000000000..232580e1a3ec5d55e17bd337fb703b1e2db6f1e8 GIT binary patch literal 675 zcmV;U0$lxxP)kytEs0P-Y~yN>SB;E(pZH5~-O%9r`1MPAE)tBM&o4H)BtiX&#(=_0m zZ&JklejmJ1QC@a0hGEdiy~#@hy})eS9)V5MlEBsKm7j^{2>M%FTbIC!!bV^rWUy(P zkj-YJo8|l((y64R@BH~qe#78+JU%&MUDv^J9C{|EkJbQeyjk>h7r$=E9{tJ@D?zYa zW2`$a?DcvP=dwp@PQG3Fx>xh_WRHHsU{#F=o6D5I?m?%8I8G8F1PGhM*4t4%e^#!^ z4*iC~i9})qwybHu76^;Or=zdFZgu4~*`ePsScqg0EY}#*7i|B33EB#k!~30gzV6G9 zD%s<2Ver^F#wK8ljdx|IL&j0y+xwd9EDgIKKKr`mr6n+2`*5nUQB~C#PjwjVMI4oC z%RP2hg2TbbZC|&4{Cya)3~slTAXq#fEKIj<9QF=R$J0t+A%Ot`7l>`kV61teP;htH zjyzHif%jM}2B}mEGMNnd4TBwLa2s-)x=#i#EG*J9jr=WQ>?dS$;no4W4|j_2sGDjU z!OUUlkjZfewb~tlF}>4#82$(Bog%7ny literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/common/rightpanel_on.png b/eric/GUI/icons/themes/common/rightpanel_on.png new file mode 100644 index 0000000000000000000000000000000000000000..0860f1680bf96ebe33985b120bf074bd1d16ff0b GIT binary patch literal 677 zcmV;W0$TlvP)k}MniU*)ljq9Y#Ly&)eRV6fPrnHP%yw) zP_0%|0X}{CL8W5hNPO&nmwIXncnBDV9jU{7-#5*1qKyBt>GsXbCib;`Ao=kV0tMoy z#z_XXxw!QOI8E*-n#!8h^*s~2w6rAo@kYfO#WBDN2v@1G@HD`XE{sCDfA@xoect{l zdGSV7;JJ+BJ3{*d7~{#n0fm7>FW;=0*!8Q|Brnc5S>H*%U)_;1P6G}C26i2K_~4$2 zec0HO{P;Ug);|Os-_dwHmSpY1G7i# z6MOY`{q&5rvHrKYf^fpB*!1G{>XB2!!{EP)2W*Sj;j zey^*70n-xG^dYt4m#V5N7m|?RN@>-{4-J9e+JpqD;vZ-esjAvWm4d1&X@b;1YEo6j zjbsv(1~YMFR45b_#$?BJoUf~@dLYseX)z4rltlE0V5Gr{7*Ppl`I02jdX`epO__9BS;{Us zIQ)A|mS2y>VyYA-mq}8OV>{ohl*_wu8}~%2?sYG@9wV_FnaRDn9{6iZOS972(qhNs zabFAQm9lL=QmIsSt>e7A4d7w$Jda%0U3)3G9Q^Hp=Y6JOvX~k3Baw*8tt#XT^4#_7 zw6wI`$%WSQF~32=Db+tk?9hnTZQcpZ&KW#j2Il;c6!t1P3(d0ZZ{T>38(7G2ayA%Qi-zJEVVVaz-x~ipyE;6 z^}IcyV6ZP5iLiL=Hh4jR&%3j8b1a!ky@KaYlU0=p3ia5U&j6W0)YS?k$p|m2)Xjvs-T(&DrmQT*L_q|)#FCgVDUBJ zH|OUGv{OExr>4euHXII9P}f;77_a=dK-`HCdTHd7Q1{zgMXgA$M5 z4L)=28V6^l8TG)}LEH<+wWstzfPpa&!2V~c0;VdeW80P8sbumE$8nUl)>a?X%RDp% z%c=z@(=zyBOZyx{r1i*sco-SKOpJK6Rgb_$7=%Qa&2$GA*?;ru&ATSQ7 zMH(=Q$6^FlX!6PxfWvbRjw)FLPEaIXK@3#bkmUpU<=pRZr0driij^{Ca)rr^XS4XS zR4x(EW-tTVb7BvE8aQ?sAi)H_>{7n)Oioe!NX$4`Pj3(gw6(Rr1@)T1$1Z@m3aav5T>%F$LN!U3$H%!KF&IMt?)5#d z7rIh`Z2u8BFXFe$JXz%$jSxv_+cwjK`iNngJMqu}fSRCgE$#x(PVmK4lFkgB zAw^SZ>ld~XRDsZ*saPyhsaT?=M|KLax-OQrIiA>b+&3WXF&mPR5C z(VejJq%2E~02W5n(q0Q*unP44@EJ;Uv{QSc176zzE|DYKBK)2&`ifw&R4#8R<%++b zpP%1@?m2PGfJ`Ps&pr1%q3JlAHf&T-*(1@0$j(qWGyp>y8DlQMnYtSDDmXuQVrr7i zm`R`Cu#r2vK4 zs8DbX@d~l&0 zWSmPmpFLpoj$2A7Az2iDDEc^$E2oiPHs)W?aWpd;KHJ=p*o80MfTkf&WnqMkm{;ry zS!h)J;JLY3x_I&89h1?abOWX-22~preZKG zJ5!TW55G4!_ySL+6aD>M?LhT1lF)W}y=PHHJlXgxIg3H1|HMCFm__~Lj zs9!l84k6Za-bbUO492B5cWv2Uw5(}9&=y45S)x2oojL`tom;uUyK6^Bg3xV8pp1RZ z&CTw;-;6L;amzGS=}JK1&_rZjA=hu*@RxHrALU6;?%(^<6a6Rp16sg>A|A%?oygm& zAo z9D3(p@AN(p1f3)iS^9&FGUBhD`Cco6eP5(~FCHGm8uDp>X)!4O=$< xol_eQFu^pFrRvwcH}f3N=uFaYulR8F96kbD3D002ovPDHLkV1o3qF24W( literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/common/sep.png b/eric/GUI/icons/themes/common/sep.png new file mode 100644 index 0000000000000000000000000000000000000000..8f86ae3aecb4162740598077d142a899f5ed14fa GIT binary patch literal 128 zcmeAS@N?(olHy`uVBq!ia0vp^j6lr8!3HE3cV7<&Qj#UE5hcO-X(i=}MX3yqDfvmM z3ZA)%>8U}fi7AzZCsS>Jij+KE978H@CH?sS-=0~RSzv+i=CVCM&VTs!_V$0C9a9)s aBp8mE^761e&N&HG&EVg{KY#xD^XG>TA3l2Y khyfKS{$v3Q=zvI&84N7E8x%xX4AU8o20wZr&d6X50NpVq(f|Me literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/common/tab_btn_off.gif b/eric/GUI/icons/themes/common/tab_btn_off.gif new file mode 100644 index 0000000000000000000000000000000000000000..bdb466b1431ca74b82289456b606bf2f46a73ac9 GIT binary patch literal 96 zcmZ?wbhEHbWMmLy*v!Ci@#4kXw{Ks)diCVVlRJ0rJbd`@*|TSN?b@|}|Ng~`7jN0J nW!tuG3`junCkvRT10q3YFtG3%EOec|YpP608>7<%7Y1tpO8+Eu literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/common/tab_btn_off_left_border.gif b/eric/GUI/icons/themes/common/tab_btn_off_left_border.gif new file mode 100644 index 0000000000000000000000000000000000000000..0beb10c61e4a45d395c25c1b730587ba58e3ceff GIT binary patch literal 216 zcmZ?wbhEHbzZ$dMH*R_xuo z_t>#xmo8mezkdDc)2BCW+H~>a#givbo_Ut))`0(bS8w}1csojZ4K z*|KHv;>FvxZDW7|#h)x-rVfY%*~!2f`arEuIc?sJV{3J`XBMnk`PS=t`R>S?{JlmI zeWqKk=FD7Tw0WV${3&Nsz4qp4-N;G(&{3hxa6r*O)B035gBw$(GgnxPgM)&IN|%ds Pa)QS{21#ZmMFwjC_{M4f literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/common/tab_btn_off_over.gif b/eric/GUI/icons/themes/common/tab_btn_off_over.gif new file mode 100644 index 0000000000000000000000000000000000000000..9395c90b4dafb707131da6722a2551111ecf4373 GIT binary patch literal 98 zcmZ?wbhEHbWMmLy*v!Ci<;s=%`Sa&*-n@D8*mdy$B!RBc<|u1ZQJ(k+jsWt*{fHt-oAbN%9ShEuU|iR?%c_fCyyOFcK-bN#fujo zI&|pFnKOqEA7+37#h)x-rVfY%*~!2flAzX?oa&S|H8W>*YK%_t2bt?;cI)*{f491M z-ZUpw@5B?;wY9aSrKQKm$KKxF*Vot7)YQ(-&cwvT$;rvUz`)AN%FoZw zqobq3!otJD!vFvPA^8LV00000EC2ui00;mU000G7ASaHZWg@1vUa&CSiv&(FWVzr4J>!^6X~v$MXwzPY)% zw6wINqocOAwg3PCA^8LV00000EC2ui00;mU000G8U?+~EWu8{&t*qB^aLlRgO4oPW zWqhB#GFXl^wAE~zq;k`_IG>k}W=hp`FxV`nGnjb24grOt7*je3Kn0+NJS2w$fv{+3 V3V{G3!H84}1_lBf0~LlL06QbrZ(jfa literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/common/tab_btn_on.gif b/eric/GUI/icons/themes/common/tab_btn_on.gif new file mode 100644 index 0000000000000000000000000000000000000000..602fecd897c78769b58e56e52b95d39c7e820d36 GIT binary patch literal 96 zcmZ?wbhEHbWMmLy*v!E2C+!y?XWh`SUMdzC3*R n@X@133`junCkvRT10q3YFtG3z=q`P-Mu?}Ri^C%+;#>U3vgwvFqod*B;o{=rA^8LV00000EC2ui00;mU000GDVE2vWCypL@lIiKCV+WTqs+Oos z5brDZJ=aW>dc{yMPp5*xFrA%^bR&^=G@1z(+u?Y>9K#|*&L}dC#AW?hQx2FxU_K}~ a7!?2j0Vr4;2M`1T0v3i54F(+@ApkoNqIrA( literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/common/tab_btn_on_right_border.gif b/eric/GUI/icons/themes/common/tab_btn_on_right_border.gif new file mode 100644 index 0000000000000000000000000000000000000000..7bc4160a266d986a2bd61366a7f1af21bc5a7d46 GIT binary patch literal 225 zcmV<703QEGNk%w1VF&;g0K@WZ^78WV@bIRlrqIyPs;a84uCB?+ z$;`~m?Ck94=jWxRrRC-2y1Kf(y}iD^zS`Q_$H&LygwvFqod*B;o{=rA^8LV00000EC2ui00;mU000GE;3tk>H+rLqlBVdb-Fn8Z+mdDQ zdVwDAJKEoDL&HCQlNV3m|<_Km-K=9D|?` b2!lbzAvpj50SgEb76%3f2@n((j3EF!)q{6{ literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/common/tab_close.png b/eric/GUI/icons/themes/common/tab_close.png new file mode 100644 index 0000000000000000000000000000000000000000..d52cddc8306c4079187921918ccf1d64a3b04098 GIT binary patch literal 189 zcmeAS@N?(olHy`uVBq!ia0vp^oFL4>1|%O$WD@{Vk|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5X;yqm)Ln>}1B{VSjvAt=KJobR`QME%(^Rfdx9r?~r4<6v` zh*#7!Y5w&0LT{U<&(Wm}Y?~T>$P0u&2x8d0h^^y(QlWC2^qd7;Zzqc89(=?$;gGQc k+vETL|4VW(HZU+VoL(hT7ghBn4rmpFr>mdKI;Vst0Dl5PU;qFB literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/common/tab_close_over.png b/eric/GUI/icons/themes/common/tab_close_over.png new file mode 100644 index 0000000000000000000000000000000000000000..4ff8a671d4ea226cc0d3285a1e275109b551882e GIT binary patch literal 173 zcmZ?wbhEHbQet9UTwH2uYEDkhv7<-r?d=(e0E$0Zz^ZgWB*;z%R;>ptJ}Qzvz7MDL oU-X%<#V#o1m}l%H=1p&eXEkh8x|k!-*5tBbq5`{u0SkjQ08|Y$6aWAK literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/common/tab_file_icon.png b/eric/GUI/icons/themes/common/tab_file_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..310fb61c7b167ba2fed9f41058028eef42f06f69 GIT binary patch literal 654 zcmV;90&)F`P)bzNANh2e0BSS*G}B!Wt%BH>8L z-ENl;sH%!oD#a_G&!bQ%z;PUeLLq3H<{bkSMS(2Kpk0zA1cN~?6pzP|%jMANbhyw_ zSf&R-&2<|eR|j~#w1Yq(fM_(zumIqB-Z419v{3xoHnDHm(D%1Qp?S^`K&rJ`4WrSB z-$gO6TCGY9QhV#I4fJ~&%-$|SS_1mtmSFbY15{)Ox*M_oPOn;gw1y%w{u~ zYb(emZ=*NJ0`_y9xVR{K3bNz2ZL`ycVena*s!&^`8cxlj(=K5C%1_KrKERJpFX5U7 zD<={OB$G*`(`ig56UgKwfwUtKhhb(x4xGOPoLhW>t=0S3ZGMI{bwz;~JI){}QV{6; zn!$zxf7)s~hvGE@-+~KRYMOZUZkv_aRRVYkRjY3zJ*T7By?~Vu3oxw`)Z7_-mj~F> zZS?jw5e^ssj)VShx!y+KQn9Tqqqx?>)f?Aw>U5r+eE8(OaQnbS5x z$4xwXb`O4@;?3h*yi<n+a07*qoM6N<$g39+Kc>n+a literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/common/tab_left.gif b/eric/GUI/icons/themes/common/tab_left.gif new file mode 100644 index 0000000000000000000000000000000000000000..a171b3f2d3c093a248f9e6827590675bfa4ec7e2 GIT binary patch literal 44 tcmZ?wbhEHbWMg1tXkcJiv}nujP)0000PbVXQnQ*UN; zcVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBUysYygZRCwC#nad4?AQVMqVk;CxL$pLC zR6!AJ_=wTfOx*Y+nLN))+&qjVCpTB3#(Td2$XLhaoI?cMCWNrZD5Zo8khW3I84)1i zg93P_je75h0BMYBt%v|(1jGn*#Hh7~2$068l!6H0r3Qb~M#h-0wc|s;OXiP1{8jci z8^N@*(Ma5H47JW@Z>rwva`iLh>TZ?u*_*1jdbUxFky?h^SZg-{1_0)SxD8kRMQs28 N002ovPDHLkV1hzNZ72W$ literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/gray/PaletteTitleBarN.png b/eric/GUI/icons/themes/gray/PaletteTitleBarN.png new file mode 100644 index 0000000000000000000000000000000000000000..09e15e163dc94431e909cc7f18404f4d911dc548 GIT binary patch literal 255 zcmeAS@N?(olHy`uVBq!ia0vp^hk#g+g9%77Xg+xkBqd8+BT9nv(@M${i&7aJQ}UBi z6+Ckj(^G>|6H_V+Po~-c6)p61aSW-r^=76wSA&9xtMRSA*98mL9ol%ikhy6-kCdpN zkz(9)hsoh8GJ4-xHM8F`863N&m&~K|!0_BoWj95Zm;)KoMa2SM>ry~6qMaGRb3dodF?K{d96IXH|ll$v-SJ`gn#>C)|BbJR`s2n^UBXR z+q<^!`cl{SWuBPj{Mr>2tJ9?`->*!q=($!Up1{z5c*m@IF}<50k9oTKxvXgTe~DWM4f`CD3w literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/gray/addmacrofoldersel.png b/eric/GUI/icons/themes/gray/addmacrofoldersel.png new file mode 100644 index 0000000000000000000000000000000000000000..8f2852905d045b36e9d6af823a50c62d92ac63a2 GIT binary patch literal 263 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H1|*Mc$*~4fk|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5XR(iTPhE&{2`t$$4J+m%@Fmo@%S)MdT!MAVUhH&lzd=A@#%a z^Ya5$9zA~iFefc7%|KQ}ghf1hM}cA?+hXP!i7iJw%qos{i58T(xUjU{*q(p?gt5eI zH>b9X>(?l-Bse;Bb$1%g5Mh2PF2XIQvtZT1p2eZUJPa%n42)vV0e|{c&I29I;OXk; Jvd$@?2>^r9U-ke1 literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/gray/backcontrols.gif b/eric/GUI/icons/themes/gray/backcontrols.gif new file mode 100644 index 0000000000000000000000000000000000000000..c8dd124058c71c0cddae7036973c71c85d531a30 GIT binary patch literal 43 scmZ?wbhEHbWMp7uXkcJCckU7c1B2pE79h#MpaUX6G7L;iE{qJ;0JvTTX#fBK literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/gray/createmacro.png b/eric/GUI/icons/themes/gray/createmacro.png new file mode 100644 index 0000000000000000000000000000000000000000..75dd0f472c7d22ceafac0eb7ed6ed1879ff2d9bf GIT binary patch literal 577 zcmV-H0>1r;P)&<#?qEbCDB_}s}(+;FaA9{~mcUM~1AGtGId P00000NkvXXu0mjf)rSF2 literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/gray/createmacroover.png b/eric/GUI/icons/themes/gray/createmacroover.png new file mode 100644 index 0000000000000000000000000000000000000000..ac5d3e90d3296a52b770daf0baa20f49fe5fb8a5 GIT binary patch literal 593 zcmV-X0}M@OQe z5D5x}hJ;2$!w=A_C^agzR>VJ$kVq6F8Wc1{;Teenl~>2jnPm3Pjdiody~*arm(0$d z^Ua>~?U^&#)jS>#s1aJI6si^WL6>5&sH*+U<#L)2Ze+7rRfsB;N?#QtsO=D_U)cSA z|Iw*6TH@)hZ&92%60%n>`*6uGcF%oeqY>A#^$& zg25p36Nqax8kkO}%+6#oFquq}s9LRt<#H+IXt&!~EEY(o)3V~UqA)%Ng8^2n6`SMn zIILDHE|&`mg#t@LKAX+P8kN>_j$SAn4zpo28l`wtDNz&$`G^y9KUM5>I!VsmZU=+G zfK)0a`C6?O_WL~&i3E~=eQj^6%!J|mycLoOcQJ~y9uP4a zjbJvLQLopT?RLB2^Z6u>-~W2^i`Z_rvWYAf3zEsCY@pli_A&|eP`BHC$te;>O-zGC zhzNy3D3{AjfL^a>TkZGzzi}K?SUN1JA4eLP>)ThKL5=M!m(dd&f+B*6=%w{uo zA{`FLOO9+2)Qi-c{eGVv9$qODMVumGREbzDCcBt|ybAOar-Xn1_WatZtW+wh5~g|o fTK^Yep8^a33Ge&ArHcSc00000NkvXXu0mjf<4Xm1 literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/gray/createmacrosel.png b/eric/GUI/icons/themes/gray/createmacrosel.png new file mode 100644 index 0000000000000000000000000000000000000000..91179734f00b5f77406ee79496302b4c8cd3561a GIT binary patch literal 634 zcmV-=0)_pFP)nD*{sZ`MIc3GTECSf+4+5ImO>RTp*`QxLUV|;lD zL5#m%T;P)e+#U}mwPv%4!C=6y(P$Jln+=P_0@-X9olb}K+3j|=QE9y7(S(A*AZsR* zNq*jUu~IygBVQd|Ll3wQ&}t)H3g=7|Fr&JzDSr z1<%~X^wgl##FWaylc_d9MP;5Yjv*DdlK%YvZ_ljD`1r%71$+0-)!G&s7G`wlhR%yg zM~@yAk-T^NcK4y<8yapoy47?4`}^DcNUcLLw_W|eo+~)4dMT8Z_l3+>2QL= literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/gray/delmacrosel.png b/eric/GUI/icons/themes/gray/delmacrosel.png new file mode 100644 index 0000000000000000000000000000000000000000..d3f53b44421e117d0ecd6fdf7fabdd299713e06f GIT binary patch literal 224 zcmeAS@N?(olHy`uVBq!ia0vp^5DSr z1<%~X^wgl##FWaylc_d9MNOVAjv*DdlK%YvZ_ljD`1r%71$+0-)!G&s7G`wlhR%yg zM~@yAk-T^NcK4y<8yapoy47?4`}^DcNUcLLw_W|eol`t4jnILgfY)!;QruBce=ik@Z+%SQ$g+Z9P_uvZFCCeAFa*Op`%lNXDLE!)c YgSzdU3u*hUfv#cjboFyt=akR{01$^+{Qv*} literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/gray/leftcanvas.png b/eric/GUI/icons/themes/gray/leftcanvas.png new file mode 100644 index 0000000000000000000000000000000000000000..b70d60205174f65558063ae4ef157bf5314f2a7f GIT binary patch literal 109 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx1SBVv2j2ryk|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5X_&r@5Ln>}1MeHuqb!cE@U=d>CcrMDO50ql?boFyt=akR{ E08oh=SO5S3 literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/gray/macrospanelback.gif b/eric/GUI/icons/themes/gray/macrospanelback.gif new file mode 100644 index 0000000000000000000000000000000000000000..270b56b90cff674dd3b869967ae36cff46c68392 GIT binary patch literal 108 zcmZ?wbhEHbWMp{3+`z!_F+%7_WhKQ4Tm~=@9HG) zs}#=Y6pEZF@@oa>?Op6LC#CM*WSn=~X2I=`P4KQy(1@e8oNym*6^)bnzq&; IkdeU}0Qes(hyVZp literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/gray/menubar.gif b/eric/GUI/icons/themes/gray/menubar.gif new file mode 100644 index 0000000000000000000000000000000000000000..bc69a3e0ed7404bcfd07659c2a596b0902a41976 GIT binary patch literal 96 zcmZ?wbhEHbWMmLx*v!Ci;>3x4`}UQTlpH^P{P5w!M~)mhaNxk+y?aldJbCo!(L;w0 jF`xp)pDbVj9S{jJgMo!tKyiYbR;xy;k43wZ3xhQPd|@C9 literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/gray/renamemacro.png b/eric/GUI/icons/themes/gray/renamemacro.png new file mode 100644 index 0000000000000000000000000000000000000000..557f60340cb186bef7bee3f4b722bd4eebc12034 GIT binary patch literal 429 zcmV;e0aE^nP)Ry&* zR3EhdxMPmvK-cxVnxZIUem*n|G%ceegzl+ XzpwSBxnDid00000NkvXXu0mjf3zfhS literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/gray/renamemacrosel.png b/eric/GUI/icons/themes/gray/renamemacrosel.png new file mode 100644 index 0000000000000000000000000000000000000000..bfdd0df69e46a1d5027739452887c2bc2b771388 GIT binary patch literal 444 zcmV;t0Ym)jh2e0B ze!q_(2%ziw(;4>8OU3D?BuR87I3ADK@AqIWnrGPzaTtbAxoz9q8oX=;hRx6xNCmark z(!_;|$Kx>?jRq{s!fv-iuh*k>;+D4*3xa_8eEw7;)=MxL46s-%90S~1)1mn3sNaQ1sDKXTLwj&HFZ+}0000}1MeHuqb!cE@U=d>CcrMDO50ql?boFyt=akR{ E08oh=SO5S3 literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/gray/statusbar.gif b/eric/GUI/icons/themes/gray/statusbar.gif new file mode 100644 index 0000000000000000000000000000000000000000..fb515f91baf8f1da03f6afa53470a756907a67ac GIT binary patch literal 98 zcmZ?wbhEHbWMmLy*v!Ci^ytyUhYz1Rb?W%>#i);>C-fKYxDl;>By%uAM!5 z_Wb$tmoHzwaN)w0D_72(IivWKg#iR~Km^DP1{To^G7p1_ZWxA{Ir-kud9q03yaS5^ H3xhQP)YvnQ literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/gray/titlebar.gif b/eric/GUI/icons/themes/gray/titlebar.gif new file mode 100644 index 0000000000000000000000000000000000000000..efd504bed27ed8c2ca7bba4446d3eae4093d8b62 GIT binary patch literal 98 zcmZ?wbhEHbWMq(J*v!E2;>C+=*RCyIy!hh9i|5auKYjZ2g$ozXo;`cz%9YEPFP}Mc mh5;2Q{$v3Q=zvI&84N7^0SqD&d@XtttrXo?h@`MESOWlRw<75P literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/gray/verticalseparator.png b/eric/GUI/icons/themes/gray/verticalseparator.png new file mode 100644 index 0000000000000000000000000000000000000000..b70d60205174f65558063ae4ef157bf5314f2a7f GIT binary patch literal 109 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx1SBVv2j2ryk|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5X_&r@5Ln>}1MeHuqb!cE@U=d>CcrMDO50ql?boFyt=akR{ E08oh=SO5S3 literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/gray/zcborder.gif b/eric/GUI/icons/themes/gray/zcborder.gif new file mode 100644 index 0000000000000000000000000000000000000000..c8dd124058c71c0cddae7036973c71c85d531a30 GIT binary patch literal 43 scmZ?wbhEHbWMp7uXkcJCckU7c1B2pE79h#MpaUX6G7L;iE{qJ;0JvTTX#fBK literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/gray/zclosebutton.png b/eric/GUI/icons/themes/gray/zclosebutton.png new file mode 100644 index 0000000000000000000000000000000000000000..c238aec042a5e4ae197b125160578fff024a691d GIT binary patch literal 745 zcmV9q6J&P-w2 z0)>Q-7@$(HMGaDnn}%xQo}Izpzz<<1KfuogdlRkJjR_DJ&=eF1NTLWKfg&xoGo_um zp3V|!B*y4XCb@I&InTW3V=l)S!{1!oKLh4+IhM_4v9Pd!_4Rev7K_D@N~Ms=WROm$ zxl03QXJ^^`{5*7BM6O!pzLfFHrAAu(`QM7#+Qi%)R>r zyoRu0xMzpOBChnukbU(MO&?n9Jk)bO%@@y~A=K52zJXyFkuV%`IXNxkm>!$ATG0B@7G>Awp@YY5=kd*x398sbL}a?lpIz!j0{( zxHCD4PD)i(HE5b2N!eWe z%kcVq1mp;4!>m{kMG2x$K>0@rvaYoTjtL%tT8_=_ z)EF9#IxNc~h!=W5b%#3`)X>(hQcX3e0s4q6} zXe*Et^4JvxsA(_zHh7+am7V>cbwzA3k~v ze&IVzMkBaZ4)b$!n4X@N^(?MoFnC$YmTAxtxP)qx3C~}=L?)9#U9Fokf#i=xn91MS zc@4kT(loFS(1=;Y-o9pvQl4A*375+ao7Dn64dnj4+h}cThOj3Qo8p7XU}X*CVCMg=~>qfiiW z(&a?Bs|yUnATlz{mCKg<9C002ovPDHLk FV1j7MX1D+V literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/gray/zgrowbutton.png b/eric/GUI/icons/themes/gray/zgrowbutton.png new file mode 100644 index 0000000000000000000000000000000000000000..e9857c3c6db2d5ab0abda349a91dcce57e7d7a87 GIT binary patch literal 750 zcmVii^P`%! zY86Cq&Tg%1-G;M{y@+M7ci)El8~j6jnt#B4KKMQu-8x}Hl|5*w4mWhd<`iMp*=m#2 zHqB1*Cro2o12^NS|X7^Hk(B* zm&4@bBy&+5{rO4s3q@ zIYvkCBKPRUL@WR$JdGRRJgpnj7qJ6k)Z+D42RvlLmVB|;q$X_qO6t$U9Y3f_z)xD z#_AWWtgJZoyjbDl;u7KmgV3Vg1mSV2o2cmqPU@yRPK^e1vk5;ZAQtN(-y8T;`0QQ7 zZ`;4{Xle@Gl&UN%P?QivNd)I3H>#9nwMn4?mgi}WCwLu8A3k~mgJBg~B!UPvL8ZAW zOAtdrQp6FEA)p0=lnO!s0>`6vT18M*yn&;sBtimD$3=mrbwH6Mgn}acyg)nxwwure z13n+?ev9Orp%_o#y-W(f4=NA>JY+?NOkgP>A|QwaV9~T1;CK#gn^HFn=w~LyjKK5Q zJj{-v)oQ{tO@jELO0s*n!(jy-oif!_fh^Haf*uuJ8# zdzd5PC~&XeXY{JY}wQmmOPOTeHjSUtu&`IR1O+G#OppeQrw0Tf@j?(pP^R g{>QHUJ^UxY06y3#vt&j~%m4rY07*qoM6N<$f}2BHy#N3J literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/gray/zgrowbuttonover.png b/eric/GUI/icons/themes/gray/zgrowbuttonover.png new file mode 100644 index 0000000000000000000000000000000000000000..ab358cb7e39aace956016c8cd60d459dfa2327c2 GIT binary patch literal 763 zcmVJNRCwCVR7+12Q561eU(@MhrZ8=R zDF&OMQZ3rz16$NhLp50j=R4n=bG~ygQB@UZX$G9Jne-f~R7y=IlbD;E!}9X7wigHl5RFC= zkH-;<#mI4Su_R*Wv;{QNu$r7Akl`Joas^4ojJEv;Z7w~B@ADqa6Terp#^VuY6x z7D@`z>9oGeGc&Ug{k;%8oiLg#C|4AeDl*I#1{SLoWx0xqQisXR!0YXz*bA6WebyJn z*Ar0h4G+VA-j6TouV~}#VC^;-34sQq-BM%)1?eyD-ily-a~-oEr?9p8og6C)>*67} z-EdP8#0~+R!vU6MVK5psf0I5{xekVAD0l>v$`V+f(^q+*KL|Txq2t0~Y-~&;w6iu$ zO@C@7hvEA%R1Rbm>DcTSCD9rP!(4YjI_!&((X zk(>G%MkBY$+WJp5lg(~?v;SWI{{GNP4yP;1a{6UCB*rCb(+p(_}QM#zar@8zr4 z>PCJSU7`=cU>~}D9a<^dv>hvJ8`#eOg3r^Ar%xV}Q=R3OEi5jo+1xkC^#+Q6_Gk}* tj?Qkaq~PT~gu|iJUk?A(efUp+0RS$^_ScH>kzW7+002ovPDHLkV1n3`T^;}c literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/gray/zoombox.png b/eric/GUI/icons/themes/gray/zoombox.png new file mode 100644 index 0000000000000000000000000000000000000000..49bbf59c3e306a9fd24900d5fba2dc886b68b25f GIT binary patch literal 215 zcmeAS@N?(olHy`uVBq!ia0vp^!ayv>!3HFi<}R-XQj#UE5hcO-X(i=}MX3yqDfvmM z3ZA)%>8U}fi7AzZCsS>JiYh%_978H@y}9DabwGiKHQ?=2+n(owg}17^f@2q5mG=-p4Azu>GUV{Zpy)E&?6F N;OXk;vd$@?2>{JdPI&+T literal 0 HcmV?d00001 diff --git a/eric/GUI/icons/themes/gray/zreducebutton.png b/eric/GUI/icons/themes/gray/zreducebutton.png new file mode 100644 index 0000000000000000000000000000000000000000..b237f6d2c78cbd8c4bcc3d5881a32c0f1594e113 GIT binary patch literal 740 zcmV?4efTu1Ki zJpx`sOxNAB@8vT32a?FYdI`sd20IJ&oelHF^Jj>5^`h_c5cGHqEiySeuHulUO=~?K zch91UUO2XnkEg<=r6rWBbqo*mfpI)`b`NlPSc5;{gX3j4Z5T!kEzXZP0oPaFV|jVm z$>;eB=jRuY=m-PP6T?E)FmYV7+<9WwVOR|WcoFe<7ujCI+rm5V9DdyTiaV2& z=%i2;MTM${A;}VWKbcXcY`aAYP511|jkSswWkMG}Rk8GL%AC6sTQP=z1GeSw=V{As~pvBVelmLp0&{``mAd zY%}EJ3A~XR!ngf0#Gn90RiF@94oV1$5&?W@*mdv%j~1iQO%ukcMLxsuY@6HJQ8b$k zSe8YQ05n-~n>!Lw(bld|PE{x}{Uj8^Y2Acc$Sv0L2c)@N2MmE2~IMq&_! z0Hh$JnlMu4)TV`_Y6a_SC5)!8Vmv#>{r2iTe)5!U@9d*1(T!AU5Ix-;ZYaByj!&E0 z*xmVp?pQk>KDf_a_;FZSU1g=U4=@`|9Q`0000? zB*>Y8^Yin@;^HDCNkSwNK`QiByZiO zzzgupvgJD}6fiU#Li+hLm@(9hlTh2qHlIFu3}5d621mvr2mH`!NU2grkv?tuE(ZdZ z&lenk8EfWrtZ;dG8HI8k6T^crhy#23$0!!7VC*)SS?yLEwOSQAVGy9e^_BO?X0zrz zPoH5TansNk79*o$2+%eK!2^zCVP_Z%sOvg3RfSTi;OMA;&8?4MTN*O2UyxHP+}!zs z8#6QLp{>5nzJpid!MojH$j^8as;U}_N(I-i#8A_!c=PgA=cRC739`=zAFVFfEkp7M zU}=Rm8)Nx(qNAZT!8%-!{W8km6>yT+88|r}hTG+&auG2*I}6d{ft%xDce+4mm2JI= zT2)1f%BEOSz|+_$&FKid6dlLc!vb8a6M`r}pkNQngLUx~XhXAIhr{WBZs@4dS=JgF z&6z+)*<6cHq19?a(=-aPTP>U7_IgE}>k=S}A_Ncp2*;sOSJ7_NF&(?yxx#qtD%sxo zWaRRBOUyp6A1#_S002ovPDHLkV1hqLX;uIL literal 0 HcmV?d00001 diff --git a/eric/GUI/palette/.DS_Store b/eric/GUI/palette/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..fe99c6202ab84e5b024082022bd4c85e3c775c61 GIT binary patch literal 12292 zcmeHMOKuZE5Pj`<5k3n`{JfkctBepAaBP#vC`KrO4GWCzjDTQlYdnrv`WPIF18@Ki zzzyJ4bq7XcH&|>4q+05({=Mqz*VEN18-QysPagnH0K3d08#h>NNHQ*YE!9HLZAwQx zaDoCeX8(fH7bU7z3Aq0lwLib|de;AGOjLFb1w91L7YNW|6HRS6-^? zV4)!ZWu4ucSZ5rdm?X$nkSi}0N}WD>Z~^Kb484%hP1N@KtnSZ6?D_iNZgm$Cbx9KX-TqseTbITT;wvf5G}&u9D%DdBoO`rR=dlN~UtIKWEPjAJ~?i7i?uZW5J#dYscto z|B$St)Spvd${w#d#UWSiu}9XM=*)s;N_#f$k@h|b_HG;}?rw>jK5bj-uJ*ZyAy*OY zd6cuy70zx!&h)2UeYU2|uYaXQzmoDPZ>i-HpT+h&xHz3H5#+m3;rNAq)miL}>gT^X zqYL~15BZHoZdC2dpK1Ar&M3k|=>}ELD1snU_abLBz&>x+oVQ`jn-$@D=d8l@ov5}$ zYMSAFRMXdrre;J_2XEA-cWA43idd%pxa`kk`xGB9UN6%!rcJzbSzBzMNAw`#C!_C# z6W_g!rf2leh5Dz6O-?*oSreOSow9d_g}w7 jD~thSz!)$Fi~(c77%&Em0b{@zFb0ePW55{rpBVTKd(IHh literal 0 HcmV?d00001 diff --git a/eric/GUI/palette/JColorPanel.java b/eric/GUI/palette/JColorPanel.java new file mode 100644 index 0000000..f7c3d7e --- /dev/null +++ b/eric/GUI/palette/JColorPanel.java @@ -0,0 +1,358 @@ +/* + +Copyright 2006 Eric Hakenholz + +This file is part of C.a.R. software. + +C.a.R. is a free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 3 of the License. + +C.a.R. is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + + */ +package eric.GUI.palette; + +import eric.GUI.themes; +import eric.JZirkelCanvas; +import java.awt.BasicStroke; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.Stroke; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionListener; + +import java.awt.image.BufferedImage; +import javax.swing.BoxLayout; +import javax.swing.JComboBox; +import javax.swing.JComponent; +import javax.swing.JDialog; +import javax.swing.JLabel; +import eric.JEricPanel; +import javax.swing.SwingConstants; + +import net.java.dev.colorchooser.ColorChooser; +import net.java.dev.colorchooser.Palette; +import rene.gui.Global; + +/** + * + * @author erichake + */ +public class JColorPanel extends JEricPanel implements MouseListener, + MouseMotionListener { + + /** + * + */ + + private final ColorChooser cchooser; + private Palette Pal; + int PaletteType; + int xx, yy; + colorline mycolorpickerline; + JComboBox JCB; + JLabel comment; + JColorPanel me; + + /** + * + * @param g + */ + @Override + public void paintComponent(final java.awt.Graphics g) { + super.paintComponent(g); + final java.awt.Dimension d=this.getSize(); + g.drawImage(themes.getImage("palbackground.gif"), 0, 0, d.width, + d.height, this); + } + + /** + * Creates a new instance of JColorPanel + * + * @param zf + * @param jpm + */ + public JColorPanel() { + me=this; + xx=-1; + yy=-1; + PaletteType=Global.getParameter("colorbackgroundPal", 1); + cchooser=new ColorChooser(); + this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); + this.setAlignmentX(0); + this.setOpaque(false); + this.add(margintop(5)); + JCB=new JComboBox(); + JCB.setMaximumRowCount(5); + JCB.setOpaque(false); + JCB.setFocusable(false); + JCB.setEditable(false); + JCB.setAlignmentX(0); + JCB.setFont(new Font("System", 0, 11)); + JCB.addItem(Global.Loc("palette.colors.saturated1")); + JCB.addItem(Global.Loc("palette.colors.desaturated1")); + JCB.addItem(Global.Loc("palette.colors.saturated2")); + JCB.addItem(Global.Loc("palette.colors.desaturated2")); + JCB.addItem(Global.Loc("palette.colors.constants")); + JCB.setSelectedIndex(PaletteType); + JCB.addItemListener(new ItemAdapter()); + final JEricPanel JCBpanel=new JEricPanel(); + JCBpanel.setLayout(new BoxLayout(JCBpanel, BoxLayout.X_AXIS)); + JCBpanel.setAlignmentX(0); + JCBpanel.setOpaque(false); + fixsize(JCBpanel, themes.getRightPanelWidth(), 24); + JCBpanel.add(margin(5)); + fixsize(JCB, themes.getRightPanelWidth()-10, 22); + JCBpanel.add(JCB); + this.add(JCBpanel); + + mycolorpickerline=new colorline(PaletteType); + this.add(mycolorpickerline); + + comment=new JLabel("coucou"); + comment.setOpaque(false); + comment.setAlignmentX(0); + comment.setFont(new Font("System", 0, 9)); + fixsize(comment, themes.getRightPanelWidth(), 14); + comment.setHorizontalAlignment(SwingConstants.CENTER); + this.add(comment); + } + + public void refresh(){ + JCB.setSelectedIndex(Global.getParameter("colorbackgroundPal", 1)); + } + + class ItemAdapter implements ItemListener { + + public void itemStateChanged(final ItemEvent evt) { + if (evt.getStateChange()==ItemEvent.SELECTED) { + me.remove(mycolorpickerline); + mycolorpickerline=new colorline(JCB.getSelectedIndex()); + + Global.setParameter("colorbackgroundPal", JCB.getSelectedIndex()); + me.add(mycolorpickerline, 2); + int x=Global.getParameter("colorbackgroundx", 74); + int y=Global.getParameter("colorbackgroundy", 12); + x=x*Pal.getSize().width/mycolorpickerline.mycolors.getSize().width; + y=y*Pal.getSize().height/mycolorpickerline.mycolors.getSize().height; + final Color mycolor=Pal.getColorAt(x, y); + if (mycolor!=null) { + Global.setParameter("colorbackground", mycolor); + } + me.repaint(); + PaletteManager.init(); + } + } + } + + public JDialog GetDialog(final Component c) { + if (c instanceof JDialog||null==c) { + return c==null?null:(JDialog) c; + } + return GetDialog(c.getParent()); + } + + class colorline extends JEricPanel { + + /** + * + */ + + JEricPanel mymargin; + onlycolors mycolors; + + colorline(final int ptype) { + PaletteType=ptype; + Pal=cchooser.getPalettes()[ptype]; + this.setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); + this.setAlignmentX(0); + mymargin=margin(0); + if (themes.getRightPanelWidth()>Pal.getSize().width) { + fixsize(mymargin, (themes.getRightPanelWidth()-Pal.getSize().width)/2, 1); + } + this.add(mymargin); + mycolors=new onlycolors(ptype); + this.add(mycolors); + this.setOpaque(false); + } + // public void fixmargin(){ + // if (PW>Pal.getSize().width){ + // fixsize(mymargin,(PW-Pal.getSize().width)/2,1); + // } + // } + // public void setPalette(int i){ + // mycolors.changePal(i); + // fixmargin(); + // } + } + + private class onlycolors extends JEricPanel { + + /** + * + */ + + Image bimage; + + @Override + public void paintComponent(final java.awt.Graphics g) { + super.paintComponent(g); + final Dimension d=this.getSize(); + final int w=d.width; + final int h=d.height; + g.drawImage(bimage, 0, 0, w, h, this); + final Color mycolor=Global.getParameter("colorbackground", + new Color(231, 238, 255)); + cchooser.setColor(mycolor); + if (JZirkelCanvas.getCurrentZC()!=null) { + JZirkelCanvas.getCurrentZC().setBackground(mycolor); + JZirkelCanvas.getCurrentZC().repaint(); + } + + + int x=Global.getParameter("colorbackgroundx", 74); + int y=Global.getParameter("colorbackgroundy", 12); + + if (PaletteType==4) { + x=((int) (x/12))*12+6; + y=((int) (y/12))*12+6; + } + + final Graphics2D g2=(Graphics2D) g; + // AlphaComposite ac = + // AlphaComposite.getInstance(AlphaComposite.SRC_OVER,0.5f); + // g2.setComposite(ac); + g2.setColor(new Color(0, 0, 0)); + Stroke stroke=new BasicStroke(1f); + g2.setStroke(stroke); + g2.drawRect(x-4, y-4, 8, 8); + stroke=new BasicStroke(1f); + g2.setStroke(stroke); + g2.setColor(new Color(255, 255, 255)); + g2.drawRect(x-3, y-3, 6, 6); + // g.drawRect(x-5,y-5,10,10); + comment.setText(Pal.getNameAt(x, y)); + } + + onlycolors(final int ptype) { + final int w=(themes.getRightPanelWidth()mycolorpickerline.mycolors.getSize().width) { + x=mycolorpickerline.mycolors.getSize().width; + } + if (x<0) { + x=0; + } + if (y>mycolorpickerline.mycolors.getSize().height) { + y=mycolorpickerline.mycolors.getSize().height; + } + if (y<0) { + y=0; + } + + Global.setParameter("colorbackgroundx", x); + Global.setParameter("colorbackgroundy", y); + + x=x*Pal.getSize().width/mycolorpickerline.mycolors.getSize().width; + y=y*Pal.getSize().height/mycolorpickerline.mycolors.getSize().height; + + final Color mycolor=Pal.getColorAt(x, y); + if (mycolor!=null) { + Global.setParameter("colorbackground", mycolor); + JZirkelCanvas.getCurrentLocalPreferences(); + mycolorpickerline.mycolors.repaint(); + } + } + + public void mouseReleased(final MouseEvent e) { + xx=-1; + yy=-1; + } + + public void mouseEntered(final MouseEvent e) { + } + + public void mouseExited(final MouseEvent e) { + } + + public void mouseDragged(final MouseEvent e) { + mousePressed(e); + } + + public void mouseMoved(final MouseEvent e) { + } +} diff --git a/eric/GUI/palette/JCursor.java b/eric/GUI/palette/JCursor.java new file mode 100644 index 0000000..56b7f4b --- /dev/null +++ b/eric/GUI/palette/JCursor.java @@ -0,0 +1,132 @@ +/* + +Copyright 2006 Eric Hakenholz + +This file is part of C.a.R. software. + + C.a.R. is a free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 3 of the License. + + C.a.R. is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + */ + + + package eric.GUI.palette; + +import eric.*; +import eric.GUI.themes; +import java.awt.Color; +import java.awt.Font; + +import javax.swing.BoxLayout; +import javax.swing.JLabel; +import eric.JEricPanel; +import javax.swing.JSlider; + +import rene.gui.Global; + +/** + * + * @author erichake + */ +public class JCursor extends JEricPanel { + /** + * + */ + private static final long serialVersionUID = 1L; + JLabel mylabel, myval; + public JSlider mycursor; + String myP, mytxt; + boolean palmember = false; + + /** Creates a new instance of JCursor */ + @Override + public void paintComponent(final java.awt.Graphics g) { + super.paintComponent(g); + if (palmember) { + final java.awt.Dimension d = this.getSize(); + g.drawImage(themes.getImage("palbackground.gif"), 0, 0, + d.width, d.height, this); + } + } + + // JCursor constructor for palette member : + public JCursor(final String myparam, final String mytext, final int min, + final int max, int sel) { + sel = Global.getParameter(myparam, sel); + myP = myparam; + palmember = true; + final int lblwidth = 65; + mytxt = mytext; + mycursor = new JSlider(); + mylabel = new JLabel(); + myval = new JLabel(); + this.setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); + this.setAlignmentX(0); + mylabel.setText(" " + mytxt); + mylabel.setForeground(Color.DARK_GRAY); + mylabel.setFont(new Font(Global.GlobalFont, Font.PLAIN, 11)); + mylabel.setSize(lblwidth, 27); + mylabel.setMaximumSize(new java.awt.Dimension(lblwidth, 27)); + mylabel.setMinimumSize(new java.awt.Dimension(lblwidth, 27)); + mylabel.setPreferredSize(new java.awt.Dimension(lblwidth, 27)); + myval.setText(String.valueOf(sel)); + myval.setForeground(Color.GRAY); + myval.setFont(new java.awt.Font(Global.GlobalFont, Font.BOLD, 11)); + myval.setSize(20, 27); + myval.setMaximumSize(new java.awt.Dimension(20, 27)); + myval.setMinimumSize(new java.awt.Dimension(20, 27)); + myval.setPreferredSize(new java.awt.Dimension(20, 27)); + mycursor.setFont(new java.awt.Font(Global.GlobalFont, 0, 11)); + mycursor.setOpaque(false); + mycursor.setMajorTickSpacing(1); + mycursor.setMaximum(max); + mycursor.setMinimum(min); + mycursor.setMinorTickSpacing(1); + mycursor.setPaintLabels(false); + mycursor.setPaintTicks(false); + mycursor.setSnapToTicks(true); + mycursor.setValue(sel); + mycursor.setAlignmentX(0.0F); + mycursor.setMaximumSize(new java.awt.Dimension(themes.getRightPanelWidth() - 82, 27)); + mycursor.setMinimumSize(new java.awt.Dimension(themes.getRightPanelWidth() - 82, 27)); + mycursor.setPreferredSize(new java.awt.Dimension(themes.getRightPanelWidth() - 82, 27)); + mycursor.setSize(new java.awt.Dimension(themes.getRightPanelWidth() - 82, 27)); + + mycursor.addChangeListener(new javax.swing.event.ChangeListener() { + public void stateChanged(final javax.swing.event.ChangeEvent evt) { + final JSlider myc = (JSlider) evt.getSource(); + final int mysel = myc.getValue(); + rene.gui.Global.setParameter(myP, mysel); + +// JPM.MW.JPR.getLocalPreferences(); + if (JZirkelCanvas.getCurrentZC()!=null) { + JZirkelCanvas.getCurrentZC().getLocalPreferences(); + JZirkelCanvas.getCurrentZC().updateDigits(); + JZirkelCanvas.getCurrentZC().JCM.updateDigits(); + JZirkelCanvas.getCurrentZC().resetGraphics(); + JZirkelCanvas.getCurrentZC().repaint(); + }; + myval.setText(String.valueOf(mysel)); + } + }); + + this.add(mylabel); + this.add(mycursor); + this.add(myval); + this.setOpaque(false); + this.setMaximumSize(new java.awt.Dimension(themes.getRightPanelWidth(), 27)); + this.setMinimumSize(new java.awt.Dimension(themes.getRightPanelWidth(), 27)); + this.setPreferredSize(new java.awt.Dimension(themes.getRightPanelWidth(), 27)); + this.setSize(themes.getRightPanelWidth(), 27); + } + +} diff --git a/eric/GUI/palette/JIcon.java b/eric/GUI/palette/JIcon.java new file mode 100644 index 0000000..fcfb3ab --- /dev/null +++ b/eric/GUI/palette/JIcon.java @@ -0,0 +1,611 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.palette; + +import eric.FileTools; +import eric.GUI.pipe_tools; +import eric.GUI.themes; +import eric.GUI.window.LeftPanel; +import eric.GUI.window.tab_main_panel; +import java.awt.image.ImageFilter; +import eric.GUI.windowComponent; +import eric.JZirkelCanvas; +import eric.macros.CreateMacroDialog; +import eric.macros.MacroTools; +import java.awt.AlphaComposite; +import java.awt.BasicStroke; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.Point; +import java.awt.Stroke; +import java.awt.event.MouseEvent; +import java.awt.image.FilteredImageSource; +import javax.swing.GrayFilter; +import javax.swing.ImageIcon; +import rene.gui.Global; +import rene.zirkel.ZirkelCanvas; +import rene.zirkel.ZirkelFrame; +import rene.zirkel.constructors.AreaConstructor; +import rene.zirkel.constructors.QuadricConstructor; +import rene.zirkel.tools.JLocusObjectTracker; +import rene.zirkel.tools.JSmacroTool; +import rene.zirkel.tools.ObjectTracker; + +/** + * + * @author erichake + */ +public class JIcon extends windowComponent { + // icon_group==null means simple push button + // icon_group==icon_name name means simple toggle button + + private String icon_name=""; + private String icon_group=""; + private boolean isSelected; // icon state + private boolean isDisabled=false; // icon disabled ? + private boolean isEntered=false; // Mouseover ? + private Image image=null; + private int IconsPerRow=-1; // Number of icons per row. + // If -1 then this is the standard number defined + // by themes.palette_icon_per_row + + @Override + public void paintComponent(final java.awt.Graphics g) { + super.paintComponent(g); + final java.awt.Dimension d=this.getSize(); + final int w=d.width; + final int h=d.height; + final Graphics2D g2=windowComponent.getGraphics2D(g); + if (isDisabled) { + final ImageFilter filter=new GrayFilter(true, 60); + final Image disImage=createImage(new FilteredImageSource(image.getSource(), filter)); + final ImageIcon myicn=new ImageIcon(disImage); + g2.drawImage(myicn.getImage(), 0, 0, w, h, this); + return; + } + g2.drawImage(image, 0, 0, w, h, this); + if (isSelected) { + final AlphaComposite ac=AlphaComposite.getInstance( + AlphaComposite.SRC_OVER, 0.2f); + g2.setComposite(ac); + g2.setColor(new Color(0, 0, 100)); + // g2.fillRoundRect(1,1,w-1,h-1,14,14); + g2.fillRect(1, 1, w-1, h-1); + } + if (isEntered) { + final AlphaComposite ac=AlphaComposite.getInstance( + AlphaComposite.SRC_OVER, 0.1f); + g2.setComposite(ac); + g2.setColor(new Color(0, 0, 80)); + final Stroke stroke=new BasicStroke(3f); + g2.setStroke(stroke); + g2.drawRect(2, 2, w-4, h-4); + } + } + + public JIcon(String name, String group) { + super(); + icon_name=name; + icon_group=group; + image=themes.getPaletteImage(name); + PaletteManager.registerIcon(this); + String ttp=PaletteManager.ToolTip(name); + if (ttp!=null) { + setToolTipText(""+ttp.replace("+", "
")+""); + } + setOpaque(false); + } + + public JIcon(String name, String group, int iconperrow) { + this(name, group); + IconsPerRow=iconperrow; + } + + public String getIconGroup() { + return icon_group; + } + + public String getIconName() { + return icon_name; + } + + public boolean isToggleButton() { + return (icon_name.equals(icon_group)); + } + + public boolean isPushButton() { + return (icon_group==null); + } + + public void setOver(boolean b) { + isEntered=b; + } + + public void setSelected(boolean b) { + isSelected=b; + } + + public void setDisabled(boolean b) { + isDisabled=b; + } + + public boolean isSelected() { + return isSelected; + } + + public boolean isDisabled() { + return isDisabled; + } + + public void init() { + int w=getIconWidth(); + setPreferredSize(new Dimension(w, w)); + } + + public int getIconWidth() { + if (IconsPerRow==-1) { + return themes.getPaletteIconWidth(); + } else { + int w=(themes.getPaletteIconPerRow()*themes.getPaletteIconWidth())/IconsPerRow; + return w; + } + } + + @Override + public Point getToolTipLocation(MouseEvent event) { + return new Point(getSize().width/2, getSize().height+4); + } + + @Override + public void mouseClicked(MouseEvent e) { + } + + @Override + public void mousePressed(MouseEvent e) { + ClicOnMe(); + } + + @Override + public void mouseReleased(MouseEvent e) { + } + + @Override + public void mouseEntered(MouseEvent e) { + PaletteManager.setOverBtn(this); + } + + @Override + public void mouseExited(MouseEvent e) { + isEntered=false; + PaletteManager.repaint(); + } + private static ZirkelFrame ZF; + private static ZirkelCanvas ZC; + private static JZirkelCanvas JZF; + private static String moveonreselect=",delete,hide,rename,edit,zoom,animate,"; + + private static void TasksBeforeClick(JIcon me) { + ZF.CurrentTool=0; + if (PaletteManager.isGeomGroup(me.getIconName())) { + AreaConstructor.deletePreview(ZF.ZC); + QuadricConstructor.deletePreview(ZF.ZC); + } + CreateMacroDialog.quit(); + ZF.ZC.JCM.hideHandles(null); + } + + public void ClicOnMe() { + if ((moveonreselect.indexOf(","+icon_name+",")!=-1)&&(isSelected)) { + PaletteManager.setSelected_with_clic("move", true); + return; + } + PaletteManager.setSelectBtn(this); + ZF=JZirkelCanvas.getCurrentZF(); + JZF=JZirkelCanvas.getCurrentJZF(); + ZC=JZirkelCanvas.getCurrentZC(); + if (ZC==null) { + return; + } + if(ZC.getTool() instanceof JSmacroTool){ + ((JSmacroTool) ZC.getTool()).invalidate(ZC); + } + + PaletteManager.setGoodProperties(icon_name); + TasksBeforeClick(this); + action(this, icon_name); + } + + private static boolean checkReplay(String o) { + if (o.equals("oneforward")) { + JZF.getReplay().iconPressed(o); + } else if (o.equals("oneback")) { + JZF.getReplay().iconPressed(o); + } else if (o.equals("fastforward")) { + JZF.getReplay().iconPressed(o); + } else if (o.equals("fastback")) { + JZF.getReplay().iconPressed(o); + } else if (o.equals("allforward")) { + JZF.getReplay().iconPressed(o); + } else if (o.equals("setbreak")) { + JZF.getReplay().iconPressed(o); + } else if (o.equals("nextbreak")) { + JZF.getReplay().iconPressed(o); + } else { + JZF.getReplay().doclose(); + return false; + } + return true; + } + + private static void action(JIcon me, String o) { + + if (checkReplay(o)) { + return; + } + if (me.isDisabled) { + return; + } + ZC.pause(true); + ZC.requestFocus(); + ZF.setinfo(o); + + if ((ZC.isDP())&&(!ZC.isEuclidian())&&(MacroTools.isDPMacro(o))) { + MacroTools.runDPMacro(o); + } else if (o.equals("select")) { + ZF.ZC.setSelectTool(); + } else if (o.equals("load")) { + ZF.setinfo("save"); + FileTools.openFile(); + } else if (o.equals("save")) { + ZF.setinfo("save"); + FileTools.saveFile(); + } else if (o.equals("new")) { + tab_main_panel.newTabBtn(); + pipe_tools.actualiseMacroPanel(); + } else if (o.equals("newmacro")) { + new CreateMacroDialog(JZirkelCanvas.getNewMacroPanel()); + JZirkelCanvas.ActualiseMacroPanel(); + } else if (o.equals("manage_macros")) { + LeftPanel.showPanel(me.isSelected); + } else if (o.startsWith("type")) { + ZF.settype(Integer.parseInt(o.substring(4))); + ZF.setinfo("zone_aspect"); + } else if (o.startsWith("thickness")) { + setObjectColorType(Integer.parseInt(o.substring(9))); + ZF.setinfo("zone_aspect"); + } else if (o.startsWith("filled")) { + setObjectFilled(me.isSelected); + } else if (o.startsWith("color")) { + ZF.setinfo("zone_aspect"); + setObjectColor(Integer.parseInt(o.substring(5))); + } else if (o.startsWith("acolor")) { + final int chx=Integer.parseInt(o.substring(6)); + ZF.ZC.setAxis_color(chx); + ZF.ZC.repaint(); + } else if (o.startsWith("athickness")) { + final int chx=Integer.parseInt(o.substring(10)); + ZF.ZC.setAxis_thickness(chx); + ZF.ZC.repaint(); + } else if (o.equals("numgrid")) { + ZF.ZC.setAxis_labels(me.isSelected); + ZF.ZC.repaint(); + } else if (o.equals("dottedgrid")) { + ZF.ZC.setAxis_with_grid(me.isSelected); + ZF.ZC.repaint(); + } else if (o.equals("vector")) { + //ZF.setVectors(true); + ZF.settool("vector"); + } else if (o.equals("vector3D")) { + //ZF.setVectors(true); + ZF.settool("vector"); + } else if (o.equals("inter3D")) { + //ZF.setVectors(true); + ZF.settool("intersection"); + } else if (o.equals("midpoint3D")) { + //ZF.setVectors(true); + ZF.settool("midpoint"); + } else if (o.equals("segment3D")) { + //ZF.setVectors(true); + ZF.settool("segment"); + } else if (o.equals("line3D")) { + //ZF.setVectors(true); + ZF.settool("line"); + } else if (o.equals("ray3D")) { + //ZF.setVectors(true); + ZF.settool("ray"); + } else if (o.equals("area3D")) { + //ZF.setVectors(true); + ZF.settool("area"); + } else if (o.equals("segment")) { + //ZF.setVectors(false); + ZF.settool("segment"); + } else if (o.equals("quadric")) { + //ZF.setVectors(false); + ZF.settool("quadric"); + } else if (o.equals("fixedsegment")) { + + ZF.setVectors(false); + ZF.settool("fixedsegment"); + } else if (o.equals("angle3D")) { + //ZF.setVectors(true); + ZF.settool("angle"); + } else if (o.equals("image3")) { + + ZF.settool("image"); + +// if (!ZF.haveFile()) { +// JOptionPane.showMessageDialog(null, Global.Loc("palette.image.fileerror")); +//// PaletteManager.MW.savefile(); +// } +// +// if (ZF.haveFile()) { +// ZF.settool("image"); +// } else { +// PaletteManager.setSelected("point", true); +// } + } else if (o.equals("background")) { + ZF.setinfo("background"); + if (me.isSelected) { + Global.setParameter("background.usesize", + false); + Global.setParameter("background.tile", + false); + Global.setParameter("background.center", + true); + ZF.loadBackground(); + PaletteManager.setSelected_with_clic("imcenter", true); + } else { + ZF.ZC.grab(false); + } + } else if (o.equals("imcenter")) { + rene.gui.Global.setParameter("background.usesize", false); + rene.gui.Global.setParameter("background.tile", false); + rene.gui.Global.setParameter("background.center", true); + ZF.setinfo("background"); + ZF.ZC.repaint(); + + } else if (o.equals("imtile")) { + rene.gui.Global.setParameter("background.usesize", false); + rene.gui.Global.setParameter("background.tile", true); + rene.gui.Global.setParameter("background.center", false); + ZF.setinfo("background"); + ZF.ZC.repaint(); + } else if (o.equals("imstretch")) { + rene.gui.Global.setParameter("background.usesize", true); + rene.gui.Global.setParameter("background.tile", false); + rene.gui.Global.setParameter("background.center", false); + ZF.setinfo("background"); + ZF.ZC.repaint(); +// } else if (name.equals("loadmacros")) { +// JMacrosTools.OpenMacro(""); +// } else if (name.equals("new")) { +// JMacrosTools.NewWindow(); +// } else if (name.equals("load")) { +// JMacrosTools.OpenFile(); +// } else if (name.equals("save")) { +// PaletteManager.MW.savefile(); + } else if (o.equals("allback")) { + // ZF.settool(ZF.NParameters); + JZF.disposeReplay(); + JZF.newReplay(); + JZF.getReplay().iconPressed(o); + } else if (o.equals("partial")) { + ZF.ZC.setPartial(me.isSelected); + } else if (o.equals("plines")) { + ZF.ZC.setPartialLines(me.isSelected); + } else if (o.equals("showvalue")) { + setObjectShowValue(me.isSelected); + } else if (o.equals("hidden")) { + ZF.sethidden(me.isSelected); + ZC.reloadCD(); + ZF.setinfo("hidden"); + } else if (o.equals("showname")) { + setObjectShowName(me.isSelected); + } else if (o.equals("bold")) { + setObjectBold(me.isSelected); + } else if (o.equals("large")) { + setObjectLarge(me.isSelected); + } else if (o.equals("longnames")) { + ZF.setLongNames(me.isSelected); + ZF.setinfo("defaults"); + } else if (o.equals("obtuse")) { + setObjectObtuse(me.isSelected); + } else if (o.equals("solid")) { + setObjectSolid(me.isSelected); + } else if (o.equals("grid")) { + ZF.ZC.setAxis_show(me.isSelected); + if (me.isSelected) { + ZF.ZC.createAxisObjects(); + } else { + ZF.ZC.deleteAxisObjects(); + } + ZF.ZC.repaint(); + ZF.setinfo("grid"); + } else if (o.equals("objecttracker")) { + + ZirkelFrame.ObjectConstructors[ZirkelFrame.NObjectTracker]=new ObjectTracker(); + ZF.settool("objecttracker"); + } else if (o.equals("locus")) { + + ZirkelFrame.ObjectConstructors[ZirkelFrame.NObjectTracker]=new JLocusObjectTracker(); + ZF.settool("objecttracker"); + } else if (o.equals("function")) { + ZF.ZC.createCurve(); + ZF.setinfo("function"); + } else if (o.equals("equationxy")) { + ZF.ZC.createEquationXY(); +// } else if (name.equals("manage_macros")) { +// PaletteManager.MW.ZContent.ShowLeftPanel(2); +// } else if (name.equals("help_panel")) { +// PaletteManager.MW.ZContent.ShowLeftPanel(3); +// } else if (name.equals("newmacro")) { +// PaletteManager.MW.ZContent.ShowMacroPanel(); +// PaletteManager.MW.ZContent.macros.myJML.MacrosTree.JML.controls.createbtn.setSelected(true); +// PaletteManager.MW.ZContent.macros.myJML.MacrosTree.JML.createmacropanel.appeargently(); +// PaletteManager.deselectgeomgroup(); +// } else if (name.equals("history_panel")) { +// PaletteManager.MW.ZContent.ShowLeftPanel(1); +// // } else if (name.equals("properties_panel")){ +// // JGlobals.JPB.showme(me.isSelected); + } else if (o.equals("copy")) { + FileTools.exportGraphicFile(FileTools.PNG, null); + } else if (o.equals("exportpng")) { + FileTools.exportGraphicFile(FileTools.PNG); + } else if (o.equals("exporteps")) { + FileTools.exportGraphicFile(FileTools.EPS); + } else if (o.equals("exportsvg")) { + FileTools.exportGraphicFile(FileTools.SVG); + } else if (o.equals("exportpdf")) { + FileTools.exportGraphicFile(FileTools.PDF); + } else if (o.startsWith("bi_")) { + if (o.equals("bi_function_u")) { + Global.setParameter("options.point.shownames", false); + JZF.getPointLabel().getBetterName(null, true); + } + + MacroTools.runBuiltinMacro("@builtin@/"+o.substring(3)); + } else if (o.equals("back")) { + ZF.ZC.back(); + ZF.settool(o); + } else if (o.equals("undo")) { + ZF.ZC.undo(); + ZF.settool(o); + } else if (o.equals("boundedpoint")) { + + ZF.settool("boundedpoint"); + } else if (o.equals("ctrl_slider")) { + ZF.ZC.setNullTool(); + } else if (o.equals("ctrl_popup")) { + ZF.ZC.setNullTool(); + } else if (o.equals("ctrl_chkbox")) { + ZF.ZC.setNullTool(); + } else if (o.equals("ctrl_button")) { + ZF.ZC.setNullTool(); + } else if (o.equals("ctrl_edit")) { + ZF.ZC.setNullTool(); + } else if (o.equals("ctrl_txtfield")) { + ZF.ZC.setNullTool(); + } else { + ZF.settool(o); + } + + JIconMouseAdapter.setgeomSelectedIcon(); + ZC.pause(false); + ZC.requestFocus(); + + } + + private static boolean isIconWithProperties(final String name) { + final String acceptedIcons=",expression,locus,bi_function_u,text,area,area3D,ray,ray3D,segment,segment3D,"+"line,line3D,point,bi_3Dcoords,parallel,plumb,intersection,inter3D,midpoint,midpoint3D,bi_syma,bi_3Dsymp,bi_3Dproj"+"bi_symc,bi_3Dsymc,bi_trans,bi_3Dtrans,bi_3Dcircle1,bi_3Dcircle2,bi_3Dcircle3pts,bi_3Dplandroite,bi_3Dplanplan,bi_3Dsphererayon,bi_3Dspherepoint,bi_3Dspheredroite,bi_3Dsphereplan,bi_3Dspheresphere,bi_med,bi_biss,vector,vector3D,fixedsegment,circle,"+"circle3,fixedcircle,bi_arc,bi_circ,angle,angle3D,fixedangle,quadric,"+"boundedpoint,tortue"; + return (acceptedIcons.indexOf(","+name+",")!=-1); + } + + public static void setObjectColor(final int i) { + String iconname=PaletteManager.geomSelectedIcon(); + if (isIconWithProperties(iconname)) { + iconname=PaletteManager.IconFamily(iconname); + Global.setParameter("options."+iconname+".pcolor", (Color) null); + Global.setParameter("options."+iconname+".color", i); + PaletteZone_Aspect.getColorPicker().setSelected(false); + PaletteZone_Aspect.getColorPicker().setDefaultColor(); + } else { + ZF.setcolor(i); + } + } + + public static void setObjectColor(final Color c) { + String iconname=PaletteManager.geomSelectedIcon(); + if (isIconWithProperties(iconname)) { + iconname=PaletteManager.IconFamily(iconname); + Global.setParameter("options."+iconname+".pcolor", c); + } + + } + + private static void setObjectColorType(final int i) { + String iconname=PaletteManager.geomSelectedIcon(); + if (isIconWithProperties(iconname)) { + iconname=PaletteManager.IconFamily(iconname); + Global.setParameter("options."+iconname+".colortype", i); + } else { + ZF.setcolortype(i); + } + } + + private static void setObjectShowName(final boolean bool) { + String iconname=PaletteManager.geomSelectedIcon(); + if (isIconWithProperties(iconname)) { + iconname=PaletteManager.IconFamily(iconname); + Global.setParameter("options."+iconname+".shownames", bool); + } else { + ZF.setShowNames(bool); + } + ZF.setinfo("defaults"); + JZF.getPointLabel().getBetterName(null, true); + } + + private static void setObjectShowValue(final boolean bool) { + String iconname=PaletteManager.geomSelectedIcon(); + if (isIconWithProperties(iconname)) { + iconname=PaletteManager.IconFamily(iconname); + Global.setParameter("options."+iconname+".showvalues", bool); + } else { + ZF.ZC.setShowValues(bool); + } + } + + private static void setObjectFilled(final boolean bool) { + String iconname=PaletteManager.geomSelectedIcon(); + if (isIconWithProperties(iconname)) { + iconname=PaletteManager.IconFamily(iconname); + Global.setParameter("options."+iconname+".filled", bool); + } else { + // ZF.ZC.setShowValues(bool); + } + } + + private static void setObjectSolid(final boolean bool) { + String iconname=PaletteManager.geomSelectedIcon(); + if (isIconWithProperties(iconname)) { + iconname=PaletteManager.IconFamily(iconname); + Global.setParameter("options."+iconname+".solid", bool); + } else { + // ZF.ZC.setShowValues(bool); + } + } + + private static void setObjectLarge(final boolean bool) { + String iconname=PaletteManager.geomSelectedIcon(); + if (isIconWithProperties(iconname)) { + iconname=PaletteManager.IconFamily(iconname); + Global.setParameter("options."+iconname+".large", bool); + } else { + ZF.ZC.setLargeFont(bool); + } + + } + + private static void setObjectBold(final boolean bool) { + String iconname=PaletteManager.geomSelectedIcon(); + if (isIconWithProperties(iconname)) { + iconname=PaletteManager.IconFamily(iconname); + Global.setParameter("options."+iconname+".bold", bool); + } else { + ZF.ZC.setBoldFont(bool); + } + } + + private static void setObjectObtuse(final boolean bool) { + String iconname=PaletteManager.geomSelectedIcon(); + if (isIconWithProperties(iconname)) { + iconname=PaletteManager.IconFamily(iconname); + Global.setParameter("options."+iconname+".obtuse", bool); + } else { + ZF.ZC.setObtuse(bool); + } + } +} diff --git a/eric/GUI/palette/JIconMouseAdapter.java b/eric/GUI/palette/JIconMouseAdapter.java new file mode 100644 index 0000000..2124e08 --- /dev/null +++ b/eric/GUI/palette/JIconMouseAdapter.java @@ -0,0 +1,57 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.palette; + +import eric.GUI.themes; +import eric.JZirkelCanvas; +import java.awt.Point; +import java.awt.event.MouseEvent; +import java.awt.event.MouseMotionListener; +import rene.zirkel.ZirkelCanvas; + +/** + * + * @author erichake + */ +public class JIconMouseAdapter implements MouseMotionListener { + + private static ZirkelCanvas ZC=null; + private static String geomSelectedIcon="point"; + private static String acceptedIcons=",hide,delete,ctrl_slider,ctrl_txtfield,ctrl_popup,ctrl_chkbox,ctrl_button,"; + + public static void setgeomSelectedIcon() { + ZC=JZirkelCanvas.getCurrentZC(); + if (ZC!=null) { + geomSelectedIcon=PaletteManager.geomSelectedIcon(); + if ((acceptedIcons.indexOf(geomSelectedIcon)==-1)||(geomSelectedIcon.equals(""))) { + ZC=null; + } + } + } + + public static void deselect() { + ZC=null; + } + + public static void paintTool() { + if (ZC!=null) { + final Point pt=ZC.getMousePosition(); + try { + ZC.getGraphics().drawImage(ZC.I, 0, 0, ZC); + ZC.getGraphics().drawImage(themes.getPaletteImage(geomSelectedIcon), pt.x+5, pt.y+5, themes.getToolIconSize(), themes.getToolIconSize(), ZC); + + } catch (Exception ex) { + } + } + } + + @Override + public void mouseMoved(MouseEvent e) { + paintTool(); + } + + public void mouseDragged(MouseEvent e) { + } +} diff --git a/eric/GUI/palette/PaletteManager.java b/eric/GUI/palette/PaletteManager.java new file mode 100644 index 0000000..545f54a --- /dev/null +++ b/eric/GUI/palette/PaletteManager.java @@ -0,0 +1,685 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.palette; + +import eric.GUI.window.LeftPanel; +import eric.GUI.window.MenuBar; +import eric.GUI.window.RightPanel; +import eric.JZirkelCanvas; +import eric.macros.MacroTools; +import eric.restrict.RestrictItems; +import eric.restrict.RestrictPanel; +import java.awt.Color; +import java.awt.Dimension; +import java.util.ArrayList; +import javax.swing.JComponent; +import javax.swing.SwingUtilities; +import rene.gui.Global; +import rene.zirkel.ZirkelCanvas; +import rene.zirkel.construction.Construction; + +/** + * + * @author erichake + */ +public class PaletteManager { + + private static String GEOM_GROUP="geom"; + static String POINT_GROUP="point"; + static String ASPECT1_GROUP="aspect1"; + static String ASPECT2_GROUP="aspect2"; + static String GRID1_GROUP="grid1"; + static String GRID2_GROUP="grid2"; + static String PHOTO_GROUP="photo"; + private static RightPanel MainPanel; + private static JIcon ctrlJSlider, ctrlJPopup, ctrlJCheckBox, ctrlJTextField, + ctrlJButton; + private static ArrayList allIcons=new ArrayList(); + private static PaletteZone JPDisk, JPEdit, JPfunc, JPTest, + JPControls, JPHist, JPSizes, JPColors, JPPrec, JPGrid; + private static ArrayList PaletteWithIconOnly; + private static PaletteZone_Aspect JPAspect; + private static PaletteZone_Geom JPGeom; + private static PaletteZone_3D JP3D; + private static JColorPanel colorpanel; + + public static ArrayList getAllIcons() { + return allIcons; + } + + public static void fixsize(JComponent jc, int w, int h) { + Dimension d=new Dimension(w, h); + jc.setSize(d); + jc.setMaximumSize(d); + jc.setMinimumSize(d); + jc.setPreferredSize(d); + } + + public static void construct(RightPanel mainpanel) { + MainPanel=mainpanel; + MainPanel.removeAll(); + allIcons.clear(); + constructJPDisk(); + constructJPEdit(); + constructJP3D(); + constructJPGeom(); + constructJPAspect(); + constructJPfunc(); + constructJPTest(); + constructJPControls(); + constructJPGrid(); + constructJPHist(); + constructJPColors(); + constructJPSizes(); + constructJPPrec(); + setDefault(); + PaletteWithIconOnly=new ArrayList(); + PaletteWithIconOnly.add(JPDisk); + PaletteWithIconOnly.add(JPEdit); + PaletteWithIconOnly.add(JP3D); + PaletteWithIconOnly.add(JPGeom); + PaletteWithIconOnly.add(JPfunc); + PaletteWithIconOnly.add(JPTest); + PaletteWithIconOnly.add(JPControls); + } + + public static void init() { + if (RightPanel.isPanelVisible()) { + fixRestrictedEnvironment(); + JPDisk.init(); + JPEdit.init(); +// JPDP.init(); + JP3D.init(); + JPGeom.init(); + JPAspect.init(); + JPfunc.init(); + JPTest.init(); + JPControls.init(); + JPGrid.init(); + JPHist.init(); + JPColors.init(); + JPSizes.init(); + JPPrec.init(); + FixPaletteHeight(null); + } + } + + private static void setDefault() { + setSelected_with_clic("type"+Global.getParameter("options.type", 0), true); + setSelected_with_clic("obtuse", Global.getParameter("options.obtuse", true)); + } + + + public static boolean isPaletteWithIconOnly(PaletteZone pz) { + for (int i=0; i=0)&&(lastpz.getBounds().y+lastpz.getBounds().height>MainPanel.getBounds().height)) { + PaletteZone pz=(PaletteZone) MainPanel.getComponent(i); + if (!pz.equals(caller)) { + pz.setHideContent(true); + pz.init(); + MainPanel.validate(); + } + i--; + } + } + MainPanel.repaint(); + } + + public static void FixPaletteHeight2(PaletteZone caller) { + if (caller!=null) { + caller.init(); + } + MainPanel.validate(); + if (MainPanel.getComponentCount()!=0) { + int i=MainPanel.getComponentCount()-1; + PaletteZone lastpz=(PaletteZone) MainPanel.getComponent(i); + while ((i>=0)&&(lastpz.getBounds().y+lastpz.getBounds().height>MainPanel.getBounds().height)) { + PaletteZone pz=(PaletteZone) MainPanel.getComponent(i); + if (!pz.equals(caller)&&!pz.equals(JPGeom)&&!pz.equals(JPAspect)&&!pz.equals(JPEdit)) { + pz.setHideContent(true); + pz.init(); + MainPanel.validate(); + } + i--; + } + } + MainPanel.repaint(); + } + + public static void registerIcon(JIcon icn) { + allIcons.add(icn); + } + + public static void removeIcon(JIcon icn) { + allIcons.remove(icn); + } + + + + public static void setOverBtn(JIcon icn) { + icn.setOver(true); + for (int i=0; i icons=new ArrayList(); + protected PaletteZoneTitle zone_title; + protected PaletteZoneContent zone_content; + private String zone_name; + private PaletteZone me; + +// @Override +// public void paintComponent(Graphics g) { +// } + public PaletteZone(String name) { + super(); + me=this; + zone_name=name; + setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); + setAlignmentX(0.0f); + zone_title=new PaletteZoneTitle(name) { + + @Override + public void mouseClicked(MouseEvent e) { + ToggleHideOrShow(); + PaletteManager.FixPaletteHeight(me); + } + }; + add(zone_title); + zone_content=new PaletteZoneContent(this); + add(zone_content); +// HideOrShow(); + } + + private void HideOrShow() { + hide_zone(Global.getParameter("hidepalette."+zone_name, false)); + } + + private void ToggleHideOrShow() { + hide_zone(!Global.getParameter("hidepalette."+zone_name, false)); + } + + private void hide_zone(boolean b) { + Global.setParameter("hidepalette."+zone_name, b); + zone_title.setHide(b); + zone_content.setHide(b); + } + + public void init() { + validate(); + HideOrShow(); + zone_title.init(); + for (JIcon element : icons) { + element.init(); + } + zone_content.init(); + } + + public void setHideContent(boolean b) { + hide_zone(b); + } + + public void setVisibleContentHeight() { + zone_content.setVisibleHeight(); + } + + public void clearContent() { + zone_content.removeAll(); + } + + public JIcon createToggleIcon(String name) { + JIcon ji=new JIcon(name, name); + addIcon(ji); + return ji; + } + + public JIcon createSimpleIcon(String name) { + JIcon ji=new JIcon(name, null); + addIcon(ji); + return ji; + } + + public JIcon createIcon(String name, String group) { + JIcon ji=new JIcon(name, group); + addIcon(ji); + return ji; + } + + public void createIcons(String myname[], String group) { + for (String element : myname) { + createIcon(element, group); + } + } + + // Seulement pour la zone Construction, et seulement dans + // le cas où il s'agit d'un modeDP : + public void insertEuclidianCheckBox(){ + + } + + // names est une chaine du type " nom1 nom2 nom3 " + public void insertIcons(String names, String group) { + String myname[]=names.trim().split(" "); + for (String element : myname) { + if ((element.equals("blank"))||(findIcon(element)==null)) { +// if (findIcon(element)==null) { + JIcon ji=createIcon(element, group); + PaletteManager.fixsize(ji, ji.getIconWidth(), ji.getIconWidth()); + } + } + } + + public JIcon findIcon(String name) { + for (JIcon ji : icons) { + if (name.equals(ji.getIconName())) { + return ji; + } + } + return null; + } + + public void removeBlankIcons() { + ArrayList blanks=new ArrayList(); + for (JIcon ji : icons) { + if (ji.getIconName().equals("blank")) { + blanks.add(ji); + } + } + for (JIcon ji : blanks) { + removeIcon(ji); + PaletteManager.removeIcon(ji); + } + } + + // names est une chaine du type " nom1 nom2 nom3 " + public void removeIcons(String names) { + ArrayList icns=new ArrayList(); + String myname[]=names.trim().split(" "); + for (String element : myname) { + JIcon ji=findIcon(element); + if (ji!=null) { + icns.add(ji); + } + } + for (JIcon ji : icns) { + removeIcon(ji); + PaletteManager.removeIcon(ji); + } + } + + public void removeIcon(JIcon ji) { + icons.remove(ji); + zone_content.remove(ji); + } + + public void addIcon(JIcon ji) { + icons.add(ji); + zone_content.add(ji); + } + + public void addComponent(JComponent jc) { + zone_content.add(jc); + } +} diff --git a/eric/GUI/palette/PaletteZoneCheckBox.java b/eric/GUI/palette/PaletteZoneCheckBox.java new file mode 100644 index 0000000..8dd2551 --- /dev/null +++ b/eric/GUI/palette/PaletteZoneCheckBox.java @@ -0,0 +1,63 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.palette; + +import eric.JZirkelCanvas; +import java.awt.AlphaComposite; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import javax.swing.JCheckBox; +import javax.swing.JLabel; +import javax.swing.SwingConstants; +import rene.gui.Global; +import rene.zirkel.ZirkelCanvas; + +/** + * + * @author erichake + */ +public class PaletteZoneCheckBox extends JCheckBox implements ItemListener{ + + public PaletteZoneCheckBox(String txt) { + super(txt); + setOpaque(false); + setFocusable(false); + setFont(new java.awt.Font(Global.GlobalFont, 1, 11)); + setForeground(new Color(100, 100, 100)); + setHorizontalAlignment(SwingConstants.CENTER); + putClientProperty("JComponent.sizeVariant", "mini"); + addItemListener(this); + } + + public void paintComponent(Graphics g) { + Dimension d=getSize(); + Graphics2D g2=(Graphics2D) g; + g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.05f)); + g2.setColor(new Color(0, 0, 255)); + g2.fillRect(3, 3, d.width-6, d.height-6); + g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.15f)); + g2.drawRect(3, 3, d.width-7, d.height-7); + g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f)); + super.paintComponent(g); + } + + public void itemStateChanged(ItemEvent e) { + ZirkelCanvas zc=JZirkelCanvas.getCurrentZC(); + if (zc!=null){ + zc.setEuclidian(isSelected()); + zc.repaint(); + } + + PaletteManager.initPaletteConsideringMode(); + PaletteManager.init(); + PaletteManager.selectGeomIcon(); + } + + +} diff --git a/eric/GUI/palette/PaletteZoneContent.java b/eric/GUI/palette/PaletteZoneContent.java new file mode 100644 index 0000000..8ad5499 --- /dev/null +++ b/eric/GUI/palette/PaletteZoneContent.java @@ -0,0 +1,76 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.palette; + +import eric.GUI.themes; +import eric.GUI.windowComponent; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Graphics; +import java.awt.Image; +import javax.swing.JComponent; + +/** + * + * @author erichake + */ +public class PaletteZoneContent extends windowComponent { + + private static Image back=themes.getImage("palbackground.gif"); + private boolean visible=true; + private int height=-1; + private PaletteZone parent; + + @Override + public void paintComponent(Graphics g) { + Dimension d=getSize(); + g.drawImage(back, 0, 0, d.width, d.height, this); + } + + // For Restricted Palette only : + public void setVisibleHeight() { + int nb=0; + // count visible icons : + for (int i=0; i0)) { + if (PaletteManager.isPaletteWithIconOnly(parent)) { + setVisibleHeight(); + } else { + JComponent ji=(JComponent) getComponent(getComponentCount()-1); + int start=getSize().height; + int bottom=ji.getBounds().y+ji.getBounds().height; + PaletteManager.fixsize(this, themes.getRightPanelWidth(), bottom); + } + } else { + PaletteManager.fixsize(this, themes.getRightPanelWidth(), 0); + } + } + + public void setHide(boolean b) { + visible=!b; + } + + public boolean isHidden(){ + return !visible; + } + + public PaletteZoneContent(PaletteZone zone) { + super(); + parent=zone; + setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0)); + setAlignmentX(0.0f); + } +} diff --git a/eric/GUI/palette/PaletteZoneLabel.java b/eric/GUI/palette/PaletteZoneLabel.java new file mode 100644 index 0000000..cf90e2b --- /dev/null +++ b/eric/GUI/palette/PaletteZoneLabel.java @@ -0,0 +1,41 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.palette; + +import java.awt.AlphaComposite; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Graphics2D; +import javax.swing.JLabel; +import javax.swing.SwingConstants; +import rene.gui.Global; + +/** + * + * @author erichake + */ +public class PaletteZoneLabel extends JLabel { + + public PaletteZoneLabel(String txt) { + super(txt); + setOpaque(false); + setFont(new java.awt.Font(Global.GlobalFont, 1, 11)); + setForeground(new Color(100, 100, 100)); + setHorizontalAlignment(SwingConstants.CENTER); + } + + public void paintComponent(Graphics g) { + Dimension d=getSize(); + Graphics2D g2=(Graphics2D) g; + g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.05f)); + g2.setColor(new Color(0, 0, 255)); + g2.fillRect(3, 3, d.width-6, d.height-6); + g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.15f)); + g2.drawRect(3, 3, d.width-7, d.height-7); + g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f)); + super.paintComponent(g); + } +} diff --git a/eric/GUI/palette/PaletteZoneTitle.java b/eric/GUI/palette/PaletteZoneTitle.java new file mode 100644 index 0000000..86166c9 --- /dev/null +++ b/eric/GUI/palette/PaletteZoneTitle.java @@ -0,0 +1,83 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.palette; + +import eric.GUI.themes; +import eric.GUI.windowComponent; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Image; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import javax.swing.BoxLayout; +import javax.swing.Icon; +import javax.swing.ImageIcon; +import javax.swing.JLabel; +import javax.swing.SwingConstants; +import rene.gui.Global; + +/** + * + * @author erichake + */ +public class PaletteZoneTitle extends windowComponent { + + private static Image offimage=themes.getImage("PaletteTitleBarN.png"); + private static Image onimage=themes.getImage("PaletteTitleBarH.png"); + private static Image rightTriangle=themes.getPaletteImage("PaletteTriangleDroite"); + private static Image bottomTriangle=themes.getPaletteImage("PaletteTriangleBas"); + private static boolean active=false; + private JLabel title=new JLabel(); + + @Override + public void paintComponent(Graphics g) { + Dimension d=getSize(); + + if (active) { + g.drawImage(onimage, 0, 0, d.width, d.height, this); + } else { + g.drawImage(offimage, 0, 0, d.width, d.height, this); + } + } + + public void init() { + PaletteManager.fixsize(this, themes.getRightPanelWidth(), themes.getPaletteZoneTitleHeight()); + } + + public PaletteZoneTitle(String name) { + super(); + setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); + setAlignmentX(0.0f); + title.setText(name); + title.setIcon(new ImageIcon(bottomTriangle)); + setHide(Global.getParameter("hidepalette." + name, true)); + title.setIconTextGap(7); + title.setFont(new java.awt.Font(Global.GlobalFont, 0, 11)); + title.setHorizontalAlignment(SwingConstants.LEFT); + PaletteManager.fixsize(title, themes.getRightPanelWidth()-themes.getPaletteZoneTitleHeight(), themes.getPaletteZoneTitleHeight()); + add(title); + } + + public void setHide(boolean b){ + if (b) title.setIcon(new ImageIcon(rightTriangle)); + else title.setIcon(new ImageIcon(bottomTriangle)); + repaint(); + } + + @Override + public void mousePressed(MouseEvent e) { + active=true; + repaint(); + } + + @Override + public void mouseReleased(MouseEvent e) { + active=false; + repaint(); + } + + +} diff --git a/eric/GUI/palette/PaletteZone_3D.java b/eric/GUI/palette/PaletteZone_3D.java new file mode 100644 index 0000000..ff7bb4a --- /dev/null +++ b/eric/GUI/palette/PaletteZone_3D.java @@ -0,0 +1,40 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.palette; + +import static eric.GUI.palette.PaletteManager.setSelected_with_clic; +import eric.JZirkelCanvas; +import rene.gui.Global; +import rene.zirkel.ZirkelCanvas; +import rene.zirkel.construction.Construction; + +/** + * + * @author erichake + */ +public class PaletteZone_3D extends PaletteZone { + + private String icns[]={"bi_3Dcoords", "inter3D", "boundedpoint", "bi_3Darete", "midpoint3D", "bi_3Dproj", "bi_3Dsymc", "bi_3Dsymp", "bi_3Dtrans", "vector3D", "line3D", "ray3D", "segment3D", "area3D", "bi_3Dsphererayon", "bi_3Dspherepoint", "bi_3Dcircle1", "bi_3Dcircle2", "bi_3Dcircle3pts", "angle3D", "bi_3Dplandroite", "bi_3Dplanplan", "bi_3Dspheredroite", "bi_3Dsphereplan", "bi_3Dspheresphere", "bi_3Dtetra", "bi_3Dcube", "bi_3Docta", "bi_3Disoc", "bi_3Ddode"}; + + public PaletteZone_3D() { + super(Global.Loc("palette.3D")); + createIcons(icns, PaletteManager.getGeomGroup()); + //setSelectBtn("bi_3Dcoords",true); + } + + public void initConsideringMode() { + ZirkelCanvas zc=JZirkelCanvas.getCurrentZC(); + if (zc==null) { + return; + } + PaletteManager.remove3DPalette(); + if (zc.getMode()==Construction.MODE_3D) { + PaletteManager.add3DPalette(); + PaletteManager.FixPaletteHeight2(this); // Dibs + setHideContent(false); + init(); + } + } +} diff --git a/eric/GUI/palette/PaletteZone_Aspect.java b/eric/GUI/palette/PaletteZone_Aspect.java new file mode 100644 index 0000000..7c03903 --- /dev/null +++ b/eric/GUI/palette/PaletteZone_Aspect.java @@ -0,0 +1,159 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.palette; + +import eric.GUI.themes; +import eric.JColorPicker; +import eric.JZirkelCanvas; +import java.awt.Color; +import java.util.Vector; +import javax.swing.BoxLayout; +import javax.swing.JButton; +import eric.JEricPanel; +import javax.swing.SwingConstants; +import rene.gui.Global; +import rene.zirkel.ZirkelCanvas; + +/** + * + * @author erichake + */ +public class PaletteZone_Aspect extends PaletteZone { + private static int content_height; + private static String[] types={"type0", "type1", "type2", "type3", "type4", "type5"}; + private static String[] colors= { "color0", "color1", "color2", "color3","color4", "color5" }; + private static String[] thickness = { "thickness0", "thickness1", "thickness2" }; + private static int label_lineheight=20; + private static PaletteZoneLabel pointshape_label,aspect_label; + private static JEricPanel point_name_panel; + private static JColorPicker color_picker; + + + public PaletteZone_Aspect() { + super(Global.Loc("palette.aspect")); + pointshape_label=addLabel(Global.Loc("palette.aspect.label.pointshape")); + point_name_panel=new JEricPanel(); + point_name_panel.setLayout(new BoxLayout(point_name_panel, BoxLayout.X_AXIS)); + point_name_panel.setOpaque(false); + add7iconsString(types,PaletteManager.POINT_GROUP); + addComponent(point_name_panel); + aspect_label=addLabel(""); + Vector V=add7iconsString(colors, PaletteManager.ASPECT1_GROUP); + color_picker=new JColorPicker(V.get(0).getIconWidth(), 6, 3,V){ + @Override + public void doChange() { + JIcon.setObjectColor(getCurrentColor()); + } + + @Override + public void afterSelect() { + JIcon.setObjectColor(getCurrentColor()); +// JPM.MW.ZF.setinfo("prop_scolor", false); + } + + @Override + public void setPalettes() { + ZirkelCanvas zc=JZirkelCanvas.getCurrentZC(); + if (zc!=null){ + setUsedColors(zc.getConstruction().getSpecialColors()); + } + } + }; + addComponent(color_picker); + createIcons(thickness,PaletteManager.ASPECT2_GROUP); + createToggleIcon("partial"); + createToggleIcon("plines"); + createToggleIcon("showvalue"); + createToggleIcon("showname"); + createToggleIcon("bold"); + createToggleIcon("large"); + createToggleIcon("filled"); + createToggleIcon("obtuse"); + createToggleIcon("solid"); + +// setContentHeight(200); + } + + public static JColorPicker getColorPicker(){ + return color_picker; + } + + + + public void init() { + PaletteManager.fixsize(pointshape_label, themes.getRightPanelWidth(), label_lineheight); + PaletteManager.fixsize(aspect_label, themes.getRightPanelWidth(), label_lineheight); + initPointNameBtn(); + super.init(); + } + + public void initPointNameBtn() { + point_name_panel.removeAll(); + JZirkelCanvas JZF=JZirkelCanvas.getCurrentJZF(); + if (JZF!=null) { + point_name_panel.add(JZF.getPointLabel().getPaletteButton()); + JButton jb=JZF.getPointLabel().getPaletteButton(); + int w=(themes.getPaletteIconPerRow()*themes.getPaletteIconWidth())/7; + PaletteManager.fixsize(jb, w, w); + point_name_panel.add(jb); + point_name_panel.validate(); + point_name_panel.repaint(); + } + } + + public void setLabel(String s){ + aspect_label.setText(s); + repaint(); + } + + private PaletteZoneLabel addLabel(final String mytxt) { + PaletteZoneLabel mylabel=new PaletteZoneLabel(mytxt); + addComponent(mylabel); + return mylabel; + } + + private Vector add7iconsString(String icns[],String group) { + Vector V=new Vector(); + for (final String element : icns) { + JIcon ji=new JIcon(element,group , 7); + addIcon(ji); + V.add(ji); + } + return V; + } + + public void addColorIcons(final String myname[], String group) { + add7iconsString(myname, group); + addComponent(JColorPicker.margin(5)); + +// JColorPicker jcp=new JColorPicker(themes.getPaletteIconWidth()-5, 6, 3) { +// +// /** +// * +// */ +// +// +// @Override +// public void doChange() { +// JPM.setObjectColor(getCurrentColor()); +// } +// +// @Override +// public void afterSelect() { +// JPM.setObjectColor(getCurrentColor()); +// JPM.MW.ZF.setinfo("prop_scolor", false); +// } +// +// @Override +// public void setPalettes() { +// setUsedColors(JPM.MW.ZF.ZC.getConstruction().getSpecialColors()); +// } +// }; +// myLine.add(JPM.MW.ColorPicker); +// addNewLine(); + } + + +} diff --git a/eric/GUI/palette/PaletteZone_Geom.java b/eric/GUI/palette/PaletteZone_Geom.java new file mode 100644 index 0000000..ac76f68 --- /dev/null +++ b/eric/GUI/palette/PaletteZone_Geom.java @@ -0,0 +1,72 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.palette; + +import eric.GUI.themes; +import eric.JZirkelCanvas; +import eric.restrict.RestrictItems; +import rene.gui.Global; +import rene.zirkel.ZirkelCanvas; +import rene.zirkel.construction.Construction; + +/** + * + * @author erichake + */ +public class PaletteZone_Geom extends PaletteZone { + + private String icns[]={"point", "intersection", "midpoint", "bi_syma", + "bi_symc", "bi_trans", "line", "ray", "parallel", "plumb", + "bi_med", "bi_biss", "segment", "fixedsegment", "vector", + "area", "angle", "fixedangle", "circle", "fixedcircle", + "circle3", "bi_circ", "bi_arc", "quadric", "text", "expression", "image3"}; + private String DPDisabledIcons=" parallel fixedsegment fixedcircle vector area bi_arc quadric bi_trans "; + private String DPNewIcons=" bi_distance bi_perp_common bi_lineIP bi_horocycle bi_equidistante blank bi_pinceau1 bi_pinceau3 bi_pinceauinter bi_pinceauhauteur bi_pinceaucycle bi_pinceaubiss "; + private PaletteZoneCheckBox euclidianBox=new PaletteZoneCheckBox(Global.Loc("palette.construction.euclidian")); + private static int box_lineheight=25; + + public PaletteZone_Geom() { + super(Global.Loc("palette.construction")); + createIcons(icns, PaletteManager.getGeomGroup()); + RestrictItems.init_geom_icns(icns); + } + + @Override + public void init() { + PaletteManager.fixsize(euclidianBox, themes.getRightPanelWidth(), 0); + super.init(); + ZirkelCanvas zc=JZirkelCanvas.getCurrentZC(); + if ((!zone_content.isHidden())&&(zc!=null)&&(zc.isDP())) { + PaletteManager.fixsize(euclidianBox, themes.getRightPanelWidth(), box_lineheight); + int w=zone_content.getWidth(); + int h=zone_content.getHeight()+box_lineheight; + PaletteManager.fixsize(zone_content, w, h); + } + } + + public void initConsideringMode() { + ZirkelCanvas zc=JZirkelCanvas.getCurrentZC(); + if (zc==null) { + return; + } + removeBlankIcons(); + PaletteManager.setDisabledIcons(DPDisabledIcons, false); + removeIcons(DPNewIcons); + zone_content.remove(euclidianBox); + + if (zc.isDP()) { + zone_content.add(euclidianBox, 0); + if (!zc.isEuclidian()) { + PaletteManager.setDisabledIcons(DPDisabledIcons, true); + removeIcons(" text expression image3 "); + insertIcons(DPNewIcons, PaletteManager.getGeomGroup()); + insertIcons(" text expression image3 ", PaletteManager.getGeomGroup()); + PaletteManager.setDisabledIcons(" filled ", true); + } + + } + + } +} diff --git a/eric/GUI/pipe_tools.java b/eric/GUI/pipe_tools.java new file mode 100644 index 0000000..adec553 --- /dev/null +++ b/eric/GUI/pipe_tools.java @@ -0,0 +1,366 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI; + +import eric.FileTools; +import eric.GUI.palette.PaletteManager; +import eric.GUI.window.*; +import eric.JEricPanel; +import eric.JGeneralMenuBar; +import eric.JZirkelCanvas; +import eric.bar.JPropertiesBar; +import eric.macros.CreateMacroDialog; +import eric.macros.CreateMacroPanel; +import eric.monkey.monkey; +import java.awt.Dimension; +import java.awt.Frame; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.event.ActionEvent; +import java.awt.event.InputEvent; +import java.awt.event.KeyEvent; +import javax.swing.AbstractAction; +import javax.swing.JComponent; +import javax.swing.KeyStroke; +import javax.swing.SwingUtilities; +import netscape.javascript.JSObject; +import rene.gui.Global; +import rene.zirkel.ZirkelCanvas; +import rene.zirkel.ZirkelFrame; +import rene.zirkel.macro.Macro; + +/** + * This is a static class provide to be a bridge between the GUI + * packages and the others. Other "engine" packages should always refer to this + * one whenever they need to interact with the GUI. The GUI also must go through + * this class to interact with the engine. + * @author erichake + */ +public class pipe_tools { + + private static MainContainer owner; + + /** + * Called by MainWindow or MainApplet at the begining of + * initialization process (constructor or init) + * @param mc : the main container -> JFrame or JApplet + */ + public static void init(MainContainer mc) { + owner=mc; + themes.setTheme(Global.getParameter("LookAndFeel", themes.GRAY)); + } + + public static boolean isApplet() { + return owner.isApplet(); + } + + public static MainContainer getWindow() { + return owner; + } + + public static Frame getFrame() { + MainContainer mc=owner; + if (mc instanceof MainWindow) { + return (Frame) mc; + } else { + return new Frame(); + } + } + + public static ContentPane getContent() { + return owner.getContent(); + } + + public static void setWindowComponents() { + owner.setComponents(); + } + + public static Point getWindowLocation() { + return owner.getLocation(); + } + + public static void setWindowLocation() { + setWindowLocation(owner.getLocation().x, owner.getLocation().y); + } + + public static void setWindowLocation(int x, int y) { + if (yGlobal.getScreenW()) { + w=Global.getScreenW(); + } + if (h>Global.getScreenH()) { + h=Global.getScreenH(); + } + int x=(Global.getScreenW()-w)/2; + int y=(Global.getScreenH()-h)/2; + setWindowLocation(x, y); + owner.setSize(w, h); + } + } + + public static void setWindowBounds() { + setWindowBounds(getFrame().getBounds()); + } + + // r est le bounds désiré de la fenêtre : + public static void setWindowBounds(Rectangle r) { + if (getWindow() instanceof MainWindow) { + + if (r.yGlobal.getScreenY()+Global.getScreenH()) { + r.height=Global.getScreenY()+Global.getScreenH()-r.y; + } + getFrame().setBounds(r); + + // I know, this is weird, but it work's (for palette display) : + owner.setComponents(); + owner.setComponents(); + } + } + static private KeyStroke enter_key=KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0); + + public static void setStandardKeyInputs() { + KeyStroke key=KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, InputEvent.SHIFT_DOWN_MASK); + owner.getRootPane().getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(key, "objectTracker"); + owner.getRootPane().getActionMap().put("objectTracker", new AbstractAction() { + + @Override + public void actionPerformed(final ActionEvent arg0) { + ZirkelFrame zf=JZirkelCanvas.getCurrentZF(); + zf.track(); + } + }); + + key=KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0); + owner.getRootPane().getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(key, "escape"); + owner.getRootPane().getActionMap().put("escape", new AbstractAction() { + + @Override + public void actionPerformed(final ActionEvent arg0) { + PaletteManager.setSelected_with_clic("move", true); + CreateMacroDialog.quit(); + } + }); + + + } + + public static void setMacroPanelKeyInputs() { + owner.getRootPane().getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(enter_key, "macro_enter"); + owner.getRootPane().getActionMap().put("macro_enter", new AbstractAction() { + + @Override + public void actionPerformed(final ActionEvent arg0) { + CreateMacroPanel.nextStep(); + } + }); + } + + public static void removeMacroPanelKeyInputs() { + owner.getRootPane().getActionMap().remove(enter_key); + } + + public static void toFront() { + if (!isApplet()) { + MainWindow mw=(MainWindow) owner; + mw.toFront(); + } + } + + public static void showRestrictedEnvironmentManager() { + ZirkelCanvas zc=JZirkelCanvas.getCurrentZC(); + if (zc!=null) { + zc.getNewRestrictedDialog(); + } + } + + public static void showExerciseManager() { + ZirkelCanvas zc=JZirkelCanvas.getCurrentZC(); + if (zc!=null) { + zc.job_showDialog(); + } + } + + public static void AppletLoadedMessage_To_HTML() { + if (isApplet()) { + MainApplet ma=(MainApplet) owner; + JSObject window=JSObject.getWindow(ma); + String[] args={}; + window.call("carmetal_applet_loaded", args); + } + } + + public static boolean Exercise_To_HTML(boolean success, String message) { + Object jsmethod=null; + if (isApplet()) { + try { + MainApplet ma=(MainApplet) owner; + JSObject window=JSObject.getWindow(ma); + String[] args={""+success, message}; + jsmethod=window.call("carmetal_job", args); + } catch (Exception e) { + return false; + } + } + return (jsmethod!=null); + } + + public static void Magnet_To_HTML(String Pt, String Obj) { + if (isApplet()) { + MainApplet ma=(MainApplet) owner; + JSObject window=JSObject.getWindow(ma); + String[] args={Pt, Obj}; + window.call("carmetal_magnet", args); + } + } + + public static JEricPanel getCanvasPanel() { + return ContentPane.getCanvasPanel(); + } + + public static void duplicateTab() { + try { + String s=FileTools.getCurrentFileSource(); + tab_main_panel.addBtnAndSelect(tab_main_panel.getActiveBtn().getTabName()+" copy"); + FileTools.setCurrentFileSource(s); + } catch (Exception ex) { + } + + } + + public static void TabHaveChanged(boolean b) { + if (JZirkelCanvas.isWorkBook()) { + tab_main_panel.allTabsHaveChanged(b); + } else { + tab_main_panel.currentTabHaveChanged(b); + } + } + + public static void actualiseMacroPanel() { + LeftPanel_content.setContent(JZirkelCanvas.getNewMacroPanel()); + JZirkelCanvas.ActualiseMacroPanel(); + } + + public static void actualiseLeftPanels() { + JZirkelCanvas.removeLeftPanelContent(); + if (LeftPanel.isHistoryPanelVisible()) { + LeftPanel_content.setContent(JZirkelCanvas.getNewCDPPanel()); + } else if (LeftPanel.isHelpPanelVisible()) { + LeftPanel_content.setContent(JZirkelCanvas.getNewInfoPanel()); + } else if (LeftPanel.isMacroPanelVisible()) { + actualiseMacroPanel(); + } else if(LeftPanel.isScriptsPanelVisible()){ + LeftPanel_content.setContent(JZirkelCanvas.getNewScriptsLeftPanel()); + } + + } + + public static void setTitle(String s) { + getContent().setTitle(s); + } + + public static JEricPanel getMenuBar() { + return new JGeneralMenuBar(); + } + + public static boolean isTabEditAccepted() { + return (JZirkelCanvas.isWorkBook()); + } + + public static void quitAll() { + JZirkelCanvas.quitAll(); + } + + public static void closeCurrent() { + JZirkelCanvas.closeCurrent(); + } + + public static void onTabActivate() { + JZirkelCanvas JZF=JZirkelCanvas.getCurrentJZF(); + if (JZF!=null) { + JZF.onTabActivate(); + SwingUtilities.invokeLater(new Runnable() { + + @Override + public void run() { + PaletteManager.selectGeomIcon(); + PaletteManager.initPaletteConsideringMode(); + PaletteManager.init(); + actualiseLeftPanels(); + } + }); + if(JGeneralMenuBar.get_scp() != null){ + JZF.getZC().add(JGeneralMenuBar.get_scp()); + JGeneralMenuBar.get_scp().refresh(); + JZF.getZC().repaint(); + } + } + } + + public static String processTabName(String name) { + if (name.endsWith(".zir")) { + name=name.substring(0, name.length()-4); + } else if (name.endsWith(".zirz")) { + name=name.substring(0, name.length()-5); + } + name=tab_main_panel.uniqueName(name); + return name; + } + + public static void setMacroHelp(Macro m) { + } + + public static void setComments(String s) { + ZirkelCanvas zc=JZirkelCanvas.getCurrentZC(); + if (zc!=null) { + zc.setJobComment(s); + } + } + + public static boolean isComments() { + ZirkelCanvas zc=JZirkelCanvas.getCurrentZC(); + if (zc==null) { + return false; + } + return (!"".equals(zc.getJobComment())); + } + + public static void saveFigure() { + FileTools.saveFileAs(); + } + private static monkey monkey=null; + + public static void monkeyStart() { + ZirkelCanvas zc=JZirkelCanvas.getCurrentZC(); + if (zc!=null) { + monkey=new monkey(zc); + monkey.start(); + } + } + + public static void monkeyStop() { + if (monkey!=null) { + monkey.stop(); + monkey=null; + } + } +} diff --git a/eric/GUI/themes.java b/eric/GUI/themes.java new file mode 100644 index 0000000..330e92b --- /dev/null +++ b/eric/GUI/themes.java @@ -0,0 +1,358 @@ +/* + +Copyright 2006 Eric Hakenholz + +This file is part of C.a.R. software. + +C.a.R. is a free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 3 of the License. + +C.a.R. is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + + */ +package eric.GUI; + +import eric.GUI.window.*; +import eric.OS; +import java.awt.AlphaComposite; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Image; +import javax.swing.ImageIcon; +import rene.gui.Global; + +/** + * + * @author erichake + */ +public class themes { + + public static String GRAY="gray"; + public static String BRUSHED="brushed"; + public static String CURRENT=BRUSHED; + public static Color TabChangedColor=new Color(28,106,161); + public static Font TabFont=new Font("Dialog", Font.PLAIN, 11); + public static Font TabMenusFont=new Font("Dialog", Font.PLAIN, 12); + public static Font TabSelectedMenusFont=new Font("Dialog", Font.BOLD+Font.ITALIC, 12); + private static String PalettePath="/eric/GUI/icons/palette/"; + private static String BarPath="/eric/GUI/icons/bar/"; + private static String ThemesPath="/eric/GUI/icons/themes/"; + private static String CurrentTheme="/eric/GUI/icons/themes/gray/"; + private static String CommonTheme="/eric/GUI/icons/themes/common/"; + private static boolean MAClook=true; + private static int palette_iconwidth=28; + private static int palette_icon_per_row=6; + private static int TitleBarHeight=35; + private static int TitleBarTextHeight=25; + private static int BoxesMarginW=5; + private static int BoxesMarginH=4; + private static int MenuBarHeight=20; + private static int VertBorderWidth=7; + private static int VertPanelBorderWidth=5; + private static int VertSeparatorWidth=5; + private static int ResizeBoxWidth=19; + private static int ResizeBoxHeight=22; + private static int MainTabPanelHeight=32; + private static int TabBtnHeight=22; + private static int ControlTabPanelWidth=150; + private static Dimension CloseBoxDim, GrowBoxDim, ReduceBoxDim,OpenLeftPanelBtnDim,OpenMiddlePanelBtnDim; + private static int OpenPanelsBtnsMarginW=5; + private static int OpenPanelsBtnsMarginH=29; + private static int comments_height, tab_leftborder, tab_rightborder, StatusBarHeight; + private static int tab_corner_width=8; + private static boolean showtabs=true; + private static boolean showstatus=true; + private static float opacity=0.5f; + private static int tooliconsize=32; + + private static int palette_ZoneTitleHeight=17; + + + + public themes() { + } + + public static void init() { + ReduceBoxDim=new Dimension(getIcon("zreducebutton.png").getIconWidth(), getIcon("zreducebutton.png").getIconHeight()); + GrowBoxDim=new Dimension(getIcon("zgrowbutton.png").getIconWidth(), getIcon("zgrowbutton.png").getIconHeight()); + CloseBoxDim=new Dimension(getIcon("zclosebutton.png").getIconWidth(), getIcon("zclosebutton.png").getIconHeight()); + OpenLeftPanelBtnDim=new Dimension(getIcon("rightpanel_on.png").getIconWidth(), getIcon("rightpanel_on.png").getIconHeight()); + OpenMiddlePanelBtnDim=new Dimension(getIcon("middlepanel_on.png").getIconWidth(), getIcon("middlepanel_on.png").getIconHeight()); + +// tab_topborder=getIcon("tab_top.gif").getIconHeight(); +// tab_leftborder=getIcon("tab_left.gif").getIconWidth(); +// tab_rightborder=getIcon("tab_right.gif").getIconWidth(); +// tab_bottomborder=getIcon("tab_bottom.gif").getIconHeight(); + comments_height=80; + tab_leftborder=0; + tab_rightborder=0; + StatusBarHeight=25; + setComponentsSize(); + } + + public static void setComponentsSize() { + CurrentTheme=ThemesPath+CURRENT+"/"; + if (isApplet()) { + VertBorderWidth=0; + VertSeparatorWidth=0; + TitleBarHeight=0; + TitleBarTextHeight=0; + MenuBarHeight=0; + ResizeBoxWidth=0; + ResizeBoxHeight=0; + MAClook=true; + return; + } + if (CURRENT.equals(GRAY)) { + VertBorderWidth=5; + VertPanelBorderWidth=5; + VertSeparatorWidth=3; + TitleBarHeight=35; + TitleBarTextHeight=25; + MenuBarHeight=20; + ResizeBoxWidth=19; + ResizeBoxHeight=22; + MAClook=true; + } else if (CURRENT.equals(BRUSHED)) { + VertBorderWidth=7; + VertSeparatorWidth=5; + TitleBarHeight=25; + TitleBarTextHeight=25; + MenuBarHeight=20; + ResizeBoxWidth=19; + ResizeBoxHeight=22; + MAClook=false; + } + } + + public static boolean isShowTabs(){ + return showtabs; + } + + public static void setShowTabs(boolean b){ + showtabs=b; + } + + public static boolean isShowStatus(){ + return showstatus; + } + + public static void setShowStatus(boolean b){ + showstatus=b; + } + + public static void setTheme(String theme) { + CURRENT=theme; + } + + public static String getTheme() { + return CURRENT; + } + + public static String getBarPath() { + return BarPath; + } + + public static String getPalettePath() { + return PalettePath; + } + + public static String getCurrentThemePath() { + return CurrentTheme; + } + + public static String getCommonThemePath() { + return CommonTheme; + } + + public static int getTabCornerWidth(){ + return tab_corner_width; + } + + public static int getToolIconSize(){ + return tooliconsize; + } + + public static int getTitleBarHeight() { + return TitleBarHeight; + } + + public static int getMenuBarHeight() { + return MenuBarHeight; + } + + + + public static int getResizeBoxHeight() { + return ResizeBoxHeight; + } + + public static int getResizeBoxWidth() { + return ResizeBoxWidth; + } + + public static int getVerticalBorderWidth() { + return showtabs?VertBorderWidth:0; + } + + public static int getVerticalPanelBorderWidth() { + if (LeftPanel.isPanelVisible()){ + return VertPanelBorderWidth; + }; + return 0; + } + + public static int getBoxesMarginWidth() { + return BoxesMarginW; + } + + public static int getBoxesMarginHeight() { + return BoxesMarginH; + } + + public static Dimension getGrowBoxDim() { + return GrowBoxDim; + } + + public static Dimension getCloseBoxDim() { + return CloseBoxDim; + } + + public static Dimension getOpenLeftPanelBtnDim() { + return OpenLeftPanelBtnDim ; + } + public static Dimension getOpenMiddlePanelBtnDim() { + return OpenMiddlePanelBtnDim ; + } + public static int getOpenPanelsBtnsMarginW(){ + return OpenPanelsBtnsMarginW; + } + public static int getOpenPanelsBtnsMarginH(){ + return OpenPanelsBtnsMarginH; + } + + public static Dimension getReduceBoxDim() { + return ReduceBoxDim; + } + + public static int getCommentsHeight() { + return Global.getParameter("comment", false)?comments_height:0; + } + + public static int getTabLeftBorderWidth() { + return tab_leftborder; + } + + public static int getTabRightBorderWidth() { + return tab_rightborder; + } + + public static int getStatusBarHeight() { + return showstatus?StatusBarHeight:0; + } + public static void setStatusBarHeight(int h) { + StatusBarHeight=h; + } + public static int getTabBtnHeight(){ + return TabBtnHeight; + } + + public static int getTabControlPanelWidth() { + return ControlTabPanelWidth; + } + + public static int getLeftPanelWidth() { + return LeftPanel.getPanelWidth(); + } + + + public static int getRightPanelWidth(){ + int w=(RightPanel.isPanelVisible())?(palette_icon_per_row*palette_iconwidth):0; + return w; + } + + public static int getTotalRightPanelWidth() { + int w=(RightPanel.isPanelVisible())?(getRightPanelWidth()+RightPanel.getSeparatorWidth()):0; + return w; + } + + public static int getPaletteZoneTitleHeight(){ + return palette_ZoneTitleHeight; + } + + public static int getPaletteIconPerRow(){ + return palette_icon_per_row; + } + + public static void setPaletteIconWidth(int i){ + palette_iconwidth=i; + } + + public static int getPaletteIconWidth(){ + return palette_iconwidth; + } + + public static int getMainTabPanelHeight() { + return showtabs?MainTabPanelHeight:0; + } + + public static void setDisable(final Graphics g, final Dimension d) { + final Graphics2D g2=(Graphics2D) g; + final AlphaComposite ac=AlphaComposite.getInstance( + AlphaComposite.SRC_OVER, opacity); + g2.setComposite(ac); + g2.setColor(new Color(255, 255, 255)); + g2.fillRect(0, 0, d.width, d.height); + } + + public static boolean AllowMacLook() { + return MAClook; + } + + public static boolean MacLF() { + if (isApplet()) { + return false; + } + return ((OS.isMac())&&themes.AllowMacLook()); + } + + public static boolean isApplet() { + return (pipe_tools.isApplet()); + } + + public static ImageIcon getIcon(final String s) { + ImageIcon myicon; + try { + myicon=new ImageIcon(themes.class.getResource(CurrentTheme+s)); + } catch (final Exception e) { + try { + myicon=new ImageIcon(themes.class.getResource(CommonTheme+s)); + } catch (final Exception ex) { + myicon=new ImageIcon(themes.class.getResource(CommonTheme+"null.gif")); + } + } + return myicon; + } + + public static Image getImage(final String s) { + return pipe_tools.getWindow().getImage(s); + } + public static Image getPaletteImage(final String s) { + return pipe_tools.getWindow().getPaletteImage(s); + } + + public static ImageIcon resizeExistingIcon(String path_name, int w, int h){ + ImageIcon iicon = new ImageIcon(themes.class.getResource(path_name)); + return new ImageIcon(iicon.getImage().getScaledInstance(w, h, Image.SCALE_SMOOTH)); + } +} diff --git a/eric/GUI/window/CanvasPanel.java b/eric/GUI/window/CanvasPanel.java new file mode 100644 index 0000000..ee0c0ac --- /dev/null +++ b/eric/GUI/window/CanvasPanel.java @@ -0,0 +1,37 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.window; + +import eric.GUI.pipe_tools; +import eric.GUI.windowComponent; +import eric.GUI.themes; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Graphics; +import javax.swing.BoxLayout; +import eric.JEricPanel; + +/** + * + * @author erichake + */ +public class CanvasPanel extends windowComponent { + + public void init() { + setBounds(themes.getVerticalBorderWidth()+themes.getLeftPanelWidth()+themes.getVerticalPanelBorderWidth()+themes.getTabLeftBorderWidth(), + themes.getTitleBarHeight()+themes.getMenuBarHeight()+themes.getCommentsHeight(), + pipe_tools.getWindowSize().width-themes.getLeftPanelWidth()-themes.getVerticalPanelBorderWidth()-themes.getTotalRightPanelWidth()-2*themes.getVerticalBorderWidth()-themes.getTabLeftBorderWidth()-themes.getTabRightBorderWidth(), + pipe_tools.getWindowSize().height-themes.getTitleBarHeight()-themes.getMenuBarHeight()-themes.getMainTabPanelHeight()-themes.getCommentsHeight()-themes.getStatusBarHeight()); + } + + public CanvasPanel() { + super(); + setLayout(new BorderLayout()); +// setOpaque(true); + } + +} diff --git a/eric/GUI/window/CloseBox.java b/eric/GUI/window/CloseBox.java new file mode 100644 index 0000000..ea47323 --- /dev/null +++ b/eric/GUI/window/CloseBox.java @@ -0,0 +1,61 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.window; + +import eric.GUI.pipe_tools; +import eric.GUI.windowComponent; +import eric.GUI.themes; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Image; +import java.awt.event.MouseEvent; + +/** + * + * @author erichake + */ +public class CloseBox extends windowComponent { + + private String btn="zclosebutton.png"; + private String overbtn="zclosebuttonover.png"; + private Image icon=themes.getImage(btn); + + public void paintComponent(Graphics g) { + Dimension d=this.getSize(); + g.drawImage(icon, 0, 0, d.width, d.height, + this); + } + + public CloseBox() { + } + + public void init() { +// win=StaticTools.getMainWindow(this); + int marginL; + if (themes.MacLF()) { + marginL=themes.getBoxesMarginWidth(); + } else { + marginL=pipe_tools.getWindowSize().width-themes.getBoxesMarginWidth()-themes.getCloseBoxDim().width-themes.getTotalRightPanelWidth(); + } + this.setBounds(marginL, + themes.getBoxesMarginHeight(), + themes.getCloseBoxDim().width, + themes.getCloseBoxDim().height); + } + + public void mousePressed(MouseEvent e) { + pipe_tools.quitAll(); + } + + public void mouseEntered(MouseEvent arg0) { + icon=themes.getImage(overbtn); + repaint(); + } + + public void mouseExited(MouseEvent arg0) { + icon=themes.getImage(btn); + repaint(); + } +} diff --git a/eric/GUI/window/ContentPane.java b/eric/GUI/window/ContentPane.java new file mode 100644 index 0000000..f814689 --- /dev/null +++ b/eric/GUI/window/ContentPane.java @@ -0,0 +1,181 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.window; + +import eric.GUI.palette.PaletteManager; +import eric.GUI.pipe_tools; +import eric.GUI.themes; +import eric.JLogoWindow; +import java.awt.Color; +import java.awt.Graphics; +import javax.swing.JLabel; +import eric.JEricPanel; +import javax.swing.SwingUtilities; +import javax.swing.ToolTipManager; +import javax.swing.UIManager; +import javax.swing.plaf.ColorUIResource; + +/** + * + * @author erichake + */ +public class ContentPane extends JEricPanel { + private static CanvasPanel CANVASPANEL; + private LeftPanel LEFTPANEL; + private LeftPanel_content LEFTPANELCONTENT; + private RightPanel RIGHTPANEL; + private ResizeBox RESIZE; + private TitleBar TITLE; + private MenuBar MENU; + private VerticalLeftBorder VERTICALLEFTBORDER; + private VerticalLeftPanelBorder VERTICALLEFTPANELBORDER; + private VerticalRightBorder VERTICALRIGHTBORDER; + private CloseBox CLOSEBOX; + private ReduceBox REDUCEBOX; + private GrowBox GROWBOX; + private comments TABTOPBORDER; + private tab_left TABLEFTBORDER; + private tab_right TABRIGHTBORDER; + private tab_bottom TABBOTTOMBORDER; + private tab_main_panel TABMAINPANEL; + private tab_control_panel TABCONTROLPANEL; + private Open_left_panel_btn OPENLEFTPANEL; + private Open_right_panel_btn OPENRIGHTPANEL; + private Open_middle_panel_btn OPENMIDDLEPANEL; + private Monkey_panel_btn MONKEYBTN; + + + + + public void paintComponent(Graphics g) { + final java.awt.Dimension d=this.getSize(); + g.setColor(Color.lightGray); + g.fillRect(0, 0, d.width, d.height); + } + + public ContentPane() { + setLayout(null); + VERTICALLEFTPANELBORDER=new VerticalLeftPanelBorder(); + CANVASPANEL=new CanvasPanel(); + LEFTPANEL=new LeftPanel(); + LEFTPANELCONTENT=new LeftPanel_content(); + RIGHTPANEL=new RightPanel(); + TABTOPBORDER=new comments(); + TABLEFTBORDER=new tab_left(); + TABRIGHTBORDER=new tab_right(); + TABBOTTOMBORDER=new tab_bottom(); + TABMAINPANEL=new tab_main_panel(); + TABCONTROLPANEL=new tab_control_panel(); + + // resizebox needs to be in front of every component : + if (!themes.isApplet()) { + RESIZE=new ResizeBox(); + add(RESIZE); + } + + add(CANVASPANEL); + + if (!themes.isApplet()) { + GROWBOX=new GrowBox(); + REDUCEBOX=new ReduceBox(); + CLOSEBOX=new CloseBox(); + TITLE=new TitleBar(); + MENU=new MenuBar(); + VERTICALLEFTBORDER=new VerticalLeftBorder(); + VERTICALRIGHTBORDER=new VerticalRightBorder(); + OPENLEFTPANEL=new Open_left_panel_btn(); + OPENRIGHTPANEL=new Open_right_panel_btn(); + OPENMIDDLEPANEL=new Open_middle_panel_btn(); + MONKEYBTN=new Monkey_panel_btn(); + add(OPENLEFTPANEL); + add(OPENRIGHTPANEL); + add(OPENMIDDLEPANEL); + add(MONKEYBTN); + add(GROWBOX); + add(REDUCEBOX); + add(CLOSEBOX); + add(TITLE); + add(MENU); + add(VERTICALLEFTBORDER); + add(VERTICALRIGHTBORDER); + } + add(VERTICALLEFTPANELBORDER); + add(TABCONTROLPANEL); + add(TABMAINPANEL); + add(TABLEFTBORDER); + add(TABRIGHTBORDER); + add(TABTOPBORDER); + add(TABBOTTOMBORDER); + add(LEFTPANEL); + add(LEFTPANELCONTENT); + add(RIGHTPANEL); + + ToolTipManager.sharedInstance().setInitialDelay(100); + ToolTipManager.sharedInstance().setDismissDelay(10000); + UIManager.put("ToolTip.background", new ColorUIResource(213, 227, 253)); + pipe_tools.setStandardKeyInputs(); + } + + public void rebuiltRightPanel(){ + final String gicon=PaletteManager.geomSelectedIcon(); + int i=getComponentZOrder(RIGHTPANEL); + remove(RIGHTPANEL); + RIGHTPANEL=null; + RIGHTPANEL=new RightPanel(); + add(RIGHTPANEL, i); + // I know, this is weird, but it work's : + setComponents(); + setComponents(); + PaletteManager.setSelected_with_clic(gicon,true); + PaletteManager.initPaletteConsideringMode(); + } + + public void setTitle(String s){ + TITLE.setTitle(s); + } + + + public static void setCurrentPanel(tab_canvas_panel canvas){ + CANVASPANEL.removeAll(); + CANVASPANEL.add(canvas); + CANVASPANEL.revalidate(); + CANVASPANEL.repaint(); + } + + public static JEricPanel getCanvasPanel(){ + return CANVASPANEL; + } + + public void setComponents() { + RIGHTPANEL.init(); + CANVASPANEL.init(); + TABTOPBORDER.init(); + TABLEFTBORDER.init(); + TABRIGHTBORDER.init(); + TABBOTTOMBORDER.init(); + LEFTPANEL.init(); + LEFTPANELCONTENT.init(); + + TABMAINPANEL.init(); + TABCONTROLPANEL.init(); + VERTICALLEFTPANELBORDER.init(); + + if (!themes.isApplet()) { + REDUCEBOX.init(); + CLOSEBOX.init(); + GROWBOX.init(); + TITLE.init(); + MENU.init(); + VERTICALLEFTBORDER.init(); + VERTICALRIGHTBORDER.init(); + RESIZE.init(); + OPENLEFTPANEL.init(); + OPENRIGHTPANEL.init(); + OPENMIDDLEPANEL.init(); + MONKEYBTN.init(); + } + + } +} diff --git a/eric/GUI/window/GrowBox.java b/eric/GUI/window/GrowBox.java new file mode 100644 index 0000000..0fba30f --- /dev/null +++ b/eric/GUI/window/GrowBox.java @@ -0,0 +1,73 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.window; + +import eric.GUI.pipe_tools; +import eric.GUI.windowComponent; +import eric.GUI.themes; +import eric.JZirkelCanvas; +import eric.bar.JPropertiesBar; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Image; +import java.awt.Rectangle; +import java.awt.event.MouseEvent; +import javax.swing.JFrame; +import rene.gui.Global; + +/** + * + * @author erichake + */ +public class GrowBox extends windowComponent { + + private String btn="zgrowbutton.png"; + private String overbtn="zgrowbuttonover.png"; + private Image icon=themes.getImage(btn); + + public void paintComponent(Graphics g) { + Dimension d=this.getSize(); + g.drawImage(icon, 0, 0, d.width, d.height, + this); + } + + public GrowBox() { + } + + public void init() { +// win=StaticTools.getMainWindow(this); + int x; + if (themes.MacLF()) { + x=themes.getBoxesMarginWidth()+themes.getCloseBoxDim().width+themes.getReduceBoxDim().width; + } else { + x=pipe_tools.getWindowSize().width-themes.getBoxesMarginWidth()-themes.getCloseBoxDim().width-themes.getGrowBoxDim().width-themes.getTotalRightPanelWidth(); + } + this.setBounds(x, + themes.getBoxesMarginHeight(), + themes.getGrowBoxDim().width, + themes.getGrowBoxDim().height); + } + + @Override + public void mousePressed(MouseEvent e) { + pipe_tools.setWindowBounds(Global.getScreen()); + } + + @Override + public void mouseEntered(MouseEvent arg0) { + icon=themes.getImage(overbtn); + repaint(); + } + + @Override + public void mouseExited(MouseEvent arg0) { + icon=themes.getImage(btn); + repaint(); + } + + @Override + public void mouseReleased(MouseEvent e) { + } +} diff --git a/eric/GUI/window/ImageFilter.java b/eric/GUI/window/ImageFilter.java new file mode 100644 index 0000000..cd00eb2 --- /dev/null +++ b/eric/GUI/window/ImageFilter.java @@ -0,0 +1,66 @@ +/* + +Copyright 2006 Eric Hakenholz + +This file is part of C.a.R. software. + + C.a.R. is a free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 3 of the License. + + C.a.R. is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + */ + + + package eric.GUI.window; + +import eric.*; +import java.io.File; + +import javax.swing.filechooser.FileFilter; + +public class ImageFilter extends FileFilter { + + @Override + public boolean accept(final File f) { + if (f.isDirectory()) { + return true; + } + final String extension = this.getExtension(f); + if (extension != null) { + if (extension.equals("tiff") || extension.equals("tif") + || extension.equals("svg") || extension.equals("gif") + || extension.equals("jpeg") || extension.equals("jpg") + || extension.equals("eps") || extension.equals("png")) { + return true; + } else { + return false; + } + } + + return false; + } + + @Override + public String getDescription() { + return "Images"; + } + + public String getExtension(final File f) { + String ext = null; + final String s = f.getName(); + final int i = s.lastIndexOf('.'); + + if (i > 0 && i < s.length() - 1) { + ext = s.substring(i + 1).toLowerCase(); + } + return ext; + } +} diff --git a/eric/GUI/window/LeftPanel.java b/eric/GUI/window/LeftPanel.java new file mode 100644 index 0000000..e3ed6f4 --- /dev/null +++ b/eric/GUI/window/LeftPanel.java @@ -0,0 +1,195 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.window; + +import eric.GUI.pipe_tools; +import eric.GUI.windowComponent; +import eric.GUI.themes; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Image; +import rene.gui.Global; + +/** + * + * @author erichake + */ +public class LeftPanel extends windowComponent { + + private static LeftPanel me; + private static int factorySize=250; + private static int actualSize=0; //width of this panel + private static final int marginW=5, marginH=4, space=2; + private static int H=themes.getIcon("leftpanelbackground.gif").getIconHeight(); + private static Image on_btn=themes.getImage("leftpanel_on_btn.gif"); + private static Image off_btn=themes.getImage("leftpanel_off_btn.gif"); + private static Dimension btn_dim=new Dimension(themes.getIcon("leftpanel_on_btn.gif").getIconWidth(), themes.getIcon("leftpanel_on_btn.gif").getIconHeight()); + + private static LeftPanel_macros_btn macros_btn=new LeftPanel_macros_btn(); + private static LeftPanel_history_btn history_btn=new LeftPanel_history_btn(); + private static LeftPanel_help_btn help_btn=new LeftPanel_help_btn(); + private static LeftPanel_scripts_btn scripts_btn=new LeftPanel_scripts_btn(); + + private static LeftPanel_close_btn close_btn=new LeftPanel_close_btn(); + + public void paintComponent(Graphics g) { + Dimension d=getSize(); + g.setColor(Color.white); + g.fillRect(0, 0, d.width, d.height); + g.drawImage(themes.getImage("leftpanelbackground.gif"), 0, 0, d.width, H, this); +// super.paintComponent(g); + } + + public static Image getOnBtn() { + return on_btn; + } + + public static Image getOffBtn() { + return off_btn; + } + + public static Dimension getBtnDim() { + return btn_dim; + } + + public static void selectHelp(){ + select(help_btn); + } + + public static void select(LeftPanel_btn btn) { + macros_btn.select(macros_btn.equals(btn)); + history_btn.select(history_btn.equals(btn)); + help_btn.select(help_btn.equals(btn)); + scripts_btn.select(scripts_btn.equals(btn)); + me.repaint(); + pipe_tools.actualiseLeftPanels(); + } + + public static int x(LeftPanel_btn btn) { + int macr=marginW; + int hist=macr+((macros_btn.isVisible())?space+btn_dim.width:0); + int help=hist+((history_btn.isVisible())?space+btn_dim.width:0); + int scripts=help+((scripts_btn.isVisible())?space+btn_dim.width:0); + if (macros_btn.equals(btn)) { + return macr; + } else if (history_btn.equals(btn)) { + return hist; + } else if (help_btn.equals(btn)) { + return help; + } else if(scripts_btn.equals(btn)){ + return scripts; + } + return 0; + } + + public static int y() { + return marginH; + } + + public static void setPanelWidth(int size) { + actualSize=size; + } + + public static int getPanelWidth() { + return actualSize; + } + + public static int getPanelHeight() { + return H; + } + + public static boolean isPanelVisible() { + return (actualSize!=0); + } + + public static void setMacroBtnVisible(boolean b){ + macros_btn.setVisible(b); + LeftPanel_content.setPanelVisibility(); + me.init(); + } + public static void setHistoryBtnVisible(boolean b){ + history_btn.setVisible(b); + LeftPanel_content.setPanelVisibility(); + me.init(); + } + public static void setHelpBtnVisible(boolean b){ + help_btn.setVisible(b); + LeftPanel_content.setPanelVisibility(); + me.init(); + } + public static void setScriptsBtnVisible(boolean b){ + scripts_btn.setVisible(b); + LeftPanel_content.setPanelVisibility(); + me.init(); + } + public static boolean isMacroBtnVisible(){ + return macros_btn.isVisible(); + } + public static boolean isHistoryBtnVisible(){ + return history_btn.isVisible(); + } + public static boolean isHelpBtnVisible(){ + return help_btn.isVisible(); + } + public static boolean isScriptsBtnVisible(){ + return scripts_btn.isVisible(); + } + + public static boolean isHistoryPanelVisible() { + return ((isPanelVisible())&&(history_btn.isPanelSelected())); + } + public static boolean isHelpPanelVisible() { + return ((isPanelVisible())&&(help_btn.isPanelSelected())); + } + public static boolean isMacroPanelVisible() { + return ((isPanelVisible())&&(macros_btn.isPanelSelected())); + } + public static boolean isScriptsPanelVisible(){ + return ((isPanelVisible())&&(scripts_btn.isPanelSelected())); + } + + public static int getFactorySize(){ + return factorySize; + } + + public static void setFactorySize(int size){ + factorySize=size; + actualSize=size; + pipe_tools.setWindowComponents(); + + } + + public static void showPanel(boolean vis) { + int w=(vis)?Global.getParameter("leftpanelwidth", factorySize):0; + setPanelWidth(w); + pipe_tools.setWindowComponents(); + pipe_tools.actualiseLeftPanels(); + } + + public void init() { + setBounds(themes.getVerticalBorderWidth(), + themes.getTitleBarHeight()+themes.getMenuBarHeight()+themes.getCommentsHeight(), + actualSize, + H); + macros_btn.init(); + history_btn.init(); + help_btn.init(); + scripts_btn.init(); + close_btn.init(); + } + + public LeftPanel() { + super(); + me=this; + setOpaque(true); + setLayout(null); + add(macros_btn); + add(history_btn); + add(help_btn); + add(scripts_btn); + add(close_btn); + } +} \ No newline at end of file diff --git a/eric/GUI/window/LeftPanel_btn.java b/eric/GUI/window/LeftPanel_btn.java new file mode 100644 index 0000000..43edda1 --- /dev/null +++ b/eric/GUI/window/LeftPanel_btn.java @@ -0,0 +1,15 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package eric.GUI.window; + +/** + * + * @author erichake + */ +public interface LeftPanel_btn { +public void select(boolean b); +public boolean isPanelSelected(); +} diff --git a/eric/GUI/window/LeftPanel_close_btn.java b/eric/GUI/window/LeftPanel_close_btn.java new file mode 100644 index 0000000..754c8af --- /dev/null +++ b/eric/GUI/window/LeftPanel_close_btn.java @@ -0,0 +1,64 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.window; + +import eric.GUI.themes; +import eric.GUI.windowComponent; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.event.MouseEvent; + +/** + * + * @author erichake + */ +public class LeftPanel_close_btn extends windowComponent { + + private boolean over=false; + private static int W=themes.getIcon("tab_close.png").getIconWidth(); + private static int H=themes.getIcon("tab_close.png").getIconHeight(); + private static int marginW=5; + private static int marginH=8; + + @Override + public void paintComponent(Graphics g) { + Dimension d=getSize(); + if (over) { + g.drawImage(themes.getImage("tab_close_over.png"), 0, 0, d.width, d.height, + this); + } else { + g.drawImage(themes.getImage("tab_close.png"), 0, 0, d.width, d.height, + this); + } + } + + public void init() { + setBounds(LeftPanel.getPanelWidth()-W-marginW, marginH, W, H); + } + + public LeftPanel_close_btn() { + } + + @Override + public void mousePressed(MouseEvent e) { +// LeftPanel.showPanel(false); +// Open_left_panel_btn.setSelected(false); +// over=false; + Open_left_panel_btn.toggle(); + } + + public void mouseEntered(MouseEvent e) { + over=true; + repaint(); + } + + public void mouseExited(MouseEvent e) { + over=false; + repaint(); + } +} + + diff --git a/eric/GUI/window/LeftPanel_content.java b/eric/GUI/window/LeftPanel_content.java new file mode 100644 index 0000000..17d7b7e --- /dev/null +++ b/eric/GUI/window/LeftPanel_content.java @@ -0,0 +1,79 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.window; + +import eric.GUI.pipe_tools; +import eric.GUI.themes; +import eric.GUI.windowComponent; +import eric.JHelpPanel; +import eric.JSprogram.JScriptsLeftPanel; +import eric.macros.MacrosList; +import java.awt.Dimension; +import javax.swing.BoxLayout; +import javax.swing.JComponent; +import rene.zirkel.construction.ConstructionDisplayPanel; + +/** + * + * @author erichake + */ +public class LeftPanel_content extends windowComponent { + + private static LeftPanel_content me; + private static JComponent JP; + + public void init() { + setBounds(themes.getVerticalBorderWidth(), + themes.getTitleBarHeight()+themes.getMenuBarHeight()+LeftPanel.getPanelHeight()+themes.getCommentsHeight(), + themes.getLeftPanelWidth(), + pipe_tools.getWindowSize().height-themes.getTitleBarHeight()-themes.getMenuBarHeight()-themes.getMainTabPanelHeight()-LeftPanel.getPanelHeight()-themes.getCommentsHeight()); + if (JP instanceof JHelpPanel) { + JHelpPanel jh=(JHelpPanel) JP; + jh.fixPanelSize(getSize().width, getSize().height); + } else if (JP instanceof MacrosList) { + MacrosList ml=(MacrosList) JP; + ml.fixPanelSize(getSize().width, getSize().height); + } else if (JP instanceof ConstructionDisplayPanel) { + ConstructionDisplayPanel cdp=(ConstructionDisplayPanel) JP; + cdp.fixPanelSize(getSize().width, getSize().height); + } else if(JP instanceof JScriptsLeftPanel){ + JScriptsLeftPanel jsp = (JScriptsLeftPanel) JP; + jsp.fixPanelSize(getSize().width, getSize().height); + } + } + + public LeftPanel_content() { + me=this; + setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); + } + + public static void setPanelVisibility(){ + if (JP instanceof MacrosList) { + JP.setVisible(LeftPanel.isMacroBtnVisible()); + } else if (JP instanceof ConstructionDisplayPanel) { + JP.setVisible(LeftPanel.isHistoryBtnVisible()); + } else if (JP instanceof JHelpPanel) { + JP.setVisible(LeftPanel.isHelpBtnVisible()); + } else if (JP instanceof JScriptsLeftPanel) { + JP.setVisible(LeftPanel.isScriptsBtnVisible()); + } + } + + public static void setContent(JComponent jp) { + JP=jp; + me.removeAll(); + me.add(jp); + me.init(); + me.revalidate(); + setPanelVisibility(); + me.repaint(); + } + + public static Dimension getPanelSize() { + return me.getSize(); + } +} + + diff --git a/eric/GUI/window/LeftPanel_help_btn.java b/eric/GUI/window/LeftPanel_help_btn.java new file mode 100644 index 0000000..45fd289 --- /dev/null +++ b/eric/GUI/window/LeftPanel_help_btn.java @@ -0,0 +1,67 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.window; + +import eric.GUI.pipe_tools; +import eric.GUI.themes; +import eric.GUI.windowComponent; +import eric.JZirkelCanvas; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.event.MouseEvent; + +/** + * + * @author erichake + */ +public class LeftPanel_help_btn extends windowComponent implements LeftPanel_btn{ + + private boolean over=false; + private boolean selected=false; + private static int X=(themes.getIcon("leftpanel_on_btn.gif").getIconWidth()-themes.getIcon("left_help.png").getIconWidth())/2; + private static int Y=3; + + @Override + public void paintComponent(Graphics g) { + Dimension d=getSize(); + if (selected) { + g.drawImage(LeftPanel.getOnBtn(), 0, 0, d.width, d.height, + this); + } else { + g.drawImage(LeftPanel.getOffBtn(), 0, 0, d.width, d.height, + this); + } + g.drawImage(themes.getImage("left_help.png"),X,Y,this); + + + } + + public void init() { + setBounds(LeftPanel.x(this),LeftPanel.y(),LeftPanel.getBtnDim().width,LeftPanel.getBtnDim().height); + } + + public LeftPanel_help_btn() { + } + + + + @Override + public void mousePressed(MouseEvent e) { + LeftPanel.select(this); + + } + + public void select(boolean b) { + selected=b; + } + + public boolean isPanelSelected() { + return selected; + } + +} + + diff --git a/eric/GUI/window/LeftPanel_history_btn.java b/eric/GUI/window/LeftPanel_history_btn.java new file mode 100644 index 0000000..868f6a4 --- /dev/null +++ b/eric/GUI/window/LeftPanel_history_btn.java @@ -0,0 +1,63 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.window; + +import eric.GUI.pipe_tools; +import eric.GUI.themes; +import eric.GUI.windowComponent; +import eric.JZirkelCanvas; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.event.MouseEvent; +import rene.zirkel.ZirkelCanvas; +import rene.zirkel.construction.ConstructionDisplayPanel; + +/** + * + * @author erichake + */ +public class LeftPanel_history_btn extends windowComponent implements LeftPanel_btn { + + private boolean over=false; + private boolean selected=false; + private static int X=(themes.getIcon("leftpanel_on_btn.gif").getIconWidth()-themes.getIcon("left_history.png").getIconWidth())/2; + private static int Y=2; + + @Override + public void paintComponent(Graphics g) { + Dimension d=getSize(); + if (selected) { + g.drawImage(LeftPanel.getOnBtn(), 0, 0, d.width, d.height, + this); + } else { + g.drawImage(LeftPanel.getOffBtn(), 0, 0, d.width, d.height, + this); + } + g.drawImage(themes.getImage("left_history.png"), X, Y, this); + } + + public void init() { + setBounds(LeftPanel.x(this), LeftPanel.y(), LeftPanel.getBtnDim().width, LeftPanel.getBtnDim().height); + } + + public LeftPanel_history_btn() { + } + + @Override + public void mousePressed(MouseEvent e) { + LeftPanel.select(this); + } + + public void select(boolean b) { + selected=b; + } + + public boolean isPanelSelected() { + return selected; + } +} + + diff --git a/eric/GUI/window/LeftPanel_macros_btn.java b/eric/GUI/window/LeftPanel_macros_btn.java new file mode 100644 index 0000000..3a8db54 --- /dev/null +++ b/eric/GUI/window/LeftPanel_macros_btn.java @@ -0,0 +1,62 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.window; + +import eric.GUI.themes; +import eric.GUI.windowComponent; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.event.MouseEvent; + +/** + * + * @author erichake + */ +public class LeftPanel_macros_btn extends windowComponent implements LeftPanel_btn{ + + private boolean over=false; + private boolean selected=true; + private static int X=(themes.getIcon("leftpanel_on_btn.gif").getIconWidth()-themes.getIcon("left_macros.png").getIconWidth())/2; + private static int Y=3; + + @Override + public void paintComponent(Graphics g) { + Dimension d=getSize(); + if (selected) { + g.drawImage(LeftPanel.getOnBtn(), 0, 0, d.width, d.height, + this); + } else { + g.drawImage(LeftPanel.getOffBtn(), 0, 0, d.width, d.height, + this); + } +g.drawImage(themes.getImage("left_macros.png"),X,Y,this); + } + + public void init() { + setBounds(LeftPanel.x(this),LeftPanel.y(),LeftPanel.getBtnDim().width,LeftPanel.getBtnDim().height); + } + + public LeftPanel_macros_btn() { + } + + + + @Override + public void mousePressed(MouseEvent e) { + LeftPanel.select(this); + } + + public void select(boolean b) { + selected=b; + } + + public boolean isPanelSelected() { + return selected; + } + +} + + diff --git a/eric/GUI/window/LeftPanel_scripts_btn.java b/eric/GUI/window/LeftPanel_scripts_btn.java new file mode 100644 index 0000000..d61fd0c --- /dev/null +++ b/eric/GUI/window/LeftPanel_scripts_btn.java @@ -0,0 +1,55 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.window; + +import eric.GUI.themes; +import eric.GUI.windowComponent; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.event.MouseEvent; + +/** + * + * @author PM + */ +public class LeftPanel_scripts_btn extends windowComponent implements LeftPanel_btn { + + private boolean selected = false; + private static int X = (themes.getIcon("leftpanel_on_btn.gif").getIconWidth()-17)/2; //17 : voir ligne 34 + private static int Y = 3; + + public LeftPanel_scripts_btn() { + } + + @Override + public void paintComponent(Graphics g) { + Dimension d=getSize(); + if (selected) { + g.drawImage(LeftPanel.getOnBtn(), 0, 0, d.width, d.height, this); + } else { + g.drawImage(LeftPanel.getOffBtn(), 0, 0, d.width, d.height, this); + } + g.drawImage(themes.resizeExistingIcon("/eric/GUI/icons/themes/common/scripts.png", 17, 17).getImage(),X,Y,this); + } + + public void init() { + setBounds(LeftPanel.x(this),LeftPanel.y(),LeftPanel.getBtnDim().width,LeftPanel.getBtnDim().height); + } + + @Override + public void mousePressed(MouseEvent e) { + LeftPanel.select(this); + } + + @Override + public void select(boolean b) { + selected = b; + } + + @Override + public boolean isPanelSelected() { + return selected; + } +} \ No newline at end of file diff --git a/eric/GUI/window/MainApplet.java b/eric/GUI/window/MainApplet.java new file mode 100644 index 0000000..cb588e8 --- /dev/null +++ b/eric/GUI/window/MainApplet.java @@ -0,0 +1,186 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.window; + +import eric.FileTools; +import eric.GUI.pipe_tools; +import eric.GUI.themes; +import eric.JZirkelCanvas; +import eric.Media; +import java.awt.Image; +import java.awt.Point; +import java.net.URL; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import javax.swing.JApplet; +import javax.swing.SwingUtilities; +import rene.zirkel.ZirkelCanvas; + +/** + * + * @author erichake + */ +public class MainApplet extends JApplet implements MainContainer { + + private ContentPane CONTENT; + private String Source=null; + + public MainApplet() { + } + + @Override + public void init() { + try { + pipe_tools.init(this); + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + createGUI(); + openFILES(); + } + }); + } catch (Exception ex) { + } + +// JSObject window=JSObject.getWindow(this); +// String[] message={"An alert message"}; +// window.call("alert", message); + + } + + @Override + public void start() { + SwingUtilities.invokeLater(new Runnable() { + public void run() { + if (Source!=null) { + FileTools.setWorkBookSource(Source); + }else{ + pipe_tools.AppletLoadedMessage_To_HTML(); + } + } + }); + } + + public void createGUI() { + tab_main_panel.removeAllBtns(CONTENT); + Media.clearMedias(); + setLayout(null); + themes.init(); + CONTENT = new ContentPane(); + setContentPane(CONTENT); + } + + public void openFILES() { + try { + Source = getParameter("source"); + final String filename = getParameter("file"); + URL url = new URL(getCodeBase(), filename); + if (url.getFile().toLowerCase().endsWith(".zirs")) { + URL myURL = new URL(getCodeBase(), filename); + FileTools.openWorkBook(url.getFile(), myURL.openStream()); + } else if (url.getFile().toLowerCase().endsWith(".zir")) { + URL myURL = new URL(getCodeBase(), filename); + FileTools.openFile(url.getFile(), myURL.openStream(), 0); + + } + } catch (Exception ex) { + setComponents(); + +// try { +// String src = getParameter("source"); +// src = src.trim(); +// FileTools.setWorkBookSource(src); +// } catch (Exception ex2) { +// setComponents(); +// } + } + } + + public void setComponents() { + CONTENT.setComponents(); + } + + public ContentPane getContent() { + return CONTENT; + } + + public Point getMouseLoc() { + return CONTENT.getMousePosition(); + } + + public Image getImage(String s) { + Image myimage; + myimage = getImage(themes.class.getResource(themes.getCommonThemePath() + s)); + if (myimage == null) { + myimage = getImage(themes.class.getResource(themes.getCurrentThemePath() + s)); + } + if (myimage == null) { + myimage = getImage(themes.class.getResource(themes.getCommonThemePath() + "null.gif")); + } + return myimage; + } + + public Image getPaletteImage(String s) { + Image myimage; + try { + myimage = getImage(themes.class.getResource(themes.getPalettePath() + s + ".png")); + } catch (final Exception e) { + try { + myimage = getImage(themes.class.getResource(themes.getPalettePath() + s + ".gif")); + } catch (final Exception ex) { + try { + myimage = getImage(themes.class.getResource(themes.getBarPath() + s + ".png")); + } catch (final Exception ex2) { + try { + myimage = getImage(themes.class.getResource(themes.getBarPath() + s + ".gif")); + } catch (final Exception ex3) { + myimage = getImage(themes.class.getResource(themes.getCommonThemePath() + "null.gif")); + } + } + } + } + return myimage; + } + + public boolean isApplet() { + return true; + } + + @Override + public void setLocation(int x, int y) { + } + + @Override + public Point getLocation() { + return new Point(0, 0); + } + + @Override + public void setSize(int w, int h) { + } + + /* these methods are made for communication between the applet + * and the web page. + */ + public String get() { + return FileTools.getWorkBookSource(); + } + + public void set(String s) { + createGUI(); + s = s.trim(); + FileTools.setWorkBookSource(s); + } + + public void JSsend(final String s) { + ZirkelCanvas zc = JZirkelCanvas.getCurrentZC(); + zc.JSsend(s); + zc.repaint(); + } + + public String JSreceive(final String s) { + ZirkelCanvas zc = JZirkelCanvas.getCurrentZC(); + return zc.JSreceive(s); + } +} diff --git a/eric/GUI/window/MainContainer.java b/eric/GUI/window/MainContainer.java new file mode 100644 index 0000000..700c375 --- /dev/null +++ b/eric/GUI/window/MainContainer.java @@ -0,0 +1,32 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package eric.GUI.window; + + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Image; +import java.awt.Point; +import javax.swing.JRootPane; + +/** + * + * @author erichake + */ +public interface MainContainer{ + public void setComponents(); + public ContentPane getContent(); + public Point getMouseLoc(); + public Image getImage(String s); + public Image getPaletteImage(String s); + public boolean isApplet(); + public void setLocation(int x, int y); + public Point getLocation(); + public void setSize(int w,int h); + public Dimension getSize(); + public JRootPane getRootPane(); +// public Image createImage(int width, int height); +} diff --git a/eric/GUI/window/MainWindow.java b/eric/GUI/window/MainWindow.java new file mode 100644 index 0000000..e22e235 --- /dev/null +++ b/eric/GUI/window/MainWindow.java @@ -0,0 +1,162 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +/* + * NewJZirkelFrame.java + * + * Created on 26 oct. 2009, 08:41:46 + */ +package eric.GUI.window; + +import eric.GUI.pipe_tools; +import eric.GUI.themes; +import eric.OS; +import java.awt.Image; +import java.awt.MouseInfo; +import java.awt.Point; +import java.awt.event.WindowEvent; +import java.awt.event.WindowListener; +import javax.swing.ImageIcon; +import javax.swing.JFrame; +import rene.gui.Global; + +/** + * + * @author erichake + */ +public class MainWindow extends JFrame implements MainContainer, WindowListener { + + private int WIN_w=1280, WIN_h=800; + private ContentPane CONTENT=null; + + @Override + public void repaint() { + } + + /** + * + */ + public MainWindow() { + super(); + pipe_tools.init(this); + addWindowListener(this); + setUndecorated(true); + setLayout(null); + themes.init(); + CONTENT=new ContentPane(); + setContentPane(CONTENT); + + if (OS.isUnix()) { + // A cause du "MToolkit" du lanceur desktop sur Linux, on ouvre + // la fenêtre en plein écran au démarrage : + setBounds(Global.getScreenX(), Global.getScreenY(), Global.getScreenW(), Global.getScreenH()); + setSize(Global.getScreenW(), Global.getScreenH()); + } else { + if (WIN_w>Global.getScreenW()) { + WIN_w=Global.getScreenW(); + } + if (WIN_h>Global.getScreenH()) { + WIN_h=Global.getScreenH(); + } + int x=(Global.getScreenW()-WIN_w)/2; + int y=(Global.getScreenH()-WIN_h)/2; + setBounds(Global.getScreenX()+x, Global.getScreenY()+y, WIN_w, WIN_h); + setSize(WIN_w, WIN_h); + } + + setComponents(); + setVisible(true); + } + + /** + * + */ + @Override + public void setComponents() { + CONTENT.setComponents(); + } + + @Override + public ContentPane getContent() { + return CONTENT; + } + + @Override + public Point getMouseLoc() { + return MouseInfo.getPointerInfo().getLocation(); + } + + @Override + public Image getImage(String s) { + ImageIcon myicon; + try { + myicon=new ImageIcon(themes.class.getResource(themes.getCommonThemePath()+s)); + } catch (final Exception e) { + try { + myicon=new ImageIcon(themes.class.getResource(themes.getCurrentThemePath()+s)); + } catch (final Exception ex) { + myicon=new ImageIcon(themes.class.getResource(themes.getCommonThemePath()+"null.gif")); + } + } + return myicon.getImage(); + } + + @Override + public Image getPaletteImage(String s) { + ImageIcon myicon; + try { + myicon=new ImageIcon(themes.class.getResource(themes.getPalettePath()+s+".png")); + } catch (final Exception e) { + try { + myicon=new ImageIcon(themes.class.getResource(themes.getPalettePath()+s+".gif")); + } catch (final Exception ex) { + try { + myicon=new ImageIcon(themes.class.getResource(themes.getBarPath()+s+".png")); + } catch (final Exception ex2) { + try { + myicon=new ImageIcon(themes.class.getResource(themes.getBarPath()+s+".gif")); + } catch (final Exception ex3) { + myicon=new ImageIcon(themes.class.getResource(themes.getCommonThemePath()+"null.gif")); + } + } + } + } + return myicon.getImage(); + } + + @Override + public boolean isApplet() { + return false; + } + + @Override + public void windowOpened(WindowEvent e) { + } + + @Override + public void windowClosing(WindowEvent e) { + } + + @Override + public void windowClosed(WindowEvent e) { + } + + @Override + public void windowIconified(WindowEvent e) { + } + + @Override + public void windowDeiconified(WindowEvent e) { + } + + @Override + public void windowActivated(WindowEvent e) { + } + + @Override + public void windowDeactivated(WindowEvent e) { + tab_main_panel.hidePopups(); + } +} \ No newline at end of file diff --git a/eric/GUI/window/Margin.java b/eric/GUI/window/Margin.java new file mode 100644 index 0000000..3d5d769 --- /dev/null +++ b/eric/GUI/window/Margin.java @@ -0,0 +1,35 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.window; + +import java.awt.Dimension; +import eric.JEricPanel; + +/** + * + * @author erichake + */ +public class Margin extends JEricPanel { + + public static final int HORIZONTAL=1, VERTICAL=2; + + public Margin(int length, int orientation) { + int w, h; + if (orientation==HORIZONTAL) { + w=length; + h=1; + } else { + w=1; + h=length; + } + Dimension d=new Dimension(w, h); + setPreferredSize(d); + setMinimumSize(d); + setMaximumSize(d); + setSize(d); + setOpaque(false); + setFocusable(false); + } +} diff --git a/eric/GUI/window/MenuBar.java b/eric/GUI/window/MenuBar.java new file mode 100644 index 0000000..1d4ce65 --- /dev/null +++ b/eric/GUI/window/MenuBar.java @@ -0,0 +1,74 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.window; + +import eric.GUI.pipe_tools; +import eric.GUI.windowComponent; +import eric.GUI.themes; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.MouseInfo; +import java.awt.Point; +import java.awt.event.MouseEvent; +import javax.swing.BoxLayout; + +/** + * + * @author erichake + */ +public class MenuBar extends windowComponent { + + private Point winloc; + private Point origin; + private Point current; + private static MenuBar me; + + @Override + public void paintComponent(Graphics g) { + Dimension d=getSize(); + g.drawImage(themes.getImage("menubar.gif"), 0, 0, d.width, d.height, + this); + } + + public void init() { + setBounds(0, themes.getTitleBarHeight(), pipe_tools.getWindowSize().width-themes.getTotalRightPanelWidth(), themes.getMenuBarHeight()); + } + + public MenuBar() { + me=this; + setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); + add(pipe_tools.getMenuBar()); + } + + public static void setMenuVisible(boolean b) { + try { + me.getComponent(0).setVisible(b); + } catch (Exception e) { + } + } + + public static boolean isMenuVisible() { + return me.getComponent(0).isVisible(); + } + + public static void reloadMenuBar() { + me.removeAll(); + me.add(pipe_tools.getMenuBar()); + me.revalidate(); + } + + @Override + public void mousePressed(MouseEvent e) { + origin=MouseInfo.getPointerInfo().getLocation(); + winloc=pipe_tools.getWindowLocation(); + } + + @Override + public void mouseDragged(MouseEvent arg0) { + current=MouseInfo.getPointerInfo().getLocation(); + pipe_tools.setWindowLocation(winloc.x+current.x-origin.x, winloc.y+current.y-origin.y); + pipe_tools.setWindowComponents(); + } +} \ No newline at end of file diff --git a/eric/GUI/window/Monkey_panel_btn.java b/eric/GUI/window/Monkey_panel_btn.java new file mode 100644 index 0000000..0edec32 --- /dev/null +++ b/eric/GUI/window/Monkey_panel_btn.java @@ -0,0 +1,92 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.window; + +import eric.GUI.pipe_tools; +import eric.GUI.windowComponent; +import eric.GUI.themes; +import java.awt.AlphaComposite; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.event.MouseEvent; +import rene.gui.Global; + +/** + * + * @author erichake + */ +public class Monkey_panel_btn extends windowComponent { + + private static Monkey_panel_btn me; + private Image icon_off=themes.getImage("monkeybtn_off.png"); + private Image icon_on=themes.getImage("monkeybtn_on.png"); + private boolean isselected=false; + private boolean isover=false; + + public void paintComponent(Graphics g) { + Dimension d=this.getSize(); + final int w=d.width; + final int h=d.height; + + final Graphics2D g2=windowComponent.getGraphics2D(g); + if (isselected) { + g2.drawImage(icon_on, 0, 0, w, h, this); + } else { + g2.drawImage(icon_off, 0, 0, w, h, this); + } + if (isover) { + final AlphaComposite ac=AlphaComposite.getInstance( + AlphaComposite.SRC_OVER, 0.3f); + g2.setComposite(ac); + g2.setColor(new Color(0, 0, 80)); + g2.fillRect(7, 5, 17, 11); + } + } + + public Monkey_panel_btn() { + me=this; + setToolTipText(Global.Loc("monkey.btn.tooltip")); + } + + public static void setSelected(boolean b) { + me.isselected=b; + me.repaint(); + } + + public void init() { + int x=pipe_tools.getWindowSize().width-themes.getTotalRightPanelWidth()-3*themes.getOpenLeftPanelBtnDim().width-themes.getOpenMiddlePanelBtnDim().width-3*themes.getOpenPanelsBtnsMarginW(); + this.setBounds(x, + themes.getOpenPanelsBtnsMarginH(), + themes.getOpenLeftPanelBtnDim().width, + themes.getOpenLeftPanelBtnDim().height); + } + + + + public void mousePressed(MouseEvent e) { + isselected=true; + repaint(); + pipe_tools.monkeyStart(); + } + + public void mouseReleased(MouseEvent e) { + isselected=false; + repaint(); + pipe_tools.monkeyStop(); + } + + public void mouseEntered(MouseEvent arg0) { + isover=true; + repaint(); + } + + public void mouseExited(MouseEvent arg0) { + isover=false; + repaint(); + } +} diff --git a/eric/GUI/window/Open_left_panel_btn.java b/eric/GUI/window/Open_left_panel_btn.java new file mode 100644 index 0000000..0ae4bf3 --- /dev/null +++ b/eric/GUI/window/Open_left_panel_btn.java @@ -0,0 +1,112 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.window; + +import eric.GUI.palette.PaletteManager; +import eric.GUI.pipe_tools; +import eric.GUI.windowComponent; +import eric.GUI.themes; +import eric.JGeneralMenuBar; +import java.awt.AlphaComposite; +import java.awt.BasicStroke; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.Stroke; +import java.awt.event.MouseEvent; +import rene.gui.Global; + +/** + * + * @author erichake + */ +public class Open_left_panel_btn extends windowComponent { + + private static Open_left_panel_btn me; + private Image icon_off=themes.getImage("leftpanel_off.png"); + private Image icon_on=themes.getImage("leftpanel_on.png"); + private boolean isselected=false; + private boolean isover=false; + + public void paintComponent(Graphics g) { + Dimension d=this.getSize(); + final int w=d.width; + final int h=d.height; + + final Graphics2D g2=windowComponent.getGraphics2D(g); + if (isselected) { + g2.drawImage(icon_on, 0, 0, w, h, this); + } else { + g2.drawImage(icon_off, 0, 0, w, h, this); + } + if (isover) { + final AlphaComposite ac=AlphaComposite.getInstance( + AlphaComposite.SRC_OVER, 0.3f); + g2.setComposite(ac); + g2.setColor(new Color(0, 0, 80)); + g2.fillRect(7, 5, 17, 11); + } + } + + public Open_left_panel_btn() { + me=this; + setToolTipText(Global.Loc("menu.display.leftpanel")); + } + + public static void setSelected(boolean b) { + me.isselected=b; + me.repaint(); + } + + public void init() { + int x=pipe_tools.getWindowSize().width-themes.getTotalRightPanelWidth()-2*themes.getOpenLeftPanelBtnDim().width-themes.getOpenMiddlePanelBtnDim().width-themes.getOpenPanelsBtnsMarginW(); + this.setBounds(x, + themes.getOpenPanelsBtnsMarginH(), + themes.getOpenLeftPanelBtnDim().width, + themes.getOpenLeftPanelBtnDim().height); + } + + public static void open() { + if (!LeftPanel.isPanelVisible()) { + toggle(); + } + } + + public static void setmode(){ + if (me!=null) { + me.isselected=LeftPanel.isPanelVisible(); + } + } + + public static void toggle() { + LeftPanel.showPanel(!LeftPanel.isPanelVisible()); + if (me!=null) { + me.isselected=LeftPanel.isPanelVisible(); + me.repaint(); + } + JGeneralMenuBar.initToggleItems(); + tab_main_panel.initToggleItems(); + if (pipe_tools.isApplet()) { + pipe_tools.setWindowComponents(); + PaletteManager.init(); + } + } + + public void mousePressed(MouseEvent e) { + toggle(); + } + + public void mouseEntered(MouseEvent arg0) { + isover=true; + repaint(); + } + + public void mouseExited(MouseEvent arg0) { + isover=false; + repaint(); + } +} diff --git a/eric/GUI/window/Open_middle_panel_btn.java b/eric/GUI/window/Open_middle_panel_btn.java new file mode 100644 index 0000000..8d003f9 --- /dev/null +++ b/eric/GUI/window/Open_middle_panel_btn.java @@ -0,0 +1,99 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.window; + +import eric.GUI.pipe_tools; +import eric.GUI.windowComponent; +import eric.GUI.themes; +import eric.JGeneralMenuBar; +import java.awt.AlphaComposite; +import java.awt.BasicStroke; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.Stroke; +import java.awt.event.MouseEvent; +import rene.gui.Global; + +/** + * + * @author erichake + */ +public class Open_middle_panel_btn extends windowComponent { + + private static Open_middle_panel_btn me; + private Image icon_off=themes.getImage("middlepanel_off.png"); + private Image icon_on=themes.getImage("middlepanel_on.png"); + private boolean isselected=false; + private boolean isover=false; + + public void paintComponent(Graphics g) { + Dimension d=this.getSize(); + final int w=d.width; + final int h=d.height; + + final Graphics2D g2=windowComponent.getGraphics2D(g); + if (isselected) { + g2.drawImage(icon_on, 0, 0, w, h, this); + } else { + g2.drawImage(icon_off, 0, 0, w, h, this); + } + if (isover) { + final AlphaComposite ac=AlphaComposite.getInstance( + AlphaComposite.SRC_OVER, 0.3f); + g2.setComposite(ac); + g2.setColor(new Color(0, 0, 80)); + g2.fillRect(7, 5, 17, 11); + } + } + + public Open_middle_panel_btn() { + me=this; + isselected=Global.getParameter("comment", false); + setToolTipText(Global.Loc("menu.display.comment")); + } + + public static void setmode(){ + if (me!=null) { + me.isselected=Global.getParameter("comment", false); + } + } + + public static void toggle() { + if (me!=null) { + me.isselected=!me.isselected; + me.repaint(); + } + Global.setParameter("comment", !Global.getParameter("comment", false)); + pipe_tools.setWindowComponents(); + comments.refresh(); + JGeneralMenuBar.initToggleItems(); + tab_main_panel.initToggleItems(); + } + + public void init() { + int x=pipe_tools.getWindowSize().width-themes.getTotalRightPanelWidth()-themes.getOpenLeftPanelBtnDim().width-themes.getOpenPanelsBtnsMarginW()-themes.getOpenMiddlePanelBtnDim().width; + this.setBounds(x, + themes.getOpenPanelsBtnsMarginH(), + themes.getOpenLeftPanelBtnDim().width, + themes.getOpenLeftPanelBtnDim().height); + } + + public void mousePressed(MouseEvent e) { + toggle(); + } + + public void mouseEntered(MouseEvent arg0) { + isover=true; + repaint(); + } + + public void mouseExited(MouseEvent arg0) { + isover=false; + repaint(); + } +} diff --git a/eric/GUI/window/Open_right_panel_btn.java b/eric/GUI/window/Open_right_panel_btn.java new file mode 100644 index 0000000..c231154 --- /dev/null +++ b/eric/GUI/window/Open_right_panel_btn.java @@ -0,0 +1,103 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.window; + +import eric.GUI.palette.PaletteManager; +import eric.GUI.pipe_tools; +import eric.GUI.windowComponent; +import eric.GUI.themes; +import eric.JGeneralMenuBar; +import java.awt.AlphaComposite; +import java.awt.BasicStroke; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.Stroke; +import java.awt.event.MouseEvent; +import rene.gui.Global; + +/** + * + * @author erichake + */ +public class Open_right_panel_btn extends windowComponent { + + private Image icon_off=themes.getImage("rightpanel_off.png"); + private Image icon_on=themes.getImage("rightpanel_on.png"); + private boolean isselected=true; + private boolean isover=false; + private static Open_right_panel_btn me; + + public void paintComponent(Graphics g) { + Dimension d=this.getSize(); + final int w=d.width; + final int h=d.height; + + final Graphics2D g2=windowComponent.getGraphics2D(g); + + if (isselected) { + g2.drawImage(icon_on, 0, 0, w, h, this); + } else { + g2.drawImage(icon_off, 0, 0, w, h, this); + } + if (isover) { + final AlphaComposite ac=AlphaComposite.getInstance( + AlphaComposite.SRC_OVER, 0.3f); + g2.setComposite(ac); + g2.setColor(new Color(0, 0, 80)); + g2.fillRect(6, 5, 17, 11); + } + } + + public Open_right_panel_btn() { + me=this; + setToolTipText(Global.Loc("menu.display.palette")); + } + + public void init() { + int x=pipe_tools.getWindowSize().width-themes.getTotalRightPanelWidth()-themes.getOpenLeftPanelBtnDim().width-themes.getOpenPanelsBtnsMarginW(); + this.setBounds(x, + themes.getOpenPanelsBtnsMarginH(), + themes.getOpenLeftPanelBtnDim().width, + themes.getOpenLeftPanelBtnDim().height); + } + + public static void setmode(){ + if (me!=null) { + me.isselected=RightPanel.isPanelVisible(); + } + } + + public static void toggle() { + RightPanel.showPanel(!RightPanel.isPanelVisible()); + if (me!=null) { + me.isselected=RightPanel.isPanelVisible(); + me.repaint(); + } + JGeneralMenuBar.initToggleItems(); + tab_main_panel.initToggleItems(); + PaletteManager.refresh(); + if (pipe_tools.isApplet()){ + pipe_tools.setWindowComponents(); + PaletteManager.init(); + } + } + + public void mousePressed(MouseEvent e) { + toggle(); + } + + public void mouseEntered(MouseEvent arg0) { + isover=true; + repaint(); + } + + public void mouseExited(MouseEvent arg0) { + isover=false; + repaint(); + } +} diff --git a/eric/GUI/window/ReduceBox.java b/eric/GUI/window/ReduceBox.java new file mode 100644 index 0000000..7e86cde --- /dev/null +++ b/eric/GUI/window/ReduceBox.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.window; + +import eric.GUI.pipe_tools; +import eric.GUI.windowComponent; +import eric.GUI.themes; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Image; +import java.awt.event.MouseEvent; +import javax.swing.JFrame; + +/** + * + * @author erichake + */ +public class ReduceBox extends windowComponent { + + private String btn="zreducebutton.png"; + private String overbtn="zreducebuttonover.png"; + private Image icon=themes.getImage(btn); + + public void paintComponent(Graphics g) { + Dimension d=this.getSize(); + g.drawImage(icon, 0, 0, d.width, d.height, + this); + } + + public ReduceBox() { + } + + public void init() { +// win=StaticTools.getMainWindow(this); + int x; + if (themes.MacLF()) { + x=themes.getBoxesMarginWidth()+themes.getCloseBoxDim().width; + } else { + x=pipe_tools.getWindowSize().width-themes.getBoxesMarginWidth()-themes.getCloseBoxDim().width-themes.getGrowBoxDim().width-themes.getReduceBoxDim().width-themes.getTotalRightPanelWidth(); + } + this.setBounds(x, + themes.getBoxesMarginHeight(), + themes.getReduceBoxDim().width, + themes.getReduceBoxDim().height); + } + + public void mousePressed(MouseEvent e) { + if (pipe_tools.getWindow() instanceof MainWindow) { + MainWindow mw=(MainWindow) pipe_tools.getWindow(); + mw.setExtendedState(JFrame.ICONIFIED); + mw.setComponents(); + } + } + + public void mouseEntered(MouseEvent arg0) { + icon=themes.getImage(overbtn); + repaint(); + } + + public void mouseExited(MouseEvent arg0) { + icon=themes.getImage(btn); + repaint(); + } +} diff --git a/eric/GUI/window/ResizeBox.java b/eric/GUI/window/ResizeBox.java new file mode 100644 index 0000000..03e6c67 --- /dev/null +++ b/eric/GUI/window/ResizeBox.java @@ -0,0 +1,73 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.window; + +import eric.GUI.pipe_tools; +import eric.GUI.windowComponent; +import eric.GUI.themes; +import eric.JZirkelCanvas; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.MouseInfo; +import java.awt.Point; +import java.awt.Toolkit; +import java.awt.event.MouseEvent; + +/** + * + * @author erichake + */ +public class ResizeBox extends windowComponent { + private Point origin; + private Point current; + private int winWidth; + private int winHeight; + + public void paintComponent(Graphics g) { + Dimension d=this.getSize(); + g.drawImage(themes.getImage("zoombox.png"), 0, 0, d.width, d.height, + this); + } + + public ResizeBox() { + + } + + public void init(){ + this.setBounds(pipe_tools.getWindowSize().width-themes.getResizeBoxWidth()-themes.getTotalRightPanelWidth(), + pipe_tools.getWindowSize().height-themes.getResizeBoxHeight(), + themes.getResizeBoxWidth(), + themes.getResizeBoxHeight()); + } + + public void mouseEntered(MouseEvent e) { + repaint(); + } + + + + @Override + public void mousePressed(MouseEvent e) { + origin=MouseInfo.getPointerInfo().getLocation(); + winWidth=pipe_tools.getWindowSize().width; + winHeight=pipe_tools.getWindowSize().height; + } + + + @Override + public void mouseDragged(MouseEvent arg0) { + current=MouseInfo.getPointerInfo().getLocation(); + int w=winWidth+current.x-origin.x; + int h=winHeight+current.y-origin.y; + Toolkit.getDefaultToolkit().sync(); + pipe_tools.setWindowSize(Math.max(w,210), Math.max(h,70)); + pipe_tools.setWindowComponents(); + } + + @Override + public void mouseReleased(MouseEvent e) { + } + +} diff --git a/eric/GUI/window/RightPanel.java b/eric/GUI/window/RightPanel.java new file mode 100644 index 0000000..e279185 --- /dev/null +++ b/eric/GUI/window/RightPanel.java @@ -0,0 +1,95 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.window; + +import eric.GUI.palette.PaletteManager; +import eric.GUI.pipe_tools; +import eric.GUI.windowComponent; +import eric.GUI.themes; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Image; +import javax.swing.BoxLayout; +import rene.gui.Global; + +/** + * + * @author erichake + */ +public class RightPanel extends windowComponent { + + private static int VerticalSeparator=1; + private static Image back=themes.getImage("rightback.png"); + private static RightPanel me; +// private static int actualSize; //width of this panel + + public static boolean isPanelVisible() { + return (me.getSize().width!=0); + } + + public static int getPanelWidth() { + return me.getSize().width; + } + + public static int getSeparatorWidth() { + if (isPanelVisible()) { + return VerticalSeparator; + } else { + return 0; + } + } + + public static void setPanelWidth(int size) { + Dimension d=new Dimension(size, pipe_tools.getWindowSize().height); + me.setPreferredSize(d); + me.setMaximumSize(d); + me.setMinimumSize(d); + me.setSize(d); + } + + public static void showPanel(boolean vis) { + int w=(vis)?(themes.getPaletteIconPerRow()*themes.getPaletteIconWidth()):0; + +// if ((w>0)&&(Global.getScreenW()>=pipe_tools.getWindowSize().width+w)) { +// pipe_tools.setWindowSize(pipe_tools.getWindowSize().width+w+VerticalSeparator, pipe_tools.getWindowSize().height); +// } + if(w>0){ + if(Global.getScreenW()>=pipe_tools.getWindowSize().width+w){ + pipe_tools.setWindowSize(pipe_tools.getWindowSize().width+w+VerticalSeparator, pipe_tools.getWindowSize().height); + } else { + pipe_tools.setWindowSize(Global.getScreenW()+VerticalSeparator, pipe_tools.getWindowSize().height); + } + } + if (w==0) { + pipe_tools.setWindowSize(pipe_tools.getWindowSize().width-getPanelWidth()-VerticalSeparator, pipe_tools.getWindowSize().height); + } + setPanelWidth(w); + me.setBounds(pipe_tools.getWindowSize().width-getPanelWidth(), 0, getPanelWidth(), pipe_tools.getWindowSize().height); + pipe_tools.setWindowComponents(); + } + + @Override + public void paintComponent(Graphics g) { + Dimension d=getSize(); + g.drawImage(back, 0, 0, d.width, d.height, this); + } + + public void init() { + setBounds(pipe_tools.getWindowSize().width-themes.getRightPanelWidth(), + 0, + themes.getRightPanelWidth(), + pipe_tools.getWindowSize().height); + PaletteManager.init(); + } + + public RightPanel() { + super(); + me=this; + setPanelWidth(themes.getPaletteIconPerRow()*themes.getPaletteIconWidth()); + setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); + setAlignmentX(0.0f); + PaletteManager.construct(this); + } +} diff --git a/eric/GUI/window/TitleBar.java b/eric/GUI/window/TitleBar.java new file mode 100644 index 0000000..18b0fab --- /dev/null +++ b/eric/GUI/window/TitleBar.java @@ -0,0 +1,79 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.window; + +import eric.GUI.pipe_tools; +import eric.GUI.windowComponent; +import eric.GUI.themes; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.MouseInfo; +import java.awt.Point; +import java.awt.RenderingHints; +import java.awt.event.MouseEvent; +import java.awt.font.FontRenderContext; +import java.awt.font.LineMetrics; +import java.awt.geom.Rectangle2D; +import rene.gui.Global; + +/** + * + * @author erichake + */ +public class TitleBar extends windowComponent { + private Point origin; + private Point current; + private Point winloc; + private Font TextFont=new Font("System", Font.PLAIN, 13); + private Color TextColor=Color.DARK_GRAY; + private String title; + + public void paintComponent(Graphics g) { + Dimension d=getSize(); + Graphics2D g2d=(Graphics2D) g; + g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, + RenderingHints.VALUE_TEXT_ANTIALIAS_ON); + + g2d.drawImage(themes.getImage("titlebar.gif"), 0, 0, d.width, d.height, + this); + g2d.setFont(TextFont); + FontRenderContext frc=g2d.getFontRenderContext(); + Rectangle2D bounds=TextFont.getStringBounds(title, frc); + LineMetrics metrics=TextFont.getLineMetrics(title, frc); + float width=(float) bounds.getWidth(); // The width of our text + float lineheight=metrics.getHeight(); // Total line height + float ascent=metrics.getAscent(); // Top of text to baseline + g2d.setColor(TextColor); + g2d.drawString(title, (pipe_tools.getWindowSize().width-themes.getTotalRightPanelWidth()-width)/2, lineheight+3); + } + + public void init() { +// win=StaticTools.getMainWindow(this); + setBounds(0, 0, pipe_tools.getWindowSize().width-themes.getTotalRightPanelWidth(), themes.getTitleBarHeight()); + } + + public TitleBar() { + title=Global.Loc("program.name"); + } + + public void mousePressed(MouseEvent e) { + origin=MouseInfo.getPointerInfo().getLocation(); + winloc=pipe_tools.getWindowLocation(); + } + + public void mouseDragged(MouseEvent arg0) { + current=MouseInfo.getPointerInfo().getLocation(); + pipe_tools.setWindowLocation(winloc.x+current.x-origin.x, winloc.y+current.y-origin.y); +// pipe_tools.setWindowComponents(); + } + + void setTitle(String s){ + title=s; + getParent().repaint(); + } +} diff --git a/eric/GUI/window/VerticalLeftBorder.java b/eric/GUI/window/VerticalLeftBorder.java new file mode 100644 index 0000000..3a424db --- /dev/null +++ b/eric/GUI/window/VerticalLeftBorder.java @@ -0,0 +1,52 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.window; + +import eric.GUI.pipe_tools; +import eric.GUI.windowComponent; +import eric.GUI.themes; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.MouseInfo; +import java.awt.Point; +import java.awt.event.MouseEvent; + +/** + * + * @author erichake + */ +public class VerticalLeftBorder extends windowComponent { + private Point origin; + private Point current; + private Point winloc; + + public void paintComponent(Graphics g) { + Dimension d=getSize(); + g.drawImage(themes.getImage("verticalseparator.png"), 0, 0, d.width, d.height, + this); + } + + public void init() { +// win=StaticTools.getMainWindow(this); + setBounds(0, + themes.getTitleBarHeight()+themes.getMenuBarHeight(), + themes.getVerticalBorderWidth(), + pipe_tools.getWindowSize().height-themes.getTitleBarHeight()-themes.getMenuBarHeight()-themes.getMainTabPanelHeight()); + } + + public VerticalLeftBorder() { + } + + public void mousePressed(MouseEvent e) { + origin=MouseInfo.getPointerInfo().getLocation(); + winloc=pipe_tools.getWindowLocation(); + } + + public void mouseDragged(MouseEvent arg0) { + current=MouseInfo.getPointerInfo().getLocation(); + pipe_tools.setWindowLocation(winloc.x+current.x-origin.x, winloc.y+current.y-origin.y); + pipe_tools.setWindowComponents(); + } +} diff --git a/eric/GUI/window/VerticalLeftPanelBorder.java b/eric/GUI/window/VerticalLeftPanelBorder.java new file mode 100644 index 0000000..86dad31 --- /dev/null +++ b/eric/GUI/window/VerticalLeftPanelBorder.java @@ -0,0 +1,76 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.window; + +import eric.GUI.pipe_tools; +import eric.GUI.windowComponent; +import eric.GUI.themes; +import java.awt.Cursor; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.MouseInfo; +import java.awt.Point; +import java.awt.event.MouseEvent; + +/** + * + * @author erichake + */ +public class VerticalLeftPanelBorder extends windowComponent { + private Point origin; + private Point current; + //private boolean mousepressed; + + @Override + public void paintComponent(Graphics g) { + Dimension d=getSize(); + g.drawImage(themes.getImage("verticalseparator.png"), 0, 0, d.width, d.height, + this); + } + + public void init() { +// win=StaticTools.getMainWindow(this); + setBounds(themes.getLeftPanelWidth()+themes.getVerticalBorderWidth(), + themes.getTitleBarHeight()+themes.getMenuBarHeight()+themes.getCommentsHeight(), + themes.getVerticalPanelBorderWidth(), + pipe_tools.getWindowSize().height-themes.getTitleBarHeight()-themes.getMenuBarHeight()-themes.getMainTabPanelHeight()-themes.getCommentsHeight()); + } + + public VerticalLeftPanelBorder() { + } + + + @Override + public void mouseEntered(MouseEvent e) { + setCursor(Cursor.getPredefinedCursor(Cursor.W_RESIZE_CURSOR)); + } + + @Override + public void mouseExited(MouseEvent e) { + setCursor(Cursor.getDefaultCursor()); + } + + @Override + public void mousePressed(MouseEvent e) { + origin=MouseInfo.getPointerInfo().getLocation(); + } + + @Override + public void mouseReleased(MouseEvent e){ + } + + @Override + public void mouseDragged(MouseEvent arg0) { + current=MouseInfo.getPointerInfo().getLocation(); + int w = LeftPanel.getFactorySize()+current.x-origin.x; + if(w>=115 && w<=this.getParent().getWidth()/2) { + LeftPanel.setFactorySize(w); + origin=current; + } + //LeftPanel.setFactorySize(LeftPanel.getFactorySize()+current.x-origin.x); +// LeftPanel.setFactorySize(LeftPanel.getFactorySize()+current.x-origin.x); +// origin=current; + } +} diff --git a/eric/GUI/window/VerticalRightBorder.java b/eric/GUI/window/VerticalRightBorder.java new file mode 100644 index 0000000..10ee0ec --- /dev/null +++ b/eric/GUI/window/VerticalRightBorder.java @@ -0,0 +1,52 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.window; + +import eric.GUI.pipe_tools; +import eric.GUI.windowComponent; +import eric.GUI.themes; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.MouseInfo; +import java.awt.Point; +import java.awt.event.MouseEvent; + +/** + * + * @author erichake + */ +public class VerticalRightBorder extends windowComponent { + private Point origin; + private Point current; + private Point winloc; + + public void paintComponent(Graphics g) { + Dimension d=getSize(); + g.drawImage(themes.getImage("verticalseparator.png"), 0, 0, d.width, d.height, + this); + } + + public void init() { +// win=StaticTools.getMainWindow(this); + setBounds(pipe_tools.getWindowSize().width-themes.getVerticalBorderWidth()-themes.getTotalRightPanelWidth(), + themes.getTitleBarHeight()+themes.getMenuBarHeight(), + themes.getVerticalBorderWidth(), + pipe_tools.getWindowSize().height-themes.getTitleBarHeight()-themes.getMenuBarHeight()-themes.getMainTabPanelHeight()); + } + + public VerticalRightBorder() { + } + + public void mousePressed(MouseEvent e) { + origin=MouseInfo.getPointerInfo().getLocation(); + winloc=pipe_tools.getWindowLocation(); + } + + public void mouseDragged(MouseEvent arg0) { + current=MouseInfo.getPointerInfo().getLocation(); + pipe_tools.setWindowLocation(winloc.x+current.x-origin.x, winloc.y+current.y-origin.y); + pipe_tools.setWindowComponents(); + } +} diff --git a/eric/GUI/window/clock.java b/eric/GUI/window/clock.java new file mode 100644 index 0000000..d0c51fb --- /dev/null +++ b/eric/GUI/window/clock.java @@ -0,0 +1,29 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package eric.GUI.window; + +import java.util.Calendar; + +/** + * + * @author erichake + */ +public class clock { + private static long time; + +// public static void start(){ +// time=Calendar.getInstance().getTimeInMillis(); +// System.out.println("-- start --"); +// } +// public static void stop(){ +// System.out.println((Calendar.getInstance().getTimeInMillis()-time)+" ms"); +// } +// public static void print(String message){ +// long newtime=Calendar.getInstance().getTimeInMillis(); +// System.out.println(message+" : "+(newtime-time)); +// time=newtime; +// } +} diff --git a/eric/GUI/window/comments.java b/eric/GUI/window/comments.java new file mode 100644 index 0000000..a2c4cd6 --- /dev/null +++ b/eric/GUI/window/comments.java @@ -0,0 +1,87 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.window; + +import eric.GUI.pipe_tools; +import eric.GUI.windowComponent; +import eric.GUI.themes; +import eric.JZirkelCanvas; +import eric.OS; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.event.MouseEvent; +import java.awt.geom.Point2D; +import javax.swing.BorderFactory; + +/** + * + * @author erichake + */ +public class comments extends windowComponent { + + private comments_area Label; + private static comments me; + private static Image bottom=themes.getImage("tab_top.gif"); + private static int H=themes.getIcon("tab_top.gif").getIconHeight(); + private Point2D start=new Point2D.Float(0, 0); +// private float[] dist = {0.0f, 0.2f, 0.4f, 0.6f, 0.8f, 1.0f}; +// private Color[] colors = {Color.YELLOW, Color.ORANGE, Color.RED, Color.MAGENTA, Color.BLUE, Color.BLACK}; + private float[] dist={0.0f, 1.0f}; +// private Color[] colors={new Color(213, 232, 255), new Color(193, 212, 235)}; + private Color[] colors={new Color(225, 239, 253), new Color(193, 212, 235)}; +// private Color[] colors={new Color(225, 239, 253), new Color(146, 196, 247)}; + private boolean JavaOlderThan6=OS.isJavaOlderThan(6); + + public void paintComponent(Graphics g) { + Dimension d=getSize(); + Graphics2D g2d=windowComponent.getGraphics2D(g); + if (JavaOlderThan6) { + g2d.setColor(colors[1]); + g2d.fillRect(0, 0, d.width, d.height); + } else { + + java.awt.LinearGradientPaint paint=new java.awt.LinearGradientPaint(start, new Point2D.Float(0, d.height), dist, colors); + g2d.setPaint(paint); + g2d.fillRect(0, 0, d.width, d.height); + } + g2d.setColor(Color.black); + g2d.drawLine(0, d.height,d.width, d.height); + super.paintComponent(g); + } + + public void init() { + setBounds(themes.getVerticalBorderWidth(), + themes.getTitleBarHeight()+themes.getMenuBarHeight(), + pipe_tools.getWindowSize().width-2*themes.getVerticalBorderWidth()-themes.getTotalRightPanelWidth(), + themes.getCommentsHeight()); + Label.init(); + } + + public comments() { + me=this; + setLayout(null); + Label=new comments_area(); + add(Label); + } + + public static void refresh() { + me.init(); + me.validate(); + me.repaint(); + } + + public static void setLabelText(String s) { + me.Label.setLabelText(s); + } + + @Override + public void mousePressed(MouseEvent e) { + Label.edit(); + } +} diff --git a/eric/GUI/window/comments_area.java b/eric/GUI/window/comments_area.java new file mode 100644 index 0000000..1cc8d2e --- /dev/null +++ b/eric/GUI/window/comments_area.java @@ -0,0 +1,232 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.window; + +import eric.GUI.pipe_tools; +import java.awt.Color; +import java.awt.Component; +import java.awt.Container; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.event.FocusAdapter; +import java.awt.event.FocusEvent; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import javax.swing.BorderFactory; +import javax.swing.JLabel; +import javax.swing.JScrollBar; +import javax.swing.JScrollPane; +import javax.swing.JTextArea; +import javax.swing.ScrollPaneConstants; +import javax.swing.SwingConstants; +import javax.swing.SwingUtilities; +import javax.swing.plaf.basic.BasicScrollBarUI; +import rene.gui.Global; + +/** + * + * @author erichake + */ +public class comments_area extends JScrollPane { + + private static int margins=3; + private static int marginLeft=0, marginTop=0, marginRight=0; + private static int scrollBarWidth=15; + private static Font commentFont=new Font("Verdana", 0, 14); + private static Color commentColor=new Color(20, 20, 20); + JLabel text_area; + private JLabel inviteLabel; + private static MouseAdapter ma=null; + private String label=""; + + public comments_area() { + super(); + text_area=new JLabel("") { + + @Override + public Dimension getPreferredSize() { + Dimension superPreferred=super.getPreferredSize(); + Container p=getParent(); + return new Dimension(p.getBounds().width-2*margins-scrollBarWidth, superPreferred.height); + } + }; + setViewportView(text_area); + addMouseListener(new MouseAdapter() { + + @Override + public void mousePressed(MouseEvent e) { + edit(); + } + }); + text_area.setOpaque(false); + text_area.setVerticalTextPosition(SwingConstants.TOP); + text_area.setHorizontalTextPosition(SwingConstants.LEFT); + text_area.setHorizontalAlignment(SwingConstants.LEFT); + text_area.setVerticalAlignment(SwingConstants.TOP); + text_area.setFont(commentFont); + text_area.setForeground(commentColor); + text_area.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); + + setOpaque(false); + this.getViewport().setOpaque(false); + setBorder(BorderFactory.createEmptyBorder(margins, margins, margins, margins)); + + JScrollBar vsb=getVerticalScrollBar(); + Dimension newsbsize=new Dimension(scrollBarWidth, 0); + vsb.setUI(new BasicScrollBarUI()); + vsb.setPreferredSize(newsbsize); + vsb.setUnitIncrement(16); + setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); + + + inviteLabel=new JLabel(Global.Loc("comment.emptycomment")); + inviteLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); + inviteLabel.setVerticalTextPosition(SwingConstants.CENTER); + inviteLabel.setHorizontalTextPosition(SwingConstants.CENTER); + inviteLabel.setHorizontalAlignment(SwingConstants.CENTER); + inviteLabel.setVerticalAlignment(SwingConstants.CENTER); + inviteLabel.setOpaque(false); + inviteLabel.setFont(commentFont); + inviteLabel.setForeground(commentColor); + text_area.add(inviteLabel); + setInviteLabel(); + ma=new MouseAdapter() { + + @Override + public void mousePressed(MouseEvent e) { + final Component cp=e.getComponent(); + SwingUtilities.invokeLater(new Runnable() { + + public void run() { + cp.requestFocus(); + } + }); + } + }; + } + + void init() { + Container p=getParent(); + if (p!=null) { + setBounds(0, 0, p.getBounds().width, p.getBounds().height); + inviteLabel.setBounds(0, 0, p.getBounds().width-2*margins-scrollBarWidth, p.getBounds().height-2*margins); + setLabelText(label); + } + + } + + public void setLabelText(String s) { + Container p=getParent(); + if (p!=null) { + label=s; + // I really don't know why, but it seems that the width is increased + // by 30%. E.g. ask for 500px will give a 650px div... + int pix=10*(p.getBounds().width-2*margins-scrollBarWidth)/13-1; + text_area.setText("

"); + setInviteLabel(); + } + } + + public String getLabelText() { + return label; + } + + public void setInviteLabel() { + inviteLabel.setVisible(label.equals("")); + } + + public void implementMouseAdapter() { + final ContentPane pane=pipe_tools.getContent(); + implementMouseAdapter(pane); + } + + public void implementMouseAdapter(Container comp) { + if (!(comp instanceof JLabel)) { + comp.addMouseListener(ma); + } + for (int i=0; i"); +// e.consume(); + } else if (e.getKeyCode()==KeyEvent.VK_ESCAPE) { + removeMouseAdapter(); + com.remove(jtf); + com.revalidate(); + com.repaint(); + } + } + + public void keyReleased(final KeyEvent e) { + pipe_tools.setComments(jtf.getText()); + setLabelText(jtf.getText()); + } + }); + jtf.addFocusListener(new FocusAdapter() { + + @Override + public void focusLost(final FocusEvent e) { +// setLabelText(jtf.getText()); + setViewportView(text_area); + com.remove(jtf); + com.revalidate(); + com.repaint(); + com.addMouseListener(com); + removeMouseAdapter(); + revalidate(); + validate(); + repaint(); + } + }); + setViewportView(jtf); + SwingUtilities.invokeLater(new Runnable() { + + public void run() { + jtf.requestFocus(); + } + }); + + } +} + + diff --git a/eric/GUI/window/myJMenuItem.java b/eric/GUI/window/myJMenuItem.java new file mode 100644 index 0000000..df53203 --- /dev/null +++ b/eric/GUI/window/myJMenuItem.java @@ -0,0 +1,52 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.window; + +import eric.GUI.themes; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import javax.swing.JMenuItem; +import javax.swing.Icon; +import eric.JSprogram.ScriptItem; + +/** + * + * @author erichake modified by PM Mazat + */ +public class myJMenuItem extends JMenuItem implements ActionListener { + private boolean selected; + + public void action() { + } + public myJMenuItem(String s) { + super(s); + addActionListener(this); + setFont(themes.TabMenusFont); + } + + public myJMenuItem(String s, Icon i){ + super(s, i); + addActionListener(this); + setFont(themes.TabMenusFont); + } + + public myJMenuItem(ScriptItem si, Icon i){ + super(si.getScriptName(), i); + addActionListener(this); + setFont(themes.TabMenusFont); + } + + public void actionPerformed(ActionEvent e) { + action(); + } + + @Override + public void setSelected(final boolean sel) { + selected=sel; + final int fontstyle=(selected)?1:0; + setFont(new java.awt.Font(themes.TabMenusFont.getFontName(), fontstyle, themes.TabMenusFont.getSize())); + repaint(); + } +} diff --git a/eric/GUI/window/nav_left.java b/eric/GUI/window/nav_left.java new file mode 100644 index 0000000..50142a5 --- /dev/null +++ b/eric/GUI/window/nav_left.java @@ -0,0 +1,79 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.window; + +import eric.GUI.windowComponent; +import eric.GUI.themes; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.event.MouseEvent; +import java.awt.image.FilteredImageSource; +import javax.swing.GrayFilter; +import javax.swing.ImageIcon; + +/** + * + * @author erichake + */ +public class nav_left extends windowComponent { + + private static int marginW=0; + private static int W=themes.getIcon("navleft.png").getIconWidth(); + private static int H=themes.getIcon("navleft.png").getIconHeight(); + private boolean over=false; + private boolean active=false; + private static boolean disable=false; + private static nav_left myself=null; + + @Override + public void paintComponent(Graphics g) { + Dimension d=getSize(); + if (disable) { + final GrayFilter filter=new GrayFilter(true, 40); + Image disImage=createImage(new FilteredImageSource(themes.getImage("navleft.png").getSource(), filter)); + ImageIcon myicn=new ImageIcon(disImage); + g.drawImage(myicn.getImage(), 0, 0, d.width, d.height, this); + return; + } + if (active) { + g.drawImage(themes.getImage("navleftpushed.png"), 0, 0, d.width, d.height, + this); + }else{ + g.drawImage(themes.getImage("navleft.png"), 0, 0, d.width, d.height, + this); + } + } + + public void init() { + setBounds(marginW+tab_control_panel.getMarginLeft(), + tab_control_panel.getMarginTop(), + W, + H); + } + + public nav_left() { + myself=this; + } + + public static void setDisabled(boolean b){ + disable=b; + if (myself!=null) myself.repaint(); + } + + @Override + public void mousePressed(MouseEvent e) { + active=true; + repaint(); + tab_main_panel.setNextActiveBtn(-1); + } + + @Override + public void mouseReleased(MouseEvent e) { + active=false; + repaint(); + } +} diff --git a/eric/GUI/window/nav_menu1.java b/eric/GUI/window/nav_menu1.java new file mode 100644 index 0000000..27910c0 --- /dev/null +++ b/eric/GUI/window/nav_menu1.java @@ -0,0 +1,86 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.window; + +import eric.GUI.windowComponent; +import eric.GUI.themes; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.event.MouseEvent; +import javax.swing.JPopupMenu; +import javax.swing.SwingUtilities; +import javax.swing.event.PopupMenuEvent; +import javax.swing.event.PopupMenuListener; + +/** + * + * @author erichake + */ +public class nav_menu1 extends windowComponent implements PopupMenuListener { + + private static int marginW=60; + private static int W=themes.getIcon("navmenu1.png").getIconWidth(); + private static int H=themes.getIcon("navmenu1.png").getIconHeight(); + private boolean over=false; + private boolean active=false; + private static nav_menu1 myself=null; + + @Override + public void paintComponent(Graphics g) { + Dimension d=getSize(); + if (active) { + g.drawImage(themes.getImage("navmenu1pushed.png"), 0, 0, d.width, d.height, + this); + } else { + g.drawImage(themes.getImage("navmenu1.png"), 0, 0, d.width, d.height, + this); + } + + } + + public void init() { + setBounds(marginW+tab_control_panel.getMarginLeft(), + tab_control_panel.getMarginTop(), + W, + H); + } + + public nav_menu1() { + myself=this; + } + + @Override + public void mousePressed(MouseEvent e) { + JPopupMenu popup=tab_main_panel.getTabPopup(); + popup.removePopupMenuListener(this); + active=true; + popup.addPopupMenuListener(this); + popup.show(this, (W-popup.getPreferredSize().width)/2, -2-popup.getPreferredSize().height); + repaint(); + } + + @Override + public void mouseReleased(MouseEvent e) { + } + + public void popupMenuWillBecomeVisible(PopupMenuEvent e) { + removeMouseListener(this); + } + + public void popupMenuWillBecomeInvisible(PopupMenuEvent e) { + active=false; + repaint(); + SwingUtilities.invokeLater(new Runnable() { + public void run() { + addMouseListener(myself); + } + }); + } + + public void popupMenuCanceled(PopupMenuEvent e) { + } +} + + diff --git a/eric/GUI/window/nav_menu2.java b/eric/GUI/window/nav_menu2.java new file mode 100644 index 0000000..74f9c46 --- /dev/null +++ b/eric/GUI/window/nav_menu2.java @@ -0,0 +1,85 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.window; + +import eric.GUI.windowComponent; +import eric.GUI.themes; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Image; +import java.awt.event.MouseEvent; +import javax.swing.JPopupMenu; +import javax.swing.SwingUtilities; +import javax.swing.event.PopupMenuEvent; +import javax.swing.event.PopupMenuListener; + +/** + * + * @author erichake + */ +public class nav_menu2 extends windowComponent implements PopupMenuListener{ + + private static int marginW=95; + private static int W=themes.getIcon("navmenu2.png").getIconWidth(); + private static int H=themes.getIcon("navmenu2.png").getIconHeight(); + private static Image offimage=themes.getImage("navmenu2.png"); + private static Image onimage=themes.getImage("navmenu2pushed.png"); + private boolean over=false; + private boolean active=false; + private static nav_menu2 myself=null; + + @Override + public void paintComponent(Graphics g) { + Dimension d=getSize(); + if (active) { + g.drawImage(onimage, 0, 0, d.width, d.height,this); + } else { + g.drawImage(offimage, 0, 0, d.width, d.height,this); + } + } + + public void init() { + setBounds(marginW+tab_control_panel.getMarginLeft(), + tab_control_panel.getMarginTop(), + W, + H); + } + + public nav_menu2() { + myself=this; + } + + + @Override + public void mousePressed(MouseEvent e) { + JPopupMenu popup=tab_main_panel.getCtrlPopup(); + popup.removePopupMenuListener(this); + active=true; + popup.addPopupMenuListener(this); + popup.show(this, (W-popup.getPreferredSize().width)/2, -2-popup.getPreferredSize().height); + repaint(); + } + + + + public void popupMenuWillBecomeVisible(PopupMenuEvent e) { + removeMouseListener(this); + } + + public void popupMenuWillBecomeInvisible(PopupMenuEvent e) { + active=false; + repaint(); + SwingUtilities.invokeLater(new Runnable() { + public void run() { + addMouseListener(myself); + } + }); + } + + public void popupMenuCanceled(PopupMenuEvent e) { + } +} + + diff --git a/eric/GUI/window/nav_right.java b/eric/GUI/window/nav_right.java new file mode 100644 index 0000000..cd31e83 --- /dev/null +++ b/eric/GUI/window/nav_right.java @@ -0,0 +1,81 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.window; + +import eric.GUI.windowComponent; +import eric.GUI.themes; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Image; +import java.awt.event.MouseEvent; +import java.awt.image.FilteredImageSource; +import javax.swing.GrayFilter; +import javax.swing.ImageIcon; + +/** + * + * @author erichake + */ +public class nav_right extends windowComponent { + + private static int marginW=24; + private static int W=themes.getIcon("navright.png").getIconWidth(); + private static int H=themes.getIcon("navright.png").getIconHeight(); + private boolean over=false; + private boolean active=false; + private static boolean disable=false; + private static nav_right myself=null; + + @Override + public void paintComponent(Graphics g) { + Dimension d=getSize(); + if (disable) { + final GrayFilter filter=new GrayFilter(true, 40); + Image disImage=createImage(new FilteredImageSource(themes.getImage("navright.png").getSource(), filter)); + ImageIcon myicn=new ImageIcon(disImage); + g.drawImage(myicn.getImage(), 0, 0, d.width, d.height, this); + return; + } + if (active) { + g.drawImage(themes.getImage("navrightpushed.png"), 0, 0, d.width, d.height, + this); + } else { + g.drawImage(themes.getImage("navright.png"), 0, 0, d.width, d.height, + this); + } + + } + + public void init() { + setBounds(marginW+tab_control_panel.getMarginLeft(), + tab_control_panel.getMarginTop(), + W, + H); + } + + public nav_right() { + myself=this; + } + + public static void setDisabled(boolean b) { + disable=b; + if (myself!=null) { + myself.repaint(); + } + } + + @Override + public void mousePressed(MouseEvent e) { + active=true; + repaint(); + tab_main_panel.setNextActiveBtn(1); + } + + @Override + public void mouseReleased(MouseEvent e) { + active=false; + repaint(); + } +} diff --git a/eric/GUI/window/tab_bottom.java b/eric/GUI/window/tab_bottom.java new file mode 100644 index 0000000..aea6445 --- /dev/null +++ b/eric/GUI/window/tab_bottom.java @@ -0,0 +1,65 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.window; + +import eric.GUI.palette.PaletteManager; +import eric.GUI.pipe_tools; +import eric.GUI.windowComponent; +import eric.GUI.themes; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.Graphics; +import java.awt.Point; +import javax.swing.BoxLayout; +import javax.swing.JLabel; +import javax.swing.SwingConstants; +import rene.gui.Global; + +/** + * + * @author erichake + */ +public class tab_bottom extends windowComponent { + + private Point winloc; + private static JLabel status=new JLabel(); + private int margin=10; + + public void paintComponent(Graphics g) { + Dimension d=getSize(); + g.drawImage(themes.getImage("tab_bottom.gif"), 0, 0, d.width, d.height, this); +// g.setColor(Color.black); +// g.drawRect(0, Themes.getTabTopBorderHeight(), d.width-1, d.height-1-Themes.getTabTopBorderHeight()); + super.paintComponent(g); + } + + public void init() { +// win=StaticTools.getMainWindow(this); + setBounds(themes.getVerticalBorderWidth()+themes.getLeftPanelWidth()+themes.getVerticalPanelBorderWidth(), + pipe_tools.getWindowSize().height-themes.getMainTabPanelHeight()-themes.getStatusBarHeight(), + pipe_tools.getWindowSize().width-2*themes.getVerticalBorderWidth()-themes.getLeftPanelWidth()-themes.getVerticalPanelBorderWidth()-themes.getTotalRightPanelWidth(), + themes.getStatusBarHeight()); + PaletteManager.fixsize(status, getBounds().width, getBounds().height); + } + + public tab_bottom() { + setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); + setOpaque(false); + status.setForeground(new Color(70, 70, 70)); + status.setFont(new Font(Global.GlobalFont, 0, 13)); + status.setHorizontalAlignment(JLabel.CENTER); + status.setVerticalAlignment(JLabel.CENTER); + add(status); + } + + public static void showStatus(String txt) { + status.setText(txt); + } + + public static String getStatus() { + return status.getText(); + } +} diff --git a/eric/GUI/window/tab_btn.java b/eric/GUI/window/tab_btn.java new file mode 100644 index 0000000..201a7d5 --- /dev/null +++ b/eric/GUI/window/tab_btn.java @@ -0,0 +1,279 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.GUI.window; + +import eric.GUI.pipe_tools; +import eric.GUI.windowComponent; +import eric.GUI.themes; +import eric.JZirkelCanvas; +import java.awt.Dimension; +import java.awt.Event; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.Point; +import java.awt.event.MouseEvent; +import javax.swing.JPopupMenu; +import javax.swing.SwingUtilities; +import javax.swing.event.PopupMenuEvent; +import javax.swing.event.PopupMenuListener; + +/** + * + * @author erichake + */ +public class tab_btn extends windowComponent implements Comparable, PopupMenuListener { + + private tab_canvas_panel panel; + private Point origin; + private Point current; + private Point btnloc; + private boolean active=true; + private boolean over=false; + private tab_close_btn CloseBtn; + private tab_btn_label Label; + private String Tooltip=""; + private static Image on_btn_right=themes.getImage("tab_btn_on_right_border.gif"); + private static Image on_btn_left=themes.getImage("tab_btn_on_left_border.gif"); + private static Image on_btn=themes.getImage("tab_btn_on.gif"); + private static Image off_btn_right=themes.getImage("tab_btn_off_right_border.gif"); + private static Image off_btn_left=themes.getImage("tab_btn_off_left_border.gif"); + private static Image off_btn=themes.getImage("tab_btn_off.gif"); + private static Image off_over_btn_right=themes.getImage("tab_btn_off_over_right_border.gif"); + private static Image off_over_btn_left=themes.getImage("tab_btn_off_over_left_border.gif"); + private static Image off_over_btn=themes.getImage("tab_btn_off_over.gif"); + private static Image file_icon=themes.getImage("tab_file_icon.png"); + private boolean Changed=false; + + public void paintComponent(Graphics g) { + + Dimension d=getSize(); + final Graphics2D g2=windowComponent.getGraphics2D(g); + + + + g2.drawImage(getBackgroundImage(), 0, 0, d.width, d.height, + this); + g2.drawImage(getLeftBorder(), 0, 0, themes.getTabCornerWidth(), d.height, + this); + g2.drawImage(getRightBorder(), d.width-themes.getTabCornerWidth(), 0, themes.getTabCornerWidth(), d.height, + this); + + if (!JZirkelCanvas.isWorkBook()) { + g2.drawImage(file_icon, 4, 2, this); + } +// g2.setColor(Color.darkGray); +// g2.drawLine(0, d.height-1, d.width-1, d.height-1); +// g2.drawLine(d.width-1, d.height-1, d.width-1, 0); +// if (!active) { +// g2.drawLine(d.width-1, 0, 0, 0); +// } + + } + + public tab_btn(String label, String tooltip) { + super(); + label=pipe_tools.processTabName(label); + Label=new tab_btn_label(label); + Tooltip=tooltip; + setLayout(null); + CloseBtn=new tab_close_btn(); + panel=new tab_canvas_panel(this); + add(CloseBtn); + add(Label); +// setToolTipText(tooltip); + setOpaque(true); + } + + public tab_btn(String label) { + this(label, label); + } + + public void setChanged(boolean b) { + Changed=b; + Label.setChanged(b); + repaint(); + } + + public void setActive(boolean act) { + active=act; + if (active) { + ContentPane.setCurrentPanel(panel); + } + } + + public boolean getActive() { + return active; + } + + public void setOver(boolean ov) { + over=ov; + } + + public tab_close_btn getTabCloseBtn() { + return CloseBtn; + } + + public tab_btn_label getTabLabel() { + return Label; + } + + public tab_canvas_panel getPanel() { + return panel; + } + + public void setTabName(String name, String tooltip) { + name=pipe_tools.processTabName(name); + Label.setLabelText(name); + setToolTip(tooltip); + } + + public void setToolTip(String tooltip){ + Tooltip = tooltip; + setToolTipText(Tooltip); + } + + public String getTabName() { + return Label.getLabelText(); + } + + public void editName() { + if (pipe_tools.isTabEditAccepted()) { + Label.edit(); + } + } + + public void init() { + setToolTipText(Tooltip); + getTabCloseBtn().init(); + getTabLabel().init(); + getPanel().init(); + } + + private Image getRightBorder(){ + if (active) { + return tab_btn.on_btn_right; + } + if (over) { + return tab_btn.off_over_btn_right; + } + return tab_btn.off_btn_right; + } + + private Image getLeftBorder(){ + if (active) { + return tab_btn.on_btn_left; + } + if (over) { + return tab_btn.off_over_btn_left; + } + return tab_btn.off_btn_left; + } + + + private Image getBackgroundImage() { + if (active) { + return tab_btn.on_btn; + } + if (over) { + return tab_btn.off_over_btn; + } + return tab_btn.off_btn; + } + + @Override + public Point getToolTipLocation(MouseEvent event) { + return new Point(0, getSize().height+2); + } + + @Override + public void mousePressed(MouseEvent e) { + origin=pipe_tools.getWindow().getMouseLoc(); + btnloc=getLocation(); + tab_main_panel.setActiveBtn(this); + repaint(); +// pipe_tools.onTabActivate(); + // Right-clic : + if (e.getModifiers()==Event.META_MASK) { + JPopupMenu popup=tab_main_panel.getCtrlPopup(); + popup.removePopupMenuListener(this); + popup.addPopupMenuListener(this); + popup.show(this, (getSize().width-popup.getPreferredSize().width)/2, -2-popup.getPreferredSize().height); + repaint(); + } + } + + @Override + public void mouseEntered(MouseEvent e) { + + tab_main_panel.setOverBtn(this); + repaint(); + } + + @Override + public void mouseExited(MouseEvent e) { + // Check whether the mouse cursor is still over the panel + +// if (getMousePosition(true)!=null) { +// return; +// } + over=false; + repaint(); + } + + @Override + public void mouseReleased(MouseEvent e) { + tab_main_panel.reorderBTNS(null); + } + + @Override + public void mouseDragged(MouseEvent e) { + getParent().setComponentZOrder(this, 0); + current=pipe_tools.getWindow().getMouseLoc(); + if (current==null) { + return; + } + setLocation(btnloc.x+current.x-origin.x, btnloc.y); + tab_main_panel.reorderBTNS(this); + } + + @Override + public void mouseMoved(MouseEvent e) { + tab_main_panel.setOverBtn(this); + repaint(); + + } + + public int compareTo(tab_btn o) { + int middle=(2*getBounds().x+getBounds().width)/2; + if ((middle>o.getBounds().x)) { + return 1; + + } + if ((middle0)) { + askedOffset=0; + } else { + if ((notches>0)&&(Rect_width*BTNS.size()+askedOffset<=getSize().width)) { + askedOffset=getSize().width-Rect_width*(BTNS.size()); + } + } + offset=askedOffset; + deOverAll(); + initBTNS(null); + } + /***************/ + /* STATIC PART */ + /***************/ + private static int Rect_width=150; + private static int offset=0; + private static int leftmargin=20; + private static tab_main_panel me=null; + private static ArrayList BTNS=new ArrayList(); + private static JPopupMenu tab_popup=null, ctrl_popup=null; + + public static tab_main_panel getme() { + return me; + } + + public static void removeAllBtns(ContentPane content) { + if (content!=null) { + for (int i=0; i1) { + int i=getActiveBtnPos(); + removeBtn(btn); + if (i1) { + me.remove(btn); + BTNS.remove(btn); + initBTNS(null); + } + } + + public static void addBtnAndSelect(String label) { + tab_btn btn=new tab_btn(label); + int i=getActiveBtnPos()+1; + if (i==BTNS.size()) { + me.add(btn); + BTNS.add(btn); + } else { + me.add(btn, i); + BTNS.add(i, btn); + } + initBTNS(null); + setActiveBtn(btn); + showActiveBtn(); + btn.editName(); + } + + public static tab_btn addBtn(String name) { + tab_btn btn=new tab_btn(name, name); + me.add(btn); + BTNS.add(btn); + return btn; + } + + public static void createTabAndCanvas(String label, String tooltip) { + tab_btn btn=new tab_btn(label, tooltip); + me.add(btn); + BTNS.add(btn); + setActiveBtn(btn); + showActiveBtn(); + } + + public static void createTabAndCanvas(String label) { + createTabAndCanvas(label, label); + } + + // j is the offset (1 for the next to the right, -1 to the left) + public static void setNextActiveBtn(int j) { + int i=getActiveBtnPos(); + try { + setActiveBtn(BTNS.get(i+j)); + showActiveBtn(); + } catch (Exception e) { + } + initNAVbtns(); + } + + public static void setCurrentTabName(String name, String tooltip) { + getActiveBtn().setTabName(name, tooltip); + } + + public static void setActiveBtn(int k) { + setActiveBtn(BTNS.get(k)); + } + + public static void setActiveBtn(final tab_btn btn) { + JZirkelCanvas.stopAllScripts(); + btn.setActive(true); + for (int i=0; i0) { + return BTNS.get(BTNS.size()-1); + } else { + return null; + } + } + + public static void currentTabHaveChanged(boolean b) { + getActiveBtn().setChanged(b); + } + + public static void allTabsHaveChanged(boolean b) { + for (int i=0; ime.getSize().width); + if ((btn.getBounds().x+btn.getSize().width>me.getSize().width)) { + offset-=btn.getBounds().x+btn.getSize().width-me.getSize().width; + } else if (btn.getBounds().x<0) { + offset+=-btn.getBounds().x; + } + initBTNS(null); + } + + public static void setOverBtn(tab_btn btn) { + btn.setOver(true); + for (int i=0; ime.getSize().width); + boolean b2=(btn.getBounds().x. + + */ + + + package eric; + +import java.lang.reflect.Method; + +public class JBrowserLauncher { + + final static String[] hex = { "%00", "%01", "%02", "%03", "%04", "%05", + "%06", "%07", "%08", "%09", "%0a", "%0b", "%0c", "%0d", "%0e", + "%0f", "%10", "%11", "%12", "%13", "%14", "%15", "%16", "%17", + "%18", "%19", "%1a", "%1b", "%1c", "%1d", "%1e", "%1f", "%20", + "%21", "%22", "%23", "%24", "%25", "%26", "%27", "%28", "%29", + "%2a", "%2b", "%2c", "%2d", "%2e", "%2f", "%30", "%31", "%32", + "%33", "%34", "%35", "%36", "%37", "%38", "%39", "%3a", "%3b", + "%3c", "%3d", "%3e", "%3f", "%40", "%41", "%42", "%43", "%44", + "%45", "%46", "%47", "%48", "%49", "%4a", "%4b", "%4c", "%4d", + "%4e", "%4f", "%50", "%51", "%52", "%53", "%54", "%55", "%56", + "%57", "%58", "%59", "%5a", "%5b", "%5c", "%5d", "%5e", "%5f", + "%60", "%61", "%62", "%63", "%64", "%65", "%66", "%67", "%68", + "%69", "%6a", "%6b", "%6c", "%6d", "%6e", "%6f", "%70", "%71", + "%72", "%73", "%74", "%75", "%76", "%77", "%78", "%79", "%7a", + "%7b", "%7c", "%7d", "%7e", "%7f", "%80", "%81", "%82", "%83", + "%84", "%85", "%86", "%87", "%88", "%89", "%8a", "%8b", "%8c", + "%8d", "%8e", "%8f", "%90", "%91", "%92", "%93", "%94", "%95", + "%96", "%97", "%98", "%99", "%9a", "%9b", "%9c", "%9d", "%9e", + "%9f", "%a0", "%a1", "%a2", "%a3", "%a4", "%a5", "%a6", "%a7", + "%a8", "%a9", "%aa", "%ab", "%ac", "%ad", "%ae", "%af", "%b0", + "%b1", "%b2", "%b3", "%b4", "%b5", "%b6", "%b7", "%b8", "%b9", + "%ba", "%bb", "%bc", "%bd", "%be", "%bf", "%c0", "%c1", "%c2", + "%c3", "%c4", "%c5", "%c6", "%c7", "%c8", "%c9", "%ca", "%cb", + "%cc", "%cd", "%ce", "%cf", "%d0", "%d1", "%d2", "%d3", "%d4", + "%d5", "%d6", "%d7", "%d8", "%d9", "%da", "%db", "%dc", "%dd", + "%de", "%df", "%e0", "%e1", "%e2", "%e3", "%e4", "%e5", "%e6", + "%e7", "%e8", "%e9", "%ea", "%eb", "%ec", "%ed", "%ee", "%ef", + "%f0", "%f1", "%f2", "%f3", "%f4", "%f5", "%f6", "%f7", "%f8", + "%f9", "%fa", "%fb", "%fc", "%fd", "%fe", "%ff" }; + + public static String encode(final String s) { + final StringBuffer sbuf = new StringBuffer(); + final int len = s.length(); + for (int i = 0; i < len; i++) { + final int ch = s.charAt(i); + if ('A' <= ch && ch <= 'Z') { // 'A'..'Z' + sbuf.append((char) ch); + } else if ('a' <= ch && ch <= 'z') { // 'a'..'z' + sbuf.append((char) ch); + } else if ('0' <= ch && ch <= '9') { // '0'..'9' + sbuf.append((char) ch); + } else if (ch == '-' + || ch == '_' // unreserved + || ch == '.' || ch == '!' || ch == '~' || ch == '*' + || ch == '\'' || ch == '(' || ch == ')' || ch == '/' + || ch == ':' || ch == '\\') { + sbuf.append((char) ch); + } else if (ch <= 0x007f) { // other ASCII + sbuf.append(hex[ch]); + } else if (ch <= 0x07FF) { // non-ASCII <= 0x7FF + sbuf.append(hex[0xc0 | (ch >> 6)]); + sbuf.append(hex[0x80 | (ch & 0x3F)]); + } else { // 0x7FF < ch <= 0xFFFF + sbuf.append(hex[0xe0 | (ch >> 12)]); + sbuf.append(hex[0x80 | ((ch >> 6) & 0x3F)]); + sbuf.append(hex[0x80 | (ch & 0x3F)]); + } + } + return sbuf.toString(); + } + + public static void openURL(String url) { + try { + if (OS.isMac()) { + final Class fileMgr = Class + .forName("com.apple.eio.FileManager"); + final Method openURL = fileMgr.getDeclaredMethod("openURL", + new Class[] { String.class }); + if (!(url.startsWith("http://"))) + url = "file://" + encode(url); + openURL.invoke(null, new Object[] { url }); + } else if (OS.isWindows()) + Runtime.getRuntime().exec( + "rundll32 url.dll,FileProtocolHandler " + url); + else { // assume Unix or Linux + final String[] browsers = { "firefox", "opera", "konqueror", + "epiphany", "mozilla", "netscape" }; + String browser = null; + for (int count = 0; count < browsers.length && browser == null; count++) + if (Runtime.getRuntime().exec( + new String[] { "which", browsers[count] }) + .waitFor() == 0) + browser = browsers[count]; + if (browser == null) + throw new Exception("Could not find web browser"); + else + Runtime.getRuntime().exec(new String[] { browser, url }); + } + } catch (final Exception e) { + } + } + +} \ No newline at end of file diff --git a/eric/JCharacterPalette.java b/eric/JCharacterPalette.java new file mode 100644 index 0000000..07ec3e1 --- /dev/null +++ b/eric/JCharacterPalette.java @@ -0,0 +1,361 @@ +/* + +Copyright 2006 Eric Hakenholz + +This file is part of C.a.R. software. + +C.a.R. is a free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 3 of the License. + +C.a.R. is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + + */ +package eric; + +import eric.GUI.palette.PaletteManager; +import java.awt.AlphaComposite; +import java.awt.Color; +import java.awt.Graphics2D; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.util.ArrayList; + +import javax.swing.BorderFactory; +import javax.swing.BoxLayout; +import javax.swing.JButton; +import javax.swing.JDialog; +import eric.JEricPanel; +import javax.swing.JSeparator; +import javax.swing.SwingConstants; + +import rene.gui.Global; + +/** + * + * @author erichake + */ +class JCharacterPalette extends JDialog implements MouseListener { + + /** + * + */ + + static int GENERICCODE=10; + JEricPanel Content, TabZone, ButtonZone; + JButton LBL; + JZirkelCanvas JZF; + int Linemax=10; + int Btnsize=18; + int Tabbtnsize=30; + + public JCharacterPalette(final JZirkelCanvas jzf, final JButton lbl) { + // super(jzf.JPM.MainPalette,true); + super(); + JZF=jzf; + + LBL=lbl; + JTabBtn.Btns.clear(); + setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE); + setTitle("Caracter Palette"); + this.setUndecorated(true); + Content=new JContent(Tabbtnsize); + // Content.setLayout(new BoxLayout(Content,BoxLayout.X_AXIS)); + // Content.setBackground(new Color(50,50,50)); + // Content.setBorder(BorderFactory.createLineBorder(new + // Color(0,0,0),1)); + this.setContentPane(Content); + this.setAlwaysOnTop(true); + this.toFront(); + ButtonZone=getnewcol(); + TabZone=getnewcol(); + TabZone.setOpaque(false); + initJTab(); + initJButtons(); + Content.add(TabZone); + Content.add(ButtonZone); + this.addMouseListener(new java.awt.event.MouseAdapter() { + + @Override + public void mousePressed(final java.awt.event.MouseEvent evt) { + JZF.getPointLabel().setEnabledJLabel(true); + setVisible(false); + dispose(); + } + }); + this.addWindowListener(new java.awt.event.WindowAdapter() { + + @Override + public void windowDeactivated(final java.awt.event.WindowEvent evt) { + JZF.getPointLabel().setEnabledJLabel(true); + setVisible(false); + dispose(); + } + }); + + this.pack(); + // JPointLabel.fixsize(Content,Content.getSize().width+1,Content.getSize().height+1); + // JPointLabel.fixsize(titles,this.getSize().width,20); + // this.pack(); + final int x=LBL.getLocationOnScreen().x+LBL.getSize().width-this.getSize().width; + final int y=LBL.getLocationOnScreen().y+LBL.getSize().height; + this.setLocation(x, y); + + JZF.getPointLabel().setEnabledJLabel(false); + + this.setVisible(true); + + } + + private JEricPanel initJTab() { + JEricPanel col=null; + JButton mybtn=null; + + col=new JEricPanel(); + col.setLayout(new BoxLayout(col, BoxLayout.Y_AXIS)); + col.setAlignmentY(0f); + mybtn=new JTabBtn(this, 0, "D"); + JPointName.fixsize(mybtn, Tabbtnsize, Tabbtnsize); + col.add(mybtn); + mybtn=new JTabBtn(this, 1, "d"); + JPointName.fixsize(mybtn, Tabbtnsize, Tabbtnsize); + col.add(mybtn); + mybtn=new JTabBtn(this, 2, "\u0394"); + JPointName.fixsize(mybtn, Tabbtnsize, Tabbtnsize); + col.add(mybtn); + mybtn=new JTabBtn(this, 3, "\u03B4"); + JPointName.fixsize(mybtn, Tabbtnsize, Tabbtnsize); + col.add(mybtn); + mybtn=new JTabBtn(this, GENERICCODE, "P1"); + JPointName.fixsize(mybtn, Tabbtnsize, Tabbtnsize); + col.add(mybtn); + col.setOpaque(false); + JTabBtn.setSelectedJTitle(JZF.getPointLabel().getCurrentLetterSetCode()); + TabZone.add(col); + // JPointLabel.fixsize(TabZone,Tabwidth,50); + return col; + } + + private JButton getJButton(final String s) { + final JButton mybtn=new JButton(s); + mybtn.setBorder(BorderFactory.createEmptyBorder()); + mybtn.setBorderPainted(false); + mybtn.setFocusPainted(false); + mybtn.setFocusable(false); + mybtn.setBackground(new Color(228, 222, 255)); + mybtn.setOpaque(false); + mybtn.setContentAreaFilled(false); + if (JZF.getPointLabel().isLetterAccepted(mybtn.getText())) { + mybtn.addMouseListener(this); + } else { + mybtn.setEnabled(false); + mybtn.addMouseListener(new java.awt.event.MouseAdapter() { + + @Override + public void mousePressed(final java.awt.event.MouseEvent evt) { + JZF.getPointLabel().setEnabledJLabel(true); + setVisible(false); + dispose(); + } + }); + } + mybtn.setFont(new java.awt.Font(Global.GlobalFont, 1, 11)); + mybtn.setForeground(new Color(20, 20, 20)); + JPointName.fixsize(mybtn, 18, 18); + return mybtn; + } + + private static JEricPanel getnewline() { + final JEricPanel line=new JEricPanel(); + line.setLayout(new BoxLayout(line, BoxLayout.X_AXIS)); + line.setAlignmentX(0f); + line.setOpaque(false); + return line; + } + + private static JEricPanel getnewcol() { + final JEricPanel col=new JEricPanel(); + col.setLayout(new BoxLayout(col, BoxLayout.Y_AXIS)); + col.setAlignmentY(0f); + col.setOpaque(true); + col.setBackground(new Color(250, 250, 250)); + return col; + } + + void initJButtons() { + JEricPanel line=null; + + final String letters=JZF.getPointLabel().getCurrentLetterSet(); + ButtonZone.removeAll(); + for (int i=0; i(); + int SetCode=0; + JCharacterPalette JCP; + + public JTabBtn(final JCharacterPalette jcp, final int code, final String s) { + SetCode=code; + JCP=jcp; + setBorder(BorderFactory.createEmptyBorder()); + setBorderPainted(false); + setFocusPainted(false); + setFocusable(false); + // setBackground(new Color(240,240,240)); + setOpaque(false); + setContentAreaFilled(false); + setHorizontalAlignment(SwingConstants.CENTER); + setFont(new java.awt.Font(Global.GlobalFont, 1, 13)); + addMouseListener(new java.awt.event.MouseAdapter() { + + @Override + public void mouseReleased(final java.awt.event.MouseEvent evt) { + if (SetCode==JCharacterPalette.GENERICCODE) { + Global.setParameter("options.point.shownames", false); + JCP.JZF.getPointLabel().getBetterName(null, true); + JCP.dispose(); + return; + } + JCP.JZF.getPointLabel().setLetterSet(SetCode); + JCP.initJButtons(); + disableAllJTitles(); + setEnabled(true); + JCP.pack(); + JCP.repaint(); + } + }); + setText(s); + Btns.add(this); + } + + static void disableAllJTitles() { + for (int i=0; i. + + */ +package eric; + +import eric.GUI.palette.JIcon; +import java.awt.AlphaComposite; +import java.awt.BasicStroke; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics2D; +import java.awt.RenderingHints; +import java.awt.Stroke; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseMotionAdapter; +import java.util.Vector; + +import javax.swing.BorderFactory; +import javax.swing.JButton; +import javax.swing.JComponent; +import eric.JEricPanel; + +import net.java.dev.colorchooser.ColorChooser; +import net.java.dev.colorchooser.Palette; + +/** + * + * @author erichake + */ +public class JColorPicker extends JButton { + + /** + * + */ + + ColorChooser CC=null; + int D, IN, STRK; + public static Color DefaultC=Color.GRAY; + Color CurrentC=DefaultC; + boolean isSelected=false, isEntered=false, isDisabled=false; + Vector group; + int[] x={0, 10, 0}; + int[] y={0, 10, 10}; + + @Override + public void paintComponent(final java.awt.Graphics g) { + final Graphics2D g2=(Graphics2D) g; + g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, + RenderingHints.VALUE_ANTIALIAS_ON); + g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, + RenderingHints.VALUE_TEXT_ANTIALIAS_ON); + g2.setRenderingHint(RenderingHints.KEY_RENDERING, + RenderingHints.VALUE_RENDER_QUALITY); + g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, + RenderingHints.VALUE_INTERPOLATION_BICUBIC); + g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, + RenderingHints.VALUE_STROKE_PURE); + + AlphaComposite ac; + if (isDisabled) { + ac=AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.2f); + g2.setComposite(ac); + g2.setColor(new Color(100, 100, 100)); + g2.fillRect(IN, IN, D-2*IN, D-2*IN); + return; + } + if (isSelected) { + ac=AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.2f); + g2.setComposite(ac); + g2.setColor(new Color(0, 0, 100)); + g2.fillRect(0, 0, D, D); + } + if (isEntered) { + ac=AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.1f); + g2.setComposite(ac); + g2.setColor(new Color(0, 0, 80)); + final Stroke stroke=new BasicStroke(3f); + g2.setStroke(stroke); + g2.drawRect(2, 2, D-4, D-4); + } + g2.setColor(CurrentC); + g2.setComposite(AlphaComposite.Src); + g2.setStroke(new BasicStroke(STRK, BasicStroke.CAP_SQUARE, 0)); + g2.clearRect(IN, IN, D-2*IN, D-2*IN); + ac=AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.4f); + g2.setComposite(ac); + g2.fillRect(IN, IN, D-2*IN, D-2*IN); + g2.setComposite(AlphaComposite.Src); + g2.drawRect(IN, IN, D-2*IN, D-2*IN); + final int sze=6; + x[0]=D-sze; + y[0]=D; + x[1]=D; + y[1]=D-sze; + x[2]=D; + y[2]=D; + g2.setComposite(AlphaComposite.SrcOver); + g2.setColor(new Color(50, 50, 50)); + g2.fillPolygon(x, y, 3); + } + + + public JColorPicker(final int d, final int inset, final int stroke, + final Vector mygroup) { + super(); + group=mygroup; + if (group!=null) { + group.add(this); + } + D=d; + IN=inset; + STRK=stroke; + setLayout(new javax.swing.BoxLayout(this, javax.swing.BoxLayout.X_AXIS)); + fixsize(this, d, d); + setBorder(BorderFactory.createEmptyBorder()); + setContentAreaFilled(false); + setFocusable(false); + CC=new ColorChooser() { + + /** + * + */ + + + @Override + public void paintComponent(final java.awt.Graphics g) { + } + }; + CC.setBorder(BorderFactory.createEmptyBorder()); + CC.addActionListener(new ActionListener() { + + public void actionPerformed(final ActionEvent arg0) { + final Color mc=CC.getColor(); + CurrentC=new Color(mc.getRed(), mc.getGreen(), mc.getBlue()); + doChange(); + } + }); + CC.addMouseMotionListener(new MouseMotionAdapter() { + + @Override + public void mouseDragged(final MouseEvent e) { + final Color mc=CC.getTransientColor(); + if (mc!=null) { + CurrentC=new Color(mc.getRed(), mc.getGreen(), mc.getBlue()); + doChange(); + } + } + }); + CC.addMouseListener(new MouseAdapter() { + + @Override + public void mouseReleased(final MouseEvent arg0) { + } + + @Override + public void mousePressed(final MouseEvent arg0) { + Select(); + afterSelect(); + } + + @Override + public void mouseEntered(final MouseEvent arg0) { + setPalettes(); + isEntered=true; + repaint(); + } + + @Override + public void mouseExited(final MouseEvent arg0) { + isEntered=false; + repaint(); + } + }); + CC.setToolTipText(""); + this.add(CC); + } + + public void setDisabled(final boolean b) { + isDisabled=b; + if (b) { + this.remove(CC); + } else { + this.add(CC); + } + } + + @Override + public String getName() { + return "scolor"; + } + + public void setPalettes() { + } + + public void setUsedColors(final Vector V) { + Color[] cols; + String[] strs; + if (V.size()==0) { + cols=new Color[1]; + strs=new String[1]; + cols[0]=Color.WHITE; + strs[0]=""; + + } else { + cols=new Color[V.size()]; + strs=new String[V.size()]; + + for (int i=0; i. + + */ + + + package eric; + +import java.awt.Color; + +/** + * + * @author erichake + */ +public class JColors { + public Color C; + public String S; + + public JColors(final Color c, final String s) { + C = c; + S = s; + } +} diff --git a/eric/JEricPanel.java b/eric/JEricPanel.java new file mode 100644 index 0000000..0d1dcfa --- /dev/null +++ b/eric/JEricPanel.java @@ -0,0 +1,25 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package eric; + +import java.awt.LayoutManager; + + + +/** + * + * @author erichake + */ +public class JEricPanel extends javax.swing.JPanel{ + + public JEricPanel(LayoutManager lm){ + super(lm); + } + public JEricPanel(){ + super(); + JLogoWindow.progress("JPanel"); + } +} diff --git a/eric/JFileFilter.java b/eric/JFileFilter.java new file mode 100644 index 0000000..eaec66b --- /dev/null +++ b/eric/JFileFilter.java @@ -0,0 +1,62 @@ +/* + +Copyright 2006 Eric Hakenholz + +This file is part of C.a.R. software. + + C.a.R. is a free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 3 of the License. + + C.a.R. is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + */ + + + package eric; + +import java.io.File; + +import javax.swing.filechooser.FileFilter; + +public class JFileFilter extends FileFilter { + // Description et extension acceptée par le filtre + public String description; + public String[] extensions; + + // Constructeur à partir de la description et de l'extension acceptée + public JFileFilter(final String description, final String ext) { + if (description == null || ext == null) { + throw new NullPointerException( + "La description (ou extension) ne peut être null."); + } + this.description = description; + this.extensions = ext.split(","); + + } + + // Implémentation de FileFilter + @Override + public boolean accept(final File file) { + if (file.isDirectory()) { + return true; + } + final String nomFichier = file.getName().toLowerCase(); + for (int i=0;i. + + */ +package eric; + +import eric.GUI.palette.PaletteManager; +import eric.GUI.pipe_tools; +import eric.GUI.themes; +import eric.GUI.window.LeftPanel; +import eric.GUI.window.Open_left_panel_btn; +import eric.GUI.window.Open_middle_panel_btn; +import eric.GUI.window.Open_right_panel_btn; +import eric.GUI.window.RightPanel; +import eric.JSprogram.ScriptItem; +import eric.JSprogram.ScriptPanel; +import eric.bar.JPropertiesBar; +import eric.macros.CreateMacroDialog; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.RenderingHints; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.InputEvent; +import java.awt.event.KeyEvent; +import java.net.URL; +import javax.swing.AbstractAction; +import javax.swing.BorderFactory; +import javax.swing.BoxLayout; +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JComponent; +import javax.swing.JLabel; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JOptionPane; +import javax.swing.JPopupMenu; +import javax.swing.KeyStroke; +import javax.swing.event.MenuEvent; +import javax.swing.event.MenuListener; +import rene.dialogs.Question; +import rene.gui.Global; +import rene.zirkel.ZirkelCanvas; +import rene.zirkel.ZirkelFrame; +import rene.zirkel.tools.JSmacroTool; + +public class JGeneralMenuBar extends JEricPanel { + + private static final int MenuTextSize = 12; + private static JGeneralMenuBar me; + myJMenuBar menubar = new myJMenuBar(); + private myJMenu MacrosMenu, ObjectsMenu, JSMenu; + JButton historybutton; + myJMenuItem hiddenitem, griditem, restrictpaletteitem, editpaletteitem, + macrositem, historyitem, helpitem, propertiesitem, smallitem, + mediumitem, largeitem, definejobitem, commentitem, leftpanelitem, paletteitem; + private static pm.Server.ServerControlPanel scp = null; + private pm.Client.ClientNetworkTools cnt = null; + + @Override + public void paintComponent(final java.awt.Graphics g) { + // super.paintComponent(g); + final java.awt.Dimension d = this.getSize(); + g.drawImage(themes.getImage("menubar.gif"), 0, 0, d.width, d.height, + this); + } + + public JGeneralMenuBar() { + me = this; + this.setLayout(new javax.swing.BoxLayout(this, + javax.swing.BoxLayout.X_AXIS)); + MacrosMenu = new myJMenu(Loc("macros")); + ObjectsMenu = new myJMenu(Global.Loc("palette.construction")); + JSMenu = new myJMenu(Loc("js")); + JSMenu.addMenuListener(new MenuListener() { + + @Override + public void menuSelected(MenuEvent e) { + InitJSMenu(); + } + + @Override + public void menuDeselected(MenuEvent e) { + } + + @Override + public void menuCanceled(MenuEvent e) { + } + }); + + init(); + InitObjectsMenu(); + } + + public void paintImmediately() { + paintImmediately(0, 0, getWidth(), getHeight()); + } + + class myJMenuBar extends JMenuBar { + + @Override + public void paintComponents(final Graphics g) { + } + + myJMenuBar() { + super(); + setUI(null); + } + + void addMenu(final JMenu mymen) { + if (mymen.getItemCount() > 0) { + this.add(mymen); + } + } + } + + class myJMenu extends JMenu { + + @Override + public void paintComponents(final Graphics g) { + } + + myJMenu(final String menuname) { + this.setText(menuname); + this.setFont(new java.awt.Font(Global.GlobalFont, 0, 12)); + this.setForeground(new Color(40, 40, 40)); + this.setOpaque(false); + } + + myJMenu(final String menuname, final boolean isSubmenu) { + this(menuname); + if (isSubmenu) { + setOpaque(true); + setIcon(new myImageIcon(getClass().getResource( + "/eric/GUI/icons/palette/null.png"), null)); + } + } + + // Constructor for the Objects submenus : + myJMenu(final String menuname, final int icnw) { + this(menuname); + setOpaque(true); + final myImageIcon myicn = new myImageIcon(getClass().getResource( + "/eric/GUI/icons/palette/null.png"), null); + myicn.setIcnMargin(0); + myicn.setIconWidth(icnw); + setIcon(myicn); + } + + void addSep() { + // if (this.getItemCount()>0) this.addSeparator(); + + this.add(new mySeparator()); + } + + void addI(final String mnu, final String icn, final int a1, + final int a2, final myJMenuItem item) { + item.setNames(Loc(mnu), icn); + if (a1 != 0) { + item.setAccelerator(KeyStroke.getKeyStroke(a1, a2)); + pipe_tools.getWindow().getRootPane().getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(a1, a2), mnu); + pipe_tools.getWindow().getRootPane().getActionMap().put(mnu, new AbstractAction() { + + @Override + public void actionPerformed(final ActionEvent arg0) { + item.action(); + } + }); + } + this.add(item); + + } + + void addI(final String mnu, final String icn, final int a1, + final int a2, final boolean sel, final myJMenuItem item) { + item.setNames(Loc(mnu), icn); + item.setSelected(sel); + if (a1 != 0) { + item.setAccelerator(KeyStroke.getKeyStroke(a1, a2)); + pipe_tools.getWindow().getRootPane().getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(a1, a2), mnu); + pipe_tools.getWindow().getRootPane().getActionMap().put(mnu, new AbstractAction() { + + @Override + public void actionPerformed(final ActionEvent arg0) { + item.action(); + } + }); + } + this.add(item); + + } + + // only for objects submenus : + void addI(final String icn, final myJMenuItem item) { + final String mnuName = PaletteManager.ToolTip(icn); + item.setNames(mnuName, icn); + item.setText("" + item.getText().replaceAll("\\+", "
") + ""); + if (!(item.myimage == null)) { + item.myimage.setIconWidth(28); + item.myimage.setIconHeight(28); + } + this.add(item); + } + + // only for language submenu : + void addI(final String lang, final String country, + final myJMenuItem item) { + final String suffix = (country.equals("")) ? lang : lang + "_" + country; + final String icn = "lg_" + suffix; + final boolean good = Global.isLanguage(lang, country); + if ((good) && (!(icn.equals("")))) { + this.setIcon(new ImageIcon(getClass().getResource( + "/eric/GUI/icons/palette/" + icn + ".png"))); + } + addI("language." + suffix, icn, 0, 0, item); + item.setEnabled(!good); + } + + class mySeparator extends JEricPanel { + + @Override + public void paintComponent(final java.awt.Graphics g) { + super.paintComponent(g); + + final java.awt.Dimension d = this.getSize(); + g.drawImage(themes.getImage("sep.png"), 2, 0, d.width - 4, 12, + this); + } + + mySeparator() { + this.setOpaque(false); + } + } + } + + class mySimpleJMenuItem extends JMenuItem { + + int ID = 0; + + mySimpleJMenuItem(final String name, final int i) { + super(name); + ID = i; + this.setOpaque(true); + this.setFont(new java.awt.Font(Global.GlobalFont, 0, MenuTextSize)); + this.addActionListener(new ActionListener() { + + @Override + public void actionPerformed(final ActionEvent event) { + action(); + } + }); + } + + void action() { + } + } + + public class myJMenuItem extends JMenuItem { + + String ICname; + boolean selected = false; + myImageIcon myimage = null; + + myJMenuItem() { + this.setOpaque(true); + this.setFont(new java.awt.Font(Global.GlobalFont, 0, MenuTextSize)); + this.addActionListener(new ActionListener() { + + @Override + public void actionPerformed(final ActionEvent event) { + ZirkelCanvas ZC = JZirkelCanvas.getCurrentZC(); + if (ZC != null && ZC.getTool() instanceof JSmacroTool) { + ((JSmacroTool) ZC.getTool()).invalidate(ZC); + } + action(); + } + }); + this.setIcon(themes.getIcon("null.png")); + // this.setIconTextGap(0); + } + + myJMenuItem(final String itemname, final String iconname) { + this(); + setNames(itemname, iconname); + } + + @Override + public void setSelected(final boolean sel) { + selected = sel; + final int fontstyle = (selected) ? 1 : 0; + this.setFont(new java.awt.Font(Global.GlobalFont, fontstyle, MenuTextSize)); + } + + @Override + public boolean isSelected() { + return selected; + } + + void setNames(final String itemname, final String iconname) { + ICname = iconname; + setText(itemname); + setIcn(iconname); + // setPreferredSize(new Dimension(getPreferredSize().width+50,22)); + } + + void setIcn(String iconname) { + if (iconname.equals("")) { + iconname = "null"; + } + URL myurl = getClass().getResource( + "/eric/GUI/icons/palette/" + iconname + ".png"); + if (myurl == null) { + myurl = getClass().getResource( + "/eric/GUI/icons/palette/" + iconname + ".gif"); + } + if (myurl == null) { + myurl = getClass().getResource( + "/eric/GUI/icons/jswindow/" + iconname + ".png"); + } + myimage = new myImageIcon(myurl, this); + + setIcon(myimage); + } + + void action() { + PaletteManager.ClicOn(ICname); + } + } + + class myImageIcon extends ImageIcon { + + int IcnHeight = 22; + int IcnWidth = 24; + int IcnMargin = 6; + myJMenuItem JM; + + @Override + public void paintIcon(final Component c, final Graphics g, final int x, + final int y) { + final Graphics2D g2 = (Graphics2D) g; + + g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, + RenderingHints.VALUE_ANTIALIAS_ON); + g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, + RenderingHints.VALUE_TEXT_ANTIALIAS_ON); + g2.setRenderingHint(RenderingHints.KEY_RENDERING, + RenderingHints.VALUE_RENDER_QUALITY); + g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, + RenderingHints.VALUE_INTERPOLATION_BICUBIC); + g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, + RenderingHints.VALUE_STROKE_PURE); + + if ((!(JM == null)) && (JM.isSelected())) { + final ImageIcon mysel = new ImageIcon(getClass().getResource( + "/eric/GUI/icons/palette/selmark.png")); + g2.drawImage(mysel.getImage(), 3, 0, 8, IcnWidth, JM); + } + g2.drawImage(getImage(), IcnMargin, 0, IcnWidth, IcnWidth, JM); + } + + public void setIcnMargin(final int i) { + IcnMargin = i; + } + + public void setIconHeight(final int i) { + IcnHeight = i; + } + + public void setIconWidth(final int i) { + IcnWidth = i; + } + + @Override + public int getIconHeight() { + return IcnHeight; + } + + @Override + public int getIconWidth() { + return IcnWidth; + } + + myImageIcon(final URL myurl, final myJMenuItem jm) { + super(myurl); + JM = jm; + } + } + + private String Loc(final String s) { + String loc = Global.Loc("menu." + s); + if (loc == null) { + loc = Global.Loc(s); + } + if (loc == null) { + loc = s; + } + return loc; + } + + public void InitMacrosMenu() { + if (MacrosMenu != null) { + MacrosMenu.removeAll(); + MacrosMenu.addI("palette.info.newmacro", "newmacro", 0, 0, new myJMenuItem() { + + @Override + public void action() { + new CreateMacroDialog(JZirkelCanvas.getNewMacroPanel()); + JZirkelCanvas.ActualiseMacroPanel(); + } + }); + MacrosMenu.addSep(); + } + } + + public static void s_InitMacrosMenu() { + if (me != null) { + me.InitMacrosMenu(); + } + } + + public static void addMacrosMenu(JMenuItem item) { + if ((me != null) && (me.MacrosMenu != null)) { + me.MacrosMenu.add(item); + } + } + + public static void s_InitJSMenu() { + if (me != null) { + me.InitJSMenu(); + } + } + + public void InitJSMenu() { + JSMenu.removeAll(); + final ZirkelCanvas ZC = JZirkelCanvas.getCurrentZC(); + if (ZC == null) { + return; + } + final ScriptPanel panel = ZC.getScriptsPanel(); + if (panel == null) { + return; + } + + myJMenuItem item = new myJMenuItem() { + + @Override + void action() { + panel.onlyRemoveScriptsManagerPanel(); + panel.Restore(); + } + }; + JSMenu.addI("JSmenu.cancel", "", 0, 0, item); + item.setEnabled(panel.isBackup()); + item.setIcon(themes.resizeExistingIcon("/eric/GUI/icons/jswindow/restore.png", 16, 16)); + + JSMenu.addSep(); + + JSMenu.addI("js.newscriptinconstruction", "", 0, 0, item = new myJMenuItem() { + + @Override + void action() { + panel.newScript(); + } + }); + + + JSMenu.addSep(); + + for (final ScriptItem myscriptitem : panel.getScripts()) { + item = new myJMenuItem() { + + @Override + public void action() { + panel.onlyRemoveScriptsManagerPanel(); + myscriptitem.runScript(); + } + }; + item.setEnabled(!myscriptitem.isRunning()); + JSMenu.addI(myscriptitem.getScriptName(), "", 0, 0, item); + //item.myimage.setIconWidth(20); + //item.myimage.setIconHeight(20); + item.setIcon(themes.resizeExistingIcon("/eric/GUI/icons/jswindow/run.png", 16, 21)); + } + + + if (panel.getScripts().size() > 0) { + JSMenu.addSep(); + } + + JSMenu.addI("JSmenu.killall", "", 0, 0, item = new myJMenuItem() { + + @Override + void action() { + ZC.killAllScripts(); + } + }); + item.setEnabled(ZC.isThereAnyScriptRunning()); + + JSMenu.addI("JSmenu.stopall", "", 0, 0, item = new myJMenuItem() { + + @Override + void action() { + //panel.stopAllScripts(); + ZC.stopAllScripts(); + } + }); + item.setEnabled(ZC.isThereAnyScriptRunning() && !ZC.isThereAnyStoppedScripts()); + + JSMenu.addI("JSmenu.restartall", "", 0, 0, item = new myJMenuItem() { + + @Override + void action() { + //panel.restartAllScripts(); + ZC.restartAllScripts(); + } + }); + item.setEnabled(ZC.isThereAnyStoppedScripts()); + JSMenu.addSep(); + + // add Modify Menu : + myJMenu modifypopup = new myJMenu(Global.Loc("JSmenu.modify"), true); + for (final ScriptItem scpitem : panel.getScripts()) { + modifypopup.addI(scpitem.getScriptName(), "", 0, 0, item = new myJMenuItem() { + + @Override + void action() { + scpitem.openEmbeddedScript(); + } + }); + } + modifypopup.setEnabled(panel.getScripts().size() > 0); + JSMenu.add(modifypopup); + + // add Delete Menu : + myJMenu deletepopup = new myJMenu(Global.Loc("JSmenu.delete"), true); + for (final ScriptItem scpitem : panel.getScripts()) { + deletepopup.addI(scpitem.getScriptName(), "", 0, 0, item = new myJMenuItem() { + + @Override + void action() { + panel.removeScript(scpitem); + } + }); + } + deletepopup.setEnabled(panel.getScripts().size() > 0); + JSMenu.add(deletepopup); + + + JSMenu.addI("JSmenu.ScriptsManager", "", 0, 0, item = new myJMenuItem() { + + @Override + void action() { + panel.addScriptsManagerPanel(); + } + }); + item.setEnabled(panel.getScripts().size() > 0); + } + + public static void initToggleItems() { + if (me != null) { + me.commentitem.setSelected(Global.getParameter("comment", false)); + me.leftpanelitem.setSelected(LeftPanel.isPanelVisible()); + me.paletteitem.setSelected(RightPanel.isPanelVisible()); + } + } + + public void InitObjectsMenu() { + ObjectsMenu.removeAll(); + final myJMenu m1 = new myJMenu(Loc("objects.points"), 0); + m1.addI("point", new myJMenuItem()); + m1.addI("intersection", new myJMenuItem()); + m1.addI("midpoint", new myJMenuItem()); + m1.addI("bi_syma", new myJMenuItem()); + m1.addI("bi_symc", new myJMenuItem()); + m1.addI("bi_trans", new myJMenuItem()); + ObjectsMenu.add(m1); + final myJMenu m2 = new myJMenu(Loc("objects.lines"), 0); + m2.addI("line", new myJMenuItem()); + m2.addI("ray", new myJMenuItem()); + m2.addI("parallel", new myJMenuItem()); + m2.addI("plumb", new myJMenuItem()); + m2.addI("bi_med", new myJMenuItem()); + m2.addI("bi_biss", new myJMenuItem()); + ObjectsMenu.add(m2); + final myJMenu m3 = new myJMenu(Loc("objects.segments"), 0); + m3.addI("segment", new myJMenuItem()); + m3.addI("fixedsegment", new myJMenuItem()); + m3.addI("vector", new myJMenuItem()); + m3.addI("area", new myJMenuItem()); + ObjectsMenu.add(m3); + final myJMenu m4 = new myJMenu(Loc("objects.angles"), 0); + m4.addI("angle", new myJMenuItem()); + m4.addI("fixedangle", new myJMenuItem()); + ObjectsMenu.add(m4); + final myJMenu m5 = new myJMenu(Loc("objects.circles"), 0); + m5.addI("circle", new myJMenuItem()); + m5.addI("fixedcircle", new myJMenuItem()); + m5.addI("circle3", new myJMenuItem()); + m5.addI("bi_circ", new myJMenuItem()); + m5.addI("bi_arc", new myJMenuItem()); + m5.addI("quadric", new myJMenuItem()); + ObjectsMenu.add(m5); + final myJMenu m7 = new myJMenu(Loc("objects.functions"), 0); + m7.addI("text", new myJMenuItem()); + m7.addI("expression", new myJMenuItem()); + m7.addI("bi_function_u", new myJMenuItem()); + m7.addI("function", new myJMenuItem()); + m7.addI("equationxy", new myJMenuItem()); + ObjectsMenu.add(m7); + final myJMenu m6 = new myJMenu(Loc("objects.tracks"), 0); + m6.addI("objecttracker", new myJMenuItem()); + m6.addI("tracker", new myJMenuItem()); + m6.addI("locus", new myJMenuItem()); + ObjectsMenu.add(m6); + + } + + private void fixsize(final JComponent cp, final int w, final int h) { + final Dimension d = new Dimension(w, h); + cp.setMaximumSize(d); + cp.setMinimumSize(d); + cp.setPreferredSize(d); + cp.setSize(d); + } + + private JEricPanel margintop(final int h) { + final JEricPanel mypan = new JEricPanel(); + fixsize(mypan, 1, h); + mypan.setOpaque(false); + mypan.setFocusable(false); + return mypan; + } + + private void showrestrictedmessage() { + if (Global.getParameter("showrestrictmessage", true)) { + final JEricPanel mypan = new JEricPanel(); + mypan.setLayout(new BoxLayout(mypan, BoxLayout.Y_AXIS)); + final JLabel mylabel = new JLabel(Global.Loc("menu.display.restrictmessage")); + mylabel.setFont(new Font("System", 0, 12)); + final JCheckBox myjcb = new JCheckBox(Global.Loc("menu.display.restrictmessage.dontdisplay")); + mypan.add(mylabel); + mypan.add(margintop(10)); + mypan.add(myjcb); + JOptionPane.showMessageDialog(null, mypan, "", + JOptionPane.PLAIN_MESSAGE, null); + Global.setParameter("showrestrictmessage", !myjcb.isSelected()); + } + } + + public void init() { + myJMenu menu; + menubar.removeAll(); + this.removeAll(); + final int ctrlkey = (OS.isMac()) ? InputEvent.META_DOWN_MASK + : InputEvent.CTRL_DOWN_MASK; + + menubar.setOpaque(false); + menubar.setBorder(BorderFactory.createEmptyBorder()); + menubar.setAlignmentY(0.5F); + + JPopupMenu.setDefaultLightWeightPopupEnabled(false); + + /** + * ************************** + * FILE MENU + *************************** + */ + menu = new myJMenu(Loc("file")); + + menu.addI("file.new", "new", KeyEvent.VK_N, ctrlkey, new myJMenuItem()); + menu.addI("file.new3D", "", 0, 0, new myJMenuItem() { + + @Override + void action() { + FileTools.New3DWindow(); + } + }); + menu.addI("file.newDP", "", 0, 0, new myJMenuItem() { + + @Override + void action() { + FileTools.NewDPWindow(); + } + }); + + + menu.addSep(); + menu.addI("file.load", "load", KeyEvent.VK_O, ctrlkey, + new myJMenuItem()); + menu.addI("file.save", "save", KeyEvent.VK_S, ctrlkey, + new myJMenuItem()); + menu.addI("tab.popup.savefileonly", "", 0, 0, new myJMenuItem() { + + @Override + void action() { + FileTools.saveFileAs(); + } + }); + menu.addI("workbook.saveas", "", 0, 0, new myJMenuItem() { + + @Override + void action() { + FileTools.saveWorkBookAs(); + } + }); + + menu.addSep(); + + + menu.addI("export.workbook", "", KeyEvent.VK_E, ctrlkey, new myJMenuItem() { + + @Override + void action() { + FileTools.HTMLWorkBookExport(); + FileTools.SaveJarAndLaunchBrowser(); + } + }); + + menu.addI("export.embedworkbook", "", 0, 0, new myJMenuItem() { + + @Override + void action() { + FileTools.HTMLWorkBookExtExport(); + } + }); + + menu.addSep(); + + menu.addI("file.exportpng", "exportpng", 0, 0, new myJMenuItem()); + menu.addI("file.exporteps", "exporteps", 0, 0, new myJMenuItem()); + menu.addI("file.exportsvg", "exportsvg", 0, 0, new myJMenuItem() { + + @Override + void action() { + FileTools.exportGraphicFile(FileTools.SVG); + } + }); + menu.addI("file.exportpdf", "exportpdf", 0, 0, new myJMenuItem() { + + @Override + void action() { + FileTools.exportGraphicFile(FileTools.PDF); + } + }); + menu.addSep(); + menu.addI("file.close", "", KeyEvent.VK_W, ctrlkey, new myJMenuItem() { + + @Override + void action() { + pipe_tools.closeCurrent(); + } + }); + menu.addSep(); + menu.addI("file.quit", "", KeyEvent.VK_Q, ctrlkey, new myJMenuItem() { + + @Override + void action() { + pipe_tools.quitAll(); + } + }); + + menubar.add(menu); + /** + * ************************** + * EDIT MENU + *************************** + */ + menu = new myJMenu(Loc("edit")); + menu.addI("edit.copy", "copy", KeyEvent.VK_C, ctrlkey, + new myJMenuItem()); + + myJMenu submenu = new myJMenu(Loc("edit.copyto"), true); + + + submenu.addI("PDF", "", 0, 0, new myJMenuItem() { + + @Override + public void action() { + FileTools.exportGraphicFile(FileTools.PDF, null); + } + }); + submenu.addI("SVG", "", 0, 0, new myJMenuItem() { + + @Override + public void action() { + FileTools.exportGraphicFile(FileTools.SVG, null); + } + }); + submenu.addI("EPS", "", 0, 0, new myJMenuItem() { + + @Override + public void action() { + FileTools.exportGraphicFile(FileTools.EPS, null); + } + }); + menu.add(submenu); + + menu.addI("edit.copyapplettag", "", 0, 0, + new myJMenuItem(){ + public void action() { + FileTools.copyAppletTag(); + } + }); + + menu.addSep(); + menu.addI("edit.move", "move", 0, 0, new myJMenuItem()); + menu.addI("edit.rename", "rename", 0, 0, new myJMenuItem() { + + @Override + public void action() { + ZirkelFrame ZF = JZirkelCanvas.getCurrentZF(); + if (ZF != null) { + ZF.settool("rename"); + } + } + }); + menu.addI("edit.edit", "edit", 0, 0, new myJMenuItem()); + menu.addI("edit.zoom", "zoom", 0, 0, new myJMenuItem() { + + @Override + public void action() { + ZirkelFrame ZF = JZirkelCanvas.getCurrentZF(); + if (ZF != null) { + ZF.settool("zoom"); + } + } + }); + menu.addI("edit.hide", "hide", 0, 0, new myJMenuItem()); + menu.addI("edit.delete", "delete", 0, 0, new myJMenuItem()); + menu.addSep(); + menu.addI("edit.deactivatealltracks", "", 0, 0, new myJMenuItem() { + + @Override + void action() { + ZirkelCanvas ZC = JZirkelCanvas.getCurrentZC(); + ZC.UniversalTrack.clearTrackImage(); + ZC.UniversalTrack.clearTrackObjects(); + ZC.repaint(); + } + }); + menu.addI("edit.deletealltracks", "", KeyEvent.VK_T, ctrlkey, new myJMenuItem() { + + @Override + void action() { + ZirkelCanvas ZC = JZirkelCanvas.getCurrentZC(); + ZC.UniversalTrack.clearTrackImage(); + ZC.repaint(); + } + }); + menu.addSep(); + menu.addI("edit.deleteall", "", KeyEvent.VK_DELETE, 0, new myJMenuItem() { + + @Override + void action() { + ZirkelFrame ZF = JZirkelCanvas.getCurrentZF(); + if (ZF.ZC.changed()) { + final Question q = new Question(pipe_tools.getFrame(), Global.Loc("savequestion.qsave"), Global.Loc("savequestion.title"), true); + q.center(null); + q.setVisible(true); + if (q.isAborted()) { + return; + } + if (q.yes()) { + FileTools.saveFile(); + } + } + ZF.clear(false); + final ScriptPanel panel = JZirkelCanvas.getCurrentZC().getScriptsPanel(); + panel.removeScript(Global.Loc("aerialview")); + panel.removeScript(Global.Loc("frontview")); + panel.removeScript(Global.Loc("rightview")); + panel.removeScript(Global.Loc("backview")); + ZF.Filename = ""; + } + }); + menubar.add(menu); + + /** + * ************************** + * OBJECTS MENU + *************************** + */ + menubar.add(ObjectsMenu); + + /** + * ************************** + * DISPLAY MENU + *************************** + */ + menu = new myJMenu(Loc("display")); + + menu.addI("display.restrictedenvironment", "", KeyEvent.VK_R, ctrlkey, new myJMenuItem() { + + @Override + void action() { + pipe_tools.showRestrictedEnvironmentManager(); + } + }); + menu.addSep(); + hiddenitem = new myJMenuItem(); + menu.addI("display.hidden", "hidden", 0, 0, false, hiddenitem); + griditem = new myJMenuItem(); + menu.addI("display.grid", "grid", 0, 0, false, griditem); + menu.addSep(); + menu.addI("display.smartboard", "", 0, 0, Global.getParameter( + "smartboard", false), new myJMenuItem() { + + @Override + void action() { + setSelected(!isSelected()); + Global.setParameter("smartboard", isSelected()); + } + }); + menu.addSep(); + + menu.addI("display.leftpanel", "", 0, 0, LeftPanel.isPanelVisible(), leftpanelitem = new myJMenuItem() { + + @Override + void action() { + Open_left_panel_btn.toggle(); + } + }); + menu.addI("display.comment", "", 0, 0, Global.getParameter( + "comment", false), commentitem = new myJMenuItem() { + + @Override + void action() { + Open_middle_panel_btn.toggle(); + } + }); + menu.addI("display.palette", "", 0, 0, RightPanel.isPanelVisible(), paletteitem = new myJMenuItem() { + + @Override + void action() { + Open_right_panel_btn.toggle(); + } + }); + menu.addSep(); + menu.addI("display.properties_panel", "properties_panel", + KeyEvent.VK_P, ctrlkey, false, new myJMenuItem() { + + @Override + void action() { + JPropertiesBar.ShowHideBar(); + } + }); + menu.addSep(); + largeitem = new myJMenuItem() { + + @Override + void action() { + if (!isSelected()) { + themes.setPaletteIconWidth(32); + setSelected(true); + mediumitem.setSelected(false); + smallitem.setSelected(false); + pipe_tools.getContent().rebuiltRightPanel(); + } + } + }; + menu.addI("display.large", "", 0, 0, false, largeitem); + + mediumitem = new myJMenuItem() { + + @Override + void action() { + if (!isSelected()) { + themes.setPaletteIconWidth(28); + setSelected(true); + largeitem.setSelected(false); + smallitem.setSelected(false); + pipe_tools.getContent().rebuiltRightPanel(); + } + } + }; + menu.addI("display.medium", "", 0, 0, false, mediumitem); + + smallitem = new myJMenuItem() { + + @Override + void action() { + if (!isSelected()) { + themes.setPaletteIconWidth(24); + setSelected(true); + mediumitem.setSelected(false); + largeitem.setSelected(false); + pipe_tools.getContent().rebuiltRightPanel(); + } + } + }; + menu.addI("display.small", "", 0, 0, false, smallitem); + + switch (Global.getParameter("options.iconsize", 1)) { + case 0: + largeitem.setSelected(true); + break; + case 1: + mediumitem.setSelected(true); + break; + case 2: + smallitem.setSelected(true); + break; + } + + menu.addSep(); + + submenu = new myJMenu(Loc("language"), true); + + submenu.addI("zh", "TW", new myJMenuItem() { + + @Override + void action() { + Global.setLanguage("zh", "TW"); + } + }); + submenu.addI("ar", "TN", new myJMenuItem() { + + @Override + void action() { + Global.setLanguage("ar", "TN"); + } + }); + submenu.addI("pt", "BR", new myJMenuItem() { + + @Override + void action() { + Global.setLanguage("pt", "BR"); + } + }); + submenu.addI("de", "", new myJMenuItem() { + + @Override + void action() { + Global.setLanguage("de", ""); + } + }); + submenu.addI("en", "", new myJMenuItem() { + + @Override + void action() { + Global.setLanguage("en", ""); + } + }); + submenu.addI("es", "", new myJMenuItem() { + + @Override + void action() { + Global.setLanguage("es", ""); + } + }); + submenu.addI("fr", "", new myJMenuItem() { + + @Override + void action() { + Global.setLanguage("fr", ""); + } + }); + submenu.addI("gl", "", new myJMenuItem() { + + @Override + void action() { + Global.setLanguage("gl", ""); + } + }); + submenu.addI("it", "", new myJMenuItem() { + + @Override + void action() { + Global.setLanguage("it", ""); + } + }); + submenu.addI("nl", "", new myJMenuItem() { + + @Override + void action() { + Global.setLanguage("nl", ""); + } + }); + submenu.addI("no", "", new myJMenuItem() { + + @Override + void action() { + Global.setLanguage("no", ""); + } + }); + submenu.addI("pl", "", new myJMenuItem() { + + @Override + void action() { + Global.setLanguage("pl", ""); + } + }); + submenu.addI("pt", "", new myJMenuItem() { + + @Override + void action() { + Global.setLanguage("pt", ""); + } + }); + submenu.addI("ru", "RU", new myJMenuItem() { + + @Override + void action() { + Global.setLanguage("ru", "RU"); + } + }); + submenu.addI("sl", "", new myJMenuItem() { + + @Override + void action() { + Global.setLanguage("sl", ""); + } + }); + submenu.addI("sv", "", new myJMenuItem() { + + @Override + void action() { + Global.setLanguage("sv", ""); + } + }); + + menu.add(submenu); + + menubar.add(menu); + + /** + * ************************** + * MACROS MENU : Initialised by + *************************** + */ + menubar.add(MacrosMenu); + + /** + * ************************** + * JAVASCRIPT MENU + *************************** + */ + InitJSMenu(); + menubar.add(JSMenu); + + /** + * ************************** + * SPECIAL MENU + *************************** + */ + menu = new myJMenu(Loc("assigment")); + + + definejobitem = new myJMenuItem() { + + @Override + void action() { + pipe_tools.showExerciseManager(); + } + }; + menu.addI("special.definejob", "", KeyEvent.VK_J, ctrlkey, false, definejobitem); + + menubar.add(menu); + + /** + * ************************** + * NETWORK MENU + *************************** + */ + menu = new myJMenu(Loc("network")); + menu.addI(Global.Loc("network.menu.connect"), "", 0, 0, new myJMenuItem(){ + + @Override + void action(){ + cnt = JZirkelCanvas.getCurrentZC().get_cnt(); + if(cnt==null) { //then display the ConnectionControlPanel + pm.Client.ConnectionControlPanel client = new pm.Client.ConnectionControlPanel(); + JZirkelCanvas.getCurrentZC().add(client); + JZirkelCanvas.getCurrentZC().repaint(); + client.init(); + PaletteManager.deselectgeomgroup(); + JZirkelCanvas.getCurrentZC().showStatus(""); + } else { //cut the connection + cnt.doClose(); + } + } + }); + menu.addI(Global.Loc("network.menu.launch"), "", 0, 0, new myJMenuItem(){ + + @Override + void action(){ + if(scp==null){ + scp = new pm.Server.ServerControlPanel(); + JZirkelCanvas.getCurrentZC().add(scp); + JZirkelCanvas.getCurrentZC().repaint(); + scp.init(); + PaletteManager.deselectgeomgroup(); + JZirkelCanvas.getCurrentZC().showStatus(""); + } else { + scp.close_and_kill_server(); + JZirkelCanvas.getCurrentZC().remove(scp); + JZirkelCanvas.getCurrentZC().repaint(); + PaletteManager.setSelected_with_clic("move", true); + scp = null; + } + } + }); + + menubar.add(menu); + + /** + * ************************** + * HELP MENU + *************************** + */ + menu = new myJMenu(Loc("help")); + menu.addI("help.about", "", 0, 0, new myJMenuItem() { + + @Override + void action() { + JLogoWindow.ShowLogoWindow(true); +// new JAboutDialog(JZirkelCanvas.getCurrentJZF()); + } + }); + menu.addI("help.licence", "", 0, 0, new myJMenuItem() { + + @Override + void action() { + new JLicence(JZirkelCanvas.getCurrentJZF()); + } + }); + menu.addI("help.info", "help_panel", 0, 0, new myJMenuItem() { + + @Override + void action() { + Open_left_panel_btn.open(); + LeftPanel.selectHelp(); + } + }); + menu.addSep(); + menu.addI("help.url0", "", 0, 0, new myJMenuItem() { + + @Override + void action() { + JBrowserLauncher.openURL("http://carmetal.org/index.php/fr/"); + } + }); + menu.addI("help.url1", "", 0, 0, new myJMenuItem() { + + @Override + void action() { + JBrowserLauncher.openURL("http://carmetal.org/index.php/fr/tutoriels/carzine"); + } + }); + menu.addI("help.url2", "", 0, 0, new myJMenuItem() { + + @Override + void action() { + JBrowserLauncher.openURL("http://car.rene-grothmann.de/doc_en/"); + } + }); + menu.addSep(); + menu.addI("help.url3", "", 0, 0, new myJMenuItem() { + + @Override + void action() { + JBrowserLauncher.openURL("http://db-maths.nuxit.net/CaRMetal/index_translate.html"); + } + }); + + menu.addSep(); + + menu.addI("help.opendefaultfolder", "", 0, 0, new myJMenuItem() { + + @Override + void action() { + Global.openHomeDirectoryInDesktop(); + } + }); + menubar.add(menu); + this.add(menubar); + this.validate(); + this.repaint(); + } + + public static pm.Server.ServerControlPanel get_scp(){ + return scp; + } +} diff --git a/eric/JGlobalPreferences.java b/eric/JGlobalPreferences.java new file mode 100644 index 0000000..72bacc2 --- /dev/null +++ b/eric/JGlobalPreferences.java @@ -0,0 +1,112 @@ +/* + +Copyright 2006 Eric Hakenholz + +This file is part of C.a.R. software. + + C.a.R. is a free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 3 of the License. + + C.a.R. is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + */ + + + package eric; + +import java.awt.Color; + +import rene.gui.Global; +import rene.util.parser.StringParser; + +/** + * + * @author erichake + */ +public class JGlobalPreferences { + static int minfontsize, minpointsize, minlinesize, arrowsize,selectionsize,monkeyspeed,gridopacity, + digits_lengths, digits_edit, digits_angles, colorbackgroundx, + colorbackgroundy, colorbackgroundPal; + static String colorbackground; + static boolean undockpalette; + + /** Creates a new instance of JProperties */ + + static public void initPreferences() { + minfontsize = Global.getParameter("prefs.minfontsize", 26); + minpointsize = Global.getParameter("prefs.minpointsize", 3); + minlinesize = Global.getParameter("prefs.minlinesize", 1); + arrowsize = Global.getParameter("prefs.arrowsize", 15); + selectionsize=Global.getParameter("prefs.selectionsize", 8); + monkeyspeed=Global.getParameter("prefs.monkeyspeed", 20); + gridopacity=Global.getParameter("prefs.gridopacity", 20); + digits_lengths = Global.getParameter("prefs.digits.lengths", 5); + digits_edit = Global.getParameter("prefs.digits.edit", 5); + digits_angles = Global.getParameter("prefs.digits.angles", 0); + colorbackground = Global.getParameter("prefs.colorbackground", + "245,245,245"); + colorbackgroundx = Global.getParameter("prefs.colorbackgroundx", 154); + colorbackgroundy = Global.getParameter("prefs.colorbackgroundy", 5); + colorbackgroundPal = Global.getParameter("prefs.colorbackgroundPal", 4); + undockpalette = Global.getParameter("prefs.undockpalette", false); + } + + static public void savePreferences() { + Global.setParameter("prefs.minfontsize", minfontsize); + Global.setParameter("prefs.minpointsize", minpointsize); + Global.setParameter("prefs.minlinesize", minlinesize); + Global.setParameter("prefs.arrowsize", arrowsize); + Global.setParameter("prefs.selectionsize", selectionsize); + Global.setParameter("prefs.monkeyspeed", monkeyspeed); + Global.setParameter("prefs.gridopacity", gridopacity); + Global.setParameter("prefs.digits.lengths", digits_lengths); + Global.setParameter("prefs.digits.edit", digits_edit); + Global.setParameter("prefs.digits.angles", digits_angles); + Global.setParameter("prefs.colorbackground", getColor(colorbackground)); + Global.setParameter("prefs.colorbackgroundx", colorbackgroundx); + Global.setParameter("prefs.colorbackgroundy", colorbackgroundy); + Global.setParameter("prefs.colorbackgroundPal", colorbackgroundPal); + Global.setParameter("prefs.undockpalette", undockpalette); + } + + static public void setLocalPreferences() { + Global.setParameter("minfontsize", minfontsize); + Global.setParameter("minpointsize", minpointsize); + Global.setParameter("minlinesize", minlinesize); + Global.setParameter("arrowsize", arrowsize); + Global.setParameter("selectionsize", selectionsize); + Global.setParameter("gridopacity", gridopacity); + Global.setParameter("monkeyspeed", monkeyspeed); + Global.setParameter("digits.lengths", digits_lengths); + Global.setParameter("digits.edit", digits_edit); + Global.setParameter("digits.angles", digits_angles); + Global.setParameter("colorbackground", getColor(colorbackground)); + Global.setParameter("colorbackgroundx", colorbackgroundx); + Global.setParameter("colorbackgroundy", colorbackgroundy); + Global.setParameter("colorbackgroundPal", colorbackgroundPal); + } + + static public void ShowPreferencesDialog() { + new JGlobalPreferencesDlog(); + + } + + // get a Color object from a string like "231,145,122" + static private Color getColor(final String s) { + final StringParser p = new StringParser(s); + p.replace(',', ' '); + int red, green, blue; + red = p.parseint(); + green = p.parseint(); + blue = p.parseint(); + return new Color(red, green, blue); + } + +} diff --git a/eric/JGlobalPreferencesColor.java b/eric/JGlobalPreferencesColor.java new file mode 100644 index 0000000..7015930 --- /dev/null +++ b/eric/JGlobalPreferencesColor.java @@ -0,0 +1,355 @@ +/* + +Copyright 2006 Eric Hakenholz + +This file is part of C.a.R. software. + + C.a.R. is a free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 3 of the License. + + C.a.R. is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + */ + + + package eric; + +import eric.GUI.pipe_tools; +import java.awt.BasicStroke; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.Stroke; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionListener; + +import javax.swing.BoxLayout; +import javax.swing.JComboBox; +import javax.swing.JComponent; +import javax.swing.JDialog; +import javax.swing.JLabel; +import eric.JEricPanel; +import javax.swing.SwingConstants; + +import net.java.dev.colorchooser.ColorChooser; +import net.java.dev.colorchooser.Palette; +import rene.gui.Global; + +/** + * + * @author erichake + */ +public class JGlobalPreferencesColor extends JEricPanel implements MouseListener, +MouseMotionListener { + /** + * + */ + private static final long serialVersionUID = 1L; + private final ColorChooser cchooser; + private Palette Pal; + int PW = 193; + int PaletteType; + int xx, yy; + colorline mycolorpickerline; + JGlobalPreferencesColor me; + JComboBox JCB; + JLabel comment; + JEricPanel colorsample = new JEricPanel(); + + @Override + public void paintComponent(final java.awt.Graphics g) { + super.paintComponent(g); + } + + private void fixsize(final JComponent cp, final Dimension d) { + cp.setMaximumSize(d); + cp.setMinimumSize(d); + cp.setPreferredSize(d); + cp.setSize(d); + } + + /** Creates a new instance of JColorPanel */ + public JGlobalPreferencesColor() { + me = this; + xx = -1; + yy = -1; + PaletteType = Global.getParameter("prefs.colorbackgroundPal", 1); + + cchooser = new ColorChooser(); + // Pal=cchooser.getPalettes()[4]; + this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); + this.setAlignmentX(0.5f); + this.setOpaque(false); + this.add(margintop(5)); + + JCB = new JComboBox(); + JCB.setMaximumRowCount(5); + JCB.setOpaque(false); + JCB.setFocusable(false); + JCB.setEditable(false); + JCB.setAlignmentX(0.5f); + JCB.setFont(new Font("System", 0, 11)); + JCB.addItem(Loc("saturated1")); + JCB.addItem(Loc("desaturated1")); + JCB.addItem(Loc("saturated2")); + JCB.addItem(Loc("desaturated2")); + JCB.addItem(Loc("constants")); + JCB.setSelectedIndex(PaletteType); + JCB.addItemListener(new ItemAdapter()); + final JEricPanel JCBpanel = new JEricPanel(); + JCBpanel.setLayout(new BoxLayout(JCBpanel, BoxLayout.X_AXIS)); + JCBpanel.setAlignmentX(0.5f); + JCBpanel.setOpaque(false); + fixsize(JCBpanel, PW, 24); + JCBpanel.add(margin(5)); + fixsize(JCB, PW - 10, 22); + JCBpanel.add(JCB); + this.add(JCBpanel); + + mycolorpickerline = new colorline(PaletteType); + this.add(mycolorpickerline); + + comment = new JLabel("coucou"); + comment.setOpaque(false); + comment.setAlignmentX(0.5f); + comment.setFont(new Font("System", 0, 9)); + fixsize(comment, PW, 14); + comment.setHorizontalAlignment(SwingConstants.CENTER); + this.add(comment); + fixsize(colorsample, new Dimension(80, 80)); + colorsample.setAlignmentX(0.5f); + this.add(colorsample); + } + + public String Loc(final String s) { + return Global.Loc("palette.colors." + s); + } + + class ItemAdapter implements ItemListener { + public void itemStateChanged(final ItemEvent evt) { + if (evt.getStateChange() == ItemEvent.SELECTED) { + me.remove(mycolorpickerline); + mycolorpickerline = new colorline(JCB.getSelectedIndex()); + Global.setParameter("prefs.colorbackgroundPal", JCB + .getSelectedIndex()); + me.add(mycolorpickerline, 2); + // JDialog father=GetDialog(me); + // father.validate(); + // father.pack(); + int x = Global.getParameter("prefs.colorbackgroundx", 154); + int y = Global.getParameter("prefs.colorbackgroundy", 5); + x = x * Pal.getSize().width + / mycolorpickerline.mycolors.getSize().width; + y = y * Pal.getSize().height + / mycolorpickerline.mycolors.getSize().height; + final Color mycolor = Pal.getColorAt(x, y); + if (mycolor != null) { + Global.setParameter("prefs.colorbackground", mycolor); + Global.setParameter("prefs.colorbackgroundx", x); + Global.setParameter("prefs.colorbackgroundy", y); + } + me.repaint(); + } + } + } + + public JDialog GetDialog(final Component c) { + if (c instanceof JDialog || null == c) + return c == null ? null : (JDialog) c; + return GetDialog(c.getParent()); + } + + class colorline extends JEricPanel { + /** + * + */ + private static final long serialVersionUID = 1L; + JEricPanel mymargin; + onlycolors mycolors; + + colorline(final int ptype) { + PaletteType = ptype; + Pal = cchooser.getPalettes()[ptype]; + this.setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); + this.setAlignmentX(0.5f); + mymargin = margin(0); + // if (PW>Pal.getSize().width){ + // fixsize(mymargin,(PW-Pal.getSize().width)/2,1); + // }; + this.add(mymargin); + mycolors = new onlycolors(ptype); + this.add(mycolors); + this.setOpaque(false); + } + + } + + private class onlycolors extends JEricPanel { + /** + * + */ + private static final long serialVersionUID = 1L; + Image bimage; + + @Override + public void paintComponent(final java.awt.Graphics g) { + super.paintComponent(g); + final Dimension d = this.getSize(); + final int w = d.width; + final int h = d.height; + g.drawImage(bimage, 0, 0, w, h, this); + final Color mycolor = Global.getParameter("prefs.colorbackground", + new Color(231, 238, 255)); + cchooser.setColor(mycolor); + colorsample.setBackground(mycolor); + // ZF.ZC.setBackground(mycolor); + // ZF.ZC.repaint(); + + int x = Global.getParameter("prefs.colorbackgroundx", 154); + int y = Global.getParameter("prefs.colorbackgroundy", 5); + + if (PaletteType == 4) { + x = ((int) (x / 12)) * 12 + 6; + y = ((int) (y / 12)) * 12 + 6; + } + + final Graphics2D g2 = (Graphics2D) g; + // AlphaComposite ac = + // AlphaComposite.getInstance(AlphaComposite.SRC_OVER,0.5f); + // g2.setComposite(ac); + g2.setColor(new Color(0, 0, 0)); + Stroke stroke = new BasicStroke(1f); + g2.setStroke(stroke); + g2.drawRect(x - 4, y - 4, 8, 8); + stroke = new BasicStroke(1f); + g2.setStroke(stroke); + g2.setColor(new Color(255, 255, 255)); + g2.drawRect(x - 3, y - 3, 6, 6); + // g.drawRect(x-5,y-5,10,10); + comment.setText(Pal.getNameAt(x, y)); + } + + onlycolors(final int ptype) { + + final int w = (PW < Pal.getSize().width) ? PW : Pal.getSize().width; + fixsize(this, w, Pal.getSize().height); + // bimage=JPM.MW.createImage(Pal.getSize().width,Pal.getSize().height); + bimage = this.createImage(Pal.getSize().width, + Pal.getSize().height); + Pal.paintTo(bimage.getGraphics()); + this.setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); + this.setAlignmentX(0.5f); + this.setOpaque(false); + this.addMouseMotionListener(me); + this.addMouseListener(me); + } + + // public void changePal(int i){ + // + // Pal=cchooser.getPalettes()[i]; + // int w=(PW mycolorpickerline.mycolors.getSize().width) + x = mycolorpickerline.mycolors.getSize().width; + if (x < 0) + x = 0; + if (y > mycolorpickerline.mycolors.getSize().height) + y = mycolorpickerline.mycolors.getSize().height; + if (y < 0) + y = 0; + + Global.setParameter("prefs.colorbackgroundx", x); + Global.setParameter("prefs.colorbackgroundy", y); + + x = x * Pal.getSize().width + / mycolorpickerline.mycolors.getSize().width; + y = y * Pal.getSize().height + / mycolorpickerline.mycolors.getSize().height; + + final Color mycolor = Pal.getColorAt(x, y); + if (mycolor != null) { + Global.setParameter("prefs.colorbackground", mycolor); + mycolorpickerline.mycolors.repaint(); + } + + } + + public void mouseReleased(final MouseEvent e) { + xx = -1; + yy = -1; + } + + public void mouseEntered(final MouseEvent e) { + + } + + public void mouseExited(final MouseEvent e) { + } + + public void mouseDragged(final MouseEvent e) { + mousePressed(e); + } + + public void mouseMoved(final MouseEvent e) { + + } + +} diff --git a/eric/JGlobalPreferencesCursor.java b/eric/JGlobalPreferencesCursor.java new file mode 100644 index 0000000..795311c --- /dev/null +++ b/eric/JGlobalPreferencesCursor.java @@ -0,0 +1,125 @@ +/* + +Copyright 2006 Eric Hakenholz + +This file is part of C.a.R. software. + + C.a.R. is a free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 3 of the License. + + C.a.R. is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + */ + + + package eric; + +import java.awt.Color; +import java.awt.Font; + +import javax.swing.BoxLayout; +import javax.swing.JLabel; +import eric.JEricPanel; +import javax.swing.JSlider; + +import rene.gui.Global; + +/** + * + * @author erichake + */ +public class JGlobalPreferencesCursor extends JEricPanel { + /** + * + */ + private static final long serialVersionUID = 1L; + JLabel mylabel, myval; + public JSlider mycursor; + String myP, mytxt; + int PW = 300;// standard palette width + boolean palmember = false; + + /** Creates a new instance of JCursor */ + @Override + public void paintComponent(final java.awt.Graphics g) { + super.paintComponent(g); + } + + // JCursor constructor for palette member : + public JGlobalPreferencesCursor(final String myparam, final String mytext, + final int min, final int max, int sel) { + // this(mytext,40,min,max,rene.gui.Global.getParameter(myparam,sel)); + sel = Global.getParameter(myparam, sel); + myP = myparam; + palmember = true; + final int lblwidth = 150; + final int valwidth = 20; + final int valheight = 27; + mytxt = mytext; + mycursor = new JSlider(); + mylabel = new JLabel(); + myval = new JLabel(); + this.setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); + // this.setAlignmentX(0); + mylabel.setText(" " + mytxt); + mylabel.setForeground(Color.DARK_GRAY); + mylabel.setFont(new Font(Global.GlobalFont, Font.PLAIN, 13)); + mylabel.setSize(lblwidth, 27); + mylabel.setMaximumSize(new java.awt.Dimension(lblwidth, 27)); + mylabel.setMinimumSize(new java.awt.Dimension(lblwidth, 27)); + mylabel.setPreferredSize(new java.awt.Dimension(lblwidth, 27)); + myval.setText(String.valueOf(sel)); + myval.setForeground(Color.GRAY); + myval.setFont(new java.awt.Font(Global.GlobalFont, Font.BOLD, 13)); + myval.setSize(valwidth, valheight); + myval.setMaximumSize(new java.awt.Dimension(valwidth, valheight)); + myval.setMinimumSize(new java.awt.Dimension(valwidth, valheight)); + myval.setPreferredSize(new java.awt.Dimension(valwidth, valheight)); + mycursor.setFont(new java.awt.Font(Global.GlobalFont, 0, 11)); + mycursor.setOpaque(false); + mycursor.setMajorTickSpacing(1); + mycursor.setMaximum(max); + mycursor.setMinimum(min); + mycursor.setMinorTickSpacing(1); + mycursor.setPaintLabels(false); + mycursor.setPaintTicks(false); + mycursor.setSnapToTicks(true); + mycursor.setValue(sel); + mycursor.setAlignmentX(0.0F); + mycursor.setMaximumSize(new java.awt.Dimension( + PW - lblwidth - valwidth, valheight)); + mycursor.setMinimumSize(new java.awt.Dimension( + PW - lblwidth - valwidth, valheight)); + mycursor.setPreferredSize(new java.awt.Dimension(PW - lblwidth + - valwidth, valheight)); + mycursor.setSize(new java.awt.Dimension(PW - lblwidth - valwidth, + valwidth)); + + mycursor.addChangeListener(new javax.swing.event.ChangeListener() { + public void stateChanged(final javax.swing.event.ChangeEvent evt) { + final JSlider myc = (JSlider) evt.getSource(); + final int mysel = myc.getValue(); + rene.gui.Global.setParameter(myP, mysel); + + myval.setText(String.valueOf(mysel)); + } + }); + + this.add(mylabel); + this.add(mycursor); + this.add(myval); + this.setOpaque(false); + this.setMaximumSize(new java.awt.Dimension(PW, 27)); + this.setMinimumSize(new java.awt.Dimension(PW, 27)); + this.setPreferredSize(new java.awt.Dimension(PW, 27)); + this.setSize(PW, 27); + } + +} diff --git a/eric/JGlobalPreferencesDlog.form b/eric/JGlobalPreferencesDlog.form new file mode 100644 index 0000000..d4e912c --- /dev/null +++ b/eric/JGlobalPreferencesDlog.form @@ -0,0 +1,190 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/eric/JGlobalPreferencesDlog.java b/eric/JGlobalPreferencesDlog.java new file mode 100644 index 0000000..acf8ede --- /dev/null +++ b/eric/JGlobalPreferencesDlog.java @@ -0,0 +1,246 @@ +/* + +Copyright 2006 Eric Hakenholz + +This file is part of C.a.R. software. + + C.a.R. is a free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 3 of the License. + + C.a.R. is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + */ + + + package eric; + +import java.awt.Dimension; +import java.awt.event.ItemEvent; + +import javax.swing.JComponent; +import eric.JEricPanel; + +import rene.gui.Global; + +/** + * + * @author erichake + */ +public class JGlobalPreferencesDlog extends javax.swing.JFrame { + + /** + * + */ + private static final long serialVersionUID = 1L; + /** Creates new form JGlobalPreferencesDlog */ + public JGlobalPreferencesDlog() { + initComponents(); + tabs.setTitleAt(0, Loc("sizes")); + tabs.setTitleAt(1, Loc("colors")); + tabs.setTitleAt(2, Loc("others")); + undock.setText(Loc("others.undock")); + JGlobalPreferences.savePreferences(); + sizes.add(Vspacer(20)); + sizes.add(new JGlobalPreferencesCursor("prefs.minpointsize", + Loc("sizes.minpointsize"), 1, 9, 3)); + sizes.add(new JGlobalPreferencesCursor("prefs.minlinesize", + Loc("sizes.minlinesize"), 1, 9, 1)); + sizes.add(new JGlobalPreferencesCursor("prefs.arrowsize", + Loc("sizes.arrowsize"), 3, 50, 15)); + sizes.add(new JGlobalPreferencesCursor("prefs.minfontsize", + Loc("sizes.minfontsize"), 1, 64, 12)); + sizes.add(Vspacer(20)); + sizes.add(new JGlobalPreferencesCursor("prefs.digits.lengths", + Loc("sizes.digits.lengths"), 0, 12, 5)); + sizes.add(new JGlobalPreferencesCursor("prefs.digits.edit", + Loc("sizes.digits.edit"), 0, 12, 5)); + sizes.add(new JGlobalPreferencesCursor("prefs.digits.angles", + Loc("sizes.digits.angles"), 0, 12, 0)); + colors.add(Vspacer(20)); + colors.add(new JGlobalPreferencesColor()); + undock.setSelected(Global.getParameter("prefs.undockpalette", false)); + setVisible(true); + } + + static private String Loc(final String s) { + return Global.Loc("menu.special.options." + + s); + } + + static private JEricPanel Vspacer(final int h) { + final JEricPanel mysep = new JEricPanel(); + mysep.setOpaque(false); + fixsize(mysep, new Dimension(1, h)); + return mysep; + } + + static private void fixsize(final JComponent cp, final Dimension d) { + cp.setMaximumSize(d); + cp.setMinimumSize(d); + cp.setPreferredSize(d); + cp.setSize(d); + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + // //GEN-BEGIN:initComponents + private void initComponents() { + tabs = new javax.swing.JTabbedPane(); + sizes = new javax.swing.JPanel(); + colors = new javax.swing.JPanel(); + other = new javax.swing.JPanel(); + jPanel2 = new javax.swing.JPanel(); + undock = new javax.swing.JCheckBox(); + jPanel1 = new javax.swing.JPanel(); + jPanel3 = new javax.swing.JPanel(); + jButton2 = new javax.swing.JButton(); + + getContentPane().setLayout( + new javax.swing.BoxLayout(getContentPane(), + javax.swing.BoxLayout.Y_AXIS)); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + setTitle("Preferences"); + setAlwaysOnTop(true); + setResizable(false); + addWindowListener(new java.awt.event.WindowAdapter() { + @Override + public void windowClosed(final java.awt.event.WindowEvent evt) { + formWindowClosed(evt); + } + }); + + tabs.setMaximumSize(new java.awt.Dimension(330, 360)); + tabs.setMinimumSize(new java.awt.Dimension(330, 360)); + tabs.setPreferredSize(new java.awt.Dimension(330, 360)); + sizes.setLayout(new javax.swing.BoxLayout(sizes, + javax.swing.BoxLayout.Y_AXIS)); + + sizes.setOpaque(false); + tabs.addTab("Sizes", sizes); + + colors.setLayout(new javax.swing.BoxLayout(colors, + javax.swing.BoxLayout.Y_AXIS)); + + colors.setOpaque(false); + tabs.addTab("Colors", colors); + + other.setLayout(new javax.swing.BoxLayout(other, + javax.swing.BoxLayout.Y_AXIS)); + + other.setOpaque(false); + jPanel2.setEnabled(false); + jPanel2.setFocusable(false); + jPanel2.setMaximumSize(new java.awt.Dimension(32767, 20)); + jPanel2.setMinimumSize(new java.awt.Dimension(10, 20)); + jPanel2.setOpaque(false); + jPanel2.setPreferredSize(new java.awt.Dimension(10, 20)); + other.add(jPanel2); + + undock.setText("Accept undocked palette"); + undock.setBorder(javax.swing.BorderFactory + .createEmptyBorder(0, 0, 0, 0)); + undock.setMargin(new java.awt.Insets(0, 0, 0, 0)); + undock.setOpaque(false); + undock.addItemListener(new java.awt.event.ItemListener() { + public void itemStateChanged(final java.awt.event.ItemEvent evt) { + undockItemStateChanged(evt); + } + }); + + other.add(undock); + + tabs.addTab("Other", other); + + getContentPane().add(tabs); + + jPanel1.setLayout(new javax.swing.BoxLayout(jPanel1, + javax.swing.BoxLayout.X_AXIS)); + + jPanel1.setMaximumSize(new java.awt.Dimension(330, 40)); + jPanel1.setMinimumSize(new java.awt.Dimension(330, 40)); + jPanel1.setPreferredSize(new java.awt.Dimension(330, 40)); + jPanel3.setLayout(new javax.swing.BoxLayout(jPanel3, + javax.swing.BoxLayout.X_AXIS)); + + jPanel3.setMaximumSize(new java.awt.Dimension(247, 40)); + jPanel3.setMinimumSize(new java.awt.Dimension(247, 40)); + jPanel3.setOpaque(false); + jPanel3.setPreferredSize(new java.awt.Dimension(247, 40)); + jPanel1.add(jPanel3); + + jButton2.setText("close"); + jButton2.setAlignmentX(0.5F); + jButton2.setFocusPainted(false); + jButton2.setFocusable(false); + jButton2.setMaximumSize(new java.awt.Dimension(75, 35)); + jButton2.setMinimumSize(new java.awt.Dimension(75, 35)); + jButton2.setPreferredSize(new java.awt.Dimension(75, 35)); + jButton2.addMouseListener(new java.awt.event.MouseAdapter() { + @Override + public void mouseClicked(final java.awt.event.MouseEvent evt) { + jButton2MouseClicked(evt); + } + }); + + jPanel1.add(jButton2); + + getContentPane().add(jPanel1); + + final java.awt.Dimension screenSize = java.awt.Toolkit + .getDefaultToolkit().getScreenSize(); + setBounds((screenSize.width - 330) / 2, (screenSize.height - 422) / 2, + 330, 422); + }// //GEN-END:initComponents + + private void undockItemStateChanged(final java.awt.event.ItemEvent evt) {// GEN-FIRST:event_undockItemStateChanged + Global.setParameter("prefs.undockpalette", + (evt.getStateChange() == ItemEvent.SELECTED)); + }// GEN-LAST:event_undockItemStateChanged + + private void formWindowClosed(final java.awt.event.WindowEvent evt) {// GEN-FIRST:event_formWindowClosed + + JGlobalPreferences.initPreferences();// TODO add your handling code + // here: + }// GEN-LAST:event_formWindowClosed + + private void jButton2MouseClicked(final java.awt.event.MouseEvent evt) {// GEN-FIRST:event_jButton2MouseClicked + dispose();// TODO add your handling code here: + }// GEN-LAST:event_jButton2MouseClicked + + /** + * @param args + * the command line arguments + */ + public static void main(final String args[]) { + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new JGlobalPreferencesDlog().setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JPanel colors; + private javax.swing.JButton jButton2; + private javax.swing.JPanel jPanel1; + private javax.swing.JPanel jPanel2; + private javax.swing.JPanel jPanel3; + private javax.swing.JPanel other; + private javax.swing.JPanel sizes; + private javax.swing.JTabbedPane tabs; + private javax.swing.JCheckBox undock; + // End of variables declaration//GEN-END:variables + +} diff --git a/eric/JHelpPanel.java b/eric/JHelpPanel.java new file mode 100644 index 0000000..734560c --- /dev/null +++ b/eric/JHelpPanel.java @@ -0,0 +1,792 @@ +/* + +Copyright 2006 Eric Hakenholz + +This file is part of C.a.R. software. + + C.a.R. is a free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 3 of the License. + + C.a.R. is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + */ + +package eric; + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.event.FocusAdapter; +import java.awt.event.FocusEvent; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.io.BufferedReader; +import java.io.FileInputStream; +import java.io.InputStreamReader; +import java.net.URL; +import java.util.Enumeration; +import java.util.StringTokenizer; +import java.util.Vector; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import javax.swing.BorderFactory; +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JComponent; +import javax.swing.JEditorPane; +import javax.swing.JLabel; +import javax.swing.JMenuItem; +import javax.swing.JPopupMenu; +import javax.swing.JScrollPane; +import javax.swing.JTextField; +import javax.swing.SwingConstants; +import javax.swing.SwingUtilities; +import javax.swing.event.HyperlinkEvent; +import javax.swing.event.HyperlinkListener; +import javax.swing.plaf.ComponentUI; +import javax.swing.plaf.metal.MetalComboBoxUI; +import javax.swing.text.html.HTMLDocument; +import javax.swing.text.html.HTMLEditorKit; +import javax.swing.text.html.StyleSheet; + +import rene.gui.Global; + +/** + * Info class. Reads a file "info.txt" or "de_info.txt" etc. that has the + * structure + * + * .subject1 substitute1 substitute2 ... .related subject subject ... Header ... + * + * .subject2 ... + * + * and displays the text, starting from header, searching for a subject or any + * of its substitutes. The headers of the related subjects are presented in a + * choice list. The user can switch to any of it. + * + * There is a history and a back button. + * + * Moroever, there is a search button, that displays the first subject + * containing a string and presents all other subjects containing the string in + * the choice list. + */ +public class JHelpPanel extends JEricPanel { + + private static final long serialVersionUID = 1L; + MyJTextPane T; + public static String Subject = "start"; + String Search = null; + // MyChoice2 L; + Vector Other = null; + Vector History = new Vector(); + Vector Related; + JEricPanel north; + MyJTextSearch TSearch; + + public JHelpPanel() { + T = new MyJTextPane(this); + final JScrollPane scrollPane = new JScrollPane(T); + scrollPane.setBorder(javax.swing.BorderFactory.createEmptyBorder()); + setAlignmentX(0.0F); + setAlignmentY(0.0F); + + setLayout(new javax.swing.BoxLayout(this, javax.swing.BoxLayout.Y_AXIS)); + setFocusable(false); + + north = new JEricPanel(); + north.setLayout(new javax.swing.BoxLayout(north, javax.swing.BoxLayout.Y_AXIS)); + north.setOpaque(false); + TSearch = new MyJTextSearch(this); + Subject = "start"; + fill(true); + north.add(TSearch); + north.add(vmargin(2)); + + add(north); + add(scrollPane); + } + + public void focusTxt() { + SwingUtilities.invokeLater(new Runnable() { + + @Override + public void run() { + TSearch.JTF.requestFocus(); + } + }); + } + + static JEricPanel margin(final int w) { + final JEricPanel mypan = new JEricPanel(); + fixsize(mypan, w, 1); + mypan.setLayout(new javax.swing.BoxLayout(mypan, javax.swing.BoxLayout.X_AXIS)); + mypan.setAlignmentX(0F); + mypan.setAlignmentY(0F); + mypan.setOpaque(false); + mypan.setFocusable(false); + return mypan; + } + + static JEricPanel vmargin(final int h) { + final JEricPanel mypan = new JEricPanel(); + fixsize(mypan, 1, h); + mypan.setLayout(new javax.swing.BoxLayout(mypan, javax.swing.BoxLayout.X_AXIS)); + mypan.setAlignmentX(0F); + mypan.setAlignmentY(0F); + mypan.setOpaque(false); + mypan.setFocusable(false); + return mypan; + } + + // Only called by LeftPanelContent init method : + public void fixPanelSize(final int w, final int h) { + fixsize(north, w, 24); + north.revalidate(); + fixsize(TSearch, w, 24); + fixsize(TSearch.wholepanel, w - 20, 18); + } + + public static void fixsize(final JComponent cp, final int w, final int h) { + final Dimension d = new Dimension(w, h); + cp.setMaximumSize(d); + cp.setMinimumSize(d); + cp.setPreferredSize(d); + cp.setSize(d); + } + + public void clearSearchTxtField() { + TSearch.JTF.setText(""); + } + + public final void fill(final boolean WithTextFocus) { + final boolean vis = TSearch.ispopupvisible(); + if (vis) { + TSearch.hidepopup(); + } + TSearch.L = new MyJPopupMenu(this); + T.setText(""); + + String TXT = ""; + + boolean Found = false, Appending = false; + Related = null; + Other = new Vector(); + String pair[] = null, lastpair[] = null; + String lang = Global.name("language", ""); + Vector SearchResults = new Vector(); + String SearchResult = ""; + String FoundTopic = null; + boolean FirstRun = true, FoundHeader = false; + + String Search1 = Search; + if (Search != null && Search.length() > 0) { + Search1 = Search.substring(0, 1).toUpperCase() + Search.substring(1); + } + + read: while (true) { + try { + Global.name("codepage.help", ""); + BufferedReader in = null; + try { + in = new BufferedReader(new InputStreamReader( + new FileInputStream(Global.getHomeDirectory() + "docs/" + lang + "info.txt"), "UTF8")); + } catch (final Exception ex) { + in = new BufferedReader(new InputStreamReader( + new FileInputStream(Global.getHomeDirectory() + "docs/" + lang + "info.txt"))); + } + + boolean newline = false; + newline: while (true) { + String s = in.readLine(); + if (s == null) { + break newline; + } + if (s.startsWith("//")) { + continue; + } + s = clear(s); + if (!s.startsWith(".") && Search != null && (s.indexOf(Search) >= 0 || s.indexOf(Search1) >= 0)) { + if (lastpair != null && pair == null && !SearchResult.equals(lastpair[0])) { + SearchResults.addElement(lastpair); + + SearchResult = lastpair[0]; + if (FoundTopic == null) { + FoundTopic = lastpair[0]; + } + } + } + interpret: while (true) { + if (!Appending && s.startsWith(".") && !s.startsWith(".related")) { + if (!Found) { + if (s.startsWith("." + Subject)) { + Found = true; + Appending = true; + continue newline; + } + final StringTokenizer t = new StringTokenizer(s); + while (t.hasMoreElements()) { + final String name = t.nextToken(); + if (name.equals(Subject)) { + Found = true; + Appending = true; + continue newline; + } + } + } + pair = new String[2]; + s = s.substring(1); + final int n = s.indexOf(' '); + if (n > 0) { + s = s.substring(0, n); + } + pair[0] = s; + continue newline; + } + if (Appending) { + if (s.startsWith(".related")) { + s = s.substring(".related".length()); + Related = new Vector(); + final StringTokenizer t = new StringTokenizer(s); + while (t.hasMoreElements()) { + Related.addElement(t.nextToken()); + } + continue newline; + } + if (s.startsWith(".")) { + Appending = false; + continue interpret; + } + if (s.trim().equals("")) { + if (!newline) { + // T.append("

"); + TXT += "

"; + } + newline = true; + } else { + newline = false; + if (s.startsWith(" ")) { + TXT += "
"; + // T.append("
"); + } + // T.append(s+" "); + TXT += s + " "; + } + } else if (pair != null && !s.startsWith(".")) { + pair[1] = s; + Other.addElement(pair); + lastpair = pair; + pair = null; + if (Search != null && (s.indexOf(Search) >= 0 || s.indexOf(Search1) >= 0)) { + if (!SearchResult.equals(lastpair[0])) { + SearchResults.addElement(lastpair); + SearchResult = lastpair[0]; + if (!FoundHeader) { + FoundTopic = lastpair[0]; + } + FoundHeader = true; + } + } + } + continue newline; + } + } + // T.append("
"); + TXT += "
"; + in.close(); + } catch (final Exception e) { + if (!lang.equals("")) { + lang = ""; + continue read; + } else { + // V.appendLine( + // Global.name("help.error","Could not find the help file!")); + // T.append(Global.name("help.error", + // "Could not find the help file!")); + TXT += Global.name("help.error", "Could not find the help file!"); + } + } + if (FoundTopic != null && FirstRun) { + Subject = FoundTopic; + SearchResults = new Vector(); + SearchResult = ""; + pair = null; + lastpair = null; + Found = false; + TXT = ""; + // T.setText(""); + // V.setText(""); + FirstRun = false; + continue read; + } else { + break read; + } + } + + // if (!Found) + // V.appendLine(Global.name("info.notfound","Topic not found!")); + if (!Found) { + // T.append(Global.name("info.notfound", "Topic not found!")); + TXT += Global.name("info.notfound", "Topic not found!"); + } + if (Search != null) { + if (SearchResults.size() > 0) { + TSearch.L.addI(Global.name("info.searchresults")); + } else { + TSearch.L.addI(Global.name("info.noresults")); + } + } else { + TSearch.L.addI(Global.name("info.select")); + } + if (Search == null && Related != null) { + final Enumeration e = Related.elements(); + while (e.hasMoreElements()) { + final String topic = (String) e.nextElement(); + final Enumeration ev = Other.elements(); + while (ev.hasMoreElements()) { + final String s[] = (String[]) ev.nextElement(); + if (s[0].equals(topic)) { + TSearch.L.addI(s[1]); + break; + } + } + } + } + + if (Search != null) { + final Enumeration e = SearchResults.elements(); + while (e.hasMoreElements()) { + final String s[] = (String[]) e.nextElement(); + TSearch.L.addI(s[1]); + } + } + T.setContent(TXT); + if (WithTextFocus) { + focusTxt(); + } + T.setCaretPosition(0); + History.addElement(Subject); + TSearch.setCount(); + if (vis) { + TSearch.showpopup(); + } + } + + public String clear(String s) { + s = s.replace('ß', ' '); + s = s.replaceAll("__", ""); + return s; + } +} + +class MyComboBoxUI extends MetalComboBoxUI { + + public static ComponentUI createUI(final JComponent c) { + return new MyComboBoxUI(); + } +} + +class MyJTextSearch extends JEricPanel { + + private static final long serialVersionUID = 1L; + JLabel cntLBL = new JLabel(); + JTextField JTF; + JHelpPanel JP; + JButton popBTN, clearBTN; + JEricPanel txtpanel; + JEricPanel wholepanel; + MyJPopupMenu L; + String old = ""; + + @Override + public void paintComponent(final java.awt.Graphics g) { + super.paintComponent(g); + final ImageIcon OffImage = new ImageIcon(getClass().getResource("/eric/GUI/icons/themes/common/helpsearchback.png")); + final java.awt.Dimension d = this.getSize(); + g.drawImage(OffImage.getImage(), 0, 0, d.width, d.height, this); + } + + public MyJTextSearch(final JHelpPanel jp) { + super(); + setLayout(new javax.swing.BoxLayout(this, javax.swing.BoxLayout.Y_AXIS)); + setOpaque(false); + JP = jp; + + L = new MyJPopupMenu(JP); + + txtpanel = new JEricPanel(); + txtpanel.setLayout(new javax.swing.BoxLayout(txtpanel, javax.swing.BoxLayout.X_AXIS)); + txtpanel.setBorder(BorderFactory.createLineBorder(new Color(150, 150, 150), 1)); + txtpanel.setOpaque(true); + txtpanel.setBackground(Color.WHITE); + wholepanel = new JEricPanel(); + wholepanel.setLayout(new javax.swing.BoxLayout(wholepanel, javax.swing.BoxLayout.X_AXIS)); + wholepanel.setBorder(BorderFactory.createEmptyBorder()); + wholepanel.setOpaque(false); + cntLBL.setOpaque(false); + cntLBL.setText(""); + cntLBL.setFont(new Font("System", 0, 9)); + cntLBL.setHorizontalAlignment(SwingConstants.CENTER); + cntLBL.setVerticalAlignment(SwingConstants.CENTER); + JHelpPanel.fixsize(cntLBL, 20, 18); + + JTF = new JTextField(); + JTF.setFont(new Font("System", 0, 11)); + JTF.setForeground(new Color(50, 50, 50)); + JTF.setBackground(new Color(255, 255, 255)); + JTF.setBorder(BorderFactory.createEmptyBorder()); + JTF.setMargin(new java.awt.Insets(0, 0, 1, 0)); + JTF.addKeyListener(new KeyAdapter() { + + @Override + public void keyReleased(final KeyEvent e) { + if (JTF.getText().equals("")) { + clearBTN.setVisible(false); + } else { + clearBTN.setVisible(true); + } + if ((e.getKeyCode() == KeyEvent.VK_ENTER) || (e.getKeyCode() == KeyEvent.VK_UP)) { + hidepopup(); + } else if (e.getKeyCode() == KeyEvent.VK_DOWN) { + showpopup(); + } else { + doSearch(JTF.getText()); + } + } + }); + // JTF.setFocusable(true); + JTF.addFocusListener(new FocusAdapter() { + + @Override + public void focusGained(final FocusEvent e) { + JTF.selectAll(); + } + }); + + final ImageIcon carimg = new ImageIcon(getClass().getResource("/eric/GUI/icons/themes/common/helpsearch1.gif")); + popBTN = new JButton(carimg); + popBTN.setBorder(BorderFactory.createEmptyBorder()); + popBTN.setOpaque(true); + popBTN.setContentAreaFilled(true); + popBTN.setFocusable(false); + popBTN.addMouseListener(new MouseAdapter() { + + @Override + public void mousePressed(final MouseEvent e) { + showpopup(); + } + }); + + final ImageIcon carimg2 = new ImageIcon(getClass().getResource("/eric/GUI/icons/themes/common/helpsearch2.png")); + final JButton backBTN = new JButton(carimg2); + backBTN.setBorder(BorderFactory.createEmptyBorder()); + backBTN.setOpaque(false); + backBTN.setContentAreaFilled(false); + backBTN.setFocusable(false); + backBTN.addMouseListener(new MouseAdapter() { + + @Override + public void mousePressed(final MouseEvent e) { + final int n = JP.History.size(); + if (n < 2) { + return; + } + JP.History.removeElementAt(n - 1); + JHelpPanel.Subject = (String) JP.History.elementAt(n - 2); + JP.History.removeElementAt(n - 2); + JP.fill(true); + } + }); + + final ImageIcon carimg3 = new ImageIcon(getClass().getResource("/eric/GUI/icons/themes/common/helpsearch3.gif")); + clearBTN = new JButton(carimg3); + clearBTN.setBorder(BorderFactory.createEmptyBorder()); + clearBTN.setOpaque(true); + clearBTN.setContentAreaFilled(true); + clearBTN.setFocusable(false); + clearBTN.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(final MouseEvent e) { + JTF.setText(""); + clearBTN.setVisible(false); + doSearch(""); + } + }); + clearBTN.setVisible(false); + JHelpPanel.fixsize(popBTN, carimg.getIconWidth(), carimg.getIconHeight()); + JHelpPanel.fixsize(clearBTN, carimg3.getIconWidth(), carimg3.getIconHeight()); + txtpanel.add(cntLBL); + txtpanel.add(popBTN); + txtpanel.add(JHelpPanel.margin(3)); + txtpanel.add(JTF); + txtpanel.add(clearBTN); + wholepanel.add(JHelpPanel.margin(5)); + wholepanel.add(txtpanel); + wholepanel.add(JHelpPanel.margin(3)); + wholepanel.add(backBTN); + this.add(JHelpPanel.vmargin(3)); + this.add(wholepanel); + } + + void showpopup() { + if (L.Count > 1) { + L.show(popBTN, 10, 20); + } + } + + void hidepopup() { + L.setVisible(false); + } + + boolean ispopupvisible() { + return L.isVisible(); + } + + void doSearch(final String s) { + if (s.equals("")) { + JP.Search = null; + } else { + JP.Search = s; + } + JHelpPanel.Subject = "start"; + JP.fill(true); + JP.Search = null; + } + + void setCount() { + if (L.Count > 1) { + cntLBL.setText("(" + (L.Count - 1) + ")"); + } else { + cntLBL.setText(""); + } + } +} + +class MyJPopupMenuItem extends JMenuItem { + + private static final long serialVersionUID = 1L; + String STR; + JHelpPanel JP; + + public MyJPopupMenuItem(final JHelpPanel jp, final String s) { + super(s.replaceAll("", "").replace("
", ", ")); + STR = s; + JP = jp; + + setFont(new Font("System", 0, 11)); + addMouseListener(new MouseAdapter() { + + @Override + public void mousePressed(final MouseEvent arg0) { + JP.TSearch.L.setVisible(false); + JP.TSearch.JTF.setText(""); + JP.TSearch.clearBTN.setVisible(false); + final String s = STR; + final Enumeration ev = JP.Other.elements(); + while (ev.hasMoreElements()) { + final String p[] = (String[]) ev.nextElement(); + if (p[1].equals(s)) { + JHelpPanel.Subject = p[0]; + JP.fill(true); + break; + } + } + } + }); + } +} + +class MyJPopupMenu extends JPopupMenu { + + private static final long serialVersionUID = 1L; + int Count = 0; + JHelpPanel JP; + + public MyJPopupMenu(final JHelpPanel jp) { + super(); + JP = jp; + setFont(new Font("System", 0, 11)); + setFocusable(false); + } + + public void addI(final String s) { + Count++; + add(new MyJPopupMenuItem(JP, s)); + } +} + +class MyJTextPane extends JEditorPane implements HyperlinkListener { + + private static final long serialVersionUID = 1L; + String content; + HTMLEditorKit editorkit; + HTMLDocument doc; + JHelpPanel JP; + + public MyJTextPane(final JHelpPanel jp) { + super(); + JP = jp; + this.setContentType("text/html;"); + editorkit = (HTMLEditorKit) getEditorKit(); + doc = (HTMLDocument) getDocument(); + final StyleSheet myStyleSheet = new StyleSheet(); + myStyleSheet.addRule("body {color: #333333;font-family: Verdana, Arial, Helvetica, sans-serif;" + + "text-align: justify;font-size: 10px;background-color: #F1F3F9;}"); + myStyleSheet.addRule("ul {text-align: left;list-style-type: disc;padding-left: 15px;list-style-position: outside;}"); + myStyleSheet.addRule(".pfooter {text-align: center;font-size: 10px;padding-bottom: 5px;" + + "padding-top: 5px;background-color: #eaedf3;}"); + myStyleSheet.addRule(".pfootertitle {font-weight: bold;text-align: center;font-size: 10px;padding-bottom: 5px;" + + "padding-top: 5px;background-color: #DBDDE3;}"); + myStyleSheet.addRule("a {color: #0a9100;text-decoration: none;}"); + myStyleSheet.addRule(".aanchor {color: #CC6633;}"); + myStyleSheet.addRule(".centered {text-align: center;}"); + myStyleSheet.addRule(".comment {text-align: center;font-size: 9px;font-style: oblique;font-weight: normal;}"); + myStyleSheet.addRule(".comment2 {text-align: justify;font-size: 9px;font-style: oblique;font-weight: normal;}"); + myStyleSheet.addRule(".ttle {color: #000000;font-family: Verdana, Arial, Helvetica, sans-serif;" + + "text-align: center;font-weight: bold;font-size: 11px;background-color: #DBDDE3;}"); + myStyleSheet.addRule(".tab {border-width: 1px;border-color: #909090;border-style:solid;}"); + myStyleSheet.addRule(".tds {border-width: 1px;border-color: #909090;border-style:solid;background-color: #DBDDE3;}"); + myStyleSheet.addRule(".image {border-width: 1px;border-color: #909090;border-style:solid;background-color: #F1F3F9;}"); + editorkit.setStyleSheet(myStyleSheet); + this.setEditable(false); + addHyperlinkListener(this); + } + + void fixImagePath() { + final String SP = System.getProperty("file.separator"); + + // Check if there are external images (inside the docs folder of + // carmetal_config directory + Pattern p = Pattern.compile("(]*src=\")(images/)([^\"]+)(\"[^>]*>)", Pattern.CASE_INSENSITIVE); + Matcher m = p.matcher(content); + StringBuffer sb = new StringBuffer(); + + while (m.find()) { + String myst = "

" + m.group(1) + "file:///"; + myst += Global.getHomeDirectory().replace("\\", "\\\\"); + myst += "docs/images/".replace("/", SP).replace("\\", "\\\\"); + myst += m.group(3).replace("/", SP).replace("\\", "\\\\"); + + // on windows, the img tag seems to need the width and height + // attribute : + final ImageIcon myimg = new ImageIcon(Global.getHomeDirectory() + "docs/images/" + m.group(3)); + if (myimg != null) { + myst += "\" width=\"" + myimg.getIconWidth() + "\" height=\"" + myimg.getIconHeight() + "\""; + } + + myst += m.group(4); + myst += "

"; + m.appendReplacement(sb, myst); + } + m.appendTail(sb); + m.reset(); + content = sb.toString(); + + // Check if there are internal images (inside the jar archive with root + // eric/GUI/icons/ : + p = Pattern.compile("(]*src=\")(#)([^\"]+)(\"[^>]*>)", Pattern.CASE_INSENSITIVE); + m = p.matcher(content); + sb = new StringBuffer(); + while (m.find()) { + final URL myIMG = Global.getPath("eric/GUI/icons/" + m.group(3)); + if (myIMG == null) + continue; + String myst = m.group(1); + myst += myIMG.toString(); + myst += m.group(4); + m.appendReplacement(sb, myst); + } + m.appendTail(sb); + m.reset(); + content = sb.toString(); + } + + void setTitle() { + if (content.equals("")) { + return; + } + content = content.replace("href=\"#", "class=\"aanchor\" href=\"#"); + final URL myIMG = Global.getPath("eric/GUI/icons/palette/" + JHelpPanel.Subject + ".png"); + final String mytitle = content.substring(0, content.indexOf("
")); + String tag = ""; + if (myIMG == null) { + tag = ""; + tag += ""; + tag += "
" + mytitle + "
"; + } else { + tag = ""; + tag += ""; + tag += ""; + tag += "
" + mytitle + "

"; + } + content = content.replaceFirst(mytitle, tag); + } + + void setFooter() { + final Enumeration e = JP.Related.elements(); + String tag = ""; + while (e.hasMoreElements()) { + final String topic = (String) e.nextElement(); + String topicTitle = ""; + final Enumeration ev = JP.Other.elements(); + + while (ev.hasMoreElements()) { + final String s[] = (String[]) ev.nextElement(); + if (s[0].equals(topic)) { + topicTitle = s[1]; + break; + } + } + + tag += "
" + topicTitle + ""; + } + + if (!tag.equals("")) { + content += ""; + content += ""; + content += tag; + content += "
" + Global.Loc("contexthelp.seealso") + "
"; + } + } + + void setContent(final String s) { + try { + content = s; + fixImagePath(); + setTitle(); + setFooter(); + editorkit.insertHTML(doc, doc.getLength(), content, 0, 0, null); + } catch (final Exception ex) { + } + // JP.focusTxt(); + } + + @Override + public void hyperlinkUpdate(final HyperlinkEvent r) { + if (r.getEventType() == javax.swing.event.HyperlinkEvent.EventType.ACTIVATED) { + String lnk = ""; + if (r.getDescription().startsWith("#")) { + lnk = r.getDescription().substring(1); + JHelpPanel.Subject = lnk; + JP.clearSearchTxtField(); + JP.fill(true); + return; + } else { + lnk = r.getDescription(); + if (!lnk.startsWith("http://")) { + lnk = "http://" + lnk; + } + JBrowserLauncher.openURL(lnk); + return; + } + } + } +} \ No newline at end of file diff --git a/eric/JLicence.java b/eric/JLicence.java new file mode 100644 index 0000000..77ec77b --- /dev/null +++ b/eric/JLicence.java @@ -0,0 +1,185 @@ +/* + +Copyright 2006 Eric Hakenholz + +This file is part of C.a.R. software. + + C.a.R. is a free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 3 of the License. + + C.a.R. is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + */ + + + package eric; + +import eric.GUI.themes; +import java.awt.Cursor; +import javax.swing.JComponent; +import rene.gui.Global; + +/** + * + * @author erichake + */ +public class JLicence extends javax.swing.JFrame { + /** + * + */ + private static final long serialVersionUID = 1L; + + + @Override + public void paint(final java.awt.Graphics g) { + super.paint(g); + final java.awt.Dimension d = this.getSize(); + g.drawImage(themes.getImage("backcontrols.gif"), 0, 0, d.width, + d.height, this); + // super.paint(g); + mytxt.repaint(); + mylink.repaint(); + } + + /** Creates new form JLicence */ + public JLicence(JComponent jp) { + initComponents(); + mytxt.setText(Global.Loc("licence.txt")); + mytxt.setOpaque(false); + mylink + .setText("http://www.gnu.org/licenses/gpl.txt"); + mylink.setOpaque(false); + mylink.setCursor(new Cursor(Cursor.HAND_CURSOR)); + this.setLocationRelativeTo(jp); + this.setVisible(true); + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + // + private void initComponents() { + jPanel2 = new javax.swing.JPanel(); + jPanel1 = new javax.swing.JPanel(); + mytxt = new javax.swing.JLabel(); + mylink = new javax.swing.JLabel(); + jPanel3 = new javax.swing.JPanel(); + + getContentPane().setLayout( + new javax.swing.BoxLayout(getContentPane(), + javax.swing.BoxLayout.Y_AXIS)); + + setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); + setTitle("Licence"); + setResizable(false); + setUndecorated(true); + addMouseListener(new java.awt.event.MouseAdapter() { + @Override + public void mousePressed(final java.awt.event.MouseEvent evt) { + formMousePressed(evt); + } + }); + addWindowListener(new java.awt.event.WindowAdapter() { + @Override + public void windowDeactivated(final java.awt.event.WindowEvent evt) { + formWindowDeactivated(evt); + } + }); + + jPanel2.setLayout(new javax.swing.BoxLayout(jPanel2, + javax.swing.BoxLayout.X_AXIS)); + + jPanel2.setMaximumSize(new java.awt.Dimension(320, 10)); + jPanel2.setMinimumSize(new java.awt.Dimension(320, 10)); + jPanel2.setPreferredSize(new java.awt.Dimension(320, 10)); + getContentPane().add(jPanel2); + + jPanel1.setLayout(new javax.swing.BoxLayout(jPanel1, + javax.swing.BoxLayout.Y_AXIS)); + + jPanel1.setOpaque(false); + mytxt.setBackground(new java.awt.Color(255, 255, 255)); + mytxt.setFont(new java.awt.Font("Dialog", 0, 12)); + mytxt.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); + mytxt.setText("txt"); + mytxt.setAlignmentX(0.5F); + mytxt.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); + mytxt.setMaximumSize(new java.awt.Dimension(300, 95)); + mytxt.setMinimumSize(new java.awt.Dimension(300, 95)); + mytxt.setPreferredSize(new java.awt.Dimension(300, 95)); + mytxt.addMouseListener(new java.awt.event.MouseAdapter() { + @Override + public void mousePressed(final java.awt.event.MouseEvent evt) { + mytxtMousePressed(evt); + } + }); + + jPanel1.add(mytxt); + + mylink.setBackground(new java.awt.Color(255, 255, 255)); + mylink.setFont(new java.awt.Font("Dialog", 0, 12)); + mylink.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); + mylink.setText("coucou"); + mylink.setAlignmentX(0.5F); + mylink.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); + mylink.setMaximumSize(new java.awt.Dimension(300, 40)); + mylink.setMinimumSize(new java.awt.Dimension(300, 40)); + mylink.setOpaque(true); + mylink.setPreferredSize(new java.awt.Dimension(300, 40)); + mylink.addMouseListener(new java.awt.event.MouseAdapter() { + @Override + public void mousePressed(final java.awt.event.MouseEvent evt) { + mylinkMousePressed(evt); + } + }); + + jPanel1.add(mylink); + + getContentPane().add(jPanel1); + + jPanel3.setLayout(new javax.swing.BoxLayout(jPanel3, + javax.swing.BoxLayout.X_AXIS)); + + jPanel3.setMaximumSize(new java.awt.Dimension(320, 10)); + jPanel3.setMinimumSize(new java.awt.Dimension(320, 10)); + jPanel3.setPreferredSize(new java.awt.Dimension(320, 10)); + getContentPane().add(jPanel3); + + pack(); + }// + + private void mylinkMousePressed(final java.awt.event.MouseEvent evt) { + JBrowserLauncher.openURL("http://www.gnu.org/licenses/gpl.txt"); + this.dispose();// TODO add your handling code here: + } + + private void formWindowDeactivated(final java.awt.event.WindowEvent evt) { + this.dispose();// TODO add your handling code here: + } + + private void formMousePressed(final java.awt.event.MouseEvent evt) { + this.dispose();// TODO add your handling code here: + } + + private void mytxtMousePressed(final java.awt.event.MouseEvent evt) { + this.dispose();// TODO add your handling code here: + } + + // Variables declaration - do not modify + private javax.swing.JPanel jPanel1; + private javax.swing.JPanel jPanel2; + private javax.swing.JPanel jPanel3; + private javax.swing.JLabel mylink; + private javax.swing.JLabel mytxt; + // End of variables declaration + +} diff --git a/eric/JLogoWindow.java b/eric/JLogoWindow.java new file mode 100644 index 0000000..2d80dd5 --- /dev/null +++ b/eric/JLogoWindow.java @@ -0,0 +1,231 @@ +/* + +Copyright 2006 Eric Hakenholz + +This file is part of C.a.R. software. + +C.a.R. is a free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 3 of the License. + +C.a.R. is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + + */ +package eric; + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.RenderingHints; +import java.awt.Toolkit; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; + +import javax.swing.ImageIcon; +import javax.swing.JFrame; + +import javax.swing.SwingUtilities; +import rene.gui.Global; + +public class JLogoWindow extends JFrame { + + private static int W=300, H=150; + private static myBar Bar=null; + private static int BW=280, BH=7, BY=110;// ProgressBar dimensions + private static volatile int BStep=0; + private static final double BStepMax=1996; + /** + * + */ + private static final long serialVersionUID=1L; + private final ImageIcon backimage=new ImageIcon(getClass().getResource("/rene/zirkel/logowindow.jpg")); + + public JLogoWindow(final boolean aboutBox) { + final Dimension dim=Toolkit.getDefaultToolkit().getScreenSize(); + setSize(W, H); + this.setLocation((dim.width-W)/2, (dim.height-H)/2); + this.setUndecorated(true); + setAlwaysOnTop(true); + setPreferredSize(new java.awt.Dimension(W, H)); + setResizable(false); + setContentPane(new myPanel()); + if (!aboutBox) { + Bar=new myBar(); + getContentPane().add(Bar); + } + } + static public JLogoWindow JLW; + + static public void progress(String message) { + +// System.out.print(BStep+": "+message); +// +// int p=(int) Math.round((BW/BStepMax)*BStep); +// System.out.println(" : "+p); + if (Bar!=null) { + BStep++; + Bar.repaint(); + } + } + + static public void ShowLogoWindow(final boolean aboutBox) { + Thread logothread=new Thread() { + + @Override + public void run() { + JLW=new JLogoWindow(aboutBox); + if (aboutBox) { + JLW.addWindowListener(new WindowAdapter() { + + @Override + public void windowDeactivated(WindowEvent e) { + DisposeLogoWindow(); + } + }); + JLW.addMouseListener(new MouseAdapter() { + + @Override + public void mousePressed(MouseEvent e) { + DisposeLogoWindow(); + } + }); + } + JLW.setVisible(true); + + + // DrawString est extrêmement lent sur certaines machines virtuelles... + // Cela oblige à certaines contorsions si on veut que le dialogue + // apparaisse immédiatement avec l'image de fond, en attendant le texte... + JLW.repaint(); + SwingUtilities.invokeLater(new Runnable() { + + public void run() { + JLW.repaint(); + } + }); + } + }; + logothread.setPriority(Thread.MAX_PRIORITY); + logothread.start(); + + } + + static public void DisposeLogoWindow() { + SwingUtilities.invokeLater(new Runnable() { + + public void run() { + if (JLW!=null) { + JLW.dispose(); + JLW=null; + Bar=null; + BStep=0; + } + } + }); + + } + + class myBar extends javax.swing.JPanel { + + @Override + public void paintComponent(Graphics g) { + super.paintComponent(g); + + Graphics2D g2=(Graphics2D) g; + g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, + RenderingHints.VALUE_ANTIALIAS_ON); + g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, + RenderingHints.VALUE_TEXT_ANTIALIAS_ON); + g2.setRenderingHint(RenderingHints.KEY_RENDERING, + RenderingHints.VALUE_RENDER_QUALITY); + g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, + RenderingHints.VALUE_INTERPOLATION_BICUBIC); + g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, + RenderingHints.VALUE_STROKE_PURE); + + Dimension d=getSize(); + g2.setColor(new Color(255, 255, 255, 230)); + int p=(int) Math.round(((BW-4)/BStepMax)*BStep); + g2.fillRect(2, 2, p, BH-4); + g2.setColor(Color.white); + g2.drawRect(0, 0, BW, BH); + } + + public myBar() { + setBounds((W-BW)/2, BY, BW, BH); + setOpaque(false); + } + } + + class myPanel extends javax.swing.JPanel { + + private boolean firstPaint=true; + + public myPanel() { + super(); + setLayout(null); + } + + @Override + public void paintComponent(Graphics g) { + super.paintComponent(g); + final Graphics2D g2=(Graphics2D) g; + g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, + RenderingHints.VALUE_ANTIALIAS_ON); + g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, + RenderingHints.VALUE_TEXT_ANTIALIAS_ON); + g2.setRenderingHint(RenderingHints.KEY_RENDERING, + RenderingHints.VALUE_RENDER_QUALITY); + g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, + RenderingHints.VALUE_INTERPOLATION_BICUBIC); + g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, + RenderingHints.VALUE_STROKE_PURE); + + + final java.awt.Dimension d=this.getSize(); + g2.drawImage(backimage.getImage(), 0, 0, d.width, d.height, this); + + if (firstPaint) { + firstPaint=false; + } else { + paintStrings(g2); + } + + } + + public void paintStrings(final Graphics2D g2) { + try { + g2.setFont(new Font("Dialog", Font.ITALIC, 13)); + FontMetrics fm=g2.getFontMetrics(); + String s=Global.Loc("splash.message"); + g2.setColor(new Color(191, 215, 255)); + int w=fm.stringWidth(s); + g2.drawString(s, (W-w)/2, 60); + + g2.setFont(new Font("Dialog", Font.PLAIN, 12)); + fm=g2.getFontMetrics(); + s=Global.name("version")+" "+Global.name("program.version"); + g2.setColor(Color.white); + w=fm.stringWidth(s); + g2.drawString(s, (W-w)/2, 85); + + s="Java : "+System.getProperty("java.version"); + g2.setColor(Color.white); + w=fm.stringWidth(s); + g2.drawString(s, (W-w)/2, 100); + } catch (Exception e) { + } + } + } +} diff --git a/eric/JMacOShandler.java b/eric/JMacOShandler.java new file mode 100644 index 0000000..9411542 --- /dev/null +++ b/eric/JMacOShandler.java @@ -0,0 +1,63 @@ +/* + +Copyright 2006 Eric Hakenholz + +This file is part of C.a.R. software. + +C.a.R. is a free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 3 of the License. + +C.a.R. is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + + */ +package eric; + +import javax.swing.SwingUtilities; + +import com.apple.eawt.Application; +import com.apple.eawt.ApplicationAdapter; +import eric.GUI.pipe_tools; + +/** + * + * @author erichake + */ +public class JMacOShandler extends Application { + + /** Creates a new instance of JMacOShandler */ + public JMacOShandler() { + addApplicationListener(new OpenHandler()); + + } + + class OpenHandler extends ApplicationAdapter { + + @Override + public void handleOpenFile(final com.apple.eawt.ApplicationEvent evt) { + final String filename=evt.getFilename(); + if (FileTools.isStartup()) { + FileTools.addStartupFile(filename); + } else { + SwingUtilities.invokeLater(new Runnable() { + public void run() { + FileTools.open(filename); + } + }); + } + } + + @Override + public void handleQuit(final com.apple.eawt.ApplicationEvent e) { + pipe_tools.quitAll(); + } + + + } +} diff --git a/eric/JMacroPrompt.java b/eric/JMacroPrompt.java new file mode 100644 index 0000000..68091dd --- /dev/null +++ b/eric/JMacroPrompt.java @@ -0,0 +1,249 @@ +/* + +Copyright 2006 Eric Hakenholz + +This file is part of C.a.R. software. + + C.a.R. is a free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 3 of the License. + + C.a.R. is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + */ + + + package eric; + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Frame; +import java.awt.Point; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; + +import javax.swing.BorderFactory; +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JComponent; +import javax.swing.JDialog; +import javax.swing.JLabel; +import javax.swing.JTextField; +import javax.swing.SwingConstants; + +import rene.gui.Global; +import rene.zirkel.ZirkelCanvas; +import rene.zirkel.expression.Expression; +import rene.zirkel.objects.ConstructionObject; +import eric.bar.JProperties; +import javax.swing.JPanel; +import rene.gui.Global; + +/** + * + * @author erichake + */ +public class JMacroPrompt extends JDialog { + /** + * + */ + private static final long serialVersionUID = 1L; + // boolean Valid=false; + JTextField T = new JTextField(); + // String S=""; + String InitValue = ""; + ConstructionObject OC; + ZirkelCanvas ZC; + int WindowEventCount = 0; + Color TitleColor = new Color(200, 200, 200); + Color TxtColor = new Color(250, 250, 250); + Color DlogColor = new Color(90, 90, 90); + + private void fixsize(final JComponent cp, final int w, final int h) { + final Dimension d = new Dimension(w, h); + cp.setMaximumSize(d); + cp.setMinimumSize(d); + cp.setPreferredSize(d); + cp.setSize(d); + } + + private JEricPanel margin(final int w) { + final JEricPanel mypan = new JEricPanel(); + fixsize(mypan, w, 1); + mypan.setOpaque(false); + mypan.setFocusable(false); + return mypan; + } + + private boolean isValidExpression(final String myexp) { + boolean bool = true; + try { + final Expression exp = new Expression(myexp, OC.getConstruction(), + OC); + if (!(exp.isValid())) + bool = false; + } catch (final Exception ex) { + bool = false; + } + return bool; + } + + public JMacroPrompt(final Frame f, final ZirkelCanvas zc, + final String oName, final ConstructionObject oc) { + super(f, true); + OC = oc; + ZC = zc; + + try { + InitValue = String.valueOf(OC.getValue()); + } catch (final Exception ex) { + } + + final JPanel content = (JPanel) this.getContentPane(); + this.setUndecorated(true); + content.setLayout(new javax.swing.BoxLayout(content, + javax.swing.BoxLayout.Y_AXIS)); + content.setBackground(DlogColor); + // this.setBackground(new Color(0.2f, 0.2f, 0.2f, 0.5f)); + // content.setOpaque(false); + + final JLabel p1 = new JLabel(Global.name("macro.prompt.prompt") + " :"); + p1.setHorizontalAlignment(SwingConstants.CENTER); + fixsize(p1, 300, 15); + p1.setAlignmentX(0.5f); + p1.setOpaque(false); + p1.setFont(new java.awt.Font(Global.GlobalFont, 1, 12)); + p1.setForeground(TitleColor); + + final JEricPanel p2 = new JEricPanel(); + p2 + .setLayout(new javax.swing.BoxLayout(p2, + javax.swing.BoxLayout.X_AXIS)); + final JLabel p21 = new JLabel(oName); + final JButton okbtn = new JButton(); + okbtn.setIcon(new ImageIcon(getClass().getResource( + "/eric/GUI/icons/palette/Mvalid.png"))); + okbtn.setBorder(BorderFactory.createEmptyBorder()); + okbtn.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(final MouseEvent e) { + doclose(); + } + }); + okbtn.setContentAreaFilled(false); + final JButton cancelbtn = new JButton(); + cancelbtn.setIcon(new ImageIcon(getClass().getResource( + "/eric/GUI/icons/palette/Mcancel.png"))); + cancelbtn.setBorder(BorderFactory.createEmptyBorder()); + cancelbtn.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(final MouseEvent e) { + T.setText(InitValue); + try { + OC.setExpression(T.getText(), OC.getConstruction()); + OC.setSlider(false); + } catch (final Exception ex) { + } + ZC.recompute(); + ZC.validate(); + ZC.repaint(); + T.requestFocus(); + T.selectAll(); + } + }); + cancelbtn.setContentAreaFilled(false); + fixsize(p21, 120, 18); + fixsize(T, 118, 18); + p2.add(margin(5)); + p2.add(p21); + p2.add(margin(10)); + p2.add(T); + p2.add(margin(5)); + p2.add(cancelbtn); + p2.add(margin(5)); + p2.add(okbtn); + p2.add(margin(5)); + + fixsize(p2, 300, 30); + p2.setAlignmentX(0.5f); + p2.setOpaque(false); + p21.setOpaque(false); + p21.setFont(new java.awt.Font(Global.GlobalFont, 1, 12)); + T.setFont(new java.awt.Font(Global.GlobalFont, 1, 12)); + p21.setForeground(TxtColor); + T.setText(JProperties.Point_To_Comma(InitValue, OC.getConstruction(), + true)); + + content.add(p1); + content.add(p2); + + T.addKeyListener(new KeyAdapter() { + @Override + public void keyPressed(final KeyEvent e) { + if ((e.getKeyCode() == KeyEvent.VK_ENTER) + || (e.getKeyCode() == KeyEvent.VK_ESCAPE)) { + doclose(); + } + + } + + @Override + public void keyReleased(final KeyEvent e) { + final String e1 = JProperties.Comma_To_Point(T.getText(), OC + .getConstruction(), true); + final String myexp = (isValidExpression(e1)) ? e1 : "invalid"; + try { + OC.setExpression(myexp, OC.getConstruction()); + OC.setSlider(false); + } catch (final Exception ex) { + } + ZC.recompute(); + ZC.validate(); + ZC.repaint(); + } + }); + + this.addWindowListener(new WindowAdapter() { + @Override + public void windowOpened(final WindowEvent e) { + T.requestFocus(); + T.selectAll(); + } + }); + + pack(); + final Point pt = zc.getLocationOnScreen(); + pt.x += zc.getSize().width / 2 - this.getSize().width / 2; + pt.y += zc.getSize().height - this.getSize().height; + this.setLocation(pt); + this.setVisible(true); + } + + public void doclose() { + final String e1 = JProperties.Comma_To_Point(T.getText(), OC + .getConstruction(), true); + final String myexp = (isValidExpression(e1)) ? e1 : InitValue; + + try { + OC.setExpression(myexp, OC.getConstruction()); + OC.setSlider(false); + } catch (final Exception ex) { + } + ZC.recompute(); + ZC.validate(); + ZC.repaint(); + setVisible(false); + dispose(); + } + +} diff --git a/eric/JPointName.java b/eric/JPointName.java new file mode 100644 index 0000000..19efbf4 --- /dev/null +++ b/eric/JPointName.java @@ -0,0 +1,278 @@ +/* + +Copyright 2006 Eric Hakenholz + +This file is part of C.a.R. software. + + C.a.R. is a free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 3 of the License. + + C.a.R. is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + */ + + + package eric; + +import java.awt.AlphaComposite; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.Graphics2D; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.util.ArrayList; + +import javax.swing.BorderFactory; +import javax.swing.JButton; +import eric.JEricPanel; +import javax.swing.SwingConstants; + +import rene.gui.Global; +import rene.zirkel.construction.Construction; +import rene.zirkel.objects.ConstructionObject; + +/** + * + * @author erichake + */ +public class JPointName { + // private String StartLetter="\u03b6"; + private static String GenericLetter = "P"; + private static String majLettersSet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + private static String minLettersSet = "abcdefghijklmnopqrstuvwxyz"; + private static String greekmajLettersSet = "\u0391\u0392\u0393\u0394\u0395\u0396" + + "\u0397\u0398\u0399\u039A\u039B\u039C\u039D\u039E\u039F\u03A0\u03A1\u03A3" + + "\u03A4\u03A5\u03A6\u03A7\u03A8\u03A9"; + private static String greekminLettersSet = "\u03B1\u03B2\u03B3\u03B4\u03B5\u03B6\u03B7\u03B8\u03B9" + + "\u03BA\u03BB\u03BC\u03BD\u03BE\u03BF\u03C0\u03C1\u03C3\u03C4\u03C5\u03C6" + + "\u03C7\u03C8\u03C9"; + private static ArrayList LettersSet = new ArrayList(); + + private String LetterSuffix = ""; + // Ct should be the ZF.ZC.getConstruction() object : + private Construction ZCcn = null; + private JButton PaletteBtn = null; + private JZirkelCanvas JZF = null; + + public static int minLettersSetCode = 1; + + // private String Letters=majLettersSet; + // 0:majLettersSet , 1:minLettersSet , 2:greekmajLettersSet , + // 3:greekminLettersSet + private int LetterSetCode = 0; + private int StartLetter = 0; + + /** + * Creates a new instance of JPointLabel + * + * @param jzf + */ + public JPointName(final JZirkelCanvas jzf) { + JZF = jzf; + ZCcn = JZF.getZF().ZC.getConstruction(); + PaletteBtn = new JPaletteButton(JZF); + } + + public JPointName() { + LettersSet.add(majLettersSet); + LettersSet.add(minLettersSet); + LettersSet.add(greekmajLettersSet); + LettersSet.add(greekminLettersSet); + } + + public String getCurrentLetterSet() { + return (String) LettersSet.get(LetterSetCode); + } + + public int getCurrentLetterSetCode() { + return LetterSetCode; + } + + static void fixsize(final Component cp, final int w, final int h) { + final Dimension d = new Dimension(w, h); + cp.setMaximumSize(d); + cp.setMinimumSize(d); + cp.setPreferredSize(d); + cp.setSize(d); + } + + public JButton getPaletteButton(){ + return PaletteBtn; + } + + public void addPaletteJLabel(final JEricPanel jp) { + fixsize(PaletteBtn, 28, jp.getSize().height); + jp.add(PaletteBtn); + } + + public void setEnabledJLabel(final boolean bool) { + PaletteBtn.setEnabled(bool); + + } + + public void addSuffixChar() { + if (LetterSuffix.equals("''")) + LetterSuffix = ""; + else + LetterSuffix += "'"; + } + + void setSuffixChar(final String suff) { + LetterSuffix = suff; + } + + public static String getGenericName(final Construction myC) { + int i = 1; + ConstructionObject o = myC.find(GenericLetter + i); + while (o != null) { + i++; + o = myC.find(GenericLetter + i); + } + + return (GenericLetter + i); + } + + public String getBetterName(final Construction myC, + final boolean setPaletteTxt) { + final String Letters = getCurrentLetterSet(); + String s = Letters.substring(StartLetter, StartLetter + 1); + if (ZCcn == null) { + s = getGenericName(myC); + } else if (Global.getParameter("options.point.shownames", false)) { + int i = Letters.indexOf(s); + final int k = i; + s += LetterSuffix; + ConstructionObject o = ZCcn.find(s); + while ((i < (Letters.length() - 1)) && (o != null)) { + i++; + s = Letters.substring(i, i + 1) + LetterSuffix; + o = ZCcn.find(s); + } + + i = -1; + while ((i < k) && (o != null)) { + i++; + s = Letters.substring(i, i + 1) + LetterSuffix; + o = ZCcn.find(s); + } + + if (o != null) { + s = getGenericName(ZCcn); + } + + } else + s = getGenericName(ZCcn); + if ((PaletteBtn != null) && (setPaletteTxt)) + PaletteBtn.setText(s); + return s; + } + + public static int findSet(final String s) { + for (int i = 0; i < LettersSet.size(); i++) { + final String mySet = (String) LettersSet.get(i); + if (mySet.indexOf(s) != -1) + return i; + } + return -1; + } + + public boolean isLetterAllowed(final String s) { + return (getCurrentLetterSet().indexOf(s) != -1); + } + + public boolean isLetterAccepted(final String s) { + if (ZCcn != null) + return (ZCcn.find(s) == null); + else + return false; + } + + public String setStartLetter(final String s) { + if (isLetterAllowed(s)) { + StartLetter = getCurrentLetterSet().indexOf(s); + } + + return getBetterName(null, true); + } + + public String setLetterSet(final int i) { + LetterSetCode = i; + StartLetter = 0; + return getBetterName(null, true); + } + +} + +class JPaletteButton extends JButton implements MouseListener { + /** + * + */ + private static final long serialVersionUID = 1L; + private final JZirkelCanvas JZF; + int[] x = { 0, 10, 0 }; + int[] y = { 0, 10, 10 }; + + @Override + public void paintComponent(final java.awt.Graphics g) { + + final Dimension d = this.getSize(); + + final int sze = 6; + x[0] = d.width - sze; + y[0] = d.height; + x[1] = d.width; + y[1] = d.height - sze; + x[2] = d.width; + y[2] = d.height; + final Graphics2D g2 = (Graphics2D) g; + + g2.setComposite(AlphaComposite.SrcOver); + g2.setColor(new Color(50, 50, 50)); + g2.fillPolygon(x, y, 3); + + g2 + .setComposite(AlphaComposite.getInstance( + AlphaComposite.SRC_OVER, 1f)); + super.paintComponent(g); + } + + public JPaletteButton(final JZirkelCanvas jzf) { + JZF = jzf; + setOpaque(false); + setContentAreaFilled(false); + setBorder(BorderFactory.createEmptyBorder()); + setFont(new java.awt.Font(Global.GlobalFont, 1, 14)); + setForeground(new Color(50, 50, 50)); + setHorizontalAlignment(SwingConstants.CENTER); + setVerticalAlignment(SwingConstants.CENTER); + addMouseListener(this); + } + + public void mouseClicked(final MouseEvent e) { + } + + public void mousePressed(final MouseEvent e) { + System.out.println("mousePressed"); + if (isEnabled()) { + JZF.getZF().setinfo("nom_points", false); + new JCharacterPalette(JZF, this); + } + } + + public void mouseReleased(final MouseEvent e) { + } + + public void mouseEntered(final MouseEvent e) { + } + + public void mouseExited(final MouseEvent e) { + } +} diff --git a/eric/JSelectPopup.java b/eric/JSelectPopup.java new file mode 100644 index 0000000..a4fcba3 --- /dev/null +++ b/eric/JSelectPopup.java @@ -0,0 +1,208 @@ +/* + +Copyright 2006 Eric Hakenholz + +This file is part of C.a.R. software. + + C.a.R. is a free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 3 of the License. + + C.a.R. is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + */ + + + package eric; + +import java.awt.Color; +import java.awt.Font; +import java.awt.MouseInfo; +import java.awt.Point; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.util.Vector; + +import javax.swing.JMenuItem; +import javax.swing.JPopupMenu; +import javax.swing.SwingUtilities; +import javax.swing.event.PopupMenuEvent; +import javax.swing.event.PopupMenuListener; + +import rene.gui.Global; +import rene.util.MyVector; +import rene.zirkel.ZirkelCanvas; +import rene.zirkel.objects.ConstructionObject; +import rene.zirkel.tools.EditTool; + +/** + * + * @author erichake + */ +// This class is only instanciated by JSelectPopup +// It is a "modal" popup for complex tools. Popup menu appear +// in a 1 pixel w/h modal JDialog : it seems it's in ZirkelCanvas, but it's +// not... +public class JSelectPopup extends JPopupMenu implements MouseListener, +PopupMenuListener { + /** + * + */ + private static final long serialVersionUID = 1L; + private static int xclic,yclic; + private static boolean iscaller=false; + ZirkelCanvas ZC; + Vector V = new Vector(); + String CallerObject = "RightClick"; + boolean RightClicked; + + public JSelectPopup(final ZirkelCanvas zc,final MyVector v, boolean RightClicked) { + init(zc, v); + addPopupMenuListener(this); + Point loc=MouseInfo.getPointerInfo().getLocation(); + SwingUtilities.convertPointFromScreen(loc, zc); + xclic=loc.x; + yclic=loc.y; + show(zc, loc.x, loc.y); + this.RightClicked = RightClicked; + } + + public void init(final ZirkelCanvas zc, final MyVector v) { + ZC = zc; + // A bit of a hack : need to know where was the calling method... + // getStackTrace stores the whole history of caller methods + final StackTraceElement[] trace = new Throwable().getStackTrace(); + for (final StackTraceElement element : trace) { + if (element.getClassName().startsWith("rene.zirkel.tools")) { + final String s = element.getClassName(); + CallerObject = s.split("\\.")[3]; + break; + } + } + + String aa = ""; + + try { + aa = Global.Loc("selectpopup." + CallerObject); + } catch (final Exception e) { + } + + JMenuItem m = new JMenuItem(aa + Global.Loc("selectpopup.whatobject")); + + m.setBackground(Color.WHITE); + m.setForeground(Color.DARK_GRAY); + + m.setFont(new Font("Dialog", 3, 12)); + m.setActionCommand("-1,false"); + + m.setEnabled(false); + m.addMouseListener(this); + this.add(m); + + for (int i = 0; i < v.size(); i++) { + final ConstructionObject o = (ConstructionObject) v.elementAt(i); + V.add(o); + final String tp = o.getName() + " : " + o.getText().split(" ")[0]; + m = new JMenuItem(tp); + m.setForeground(o.getColor()); + m.setBackground(new Color(240, 240, 240)); + m.setFont(new Font("Dialog", 1, 12)); + + m.setActionCommand(String.valueOf(i) + "," + o.selected()); + m.setRolloverEnabled(true); + + m.addMouseListener(this); + m.addActionListener(new ActionListener() { + public void actionPerformed(final ActionEvent event) { + final JMenuItem jm = (JMenuItem) event.getSource(); + doaction(jm.getActionCommand(), event.getModifiers()); + } + }); + this.add(m); + } + + + } + + public static int getMouseX(){ + return xclic; + } + public static int getMouseY(){ + return yclic; + } + public static boolean isCallerObject(){ + return iscaller; + } + + public int row(final String str) { + return Integer.parseInt(str.split(",")[0]); + } + + public boolean sel(final String str) { + final String bl = str.split(",")[1].toLowerCase(); + return (bl.equals("true")); + } + + public void doaction(final String str, final int modifier) { + final ConstructionObject o = (ConstructionObject) V.elementAt(row(str)); + o.setSelected(sel(str)); + iscaller=true; + if(RightClicked){ + ZC.clearSelected(); + eric.bar.JPropertiesBar.EditObject(o, true, false); + } else { +// System.out.println(o.getName()); + ZC.setConstructionObject(o); + } + iscaller=false; + } + + public void mouseClicked(final MouseEvent e) { + } + + public void mousePressed(final MouseEvent e) { + } + + public void mouseReleased(final MouseEvent e) { + } + + public void mouseEntered(final MouseEvent e) { + final JMenuItem jm = (JMenuItem) e.getSource(); + final int i = row(jm.getActionCommand()); + if ((i > -1) && (!sel(jm.getActionCommand()))) { + final ConstructionObject o = (ConstructionObject) V.elementAt(i); + o.setSelected(true); + ZC.repaint(); + } + } + + public void mouseExited(final MouseEvent e) { + final JMenuItem jm = (JMenuItem) e.getSource(); + final int i = row(jm.getActionCommand()); + if ((i > -1) && (!sel(jm.getActionCommand()))) { + final ConstructionObject o = (ConstructionObject) V.elementAt(i); + o.setSelected(false); + ZC.repaint(); + } + } + + // + public void popupMenuWillBecomeVisible(final PopupMenuEvent e) { + } + + public void popupMenuWillBecomeInvisible(final PopupMenuEvent e) { + } + + public void popupMenuCanceled(final PopupMenuEvent e) { + } + +} diff --git a/eric/JSprogram/.DS_Store b/eric/JSprogram/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..d2ce7cd1b1b022805c2327b8734963ae475ed990 GIT binary patch literal 8196 zcmeHMU2YRG5dNG56k4GMRY841`^ZxzZm@*3QV<11t3CqxSxQQpR83OUw>?G=#Q}N% z4!{k&30S>rZMfk0CoUW*~Qj2Ijm^%T>4TgxjS`Q zLp;#O35FQq0@>2+cq1wh6^IH%1)>5`f&W1PezT=j1K)l7G>%b$sKC8cKz<(*cCo3m zxwZP!!9hy^+6r%L<2CC5#U#$A&gRxCl$^GDFb-;5iD4|9&l8zWn>w3YYvC{!4&yu< zSD_g7PF$kXVNz@37!`;LEGrgQ8D#=mgw_n?e zdPlG4?34M9kEm7_(yMa0z_LZH`;0roTe6&?!>fxBT65;Q5W_0;F&Q&_53)$+_$)R0 zz2a()bk8LE2KPM}g^~R6@y{IoSYsFcyTlK;CmFR7rnbw4+vStbT~}^-?}TH@+_bT+ zWzzienYI|upB!(IEhBdzM>NN-xz4i7k@`yX7%#axS>IKNNwdw5qgG&AyAI7eAHQ9| zk8wcnL-rF@Kd>InJD=rAf#nEaxr&S|z0f)&_w)~sl2e4@#1<8}BMOvloI6tg@9~on z&jIep#>FtB0)J5fQ)wPH8zgkK^%Awz+6nt-c4;y%w^kt>v>d0^a-4Sl4?|ujoGO^q Z+1y&*Vf*I?0rQ$Be*bj?;&3k&_zkH^YDoY9 literal 0 HcmV?d00001 diff --git a/eric/JSprogram/.cvsignore b/eric/JSprogram/.cvsignore new file mode 100755 index 0000000..e43b0f9 --- /dev/null +++ b/eric/JSprogram/.cvsignore @@ -0,0 +1 @@ +.DS_Store diff --git a/eric/JSprogram/Const.java b/eric/JSprogram/Const.java new file mode 100644 index 0000000..8c158f8 --- /dev/null +++ b/eric/JSprogram/Const.java @@ -0,0 +1,31 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package eric.JSprogram; + + + +/** + * + * @author erichake + */ +public class Const{ + public double BLA=3.5; +public Const(){ + +} +public double getBLA(){ + return BLA; +} + +public double m(String a,String b){ + return 1.0; +} + +public double m(String a){ + return 2.0; +} + +} diff --git a/eric/JSprogram/JSBlankIcon.java b/eric/JSprogram/JSBlankIcon.java new file mode 100644 index 0000000..a33f927 --- /dev/null +++ b/eric/JSprogram/JSBlankIcon.java @@ -0,0 +1,31 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package eric.JSprogram; + +import java.awt.Dimension; +import javax.swing.BorderFactory; +import javax.swing.JButton; + +/** + * + * @author erichake + */ +public class JSBlankIcon extends JButton{ +public JSBlankIcon(int size) { + this.setBorder(BorderFactory.createEmptyBorder()); + fixsize(size); + this.setContentAreaFilled(false); + this.setOpaque(false); + } + +private void fixsize(final int sze) { + final Dimension d=new Dimension(sze, sze); + this.setMaximumSize(d); + this.setMinimumSize(d); + this.setPreferredSize(d); + this.setSize(d); + } +} diff --git a/eric/JSprogram/JSButton.java b/eric/JSprogram/JSButton.java new file mode 100644 index 0000000..f17566b --- /dev/null +++ b/eric/JSprogram/JSButton.java @@ -0,0 +1,144 @@ +/* + +Copyright 2006 Eric Hakenholz + +This file is part of C.a.R. software. + +C.a.R. is a free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 3 of the License. + +C.a.R. is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + + */ +package eric.JSprogram; + +import eric.GUI.themes; +import eric.JZirkelCanvas; +import java.awt.AlphaComposite; +import java.awt.BasicStroke; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.RenderingHints; +import java.awt.Stroke; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.image.FilteredImageSource; +import java.awt.image.ImageFilter; + +import javax.swing.BorderFactory; +import javax.swing.GrayFilter; +import javax.swing.ImageIcon; +import javax.swing.JButton; +import rene.zirkel.ZirkelCanvas; + +public class JSButton extends JButton implements MouseListener { + +// private final ImageIcon myimage; + int iconsize=24; + boolean isEntered=false; // Mouseover ? + boolean isDisabled; + private String Name; + + // String Shortcut; + @Override + public void paintComponent(final java.awt.Graphics g) { + final java.awt.Dimension d=this.getSize(); + final int w=d.width; + final int h=d.height; + + if (g==null) { + return; + } + + super.paintComponent(g); + final Graphics2D g2=(Graphics2D) g; + g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, + RenderingHints.VALUE_ANTIALIAS_ON); + g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, + RenderingHints.VALUE_TEXT_ANTIALIAS_ON); + g2.setRenderingHint(RenderingHints.KEY_RENDERING, + RenderingHints.VALUE_RENDER_QUALITY); + g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, + RenderingHints.VALUE_INTERPOLATION_BICUBIC); + g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, + RenderingHints.VALUE_STROKE_PURE); + if (isDisabled) { + final ImageFilter filter=new GrayFilter(true, 60); + final Image disImage=createImage(new FilteredImageSource(themes.getPaletteImage(Name).getSource(), filter)); + final ImageIcon myicn=new ImageIcon(disImage); + g2.drawImage(myicn.getImage(), 0, 0, w, h, this); + return; + } + //not elegant... just for one icon... + if(Name.equals("monkey")){ + g2.drawImage(themes.resizeExistingIcon("/eric/GUI/icons/themes/common/monkeybtn_off.png", 22, 15).getImage(), 1, 4, 22, 15, this); + } else { + g2.drawImage(themes.getPaletteImage(Name), 0, 0, w, h, this); + } + + if (isEntered) { + final AlphaComposite ac=AlphaComposite.getInstance( + AlphaComposite.SRC_OVER, 0.1f); + g2.setComposite(ac); + g2.setColor(new Color(0, 0, 80)); + final Stroke stroke=new BasicStroke(3f); + g2.setStroke(stroke); + g2.drawRect(1, 1, w-2, h-2); + + } + } + + public JSButton(String name, int size,boolean enabled) { + isDisabled=!enabled; + iconsize=size; + Name=name; + this.setBorder(BorderFactory.createEmptyBorder()); + fixsize(iconsize); + this.addMouseListener(this); + this.setContentAreaFilled(false); + this.setOpaque(false); + this.setFocusable(false); + } + + + + private void fixsize(final int sze) { + final Dimension d=new Dimension(sze, sze); + this.setMaximumSize(d); + this.setMinimumSize(d); + this.setPreferredSize(d); + this.setSize(d); + } + + public void mouseClicked(MouseEvent e) { + } + + public void mousePressed(MouseEvent e) { + } + + public void mouseReleased(MouseEvent e) { + } + + public void mouseEntered(final MouseEvent e) { + isEntered=true; + repaint(); + + } + + public void mouseExited(final MouseEvent e) { + isEntered=false; + repaint(); + + } +} + + diff --git a/eric/JSprogram/JSEditor.form b/eric/JSprogram/JSEditor.form new file mode 100644 index 0000000..75689c6 --- /dev/null +++ b/eric/JSprogram/JSEditor.form @@ -0,0 +1,877 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/eric/JSprogram/JSEditor.java b/eric/JSprogram/JSEditor.java new file mode 100644 index 0000000..f7f5bd3 --- /dev/null +++ b/eric/JSprogram/JSEditor.java @@ -0,0 +1,2977 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +/* + * JConsole2.java + * + * Created on 20 avr. 2009, 08:24:41 + * by Éric Hakenholz, + * with somme addons by Alain Busser + * wwith addons by Patrice Debrabant + */ +package eric.JSprogram; + +import eric.JBrowserLauncher; +import eric.JZirkelCanvas; +import eric.OS; +import java.awt.Color; +import java.awt.Cursor; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.FontMetrics; +import java.awt.Insets; +import java.awt.MouseInfo; +import java.awt.Point; +import java.awt.Toolkit; +import java.awt.event.ActionEvent; +import java.awt.event.InputEvent; +import java.awt.event.KeyEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.StringReader; +import java.util.ArrayList; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import javax.swing.AbstractAction; +import javax.swing.BorderFactory; +import javax.swing.JComponent; +import javax.swing.JOptionPane; +import javax.swing.JTextPane; +import javax.swing.KeyStroke; +import javax.swing.SwingUtilities; +import javax.swing.ToolTipManager; +import javax.swing.border.BevelBorder; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; +import javax.swing.event.UndoableEditEvent; +import javax.swing.event.UndoableEditListener; +import javax.swing.text.AbstractDocument; +import javax.swing.text.Element; +import javax.swing.text.Style; +import javax.swing.text.StyleConstants; +import javax.swing.text.StyledDocument; +import javax.swing.text.TabSet; +import javax.swing.text.TabStop; +import javax.swing.undo.CannotRedoException; +import javax.swing.undo.CannotUndoException; +import javax.swing.undo.UndoManager; +import javax.swing.undo.UndoableEdit; +import rene.gui.Global; + +/** + * + * @author erichake + */ +public class JSEditor extends javax.swing.JFrame { + +// final UndoManager undo=new UndoManager(); + StyledDocument doc; + final int ctrlkey=(OS.isMac())?InputEvent.META_DOWN_MASK + :InputEvent.CTRL_DOWN_MASK; + private boolean NoTypeNoClic=true; + UndoManager undo; + private Point origin; + private Point winloc; + private Point current; + private int xx; + private int yy; + private int w; + private int h; + private int JSsel=0; + private Pattern p; + private boolean matchFound = false; + protected static int TailleTexte=16; + private String filename=""; // script in file + private String scriptname=""; // script in figure + private ScriptItem ITEM; + private boolean FlagSimp=false; // Dibs : drapeau interface simplifiée + private boolean infrench; // Dibs + private boolean pseudoCode=false; + private boolean ancienPseudoCode=false; + + /** Creates new form JConsole2 */ + public JSEditor(ScriptItem item) { + infrench = Global.getParameter("language", "").equals("fr"); + ITEM=item; + initComponents(); + if (JZirkelCanvas.getCurrentZC().is3D()){ + c_carmetal.setMaximumSize(new java.awt.Dimension(182, 380)); + c_carmetal.setMinimumSize(new java.awt.Dimension(182, 370)); + c_carmetal.setPreferredSize(new java.awt.Dimension(182, 370)); + } + else { + c_carmetal.setMaximumSize(new java.awt.Dimension(182, 290)); + c_carmetal.setMinimumSize(new java.awt.Dimension(182, 280)); + c_carmetal.setPreferredSize(new java.awt.Dimension(182, 280)); + } + doc=script_area.getStyledDocument(); + initCaRMetalBtns(); + initScriptArea(); + initUndoRedo(); + initJSlist(); + setWindowTitle(Loc("JSeditor.title")); + if ((OS.isMac())) { + fixsize(macpanel, 1, 1); + winpanel.removeAll(); + winpanel.add(title_lbl); + winpanel.revalidate(); + } else { + fixsize(winpanel, 1, 1); + } + this.setLocationRelativeTo(JZirkelCanvas.getCurrentZC()); + errorpanel.removeAll(); + errorpanel.revalidate(); + + setTabs(script_area, 3); + setSize(920, 690); + + // Show tool tips immediately + ToolTipManager.sharedInstance().setInitialDelay(50); + setVisible(true); + + + } + + public void setBackBtnEnabled(boolean bool) { + backbtn.setEnabled(bool); + } + + public void setScriptName(String s) { + scriptname=s; + } + + public String getScriptName() { + return scriptname; + } + + public void setFileName(String s) { + filename=s; + } + + public String getFileName() { + return filename; + } + + public void setWindowTitle(String s) { + title_lbl.setText(s); + } + + public String getWindowTitle() { + return title_lbl.getText(); + } + + public boolean isFileOpened() { + return !(filename.equals("")); + } + + private void initJSlist() { + } + + static void fixsize(final JComponent cp, final int w, final int h) { + final Dimension d=new Dimension(w, h); + cp.setMaximumSize(d); + cp.setMinimumSize(d); + cp.setPreferredSize(d); + cp.setSize(d); + } + + public void NoTypeNoClic() { + NoTypeNoClic=true; + } + + public void addOrChange(String st) { + if (NoTypeNoClic) { + undo.undo(); + } else { + NoTypeNoClic(); + } + addToScript(st); + } + + public void addToScript(String st) { + script_area.requestFocus(); + script_area.replaceSelection(st); +// syntaxColoring(); + script_area.requestFocus(); + } + + public void clearSelection() { + script_area.replaceSelection(""); + script_area.requestFocus(); + } + + public JSIcon addCMicon(String obj, String syntax) { + JSIcon jsi=new JSIcon(this, obj, syntax); + jsi.setToolTipText(Loc("JSeditor."+obj)); + c_carmetal.add(jsi); + return jsi; + } + + /** + * + * @param obj + * @param example + * @return + */ + public JSButton addJSIcon(String obj, final String example) { + JSButton jb=new JSButton(obj, 24, true); + jb.addMouseListener(new MouseAdapter() { + + @Override + public void mousePressed(MouseEvent e) { + addToScript(example); + } + }); + js_btns.add(jb); + return jb; + } + + public JSButton addCMicon2(String obj, final String example) { //Dibs + JSButton jb=new JSButton(obj, 24, true); + jb.setToolTipText(Loc("JSeditor."+obj)); + jb.addMouseListener(new MouseAdapter() { + + @Override + public void mousePressed(MouseEvent e) { + addToScript(example); + } + }); + c_carmetal.add(jb); + return jb; + } + + public void addBlankIcon(int nb, int size) { + for (int i=0; i=)", Pattern.MULTILINE); + m = p.matcher(scp); + matchFound = m.find(); + while (matchFound) { + posCurseur=script_area.getCaretPosition(); + scp= m.replaceFirst(String.valueOf(m.group(1))+"≥"); + script_area.setText(scp); + try { + script_area.setCaretPosition(posCurseur-1); + } + catch(Exception e) { + } + m = p.matcher(scp); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*)(?:>=)", Pattern.MULTILINE); + m = p.matcher(scp); + matchFound = m.find(); + while (matchFound) { + posCurseur=script_area.getCaretPosition(); + scp= m.replaceFirst(String.valueOf(m.group(1))+"≥"); + script_area.setText(scp); + try { + script_area.setCaretPosition(posCurseur-1); + } + catch(Exception e) { + } + m = p.matcher(scp); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]*)(?:!=)", Pattern.MULTILINE); + m = p.matcher(scp); + matchFound = m.find(); + while (matchFound) { + posCurseur=script_area.getCaretPosition(); + scp= m.replaceFirst(String.valueOf(m.group(1))+"≠"); + script_area.setText(scp); + try { + script_area.setCaretPosition(posCurseur-1); + } + catch(Exception e) { + } + m = p.matcher(scp); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*)(?:!=)", Pattern.MULTILINE); + m = p.matcher(scp); + matchFound = m.find(); + while (matchFound) { + posCurseur=script_area.getCaretPosition(); + scp= m.replaceFirst(String.valueOf(m.group(1))+"≠"); + script_area.setText(scp); + try { + script_area.setCaretPosition(posCurseur-1); + } + catch(Exception e) { + } + m = p.matcher(scp); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]*)\\*", Pattern.MULTILINE); + m = p.matcher(scp); + matchFound = m.find(); + while (matchFound) { + posCurseur=script_area.getCaretPosition(); + scp= m.replaceFirst(String.valueOf(m.group(1))+"×"); + script_area.setText(scp); + try { + script_area.setCaretPosition(posCurseur); + } + catch(Exception e) { + } + m = p.matcher(scp); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*)\\*", Pattern.MULTILINE); + m = p.matcher(scp); + matchFound = m.find(); + while (matchFound) { + posCurseur=script_area.getCaretPosition(); + scp= m.replaceFirst(String.valueOf(m.group(1))+"×"); + script_area.setText(scp); + try { + script_area.setCaretPosition(posCurseur); + } + catch(Exception e) { + } + m = p.matcher(scp); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]*)Infinity", Pattern.MULTILINE); + m = p.matcher(scp); + matchFound = m.find(); + while (matchFound) { + posCurseur=script_area.getCaretPosition(); + scp= m.replaceFirst(String.valueOf(m.group(1))+"∞"); + script_area.setText(scp); + try { + script_area.setCaretPosition(posCurseur-7); + } + catch(Exception e) { + } + m = p.matcher(scp); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*)Infinity", Pattern.MULTILINE); + m = p.matcher(scp); + matchFound = m.find(); + while (matchFound) { + posCurseur=script_area.getCaretPosition(); + scp= m.replaceFirst(String.valueOf(m.group(1))+"∞"); + script_area.setText(scp); + try { + script_area.setCaretPosition(posCurseur-7); + } + catch(Exception e) { + } + m = p.matcher(scp); + matchFound = m.find(); + } + } + else { + pseudoCode=false; + if (ancienPseudoCode) { + js_btns.removeAll(); + c_carmetal.removeAll(); + initCaRMetalBtns(); + js_btns.revalidate(); + c_carmetal.revalidate(); + ancienPseudoCode=false; + } + } + scp="\n"+scp+"\n"; +// scp=scp.replace("(", "@").replace(")", "@"); + + //CaRMetal javascript instructions coloring : + String[] allnames=JSFunctions.getKeywords(); + ArrayList carmetal_matches=new ArrayList(); + for (int i=1; i js_matches=new ArrayList(); + for (int i=0; i js_maths_matches=new ArrayList(); + if (pseudoCode) { + for (int i=0; i js_comments=new ArrayList(); +// Matcher m = Pattern.compile("[\n\t]+(\\Q//\\E[^\n]*)", Pattern.MULTILINE).matcher(scp); + Matcher m=Pattern.compile("(\\Q//\\E[^\n]*)", Pattern.MULTILINE).matcher(scp); + while (m.find()) { + js_comments.add(m.start(1)-1); + js_comments.add(m.end(1)-1); +// System.out.println("start="+m.start(1)+" end="+m.end(1)); +// m = Pattern.compile("/\\*([^*]|\\*+[^*/])*\\*+/").matcher(scp); +// m = Pattern.compile("(\\/\\*.*\\*\\/)").matcher(scp); +// while (m.find()) { +// js_comments.add(m.start(1) - 1); +// js_comments.add(m.end(1) - 1); +// marche pas, je sais pas pourquoi + } +// } + + // Text coloring : + ArrayList text_matches=new ArrayList(); + m=Pattern.compile("\"([^\"]*)\"", Pattern.MULTILINE).matcher(scp); + while (m.find()) { + text_matches.add(m.start(1)-1); + text_matches.add(m.end(1)-1); +// System.out.println("start="+m.start(1)+" end="+m.end(1)); + } + + // Number coloring : + ArrayList number_matches=new ArrayList(); +// m = Pattern.compile("[\\+\\-]?\\d+(\\.\\d*)?([Ee][\\+\\-]?\\d+)?", Pattern.MULTILINE).matcher(scp); + m=Pattern.compile("([0-9\\.]+)", Pattern.MULTILINE).matcher(scp); +// m = Pattern.compile("([0-9\\.\\+\\-]+)", Pattern.MULTILINE).matcher(scp); + while (m.find()) { + number_matches.add(m.start(1)-1); + number_matches.add(m.end(1)-1); +// System.out.println("start="+m.start(1)+" end="+m.end(1)); + } + + doc.setCharacterAttributes(0, script_area.getText().length(), script_area.getStyle("Normal"), true); + + for (int i=0; i,,)"); + addCMicon("intersection", "Intersection(,,)"); + addCMicon("midpoint", "Milieu(,,)"); + addCMicon("bi_syma", "SymétrieAxiale(,,)"); + addCMicon("bi_symc", "SymétrieCentrale(,,)"); + addCMicon("bi_trans", "Translation(,,,)"); + addCMicon("line", "Droite(,,)"); + addCMicon("ray", "DemiDroite(,,)"); + addCMicon("parallel", "Parallèle(,,)"); + addCMicon("plumb", "Perpendiculaire(,,)"); + addCMicon("bi_med", "Médiatrice(,,)"); + addCMicon("bi_biss", "Bissectrice(,,,)"); + addCMicon("segment", "Segment(,,)"); + addCMicon("fixedsegment", "SegmentFixe(,,)"); + addCMicon("vector", "Vecteur(,,)"); + addCMicon("area", "Polygone(,)"); + addCMicon("angle", "Angle(,,,)"); + addCMicon("fixedangle", "AngleFixe(,,,)"); + addCMicon("circle", "Cercle(,,)"); + addCMicon("fixedcircle", "CercleRayon(,,)"); + addCMicon("circle3", "Cercle3(,,,)"); + addCMicon("bi_circ", "Cercle3pts(,,,)"); + addCMicon("bi_arc", "Arc3pts(,,,)"); + addCMicon("quadric", "Quadrique(,,,,,)"); + // addCMicon("text", ""); + addCMicon("expression", "Expression(,\"Votre expression\",,)"); + addCMicon("text", "Texte(,\"Votre message\",,)"); + // addCMicon("image3", ""); + // addBlankIcon(3); + addCMicon("function", "FonctionCartésienne(,-5,5,\"x^2-2*x+1\")"); + addCMicon("parametricfunction", "FonctionParamétrique(,-3.14,3.14,\"3*rcos(t)^3\",\"3*rsin(t)^3\")"); + addCMicon("equationxy", "TracéImplicite(,\"x^3-2*x-y^2+1\")"); + addCMicon("macro", "ExécuterMacro(,\"_x,_y,_z\")"); + } + else { + addCMicon("point", " ⟵ Point(,,)"); + addCMicon("intersection", " ⟵ Intersection(,,)"); + addCMicon("midpoint", " ⟵ Milieu(,,)"); + addCMicon("bi_syma", " ⟵ SymétrieAxiale(,,)"); + addCMicon("bi_symc", " ⟵ SymétrieCentrale(,,)"); + addCMicon("bi_trans", " ⟵ Translation(,,,)"); + addCMicon("line", " ⟵ Droite(,,)"); + addCMicon("ray", " ⟵ DemiDroite(,,)"); + addCMicon("parallel", " ⟵ Parallèle(,,)"); + addCMicon("plumb", " ⟵ Perpendiculaire(,,)"); + addCMicon("bi_med", " ⟵ Médiatrice(,,)"); + addCMicon("bi_biss", " ⟵ Bissectrice(,,,)"); + addCMicon("segment", " ⟵ Segment(,,)"); + addCMicon("fixedsegment", " ⟵ SegmentFixe(,,)"); + addCMicon("vector", " ⟵ Vecteur(,,)"); + addCMicon("area", " ⟵ Polygone(,)"); + addCMicon("angle", " ⟵ Angle(,,,)"); + addCMicon("fixedangle", " ⟵ AngleFixe(,,,)"); + addCMicon("circle", " ⟵ Cercle(,,)"); + addCMicon("fixedcircle", " ⟵ CercleRayon(,,)"); + addCMicon("circle3", " ⟵ Cercle3(,,,)"); + addCMicon("bi_circ", " ⟵ Cercle3pts(,,,)"); + addCMicon("bi_arc", " ⟵ Arc3pts(,,,)"); + addCMicon("quadric", " ⟵ Quadrique(,,,,,)"); + // addCMicon("text", ""); + addCMicon("expression", " ⟵ Expression(,\"Votre expression\",,)"); + addCMicon("text", "=Texte(,\"Votre message\",,)"); + // addCMicon("image3", ""); + // addBlankIcon(3); + addCMicon("function", " ⟵ FonctionCartésienne(,-5,5,\"x^2-2*x+1\")"); + addCMicon("parametricfunction", " ⟵ FonctionParamétrique(,-3.14,3.14,\"3*rcos(t)^3\",\"3*rsin(t)^3\")"); + addCMicon("equationxy", " ⟵ TracéImplicite(,\"x^3-2*x-y^2+1\")"); + addCMicon("macro", " ⟵ ExécuterMacro(\"macroName\",\"_x,_y,_z\")"); + + } + addSeparator(1); + addCMicon("interactiveinput", " ⟵ EntréeInteractive(\"Message\",<\"Point,Segment,Line,Circle\">)"); + addCMicon("aimant", "MettreObjetsMagnétiques(,)"); + addCMicon("hide", "MettreCaché(,<\"vrai,faux\">)"); + addCMicon("type2", "MettreTypePoint(,<\"square,circle,diamond,point,cross,dcross\">)"); + addCMicon("color4", "MettreCouleur(,<\"green,blue,brown,cyan,red,black\">)"); + addCMicon("thickness1", "MettreEpaisseur(,<\"thick,normal,thin\">)"); + addCMicon("partial", "MettrePartiel(,<\"vrai,faux\">)"); + addCMicon("showvalue", "MettreMontrerValeur(,<\"vrai,faux\">)"); + addCMicon("showname", "MettreMontrerNom(,<\"vrai,faux\">)"); + addCMicon("filled", "MettreRempli(,<\"vrai,faux\">)"); + addCMicon("monkey", "Déplacer(,,)"); + addCMicon("nail", "MettreFixe(,<\"vrai,faux\">)"); + // addCMicon("dice", "=Math.ceil(Math.random()*6)"); + addSeparator(1); + addCMicon("tortue", "AttacherTortue()"); + addCMicon("avancer", "Avancer()"); + addCMicon("reculer", "Reculer()"); + addCMicon("tournerG", "TournerGauche()"); + addCMicon("tournerD", "TournerDroite()"); + addCMicon("vitesse", "VitesseTortue()"); + addCMicon2("crayonB", "BaisserStylo()"); + addCMicon2("crayonH", "LeverStylo()"); + addCMicon2("cacher", "CacherTortue()"); + addCMicon2("montrer", "MontrerTortue()"); + addCMicon("orienter", "OrienterTortue()"); + addCMicon("viser", "Viser()"); + addCMicon("avancer2", " ⟵ Avancer()"); + //addCMicon("avancer3", " ⟵ Avancer()[1]"); + //addCMicon("avancer4", "t ⟵ Avancer(); ⟵ t[0]; ⟵ t[1]"); + addCMicon("reculer2", " ⟵ Reculer()"); + //addCMicon("reculer3", " ⟵ Reculer()[1]"); + //addCMicon("reculer4", "t ⟵ Reculer(); ⟵ t[0]; ⟵ t[1]"); + addSeparator(1); + if (FlagSimp) { + addCMicon("bi_3Dcoords", "Point3D(,,,)"); + addCMicon("bi_3Dproj", "Projection3D(,\"C,D,E\",)"); + addCMicon("bi_3Dsymc", "SymétrieCentrale3D(,,)"); + addCMicon("bi_3Dsymp", "Symétrie3DPlan(,\"C,D,E\",)"); + addCMicon("bi_3Dtrans", "Translation3D(,,,)"); + addCMicon("bi_3Dsphererayon", "SphèreRayon(,,)"); + addCMicon("bi_3Dspherepoint", "Sphère(,,)"); + addCMicon("bi_3Dcircle1", "Cercle3D(,,)"); + addCMicon("bi_3Dcircle2", "CercleRayon3D(,,,\"E7\")"); + addCMicon("bi_3Dcircle3pts", "Cercle3D3pts(,,,)"); + } + else { + addCMicon("bi_3Dcoords", " ⟵ Point3D(,,,)"); + addCMicon("bi_3Dproj", " ⟵ Projection3D(,\"_f,_g,_h\",)"); + addCMicon("bi_3Dsymc", " ⟵ SymétrieCentrale3D(,,)"); + addCMicon("bi_3Dsymp", " ⟵ Symétrie3DPlan(,\"_f,_g,_h\",)"); + addCMicon("bi_3Dtrans", " ⟵ Translation3D(,,,)"); + addCMicon("bi_3Dsphererayon", " ⟵ SphèreRayon(,,)"); + addCMicon("bi_3Dspherepoint", " ⟵ Sphère(,,)"); + addCMicon("bi_3Dcircle1", " ⟵ Cercle3D(,,)"); + addCMicon("bi_3Dcircle2", " ⟵ CercleRayon3D(,,,\"E7\")"); + addCMicon("bi_3Dcircle3pts", " ⟵ Cercle3D3pts(,,,)"); + } + addSeparator(1); + addCMicon("tournerG3D", "TournerGauche()"); + addCMicon("tournerD3D", "TournerDroite()"); + addCMicon("pivoterH", "PivoterHaut()"); + addCMicon("pivoterB", "PivoterBas()"); + addCMicon("pivoterG", "PivoterGauche()"); + addCMicon("pivoterD", "PivoterDroite()"); + + } + else { + if (FlagSimp) { + addCMicon("point", "Point(,,)"); + addCMicon("intersection", "Intersection(,,)"); + addCMicon("midpoint", "MidPoint(,,)"); + addCMicon("bi_syma", "Reflection(,,)"); + addCMicon("bi_symc", "Symmetry(,,)"); + addCMicon("bi_trans", "Translation(,,,)"); + addCMicon("line", "Line(,,)"); + addCMicon("ray", "Ray(,,)"); + addCMicon("parallel", "Parallel(,,)"); + addCMicon("plumb", "Perpendicular(,,)"); + addCMicon("bi_med", "PerpendicularBisector(,,)"); + addCMicon("bi_biss", "AngleBisector(,,,)"); + addCMicon("segment", "Segment(,,)"); + addCMicon("fixedsegment", "FixedSegment(,,)"); + addCMicon("vector", "Vector(,,)"); + addCMicon("area", "Polygon(,)"); + addCMicon("angle", "Angle(,,,)"); + addCMicon("fixedangle", "FixedAngle(,,,)"); + addCMicon("circle", "Circle(,,)"); + addCMicon("fixedcircle", "FixedCircle(,,)"); + addCMicon("circle3", "Circle3(,,,)"); + addCMicon("bi_circ", "Circle3pts(,,,)"); + addCMicon("bi_arc", "Arc3pts(,,,)"); + addCMicon("quadric", "Quadric(,,,,,)"); + // addCMicon("text", ""); + addCMicon("expression", "Expression(,\"Votre expression\",,)"); + addCMicon("text", "Text(,\"Votre message\",,)"); + // addCMicon("image3", ""); + // addBlankIcon(3); + addCMicon("function", "CartesianFunction(,-5,5,\"x^2-2*x+1\")"); + addCMicon("parametricfunction", "ParametricFunction(,-3.14,3.14,\"3*rcos(t)^3\",\"3*rsin(t)^3\")"); + addCMicon("equationxy", "ImplicitPlot(,\"x^3-2*x-y^2+1\")"); + addCMicon("macro", "ExecuteMacro(,\"_x,_y,_z\")"); + } + else { + addCMicon("point", " ⟵ Point(,,)"); + addCMicon("intersection", " ⟵ Intersection(,,)"); + addCMicon("midpoint", " ⟵ MidPoint(,,)"); + addCMicon("bi_syma", " ⟵ Reflection(,,)"); + addCMicon("bi_symc", " ⟵ Symmetry(,,)"); + addCMicon("bi_trans", " ⟵ Translation(,,,)"); + addCMicon("line", " ⟵ Line(,,)"); + addCMicon("ray", " ⟵ Ray(,,)"); + addCMicon("parallel", " ⟵ Parallel(,,)"); + addCMicon("plumb", " ⟵ Perpendicular(,,)"); + addCMicon("bi_med", " ⟵ PerpendicularBisector(,,)"); + addCMicon("bi_biss", " ⟵ AngleBisector(,,,)"); + addCMicon("segment", " ⟵ Segment(,,)"); + addCMicon("fixedsegment", " ⟵ FixedSegment(,,)"); + addCMicon("vector", " ⟵ Vector(,,)"); + addCMicon("area", " ⟵ Polygon(,)"); + addCMicon("angle", " ⟵ Angle(,,,)"); + addCMicon("fixedangle", " ⟵ FixedAngle(,,,)"); + addCMicon("circle", " ⟵ Circle(,,)"); + addCMicon("fixedcircle", " ⟵ FixedCircle(,,)"); + addCMicon("circle3", " ⟵ Circle3(,,,)"); + addCMicon("bi_circ", " ⟵ Circle3pts(,,,)"); + addCMicon("bi_arc", " ⟵ Arc3pts(,,,)"); + addCMicon("quadric", " ⟵ Quadric(,,,,,)"); + // addCMicon("text", ""); + addCMicon("expression", " ⟵ Expression(,\"Votre expression\",,)"); + addCMicon("text", " ⟵ Text(,\"Votre message\",,)"); + // addCMicon("image3", ""); + // addBlankIcon(3); + addCMicon("function", " ⟵ CartesianFunction(,-5,5,\"x^2-2*x+1\")"); + addCMicon("parametricfunction", " ⟵ ParametricFunction(,-3.14,3.14,\"3*rcos(t)^3\",\"3*rsin(t)^3\")"); + addCMicon("equationxy", " ⟵ ImplicitPlot(,\"x^3-2*x-y^2+1\")"); + addCMicon("macro", " ⟵ ExecuteMacro(\"macroName\",\"_x,_y,_z\")"); + } + addSeparator(1); + addCMicon("interactiveinput", " ⟵ InteractiveInput(\"Message\",<\"Point,Segment,Line,Circle\">)"); + addCMicon("aimant", "SetMagneticObjects(,)"); + addCMicon("hide", "SetHide(,<\"true,false\">)"); + addCMicon("type2", "SetPointType(,<\"square,circle,diamond,point,cross,dcross\">)"); + addCMicon("color4", "SetColor(,<\"green,blue,brown,cyan,red,black\">)"); + addCMicon("thickness1", "SetThickness(,<\"thick,normal,thin\">)"); + addCMicon("partial", "SetPartial(,<\"true,false\">)"); + addCMicon("showvalue", "SetShowValue(,<\"true,false\">)"); + addCMicon("showname", "SetShowName(,<\"true,false\">)"); + addCMicon("filled", "SetFilled(,<\"true,false\">)"); + addCMicon("monkey", "Move(,,)"); + addCMicon("nail", "SetFixed(,<\"true,false\">)"); +// addCMicon("dice", "=Math.ceil(Math.random()*6)"); + + addSeparator(1); + addCMicon("tortue", "FixTurtle()"); + addCMicon("avancer", "MoveForward()"); + addCMicon("reculer", "MoveBackward()"); + addCMicon("tournerG", "TurnLeft()"); + addCMicon("tournerD", "TurnRight()"); + addCMicon("vitesse", "TurtleSpeed()"); + addCMicon2("crayonB", "TurtleDown()"); + addCMicon2("crayonH", "TurtleUp()"); + addCMicon2("cacher", "HideTurtle()"); + addCMicon2("montrer", "ShowTurtle()"); + addCMicon("orienter", "OrientateTurtle()"); + addCMicon("viser", "OrientateTowards()"); + addCMicon("avancer2", " ⟵ MoveForward()"); + //addCMicon("avancer3", " ⟵ MoveForward()[1]"); + //addCMicon("avancer4", "t ⟵ MoveForward(); ⟵ t[0]; ⟵ t[1]"); + addCMicon("reculer2", " ⟵ MoveBackward()"); + //addCMicon("reculer3", " ⟵ MoveBackward()[1]"); + //addCMicon("reculer4", "t ⟵ MoveBackward(); ⟵ t[0]; ⟵ t[1]"); + addSeparator(1); + if (FlagSimp) { + addCMicon("bi_3Dcoords", "Point3D(,,,)"); + addCMicon("bi_3Dproj", "Projection3D(,\"C,D,E\",)"); + addCMicon("bi_3Dsymc", "Symmetry3D(,,)"); + addCMicon("bi_3Dsymp", "Reflection3D(,\"C,D,E\",)"); + addCMicon("bi_3Dtrans", "Translation3D(,,,)"); + addCMicon("bi_3Dsphererayon", "FixedSphere(,,)"); + addCMicon("bi_3Dspherepoint", "Sphere(,,)"); + addCMicon("bi_3Dcircle1", "Circle3D(,,)"); + addCMicon("bi_3Dcircle2", "FixedCircle3D(,,,\"E7\")"); + addCMicon("bi_3Dcircle3pts", "Circle3D3pts(,,,)"); + } + else { + addCMicon("bi_3Dcoords", " ⟵ Point3D(,,,)"); + addCMicon("bi_3Dproj", " ⟵ Projection3D(,\"_f,_g,_h\",)"); + addCMicon("bi_3Dsymc", " ⟵ Symmetry3D(,,)"); + addCMicon("bi_3Dsymp", " ⟵ Reflection3D(,\"_f,_g,_h\",)"); + addCMicon("bi_3Dtrans", " ⟵ Translation3D(,,,)"); + addCMicon("bi_3Dsphererayon", " ⟵ FixedSphere(,,)"); + addCMicon("bi_3Dspherepoint", " ⟵ Sphere(,,)"); + addCMicon("bi_3Dcircle1", " ⟵ Circle3D(,,)"); + addCMicon("bi_3Dcircle2", " ⟵ FixedCircle3D(,,,\"E7\")"); + addCMicon("bi_3Dcircle3pts", " ⟵ Circle3D3pts(,,,)"); + } + addSeparator(1); + addCMicon("tournerG3D", "TurnLeft()"); + addCMicon("tournerD3D", "TurnRight()"); + addCMicon("pivoterH", "PitchUp()"); + addCMicon("pivoterB", "PitchDown()"); + addCMicon("pivoterG", "RollLeft()"); + addCMicon("pivoterD", "RollRight()"); + } + addJSIcon("js_cos", "cos(x)"); + addJSIcon("js_sin", "sin(x)"); + addJSIcon("js_tan", "tan(x)"); + addJSIcon("js_acos", "acos(x)"); + addJSIcon("js_asin", "asin(x)"); + addJSIcon("js_atan", "atan(x)"); + addJSIcon("js_abs", "abs(x)"); + if (infrench) { + addJSIcon("js_ceil", "val_approchée_par_excès(x)"); + addJSIcon("js_floor", "troncature(x)"); + addJSIcon("js_round", "arrondi(x)"); + addJSIcon("js_min", "min(x,y)"); + addJSIcon("js_max", "max(x,y)"); + addJSIcon("js_pi", "PI"); + addJSIcon("js_e", "Math.E"); + addJSIcon("js_xn", "puissance(x,n)"); + addJSIcon("js_ex", "exp(x)"); + addJSIcon("js_ln", "ln(x)"); + addJSIcon("js_sqrt", "racine(x)"); + addJSIcon("js_or", "(x=2 || x>5)"); + addJSIcon("js_and", "(x>2 && x<=5)"); + addJSIcon("js_no", "!(x>0)"); + addJSIcon("hour", "Pause(1000)"); + addJSIcon("js_array", "tableau ⟵ [[1,2],[3,4]]"); + addJSIcon("dice", "val_approchée_par_excès(nombre_aleatoire()*6)"); + } + else { + addJSIcon("js_ceil", "ceil(x)"); + addJSIcon("js_floor", "floor(x)"); + addJSIcon("js_round", "round(x)"); + addJSIcon("js_min", "min(x,y)"); + addJSIcon("js_max", "max(x,y)"); + addJSIcon("js_pi", "PI"); + addJSIcon("js_e", "Math.E"); + addJSIcon("js_xn", "pow(x,n)"); + addJSIcon("js_ex", "exp(x)"); + addJSIcon("js_ln", "ln(x)"); + addJSIcon("js_sqrt", "sqrt(x)"); + addJSIcon("js_or", "(x=2 || x>5)"); + addJSIcon("js_and", "(x>2 && x<=5)"); + addJSIcon("js_no", "!(x>0)"); + addJSIcon("hour", "Pause(1000)"); + addJSIcon("js_array", "tableau ⟵ [[1,2],[3,4]]"); + addJSIcon("dice", "ceil(random()*6)"); + } + } + else { + if (infrench) { + if (FlagSimp) { + addCMicon("point", "Point(,,);"); + addCMicon("intersection", "Intersection(,,);"); + addCMicon("midpoint", "Milieu(,,);"); + addCMicon("bi_syma", "SymétrieAxiale(,,);"); + addCMicon("bi_symc", "SymétrieCentrale(,,);"); + addCMicon("bi_trans", "Translation(,,,);"); + addCMicon("line", "Droite(,,);"); + addCMicon("ray", "DemiDroite(,,);"); + addCMicon("parallel", "Parallèle(,,);"); + addCMicon("plumb", "Perpendiculaire(,,);"); + addCMicon("bi_med", "Médiatrice(,,);"); + addCMicon("bi_biss", "Bissectrice(,,,);"); + addCMicon("segment", "Segment(,,);"); + addCMicon("fixedsegment", "SegmentFixe(,,);"); + addCMicon("vector", "Vecteur(,,);"); + addCMicon("area", "Polygone(,);"); + addCMicon("angle", "Angle(,,,);"); + addCMicon("fixedangle", "AngleFixe(,,,);"); + addCMicon("circle", "Cercle(,,);"); + addCMicon("fixedcircle", "CercleRayon(,,);"); + addCMicon("circle3", "Cercle3(,,,);"); + addCMicon("bi_circ", "Cercle3pts(,,,);"); + addCMicon("bi_arc", "Arc3pts(,,,);"); + addCMicon("quadric", "Quadrique(,,,,,);"); + // addCMicon("text", ""); + addCMicon("expression", "Expression(,\"Votre expression\",,);"); + addCMicon("text", "Texte(,\"Votre message\",,);"); + // addCMicon("image3", ""); + // addBlankIcon(3); + addCMicon("function", "FonctionCartésienne(,-5,5,\"x^2-2*x+1\");"); + addCMicon("parametricfunction", "FonctionParamétrique(,-3.14,3.14,\"3*rcos(t)^3\",\"3*rsin(t)^3\");"); + addCMicon("equationxy", "TracéImplicite(,\"x^3-2*x-y^2+1\");"); + addCMicon("macro", "ExécuterMacro(,\"_x,_y,_z\");"); + addSeparator(1); + addCMicon("interactiveinput", ":=EntréeInteractive(\"Message\",<\"Point,Segment,Line,Circle\">);"); + addCMicon("aimant", "MettreObjetsMagnétiques(,);"); + addCMicon("hide", "MettreCaché(,<\"vrai,faux\">);"); + addCMicon("type2", "MettreTypePoint(,<\"square,circle,diamond,point,cross,dcross\">);"); + addCMicon("color4", "MettreCouleur(,<\"green,blue,brown,cyan,red,black\">);"); + addCMicon("thickness1", "MettreEpaisseur(,<\"thick,normal,thin\">);"); + addCMicon("partial", "MettrePartiel(,<\"vrai,faux\">);"); + addCMicon("showvalue", "MettreMontrerValeur(,<\"vrai,faux\">);"); + addCMicon("showname", "MettreMontrerNom(,<\"vrai,faux\">);"); + addCMicon("filled", "MettreRempli(,<\"vrai,faux\">);"); + addCMicon("monkey", "Déplacer(,,);"); + addCMicon("nail", "MettreFixe(,<\"vrai,faux\">);"); + // addCMicon("dice", "=Math.ceil(Math.random()*6);"); + addSeparator(1); + addCMicon("tortue", "AttacherTortue();"); + addCMicon("avancer", "Avancer();"); + addCMicon("reculer", "Reculer();"); + addCMicon("tournerG", "TournerGauche();"); + addCMicon("tournerD", "TournerDroite();"); + addCMicon("vitesse", "VitesseTortue();"); + addCMicon2("crayonB", "BaisserStylo();"); + addCMicon2("crayonH", "LeverStylo();"); + addCMicon2("cacher", "CacherTortue();"); + addCMicon2("montrer", "MontrerTortue();"); + addCMicon("orienter", "OrienterTortue();"); + addCMicon("viser", "Viser();"); + addCMicon("avancer2", ":=Avancer()[0];"); + addCMicon("avancer3", ":=Avancer()[1];"); + addCMicon("avancer4", "t:=Avancer();:=t[0];:=t[1];"); + addCMicon("reculer2", ":=Reculer()[0];"); + addCMicon("reculer3", ":=Reculer()[1];"); + addCMicon("reculer4", "t:=Reculer();:=t[0];:=t[1];"); + addSeparator(1); + addCMicon("bi_3Dcoords", "Point3D(,,,);"); + addCMicon("bi_3Dproj", "Projection3D(,\"C,D,E\",);"); + addCMicon("bi_3Dsymc", "SymétrieCentrale3D(,,);"); + addCMicon("bi_3Dsymp", "Symétrie3DPlan(,\"C,D,E\",);"); + addCMicon("bi_3Dtrans", "Translation3D(,,,);"); + addCMicon("bi_3Dsphererayon", "SphèreRayon(,,);"); + addCMicon("bi_3Dspherepoint", "Sphère(,,);"); + addCMicon("bi_3Dcircle1", "Cercle3D(,,);"); + addCMicon("bi_3Dcircle2", "CercleRayon3D(,,,\"E7\");"); + addCMicon("bi_3Dcircle3pts", "Cercle3D3pts(,,,);"); + } + else { + addCMicon("point", "=Point(,,);"); + addCMicon("intersection", "=Intersection(,,);"); + addCMicon("midpoint", "=Milieu(,,);"); + addCMicon("bi_syma", "=SymétrieAxiale(,,);"); + addCMicon("bi_symc", "=SymétrieCentrale(,,);"); + addCMicon("bi_trans", "=Translation(,,,);"); + addCMicon("line", "=Droite(,,);"); + addCMicon("ray", "=DemiDroite(,,);"); + addCMicon("parallel", "=Parallèle(,,);"); + addCMicon("plumb", "=Perpendiculaire(,,);"); + addCMicon("bi_med", "=Médiatrice(,,);"); + addCMicon("bi_biss", "=Bissectrice(,,,);"); + addCMicon("segment", "=Segment(,,);"); + addCMicon("fixedsegment", "=SegmentFixe(,,);"); + addCMicon("vector", "=Vecteur(,,);"); + addCMicon("area", "=Polygone(,);"); + addCMicon("angle", "=Angle(,,,);"); + addCMicon("fixedangle", "=AngleFixe(,,,);"); + addCMicon("circle", "=Cercle(,,);"); + addCMicon("fixedcircle", "=CercleRayon(,,);"); + addCMicon("circle3", "=Cercle3(,,,);"); + addCMicon("bi_circ", "=Cercle3pts(,,,);"); + addCMicon("bi_arc", "=Arc3pts(,,,);"); + addCMicon("quadric", "=Quadrique(,,,,,);"); + // addCMicon("text", ""); + addCMicon("expression", "=Expression(,\"Votre expression\",,);"); + addCMicon("text", "=Texte(,\"Votre message\",,);"); + // addCMicon("image3", ""); + // addBlankIcon(3); + addCMicon("function", "=FonctionCartésienne(,-5,5,\"x^2-2*x+1\");"); + addCMicon("parametricfunction", "=FonctionParamétrique(,-3.14,3.14,\"3*rcos(t)^3\",\"3*rsin(t)^3\");"); + addCMicon("equationxy", "=TracéImplicite(,\"x^3-2*x-y^2+1\");"); + addCMicon("macro", "=ExécuterMacro(\"macroName\",\"_x,_y,_z\");"); + addSeparator(1); + addCMicon("interactiveinput", "=EntréeInteractive(\"Message\",<\"Point,Segment,Line,Circle\">);"); + addCMicon("aimant", "MettreObjetsMagnétiques(,);"); + addCMicon("hide", "MettreCaché(,<\"vrai,faux\">);"); + addCMicon("type2", "MettreTypePoint(,<\"square,circle,diamond,point,cross,dcross\">);"); + addCMicon("color4", "MettreCouleur(,<\"green,blue,brown,cyan,red,black\">);"); + addCMicon("thickness1", "MettreEpaisseur(,<\"thick,normal,thin\">);"); + addCMicon("partial", "MettrePartiel(,<\"vrai,faux\">);"); + addCMicon("showvalue", "MettreMontrerValeur(,<\"vrai,faux\">);"); + addCMicon("showname", "MettreMontrerNom(,<\"vrai,faux\">);"); + addCMicon("filled", "MettreRempli(,<\"vrai,faux\">);"); + addCMicon("monkey", "Déplacer(,,);"); + addCMicon("nail", "MettreFixe(,<\"vrai,faux\">);"); + // addCMicon("dice", "=Math.ceil(Math.random()*6);"); + addSeparator(1); + addCMicon("tortue", "AttacherTortue();"); + addCMicon("avancer", "Avancer();"); + addCMicon("reculer", "Reculer();"); + addCMicon("tournerG", "TournerGauche();"); + addCMicon("tournerD", "TournerDroite();"); + addCMicon("vitesse", "VitesseTortue();"); + addCMicon2("crayonB", "BaisserStylo();"); + addCMicon2("crayonH", "LeverStylo();"); + addCMicon2("cacher", "CacherTortue();"); + addCMicon2("montrer", "MontrerTortue();"); + addCMicon("orienter", "OrienterTortue();"); + addCMicon("viser", "Viser();"); + addCMicon("avancer2", "=Avancer()[0];"); + addCMicon("avancer3", "=Avancer()[1];"); + addCMicon("avancer4", "t=Avancer();=t[0];=t[1];"); + addCMicon("reculer2", "=Reculer()[0];"); + addCMicon("reculer3", "=Reculer()[1];"); + addCMicon("reculer4", "t=Reculer();=t[0];=t[1];"); + addSeparator(1); + addCMicon("bi_3Dcoords", "=Point3D(,,,);"); + addCMicon("bi_3Dproj", "=Projection3D(,\"_f,_g,_h\",);"); + addCMicon("bi_3Dsymc", "=SymétrieCentrale3D(,,);"); + addCMicon("bi_3Dsymp", "=Symétrie3DPlan(,\"_f,_g,_h\",);"); + addCMicon("bi_3Dtrans", "=Translation3D(,,,);"); + addCMicon("bi_3Dsphererayon", "=SphèreRayon(,,);"); + addCMicon("bi_3Dspherepoint", "=Sphère(,,);"); + addCMicon("bi_3Dcircle1", "=Cercle3D(,,);"); + addCMicon("bi_3Dcircle2", "=CercleRayon3D(,,,\"E7\");"); + addCMicon("bi_3Dcircle3pts", "=Cercle3D3pts(,,,);"); + } + addSeparator(1); + addCMicon("tournerG3D", "TournerGauche();"); + addCMicon("tournerD3D", "TournerDroite();"); + addCMicon("pivoterH", "PivoterHaut();"); + addCMicon("pivoterB", "PivoterBas();"); + addCMicon("pivoterG", "PivoterGauche();"); + addCMicon("pivoterD", "PivoterDroite();"); + + } + else { + if (FlagSimp) { + addCMicon("point", "Point(,,);"); + addCMicon("intersection", "Intersection(,,);"); + addCMicon("midpoint", "MidPoint(,,);"); + addCMicon("bi_syma", "Reflection(,,);"); + addCMicon("bi_symc", "Symmetry(,,);"); + addCMicon("bi_trans", "Translation(,,,);"); + addCMicon("line", "Line(,,);"); + addCMicon("ray", "Ray(,,);"); + addCMicon("parallel", "Parallel(,,);"); + addCMicon("plumb", "Perpendicular(,,);"); + addCMicon("bi_med", "PerpendicularBisector(,,);"); + addCMicon("bi_biss", "AngleBisector(,,,);"); + addCMicon("segment", "Segment(,,);"); + addCMicon("fixedsegment", "FixedSegment(,,);"); + addCMicon("vector", "Vector(,,);"); + addCMicon("area", "Polygon(,);"); + addCMicon("angle", "Angle(,,,);"); + addCMicon("fixedangle", "FixedAngle(,,,);"); + addCMicon("circle", "Circle(,,);"); + addCMicon("fixedcircle", "FixedCircle(,,);"); + addCMicon("circle3", "Circle3(,,,);"); + addCMicon("bi_circ", "Circle3pts(,,,);"); + addCMicon("bi_arc", "Arc3pts(,,,);"); + addCMicon("quadric", "Quadric(,,,,,);"); + // addCMicon("text", ""); + addCMicon("expression", "Expression(,\"Votre expression\",,);"); + addCMicon("text", "Text(,\"Votre message\",,);"); + // addCMicon("image3", ""); + // addBlankIcon(3); + addCMicon("function", "CartesianFunction(,-5,5,\"x^2-2*x+1\");"); + addCMicon("parametricfunction", "ParametricFunction(,-3.14,3.14,\"3*rcos(t)^3\",\"3*rsin(t)^3\");"); + addCMicon("equationxy", "ImplicitPlot(,\"x^3-2*x-y^2+1\");"); + addCMicon("macro", "ExecuteMacro(,\"_x,_y,_z\");"); + addSeparator(1); + addCMicon("interactiveinput", ":=InteractiveInput(\"Message\",<\"Point,Segment,Line,Circle\">);"); + } + else { + addCMicon("point", "=Point(,,);"); + addCMicon("intersection", "=Intersection(,,);"); + addCMicon("midpoint", "=MidPoint(,,);"); + addCMicon("bi_syma", "=Reflection(,,);"); + addCMicon("bi_symc", "=Symmetry(,,);"); + addCMicon("bi_trans", "=Translation(,,,);"); + addCMicon("line", "=Line(,,);"); + addCMicon("ray", "=Ray(,,);"); + addCMicon("parallel", "=Parallel(,,);"); + addCMicon("plumb", "=Perpendicular(,,);"); + addCMicon("bi_med", "=PerpendicularBisector(,,);"); + addCMicon("bi_biss", "=AngleBisector(,,,);"); + addCMicon("segment", "=Segment(,,);"); + addCMicon("fixedsegment", "=FixedSegment(,,);"); + addCMicon("vector", "=Vector(,,);"); + addCMicon("area", "=Polygon(,);"); + addCMicon("angle", "=Angle(,,,);"); + addCMicon("fixedangle", "=FixedAngle(,,,);"); + addCMicon("circle", "=Circle(,,);"); + addCMicon("fixedcircle", "=FixedCircle(,,);"); + addCMicon("circle3", "=Circle3(,,,);"); + addCMicon("bi_circ", "=Circle3pts(,,,);"); + addCMicon("bi_arc", "=Arc3pts(,,,);"); + addCMicon("quadric", "=Quadric(,,,,,);"); + // addCMicon("text", ""); + addCMicon("expression", "=Expression(,\"Votre expression\",,);"); + addCMicon("text", "=Text(,\"Votre message\",,);"); + // addCMicon("image3", ""); + // addBlankIcon(3); + addCMicon("function", "=CartesianFunction(,-5,5,\"x^2-2*x+1\");"); + addCMicon("parametricfunction", "=ParametricFunction(,-3.14,3.14,\"3*rcos(t)^3\",\"3*rsin(t)^3\");"); + addCMicon("equationxy", "=ImplicitPlot(,\"x^3-2*x-y^2+1\");"); + addCMicon("macro", "=ExecuteMacro(\"macroName\",\"_x,_y,_z\");"); + addSeparator(1); + addCMicon("interactiveinput", "=InteractiveInput(\"Message\",<\"Point,Segment,Line,Circle\">);"); + } + addCMicon("aimant", "SetMagneticObjects(,);"); + addCMicon("hide", "SetHide(,<\"true,false\">);"); + addCMicon("type2", "SetPointType(,<\"square,circle,diamond,point,cross,dcross\">);"); + addCMicon("color4", "SetColor(,<\"green,blue,brown,cyan,red,black\">);"); + addCMicon("thickness1", "SetThickness(,<\"thick,normal,thin\">);"); + addCMicon("partial", "SetPartial(,<\"true,false\">);"); + addCMicon("showvalue", "SetShowValue(,<\"true,false\">);"); + addCMicon("showname", "SetShowName(,<\"true,false\">);"); + addCMicon("filled", "SetFilled(,<\"true,false\">);"); + addCMicon("monkey", "Move(,,);"); + addCMicon("nail", "SetFixed(,<\"true,false\">);"); +// addCMicon("dice", "=Math.ceil(Math.random()*6);"); + + addSeparator(1); + addCMicon("tortue", "FixTurtle();"); + addCMicon("avancer", "MoveForward();"); + addCMicon("reculer", "MoveBackward();"); + addCMicon("tournerG", "TurnLeft();"); + addCMicon("tournerD", "TurnRight();"); + addCMicon("vitesse", "TurtleSpeed();"); + addCMicon2("crayonB", "TurtleDown();"); + addCMicon2("crayonH", "TurtleUp();"); + addCMicon2("cacher", "HideTurtle();"); + addCMicon2("montrer", "ShowTurtle();"); + addCMicon("orienter", "OrientateTurtle();"); + addCMicon("viser", "OrientateTowards();"); + if (FlagSimp) { + addCMicon("avancer2", ":=MoveForward()[0];"); + addCMicon("avancer3", ":=MoveForward()[1];"); + addCMicon("avancer4", "t:=MoveForward();:=t[0];:=t[1];"); + addCMicon("reculer2", ":=MoveBackward()[0];"); + addCMicon("reculer3", ":=MoveBackward()[1];"); + addCMicon("reculer4", "t:=MoveBackward();:=t[0];:=t[1];"); + addSeparator(1); + addCMicon("bi_3Dcoords", "Point3D(,,,);"); + addCMicon("bi_3Dproj", "Projection3D(,\"C,D,E\",);"); + addCMicon("bi_3Dsymc", "Symmetry3D(,,);"); + addCMicon("bi_3Dsymp", "Reflection3D(,\"C,D,E\",);"); + addCMicon("bi_3Dtrans", "Translation3D(,,,);"); + addCMicon("bi_3Dsphererayon", "FixedSphere(,,);"); + addCMicon("bi_3Dspherepoint", "Sphere(,,);"); + addCMicon("bi_3Dcircle1", "Circle3D(,,);"); + addCMicon("bi_3Dcircle2", "FixedCircle3D(,,,\"E7\");"); + addCMicon("bi_3Dcircle3pts", "Circle3D3pts(,,,);"); + } + else { + addCMicon("avancer2", "=MoveForward()[0];"); + addCMicon("avancer3", "=MoveForward()[1];"); + addCMicon("avancer4", "t=MoveForward();=t[0];=t[1];"); + addCMicon("reculer2", "=MoveBackward()[0];"); + addCMicon("reculer3", "=MoveBackward()[1];"); + addCMicon("reculer4", "t=MoveBackward();=t[0];=t[1];"); + addSeparator(1); + addCMicon("bi_3Dcoords", "=Point3D(,,,);"); + addCMicon("bi_3Dproj", "=Projection3D(,\"_f,_g,_h\",);"); + addCMicon("bi_3Dsymc", "=Symmetry3D(,,);"); + addCMicon("bi_3Dsymp", "=Reflection3D(,\"_f,_g,_h\",);"); + addCMicon("bi_3Dtrans", "=Translation3D(,,,);"); + addCMicon("bi_3Dsphererayon", "=FixedSphere(,,);"); + addCMicon("bi_3Dspherepoint", "=Sphere(,,);"); + addCMicon("bi_3Dcircle1", "=Circle3D(,,);"); + addCMicon("bi_3Dcircle2", "=FixedCircle3D(,,,\"E7\");"); + addCMicon("bi_3Dcircle3pts", "=Circle3D3pts(,,,);"); + } + addSeparator(1); + addCMicon("tournerG3D", "TurnLeft();"); + addCMicon("tournerD3D", "TurnRight();"); + addCMicon("pivoterH", "PitchUp();"); + addCMicon("pivoterB", "PitchDown();"); + addCMicon("pivoterG", "RollLeft();"); + addCMicon("pivoterD", "RollRight();"); + } + addJSIcon("js_cos", "Math.cos(x)"); + addJSIcon("js_sin", "Math.sin(x)"); + addJSIcon("js_tan", "Math.tan(x)"); + addJSIcon("js_acos", "Math.acos(x)"); + addJSIcon("js_asin", "Math.asin(x)"); + addJSIcon("js_atan", "Math.atan(x)"); + addJSIcon("js_abs", "Math.abs(x)"); + addJSIcon("js_ceil", "Math.ceil(x)"); + addJSIcon("js_floor", "Math.floor(x)"); + addJSIcon("js_round", "Math.round(x)"); + addJSIcon("js_min", "Math.min(x,y)"); + addJSIcon("js_max", "Math.max(x,y)"); + addJSIcon("js_pi", "Math.PI"); + addJSIcon("js_e", "Math.E"); + addJSIcon("js_xn", "Math.pow(x,n)"); + addJSIcon("js_ex", "Math.exp(x)"); + addJSIcon("js_ln", "Math.log(x)"); + addJSIcon("js_sqrt", "Math.sqrt(x)"); + addJSIcon("js_or", "(x==2 || x>=5)"); + addJSIcon("js_and", "(x>=2 && x<=5)"); + addJSIcon("js_no", "!(x==0)"); + addJSIcon("hour", "Pause(1000);"); + addJSIcon("js_array", "tableau = [[1,2],[3,4]];"); + addJSIcon("dice", "Math.ceil(Math.random()*6)"); + } + + } + + + public void initUndoRedo() { + + undo=new UndoManager() { + + public synchronized boolean addEdit(UndoableEdit anEdit) { + if (anEdit instanceof AbstractDocument.DefaultDocumentEvent) { + AbstractDocument.DefaultDocumentEvent de=(AbstractDocument.DefaultDocumentEvent) anEdit; + if (de.getType()==DocumentEvent.EventType.CHANGE) { + return false; + } + } + return super.addEdit(anEdit); + } + }; + + script_area.getStyledDocument().addUndoableEditListener(new UndoableEditListener() { + + public void undoableEditHappened(UndoableEditEvent e) { + undo.addEdit(e.getEdit()); + } + }); + + script_area.getActionMap().put("Undo", + new AbstractAction("Undo") { + + public void actionPerformed(ActionEvent evt) { + try { + if (undo.canUndo()) { + undo.undo(); + } + } catch (CannotUndoException e) { + } + } + }); + + script_area.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_Z, ctrlkey), "Undo"); + script_area.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_Y, ctrlkey), "Redo"); + script_area.getActionMap().put("Redo", + new AbstractAction("Redo") { + + public void actionPerformed(ActionEvent evt) { + try { + if (undo.canRedo()) { + undo.redo(); + } + } catch (CannotRedoException e) { + } + } + }); + } + + // Select a line (linenumber starts at 1) + private void selectLine(int linenumber) { + Element root=script_area.getDocument().getDefaultRootElement(); + Element myline=root.getElement(linenumber-1); + int start=myline.getStartOffset(); + int end=myline.getEndOffset(); + script_area.select(start, end); + } + + static public String Loc(final String s) { + return Global.Loc(s); + } + + /** + * In case of errors, it's called at Runtime by JSRun class + * @param errormessage + */ + public void Error(String errormessage) { + StringBuffer sb=new StringBuffer(); + int errorline=1; + Pattern p=Pattern.compile("\\([^#]*#([0-9]+)\\)", Pattern.CASE_INSENSITIVE); + Matcher m=p.matcher(errormessage); + if (m.find()) { + errorline=Integer.parseInt(m.group(1))+1; + m.appendReplacement(sb, ""); + } else { + sb=sb.append(errormessage); + } + errorpanel.removeAll(); + errortitlelabel.setText(" "+Loc("JSerror.title")+" ("+Loc("JSerror.line")+" "+errorline+") :"); + errormessagelabel.setText(sb.toString()); + errorpanel.add(errortitlelabel); + errorpanel.add(errormessagelabel); + errorpanel.revalidate(); + errorpanel.repaint(); + selectLine(errorline); + script_area.requestFocus(); + } + + public void setTabs(JTextPane textPane, int charactersPerTab) { + FontMetrics fm=textPane.getFontMetrics(textPane.getFont()); + int charWidth=fm.charWidth('w'); + int tabWidth=charWidth*charactersPerTab; + + TabStop[] tabs=new TabStop[10]; + + for (int j=0; j braces; + + private int tabIndent(int carnum) { + int priority=0; + int i=0; + while ((ibraces.get(i))) { + priority=braces.get(i+1); + i+=2; + } +// +// +// +// for (int i=0;ibraces.get(i)) { +// return braces.get(i+1); +// } +// } + return priority; + } + + private void shiftposition(int lg, int sh) { + for (int i=0; ilg) { + braces.set(i, braces.get(i)+sh); + } + } + } + + private String tabs(int t) { + String st=""; + for (int i=0; i(); + String alltxt=script_area.getText(); + boolean inquote=false; + char oldcur=0; + char cur=0; + int bracesnum=0; + int oldbracesnum=0; + for (int i=0; i//GEN-BEGIN:initComponents + private void initComponents() { + + jPanel3 = new myJTitleBar(); + macpanel = new javax.swing.JPanel(); + title_lbl = new javax.swing.JLabel(); + closeBTN = new javax.swing.JButton(); + winpanel = new javax.swing.JPanel(); + jPanel1 = new javax.swing.JPanel(); + LeftBorder = new myJVerticalSeparatorPanel(); + jPanel15 = new javax.swing.JPanel(); + jPanel2 = new javax.swing.JPanel(); + action_buttons = new javax.swing.JPanel(); + jTextHeight = new javax.swing.JSlider(); + jPanel18 = new javax.swing.JPanel(); + openbtnfrench = new javax.swing.JButton(); + openbtnSimp = new javax.swing.JButton(); + openbtn5 = new javax.swing.JButton(); + jPanel16 = new javax.swing.JPanel(); + openbtn2 = new javax.swing.JButton(); + jPanel10 = new javax.swing.JPanel(); + backbtn = new javax.swing.JButton(); + jPanel11 = new javax.swing.JPanel(); + openbtn3 = new javax.swing.JButton(); + jPanel12 = new javax.swing.JPanel(); + openbtn4 = new javax.swing.JButton(); + jPanel4 = new javax.swing.JPanel(); + jScrollPane1 = new javax.swing.JScrollPane(); + script_area = new javax.swing.JTextPane(); + jPanel14 = new javax.swing.JPanel(); + commands = new javax.swing.JPanel(); + jLabel1 = new javax.swing.JLabel(); + c_carmetal = new javax.swing.JPanel(); + c_js = new javax.swing.JPanel(); + jLabel2 = new javax.swing.JLabel(); + js_btns = new javax.swing.JPanel(); + jScrollPane2 = new javax.swing.JScrollPane(); + JSlist = new javax.swing.JList(); + RightBorder = new myJVerticalSeparatorPanel(); + controls = new myStatusBarPanel(); + jPanel13 = new javax.swing.JPanel(); + errorpanel = new javax.swing.JPanel(); + errortitlelabel = new javax.swing.JLabel(); + errormessagelabel = new javax.swing.JLabel(); + jButton2 = new javax.swing.JButton(); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + setUndecorated(true); + addWindowListener(new java.awt.event.WindowAdapter() { + public void windowClosing(java.awt.event.WindowEvent evt) { + formWindowClosing(evt); + } + public void windowClosed(java.awt.event.WindowEvent evt) { + formWindowClosed(evt); + } + public void windowActivated(java.awt.event.WindowEvent evt) { + formWindowActivated(evt); + } + public void windowDeactivated(java.awt.event.WindowEvent evt) { + formWindowDeactivated(evt); + } + }); + getContentPane().setLayout(new javax.swing.BoxLayout(getContentPane(), javax.swing.BoxLayout.Y_AXIS)); + + jPanel3.setMaximumSize(new java.awt.Dimension(32767, 25)); + jPanel3.setMinimumSize(new java.awt.Dimension(0, 25)); + jPanel3.setPreferredSize(new java.awt.Dimension(199, 25)); + jPanel3.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { + public void mouseDragged(java.awt.event.MouseEvent evt) { + jPanel3MouseDragged(evt); + } + }); + jPanel3.addMouseListener(new java.awt.event.MouseAdapter() { + public void mousePressed(java.awt.event.MouseEvent evt) { + jPanel3MousePressed(evt); + } + }); + jPanel3.setLayout(new javax.swing.BoxLayout(jPanel3, javax.swing.BoxLayout.X_AXIS)); + + macpanel.setAlignmentX(0.0F); + macpanel.setEnabled(false); + macpanel.setFocusable(false); + macpanel.setMaximumSize(new java.awt.Dimension(32767, 25)); + macpanel.setMinimumSize(new java.awt.Dimension(0, 25)); + macpanel.setOpaque(false); + macpanel.setPreferredSize(new java.awt.Dimension(523, 25)); + macpanel.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { + public void mouseDragged(java.awt.event.MouseEvent evt) { + macpanelMouseDragged(evt); + } + }); + macpanel.addMouseListener(new java.awt.event.MouseAdapter() { + public void mousePressed(java.awt.event.MouseEvent evt) { + macpanelMousePressed(evt); + } + }); + macpanel.setLayout(new javax.swing.BoxLayout(macpanel, javax.swing.BoxLayout.X_AXIS)); + + title_lbl.setBackground(new java.awt.Color(117, 112, 104)); + title_lbl.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); + title_lbl.setText("jLabel3"); + title_lbl.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); + title_lbl.setMaximumSize(new java.awt.Dimension(32767, 32767)); + title_lbl.setMinimumSize(new java.awt.Dimension(0, 25)); + title_lbl.setPreferredSize(new java.awt.Dimension(45, 25)); + macpanel.add(title_lbl); + + jPanel3.add(macpanel); + + closeBTN.setIcon(new javax.swing.ImageIcon(getClass().getResource("/eric/GUI/icons/themes/gray/zclosebutton.png"))); // NOI18N + closeBTN.setBorder(null); + closeBTN.setBorderPainted(false); + closeBTN.setContentAreaFilled(false); + closeBTN.setFocusPainted(false); + closeBTN.setFocusable(false); + closeBTN.setMaximumSize(new java.awt.Dimension(25, 30)); + closeBTN.setMinimumSize(new java.awt.Dimension(25, 30)); + closeBTN.setPreferredSize(new java.awt.Dimension(25, 30)); + closeBTN.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/eric/GUI/icons/themes/gray/zclosebuttonover.png"))); // NOI18N + closeBTN.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + closeBTNMouseClicked(evt); + } + }); + jPanel3.add(closeBTN); + + winpanel.setAlignmentX(0.0F); + winpanel.setEnabled(false); + winpanel.setFocusable(false); + winpanel.setMaximumSize(new java.awt.Dimension(32767, 25)); + winpanel.setMinimumSize(new java.awt.Dimension(0, 25)); + winpanel.setOpaque(false); + winpanel.setPreferredSize(new java.awt.Dimension(523, 25)); + winpanel.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { + public void mouseDragged(java.awt.event.MouseEvent evt) { + winpanelMouseDragged(evt); + } + }); + winpanel.addMouseListener(new java.awt.event.MouseAdapter() { + public void mousePressed(java.awt.event.MouseEvent evt) { + winpanelMousePressed(evt); + } + }); + winpanel.setLayout(new javax.swing.BoxLayout(winpanel, javax.swing.BoxLayout.X_AXIS)); + jPanel3.add(winpanel); + + getContentPane().add(jPanel3); + + jPanel1.setPreferredSize(new java.awt.Dimension(565, 487)); + jPanel1.setLayout(new javax.swing.BoxLayout(jPanel1, javax.swing.BoxLayout.X_AXIS)); + + LeftBorder.setMaximumSize(new java.awt.Dimension(5, 32767)); + LeftBorder.setMinimumSize(new java.awt.Dimension(5, 30)); + LeftBorder.setOpaque(false); + LeftBorder.setPreferredSize(new java.awt.Dimension(5, 487)); + LeftBorder.setLayout(null); + jPanel1.add(LeftBorder); + + jPanel15.setAlignmentX(0.0F); + jPanel15.setMaximumSize(new java.awt.Dimension(3, 1)); + jPanel15.setMinimumSize(new java.awt.Dimension(3, 1)); + jPanel15.setOpaque(false); + jPanel15.setPreferredSize(new java.awt.Dimension(3, 1)); + jPanel15.setLayout(new javax.swing.BoxLayout(jPanel15, javax.swing.BoxLayout.LINE_AXIS)); + jPanel1.add(jPanel15); + + jPanel2.setFocusable(false); + jPanel2.setLayout(new javax.swing.BoxLayout(jPanel2, javax.swing.BoxLayout.Y_AXIS)); + + action_buttons.setAlignmentX(0.0F); + action_buttons.setAlignmentY(0.0F); + action_buttons.setMaximumSize(new java.awt.Dimension(32727, 40)); + action_buttons.setMinimumSize(new java.awt.Dimension(370, 40)); + action_buttons.setPreferredSize(new java.awt.Dimension(350, 40)); + action_buttons.setLayout(new javax.swing.BoxLayout(action_buttons, javax.swing.BoxLayout.X_AXIS)); + + jTextHeight.setFont(new java.awt.Font("DejaVu Sans", 0, 8)); + jTextHeight.setForeground(new java.awt.Color(50, 50, 150)); + jTextHeight.setMaximum(36); + jTextHeight.setMinimum(9); + jTextHeight.setMinorTickSpacing(1); + jTextHeight.setPaintLabels(true); + jTextHeight.setPaintTicks(true); + jTextHeight.setSnapToTicks(true); + jTextHeight.setToolTipText("script height"); + jTextHeight.setValue(16); + jTextHeight.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); + jTextHeight.setMinimumSize(new java.awt.Dimension(96, 43)); + jTextHeight.addChangeListener(new javax.swing.event.ChangeListener() { + public void stateChanged(javax.swing.event.ChangeEvent evt) { + jTextHeightStateChanged(evt); + } + }); + action_buttons.add(jTextHeight); + + jPanel18.setFocusable(false); + jPanel18.setMaximumSize(new java.awt.Dimension(35, 1)); + jPanel18.setMinimumSize(new java.awt.Dimension(35, 1)); + jPanel18.setOpaque(false); + jPanel18.setPreferredSize(new java.awt.Dimension(35, 1)); + action_buttons.add(jPanel18); + + openbtn5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/eric/GUI/icons/jswindow/comment.png"))); // NOI18N + openbtn5.setToolTipText(Loc("JSEditor.comment")); + openbtn5.setBorder(null); + openbtn5.setContentAreaFilled(false); + openbtn5.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + openbtn5MouseClicked(evt); + } + }); + openbtn5.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + openbtn5ActionPerformed(evt); + } + }); + openbtn5.addKeyListener(new java.awt.event.KeyAdapter() { + public void keyPressed(java.awt.event.KeyEvent evt) { + openbtn5KeyPressed(evt); + } + }); + action_buttons.add(openbtn5); + + jPanel16.setFocusable(false); + jPanel16.setMaximumSize(new java.awt.Dimension(10, 1)); + jPanel16.setMinimumSize(new java.awt.Dimension(10, 1)); + jPanel16.setOpaque(false); + jPanel16.setPreferredSize(new java.awt.Dimension(10, 1)); + action_buttons.add(jPanel16); + + openbtn2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/eric/GUI/icons/jswindow/format.png"))); // NOI18N + openbtn2.setToolTipText(Loc("JSeditor.format")); + openbtn2.setBorder(null); + openbtn2.setContentAreaFilled(false); + openbtn2.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + openbtn2MouseClicked(evt); + } + }); + openbtn2.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + openbtn2ActionPerformed(evt); + } + }); + openbtn2.addKeyListener(new java.awt.event.KeyAdapter() { + public void keyPressed(java.awt.event.KeyEvent evt) { + openbtn2KeyPressed(evt); + } + }); + action_buttons.add(openbtn2); + + jPanel10.setFocusable(false); + jPanel10.setMaximumSize(new java.awt.Dimension(10, 1)); + jPanel10.setMinimumSize(new java.awt.Dimension(10, 1)); + jPanel10.setOpaque(false); + jPanel10.setPreferredSize(new java.awt.Dimension(10, 1)); + action_buttons.add(jPanel10); + + backbtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/eric/GUI/icons/jswindow/restore.png"))); // NOI18N + backbtn.setToolTipText(Loc("JSeditor.restore")); + backbtn.setBorder(null); + backbtn.setContentAreaFilled(false); + backbtn.setEnabled(false); + backbtn.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + backbtnActionPerformed(evt); + } + }); + backbtn.addKeyListener(new java.awt.event.KeyAdapter() { + public void keyPressed(java.awt.event.KeyEvent evt) { + backbtnKeyPressed(evt); + } + }); + backbtn.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + backbtnMouseClicked(evt); + } + }); + action_buttons.add(backbtn); + + jPanel11.setFocusable(false); + jPanel11.setMaximumSize(new java.awt.Dimension(10, 1)); + jPanel11.setMinimumSize(new java.awt.Dimension(10, 1)); + jPanel11.setOpaque(false); + jPanel11.setPreferredSize(new java.awt.Dimension(10, 1)); + action_buttons.add(jPanel11); + + openbtn3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/eric/GUI/icons/jswindow/run.png"))); // NOI18N + openbtn3.setToolTipText(Loc("JSeditor.run")); + openbtn3.setBorder(null); + openbtn3.setContentAreaFilled(false); + openbtn3.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + openbtn3ActionPerformed(evt); + } + }); + openbtn3.addKeyListener(new java.awt.event.KeyAdapter() { + public void keyPressed(java.awt.event.KeyEvent evt) { + openbtn3KeyPressed(evt); + } + }); + openbtn3.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + openbtn3MouseClicked(evt); + } + }); + action_buttons.add(openbtn3); + + jPanel12.setFocusable(false); + jPanel12.setMaximumSize(new java.awt.Dimension(35, 1)); + jPanel12.setMinimumSize(new java.awt.Dimension(35, 1)); + jPanel12.setOpaque(false); + jPanel12.setPreferredSize(new java.awt.Dimension(35, 1)); + action_buttons.add(jPanel12); + + if (infrench) {openbtnfrench.setIcon(new javax.swing.ImageIcon(getClass().getResource("/eric/GUI/icons/jswindow/french.png"))); // NOI18N + } + else { + openbtnfrench.setIcon(new javax.swing.ImageIcon(getClass().getResource("/eric/GUI/icons/jswindow/french2.png"))); + } + openbtnfrench.setToolTipText(Loc("JSeditor.choseFrench")); + openbtnfrench.setBorder(null); + openbtnfrench.setContentAreaFilled(false); + openbtnfrench.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + openbtnfrenchActionPerformed(evt); + } + }); + openbtnfrench.addKeyListener(new java.awt.event.KeyAdapter() { + public void keyPressed(java.awt.event.KeyEvent evt) { + openbtnfrenchKeyPressed(evt); + } + }); + openbtnfrench.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + openbtnfrenchMouseClicked(evt); + } + }); + + openbtnSimp.setIcon(new javax.swing.ImageIcon(getClass().getResource("/eric/GUI/icons/jswindow/js.png"))); // NOI18N + openbtnSimp.setToolTipText(Loc("JSeditor.choseGenerator")); + openbtnSimp.setBorder(null); + openbtnSimp.setContentAreaFilled(false); + openbtnSimp.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + openbtnSimpActionPerformed(evt); + } + }); + openbtnSimp.addKeyListener(new java.awt.event.KeyAdapter() { + public void keyPressed(java.awt.event.KeyEvent evt) { + openbtnSimpKeyPressed(evt); + } + }); + openbtnSimp.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + openbtnSimpMouseClicked(evt); + } + }); + action_buttons.add(openbtnfrench); + action_buttons.add(openbtnSimp); + + openbtn4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/eric/GUI/icons/jswindow/help.png"))); // NOI18N + openbtn4.setToolTipText(Loc("JSeditor.help")); + openbtn4.setBorder(null); + openbtn4.setContentAreaFilled(false); + openbtn4.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + openbtn4ActionPerformed(evt); + } + }); + openbtn4.addKeyListener(new java.awt.event.KeyAdapter() { + public void keyPressed(java.awt.event.KeyEvent evt) { + openbtn4KeyPressed(evt); + } + }); + openbtn4.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + openbtn4MouseClicked(evt); + } + }); + action_buttons.add(openbtn4); + + jPanel2.add(action_buttons); + + jPanel4.setAlignmentX(0.0F); + jPanel4.setAlignmentY(0.0F); + jPanel4.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); + jPanel4.setLayout(new javax.swing.BoxLayout(jPanel4, javax.swing.BoxLayout.X_AXIS)); + + jScrollPane1.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); + + script_area.setFont(new java.awt.Font("Monospaced", 0, 24)); + script_area.setCaretColor(new java.awt.Color(128, 64, 0)); + script_area.setCursor(new java.awt.Cursor(java.awt.Cursor.TEXT_CURSOR)); + script_area.setDisabledTextColor(new java.awt.Color(158, 150, 236)); + script_area.addKeyListener(new java.awt.event.KeyAdapter() { + public void keyTyped(java.awt.event.KeyEvent evt) { + script_areaKeyTyped(evt); + } + public void keyPressed(java.awt.event.KeyEvent evt) { + script_areaKeyPressed(evt); + } + public void keyReleased(java.awt.event.KeyEvent evt) { + script_areaKeyReleased(evt); + } + }); + script_area.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + script_areaMouseClicked(evt); + } + }); + jScrollPane1.setViewportView(script_area); + + jPanel4.add(jScrollPane1); + + jPanel2.add(jPanel4); + + jPanel14.setAlignmentX(0.0F); + jPanel14.setMaximumSize(new java.awt.Dimension(1, 2)); + jPanel14.setMinimumSize(new java.awt.Dimension(1, 2)); + jPanel14.setOpaque(false); + jPanel14.setPreferredSize(new java.awt.Dimension(1, 2)); + jPanel14.setLayout(new javax.swing.BoxLayout(jPanel14, javax.swing.BoxLayout.LINE_AXIS)); + jPanel2.add(jPanel14); + + jPanel1.add(jPanel2); + + commands.setBackground(new java.awt.Color(204, 204, 255)); + commands.setFocusable(false); + commands.setMaximumSize(new java.awt.Dimension(182, 98397)); + commands.setMinimumSize(new java.awt.Dimension(182, 0)); + commands.setOpaque(false); + commands.setPreferredSize(new java.awt.Dimension(182, 460)); + commands.setLayout(new javax.swing.BoxLayout(commands, javax.swing.BoxLayout.Y_AXIS)); + + jLabel1.setBackground(new java.awt.Color(117, 112, 104)); + jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); + jLabel1.setText("CaRMetal"); + jLabel1.setAlignmentX(0.5F); + jLabel1.setEnabled(false); + jLabel1.setFocusable(false); + jLabel1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); + jLabel1.setIconTextGap(0); + jLabel1.setMaximumSize(new java.awt.Dimension(182, 25)); + jLabel1.setMinimumSize(new java.awt.Dimension(182, 25)); + jLabel1.setPreferredSize(new java.awt.Dimension(182, 25)); + jLabel1.setRequestFocusEnabled(false); + jLabel1.setVerifyInputWhenFocusTarget(false); + commands.add(jLabel1); + + c_carmetal.setBackground(new java.awt.Color(117, 112, 104)); + c_carmetal.setMaximumSize(new java.awt.Dimension(182, 260)); + c_carmetal.setMinimumSize(new java.awt.Dimension(182, 250)); + c_carmetal.setOpaque(false); + c_carmetal.setPreferredSize(new java.awt.Dimension(182, 250)); + c_carmetal.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.CENTER, 3, 3)); + commands.add(c_carmetal); + + c_js.setBackground(new java.awt.Color(117, 112, 104)); + c_js.setMaximumSize(new java.awt.Dimension(182, 374)); + c_js.setMinimumSize(new java.awt.Dimension(182, 260)); + c_js.setOpaque(false); + c_js.setPreferredSize(new java.awt.Dimension(182, 260)); + c_js.setLayout(new javax.swing.BoxLayout(c_js, javax.swing.BoxLayout.Y_AXIS)); + + jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); + jLabel2.setText("Javascript"); + jLabel2.setAlignmentX(0.5F); + jLabel2.setEnabled(false); + jLabel2.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); + jLabel2.setIconTextGap(0); + jLabel2.setMaximumSize(new java.awt.Dimension(182, 25)); + jLabel2.setMinimumSize(new java.awt.Dimension(182, 25)); + jLabel2.setPreferredSize(new java.awt.Dimension(182, 25)); + jLabel2.setRequestFocusEnabled(false); + jLabel2.setVerifyInputWhenFocusTarget(false); + c_js.add(jLabel2); + + js_btns.setMaximumSize(new java.awt.Dimension(182, 120)); + js_btns.setMinimumSize(new java.awt.Dimension(182, 120)); + js_btns.setOpaque(false); + js_btns.setPreferredSize(new java.awt.Dimension(182, 120)); + js_btns.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.CENTER, 3, 3)); + c_js.add(js_btns); + + jScrollPane2.setBorder(javax.swing.BorderFactory.createEtchedBorder()); + jScrollPane2.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); + jScrollPane2.setAutoscrolls(true); + jScrollPane2.setFont(new java.awt.Font("Lucida Grande", 0, 12)); + jScrollPane2.setMaximumSize(new java.awt.Dimension(160, 500)); + jScrollPane2.setMinimumSize(new java.awt.Dimension(160, 100)); + jScrollPane2.setPreferredSize(new java.awt.Dimension(160, 100)); + + JSlist.setBackground(new java.awt.Color(214, 221, 229)); + JSlist.setFont(new java.awt.Font("DejaVu Sans", 2, 16)); // NOI18N + JSlist.setForeground(new java.awt.Color(150, 50, 50)); + JSlist.setModel(new javax.swing.AbstractListModel() { + String[] strings = { Global.Loc("JSFonctions.Input"), Global.Loc("JSFonctions.Print"), Global.Loc("JSFonctions.Println"), Global.Loc("JSFonctions.Alert"), Global.Loc("JSFonctions.ifelse"), Global.Loc("JSFonctions.switchcase"), Global.Loc("JSFonctions.for"), Global.Loc("JSFonctions.while"), Global.Loc("JSFonctions.dowhile"), Global.Loc("JSFonctions.dountil"), Global.Loc("JSFonctions.function") }; + public int getSize() { return strings.length; } + public Object getElementAt(int i) { return strings[i]; } + }); + JSlist.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); + JSlist.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); + JSlist.setDragEnabled(true); + JSlist.setFixedCellHeight(20); + JSlist.setMaximumSize(new java.awt.Dimension(160, 415)); + JSlist.setMinimumSize(new java.awt.Dimension(160, 20)); + JSlist.setPreferredSize(new java.awt.Dimension(160, 220)); + JSlist.setRequestFocusEnabled(false); + JSlist.setVisibleRowCount(-1); + JSlist.addListSelectionListener(new javax.swing.event.ListSelectionListener() { + public void valueChanged(javax.swing.event.ListSelectionEvent evt) { + JSlistValueChanged(evt); + } + }); + jScrollPane2.setViewportView(JSlist); + + c_js.add(jScrollPane2); + + commands.add(c_js); + + jPanel1.add(commands); + + RightBorder.setMaximumSize(new java.awt.Dimension(5, 32767)); + RightBorder.setMinimumSize(new java.awt.Dimension(5, 0)); + RightBorder.setPreferredSize(new java.awt.Dimension(5, 515)); + RightBorder.setLayout(null); + jPanel1.add(RightBorder); + + getContentPane().add(jPanel1); + + controls.setMaximumSize(new java.awt.Dimension(32000, 22)); + controls.setMinimumSize(new java.awt.Dimension(35, 22)); + controls.setPreferredSize(new java.awt.Dimension(35, 22)); + controls.setLayout(new javax.swing.BoxLayout(controls, javax.swing.BoxLayout.X_AXIS)); + + jPanel13.setAlignmentX(0.0F); + jPanel13.setAlignmentY(0.0F); + jPanel13.setMaximumSize(new java.awt.Dimension(10, 1)); + jPanel13.setMinimumSize(new java.awt.Dimension(10, 1)); + jPanel13.setOpaque(false); + jPanel13.setPreferredSize(new java.awt.Dimension(10, 1)); + controls.add(jPanel13); + + errorpanel.setAlignmentX(0.0F); + errorpanel.setAlignmentY(0.0F); + errorpanel.setMaximumSize(new java.awt.Dimension(32737, 32737)); + errorpanel.setMinimumSize(new java.awt.Dimension(0, 30)); + errorpanel.setOpaque(false); + errorpanel.setPreferredSize(new java.awt.Dimension(0, 30)); + errorpanel.setLayout(new javax.swing.BoxLayout(errorpanel, javax.swing.BoxLayout.X_AXIS)); + + errortitlelabel.setBackground(new java.awt.Color(117, 112, 104)); + errortitlelabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/eric/GUI/icons/jswindow/error.png"))); // NOI18N + errortitlelabel.setText("Error"); + errortitlelabel.setAlignmentY(0.0F); + errortitlelabel.setIconTextGap(10); + errortitlelabel.setMaximumSize(new java.awt.Dimension(250, 30)); + errortitlelabel.setMinimumSize(new java.awt.Dimension(250, 30)); + errortitlelabel.setPreferredSize(new java.awt.Dimension(250, 30)); + errorpanel.add(errortitlelabel); + + errormessagelabel.setBackground(new java.awt.Color(117, 112, 104)); + errormessagelabel.setFont(new java.awt.Font("DejaVu Sans", 3, 13)); + errormessagelabel.setForeground(new java.awt.Color(102, 102, 102)); + errormessagelabel.setText("Error message"); + errormessagelabel.setAlignmentY(0.0F); + errormessagelabel.setMaximumSize(new java.awt.Dimension(10000, 30)); + errormessagelabel.setMinimumSize(new java.awt.Dimension(300, 30)); + errormessagelabel.setPreferredSize(new java.awt.Dimension(300, 30)); + errorpanel.add(errormessagelabel); + + controls.add(errorpanel); + + jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/eric/GUI/icons/themes/gray/zoombox.png"))); // NOI18N + jButton2.setAlignmentY(0.0F); + jButton2.setBorderPainted(false); + jButton2.setContentAreaFilled(false); + jButton2.setMaximumSize(new java.awt.Dimension(25, 30)); + jButton2.setMinimumSize(new java.awt.Dimension(25, 30)); + jButton2.setPreferredSize(new java.awt.Dimension(25, 30)); + jButton2.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + jButton2MouseClicked(evt); + } + public void mousePressed(java.awt.event.MouseEvent evt) { + jButton2MousePressed(evt); + } + }); + jButton2.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { + public void mouseDragged(java.awt.event.MouseEvent evt) { + jButton2MouseDragged(evt); + } + }); + jButton2.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton2ActionPerformed(evt); + } + }); + controls.add(jButton2); + + getContentPane().add(controls); + + pack(); + }// //GEN-END:initComponents + + private void script_areaKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_script_areaKeyReleased +// syntaxColoring(); // TODO add your handling code here: +// if (evt.getKeyCode()==KeyEvent.VK_ENTER) { +// FindDelimiters(); +// int c=script_area.getCaretPosition(); +// int t=tabIndent(c); +// script_area.replaceSelection(tabs(t)); +// +//// script_area.setCaretPosition(c-t); +// } + }//GEN-LAST:event_script_areaKeyReleased + + private void script_areaKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_script_areaKeyPressed + // TODO add your handling code here: + NoTypeNoClic=false; +// errorpanel.removeAll(); + + + }//GEN-LAST:event_script_areaKeyPressed + + private void script_areaKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_script_areaKeyTyped +// errorpanel.removeAll(); // TODO add your handling code here: + clearStatusBar(); + }//GEN-LAST:event_script_areaKeyTyped + + private void script_areaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_script_areaMouseClicked + NoTypeNoClic=false; // TODO add your handling code here: + clearStatusBar(); + }//GEN-LAST:event_script_areaMouseClicked + + private void closeBTNMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_closeBTNMouseClicked + dispose(); + }//GEN-LAST:event_closeBTNMouseClicked + + private void macpanelMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_macpanelMousePressed + origin=MouseInfo.getPointerInfo().getLocation(); + winloc=getLocation(); + // TODO add your handling code here: +}//GEN-LAST:event_macpanelMousePressed + + private void jPanel3MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanel3MousePressed + origin=MouseInfo.getPointerInfo().getLocation(); + winloc=getLocation(); + // TODO add your handling code here: + }//GEN-LAST:event_jPanel3MousePressed + + private void jPanel3MouseDragged(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanel3MouseDragged + current=MouseInfo.getPointerInfo().getLocation(); + xx=winloc.x+current.x-origin.x; + yy=winloc.y+current.y-origin.y; + + setLocation(xx, yy); + Toolkit.getDefaultToolkit().sync(); + // TODO add your handling code here: + }//GEN-LAST:event_jPanel3MouseDragged + + private void macpanelMouseDragged(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_macpanelMouseDragged + current=MouseInfo.getPointerInfo().getLocation(); + xx=winloc.x+current.x-origin.x; + yy=winloc.y+current.y-origin.y; + + setLocation(xx, yy); + Toolkit.getDefaultToolkit().sync(); + // TODO add your handling code here: +}//GEN-LAST:event_macpanelMouseDragged + + private void winpanelMouseDragged(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_winpanelMouseDragged + current=MouseInfo.getPointerInfo().getLocation(); + xx=winloc.x+current.x-origin.x; + yy=winloc.y+current.y-origin.y; + + setLocation(xx, yy); + Toolkit.getDefaultToolkit().sync(); + // TODO add your handling code here: +}//GEN-LAST:event_winpanelMouseDragged + + private void winpanelMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_winpanelMousePressed + origin=MouseInfo.getPointerInfo().getLocation(); + winloc=getLocation(); + // TODO add your handling code here: +}//GEN-LAST:event_winpanelMousePressed + + private void jButton2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton2MouseClicked + // TODO add your handling code here: + }//GEN-LAST:event_jButton2MouseClicked + + private void jButton2MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton2MousePressed + origin=MouseInfo.getPointerInfo().getLocation(); + winloc=getLocation(); + w=this.getWidth(); + h=this.getHeight(); + // TODO add your handling code here: + }//GEN-LAST:event_jButton2MousePressed + + private void jButton2MouseDragged(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton2MouseDragged + current=MouseInfo.getPointerInfo().getLocation(); + + setSize(Math.max(current.x-origin.x+w, 40), Math.max(current.y-origin.y+h, 120)); + Toolkit.getDefaultToolkit().sync(); + // TODO add your handling code here: + }//GEN-LAST:event_jButton2MouseDragged + + private void JSlistValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_JSlistValueChanged + //infrench = System.getProperty("user.language").equals("fr"); + String scp=script_area.getText(); + if (evt.getValueIsAdjusting()==false) { + int sel=JSlist.getSelectedIndex(); + JSlist.removeSelectionInterval(sel, sel); + if (sel==0) { + if (pseudoCode){ + if (infrench) { + script_area.replaceSelection("a ⟵ Entrée(\""+Loc("JScmd.inputmessage")+"\")"); + } + else { + script_area.replaceSelection("a ⟵ Input(\""+Loc("JScmd.inputmessage")+"\")"); + } + } + else { + if (infrench) { + if (FlagSimp) { + script_area.replaceSelection("a:=Entrée(\""+Loc("JScmd.inputmessage")+"\");"); + } + else { + script_area.replaceSelection("a=Entrée(\""+Loc("JScmd.inputmessage")+"\");"); + } + } + else { + if (FlagSimp) { + script_area.replaceSelection("a:=Input(\""+Loc("JScmd.inputmessage")+"\");"); + } + else { + script_area.replaceSelection("a=Input(\""+Loc("JScmd.inputmessage")+"\");"); + } + } + } + } else if (sel==1) { + if (pseudoCode){ + if (infrench) { + script_area.replaceSelection("Afficher \""+Loc("JScmd.promptmessage")+"\""); + } + else { + script_area.replaceSelection("Print(\""+Loc("JScmd.promptmessage")+"\")"); + } + } + else { + if (infrench) { + script_area.replaceSelection("Afficher(\""+Loc("JScmd.promptmessage")+"\");"); + } + else { + script_area.replaceSelection("Print(\""+Loc("JScmd.promptmessage")+"\");"); + } + } + } else if (sel==2) { + if (pseudoCode){ + if (infrench) { + script_area.replaceSelection("Afficherligne(\""+Loc("JScmd.promptmessage")+"\")"); + } + else { + script_area.replaceSelection("Println(\""+Loc("JScmd.promptmessage")+"\")"); + } + } + else { + if (infrench) { + script_area.replaceSelection("Afficherligne(\""+Loc("JScmd.promptmessage")+"\");"); + } + else { + script_area.replaceSelection("Println(\""+Loc("JScmd.promptmessage")+"\");"); + } + } + } else if (sel==3) { + if (pseudoCode){ + if (infrench) { + script_area.replaceSelection("Alerte(\""+Loc("JScmd.promptmessage")+"\")"); + } + else { + script_area.replaceSelection("Alert(\""+Loc("JScmd.promptmessage")+"\")"); + } + } + else{ + if (infrench) { + script_area.replaceSelection("Alerte(\""+Loc("JScmd.promptmessage")+"\");"); + } + else { + script_area.replaceSelection("Alert(\""+Loc("JScmd.promptmessage")+"\");"); + } + } + } else if (sel==4) { + if (pseudoCode){ + if (infrench) { + script_area.replaceSelection("si i<20 \n ...\nsinon \n ..."); + } + else { + script_area.replaceSelection("if i<20 \n ...\nelse \n ..."); + } + } + else { + if (infrench) { + script_area.replaceSelection("si (i<20){\n\n} sinon {\n\n}"); + } + else { + script_area.replaceSelection("if (i<20){\n\n} else {\n\n}"); + } + } + } else if (sel==5) { + if (pseudoCode){ + if (infrench) { + script_area.replaceSelection("si i<20 \n ...\nsinon \n si i<5 \n ...\n sinon \n ..."); + } + else { + script_area.replaceSelection("if i<20 \n ...\nelse \n if i<5 \n ...\n else \n ..."); + } + } + else { + if (infrench) { + script_area.replaceSelection("bifurquer (d){\n " + +"cas 1 : {\n\n rompre; }\n cas 2 : {\n\n rompre; }\n" + +"cas 3 : {\n\n rompre;} \n par défaut : {\n\n } \n} "); + } + else { + script_area.replaceSelection("switch (d){\n " + +"case 1 : {\n\n break; }\n case 2 : {\n\n break; }\n" + +"case 3 : {\n\n break;} \n par default : {\n\n } \n} "); + } + } + } else if (sel==6) { + if (pseudoCode){ + if (infrench) { + if (FlagSimp) { + script_area.replaceSelection("répéter 20 fois \n ..."); + } + else { + script_area.replaceSelection("pour i allant de 1 à 20 \n ..."); + } + } + else { + if (FlagSimp) { + script_area.replaceSelection("repeat 20 times \n ..."); + } + else { + script_area.replaceSelection("for (i ⟵ 0; i<20; i++) \n ..."); + } + } + } + else { + if (infrench) { + if (FlagSimp) { + script_area.replaceSelection("répéter 20 fois {\n\n}"); + } + else { + script_area.replaceSelection("pour i allant de 1 à 20 {\n\n}"); + } + } + else { + if (FlagSimp) { + script_area.replaceSelection("repeat 20 times {\n\n}"); + } + else { + script_area.replaceSelection("for (i=0; i<20; i++){\n\n}"); + } + } + } + } else if (sel==7) { + if (pseudoCode){ + if (infrench) { + script_area.replaceSelection("tant que (i<20)\n ...\n i ⟵ i+1"); + } + else { + script_area.replaceSelection("while (i<20)\n ...\n i ⟵ i+1"); + } + } + else { + if (infrench) { + if (FlagSimp) { + script_area.replaceSelection("tant que (i<20){\ni:=i+1;\n}\n"); + } + else { + script_area.replaceSelection("tant que (i<20){\ni=i+1;\n}\n"); + } + } + else { + if (FlagSimp) { + script_area.replaceSelection("while (i<20){\ni:=i+1;\n}\n"); + } + else { + script_area.replaceSelection("while (i<20){\ni=i+1;\n}\n"); + } + } + } + } else if(sel==8) { + if (pseudoCode){ + if (infrench) { + script_area.replaceSelection("faire\n ...\n i ⟵ i+1\ntant que (i<20)\n"); + } + else { + script_area.replaceSelection("do\n ...\n i ⟵ i+1\nwhile (i<20)\n"); + } + } + else { + if (infrench) { + if (FlagSimp) { + script_area.replaceSelection("faire{\ni:=i+1;\n\n}tant que (i<20)\n"); + } + else { + script_area.replaceSelection("faire{\ni=i+1;\n\n}tant que (i<20)\n"); + } + } + else { + if (FlagSimp) { + script_area.replaceSelection("do{\ni:=i+1;\n\n}while (i<20)\n"); + } + else { + script_area.replaceSelection("do{\ni=i+1;\n\n}while (i<20)\n"); + } + } + } + } else if(sel==9) { + if (pseudoCode){ + if (infrench) { + script_area.replaceSelection("faire\n ...\n i ⟵ i+1\njusqu'à (i>20)\n"); + } + else { + script_area.replaceSelection("do\n ...\n i ⟵ i+1\nuntil (i>20)\n"); + } + } + else { + if (infrench) { + if (FlagSimp) { + script_area.replaceSelection("faire{\ni:=i+1;\n\n}jusqu'à (i>20);\n"); + } + else { + script_area.replaceSelection("faire{\ni=i+1;\n\n}jusqu'à (i>20);\n"); + } + } + else { + if (FlagSimp) { + script_area.replaceSelection("do{\ni:=i+1;\n\n}until (i>20);\n"); + } + else { + script_area.replaceSelection("do{\ni=i+1;\n\n}until (i>20);\n"); + } + } + } + } else if (sel==10) { + if (pseudoCode){ + if (infrench) { + script_area.replaceSelection("fonction mafonction(x)\n ..."); + } + else { + script_area.replaceSelection("function myfunction(x)\n ..."); + } + } + else { + if (infrench) { + script_area.replaceSelection("fonction myfunction(x){\n\n}"); + } + else { + script_area.replaceSelection("function myfunction(x){\n\n}"); + } + } + } + //Format(); + script_area.requestFocus(); + } + // TODO add your handling code here: + }//GEN-LAST:event_JSlistValueChanged + + private void formWindowClosed(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosed + + + + + // TODO add your handling code here: + }//GEN-LAST:event_formWindowClosed + + private void formWindowActivated(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowActivated +// System.out.println("activated"); // TODO add your handling code here: + }//GEN-LAST:event_formWindowActivated + + private void formWindowDeactivated(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowDeactivated +// System.out.println("déactivated"); // TODO add your handling code here: + }//GEN-LAST:event_formWindowDeactivated + + private void backbtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_backbtnActionPerformed + // TODO add your handling code here: +}//GEN-LAST:event_backbtnActionPerformed + + private void backbtnKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_backbtnKeyPressed + // TODO add your handling code here: +}//GEN-LAST:event_backbtnKeyPressed + + private void backbtnMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_backbtnMouseClicked + // TODO add your handling code here: + clearStatusBar(); + ITEM.getPanel().Restore(); +}//GEN-LAST:event_backbtnMouseClicked + + private void openbtn2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_openbtn2ActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_openbtn2ActionPerformed + + private void openbtn2KeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_openbtn2KeyPressed + // TODO add your handling code here: + }//GEN-LAST:event_openbtn2KeyPressed + + private void openbtn2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_openbtn2MouseClicked + // TODO add your handling code here: + clearStatusBar(); + Format(); + syntaxColoring(); + }//GEN-LAST:event_openbtn2MouseClicked + + private void openbtn3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_openbtn3ActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_openbtn3ActionPerformed + + private void openbtn3KeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_openbtn3KeyPressed + // TODO add your handling code here: + }//GEN-LAST:event_openbtn3KeyPressed + + private void openbtn3MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_openbtn3MouseClicked + // TODO add your handling code here: + clearStatusBar(); + ITEM.runScript(); + }//GEN-LAST:event_openbtn3MouseClicked + + private void openbtn4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_openbtn4ActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_openbtn4ActionPerformed + + private void openbtn4KeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_openbtn4KeyPressed + // TODO add your handling code here: + }//GEN-LAST:event_openbtn4KeyPressed + + private void openbtn4MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_openbtn4MouseClicked + // TODO add your handling code here: +// setAlwaysOnTop(true); + JBrowserLauncher.openURL("http://carmetal.org/index.php/fr/tutoriels/les-scripts/syntaxe"); +//setAlwaysOnTop(false); + toFront(); + + }//GEN-LAST:event_openbtn4MouseClicked + + private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing + // TODO add your handling code here: + }//GEN-LAST:event_formWindowClosing + + private void openbtn5ActionPerformed(java.awt.event.ActionEvent evt) { + // TODO add your handling code here: + } + + private void openbtn5KeyPressed(java.awt.event.KeyEvent evt) { + // TODO add your handling code here: + } + + private void openbtn5MouseClicked(java.awt.event.MouseEvent evt) { + // TODO add your handling code here: + commentSelection(); + } + + private void openbtnfrenchActionPerformed(java.awt.event.ActionEvent evt) { + // TODO add your handling code here: + } + + private void openbtnfrenchKeyPressed(java.awt.event.KeyEvent evt) { + // TODO add your handling code here: + } + + private void openbtnfrenchMouseClicked(java.awt.event.MouseEvent evt) { + // TODO add your handling code here: + infrench=!infrench; + if (infrench) openbtnfrench.setIcon(new javax.swing.ImageIcon(getClass().getResource("/eric/GUI/icons/jswindow/french.png"))); + else openbtnfrench.setIcon(new javax.swing.ImageIcon(getClass().getResource("/eric/GUI/icons/jswindow/french2.png"))); + openbtnfrench.setBorder(null); + openbtnfrench.setContentAreaFilled(false); + c_carmetal.removeAll(); + initCaRMetalBtns(); + openbtnfrench.revalidate(); + c_carmetal.revalidate(); + } + + private void openbtnSimpActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_openbtn5ActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_openbtn5ActionPerformed + + private void openbtnSimpKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_openbtn5KeyPressed + // TODO add your handling code here: + }//GEN-LAST:event_openbtn5KeyPressed + + private void openbtnSimpMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_openbtn5MouseClicked + // TODO add your handling code here: + FlagSimp=!FlagSimp; + if (FlagSimp) openbtnSimp.setIcon(new javax.swing.ImageIcon(getClass().getResource("/eric/GUI/icons/jswindow/js2.png"))); + else openbtnSimp.setIcon(new javax.swing.ImageIcon(getClass().getResource("/eric/GUI/icons/jswindow/js.png"))); + openbtnSimp.setBorder(null); + openbtnSimp.setContentAreaFilled(false); + c_carmetal.removeAll(); + initCaRMetalBtns(); + openbtnSimp.revalidate(); + c_carmetal.revalidate(); + }//GEN-LAST:event_openbtn5MouseClicked + + private void jTextHeightStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jTextHeightStateChanged + // TODO add your handling code here: + clearStatusBar(); + script_area.setFont(new Font("monospaced", Font.PLAIN, TailleTexte));//taille script + TailleTexte=jTextHeight.getValue(); + }//GEN-LAST:event_jTextHeightStateChanged + + private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_jButton2ActionPerformed + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JList JSlist; + private javax.swing.JPanel LeftBorder; + private javax.swing.JPanel RightBorder; + private javax.swing.JPanel action_buttons; + private javax.swing.JButton backbtn; + private javax.swing.JPanel c_carmetal; + private javax.swing.JPanel c_js; + private javax.swing.JButton closeBTN; + private javax.swing.JPanel commands; + private javax.swing.JPanel controls; + private javax.swing.JLabel errormessagelabel; + private javax.swing.JPanel errorpanel; + private javax.swing.JLabel errortitlelabel; + private javax.swing.JButton jButton2; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; + private javax.swing.JPanel jPanel1; + private javax.swing.JPanel jPanel10; + private javax.swing.JPanel jPanel11; + private javax.swing.JPanel jPanel12; + private javax.swing.JPanel jPanel13; + private javax.swing.JPanel jPanel14; + private javax.swing.JPanel jPanel15; + private javax.swing.JPanel jPanel16; + private javax.swing.JPanel jPanel18; + private javax.swing.JPanel jPanel2; + private javax.swing.JPanel jPanel3; + private javax.swing.JPanel jPanel4; + private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JScrollPane jScrollPane2; + private javax.swing.JSlider jTextHeight; + private javax.swing.JPanel js_btns; + private javax.swing.JPanel macpanel; + private javax.swing.JButton openbtn2; + private javax.swing.JButton openbtn3; + private javax.swing.JButton openbtn4; + private javax.swing.JButton openbtn5; + private javax.swing.JButton openbtnfrench; + private javax.swing.JButton openbtnSimp; + private javax.swing.JTextPane script_area; + private javax.swing.JLabel title_lbl; + private javax.swing.JPanel winpanel; + // End of variables declaration//GEN-END:variables +} diff --git a/eric/JSprogram/JSFunctions.java b/eric/JSprogram/JSFunctions.java new file mode 100644 index 0000000..1ccc60d --- /dev/null +++ b/eric/JSprogram/JSFunctions.java @@ -0,0 +1,7815 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.JSprogram; + +import eric.*; +import eric.GUI.palette.PaletteManager; +import eric.GUI.pipe_tools; +import java.awt.Color; +import java.awt.FileDialog; +import java.io.File; +import java.util.Enumeration; +import java.util.Vector; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import javax.swing.JFileChooser; +import javax.swing.JOptionPane; +import org.mozilla.javascript.Context; +import org.mozilla.javascript.Scriptable; +import org.mozilla.javascript.ScriptableObject; +import rene.gui.Global; +import rene.util.FileName; +import rene.zirkel.ZirkelCanvas; +import rene.zirkel.construction.Construction; +import rene.zirkel.construction.ConstructionException; +import rene.zirkel.constructors.ObjectConstructor; +import rene.zirkel.expression.Expression; +import rene.zirkel.macro.MacroRunner; +import rene.zirkel.objects.AngleObject; +import rene.zirkel.objects.AreaObject; +import rene.zirkel.objects.ConstructionObject; +import rene.zirkel.objects.EquationXYObject; +import rene.zirkel.objects.ExpressionObject; +import rene.zirkel.objects.FixedAngleObject; +import rene.zirkel.objects.FixedCircleObject; +import rene.zirkel.objects.FunctionObject; +import rene.zirkel.objects.IntersectionObject; +import rene.zirkel.objects.PointObject; +import rene.zirkel.objects.PrimitiveCircleObject; +import rene.zirkel.objects.PrimitiveLineObject; +import rene.zirkel.objects.QuadricObject; +import rene.zirkel.objects.SegmentObject; +import rene.zirkel.objects.TextObject; +import rene.zirkel.objects.TwoPointLineObject; +import rene.zirkel.objects.VectorObject; + +/** + * + * @author erichake with addons by Dibs + */ +public class JSFunctions { + + static String[] allnames={"cm", "Input", "Entrée", "EntréeNombreEntier", "EntréeNombreDécimal", "Prompt", "Signaler", "Print", "Afficher", "afficher", "Println", "Afficherligne", "Shownames", "MontrerNoms", "Hidenames", "CacherNoms", "Hide", "Cacher", "Show", + "Montrer", "Point", "PointOn", "PointSur", "ImplicitPlot", "TracéImplicite", "Intersection", "Intersection2", "Intersections", "MidPoint", "Milieu", "Symmetry", "SymétrieCentrale", "Line", "Droite", "Segment", "Circle", "Cercle", "Parallel", + "Parallèle", "Perpendicular", "Perpendiculaire", "FixedCircle", "CercleRayon", "Move", "Déplacer", "X", "Y", "GetExpressionValue", "PrendreValeurExpression", "Ray", "DemiDroite", "Angle", "Polygon", "Polygone", "Quadric", "Quadrique", + "CartesianFunction", "FonctionCartésienne", "ParametricFunction", "FonctionParamétrique", "SetColor", "MettreCouleur", "SetText", "MettreTexte", "SetThickness", "MettreEpaisseur", "SetFixed", "MettreFixe", "Vector", "Vecteur", "SetRGBColor", + "MettreCouleurRVB", "SetShowName", "MettreMontrerNom", "SetShowValue", "MettreMontrerValeur", "SetFilled", "MettreRempli", "SetSolid", "MettreOpaque", "SetPartial", "MettrePartiel", "Expression", "Text", "Texte", "SetAlias", "MettreAlias", "SetMagneticObjects", + "MettreObjetsMagnétiques", "AddMagneticObject", "AjouterObjetMagnétique", "SetMagneticRay", "MettreRayonMagnétique", "SetPointType", "MettreTypePoint", "InteractiveInput", "EntréeInteractive", "FixedSegment", "SegmentFixe", "SetHide", "MettreCaché", "Pause", + "Delete", "Supprimer", "SetExpressionValue", "MettreValeurExpression", "Reflection", "SymétrieAxiale", "Translation", "PerpendicularBisector", "Médiatrice", "AngleBisector", "Bissectrice", "Circle3pts", "Cercle3pts", + "Arc3pts", "FixedAngle", "AngleFixe", "Circle3", "Cercle3", "ExecuteMacro", "ExécuterMacro", "ExecuteMacroAsBuilt", "ExécuterMacroCommeDéfinie", "Alert", "Alerte", "Conditional", "Conditionnel", "Layer", "Calque", "GetRed", "PrendreRouge", "GetGreen", "PrendreVert", "GetBlue", "PrendreBleu", "PenDown", "CrayonBaissé", + "SetRed", "MettreRouge", "SetGreen", "MettreVert", "SetBlue", "MettreBleu", "DPPoint", "DPLine", "DPSegment", "DPPerpendicular", "DPPerpendicularBisector", + "DPMidPoint", "DPCircle", "DPReflexion", "DPSymmetry", "DPAngleBisector", "DPCommonPerpendicular", "DPRay", + "getC", "getZC", "refreshZC", "rafraichirZC", "Load", "Origin", "Origine", "Extremity", "Extrémité", "GetText", "PrendreTexte", "ReflexAngle", "AngleRentrant", "Exists", "Existe", "SetIncrement", "MettreIncrément", + "GetOpenFile", "PrendreFichierOuvert", "OrderedIntersection", "IntersectionOrdonnée", "SetMinOpen", "SetMinClosed", "SetMaxOpen", "SetMaxClosed","Distance", "Point3D", "X3D", "Y3D", "Z3D", "Distance3D", + "getCONSOLE", "prendreCONSOLE", "Sphere", "Sphère", "FixedSphere", "SphèreRayon", "Projection3D", "Reflection3D", "Symétrie3DPlan", "Symmetry3D", "SymétrieCentrale3D", "Translation3D", "Circle3D", "Cercle3D", "FixedCircle3D", "CercleRayon3D", "Circle3D3pts", "Cercle3D3pts","SetIconSelection","IsIconSelected","AttacherTortue", + "BaisserStylo","LeverStylo","Avancer","TournerGauche","TournerDroite","MontrerTortue","CacherTortue","OrienterTortue","VitesseTortue","Reculer","PivoterGauche","PivoterDroite","PivoterHaut","PivoterBas","Viser","Triangle","Quadrilatère","Quadrangle","FixTurtle","TurtleDown","TurtleUp","MoveForward","MoveBackward","TurnLeft", + "TurnRight","RollLeft","RollRight","PitchUp","PitchDown","ShowTurtle","HideTurtle","OrientateTurtle","OrientateTowards","TurtleSpeed","Liberate","Libérer","getRealScript","getZZ","prendreZZ","Quadrilatère3D", "Quadrangle3D", "Polygone3D", "Polygon3D","ClicVirtuel"}; + + static PointObject ptTortue, pt3DTortue; + static PointObject ptTortue2, pt3DTortue2; + static PointObject ptSupport; + static PointObject ptSupport2; + static PointObject ptO; + static PointObject ptO2; + static PointObject ptO3; + static VectorObject dirTortue; + static VectorObject dirTortueVisu; + static ExpressionObject longueurTortue, longueurTortue3D; + static boolean styloBaisse, turtleIs3D; + static double vitesseTortue = 100; + static double nbSteps=1; + static PointObject t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, t19, t20, t21, t22, t23, t24; + static Vector p1, p2, tete, p3, p4, cara; + static AreaObject pp1, pp2, pp3, pp4, ttete, ccara; + static PointObject pt3D0, pt3D1, pt3D2, pt3D3, pt3D1b, pt3D2b, pt3D3b, pt3DSupport, pt3DSupport01, pt3DSupport02, pt3DSupport03, t3D1, t3D2, t3D3, t3D4; + static VectorObject dirTortue3D1, dirTortue3D2, dirTortue3D3, dirTortueVisu3D1, dirTortueVisu3D2, dirTortueVisu3D3; + static Vector p3D; + static AreaObject pp3D; + static PointObject oldpt3D2, oldpt3D3, pt3D2bis, pt3D3bis, npoint; + + + public static String[] getKeywords() { + return allnames; + } + + public static String AttacherTortue(String name) { + pt3DTortue=(PointObject) getC().find(name); + if (pt3DTortue!=null) { + turtleIs3D=pt3DTortue.is3D(); + synchronized (getC()) { + if (turtleIs3D) { + try { if (pt3D0==null) { + longueurTortue3D=new ExpressionObject(getC(), 0, 0); + longueurTortue3D.setDefaults(); + longueurTortue3D.setHidden(true); + longueurTortue3D.setName("kTortue3D"); + longueurTortue3D.setPrompt(longueurTortue3D.getName()); + styloBaisse = true; + + pt3D0=new PointObject(getC(),0,0); + longueurTortue3D.setExpression("60/pixel", getC()); + pt3D1=new PointObject(getC(),0,0); + + pt3D2=new PointObject(getC(),0,0); + + pt3D3=new PointObject(getC(),0,0); + + pt3D1b=new PointObject(getC(),0,0); + + pt3D2b=new PointObject(getC(),0,0); + + pt3D3b=new PointObject(getC(),0,0); + + dirTortue3D1= new VectorObject(getC(),pt3D0,pt3D1); + dirTortue3D2= new VectorObject(getC(),pt3D0,pt3D2); + dirTortue3D3= new VectorObject(getC(),pt3D0,pt3D3); + + pt3DSupport=new PointObject(getC(),0,0); + pt3DSupport01=new PointObject(getC(),0,0); + pt3DSupport02=new PointObject(getC(),0,0); + pt3DSupport03=new PointObject(getC(),0,0); + + dirTortueVisu3D1= new VectorObject(getC(),pt3DSupport,pt3DSupport01); + dirTortueVisu3D2= new VectorObject(getC(),pt3DSupport,pt3DSupport02); + dirTortueVisu3D3= new VectorObject(getC(),pt3DSupport,pt3DSupport03); + + p3D= new Vector(); + t3D1=new PointObject(getC(),0,0); + t3D2=new PointObject(getC(),0,0); + t3D3=new PointObject(getC(),0,0);; + t3D4=new PointObject(getC(),0,0); + pp3D = new AreaObject(getC(),p3D); + pp3D.setDefaults(); + pp3D.setFilled(true); + pp3D.setSpecialColor(new Color(138,74,0)); + } + else { + pt3D1=new PointObject(getC(),0,0); + pt3D2=new PointObject(getC(),0,0); + pt3D3=new PointObject(getC(),0,0); + pt3D1b=new PointObject(getC(),0,0); + pt3D2b=new PointObject(getC(),0,0); + pt3D3b=new PointObject(getC(),0,0); + } + addObject(longueurTortue3D); + addObject(pt3D0); + addObject(pt3D1); + addObject(pt3D2); + addObject(pt3D3); + addObject(pt3D1b); + addObject(pt3D2b); + addObject(pt3D3b); + addObject(dirTortue3D1); + addObject(dirTortue3D2); + addObject(dirTortue3D3); + addObject(pt3DSupport); + addObject(pt3DSupport01); + addObject(pt3DSupport02); + addObject(pt3DSupport03); + addObject(dirTortueVisu3D1); + addObject(dirTortueVisu3D2); + addObject(dirTortueVisu3D3); + addObject(t3D1); + addObject(t3D2); + addObject(t3D3); + addObject(pp3D); + pt3D0.setIs3D(true); + pt3D1.setIs3D(true); + pt3D2.setIs3D(true); + pt3D3.setIs3D(true); + pt3D0.setFixed("0","0","0"); + pt3D0.validate(); + pt3D1.setFixed("1","0","0"); + pt3D1.validate(); + pt3D2.setFixed("0","1","0"); + pt3D3.validate(); + pt3D3.setFixed("0","0","1"); + pt3D0.setHidden(true); + pt3D1.setSuperHidden(true); + pt3D2.setSuperHidden(true); + pt3D3.setSuperHidden(true); + pt3D1b.setSuperHidden(true); + pt3D2b.setSuperHidden(true); + pt3D3b.setSuperHidden(true); + + pt3D1b.setIs3D(true); + pt3D2b.setIs3D(true); + pt3D3b.setIs3D(true); + pt3D1b.setFixed("1","0","0"); + pt3D2b.setFixed("0","1","0"); + pt3D3b.setFixed("0","0","1"); + + pt3DSupport.setIs3D(true); + pt3DSupport01.setIs3D(true); + pt3DSupport02.setIs3D(true); + pt3DSupport03.setIs3D(true); + + t3D1.setIs3D(true); + t3D2.setIs3D(true); + t3D3.setIs3D(true); + t3D4.setIs3D(true); + + dirTortue3D1.setDefaults(); + dirTortue3D1.setHidden(true); + + dirTortue3D2.setDefaults(); + dirTortue3D2.setHidden(true); + + dirTortue3D3.setDefaults(); + dirTortue3D3.setHidden(true); + + dirTortueVisu3D1.setDefaults(); + dirTortueVisu3D1.setHidden(true); + + dirTortueVisu3D2.setDefaults(); + dirTortueVisu3D2.setHidden(true); + + dirTortueVisu3D3.setDefaults(); + dirTortueVisu3D3.setHidden(true); + + pt3DTortue=(PointObject) getC().find(name); + + pt3DSupport.setSuperHidden(true); + pt3DSupport.setFixed("x3D("+pt3DTortue.getName()+")","y3D("+pt3DTortue.getName()+")","z3D("+pt3DTortue.getName()+")"); + + pt3DSupport01.setSuperHidden(true); + pt3DSupport01.setFixed("x3D("+pt3DTortue.getName()+")+x3D("+dirTortue3D1.getName()+")","y3D("+pt3DTortue.getName()+")+y3D("+dirTortue3D1.getName()+")","z3D("+pt3DTortue.getName()+")+z3D("+dirTortue3D1.getName()+")"); + + pt3DSupport02.setSuperHidden(true); + pt3DSupport02.setFixed("x3D("+pt3DTortue.getName()+")+x3D("+dirTortue3D2.getName()+")","y3D("+pt3DTortue.getName()+")+y3D("+dirTortue3D2.getName()+")","z3D("+pt3DTortue.getName()+")+z3D("+dirTortue3D2.getName()+")"); + + pt3DSupport03.setSuperHidden(true); + pt3DSupport03.setFixed("x3D("+pt3DTortue.getName()+")+x3D("+dirTortue3D3.getName()+")","y3D("+pt3DTortue.getName()+")+y3D("+dirTortue3D3.getName()+")","z3D("+pt3DTortue.getName()+")+z3D("+dirTortue3D3.getName()+")"); + + pt3DSupport.validate(); + pt3DSupport01.validate(); + pt3DSupport02.validate(); + pt3DSupport03.validate(); + dirTortueVisu3D1.validate(); + dirTortueVisu3D2.validate(); + dirTortueVisu3D3.validate(); + + p3D.add(pt3DSupport); + + t3D1.setDefaults(); + t3D1.setSuperHidden(true); + t3D1.setFixed("x3D("+pt3DSupport.getName()+")-0.4*"+longueurTortue3D.getName()+"*x3D("+dirTortueVisu3D1.getName()+")+0.4*"+longueurTortue3D.getName()+"*x3D("+dirTortueVisu3D2.getName()+")","y3D("+pt3DSupport.getName()+")-0.4*"+longueurTortue3D.getName()+"*y3D("+dirTortueVisu3D1.getName()+")+0.4*"+longueurTortue3D.getName()+"*y3D("+dirTortueVisu3D2.getName()+")","z3D("+pt3DSupport.getName()+")-0.4*"+longueurTortue3D.getName()+"*z3D("+dirTortueVisu3D1.getName()+")+0.4*"+longueurTortue3D.getName()+"*z3D("+dirTortueVisu3D2.getName()+")"); + p3D.add(t3D1); + + t3D2.setDefaults(); + t3D2.setSuperHidden(true); + t3D2.setFixed("x3D("+pt3DSupport.getName()+")+0.8*"+longueurTortue3D.getName()+"*x3D("+dirTortueVisu3D1.getName()+")","y3D("+pt3DSupport.getName()+")+0.8*"+longueurTortue3D.getName()+"*y3D("+dirTortueVisu3D1.getName()+")","z3D("+pt3DSupport.getName()+")+0.8*"+longueurTortue3D.getName()+"*z3D("+dirTortueVisu3D1.getName()+")"); + p3D.add(t3D2); + + t3D3.setDefaults(); + t3D3.setSuperHidden(true); + t3D3.setFixed("x3D("+pt3DSupport.getName()+")-0.4*"+longueurTortue3D.getName()+"*x3D("+dirTortueVisu3D1.getName()+")-0.4*"+longueurTortue3D.getName()+"*x3D("+dirTortueVisu3D2.getName()+")","y3D("+pt3DSupport.getName()+")-0.4*"+longueurTortue3D.getName()+"*y3D("+dirTortueVisu3D1.getName()+")-0.4*"+longueurTortue3D.getName()+"*y3D("+dirTortueVisu3D2.getName()+")","z3D("+pt3DSupport.getName()+")-0.4*"+longueurTortue3D.getName()+"*z3D("+dirTortueVisu3D1.getName()+")-0.4*"+longueurTortue3D.getName()+"*z3D("+dirTortueVisu3D2.getName()+")"); + p3D.add(t3D3); + + t3D1.validate(); + t3D2.validate(); + t3D3.validate(); + pp3D.validate(); + pp3D.addConditional("solid",new Expression(pp3D.getName()+"<0",getC(),pp3D)); + pp3D.addConditional("thick",new Expression(pp3D.getName()+"<0",getC(),pp3D)); + + } catch (Exception e) { + return ""; + } + return name; + } + + else { + try { + if (ptO==null) { + longueurTortue=new ExpressionObject(getC(), 0, 0); + longueurTortue.setDefaults(); + longueurTortue.setHidden(true); + longueurTortue.setName("kTortue"); + longueurTortue.setPrompt(longueurTortue.getName()); + styloBaisse = true; + p1= new Vector(); + t1=new PointObject(getC(),0,0); + t2=new PointObject(getC(),0,0); + t3=new PointObject(getC(),0,0); + t4=new PointObject(getC(),0,0); + pp1 = new AreaObject(getC(),p1); + p2= new Vector(); + t5=new PointObject(getC(),0,0); + t6=new PointObject(getC(),0,0); + pp2 = new AreaObject(getC(),p2); + + tete= new Vector(); + t7=new PointObject(getC(),0,0); + t8=new PointObject(getC(),0,0); + t9=new PointObject(getC(),0,0); + t10=new PointObject(getC(),0,0); + t11=new PointObject(getC(),0,0); + ttete = new AreaObject(getC(),tete); + if (getC().find("turtleVttete")==null) {ttete.setName("turtleVttete");} + p3= new Vector(); + t12=new PointObject(getC(),0,0); + t13=new PointObject(getC(),0,0); + t14=new PointObject(getC(),0,0); + pp3 = new AreaObject(getC(),p3); + p4= new Vector(); + t15=new PointObject(getC(),0,0); + t16=new PointObject(getC(),0,0); + t17=new PointObject(getC(),0,0); + pp4 = new AreaObject(getC(),p4); + cara= new Vector(); + t18=new PointObject(getC(),0,0); + t19=new PointObject(getC(),0,0); + t20=new PointObject(getC(),0,0); + t21=new PointObject(getC(),0,0); + t22=new PointObject(getC(),0,0); + t23=new PointObject(getC(),0,0); + t24=new PointObject(getC(),0,0); + ccara = new AreaObject(getC(),cara); + if (getC().find("turtleVccara")==null) {ccara.setName("turtleVccara");} + pp1.setDefaults(); + pp1.setFilled(true); + pp1.setSpecialColor(new Color(138,102,66)); + pp2.setDefaults(); + pp2.setFilled(true); + pp2.setSpecialColor(new Color(138,102,66)); + ttete.setDefaults(); + ttete.setFilled(true); + ttete.setSpecialColor(new Color(138,102,66)); + pp3.setDefaults(); + pp3.setFilled(true); + pp3.setSpecialColor(new Color(138,102,66)); + pp4.setDefaults(); + pp4.setFilled(true); + pp4.setSpecialColor(new Color(138,102,66)); + ccara.setDefaults(); + ccara.setFilled(true); + ccara.setSpecialColor(new Color(82,139,139)); + } + try { + longueurTortue.setExpression("60/pixel", getC()); + } catch (final ConstructionException e) { + return ""; + } + ptTortue=(PointObject) getC().find(name); + + // + ptO=new PointObject(getC(),0,0); + ptO2=new PointObject(getC(),1,0); + dirTortue= new VectorObject(getC(),ptO,ptO2); + ptSupport=new PointObject(getC(),0,0); + ptSupport2=new PointObject(getC(),0,0); + ptTortue2=new PointObject(getC(),0,0); + dirTortueVisu= new VectorObject(getC(),ptSupport,ptSupport2); + + addObject(longueurTortue); + ptO.setHidden(true); + addObject(ptO); + ptO.setFixed("0*x("+ptTortue.getName()+")","0"); // astuce... + ptO2.setSuperHidden(true); + addObject(ptO2); + ptO2.setFixed("1","0*y("+ptTortue.getName()+")"); + ptO.validate(); + ptO2.validate(); + dirTortue.validate(); + dirTortue.setDefaults(); + dirTortue.setHidden(true); + addObject(dirTortue); + ptSupport.setSuperHidden(true); + addObject(ptSupport); + ptSupport.setFixed("x("+ptTortue.getName()+")","y("+ptTortue.getName()+")"); + ptSupport2.setSuperHidden(true); + addObject(ptSupport2); + ptSupport2.setFixed("x("+ptTortue.getName()+")+x("+dirTortue.getName()+")","y("+ptTortue.getName()+")+y("+dirTortue.getName()+")"); + ptTortue2.setDefaults(); + ptTortue2.setSuperHidden(true); + addObject(ptTortue2); + ptTortue2.setFixed("x("+ptTortue.getName()+")+x("+dirTortue.getName()+")","y("+ptTortue.getName()+")+y("+dirTortue.getName()+")"); + ptTortue2.validate(); + dirTortueVisu.validate(); + dirTortueVisu.setDefaults(); + dirTortueVisu.setHidden(true); + addObject(dirTortueVisu); + t1.setDefaults(); + t1.setSuperHidden(true); + addObject(t1); + t1.setFixed("x("+ptSupport.getName()+")-0.2*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")","y("+ptSupport.getName()+")+0.2*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")"); + p1.add(t1); + t2.setDefaults(); + t2.setSuperHidden(true); + addObject(t2); + t2.setFixed("x("+ptSupport.getName()+")-0.4*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")","y("+ptSupport.getName()+")+0.4*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")"); + p1.add(t2); + t3.setDefaults(); + t3.setSuperHidden(true); + addObject(t3); + t3.setFixed("x("+ptSupport.getName()+")+0.2*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")-0.2*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")","y("+ptSupport.getName()+")+0.2*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")+0.2*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")"); + p1.add(t3); + addObject(pp1); + t4.setDefaults(); + t4.setSuperHidden(true); + addObject(t4); + t4.setFixed("x("+ptSupport.getName()+")+0.5*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")-0.3*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")","y("+ptSupport.getName()+")+0.5*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")+0.3*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")"); + p2.add(t4); + t5.setDefaults(); + t5.setSuperHidden(true); + addObject(t5); + t5.setFixed("x("+ptSupport.getName()+")+0.7*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")-0.5*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")","y("+ptSupport.getName()+")+0.7*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")+0.5*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")"); + p2.add(t5); + t6.setDefaults(); + t6.setSuperHidden(true); + addObject(t6); + t6.setFixed("x("+ptSupport.getName()+")+0.65*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")-0.2*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")","y("+ptSupport.getName()+")+0.65*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")+0.2*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")"); + p2.add(t6); + addObject(pp2); + t7.setDefaults(); + t7.setSuperHidden(true); + addObject(t7); + t7.setFixed("x("+ptSupport.getName()+")+0.75*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")-0.1*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")","y("+ptSupport.getName()+")+0.75*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")+0.1*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")"); + tete.add(t7); + t8.setDefaults(); + t8.setSuperHidden(true); + addObject(t8); + t8.setFixed("x("+ptSupport.getName()+")+0.9*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")-0.15*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")","y("+ptSupport.getName()+")+0.9*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")+0.15*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")"); + tete.add(t8); + t9.setDefaults(); + t9.setSuperHidden(true); + addObject(t9); + t9.setFixed("x("+ptSupport.getName()+")+1.05*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")","y("+ptSupport.getName()+")+1.05*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")"); + tete.add(t9); + t10.setDefaults(); + t10.setSuperHidden(true); + addObject(t10); + t10.setFixed("x("+ptSupport.getName()+")+0.9*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")+0.15*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")","y("+ptSupport.getName()+")+0.9*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")-0.15*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")"); + tete.add(t10); + t11.setDefaults(); + t11.setSuperHidden(true); + addObject(t11); + t11.setFixed("x("+ptSupport.getName()+")+0.75*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")+0.1*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")","y("+ptSupport.getName()+")+0.75*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")-0.1*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")"); + tete.add(t11); + addObject(ttete); + t12.setDefaults(); + t12.setSuperHidden(true); + addObject(t12); + t12.setFixed("x("+ptSupport.getName()+")+0.2*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")","y("+ptSupport.getName()+")-0.2*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")"); + p3.add(t12); + t13.setDefaults(); + t13.setSuperHidden(true); + addObject(t13); + t13.setFixed("x("+ptSupport.getName()+")+0.4*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")","y("+ptSupport.getName()+")-0.4*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")"); + p3.add(t13); + t14.setDefaults(); + t14.setSuperHidden(true); + addObject(t14); + t14.setFixed("x("+ptSupport.getName()+")+0.2*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")+0.2*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")","y("+ptSupport.getName()+")+0.2*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")-0.2*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")"); + p3.add(t14); + addObject(pp3); + t15.setDefaults(); + t15.setSuperHidden(true); + addObject(t15); + t15.setFixed("x("+ptSupport.getName()+")+0.5*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")+0.3*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")","y("+ptSupport.getName()+")+0.5*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")-0.3*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")"); + p4.add(t15); + t16.setDefaults(); + t16.setSuperHidden(true); + addObject(t16); + t16.setFixed("x("+ptSupport.getName()+")+0.7*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")+0.5*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")","y("+ptSupport.getName()+")+0.7*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")-0.5*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")"); + p4.add(t16); + t17.setDefaults(); + t17.setSuperHidden(true); + addObject(t17); + t17.setFixed("x("+ptSupport.getName()+")+0.65*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")+0.2*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")","y("+ptSupport.getName()+")+0.65*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")-0.2*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")"); + p4.add(t17); + addObject(pp4); + t18.setDefaults(); + t18.setSuperHidden(true); + addObject(t18); + t18.setFixed("x("+ptSupport.getName()+")","y("+ptSupport.getName()+")"); + cara.add(t18); + t19.setDefaults(); + t19.setSuperHidden(true); + addObject(t19); + t19.setFixed("x("+ptSupport.getName()+")+0.3*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")+0.35*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")","y("+ptSupport.getName()+")+0.3*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")-0.35*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")"); + cara.add(t19); + t20.setDefaults(); + t20.setSuperHidden(true); + addObject(t20); + t20.setFixed("x("+ptSupport.getName()+")+0.6*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")+0.35*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")","y("+ptSupport.getName()+")+0.6*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")-0.35*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")"); + cara.add(t20); + t21.setDefaults(); + t21.setSuperHidden(true); + addObject(t21); + t21.setFixed("x("+ptSupport.getName()+")+0.8*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")+0.05*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")","y("+ptSupport.getName()+")+0.8*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")-0.05*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")"); + cara.add(t21); + t22.setDefaults(); + t22.setSuperHidden(true); + addObject(t22); + t22.setFixed("x("+ptSupport.getName()+")+0.8*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")-0.05*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")","y("+ptSupport.getName()+")+0.8*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")+0.05*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")"); + cara.add(t22); + t23.setDefaults(); + t23.setSuperHidden(true); + addObject(t23); + t23.setFixed("x("+ptSupport.getName()+")+0.6*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")-0.35*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")","y("+ptSupport.getName()+")+0.6*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")+0.35*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")"); + cara.add(t23); + t24.setDefaults(); + t24.setSuperHidden(true); + addObject(t24); + t24.setFixed("x("+ptSupport.getName()+")+0.3*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")-0.35*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")","y("+ptSupport.getName()+")+0.3*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")+0.35*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")"); + cara.add(t24); + addObject(ccara); + + } catch (Exception e) { + return ""; + } + return name; + + } + } + } + else { + return(""); + } + } + + public static String FixTurtle(String name) { + pt3DTortue=(PointObject) getC().find(name); + if (pt3DTortue!=null) { + turtleIs3D=pt3DTortue.is3D(); + synchronized (getC()) { + if (turtleIs3D) { + try { if (pt3D0==null) { + longueurTortue3D=new ExpressionObject(getC(), 0, 0); + longueurTortue3D.setDefaults(); + longueurTortue3D.setHidden(true); + longueurTortue3D.setName("kTortue3D"); + longueurTortue3D.setPrompt(longueurTortue3D.getName()); + styloBaisse = true; + + pt3D0=new PointObject(getC(),0,0); + longueurTortue3D.setExpression("60/pixel", getC()); + pt3D1=new PointObject(getC(),0,0); + + pt3D2=new PointObject(getC(),0,0); + + pt3D3=new PointObject(getC(),0,0); + + pt3D1b=new PointObject(getC(),0,0); + + pt3D2b=new PointObject(getC(),0,0); + + pt3D3b=new PointObject(getC(),0,0); + + dirTortue3D1= new VectorObject(getC(),pt3D0,pt3D1); + dirTortue3D2= new VectorObject(getC(),pt3D0,pt3D2); + dirTortue3D3= new VectorObject(getC(),pt3D0,pt3D3); + + pt3DSupport=new PointObject(getC(),0,0); + pt3DSupport01=new PointObject(getC(),0,0); + pt3DSupport02=new PointObject(getC(),0,0); + pt3DSupport03=new PointObject(getC(),0,0); + + dirTortueVisu3D1= new VectorObject(getC(),pt3DSupport,pt3DSupport01); + dirTortueVisu3D2= new VectorObject(getC(),pt3DSupport,pt3DSupport02); + dirTortueVisu3D3= new VectorObject(getC(),pt3DSupport,pt3DSupport03); + + p3D= new Vector(); + t3D1=new PointObject(getC(),0,0); + t3D2=new PointObject(getC(),0,0); + t3D3=new PointObject(getC(),0,0);; + t3D4=new PointObject(getC(),0,0); + pp3D = new AreaObject(getC(),p3D); + pp3D.setDefaults(); + pp3D.setFilled(true); + pp3D.setSpecialColor(new Color(138,74,0)); + } + else { + pt3D1=new PointObject(getC(),0,0); + pt3D2=new PointObject(getC(),0,0); + pt3D3=new PointObject(getC(),0,0); + pt3D1b=new PointObject(getC(),0,0); + pt3D2b=new PointObject(getC(),0,0); + pt3D3b=new PointObject(getC(),0,0); + } + addObject(longueurTortue3D); + addObject(pt3D0); + addObject(pt3D1); + addObject(pt3D2); + addObject(pt3D3); + addObject(pt3D1b); + addObject(pt3D2b); + addObject(pt3D3b); + addObject(dirTortue3D1); + addObject(dirTortue3D2); + addObject(dirTortue3D3); + addObject(pt3DSupport); + addObject(pt3DSupport01); + addObject(pt3DSupport02); + addObject(pt3DSupport03); + addObject(dirTortueVisu3D1); + addObject(dirTortueVisu3D2); + addObject(dirTortueVisu3D3); + addObject(t3D1); + addObject(t3D2); + addObject(t3D3); + addObject(pp3D); + pt3D0.setIs3D(true); + pt3D1.setIs3D(true); + pt3D2.setIs3D(true); + pt3D3.setIs3D(true); + pt3D0.setFixed("0","0","0"); + pt3D0.validate(); + pt3D1.setFixed("1","0","0"); + pt3D1.validate(); + pt3D2.setFixed("0","1","0"); + pt3D3.validate(); + pt3D3.setFixed("0","0","1"); + pt3D0.setHidden(true); + pt3D1.setSuperHidden(true); + pt3D2.setSuperHidden(true); + pt3D3.setSuperHidden(true); + pt3D1b.setSuperHidden(true); + pt3D2b.setSuperHidden(true); + pt3D3b.setSuperHidden(true); + + pt3D1b.setIs3D(true); + pt3D2b.setIs3D(true); + pt3D3b.setIs3D(true); + pt3D1b.setFixed("1","0","0"); + pt3D2b.setFixed("0","1","0"); + pt3D3b.setFixed("0","0","1"); + + pt3DSupport.setIs3D(true); + pt3DSupport01.setIs3D(true); + pt3DSupport02.setIs3D(true); + pt3DSupport03.setIs3D(true); + + t3D1.setIs3D(true); + t3D2.setIs3D(true); + t3D3.setIs3D(true); + t3D4.setIs3D(true); + + dirTortue3D1.setDefaults(); + dirTortue3D1.setHidden(true); + + dirTortue3D2.setDefaults(); + dirTortue3D2.setHidden(true); + + dirTortue3D3.setDefaults(); + dirTortue3D3.setHidden(true); + + dirTortueVisu3D1.setDefaults(); + dirTortueVisu3D1.setHidden(true); + + dirTortueVisu3D2.setDefaults(); + dirTortueVisu3D2.setHidden(true); + + dirTortueVisu3D3.setDefaults(); + dirTortueVisu3D3.setHidden(true); + + pt3DTortue=(PointObject) getC().find(name); + + pt3DSupport.setSuperHidden(true); + pt3DSupport.setFixed("x3D("+pt3DTortue.getName()+")","y3D("+pt3DTortue.getName()+")","z3D("+pt3DTortue.getName()+")"); + + pt3DSupport01.setSuperHidden(true); + pt3DSupport01.setFixed("x3D("+pt3DTortue.getName()+")+x3D("+dirTortue3D1.getName()+")","y3D("+pt3DTortue.getName()+")+y3D("+dirTortue3D1.getName()+")","z3D("+pt3DTortue.getName()+")+z3D("+dirTortue3D1.getName()+")"); + + pt3DSupport02.setSuperHidden(true); + pt3DSupport02.setFixed("x3D("+pt3DTortue.getName()+")+x3D("+dirTortue3D2.getName()+")","y3D("+pt3DTortue.getName()+")+y3D("+dirTortue3D2.getName()+")","z3D("+pt3DTortue.getName()+")+z3D("+dirTortue3D2.getName()+")"); + + pt3DSupport03.setSuperHidden(true); + pt3DSupport03.setFixed("x3D("+pt3DTortue.getName()+")+x3D("+dirTortue3D3.getName()+")","y3D("+pt3DTortue.getName()+")+y3D("+dirTortue3D3.getName()+")","z3D("+pt3DTortue.getName()+")+z3D("+dirTortue3D3.getName()+")"); + + pt3DSupport.validate(); + pt3DSupport01.validate(); + pt3DSupport02.validate(); + pt3DSupport03.validate(); + dirTortueVisu3D1.validate(); + dirTortueVisu3D2.validate(); + dirTortueVisu3D3.validate(); + + p3D.add(pt3DSupport); + + t3D1.setDefaults(); + t3D1.setSuperHidden(true); + t3D1.setFixed("x3D("+pt3DSupport.getName()+")-0.4*"+longueurTortue3D.getName()+"*x3D("+dirTortueVisu3D1.getName()+")+0.4*"+longueurTortue3D.getName()+"*x3D("+dirTortueVisu3D2.getName()+")","y3D("+pt3DSupport.getName()+")-0.4*"+longueurTortue3D.getName()+"*y3D("+dirTortueVisu3D1.getName()+")+0.4*"+longueurTortue3D.getName()+"*y3D("+dirTortueVisu3D2.getName()+")","z3D("+pt3DSupport.getName()+")-0.4*"+longueurTortue3D.getName()+"*z3D("+dirTortueVisu3D1.getName()+")+0.4*"+longueurTortue3D.getName()+"*z3D("+dirTortueVisu3D2.getName()+")"); + p3D.add(t3D1); + + t3D2.setDefaults(); + t3D2.setSuperHidden(true); + t3D2.setFixed("x3D("+pt3DSupport.getName()+")+0.8*"+longueurTortue3D.getName()+"*x3D("+dirTortueVisu3D1.getName()+")","y3D("+pt3DSupport.getName()+")+0.8*"+longueurTortue3D.getName()+"*y3D("+dirTortueVisu3D1.getName()+")","z3D("+pt3DSupport.getName()+")+0.8*"+longueurTortue3D.getName()+"*z3D("+dirTortueVisu3D1.getName()+")"); + p3D.add(t3D2); + + t3D3.setDefaults(); + t3D3.setSuperHidden(true); + t3D3.setFixed("x3D("+pt3DSupport.getName()+")-0.4*"+longueurTortue3D.getName()+"*x3D("+dirTortueVisu3D1.getName()+")-0.4*"+longueurTortue3D.getName()+"*x3D("+dirTortueVisu3D2.getName()+")","y3D("+pt3DSupport.getName()+")-0.4*"+longueurTortue3D.getName()+"*y3D("+dirTortueVisu3D1.getName()+")-0.4*"+longueurTortue3D.getName()+"*y3D("+dirTortueVisu3D2.getName()+")","z3D("+pt3DSupport.getName()+")-0.4*"+longueurTortue3D.getName()+"*z3D("+dirTortueVisu3D1.getName()+")-0.4*"+longueurTortue3D.getName()+"*z3D("+dirTortueVisu3D2.getName()+")"); + p3D.add(t3D3); + + t3D1.validate(); + t3D2.validate(); + t3D3.validate(); + pp3D.validate(); + pp3D.addConditional("solid",new Expression(pp3D.getName()+"<0",getC(),pp3D)); + pp3D.addConditional("thick",new Expression(pp3D.getName()+"<0",getC(),pp3D)); + + } catch (Exception e) { + return ""; + } + return name; + } + + else { + try { + if (ptO==null) { + longueurTortue=new ExpressionObject(getC(), 0, 0); + longueurTortue.setDefaults(); + longueurTortue.setHidden(true); + longueurTortue.setName("kTortue"); + longueurTortue.setPrompt(longueurTortue.getName()); + styloBaisse = true; + p1= new Vector(); + t1=new PointObject(getC(),0,0); + t2=new PointObject(getC(),0,0); + t3=new PointObject(getC(),0,0); + t4=new PointObject(getC(),0,0); + pp1 = new AreaObject(getC(),p1); + p2= new Vector(); + t5=new PointObject(getC(),0,0); + t6=new PointObject(getC(),0,0); + pp2 = new AreaObject(getC(),p2); + + tete= new Vector(); + t7=new PointObject(getC(),0,0); + t8=new PointObject(getC(),0,0); + t9=new PointObject(getC(),0,0); + t10=new PointObject(getC(),0,0); + t11=new PointObject(getC(),0,0); + ttete = new AreaObject(getC(),tete); + if (getC().find("turtleVttete")==null) {ttete.setName("turtleVttete");} + p3= new Vector(); + t12=new PointObject(getC(),0,0); + t13=new PointObject(getC(),0,0); + t14=new PointObject(getC(),0,0); + pp3 = new AreaObject(getC(),p3); + p4= new Vector(); + t15=new PointObject(getC(),0,0); + t16=new PointObject(getC(),0,0); + t17=new PointObject(getC(),0,0); + pp4 = new AreaObject(getC(),p4); + cara= new Vector(); + t18=new PointObject(getC(),0,0); + t19=new PointObject(getC(),0,0); + t20=new PointObject(getC(),0,0); + t21=new PointObject(getC(),0,0); + t22=new PointObject(getC(),0,0); + t23=new PointObject(getC(),0,0); + t24=new PointObject(getC(),0,0); + ccara = new AreaObject(getC(),cara); + if (getC().find("turtleVccara")==null) {ccara.setName("turtleVccara");} + pp1.setDefaults(); + pp1.setFilled(true); + pp1.setSpecialColor(new Color(138,102,66)); + pp2.setDefaults(); + pp2.setFilled(true); + pp2.setSpecialColor(new Color(138,102,66)); + ttete.setDefaults(); + ttete.setFilled(true); + ttete.setSpecialColor(new Color(138,102,66)); + pp3.setDefaults(); + pp3.setFilled(true); + pp3.setSpecialColor(new Color(138,102,66)); + pp4.setDefaults(); + pp4.setFilled(true); + pp4.setSpecialColor(new Color(138,102,66)); + ccara.setDefaults(); + ccara.setFilled(true); + ccara.setSpecialColor(new Color(82,139,139)); + } + try { + longueurTortue.setExpression("60/pixel", getC()); + } catch (final ConstructionException e) { + return ""; + } + ptTortue=(PointObject) getC().find(name); + + // + ptO=new PointObject(getC(),0,0); + ptO2=new PointObject(getC(),1,0); + dirTortue= new VectorObject(getC(),ptO,ptO2); + ptSupport=new PointObject(getC(),0,0); + ptSupport2=new PointObject(getC(),0,0); + ptTortue2=new PointObject(getC(),0,0); + dirTortueVisu= new VectorObject(getC(),ptSupport,ptSupport2); + + addObject(longueurTortue); + ptO.setHidden(true); + addObject(ptO); + ptO.setFixed("0*x("+ptTortue.getName()+")","0"); // astuce... + ptO2.setSuperHidden(true); + addObject(ptO2); + ptO2.setFixed("1","0*y("+ptTortue.getName()+")"); + ptO.validate(); + ptO2.validate(); + dirTortue.validate(); + dirTortue.setDefaults(); + dirTortue.setHidden(true); + addObject(dirTortue); + ptSupport.setSuperHidden(true); + addObject(ptSupport); + ptSupport.setFixed("x("+ptTortue.getName()+")","y("+ptTortue.getName()+")"); + ptSupport2.setSuperHidden(true); + addObject(ptSupport2); + ptSupport2.setFixed("x("+ptTortue.getName()+")+x("+dirTortue.getName()+")","y("+ptTortue.getName()+")+y("+dirTortue.getName()+")"); + ptTortue2.setDefaults(); + ptTortue2.setSuperHidden(true); + addObject(ptTortue2); + ptTortue2.setFixed("x("+ptTortue.getName()+")+x("+dirTortue.getName()+")","y("+ptTortue.getName()+")+y("+dirTortue.getName()+")"); + ptTortue2.validate(); + dirTortueVisu.validate(); + dirTortueVisu.setDefaults(); + dirTortueVisu.setHidden(true); + addObject(dirTortueVisu); + t1.setDefaults(); + t1.setSuperHidden(true); + addObject(t1); + t1.setFixed("x("+ptSupport.getName()+")-0.2*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")","y("+ptSupport.getName()+")+0.2*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")"); + p1.add(t1); + t2.setDefaults(); + t2.setSuperHidden(true); + addObject(t2); + t2.setFixed("x("+ptSupport.getName()+")-0.4*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")","y("+ptSupport.getName()+")+0.4*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")"); + p1.add(t2); + t3.setDefaults(); + t3.setSuperHidden(true); + addObject(t3); + t3.setFixed("x("+ptSupport.getName()+")+0.2*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")-0.2*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")","y("+ptSupport.getName()+")+0.2*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")+0.2*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")"); + p1.add(t3); + addObject(pp1); + t4.setDefaults(); + t4.setSuperHidden(true); + addObject(t4); + t4.setFixed("x("+ptSupport.getName()+")+0.5*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")-0.3*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")","y("+ptSupport.getName()+")+0.5*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")+0.3*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")"); + p2.add(t4); + t5.setDefaults(); + t5.setSuperHidden(true); + addObject(t5); + t5.setFixed("x("+ptSupport.getName()+")+0.7*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")-0.5*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")","y("+ptSupport.getName()+")+0.7*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")+0.5*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")"); + p2.add(t5); + t6.setDefaults(); + t6.setSuperHidden(true); + addObject(t6); + t6.setFixed("x("+ptSupport.getName()+")+0.65*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")-0.2*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")","y("+ptSupport.getName()+")+0.65*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")+0.2*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")"); + p2.add(t6); + addObject(pp2); + t7.setDefaults(); + t7.setSuperHidden(true); + addObject(t7); + t7.setFixed("x("+ptSupport.getName()+")+0.75*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")-0.1*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")","y("+ptSupport.getName()+")+0.75*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")+0.1*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")"); + tete.add(t7); + t8.setDefaults(); + t8.setSuperHidden(true); + addObject(t8); + t8.setFixed("x("+ptSupport.getName()+")+0.9*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")-0.15*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")","y("+ptSupport.getName()+")+0.9*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")+0.15*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")"); + tete.add(t8); + t9.setDefaults(); + t9.setSuperHidden(true); + addObject(t9); + t9.setFixed("x("+ptSupport.getName()+")+1.05*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")","y("+ptSupport.getName()+")+1.05*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")"); + tete.add(t9); + t10.setDefaults(); + t10.setSuperHidden(true); + addObject(t10); + t10.setFixed("x("+ptSupport.getName()+")+0.9*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")+0.15*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")","y("+ptSupport.getName()+")+0.9*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")-0.15*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")"); + tete.add(t10); + t11.setDefaults(); + t11.setSuperHidden(true); + addObject(t11); + t11.setFixed("x("+ptSupport.getName()+")+0.75*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")+0.1*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")","y("+ptSupport.getName()+")+0.75*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")-0.1*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")"); + tete.add(t11); + addObject(ttete); + t12.setDefaults(); + t12.setSuperHidden(true); + addObject(t12); + t12.setFixed("x("+ptSupport.getName()+")+0.2*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")","y("+ptSupport.getName()+")-0.2*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")"); + p3.add(t12); + t13.setDefaults(); + t13.setSuperHidden(true); + addObject(t13); + t13.setFixed("x("+ptSupport.getName()+")+0.4*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")","y("+ptSupport.getName()+")-0.4*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")"); + p3.add(t13); + t14.setDefaults(); + t14.setSuperHidden(true); + addObject(t14); + t14.setFixed("x("+ptSupport.getName()+")+0.2*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")+0.2*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")","y("+ptSupport.getName()+")+0.2*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")-0.2*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")"); + p3.add(t14); + addObject(pp3); + t15.setDefaults(); + t15.setSuperHidden(true); + addObject(t15); + t15.setFixed("x("+ptSupport.getName()+")+0.5*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")+0.3*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")","y("+ptSupport.getName()+")+0.5*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")-0.3*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")"); + p4.add(t15); + t16.setDefaults(); + t16.setSuperHidden(true); + addObject(t16); + t16.setFixed("x("+ptSupport.getName()+")+0.7*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")+0.5*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")","y("+ptSupport.getName()+")+0.7*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")-0.5*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")"); + p4.add(t16); + t17.setDefaults(); + t17.setSuperHidden(true); + addObject(t17); + t17.setFixed("x("+ptSupport.getName()+")+0.65*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")+0.2*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")","y("+ptSupport.getName()+")+0.65*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")-0.2*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")"); + p4.add(t17); + addObject(pp4); + t18.setDefaults(); + t18.setSuperHidden(true); + addObject(t18); + t18.setFixed("x("+ptSupport.getName()+")","y("+ptSupport.getName()+")"); + cara.add(t18); + t19.setDefaults(); + t19.setSuperHidden(true); + addObject(t19); + t19.setFixed("x("+ptSupport.getName()+")+0.3*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")+0.35*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")","y("+ptSupport.getName()+")+0.3*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")-0.35*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")"); + cara.add(t19); + t20.setDefaults(); + t20.setSuperHidden(true); + addObject(t20); + t20.setFixed("x("+ptSupport.getName()+")+0.6*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")+0.35*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")","y("+ptSupport.getName()+")+0.6*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")-0.35*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")"); + cara.add(t20); + t21.setDefaults(); + t21.setSuperHidden(true); + addObject(t21); + t21.setFixed("x("+ptSupport.getName()+")+0.8*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")+0.05*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")","y("+ptSupport.getName()+")+0.8*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")-0.05*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")"); + cara.add(t21); + t22.setDefaults(); + t22.setSuperHidden(true); + addObject(t22); + t22.setFixed("x("+ptSupport.getName()+")+0.8*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")-0.05*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")","y("+ptSupport.getName()+")+0.8*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")+0.05*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")"); + cara.add(t22); + t23.setDefaults(); + t23.setSuperHidden(true); + addObject(t23); + t23.setFixed("x("+ptSupport.getName()+")+0.6*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")-0.35*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")","y("+ptSupport.getName()+")+0.6*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")+0.35*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")"); + cara.add(t23); + t24.setDefaults(); + t24.setSuperHidden(true); + addObject(t24); + t24.setFixed("x("+ptSupport.getName()+")+0.3*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")-0.35*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")","y("+ptSupport.getName()+")+0.3*"+longueurTortue.getName()+"*y("+dirTortueVisu.getName()+")+0.35*"+longueurTortue.getName()+"*x("+dirTortueVisu.getName()+")"); + cara.add(t24); + addObject(ccara); + + } catch (Exception e) { + return ""; + } + return name; + + } + } + } + else { + return(""); + } + } + + public static boolean BaisserStylo() { + styloBaisse = true; + return true; + } + + public static boolean TurtleDown() { + styloBaisse = true; + return true; + } + + public static boolean LeverStylo() { + styloBaisse = false; + return false; + } + + public static boolean TurtleUp() { + styloBaisse = false; + return false; + } + + public static String[] Avancer(String ptName, String segtName, String di) throws Exception { + PointObject pt=null; + SegmentObject so=null; + String[] ptSegmt=new String[2]; + synchronized (getC()) { + if (segtName.equals("undefined")) { + di=ptName; + segtName=""; + ptName=""; + } else if (di.equals("undefined")) { + di=segtName; + segtName=""; + } + if (turtleIs3D) { + try { + pt=new PointObject(getC(), 0, 0); + pt.setIs3D(true); + pt.setFixed("x3D("+pt3DTortue.getName()+")","y3D("+pt3DTortue.getName()+")","z3D("+pt3DTortue.getName()+")"); + pt.validCoordinates(); + pt.setDefaults(); + pt.setShowValue(false); + pt.setShowName(false); + pt.setType(3); + if (!ptName.equals("")) { + pt.setName(parseVariables(ptName)); + } + addObject(pt); + pt3DSupport.setFixed("x3D("+pt.getName()+")","y3D("+pt.getName()+")","z3D("+pt.getName()+")"); + pt3DSupport.validCoordinates(); + pt3DSupport01.setFixed("x3D("+pt3DSupport.getName()+")+x3D("+dirTortue3D1.getName()+")","y3D("+pt3DSupport.getName()+")+y3D("+dirTortue3D1.getName()+")","z3D("+pt3DSupport.getName()+")+z3D("+dirTortue3D1.getName()+")"); + pt3DSupport01.validCoordinates(); + pt3DSupport02.setFixed("x3D("+pt3DSupport.getName()+")+x3D("+dirTortue3D2.getName()+")","y3D("+pt3DSupport.getName()+")+y3D("+dirTortue3D2.getName()+")","z3D("+pt3DSupport.getName()+")+z3D("+dirTortue3D2.getName()+")"); + pt3DSupport02.validCoordinates(); + pt3DSupport03.setFixed("x3D("+pt3DSupport.getName()+")+x3D("+dirTortue3D3.getName()+")","y3D("+pt3DSupport.getName()+")+y3D("+dirTortue3D3.getName()+")","z3D("+pt3DSupport.getName()+")+z3D("+dirTortue3D3.getName()+")"); + pt3DSupport03.validCoordinates(); + if (styloBaisse) { + so=new SegmentObject(getC(),pt3DTortue,pt); + so.validate(); + so.setDefaults(); + if (!segtName.equals("")) { + so.setName(parseVariables(segtName)); + } + addObject(so); + } + else { + pt.setHidden(true); + } + for (int l=1;l100) { + theSpeed=100; + } + } + nbSteps= Math.floor(99/theSpeed)+1; + } + } + + + public static void TurtleSpeed(String vitesse){ + synchronized (getC()) { + double theSpeed = Double.parseDouble(vitesse); + if (theSpeed<0.01) { + theSpeed=0.01; + } else { + if (theSpeed>100) { + theSpeed=100; + } + } + nbSteps= Math.floor(99/theSpeed)+1; + } + } + + private static void setJSO(ConstructionObject o) { + ScriptThread th=(ScriptThread) Thread.currentThread(); + th.setJSO(o); + } + + private static ConstructionObject getJSO() { + ScriptThread th=(ScriptThread) Thread.currentThread(); + return th.getJSO(); + } + + private static boolean isValidII() { + ScriptThread th=(ScriptThread) Thread.currentThread(); + return th.isValidII(); + } + + private static void paint() { + ScriptThread th=(ScriptThread) Thread.currentThread(); + th.getZC().repaint(); + } + + private static void addObject(ConstructionObject o) { + ScriptThread th=(ScriptThread) Thread.currentThread(); + th.getC().add(o); + th.getZC().update_distant(o, 1); + } + + public static void refreshZC() { + ScriptThread th=(ScriptThread) Thread.currentThread(); + th.getZC().dovalidate(); + th.getZC().repaint(); + } + + public static void rafraichirZC() { + ScriptThread th=(ScriptThread) Thread.currentThread(); + th.getZC().dovalidate(); + th.getZC().repaint(); + } + + public static Construction getC() { + ScriptThread th=(ScriptThread) Thread.currentThread(); + return th.getC(); + } + + public static ZirkelCanvas getZC() { + ScriptThread th=(ScriptThread) Thread.currentThread(); + return th.getZC(); + } + + public static String getRealScript() { + ScriptThread th=(ScriptThread) Thread.currentThread(); + return th.getSCRIPT(); + } + + public static String getZZ() { + ScriptThread th=(ScriptThread) Thread.currentThread(); + String bibop=th.getSCRIPT(); + bibop=bibop.replace("=","⟵"); + bibop=bibop.replace("⟵⟵","="); + bibop=bibop.replace("!⟵","≠"); + bibop=bibop.replace("<⟵","≤"); + bibop=bibop.replace(">⟵","≥"); + bibop=bibop.replace("Afficherligne","Afficher"); + return bibop; + } + + public static String prendreZZ() { + ScriptThread th=(ScriptThread) Thread.currentThread(); + String bibop=th.getSCRIPTi(); + bibop=bibop.replace("=","⟵"); + bibop=bibop.replace("⟵⟵","="); + bibop=bibop.replace("!⟵","≠"); + bibop=bibop.replace("<⟵","≤"); + bibop=bibop.replace(">⟵","≥"); + bibop=bibop.replace("Println","Afficher"); + bibop=bibop.replace("Print","Afficher"); + return bibop; + } + + + private static ScriptThread getTHREAD() { + ScriptThread th=(ScriptThread) Thread.currentThread(); + return th; + } + + private static ScriptableObject getSCOPE() { + ScriptThread th=(ScriptThread) Thread.currentThread(); + return th.getSCOPE(); + } + + public static JSOuputConsole getCONSOLE() { + ScriptThread th=(ScriptThread) Thread.currentThread(); + return th.getCONSOLE(); + } + + public static JSOuputConsole prendreCONSOLE() { + ScriptThread th=(ScriptThread) Thread.currentThread(); + return th.getCONSOLE(); + } + + public static boolean SetIconSelection(String iconname, boolean sel) { + return PaletteManager.setSelected_with_clic2(iconname, sel); + } + + public static boolean ClicVirtuel(String iconname, boolean sel) { + return PaletteManager.setSelected_with_clic2(iconname, sel); + } + + public static boolean IsIconSelected(String iconname) { + return PaletteManager.isSelected(iconname); + } + + /** + * Read a file an return is content as a string.
+ *
+ * This function will be useful in javascript context.
+ * One will be able, for instance, to write inside a CaRScript :
+ * eval(Load("mytools.js"));
+ * This will behave as if the file "mytools.js" had been imported.
+ * The objects of "mytools.js" will be accessible within the CaRScript.
+ * + * Load is more versatile than just an import function.
+ * Indeed, you have the opportunity to make some text processing + * after loading and before evaluating :
+ *MyTools = Load("mytools.js");
+ *MyTools = doSomeModificationsTo(MyTools); // apply some regexps or whatever
+ *eval(Mytools);
+ * + * @param fic + * @return The read text + */ + public static String Load(String fic) { + String FS=System.getProperty("file.separator"); + String myfic=Global.getHomeDirectory()+"scripts"+FS+fic.replace("/", FS); + if (!new File(myfic).exists()) { + myfic=FileName.path(JZirkelCanvas.getFileName())+FS+fic.replace("/", FS); + } + String r; + String s=""; + boolean firstLine=true; + try { + java.io.BufferedReader f=new java.io.BufferedReader(new java.io.FileReader(myfic)); + try { + while ((r=f.readLine())!=null) { + s=(firstLine==true)?r:s+System.getProperty("line.separator")+r; + firstLine=false; + } + f.close(); + return s; + } catch (java.io.IOException e) { + return s; + } + } catch (java.io.FileNotFoundException e) { + return ""; + } + + } + + private static String parseVariables(String s) { + String origin; + String endtxt=s.replaceAll("([0-9]+)e([0-9]+)", "$1E$2"); + do { + origin=endtxt; + StringBuffer sb1=new StringBuffer(); + Pattern pxy=Pattern.compile("(x|y)_(\\w*)", Pattern.CASE_INSENSITIVE); + Matcher m=pxy.matcher(origin); + while (m.find()) { + Object x=getSCOPE().get(m.group(2), getSCOPE()); + if (x!=Scriptable.NOT_FOUND) { + m.appendReplacement(sb1, m.group(1)+"("+Context.toString(x)+")"); + } + } + m.appendTail(sb1); + m.reset(); + StringBuffer sb2=new StringBuffer(); + Pattern pexp=Pattern.compile("_(\\w*)", Pattern.CASE_INSENSITIVE); + m=pexp.matcher(sb1.toString()); + while (m.find()) { + Object x=getSCOPE().get(m.group(1), getSCOPE()); + if (x!=Scriptable.NOT_FOUND) { + m.appendReplacement(sb2, Context.toString(x)); + } + } + m.appendTail(sb2); + m.reset(); + endtxt=sb2.toString(); + } while (!(origin.equals(endtxt))); + return endtxt; + } + + static public String Loc(final String s) { + return Global.Loc("JSerror."+s); + } + + static public String LastNObjectsName(int N){ + if(N==0){ + return ""; + } + String names; + if(getC().lastButN(0)!=null){ + names = getC().lastButN(0).getName(); + } else { + names = ""; + } + + for(int i=1; iNote : It's possible to change this property in one step for + * multiple object. + *
Example : SetColor("A,B,c1,E1","cyan") will give the "cyan" color + * to the objects A, B, c1 and E1 + * @param name Name of the object you want to change color + * @param col Name of the color. It can be "green", "blue", "brown", "cyan", "red" or "black". + */ + static public void SetColor(String name, String col) { + String[] names=parseVariables(name).split(","); + for(String name1 : names) { + c("color("+col+"," + name1 + ")"); + } + } + + static public void MettreCouleur(String name, String col) { + String[] names=parseVariables(name).split(","); + for(String name1 : names) { + c("color("+col+"," + name1 + ")"); + } + } + + /** + *Set the shape of a point. It has no effect if the object is not a point. + *
Note : It's possible to change this property in one step for + * multiple points. + *
Example : SetPointType("A,B,E,F","square") will give the "square" shape + * to the points A, B, E and F + * @param name Name of the point you want to change shape + * @param type Name of the shape. It can be "square", "circle", "diamond", "point", "cross", "dcross". + */ + static public void SetPointType(String name, String type) { + String[] names=parseVariables(name).split(","); + for(String name1 : names) { + c("type("+type+"," + name1 + ")"); + } + } + + static public void MettreTypePoint(String name, String type) { + String[] names=parseVariables(name).split(","); + for(String name1 : names) { + c("type("+type+"," + name1 + ")"); + } + } + + /** + * Set the RGB color of an object using 3 integer numbers in [0..255]. + *
Note : It's possible to change this property in one step for + * multiple object. + *
Example : SetColor("A,B,c1",120,40,245) will give the same color + * to the objects A, B and c1. This color is defined by r=120, g=40 and b=245. + * @param name Name of the object you want to change color + * @param r Red value (integer in [0..255] + * @param g Green value (integer in [0..255] + * @param b Blue value (integer in [0..255] + */ + static public void SetRGBColor(String name, String r, String g, String b) { + // Color mycolor=new Color(r, g, b); + String[] names=parseVariables(name).split(","); + for (String name1 : names) { + ConstructionObject o = getC().find(name1); + if (o!=null) { + // o.setSpecialColor(mycolor); + o.setSpecialColor(r,g,b); + } + } +// getZC().repaint(); +// validate(); +// paint() + + } + + static public void MettreCouleurRVB(String name, String r, String g, String b) { + // Color mycolor=new Color(r, g, b); + String[] names=parseVariables(name).split(","); + for (String name1 : names) { + ConstructionObject o = getC().find(name1); + if (o!=null) { + // o.setSpecialColor(mycolor); + o.setSpecialColor(r,g,b); + } + } +// getZC().repaint(); +// validate(); +// paint() + + } + + /** + * Set the thickness of an object. + *
Note : It's possible to change this property in one step for + * multiple objects. + *
Example : SetThickness("A,B,c1,l1","thick") will give the "thick" aspect + * to the objects A, B, c1 and l1 + * @param name Name of the point you want to change shape + * @param thc Name of the thickness. It can be "thick", "normal" and "thin". + */ + static public void SetThickness(String name, String thc) { + String[] names=parseVariables(name).split(","); + for (String name1 : names) { + c("thickness("+thc+"," + name1 + ")"); + } + } + + static public void MettreEpaisseur(String name, String thc) { + String[] names=parseVariables(name).split(","); + for (String name1 : names) { + c("thickness("+thc+"," + name1 + ")"); + } + } + + /** + * Set the alias name of an object. + *
Note : It's possible to change this property in one step for + * multiple objects. + *
Example : SetAlias("A,B,c1,l1","My beautiful object") + * will give the "My beautiful object" alias name to the objects A, B, c1 and l1 + * @param name Name of the point you want to change alias name. + * @param alias Alias name. + */ + static public void SetAlias(String name, String alias) { + String[] names=parseVariables(name).split(","); + for (String name1 : names) { + ConstructionObject o = getC().find(name1); + if (o!=null) { + o.setAlias(parseVariables(alias)); + } + } + } + + static public void MettreAlias(String name, String alias) { + String[] names=parseVariables(name).split(","); + for (String name1 : names) { + ConstructionObject o = getC().find(name1); + if (o!=null) { + o.setAlias(parseVariables(alias)); + } + } + } + + /** + * Set the increment of a point object. + *
Note : It's possible to change this property in one step for + * multiple points. + *
Example : SetIncrement("A,B,C",0.1) + * will set the increment of A, B, and C + * @param name Name of the point you want to set the increment. + * @param delta + */ + static public void SetIncrement(String name, double delta) { + String[] names=parseVariables(name).split(","); + for(String name1 : names) { + ConstructionObject o = getC().find(name1); + if (o instanceof PointObject) { + o.setIncrement(delta); + } + } + } + + static public void MettreIncrément(String name, double delta) { + String[] names=parseVariables(name).split(","); + for(String name1 : names) { + ConstructionObject o = getC().find(name1); + if (o instanceof PointObject) { + o.setIncrement(delta); + } + } + } + + /** + * Set the standard magnetic attraction lenght of a point + * @param name Name of a point + * @param ray Attraction lenght, in pixels (number or expression) + * @see #SetMagneticObjects + * @see #AddMagneticObject + */ + static public void SetMagneticRay(String name, String ray) { + ConstructionObject o=getC().find(name); + if ((o==null)||(!(o instanceof PointObject))) { + return; + } + PointObject pt=(PointObject) o; + pt.setMagnetRayExp(parseVariables(ray)); + refreshZC(); + } + + static public void MettreRayonMagnétique(String name, String ray) { + ConstructionObject o=getC().find(name); + if ((o==null)||(!(o instanceof PointObject))) { + return; + } + PointObject pt=(PointObject) o; + pt.setMagnetRayExp(parseVariables(ray)); + refreshZC(); + } + + /** + * Set the objects that will magnetize a given point + *
Example : SetMagneticObjects("P","c1,d1,A") will + * make the point P attracted by the objects c1, d1 and A. + *
It's possible to define exceptions using the ":" separator. + * If, for instance, objectlist contains "A,E,c1:20,l1" and the attraction + * field is defined by 50 pixels, objects "A", "E" and "l1" have an attraction + * radius of 50 pixels, but the object c1 will have an attraction radius of 20 pixels. + * @param name Name of a point + * @param objectlist List of objects + * @see #AddMagneticObject + * @see #SetMagneticRay + */ + static public void SetMagneticObjects(String name, String objectlist) { + ConstructionObject o=getC().find(name); + if ((o==null)||(!(o instanceof PointObject))) { + return; + } + PointObject pt=(PointObject) o; + pt.setMagnetObjects(parseVariables(objectlist)); + } + + static public void MettreObjetsMagnétiques(String name, String objectlist) { + ConstructionObject o=getC().find(name); + if ((o==null)||(!(o instanceof PointObject))) { + return; + } + PointObject pt=(PointObject) o; + pt.setMagnetObjects(parseVariables(objectlist)); + } + + /** + * Add an object to the list of magnetic objects of a given point. + * @param name Name of the point + * @param object Object to add to the magnetic point list + * @see #SetMagneticObjects + * @see #SetMagneticRay + */ + static public void AddMagneticObject(String name, String object) { + ConstructionObject o=getC().find(name); + if ((o==null)||(!(o instanceof PointObject))) { + return; + } + PointObject pt=(PointObject) o; + pt.addMagnetObject(parseVariables(object)); + } + + static public void AjouterObjetMagnétique(String name, String object) { + ConstructionObject o=getC().find(name); + if ((o==null)||(!(o instanceof PointObject))) { + return; + } + PointObject pt=(PointObject) o; + pt.addMagnetObject(parseVariables(object)); + } + + /** + * Fix or unfix an object in the CaRMetal current window. A fixed object + * can't be moved with the mouse. + *
Note : It's possible to change this property in one step for + * multiple objects. + *
Example : SetFixed("A,B,c1,l1",true) + * will fix the objects A, B, c1 and l1 in the CaRMetal current window. + * @param name Name of the object + * @param bool "true" value to fix the object, "false" to unfix it. + */ + static public void SetFixed(String name, boolean bool) { + String[] names=parseVariables(name).split(","); + for(String name1 : names) { + ConstructionObject o = getC().find(name1); + if (o!=null) { + o.setFixed(bool); + } + } + } + + static public void MettreFixe(String name, boolean bool) { + String[] names=parseVariables(name).split(","); + for(String name1 : names) { + ConstructionObject o = getC().find(name1); + if (o!=null) { + o.setFixed(bool); + } + } + } + + static public void Liberate(String name) { + String[] names=parseVariables(name).split(","); + for(String name1 : names) { + ConstructionObject o = getC().find(name1); + if (o!=null) { + o.setFixed(false); + } + } + } + + static public void Libérer(String name) { + String[] names=parseVariables(name).split(","); + for(String name1 : names) { + ConstructionObject o = getC().find(name1); + if (o!=null) { + o.setFixed(false); + } + } + } + + /** + * Shows or hide the name of an object (or multiple objects). + *
Example : SetShowName("A,B,c1,l1",true) + * will shows the names of objects A, B, c1 and l1. + * @param name Name(s) of object. + * @param bool "true" to show name, and "false" to hide it. + */ + static public void SetShowName(String name, boolean bool) { + String[] names=parseVariables(name).split(","); + for(String name1 : names) { + ConstructionObject o = getC().find(name1); + if (o!=null) { + o.setShowName(bool); + } + } + } + + static public void MettreMontrerNom(String name, boolean bool) { + String[] names=parseVariables(name).split(","); + for(String name1 : names) { + ConstructionObject o = getC().find(name1); + if (o!=null) { + o.setShowName(bool); + } + } + } + + /** + * Shows or hide the value of an object (or multiple objects). + *
Example : SetShowValue("A,B,c1,l1",true) + * will shows the value of objects A, B, c1 and l1. + * @param name Name(s) of object. + * @param bool "true" to show value, and "false" to hide it. + */ + static public void SetShowValue(String name, boolean bool) { + String[] names=parseVariables(name).split(","); + for (String name1 : names) { + ConstructionObject o = getC().find(name1); + if (o!=null) { + o.setShowValue(bool); + } + } + } + + static public void MettreMontrerValeur(String name, boolean bool) { + String[] names=parseVariables(name).split(","); + for (String name1 : names) { + ConstructionObject o = getC().find(name1); + if (o!=null) { + o.setShowValue(bool); + } + } + } + + /** + * Some objects can be filled (circles, polygons, etc...). This will + * fill or unfill an object (or multiple objects). + *
Example : SetFilled("A,B,c1,l1",true) + * will fill objects A, B, c1 and l1. + * @param name Name(s) of object. + * @param bool "true" to fill objects, and "false" to unfill it. + */ + static public void SetFilled(String name, boolean bool) { + String[] names=parseVariables(name).split(","); + for (String name1 : names) { + ConstructionObject o = getC().find(name1); + if (o!=null) { + o.setFilled(bool); + } + } + } + + static public void MettreRempli(String name, boolean bool) { + String[] names=parseVariables(name).split(","); + for (String name1 : names) { + ConstructionObject o = getC().find(name1); + if (o!=null) { + o.setFilled(bool); + } + } + } + + static public void SetSolid(String name, boolean bool) { + String[] names=parseVariables(name).split(","); + for (int i=0; iExample : SetPartial("A,B,c1,l1",true) + * will draw partially objects A, B, c1 and l1. + * @param name Name(s) of object. + * @param bool "true" to draw partially, and "false" to draw completly. + */ + static public void SetPartial(String name, boolean bool) { + String[] names=parseVariables(name).split(","); + for (String name1 : names) { + ConstructionObject o = getC().find(name1); + if (o!=null) { + o.setPartial(bool); + getC().updateCircleDep(); + } + } + } + + static public void MettrePartiel(String name, boolean bool) { + String[] names=parseVariables(name).split(","); + for (String name1 : names) { + ConstructionObject o = getC().find(name1); + if (o!=null) { + o.setPartial(bool); + getC().updateCircleDep(); + } + } + } + + /** + *After calling this command, names of new objects will be displayed. + */ + static public void Shownames() { + cm("shownames"); + } + + static public void MontrerNoms() { + cm("shownames"); + } + + /** + *After calling this command, names of new objects will not be displayed. + */ + static public void Hidenames() { + cm("hidenames"); + } + + static public void CacherNoms() { + cm("hidenames"); + } + + /** + * Hides an object (or multiple objects). + *
Example : Hide("A,B,c1,l1") + * will hide objects A, B, c1 and l1. + * @param name Name(s) of object(s). + */ + static public void Hide(String name) { + String[] names=parseVariables(name).split(","); + for(String name1 : names) { + c("hide(true," + name1 + ")"); + } + paint(); + } + + static public void Cacher(String name) { + String[] names=parseVariables(name).split(","); + for(String name1 : names) { + c("hide(true," + name1 + ")"); + } + paint(); + } + + static public void SetHide(String name, boolean b) { + String[] names=parseVariables(name).split(","); + for (String name1 : names) { + c("hide("+b+"," + name1 + ")"); + } + paint(); + } + + static public void MettreCaché(String name, boolean b) { + String[] names=parseVariables(name).split(","); + for (String name1 : names) { + c("hide("+b+"," + name1 + ")"); + } + paint(); + } + + /** + * Shows an object (or multiple objects). + *
Example : Show("A,B,c1,l1") + * will show objects A, B, c1 and l1. + * @param name Name(s) of object(s). + */ + static public void Show(String name) { + String[] names=parseVariables(name).split(","); + for (String name1 : names) { + c("hide(false," + name1 + ")"); + } + paint(); + } + + static public void Montrer(String name) { + String[] names=parseVariables(name).split(","); + for (String name1 : names) { + c("hide(false," + name1 + ")"); + } + paint(); + } + +// static public void Delete(String name) { +// String[] names=parseVariables(name).split(","); +// for (int i=0; iFrom javascript, you can also do something like this : + *
    + *
  1. a=Point("",1,2)
  2. + *
  3. b=Point("",-2,3)
  4. + *
  5. m=4
  6. + *
  7. c=Point("","(x_a+x_b)/_m","(y_a+y_b)/_m")
  8. + *
+ * The "_" symbol means that javascript must use the content of variables. + * For example The string "_m" will be replaced by "4" (line 3).
Another + * "shortcut" : if, for example, a contains "P1" (the real name of the point + * created by step 1), the string x_a is equivalent to the string "x(P1)". + * @param name Name of the point (suggestion) + * @param x x-coordinate (number or expression) + * @param y y-coordinate (number or expression) + * @return Name of the created point + * @throws java.lang.Exception + */ + static public String Point(String name, String x, String y) throws Exception { + PointObject pt=null; + synchronized (getC()) { + if (x.equals("undefined")) { + double xx=getC().getX()+2*Math.random()*getC().getW()-getC().getW(); + double yy=getC().getY()-Math.random()*getC().getH()+getC().getH()/2; + x=""+xx; + y=""+yy; + if (name.equals("undefined")) { + name=""; + } + } else if (y.equals("undefined")) { + y=x; + x=name; + name=""; + } + try { + pt=new PointObject(getC(), Math.round(Double.valueOf(x)*1E13)/1E13, Math.round(Double.valueOf(y)*1E13)/1E13); + } catch (NumberFormatException e) { + try { + pt=new PointObject(getC(), 0, 0); + pt.setFixed(parseVariables(x), parseVariables(y)); + pt.validCoordinates(); + } catch (Exception ex) { + throw new Exception(Loc("pointcoords")); + } + } + pt.setDefaults(); + if (!name.equals("")) { + pt.setName(parseVariables(name)); + } + pt.validate(); + addObject(pt); + return pt.getName(); + } + } + + /** + * @author Dibs + * + */ + static public String Point3D(String name, String x, String y, String z) throws Exception { + if (!getZC().is3D()) return ""; + PointObject pt=null; + synchronized (getC()) { + if (x.equals("undefined")) { + double xx=getC().getX()+2*Math.random()*getC().getW()-getC().getW(); + double yy=getC().getY()-Math.random()*getC().getH()+getC().getH()/2; + try { + double xO=getC().find("O").getX(), yO = getC().find("O").getY(); + double x3DO=getC().find("O").getX(); + double y3DO=getC().find("O").getY(); + double xx3D = Math.sin(Math.toRadians(getC().find("E10").getValue()))*(xx-xO)-Math.sin(Math.toRadians(getC().find("E11").getValue()))*Math.cos(Math.toRadians(getC().find("E10").getValue()))*(yy-yO); + double yy3D = Math.cos(Math.toRadians(getC().find("E10").getValue()))*(xx-xO)+Math.sin(Math.toRadians(getC().find("E11").getValue()))*Math.sin(Math.toRadians(getC().find("E10").getValue()))*(yy-yO); + double zz3D = Math.cos(Math.toRadians(getC().find("E11").getValue()))*(yy-yO); + if (Math.abs(xx3D)<1e-16) { + xx3D=0; + } + if (Math.abs(yy3D)<1e-16) { + yy3D=0; + } + if (Math.abs(zz3D)<1e-16) { + zz3D=0; + } + x=""+xx3D; + y=""+yy3D; + z=""+zz3D; + } + catch (final Exception f) { + x=""+Math.random(); + y=""+Math.random(); + z=""+Math.random(); + } + if (name.equals("undefined")) { + name=""; + } + + } else if (z.equals("undefined")) { + z=y; + y=x; + x=name; + name=""; + } + try { + double x1 = Math.round(Double.valueOf(x)*1E13)/1E13; + double y1 =Math.round(Double.valueOf(y)*1E13)/1E13; + double z1 =Math.round(Double.valueOf(z)*1E13)/1E13; + pt=new PointObject(getC(), 0, 0); + pt.setFixed("x(O)+("+x1+")*(x(X)-x(O))+("+y1+")*(x(Y)-x(O))+("+z1+")*(x(Z)-x(O))", "y(O)+("+x1+")*(y(X)-y(O))+("+y1+")*(y(Y)-y(O))+("+z1+")*(y(Z)-y(O))"); + pt.setIs3D(true); + pt.setX3D(x1); + pt.setY3D(y1); + pt.setZ3D(z1); + } catch (Exception e) { + try { + pt=new PointObject(getC(), 0, 0); + pt.setFixed(x,y,z); + pt.setIs3D(true); + pt.validCoordinates3D(); + pt.setFixed("x(O)+("+parseVariables(x)+")*(x(X)-x(O))+("+parseVariables(y)+")*(x(Y)-x(O))+("+parseVariables(z)+")*(x(Z)-x(O))", "y(O)+("+parseVariables(x)+")*(y(X)-y(O))+("+parseVariables(y)+")*(y(Y)-y(O))+("+parseVariables(z)+")*(y(Z)-y(O))"); + pt.validCoordinates(); + } catch (Exception ex) { + + throw new Exception(Loc("pointcoords")); + } + } + pt.setDefaults(); + if (!name.equals("")) { + pt.setName(parseVariables(name)); + } + pt.setColorType(ConstructionObject.NORMAL); + pt.setShowName(false); + pt.setShowValue(false); + pt.validate(); + addObject(pt); + return pt.getName(); + } + } + + /** + * Set or Create a bounded point + * @param name Name of the bound point + * @param obj Name of the object + * @return Name of the set or created point + */ + static public String PointOn(String name, String obj) { + PointObject pt; + synchronized (getC()) { + if (obj.equals("undefined")) { + obj=parseVariables(name);//à tester... + pt=new PointObject(getC(), 0, 0); + pt.setDefaults(); + addObject(pt); + } else { + ConstructionObject co=getC().find(name); + if (co==null) { + pt=new PointObject(getC(), name); + pt.setDefaults(); + addObject(pt); + } else { + pt=(PointObject) co; + } + } + pt.setBound(obj); + pt.setUseAlpha(true); //pt will keep his barycentric coordinates relative to obj + + //to avoid the bound point being too near of an existing point + final Enumeration e=getC().elements(); + while (e.hasMoreElements()) { + ConstructionObject c=(ConstructionObject) e.nextElement(); + if (c instanceof PointObject) { + if ((pt.getX()-c.getX()<0.1)&&(pt.getY()-c.getY()<0.1)) { + pt.setXY(pt.getX()+Math.random()*2-1, pt.getY()+Math.random()*2-1); + break; + } + } + } + return pt.getName(); + } + } + + static public String PointSur(String name, String obj) { + PointObject pt; + synchronized (getC()) { + if (obj.equals("undefined")) { + obj=parseVariables(name);//à tester... + pt=new PointObject(getC(), 0, 0); + pt.setDefaults(); + addObject(pt); + } else { + ConstructionObject co=getC().find(name); + if (co==null) { + pt=new PointObject(getC(), name); + pt.setDefaults(); + addObject(pt); + } else { + pt=(PointObject) co; + } + } + pt.setBound(obj); + pt.setUseAlpha(true); //pt will keep his barycentric coordinates relative to obj + + //to avoid the bound point being too near of an existing point + final Enumeration e=getC().elements(); + while (e.hasMoreElements()) { + ConstructionObject c=(ConstructionObject) e.nextElement(); + if (c instanceof PointObject) { + if ((pt.getX()-c.getX()<0.1)&&(pt.getY()-c.getY()<0.1)) { + pt.setXY(pt.getX()+Math.random()*2-1, pt.getY()+Math.random()*2-1); + break; + } + } + } + return pt.getName(); + } + } + + /** + * Create the midpoint of two existing points + * @param name Name of the midpoint + * @param a Name of first point + * @param b Name of second point + * @return the midpoint name + */ + static public String MidPoint(String name, String a, String b) { + synchronized (getC()) { + if (b.equals("undefined")) { + b=a; + a=name; + name=""; + } + a=parseVariables(a); + b=parseVariables(b); + String sn = Global.name("name.short.Midpoint"); + if (name.equals("")) { + c(sn+"("+a+","+b+")"); + getC().lastButN(0).setShowName(false); + } else { + name=parseVariables(name); + c(name+"="+sn+"("+a+","+b+")"); + } + return LastNObjectsName(1); + } + } + + static public String Milieu(String name, String a, String b) { + synchronized (getC()) { + if (b.equals("undefined")) { + b=a; + a=name; + name=""; + } + a=parseVariables(a); + b=parseVariables(b); + String sn = Global.name("name.short.Midpoint"); + if (name.equals("")) { + c(sn+"("+a+","+b+")"); + getC().lastButN(0).setShowName(false); + } else { + name=parseVariables(name); + c(name+"="+sn+"("+a+","+b+")"); + } + return LastNObjectsName(1); + } + } + + /** + * Reflects the point p with line d + * @param name Name of the Symmetric + * @param l Reflection line + * @param p Point to reflect + * @return the reflection point name + * @throws java.lang.Exception + */ + static public String Reflection(String name, String l, String p) throws Exception { + synchronized (getC()) { + if (p.equals("undefined")) { + p=l; + l=name; + name=""; + } + l=parseVariables(l); + p=parseVariables(p); + if (name.equals("")) { + c("@builtin@/syma("+l+","+p+")"); + getC().lastButN(0).setShowName(false); + } else { + name=parseVariables(name); + c(name+"=@builtin@/syma("+l+","+p+")"); + } + return LastNObjectsName(1); + } + } + + static public String SymétrieAxiale(String name, String l, String p) throws Exception { + synchronized (getC()) { + if (p.equals("undefined")) { + p=l; + l=name; + name=""; + } + l=parseVariables(l); + p=parseVariables(p); + if (name.equals("")) { + c("@builtin@/syma("+l+","+p+")"); + getC().lastButN(0).setShowName(false); + } else { + name=parseVariables(name); + c(name+"=@builtin@/syma("+l+","+p+")"); + } + return LastNObjectsName(1); + } + } + + /** + * Translate the point p with vector ab + * @param name Name of the Translated point + * @param a first point of the vector + * @param b second point of the vector + * @param p Point to translate + * @return the translated point name + * @throws java.lang.Exception + */ + static public String Translation(String name, String a, String b, String p) throws Exception { + synchronized (getC()) { + if (p.equals("undefined")) { + p=b; + b=a; + a=name; + name=""; + } + a=parseVariables(a); + b=parseVariables(b); + p=parseVariables(p); + if (name.equals("")) { + c("@builtin@/trans("+a+","+b+","+p+")"); + getC().lastButN(0).setShowName(false); + } else { + name=parseVariables(name); + c(name+"=@builtin@/trans("+a+","+b+","+p+")"); + } + return LastNObjectsName(1); + } + } + + /** + * Reflect the point b with center a + * @param name Name of the Reflect point + * @param a Symmetry center + * @param b Point to reflect + * @return the symmetric point name + */ + static public String Symmetry(String name, String a, String b) { + synchronized (getC()) { + if (b.equals("undefined")) { + b=a; + a=name; + name=""; + } + a=parseVariables(a); + b=parseVariables(b); + String sn = Global.name("name.short.Point"); + if (name.equals("")) { + c(sn+"(2*x("+a+")-x("+b+"),2*y("+a+")-y("+b+"))"); + getC().lastButN(0).setShowName(false); + } else { + name=parseVariables(name); + c(name+"="+sn+"(2*x("+a+")-x("+b+"),2*y("+a+")-y("+b+"))"); + } + return LastNObjectsName(1); + } + } + + static public String SymétrieCentrale(String name, String a, String b) { + synchronized (getC()) { + if (b.equals("undefined")) { + b=a; + a=name; + name=""; + } + a=parseVariables(a); + b=parseVariables(b); + String sn = Global.name("name.short.Point"); + if (name.equals("")) { + c(sn+"(2*x("+a+")-x("+b+"),2*y("+a+")-y("+b+"))"); + getC().lastButN(0).setShowName(false); + } else { + name=parseVariables(name); + c(name+"="+sn+"(2*x("+a+")-x("+b+"),2*y("+a+")-y("+b+"))"); + } + return LastNObjectsName(1); + } + } + + /** + * Creates the perpendicular bisector between two points a and b + * @param name Name of the perpendicular bisector + * @param a first point + * @param b second point + * @return the perpendicular bisector name + */ + static public String PerpendicularBisector(String name, String a, String b) { + synchronized (getC()) { + if (b.equals("undefined")) { + b=a; + a=name; + name=""; + } + a=parseVariables(a); + b=parseVariables(b); + if (name.equals("")) { + c("@builtin@/med("+a+","+b+")"); + getC().lastButN(0).setShowName(false); + } else { + name=parseVariables(name); + c(name+"=@builtin@/med("+a+","+b+")"); + } + return LastNObjectsName(1); + } + } + + static public String Médiatrice(String name, String a, String b) { + synchronized (getC()) { + if (b.equals("undefined")) { + b=a; + a=name; + name=""; + } + a=parseVariables(a); + b=parseVariables(b); + if (name.equals("")) { + c("@builtin@/med("+a+","+b+")"); + getC().lastButN(0).setShowName(false); + } else { + name=parseVariables(name); + c(name+"=@builtin@/med("+a+","+b+")"); + } + return LastNObjectsName(1); + } + } + + /** + * Create the angle bisector between 3 points a, b and c + * @param name Name of the perpendicular bisector + * @param a first point + * @param b second point + * @param c third point + * @return the angle bisector name + * @throws java.lang.Exception + */ + static public String AngleBisector(String name, String a, String b, String c) throws Exception { + synchronized (getC()) { + if (c.equals("undefined")) { + c=b; + b=a; + a=name; + name=""; + } + a=parseVariables(a); + b=parseVariables(b); + c=parseVariables(c); + if (name.equals("")) { + c("@builtin@/biss("+a+","+b+","+c+")"); + getC().lastButN(0).setShowName(false); + } else { + name=parseVariables(name); + c(name+"=@builtin@/biss("+a+","+b+","+c+")"); + } + return LastNObjectsName(1); + } + } + + static public String Bissectrice(String name, String a, String b, String c) throws Exception { + synchronized (getC()) { + if (c.equals("undefined")) { + c=b; + b=a; + a=name; + name=""; + } + a=parseVariables(a); + b=parseVariables(b); + c=parseVariables(c); + if (name.equals("")) { + c("@builtin@/biss("+a+","+b+","+c+")"); + getC().lastButN(0).setShowName(false); + } else { + name=parseVariables(name); + c(name+"=@builtin@/biss("+a+","+b+","+c+")"); + } + return LastNObjectsName(1); + } + } + + /** + * Create the circumcicular circle between 3 points a, b and c + * @param name Name of the perpendicular bisector + * @param a first point + * @param b second point + * @param c third point + * @return the circumcicular circle name + * @throws java.lang.Exception + */ + static public String Circle3pts(String name, String a, String b, String c) throws Exception { + synchronized (getC()) { + if (c.equals("undefined")) { + c=b; + b=a; + a=name; + name=""; + } + a=parseVariables(a); + b=parseVariables(b); + c=parseVariables(c); + if (name.equals("")) { + c("@builtin@/circ("+a+","+b+","+c+")"); + getC().lastButN(0).setShowName(false); + } else { + name=parseVariables(name); + c(name+"=@builtin@/circ("+a+","+b+","+c+")"); + } + getC().lastButN(0).setDefaults(); + return LastNObjectsName(1); + } + } + + static public String Cercle3pts(String name, String a, String b, String c) throws Exception { + synchronized (getC()) { + if (c.equals("undefined")) { + c=b; + b=a; + a=name; + name=""; + } + a=parseVariables(a); + b=parseVariables(b); + c=parseVariables(c); + if (name.equals("")) { + c("@builtin@/circ("+a+","+b+","+c+")"); + getC().lastButN(0).setShowName(false); + } else { + name=parseVariables(name); + c(name+"=@builtin@/circ("+a+","+b+","+c+")"); + } + getC().lastButN(0).setDefaults(); + return LastNObjectsName(1); + } + } + + /** + * Creates the circle around a with radius bc + * @param name Name of the circle + * @param a center point + * @param b first point + * @param c second point + * @return the circle name + * @throws java.lang.Exception + */ + static public String Circle3(String name, String a, String b, String c) throws Exception { + synchronized (getC()) { + if (c.equals("undefined")) { + c=b; + b=a; + a=name; + name=""; + } + a=parseVariables(a); + b=parseVariables(b); + c=parseVariables(c); + String sn = Global.name("name.short.Circle3"); + if (name.equals("")) { + c(sn+"("+a+","+b+","+c+")"); + getC().lastButN(0).setShowName(false); + } else { + name=parseVariables(name); + c(name+"="+sn+"("+a+","+b+","+c+")"); + } + return LastNObjectsName(1); + } + } + + static public String Cercle3(String name, String a, String b, String c) throws Exception { + synchronized (getC()) { + if (c.equals("undefined")) { + c=b; + b=a; + a=name; + name=""; + } + a=parseVariables(a); + b=parseVariables(b); + c=parseVariables(c); + String sn = Global.name("name.short.Circle3"); + if (name.equals("")) { + c(sn+"("+a+","+b+","+c+")"); + getC().lastButN(0).setShowName(false); + } else { + name=parseVariables(name); + c(name+"="+sn+"("+a+","+b+","+c+")"); + } + return LastNObjectsName(1); + } + } + + /** + * Create the circumcircular arc between 3 points a, b and c + * @param name Name of the perpendicular bisector + * @param a first point + * @param b second point + * @param c third point + * @return the circumcircular arc name + * @throws java.lang.Exception + */ + static public String Arc3pts(String name, String a, String b, String c) throws Exception { + synchronized (getC()) { + if (c.equals("undefined")) { + c=b; + b=a; + a=name; + name=""; + } + a=parseVariables(a); + b=parseVariables(b); + c=parseVariables(c); + if (name.equals("")) { + c("@builtin@/arc("+a+","+b+","+c+")"); + getC().lastButN(0).setShowName(false); + } else { + name=parseVariables(name); + c(name+"=@builtin@/arc("+a+","+b+","+c+")"); + } + return LastNObjectsName(1); + } + } + + /** + * Creates the intersection between two objects. If you provide a name + * for the intersection, only one intersection point will be created. + * If you give the empty string "" as name parameter, two intersection + * points will be created, if the a and b objects are two circles + * or line/circle. + * @param name Name of the intersection point + * @param a Name of first object + * @param b Name of second object + * @param order Number which gives the order of intersection : 0 means first + * @return Name of intersection point + * @throws java.lang.Exception + * @see #Intersection2 + */ + static public String OrderedIntersection(String name, String a, String b, String order) throws Exception { + synchronized (getC()) { + if (order.equals("undefined")) { + order=b; + b=a; + a=name; + name=""; + } + a=parseVariables(a); + b=parseVariables(b); + order=parseVariables(order); + String sn = Global.name("name.short.Intersection"); + if (name.equals("")) { + c(sn+"("+a+","+b+")"); + getC().lastButN(0).setShowName(false); + } else { + name=parseVariables(name); + c(name+"="+sn+"("+a+","+b+")"); + } + IntersectionObject i=(IntersectionObject) getC().lastButN(0); + i.setFirst(Integer.valueOf(order)==0); + return LastNObjectsName(1); + } + } + + static public String IntersectionOrdonnée(String name, String a, String b, String order) throws Exception { + synchronized (getC()) { + if (order.equals("undefined")) { + order=b; + b=a; + a=name; + name=""; + } + a=parseVariables(a); + b=parseVariables(b); + order=parseVariables(order); + String sn = Global.name("name.short.Intersection"); + if (name.equals("")) { + c(sn+"("+a+","+b+")"); + getC().lastButN(0).setShowName(false); + } else { + name=parseVariables(name); + c(name+"="+sn+"("+a+","+b+")"); + } + IntersectionObject i=(IntersectionObject) getC().lastButN(0); + i.setFirst(Integer.valueOf(order)==0); + return LastNObjectsName(1); + } + } + + /** + * Creates the intersection between two objects. If you provide a name + * for the intersection, only one intersection point will be created. + * If you give the empty string "" as name parameter, two intersection + * points will be created, if the a and b objects are two circles + * or line/circle. + * @param name Name of the intersection point + * @param a Name of first object + * @param b Name of second object + * @return Name of intersection point + * @throws java.lang.Exception + * @see #Intersection2 + */ + static public String Intersection(String name, String a, String b) throws Exception { + synchronized (getC()) { + if (b.equals("undefined")) { + b=a; + a=name; + name=""; + } + a=parseVariables(a); + b=parseVariables(b); + String sn = Global.name("name.short.Intersection"); + if (name.equals("")) { + c(sn+"("+a+","+b+")"); + getC().lastButN(0).setShowName(false); + } else { + name=parseVariables(name); + c(name+"="+sn+"("+a+","+b+")"); + } + return LastNObjectsName(1); + } + } + + /** + * When two objects have two intersection points (two circles or one line/one circle) + * you may use this command to create them both. + * @param name1 Name of first intersection point + * @param name2 Name of second intersection point + * @param a Name of first object + * @param b Name of second object + * @return Name of intersection point + * @see #Intersection + */ + static public String Intersection2(String name1, String name2, String a, String b) { + synchronized (getC()) { + if (b.equals("undefined")) { + b=a; + a=name2; + name2=name1; + name1=""; + if (b.equals("undefined")) { + b=a; + a=name2; + name2=""; + } + } + a=parseVariables(a); + b=parseVariables(b); + String sn = Global.name("name.short.Intersection"); + if (name1.equals("")) { + c("I2,I1="+sn+"("+a+","+b+")"); + getC().lastButN(0).setShowName(false); + } else { + c(name2+","+name1+"="+sn+"("+a+","+b+")"); + } + return LastNObjectsName(2); + } + } + + /** + * General case: The number of the intersection points depends + * on the nature of the lines intersected + * @param name of the first intersection point + * @param a Name of first object + * @param b Name of second object + * @return list of the intersection points in a String + * @throws java.lang.Exception + * @see #Intersection + */ + static public String Intersections(String name, String a, String b) throws Exception { + synchronized (getC()) { + if (b.equals("undefined")) { + b=a; + a=name; + name=""; + } + a=parseVariables(a); + b=parseVariables(b); + String sn = Global.name("name.short.Intersection"); + if (name.equals("")) { + c(sn+"("+a+","+b+")"); + getC().lastButN(0).setShowName(false); + } else { + name=parseVariables(name); + c(name+"="+sn+"("+a+","+b+")"); + } + if (getC().find(a) instanceof PrimitiveLineObject&&getC().find(b) instanceof PrimitiveLineObject) { + return LastNObjectsName(1); + } else { + if ((getC().find(a) instanceof PrimitiveCircleObject||getC().find(b) instanceof PrimitiveCircleObject) + ||(getC().find(a) instanceof PrimitiveLineObject&&getC().find(b) instanceof QuadricObject) + ||(getC().find(a) instanceof QuadricObject&&getC().find(b) instanceof PrimitiveLineObject)) { + return LastNObjectsName(2); + } else { + if (getC().find(a) instanceof QuadricObject&&getC().find(b) instanceof QuadricObject) { + return LastNObjectsName(4); + } else { + if (getC().find(a) instanceof FunctionObject||getC().find(b) instanceof FunctionObject) { + return LastNObjectsName(1); + } else { + throw new Exception(Loc("notgoodtype")); + } + } + } + } + } + } + + /** + * Creates a line between two points + * @param name Name of the line (suggestion) + * @param a Name of first point + * @param b Name of second point + * @return Name of the created line + */ + static public String Line(String name, String a, String b) { + synchronized (getC()) { + if (b.equals("undefined")) { + b=a; + a=name; + name=""; + } + a=parseVariables(a); + b=parseVariables(b); + String sn = Global.name("name.short.Line"); + if (name.equals("")) { + c(sn+"("+a+","+b+")"); + getC().lastButN(0).setShowName(false); + } else { + name=parseVariables(name); + c(name+"="+sn+"("+a+","+b+")"); + } + NormalizeLast(); + return LastNObjectsName(1); + } + } + + static public String Droite(String name, String a, String b) { + synchronized (getC()) { + if (b.equals("undefined")) { + b=a; + a=name; + name=""; + } + a=parseVariables(a); + b=parseVariables(b); + String sn = Global.name("name.short.Line"); + if (name.equals("")) { + c(sn+"("+a+","+b+")"); + getC().lastButN(0).setShowName(false); + } else { + name=parseVariables(name); + c(name+"="+sn+"("+a+","+b+")"); + } + NormalizeLast(); + return LastNObjectsName(1); + } + } + + /** + * Creates a ray from point a to point b + * @param name Name of the ray (suggestion) + * @param a Name of first point + * @param b Name of second point + * @return Name of the created ray + */ + static public String Ray(String name, String a, String b) { + synchronized (getC()) { + if (b.equals("undefined")) { + b=a; + a=name; + name=""; + } + a=parseVariables(a); + b=parseVariables(b); + String sn = Global.name("name.short.Ray"); + if (name.equals("")) { + c(sn+"("+a+","+b+")"); + getC().lastButN(0).setShowName(false); + } else { + name=parseVariables(name); + c(name+"="+sn+"("+a+","+b+")"); + } + NormalizeLast(); + return LastNObjectsName(1); + } + } + + static public String DemiDroite(String name, String a, String b) { + synchronized (getC()) { + if (b.equals("undefined")) { + b=a; + a=name; + name=""; + } + a=parseVariables(a); + b=parseVariables(b); + String sn = Global.name("name.short.Ray"); + if (name.equals("")) { + c(sn+"("+a+","+b+")"); + getC().lastButN(0).setShowName(false); + } else { + name=parseVariables(name); + c(name+"="+sn+"("+a+","+b+")"); + } + NormalizeLast(); + return LastNObjectsName(1); + } + } + + /** + * Creates an angle defined by 3 points a,b and c (b is the vertex). + * @param name Name of the angle (suggestion) + * @param a Name of first point + * @param b Name of the vertex + * @param c Name of the third point + * @return Name of the created angle + */ + static public String Angle(String name, String a, String b, String c) { + synchronized (getC()) { + if (c.equals("undefined")) { + c=b; + b=a; + a=name; + name=""; + } + a=parseVariables(a); + b=parseVariables(b); + c=parseVariables(c); + String sn = Global.name("name.short.Angle"); + if (name.equals("")) { + c(sn+"("+a+","+b+","+c+")"); + getC().lastButN(0).setShowName(false); + } else { + name=parseVariables(name); + c(name+"="+sn+"("+a+","+b+","+c+")"); + } + return LastNObjectsName(1); + } + } + + /** + * Creates an angle defined by 2 points a,b and an expression c (b is the vertex). + * @param name Name of the angle (suggestion) + * @param a Name of first point + * @param b Name of the vertex + * @param c angle in degree + * @return Name of the created angle + */ + static public String FixedAngle(String name, String a, String b, String c) throws Exception{ + synchronized (getC()) { + if (c.equals("undefined")) { + c=b; + b=a; + a=name; + name=""; + } + a=parseVariables(a); + b=parseVariables(b); + String sn = Global.name("name.short.Angle"); + try { + if (name.equals("")) { + c(sn+"("+a+","+b+","+Math.round(Double.valueOf(c)*1E13)/1E13+")"); + getC().lastButN(0).setShowName(false); + } else { + name=parseVariables(name); + c(name+"="+sn+"("+a+","+b+","+Math.round(Double.valueOf(c)*1E13)/1E13+")"); + } + NormalizeLast(); + getC().lastButN(0).setDefaults(); + return LastNObjectsName(1); + } catch (NumberFormatException e) { + try { + if (name.equals("")) { + c(sn+"("+a+","+b+",0)"); + getC().lastButN(0).setShowName(false); + } else { + name=parseVariables(name); + c(name+"="+sn+"("+a+","+b+",0)"); + } + NormalizeLast(); + getC().lastButN(0).setDefaults(); + c=parseVariables(c); + ((FixedAngleObject) getC().lastButN(0)).setFixed(c); + return LastNObjectsName(1); + } catch (Exception ex) { + throw new Exception(Loc("notgoodtype")); + } + } + } + } + + static public String AngleFixe(String name, String a, String b, String c) throws Exception{ + synchronized (getC()) { + if (c.equals("undefined")) { + c=b; + b=a; + a=name; + name=""; + } + a=parseVariables(a); + b=parseVariables(b); + String sn = Global.name("name.short.Angle"); + try { + if (name.equals("")) { + c(sn+"("+a+","+b+","+Math.round(Double.valueOf(c)*1E13)/1E13+")"); + getC().lastButN(0).setShowName(false); + } else { + name=parseVariables(name); + c(name+"="+sn+"("+a+","+b+","+Math.round(Double.valueOf(c)*1E13)/1E13+")"); + } + NormalizeLast(); + getC().lastButN(0).setDefaults(); + return LastNObjectsName(1); + } catch (NumberFormatException e) { + try { + if (name.equals("")) { + c(sn+"("+a+","+b+",0)"); + getC().lastButN(0).setShowName(false); + } else { + name=parseVariables(name); + c(name+"="+sn+"("+a+","+b+",0)"); + } + NormalizeLast(); + getC().lastButN(0).setDefaults(); + c=parseVariables(c); + ((FixedAngleObject) getC().lastButN(0)).setFixed(c); + return LastNObjectsName(1); + } catch (Exception ex) { + throw new Exception(Loc("notgoodtype")); + } + } + } + } + + /** + * Set angles as reflex or not. + *
Example : ReflexAngle("a1,a2",true) + * @param name Name(s) of object. + * @param bool "true" to set as reflex, "false" to have only angles less than 180°. + * @throws java.lang.Exception + */ + static public void ReflexAngle(String name, boolean bool) throws Exception { + + String[] names=parseVariables(name).split(","); + for (String name1 : names) { + ConstructionObject o = getC().find(name1); + if (!(o instanceof AngleObject)) { + throw new Exception(Loc("notgoodtype")); + } + if (o!=null && true) { + o.setObtuse(bool); + } + } + } + + static public void AngleRentrant(String name, boolean bool) throws Exception { + + String[] names=parseVariables(name).split(","); + for (String name1 : names) { + ConstructionObject o = getC().find(name1); + if (!(o instanceof AngleObject)) { + throw new Exception(Loc("notgoodtype")); + } + if (o!=null && true) { + o.setObtuse(bool); + } + } + } + + /** + * Execute a macro-construction m with parameters params + * @param lastObjName Name of last created object(s) + * @param macroname Name of macro + * @param params list of objects (e.g. "A,E,F,G") + * @return Name of the last created object or the String array with all targets name + */ + static public Object ExecuteMacro(String lastObjName, String macroname, String params) { + synchronized (getC()) { + if (params.equals("undefined")) { + params=macroname; + macroname=lastObjName; + lastObjName=""; + } + if (lastObjName.equals("")) { + c(macroname+"("+parseVariables(params)+")"); + //getC().lastButN(0).setShowName(false); + } else { + c(parseVariables(lastObjName)+"="+macroname+"("+parseVariables(params)+")"); + } + + String[] TargetsNamesArray = MacroRunner.TargetsNameList.toArray(new String[MacroRunner.TargetsNameList.size()]); + for (int i=0; i. + + */ +package eric.JSprogram; + +import java.awt.Dimension; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +import java.util.ArrayList; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import javax.swing.JComponent; +import eric.JEricPanel; +import javax.swing.JTextPane; +import javax.swing.plaf.metal.MetalComboBoxUI; + +public class JSIcon extends JSButton { + + /** + * + */ + + String NAME; + String CODE; + ArrayList PATTERNS=new ArrayList(); + ArrayList STRS=new ArrayList(); + ArrayList VARS=new ArrayList(); + ArrayList CONST=new ArrayList(); + ArrayList EXEMPLES=new ArrayList(); + JSEditor JSC; + private static final String REGEX_NUMERIC="(((?<=[-+*/(])|(?<=^))-)?\\d+(\\.\\d+)?"; + private static final String REGEX_VARIABLE="\\$[a-zA-Z][a-zA-Z0-9]*"; + public static final String REGEX_OPERATION="[a-zA-Z][a-zA-Z0-9]+|[-*/+|?:@&^<>'`=%#]"; + private static final String REGEX_PARANTHESIS="[()]"; +// private JPanel JPN=new JPanel(); + + private void fixsize(final int sze) { + final Dimension d=new Dimension(sze, sze); + this.setMaximumSize(d); + this.setMinimumSize(d); + this.setPreferredSize(d); + this.setSize(d); + } + + // Create an Icon wich belongs to group (if not null) : +// public JSIcon(final JSConsole jsc, final String nm, String[] codes) { + public JSIcon(JSEditor jsc, String name, String code) { + super(name, 24, !code.equals("")); + JSC=jsc; + NAME=name; + CODE=code; + this.addMouseListener(new MouseAdapter() { + + public void mousePressed(final MouseEvent e) { + if (!isDisabled) { + JSC.clearStatusBar(); + if (e.getButton()!=MouseEvent.BUTTON3) { + ClicOnMe(); + } + JSC.NoTypeNoClic(); + } + } + }); + interpret(); + } + + @Override + public String getName() { + return NAME; + } + private int[] t; + private int[] T; + + private void interpret() { +// exemple : =Point(,,); + StringBuffer sb=new StringBuffer(); + Pattern p=Pattern.compile("<(\\w+[,\\w]*)>", Pattern.CASE_INSENSITIVE); + Matcher m=p.matcher(CODE); + while (m.find()) { + VARS.add(m.group(1).split(",")); + m.appendReplacement(sb, "@@@@"); + } + m.appendTail(sb); + m.reset(); + String result=" "+sb.toString()+" "; + String[] c=result.split("@@@@"); + + + + + for (int i=0; i", Pattern.CASE_INSENSITIVE); + Matcher m=p.matcher((String) EXEMPLES.get(i)); + + if (m.find()) { + String[] c=m.group(1).split(","); + m.appendReplacement(sb, "@@@@"); + m.appendTail(sb); + String myex=sb.toString(); + for (int k=0; k0)) { + T[i]=0; + i=i-1; + } + + if (T[i]1) { +// st=(String) EXEMPLES.get(0); +// } + JSC.addToScript(exemple(0)); + + +// String st=""; +// +// +// +// for (int i=0; i ToolTip = new ArrayList(), FileName = new ArrayList(); + private ScriptItemsArray items=new ScriptItemsArray(); + private JScrollPane jsp; + + public JScriptsLeftPanel(){ + this.setLayout(new javax.swing.BoxLayout(this, javax.swing.BoxLayout.Y_AXIS)); + + myRoot = new DefaultMutableTreeNode("CaRScripts"); + explore(ScriptsDirectory, myRoot); + + ScriptsTree = new JTree(myRoot); + ToolTipManager.sharedInstance().registerComponent(ScriptsTree); + ScriptsTree.setCellRenderer(new MyRenderer()); + + MouseListener ml = new MouseAdapter() { + + @Override + public void mousePressed(MouseEvent e) { + int row = ScriptsTree.getRowForLocation(e.getX(), e.getY()); + TreePath TPath = ScriptsTree.getPathForLocation(e.getX(), e.getY()); + ScriptsTree.setSelectionRow(row); + if(row != -1 && e.isMetaDown()) { + path = Global.getHomeDirectory()+"scripts"; + for(int i=1; i
"; + try { + InputStream input = new FileInputStream(file); + BufferedReader in = new BufferedReader(new InputStreamReader(input, "UTF-8")); + while((str=in.readLine())!=null && !(str=str.trim()).endsWith("//end")) { + //str=str.trim(); + mystr += str.replace("//", ""); + mystr += "
"; + } + } catch(Exception ex){} + return mystr+""; + } + + /* + * menu popup et les méthodes attachées + * aux différents items + */ + private void myPopUpMenu(final String path, final MouseEvent e){ + JMenuItem item, runitem, includeFileItem, includeFolderItem; + JPopupMenu myPopUpMenu = new JPopupMenu(); + + // add Cancel Item : + item = new myJMenuItem(Global.Loc("JSmenu.cancel"), themes.resizeExistingIcon("/eric/GUI/icons/jswindow/restore.png", 16, 16)); + item.addActionListener(new ActionListener() { + + @Override + public void actionPerformed(final ActionEvent event) { + JZirkelCanvas.getCurrentZC().getScriptsPanel().Restore(); + } + }); + item.setEnabled(JZirkelCanvas.getCurrentZC().getScriptsPanel().isBackup()); + myPopUpMenu.add(item); + + // add Run Item + runitem = new myJMenuItem("Exécuter", themes.resizeExistingIcon("/eric/GUI/icons/jswindow/run.png", 12, 16)); + runitem.addActionListener(new ActionListener() { + + @Override + public void actionPerformed(final ActionEvent event) { + run(new File(path)); + } + }); + + // to include this file + includeFileItem=new myJMenuItem("Inclure dans la figure"); + includeFileItem.addActionListener(new ActionListener(){ + + @Override + public void actionPerformed(ActionEvent e) { + include(path); + } + }); + + //to include all scripts in this folder + includeFolderItem = new myJMenuItem("Inclure le dossier dans la figure"); + includeFolderItem.addActionListener(new ActionListener(){ + + @Override + public void actionPerformed(ActionEvent e) { + includeFolder(new File(path)); + } + }); + + if((new File(path)).isDirectory()){ + myPopUpMenu.add(includeFolderItem); + } else { + myPopUpMenu.add(runitem); + myPopUpMenu.add(includeFileItem); + } + + myPopUpMenu.show(e.getComponent(), e.getX()+15, e.getY()); + } + + public void run(File file){ + String str=""; + String mystr=""; + try { + InputStream input=new FileInputStream(file); + BufferedReader in=new BufferedReader(new InputStreamReader(input, "UTF-8")); + while ((str=in.readLine())!=null) { + str=str.trim(); + mystr+=str+"\n"; + } + } catch(Exception ex){} + + ScriptItem si = new ScriptItem(null, "anonymous", mystr); + items.add(si); + si.runScript(); + } + + public void include(String path){ + JZirkelCanvas.getCurrentZC().openScriptFile(path, false); + } + + public void includeFolder(File folder){ + File[] f = folder.listFiles(); + for(File file : f){ + if(file.toString().endsWith(".js")){ + include(file.toString()); + } else if(file.isDirectory()){ + includeFolder(file); + } + } + } + + /* + * Scripts lancés depuis le panneau de gauche + */ + + public ScriptItemsArray getScripts(){ + return items; + } +} \ No newline at end of file diff --git a/eric/JSprogram/LineNumber.java b/eric/JSprogram/LineNumber.java new file mode 100644 index 0000000..d83e038 --- /dev/null +++ b/eric/JSprogram/LineNumber.java @@ -0,0 +1,133 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package eric.JSprogram; + + + +//package text; +import java.awt.*; +import javax.swing.*; +import javax.swing.border.*; +import javax.swing.text.*; +public class LineNumber extends JComponent { +// private final static Color DEFAULT_BACKGROUND = new Color(235, 230, 225); + private final static Color DEFAULT_BACKGROUND = new Color(14, 221, 29); + private final static Color DEFAULT_FOREGROUND = Color.black; + private final static Font DEFAULT_FONT = new Font("monospaced", Font.PLAIN, 12); + // LineNumber height (abends when I use MAX_VALUE) + private final static int HEIGHT = Integer.MAX_VALUE - 1000000; + // Set right/left margin + private final static int MARGIN = 5; + // Variables for this LineNumber component + private FontMetrics fontMetrics; + private int lineHeight; + private int currentDigits; + // Metrics of the component used in the constructor + private JComponent component; + private int componentFontHeight; + private int componentFontAscent; + /** + * Convenience constructor for Text Components + */ + public LineNumber(JComponent component) { + if (component == null) { + setFont( DEFAULT_FONT ); + this.component = this; + } else { + setFont( component.getFont() ); + this.component = component; + } + setBackground( DEFAULT_BACKGROUND ); + setForeground( DEFAULT_FOREGROUND ); + setPreferredWidth( 99 ); + } + /** + * Calculate the width needed to display the maximum line number + */ + public void setPreferredWidth(int lines) { + int digits = String.valueOf(lines).length(); + // Update sizes when number of digits in the line number changes + if (digits != currentDigits && digits > 1) { + currentDigits = digits; + int width = fontMetrics.charWidth( '0' ) * digits; + Dimension d = getPreferredSize(); + d.setSize(2 * MARGIN + width, HEIGHT); + setPreferredSize( d ); + setSize( d ); + } + } + /** + * Reset variables that are dependent on the font. + */ + public void setFont(Font font) { + super.setFont(font); + fontMetrics = getFontMetrics( getFont() ); + componentFontHeight = fontMetrics.getHeight(); + componentFontAscent = fontMetrics.getAscent(); + } + /** + * The line height defaults to the line height of the font for this + * component. + */ + public int getLineHeight() { + if (lineHeight == 0) + return componentFontHeight; + else + return lineHeight; + } + /** + * Override the default line height with a positive value. + * For example, when you want line numbers for a JTable you could + * use the JTable row height. + */ + public void setLineHeight(int lineHeight) { + if (lineHeight > 0) + this.lineHeight = lineHeight; + } + public int getStartOffset() { + return component.getInsets().top + componentFontAscent; + } + public void paintComponent(Graphics g) { + int lineHeight = getLineHeight(); + int startOffset = getStartOffset(); + Rectangle drawHere = g.getClipBounds(); + // Paint the background + g.setColor( getBackground() ); + g.fillRect(drawHere.x, drawHere.y, drawHere.width, drawHere.height); + // Determine the number of lines to draw in the foreground. + g.setColor( getForeground() ); + int startLineNumber = (drawHere.y / lineHeight) + 1; + int endLineNumber = startLineNumber + (drawHere.height / lineHeight); + int start = (drawHere.y / lineHeight) * lineHeight + startOffset; + for (int i = startLineNumber; i <= endLineNumber; i++) { + String lineNumber = String.valueOf(i); + int stringWidth = fontMetrics.stringWidth( lineNumber ); + int rowWidth = getSize().width; + g.drawString(lineNumber, rowWidth - stringWidth - MARGIN, start); + start += lineHeight; + } + int rows = component.getSize().height / componentFontHeight; + setPreferredWidth( rows ); + } + public static void main(String[] args) { + JFrame frame = new JFrame("LineNumberDemo"); + frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE ); + JPanel panel = new JPanel(); + frame.setContentPane( panel ); + panel.setBorder(BorderFactory.createEmptyBorder(20,20,20,20)); + panel.setLayout(new BorderLayout()); + JTextArea textPane = new JTextArea(); + textPane.setFont( new Font("monospaced", Font.PLAIN, 12) ); + textPane.setText("abc"); + JScrollPane scrollPane = new JScrollPane(textPane); + panel.add(scrollPane); + scrollPane.setPreferredSize(new Dimension(300, 250)); + LineNumber lineNumber = new LineNumber( textPane ); + scrollPane.setRowHeaderView(lineNumber ); + frame.pack(); + frame.setVisible(true); + } +} \ No newline at end of file diff --git a/eric/JSprogram/LineNumberView.java b/eric/JSprogram/LineNumberView.java new file mode 100644 index 0000000..6d035d3 --- /dev/null +++ b/eric/JSprogram/LineNumberView.java @@ -0,0 +1,330 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package eric.JSprogram; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.Rectangle; +import java.awt.event.ComponentAdapter; +import java.awt.event.ComponentEvent; + +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; + +import javax.swing.BorderFactory; +import javax.swing.JComponent; +import javax.swing.SizeSequence; +import javax.swing.UIManager; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; +import javax.swing.text.BadLocationException; +import javax.swing.text.Document; +import javax.swing.text.Element; +import javax.swing.text.JTextComponent; +//import eric.JSprogram.JSConsole; + +/** + * LineNumberView is a simple line-number gutter that works correctly + * even when lines are wrapped in the associated text component. This + * is meant to be used as the RowHeaderView in a JScrollPane that + * contains the associated text component. Example usage: + *
+ *   JTextArea ta = new JTextArea();
+ *   ta.setLineWrap(true);
+ *   ta.setWrapStyleWord(true);
+ *   JScrollPane sp = new JScrollPane(ta);
+ *   sp.setRowHeaderView(new LineNumberView(ta));
+ *
+ * + * @author Alan Moore + */ +public class LineNumberView extends JComponent +{ + // This is for the border to the right of the line numbers. + // There's probably a UIDefaults value that could be used for this. + private static final Color BORDER_COLOR = Color.GRAY; + private final static Color DEFAULT_BACKGROUND = new Color(214, 221, 229); + private final static Color DEFAULT_FOREGROUND = Color.black; + + private static final int WIDTH_TEMPLATE = 99999; + private static final int MARGIN = 2; + + private FontMetrics viewFontMetrics; + private int maxNumberWidth; + private int componentWidth; + + private int textTopInset; + private int textFontAscent; + private int textFontHeight; + + private JTextComponent text; + private SizeSequence sizes; + private int startLine = 0; + private boolean structureChanged = true; + + /** + * Construct a LineNumberView and attach it to the given text component. + * The LineNumberView will listen for certain kinds of events from the + * text component and update itself accordingly. + * + * @param startLine the line that changed, if there's only one + * @param structureChanged if true, ignore the line number and + * update all the line heights. + */ + public LineNumberView(JTextComponent text) + { + if (text == null) + { + throw new IllegalArgumentException("Text component cannot be null"); + } + this.text = text; + updateCachedMetrics(); + + UpdateHandler handler = new UpdateHandler(); + text.getDocument().addDocumentListener(handler); + text.addPropertyChangeListener(handler); + text.addComponentListener(handler); + +// setBorder(BorderFactory.createMatteBorder(0, 0, 0, 1, BORDER_COLOR)); + setBorder(BorderFactory.createEmptyBorder()); + setBackground(DEFAULT_BACKGROUND); + setForeground(DEFAULT_FOREGROUND) ; + } + + /** + * Schedule a repaint because one or more line heights may have changed. + * + * @param startLine the line that changed, if there's only one + * @param structureChanged if true, ignore the line number and + * update all the line heights. + */ + private void viewChanged(int startLine, boolean structureChanged) + { + this.startLine = startLine; + this.structureChanged = structureChanged; + + revalidate(); + repaint(); + } + + /** Update the line heights as needed. */ + private void updateSizes() + { + if (startLine < 0) + { + return; + } + + if (structureChanged) + { + int count = getAdjustedLineCount(); + sizes = new SizeSequence(count); + for (int i = 0; i < count; i++) + { + sizes.setSize(i, getLineHeight(i)); + } + structureChanged = false; + } + else + { + sizes.setSize(startLine, getLineHeight(startLine)); + } + + startLine = -1; + } + + /* Copied from javax.swing.text.PlainDocument */ + private int getAdjustedLineCount() + { + // There is an implicit break being modeled at the end of the + // document to deal with boundary conditions at the end. This + // is not desired in the line count, so we detect it and remove + // its effect if throwing off the count. + Element map = text.getDocument().getDefaultRootElement(); + int n = map.getElementCount(); + Element lastLine = map.getElement(n - 1); + if ((lastLine.getEndOffset() - lastLine.getStartOffset()) > 1) + { + return n; + } + + return n - 1; + } + + /** + * Get the height of a line from the JTextComponent. + * + * @param index the line number + * @param the height, in pixels + */ + private int getLineHeight(int index) + { + int lastPos = sizes.getPosition(index) + textTopInset; + int height = textFontHeight; + try + { + Element map = text.getDocument().getDefaultRootElement(); + int lastChar = map.getElement(index).getEndOffset() - 1; + Rectangle r = text.modelToView(lastChar); + height = (r.y - lastPos) + r.height; + } + catch (BadLocationException ex) + { + ex.printStackTrace(); + } + return height; + } + + /** + * Cache some values that are used a lot in painting or size + * calculations. Also ensures that the line-number font is not + * larger than the text component's font (by point-size, anyway). + */ + private void updateCachedMetrics() + { + Font textFont = text.getFont(); + FontMetrics fm = getFontMetrics(textFont); + textFontHeight = Math.max(fm.getHeight(),10); + textFontHeight = JSEditor.TailleTexte; //private donc inaccessible ici, dommage... + textFontAscent = fm.getAscent(); + textTopInset = text.getInsets().top; + + Font viewFont = getFont(); + boolean changed = false; + if (viewFont == null) + { + viewFont = UIManager.getFont("Label.font"); + changed = true; + } + if (viewFont.getSize() != textFont.getSize()) + { + viewFont = viewFont.deriveFont(textFont.getSize2D()); + changed = true; + } + + viewFontMetrics = getFontMetrics(viewFont); + maxNumberWidth = (viewFontMetrics.stringWidth(String.valueOf(WIDTH_TEMPLATE))+10)/2; + componentWidth = 2 * MARGIN + maxNumberWidth; + + if (changed) + { + super.setFont(viewFont); + } + } + + public Dimension getPreferredSize() + { + return new Dimension(componentWidth, text.getHeight()); + } + + public void setFont(Font font) + { + super.setFont(font); + updateCachedMetrics(); + } + + public void paintComponent(Graphics g) + { + updateSizes(); + Rectangle clip = g.getClipBounds(); + + g.setColor(getBackground()); + g.fillRect(clip.x, clip.y, clip.width, clip.height); + + g.setColor(getForeground()); + int base = clip.y - textTopInset; + int first = sizes.getIndex(base); + int last = sizes.getIndex(base + clip.height); + String text = ""; + + for (int i = first; i <= last; i++) + { + text = String.valueOf(i+1); + int x = MARGIN + maxNumberWidth - viewFontMetrics.stringWidth(text); + int y = sizes.getPosition(i) + textFontAscent + textTopInset; + g.drawString(text, x, y); + } + } + + class UpdateHandler extends ComponentAdapter + implements PropertyChangeListener, DocumentListener + { + /** + * The text component was resized. 'Nuff said. + */ + public void componentResized(ComponentEvent evt) + { + viewChanged(0, true); + } + + /** + * A bound property was changed on the text component. Properties + * like the font, border, and tab size affect the layout of the + * whole document, so we invalidate all the line heights here. + */ + public void propertyChange(PropertyChangeEvent evt) + { + Object oldValue = evt.getOldValue(); + Object newValue = evt.getNewValue(); + String propertyName = evt.getPropertyName(); + if ("document".equals(propertyName)) + { + if (oldValue != null && oldValue instanceof Document) + { + ((Document)oldValue).removeDocumentListener(this); + } + if (newValue != null && newValue instanceof Document) + { + ((Document)newValue).addDocumentListener(this); + } + } + + updateCachedMetrics(); + viewChanged(0, true); + } + + /** + * Text was inserted into the document. + */ + public void insertUpdate(DocumentEvent evt) + { + update(evt); + } + + /** + * Text was removed from the document. + */ + public void removeUpdate(DocumentEvent evt) + { + update(evt); + } + + /** + * Text attributes were changed. In a source-code editor based on + * StyledDocument, attribute changes should be applied automatically + * in response to inserts and removals. Since we're already + * listening for those, this method should be redundant, but YMMV. + */ + public void changedUpdate(DocumentEvent evt) + { +// update(evt); + } + + /** + * If the edit was confined to a single line, invalidate that + * line's height. Otherwise, invalidate them all. + */ + private void update(DocumentEvent evt) + { + Element map = text.getDocument().getDefaultRootElement(); + int line = map.getElementIndex(evt.getOffset()); + DocumentEvent.ElementChange ec = evt.getChange(map); + viewChanged(line, ec != null); + } + } +} \ No newline at end of file diff --git a/eric/JSprogram/ScriptItem.java b/eric/JSprogram/ScriptItem.java new file mode 100644 index 0000000..3683769 --- /dev/null +++ b/eric/JSprogram/ScriptItem.java @@ -0,0 +1,487 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.JSprogram; + +import eric.GUI.ZDialog.ZTextFieldAndLabel; +import eric.GUI.palette.PaletteManager; +import eric.GUI.themes; +import eric.JZirkelCanvas; +import eric.controls.JCanvasPanel; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.io.BufferedReader; +import java.io.FileInputStream; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.ArrayList; +import javax.swing.JMenuItem; +import javax.swing.JOptionPane; +import rene.gui.Global; +import rene.util.FileName; +import rene.util.xml.XmlTree; +import rene.util.xml.XmlWriter; +import rene.zirkel.ZirkelCanvas; +import rene.zirkel.objects.ConstructionObject; +import rene.zirkel.tools.Scripts_SetMouseDrag; +//import rene.zirkel.tools.Scripts_SetMouseOver; +import rene.zirkel.tools.Scripts_SetMouseUp; + +/** + * + * @author erichake + */ +public class ScriptItem extends JMenuItem implements ActionListener { + + private String name, source; + private boolean executeOnLoad=false; + private ArrayList mouseDragEventTargets=new ArrayList(); + private ArrayList mouseUpEventTargets=new ArrayList(); + private ArrayList mouseOverEventTargets=new ArrayList(); + private ScriptThread THREAD=null; + private ZTextFieldAndLabel currentInputField=null, otherInputField = null; + private String mouseDragTargetsNames="", mouseUpTargetsNames=""; // Attention, champs intermédiaire pour le load, ne reflète pas toujours la réalité + // private String mouseOverTargetsNames=""; + private JSEditor JSC=null; + private String FILENAME=""; + private ScriptPanel PANEL; + + public ScriptItem(ScriptPanel panel, XmlTree tree) { + super(tree.getTag().getValue("Name")); + PANEL=panel; + name=tree.getTag().getValue("Name"); + if (tree.getTag().hasParam("mousedrag")) { + mouseDragTargetsNames=tree.getTag().getValue("mousedrag"); + } + if (tree.getTag().hasParam("mouseup")) { + mouseUpTargetsNames=tree.getTag().getValue("mouseup"); + } + executeOnLoad=tree.getTag().hasTrueParam("onload"); + source=tree.getText(); + source=source.replaceAll("^[\n]*", ""); + source=source.replace("<", "<"); + source=source.replace(">", ">"); + addActionListener(this); + setFont(themes.TabMenusFont); + } + + public ScriptItem(ScriptPanel panel, String scriptname, String scriptsource) { + super(scriptname); + PANEL=panel; + name=scriptname; + source=scriptsource; + addActionListener(this); + setFont(themes.TabMenusFont); + } + + public ScriptPanel getPanel() { + return PANEL; + } + + public void setExecuteOnLoad(boolean b) { + executeOnLoad=b; + } + + public boolean getExecuteOnLoad() { + return executeOnLoad; + } + + public void setFileName(String name) { + FILENAME=name; + } + + public String getFileName() { + return FILENAME; + } + + public String getScriptName() { + return name; + } + + public String getScriptSource() { + return source; + } + + public void setScriptName(String s) { + name=s; + } + + public void setScriptSource(String s) { + source=s; + } + + public void setEditor(JSEditor jse){ + JSC=jse; + } + + public JSEditor getEditor() { + return JSC; + } + + public void openEditor() { + if (JSC==null) { + JSC=new JSEditor(this); + } else { + JSC.setVisible(true); + JSC.toFront(); + } + } + + public void closeEditor() { + if (JSC!=null) { + JSC.setVisible(false); + } + } + + public static boolean unique(String s, ScriptItemsArray V) { + for (ScriptItem myItem : V) { + if (s.equals(myItem.getScriptName())) { + return false; + } + } + return true; + } + + public static String uniqueScriptName(String base) { + ZirkelCanvas zc=JZirkelCanvas.getCurrentZC(); + if (zc==null) { + return base; + } + ScriptItemsArray V=zc.getScripts(); + if (!unique(base, V)) { + int num=0; + do { + num++; + base=base.replaceAll("[\\s0-9]+$", "")+" "+num; + } while (!unique(base, V)); + } + return base; + } + + public void newScriptInConstruction() { + openEditor(); + String s=""; + do { + s=(String) JOptionPane.showInputDialog( + JSC, + Global.Loc("JSeditor.saveinfig.question"), + Global.Loc("JSeditor.saveinfig.title"), + JOptionPane.PLAIN_MESSAGE, + null, + null, + ""); + } while ("".equals(s)); + s=uniqueScriptName(s); + JSC.setWindowTitle(Global.Loc("JSeditor.infig")+s); + JSC.setScriptName(s); + setScriptName(s); + } + + public void openScriptFile(final String myname, boolean open) { + String str=""; + String mystr=""; + try { + InputStream input=new FileInputStream(myname); + BufferedReader in=new BufferedReader(new InputStreamReader(input, "UTF-8")); + while ((str=in.readLine())!=null) { + str=str.trim(); + mystr+=str+"\n"; + } + source=mystr; + name=FileName.filename(myname); + if(open) + openEditor(); + JSC.setScriptArea(source); + JSC.setWindowTitle(Global.Loc("JSeditor.infig")+name); + JSC.setScriptName(name); + } catch (Exception ex) { + } + } + + public void openEmbeddedScript() { + openEditor(); + JSC.setScriptArea(source); + JSC.setWindowTitle(Global.Loc("JSeditor.infig")+name); + JSC.setScriptName(name); + } + + public void sendErrorToEditor(String message) { + openEditor(); + JSC.setScriptArea(source); + JSC.setWindowTitle(FILENAME); + JSC.Error(message); + } + + public void fixMouseTargets() { + setMouseDragTargets(mouseDragTargetsNames); + setMouseUpTargets(mouseUpTargetsNames); +// setMouseOverTargets(mouseOverTargetsNames); + } + + public void saveScript(final XmlWriter xml) { + xml.startTagStart("Script"); + xml.printArg("Name", name); + if(mouseDragEventTargets.size()>0) { + xml.printArg("mousedrag", getMouseDragTargetNames()); + } + if(mouseUpEventTargets.size()>0) { + xml.printArg("mouseup", getMouseUpTargetNames()); + } + xml.printArg("onload", ""+executeOnLoad); + xml.startTagEndNewLine(); + xml.print(source); + //xml.println(); + xml.endTagNewLine("Script"); + } + + @Override + public void actionPerformed(ActionEvent e) { + runScript(); + } + + public void stopme() { + if (THREAD!=null) { + THREAD.stopme(); + } + } + + public void restartme() { + if (THREAD!=null) { + THREAD.restartme(); + } + } + + public void killme() { + if (THREAD!=null) { + THREAD.killme(); + THREAD=null; + } + } + + public boolean isRunning() { + if (THREAD!=null) { + return THREAD.isRunning(); + } + return false; + } + + public boolean isStopped() { + if (THREAD!=null) { + return THREAD.isStopped(); + } + return false; + } + + public void runScript() { + killme(); + THREAD=new ScriptThread(this); + THREAD.runme(); + } + + public void runControlScript(JCanvasPanel jp) { + if (isRunning()) { + return; + } + for (ConstructionObject obj : mouseDragEventTargets) { + if (obj==jp.O) { + THREAD=new ScriptThread(this); + THREAD.runme(); + return; + } + } + } + + public void prepareDragAction(ConstructionObject o) { + if (isRunning()) { + return; + } + for (ConstructionObject obj : mouseDragEventTargets) { + if (obj==o) { + THREAD=new ScriptThread(this); + THREAD.prepareActionScript(o.getName()); + return; + } + } + } + + public void runDragAction() { + if (THREAD!=null) { + THREAD.runActionScript(); + } + } + public void runUpAction(ConstructionObject o){ + for(ConstructionObject obj : mouseUpEventTargets){ + if(obj==o){ + runScript(); + } + } + } + + public void stopDragAction() { + if (THREAD!=null) { + THREAD.stopActionScript(); + } + } + + public void refreshMouseDragInputField() { + if (currentInputField!=null) { + currentInputField.setText(getMouseDragTargetNames()); + otherInputField.setText(getMouseUpTargetNames()); + } + } + public void refreshMouseUpInputField() { + if (currentInputField!=null) { + currentInputField.setText(getMouseUpTargetNames()); + otherInputField.setText(getMouseDragTargetNames()); + } + } + + public void setMouseDragTool(ZTextFieldAndLabel current, ZTextFieldAndLabel other) { + ZirkelCanvas zc=JZirkelCanvas.getCurrentZC(); + if (zc!=null) { + currentInputField=current; + otherInputField = other; + PaletteManager.deselectgeomgroup(); + zc.setTool(new Scripts_SetMouseDrag(this)); + setTargetSelected(zc, mouseDragEventTargets, true); + } + } + public void setMouseUpTool(ZTextFieldAndLabel current, ZTextFieldAndLabel other) { + ZirkelCanvas zc=JZirkelCanvas.getCurrentZC(); + if (zc!=null) { + currentInputField=current; + otherInputField = other; + PaletteManager.deselectgeomgroup(); + zc.setTool(new Scripts_SetMouseUp(this)); + setTargetSelected(zc, mouseUpEventTargets, true); + } + } + + public String getMouseDragTargetNames() { + return getTargetNames(mouseDragEventTargets); + } + public String getMouseUpTargetNames() { + return getTargetNames(mouseUpEventTargets); + } + + public void fixmouseDragTargetsNames(){ + mouseDragTargetsNames=getTargetNames(mouseDragEventTargets); + } + public void fixmouseUpTargetsNames(){ + mouseUpTargetsNames=getTargetNames(mouseUpEventTargets); + } + + public void reloadMouseDragTargets(){ + loadTargets(mouseDragEventTargets, mouseDragTargetsNames); + } + public void reloadMouseUpTargets(){ + loadTargets(mouseUpEventTargets, mouseUpTargetsNames); + } + + public void setMouseDragTargets(String t) { + setTargets(mouseDragEventTargets, t); + } + public void setMouseUpTargets(String t) { + setTargets(mouseUpEventTargets, t); + } + + public void addMouseDragTarget(ConstructionObject o) { + addTarget(mouseDragEventTargets, o); + } + public void addMouseUpTarget(ConstructionObject o) { + addTarget(mouseUpEventTargets, o); + } + + public void removeMouseDragTarget(ConstructionObject o) { + removeTarget(mouseDragEventTargets, o); + } + public void removeMouseUpTarget(ConstructionObject o) { + removeTarget(mouseUpEventTargets, o); + } + + /* + * Mouse Over Input Field (not implemented) + */ + public void refreshMouseOverInputField() { + if (currentInputField!=null) { + currentInputField.setText(getMouseOverTargetNames()); + } + } + +// public void setMouseOverTool(ZTextFieldAndLabel current) { +// ZirkelCanvas zc=JZirkelCanvas.getCurrentZC(); +// if (zc!=null) { +// currentInputField=current; +// PaletteManager.deselectgeomgroup(); +// zc.setTool(new Scripts_SetMouseOver(this)); +// setTargetSelected(zc, mouseOverEventTargets, true); +// } +// } + + public String getMouseOverTargetNames() { + return getTargetNames(mouseOverEventTargets); + } + +// public void setMouseOverTargets(String t) { +// setTargets(mouseOverEventTargets, t); +// } +// + public void addMouseOverTarget(ConstructionObject o) { + addTarget(mouseOverEventTargets, o); + } + + public void removeMouseOverTarget(ConstructionObject o) { + removeTarget(mouseOverEventTargets, o); + } + /* + * End + */ + + private String getTargetNames(ArrayList targets) { + String names=""; + for (int i=0; i targets, String t) { + ZirkelCanvas zc=JZirkelCanvas.getCurrentZC(); + if (zc!=null) { + targets.clear(); + String[] names=t.split(";"); + for (int i=0; i targets, String t) { + ZirkelCanvas zc=JZirkelCanvas.getCurrentZC(); + if (zc!=null) { + setTargetSelected(zc, targets, false); + loadTargets(targets,t); + setTargetSelected(zc, targets, true); + } + } + + private void addTarget(ArrayList targets, ConstructionObject o) { + targets.add(o); + } + + private void removeTarget(ArrayList targets, ConstructionObject o) { + targets.remove(o); + } + + private void setTargetSelected(ZirkelCanvas zc, ArrayList targets, boolean sel) { + zc.clearSelected(); + for (int i=0; i{ + + public ScriptItemsArray(){ + super(); + } + +} diff --git a/eric/JSprogram/ScriptPanel.java b/eric/JSprogram/ScriptPanel.java new file mode 100644 index 0000000..27d97c1 --- /dev/null +++ b/eric/JSprogram/ScriptPanel.java @@ -0,0 +1,432 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.JSprogram; + +import eric.FileTools; +import eric.GUI.palette.PaletteManager; +import eric.GUI.themes; +import eric.GUI.window.myJMenuItem; +import eric.controls.JCanvasPanel; +import java.awt.Graphics; +import java.awt.Image; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.util.ArrayList; +import javax.swing.JMenu; +import eric.JEricPanel; +import java.awt.event.MouseAdapter; +import javax.swing.JPopupMenu; +import javax.swing.JSeparator; +import rene.gui.Global; +import rene.util.xml.XmlTree; +import rene.zirkel.ZirkelCanvas; +import rene.zirkel.objects.ConstructionObject; + +/** + * + * @author erichake, modified by PM Mazat + */ +public class ScriptPanel extends JEricPanel { + + private ArrayList BACKUPS=new ArrayList(); + private ZirkelCanvas ZC; + private ScriptItemsArray items=new ScriptItemsArray(); + private ArrayList itemsbackup; + private static Image icon=themes.getImage("scripts.png"); + private int W=32, H=32, X=10, Y=10; + private ScriptsManager ScriptsManagerPanel=null; + private static int ScriptsManagerPanel_X=3, ScriptsManagerPanel_Y=45, ScriptsManagerPanel_WIDTH=3*12+180+90; + + public ScriptPanel(ZirkelCanvas zc) { + ZC=zc; + setBounds(X, Y, W, H); + + MouseListener ml = new MouseAdapter(){ + + @Override + public void mousePressed(MouseEvent e){ + showPopup(); + } + }; + + this.addMouseListener(ml); + } + + @Override + public void paintComponent(Graphics g) { + g.drawImage(icon, 0, 0, W, H, this); + } + + public void Backup() { + try { + BACKUPS.add(FileTools.getCurrentFileSource()); + fixConsoleBackBtn(); + } catch (Exception ex) { + } + } + + public boolean isBackup() { + return (BACKUPS.size()>0); + } + + public void Restore() { + ZC.killAllScripts(); + try { + Thread.sleep(500); + } catch (Exception ex) { + } + backupScriptItems(); + if (BACKUPS.size()>0) { + ZC.getConstruction().clear(); + try { + FileTools.setCurrentFileSource(BACKUPS.get(BACKUPS.size()-1)); + } catch (final Exception e) { + } + BACKUPS.remove(BACKUPS.size()-1); + + } + restoreScriptItems(); + fixConsoleBackBtn(); + /* + * Si on a ajouté un script après avoir lancé d'un script de bibliothèque + * le panneau n'est pas affiché après l'annulation + */ + if(items.size()!=0) + ZC.add(this); + } + + public void backupScriptItems() { + itemsbackup=new ArrayList(); + for (ScriptItem item : items) { + item.fixmouseDragTargetsNames(); + item.fixmouseUpTargetsNames(); + itemsbackup.add(item); + } + } + + public void restoreScriptItems() { + items.clear(); + for (ScriptItem item : itemsbackup) { + item.reloadMouseDragTargets(); + item.reloadMouseUpTargets(); + items.add(item); + } + } + + public void fixConsoleBackBtn() { + for (ScriptItem item : items) { + JSEditor jsc=item.getEditor(); + if (jsc!=null) { + jsc.setBackBtnEnabled(BACKUPS.size()>0); + } + } + } + + public void showPopup() { + JPopupMenu popup = new JPopupMenu(); + + // add Cancel Item : + myJMenuItem item=new myJMenuItem(Global.Loc("JSmenu.cancel"), themes.resizeExistingIcon("/eric/GUI/icons/jswindow/restore.png", 16, 16)) { + + @Override + public void action() { + onlyRemoveScriptsManagerPanel(); + Restore(); + } + }; + item.setEnabled(isBackup()); + popup.add(item); + popup.add(new JSeparator()); + + // add New Script Item : + item=new myJMenuItem(Global.Loc("JSmenu.add")) { + + @Override + public void action() { + newScript(); + } + }; + popup.add(item); + popup.add(new JSeparator()); + + // add Run script Items : + for (int i=0; i0) { + removeScript(items.get(0)); + } + } + + public void removeScript(ScriptItem si) { + ZC.getConstruction().haveChanged(); + items.remove(si); + if (items.isEmpty()) { + ZC.remove(this); + removeScriptsManagerPanel(); + ZC.repaint(); + } + if (ScriptsManagerPanel!=null) { + addScriptsManagerPanel(); + } + } + + public void addScript(XmlTree tree) { + items.add(new ScriptItem(this, tree)); + + // at first added script, button must be drawn in the canvas : + if (items.size()==1) { + ZC.add(this); + } + } + + private ScriptItem findScript(String nme) { + for (int i=0; i="); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*)≥", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+">="); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]*)≠", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+"!="); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*)≠", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+"!="); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]*)modulo", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+"%"); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*)modulo", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+"%"); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]*)×", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+"*"); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*)×", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+"*"); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]*)∞", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+"Infinity"); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*)∞", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+"Infinity"); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]*):", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+"/"); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*):", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+"/"); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + SCRIPT=SCRIPT.replace(",\"fin\")",",\"thin\")"); + + //SCRIPT=SCRIPT.replace("fin","Fin"); + //SCRIPT=SCRIPT.replace("Fin","//Fin"); + //SCRIPT=SCRIPT.replace(",","."); + p = Pattern.compile("^afficher\\s", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst("Afficher "); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]*)\\safficher\\s", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+" Afficher "); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*)\\safficher\\s", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+" Afficher "); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("^Println\\(", Pattern.MULTILINE); //tour de passe-passe de base + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst("Printline("); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]*)\\sPrintln\\(", Pattern.MULTILINE); //tour de passe-passe de base + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+" Printline("); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*)\\sPrintln\\(", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+" Printline("); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]*)ln\\(", Pattern.MULTILINE); //tour de passe-passe de base + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+"log("); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*)ln\\(", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+"log("); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]*)val_approchée_par_excès\\(", Pattern.MULTILINE); //tour de passe-passe de base + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+"ceil("); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*)val_approchée_par_excès\\(", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+"ceil("); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("^Printline\\(", Pattern.MULTILINE); //tour de passe-passe de base + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst("Println("); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]*\\s)Printline\\(", Pattern.MULTILINE); //tour de passe-passe de base + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+"Println("); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*\\s)Printline\\(", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+"Println("); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]*)arrondi\\(", Pattern.MULTILINE); //tour de passe-passe de base + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+"round("); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*)arrondi\\(", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+"round("); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]*)troncature\\(", Pattern.MULTILINE); //tour de passe-passe de base + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+"floor("); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*)troncature\\(", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+"floor\\("); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]*)racine\\(", Pattern.MULTILINE); //tour de passe-passe de base + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+"sqrt("); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*)racine\\(", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+"sqrt("); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]*)puissance\\(", Pattern.MULTILINE); //tour de passe-passe de base + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+"pow("); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*)puissance\\(", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+"pow("); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]*)nombre_aleatoire\\(", Pattern.MULTILINE); //tour de passe-passe de base + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+"random("); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*)nombre_aleatoire\\(", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+"random("); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]*[^.\"])PI", Pattern.MULTILINE); //tour de passe-passe de base + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+"Math.PI"); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*[^.\"])PI", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+"Math.PI"); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]*[^.\"]).taille", Pattern.MULTILINE); //tour de passe-passe de base + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+".length"); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*[^.\"]).taille", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+".length"); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + String[] mathkeynames2={"sin", "cos", "tan", "asin", "acos", "atan", + "abs", "ceil", "round", "floor","exp", "log", "sqrt", "random", "pow", "min", "max"}; + for (int i=0; i=1) { + SCRIPT= m.replaceFirst("while ("+String.valueOf(m.group(1))+")\n"); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]*)\\stant(?:\\s)que\\s([^\n]*)\n", Pattern.MULTILINE); //tour de passe-passe de base + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+" while ("+String.valueOf(m.group(2))+")\n"); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*)\\stant(?:\\s)que\\s([^\n]*)\n", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound&&m.groupCount()>=2) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+" while ("+String.valueOf(m.group(2))+")\n"); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("^si\\s([^\n]*)\n", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound&&m.groupCount()>=1) { + SCRIPT= m.replaceFirst("if ("+String.valueOf(m.group(1))+")\n"); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]*)\\ssi\\s([^\n]*)\n", Pattern.MULTILINE); //tour de passe-passe de base + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+" if ("+String.valueOf(m.group(2))+")\n"); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*)\\ssi\\s([^\n]*)\n", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound&&m.groupCount()>=2) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+" if ("+String.valueOf(m.group(2))+")\n"); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("^Si\\s([^\n]*)\n", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound&&m.groupCount()>=1) { + SCRIPT= m.replaceFirst("if ("+String.valueOf(m.group(1))+")\n"); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]*)\\sSi\\s([^\n]*)\n", Pattern.MULTILINE); //tour de passe-passe de base + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+" if ("+String.valueOf(m.group(2))+")\n"); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*)\\sSi\\s([^\n]*)\n", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound&&m.groupCount()>=2) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+" if ("+String.valueOf(m.group(2))+")\n"); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + int nbOuverts=0; + String[] lesLignes= SCRIPT.split("\n"); + int indentationLignePrec=0; + int indentationLigneActu=0; + Boolean cherchonsUnEspace=true; + int ancienneLigne=0; + for (int i=1; iindentationLignePrec) { + lesLignes[i-1]=lesLignes[i-1]+"{"; + nbOuverts++; + } + if (indentationLigneActu==indentationLignePrec) { + lesLignes[i-1]=lesLignes[i-1]+";"; + } + while (indentationLigneActu=1) { + SCRIPT= m.replaceFirst("{"+String.valueOf(m.group(1))); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + } + SCRIPT=SCRIPT+lesLignes[lesLignes.length-1]; + p = Pattern.compile("^[\\s]*;$", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(""); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("^;;", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(";"); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]*);;", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+";"); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*);;", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+";"); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("^\\};", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst("}"); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]*)\\};", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+"}"); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*)\\};", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+"}"); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + } + p = Pattern.compile("(^[^\"]*):=", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+"="); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*):=", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+"="); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("^Tant\\s", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst("tant "); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]*)\\sTant\\s", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+" tant "); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*)\\sTant\\s", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+" tant "); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("^Si\\s", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst("si "); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]*)\\sSi\\s", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+" si "); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*)\\sSi\\s", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+" si "); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("^Pour\\s", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst("pour "); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]*)\\sPour\\s", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+" pour "); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*)\\sPour\\s", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+" pour "); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("^Répéter\\s", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst("répéter "); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]*)\\sRépéter\\s", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+" répéter "); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*)\\sRépéter\\s", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+" répéter "); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + SCRIPT=SCRIPT.replace(",\"fin\")",",\"thin\")"); + SCRIPT=SCRIPT.replace(",\"épais\")",",\"thick\")"); + SCRIPT=SCRIPT.replace(",\"carré\")",",\"square\")"); + SCRIPT=SCRIPT.replace(",\"cercle\")",",\"circle\")"); + SCRIPT=SCRIPT.replace(",\"diamant\")",",\"diamond\")"); + SCRIPT=SCRIPT.replace(",\"croixPlus\")",",\"cross\")"); + SCRIPT=SCRIPT.replace(",\"croix\")",",\"dcross\")"); + + SCRIPT=SCRIPT.replace(",\"vert\")",",\"green\")"); + SCRIPT=SCRIPT.replace(",\"bleu\")",",\"blue\")"); + SCRIPT=SCRIPT.replace(",\"marron\")",",\"brown\")"); + SCRIPT=SCRIPT.replace(",\"rouge\")",",\"red\")"); + SCRIPT=SCRIPT.replace(",\"noir\")",",\"black\")"); + + SCRIPT=SCRIPT.replace(",\"montrervaleur\")",",\"showvalue\")"); + SCRIPT=SCRIPT.replace(",\"montrernom\")",",\"showname\")"); + SCRIPT=SCRIPT.replace(",\"fond\")",",\"background\")"); + SCRIPT=SCRIPT.replace(",\"caché\")",",\"hidden\")"); + SCRIPT=SCRIPT.replace(",\"supercaché\")",",\"superhidden\")"); + + SCRIPT=SCRIPT.replace("(\"polygone\",","(\"area\","); + SCRIPT=SCRIPT.replace("(\"rempli\",","(\"filled\","); + SCRIPT=SCRIPT.replace("(\"opaque\",","(\"solid\","); + SCRIPT=SCRIPT.replace("(\"cercle\",","(\"circle\","); + SCRIPT=SCRIPT.replace("(\"droite\",","(\"line\","); + SCRIPT=SCRIPT.replace("(\"texte\",","(\"text\","); + SCRIPT=SCRIPT.replace("(\"couleur0\",","(\"color0\","); + SCRIPT=SCRIPT.replace("(\"couleur1\",","(\"color1\","); + SCRIPT=SCRIPT.replace("(\"couleur2\",","(\"color2\","); + SCRIPT=SCRIPT.replace("(\"couleur3\",","(\"color3\","); + SCRIPT=SCRIPT.replace("(\"couleur4\",","(\"color4\","); + SCRIPT=SCRIPT.replace("(\"couleur5\",","(\"color5\","); + SCRIPT=SCRIPT.replace("(\"épaisseur0\",","(\"thickness0\","); + SCRIPT=SCRIPT.replace("(\"épaisseur1\",","(\"thickness1\","); + SCRIPT=SCRIPT.replace("(\"épaisseur2\",","(\"thickness2\","); + SCRIPT=SCRIPT.replace("(\"montrervaleur\",","(\"showvalue\","); + SCRIPT=SCRIPT.replace("(\"montrernom\",","(\"showname\","); + SCRIPT=SCRIPT.replace("(\"obtus\",","(\"obtuse\","); + + p = Pattern.compile("(^[^\"]*)vrai", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+"true"); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*)vrai", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+"true"); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]*)faux", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+"false"); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*)faux", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+"false"); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("^si\\s", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst("if "); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]*)\\ssi\\s", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+" if "); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*)\\ssi\\s", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+" if "); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("^sinon(\\W)", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst("else"+String.valueOf(m.group(1))); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]*)\\ssinon(\\W)", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+" else"+String.valueOf(m.group(2))); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*)\\ssinon", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+" else"); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("^bifurquer\\s", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst("switch "); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]*)\\sbifurquer\\s", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+" switch "); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*)\\sbifurquer\\s", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+" switch "); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("^cas\\s", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst("case "); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]*)\\scas\\s", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+" case "); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*)\\scas\\s", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+" case "); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("^rompre([\\W&&[^\"]])", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound&&m.groupCount()>=1) { + SCRIPT= m.replaceFirst("break"+String.valueOf(m.group(1))); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]*)\\srompre([\\W&&[^\"]])", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound&&m.groupCount()>=2) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+" break"+String.valueOf(m.group(2))); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*)\\srompre([\\W&&[^\"]])", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound&&m.groupCount()>=2) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+" break"+String.valueOf(m.group(2))); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("^par\\sdéfaut([\\W&&[^\"]])", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound&&m.groupCount()>=1) { + SCRIPT= m.replaceFirst("default"+String.valueOf(m.group(1))); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]*)\\spar\\sdéfaut([\\W&&[^\"]])", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound&&m.groupCount()>=2) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+" default"+String.valueOf(m.group(2))); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*)\\spar\\sdéfaut([\\W&&[^\"]])", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound&&m.groupCount()>=2) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+" default"+String.valueOf(m.group(2))); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("^pour\\s", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + if (matchFound) { + SCRIPT= m.replaceAll("for "); + } + p = Pattern.compile("(^[^\"]*)\\spour\\s", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound&&m.groupCount()>=1) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+" for "); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*)\\spour\\s", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound&&m.groupCount()>=1) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+" for "); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]*)\\sallant\\sde\\s", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound&&m.groupCount()>=1) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+" from "); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*)\\sallant\\sde\\s", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound&&m.groupCount()>=1) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+" from "); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]*)\\sà\\s", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound&&m.groupCount()>=1) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+" to "); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*)\\sà\\s", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound&&m.groupCount()>=1) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+" to "); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("^tant\\sque\\s(\\W)", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound&&m.groupCount()>=1) { + SCRIPT= m.replaceFirst("while "+String.valueOf(m.group(1))); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]*)\\stant\\sque([\\W&&[^\"]])", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound&&m.groupCount()>=2) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+" while"+String.valueOf(m.group(2))); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*)\\stant\\sque([\\W&&[^\"]])", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound&&m.groupCount()>=2) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+" while"+String.valueOf(m.group(2))); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("^faire(\\W)", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound&&m.groupCount()>=1) { + SCRIPT= m.replaceFirst("do"+String.valueOf(m.group(1))); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]*)\\sfaire([\\W&&[^\"]])", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound&&m.groupCount()>=2) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+" do"+String.valueOf(m.group(2))); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*)\\sfaire([\\W&&[^\"]])", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound&&m.groupCount()>=2) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+" do"+String.valueOf(m.group(2))); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]*)\\sjusqu'à\\s([\\W&&[^\"]])", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound&&m.groupCount()>=2) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+" until "+String.valueOf(m.group(2))); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*)\\sjusqu'à\\s([\\W&&[^\"]])", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound&&m.groupCount()>=2) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+" until "+String.valueOf(m.group(2))); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]*)\\suntil[\\s]*\\(([^;]+);", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound&&m.groupCount()>=2) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+" while (!("+String.valueOf(m.group(2))+")"); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*)\\suntil[\\s]*\\(([^;]+);", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound&&m.groupCount()>=1) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+" while (!("+String.valueOf(m.group(2))+")"); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("^fonction(\\W)", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound&&m.groupCount()>=1) { + SCRIPT= m.replaceFirst("function"+String.valueOf(m.group(1))); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]*)\\sfonction([\\W&&[^\"]])", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound&&m.groupCount()>=2) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+" function"+String.valueOf(m.group(2))); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*)\\sfonction([\\W&&[^\"]])", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound&&m.groupCount()>=2) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+" function"+String.valueOf(m.group(2))); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("^retourner(\\W)", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound&&m.groupCount()>=1) { + SCRIPT= m.replaceFirst("return"+String.valueOf(m.group(1))); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]*)\\sretourner([\\W&&[^\"]])", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound&&m.groupCount()>=2) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+" return"+String.valueOf(m.group(2))); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*)\\sretourner([\\W&&[^\"]])", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound&&m.groupCount()>=2) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+" return"+String.valueOf(m.group(2))); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("^for\\s+([a-zA-Z][a-zA-Z_0-9]*)\\s+from\\s+([a-zA-Z_0-9\\[\\]\\-\\+\\*/\\.\\(\\)]+)\\s+to\\s+([a-zA-Z_0-9\\[\\]\\-\\+\\*/\\.\\(\\)]+)\\s*\\{", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound&&m.groupCount()>=3) { + SCRIPT= m.replaceFirst("for ("+m.group(1)+"="+String.valueOf(m.group(2))+";"+String.valueOf(m.group(1))+"<="+String.valueOf(m.group(3))+";"+String.valueOf(m.group(1))+"="+String.valueOf(m.group(1))+"+1){"); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]*)for\\s+([a-zA-Z][a-zA-Z_0-9]*)\\s+from\\s+([a-zA-Z_0-9\\[\\]\\-\\+\\*/\\.\\(\\)]+)\\s+to\\s+([a-zA-Z_0-9\\[\\]\\-\\+\\*/\\.\\(\\)]+)\\s*\\{", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound&&m.groupCount()>=3) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+"for ("+String.valueOf(m.group(2))+"="+String.valueOf(m.group(3))+";"+String.valueOf(m.group(2))+"<="+String.valueOf(m.group(4))+";"+String.valueOf(m.group(2))+"="+String.valueOf(m.group(2))+"+1){"); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*)for\\s+([a-zA-Z][a-zA-Z_0-9]*)\\s+from\\s+([a-zA-Z_0-9\\[\\]\\-\\+\\*/\\.\\(\\)]+)\\s+to\\s+([a-zA-Z_0-9\\[\\]\\-\\+\\*/\\.\\(\\)]+)\\s*\\{", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound&&m.groupCount()>=3) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+"for ("+String.valueOf(m.group(2))+"="+String.valueOf(m.group(3))+";"+String.valueOf(m.group(2))+"<="+String.valueOf(m.group(4))+";"+String.valueOf(m.group(2))+"="+String.valueOf(m.group(2))+"+1){"); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("^for\\s+var\\s+([a-zA-Z][a-zA-Z_0-9]*)\\s+from\\s+([a-zA-Z_0-9\\[\\]\\-\\+\\*/\\.\\(\\)]+)\\s+to\\s+([a-zA-Z_0-9\\[\\]\\-\\+\\*/\\.\\(\\)]+)\\s*\\{", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound&&m.groupCount()>=3) { + SCRIPT= m.replaceFirst("for (var "+m.group(1)+"="+String.valueOf(m.group(2))+";"+String.valueOf(m.group(1))+"<="+String.valueOf(m.group(3))+";"+String.valueOf(m.group(1))+"="+String.valueOf(m.group(1))+"+1){"); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]*)for\\s+var\\s+([a-zA-Z][a-zA-Z_0-9]*)\\s+from\\s+([a-zA-Z_0-9\\[\\]\\-\\+\\*/\\.\\(\\)]+)\\s+to\\s+([a-zA-Z_0-9\\[\\]\\-\\+\\*/\\.\\(\\)]+)\\s*\\{", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound&&m.groupCount()>=3) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+"for (var "+String.valueOf(m.group(2))+"="+String.valueOf(m.group(3))+";"+String.valueOf(m.group(2))+"<="+String.valueOf(m.group(4))+";"+String.valueOf(m.group(2))+"="+String.valueOf(m.group(2))+"+1){"); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*)for\\s+var\\s+([a-zA-Z][a-zA-Z_0-9]*)\\s+from\\s+([a-zA-Z_0-9\\[\\]\\-\\+\\*/\\.\\(\\)]+)\\s+to\\s+([a-zA-Z_0-9\\[\\]\\-\\+\\*/\\.\\(\\)]+)\\s*\\{", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound&&m.groupCount()>=3) { + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+"for (var "+String.valueOf(m.group(2))+"="+String.valueOf(m.group(3))+";"+String.valueOf(m.group(2))+"<="+String.valueOf(m.group(4))+";"+String.valueOf(m.group(2))+"="+String.valueOf(m.group(2))+"+1){"); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("^répéter\\s+([a-zA-Z_0-9\\[\\]\\-\\+\\*/\\.\\(\\)]+)\\s+fois\\s*\\{", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound&&m.groupCount()>=1) { + nbRepeter++; + SCRIPT= m.replaceFirst("for (var compteurZZ"+nbRepeter+"=0;compteurZZ"+nbRepeter+"<"+String.valueOf(m.group(1))+";compteurZZ"+nbRepeter+"++){"); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]*)répéter\\s+([a-zA-Z_0-9\\[\\]\\-\\+\\*/\\.\\(\\)]+)\\s+fois\\s*\\{", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound&&m.groupCount()>=1) { + nbRepeter++; + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+"for (var compteurZZ"+nbRepeter+"=0;compteurZZ"+nbRepeter+"<"+String.valueOf(m.group(2))+";compteurZZ"+nbRepeter+"++){"); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*)répéter\\s+([a-zA-Z_0-9\\[\\]\\-\\+\\*/\\.\\(\\)]+)\\s+fois\\s*\\{", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound&&m.groupCount()>=1) { + nbRepeter++; + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+"for (var compteurZZ"+nbRepeter+"=0;compteurZZ"+nbRepeter+"<"+String.valueOf(m.group(2))+";compteurZZ"+nbRepeter+"++){"); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("^repeat\\s+([a-zA-Z_0-9\\[\\]\\-\\+\\*/\\.\\(\\)]+)\\s+times\\s*\\{", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound&&m.groupCount()>=1) { + nbRepeter++; + SCRIPT= m.replaceFirst("for (var compteurZZ"+nbRepeter+"=0;compteurZZ"+nbRepeter+"<"+String.valueOf(m.group(1))+";compteurZZ"+nbRepeter+"++){"); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]*)repeat\\s+([a-zA-Z_0-9\\[\\]\\-\\+\\*/\\.\\(\\)]+)\\s+times\\s*\\{", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound&&m.groupCount()>=1) { + nbRepeter++; + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+"for (var compteurZZ"+nbRepeter+"=0;compteurZZ"+nbRepeter+"<"+String.valueOf(m.group(2))+";compteurZZ"+nbRepeter+"++){"); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + p = Pattern.compile("(^[^\"]+(?:\"[^\"]*\"[^\"]*)+[^\"\n]*)repeat\\s+([a-zA-Z_0-9\\[\\]\\-\\+\\*/\\.\\(\\)]+)\\s+times\\s*\\{", Pattern.MULTILINE); + m = p.matcher(SCRIPT); + matchFound = m.find(); + while (matchFound&&m.groupCount()>=1) { + nbRepeter++; + SCRIPT= m.replaceFirst(String.valueOf(m.group(1))+"for (var compteurZZ"+nbRepeter+"=0;compteurZZ"+nbRepeter+"<"+String.valueOf(m.group(2))+";compteurZZ"+nbRepeter+"++){"); + m = p.matcher(SCRIPT); + matchFound = m.find(); + } + System.out.println(SCRIPT); + //ITEM.getPanel().Backup(); + JZirkelCanvas.getCurrentZC().getScriptsPanel().Backup(); + setPriority(Thread.MIN_PRIORITY); + start(); + } + + String getSCRIPT() { + return SCRIPT; + } + + String getSCRIPTi() { + return ITEM.getScriptSource(); + } + + /***************************************** + * PARTIE RESERVEE AUX ACTION-SCRIPTS : + *****************************************/ + public void runActionScript() { + if (actionScriptInProgress) { + executeActionScript=true; + } + } + + public void stopActionScript() { + if (actionScriptInProgress) { + busyActionScript=false; + actionScriptInProgress=false; + } + } + + public void prepareActionScript(final String pointName) { + isActionScript=true; + busyActionScript=true; + actionScriptInProgress=true; + SCRIPT=ITEM.getScriptSource().replace("$name", pointName); + ITEM.getPanel().Backup(); + setPriority(Thread.MAX_PRIORITY); + start(); + } + + /*************************************************** + * APPELE UNE SEULE FOIS AU LANCEMENT DE L'APPLI : + ***************************************************/ + static public void InitContextFactory() { + ContextFactory.initGlobal(new ContextFactory() { + + @Override + protected Context makeContext() { + Context cx=super.makeContext(); + cx.setInstructionObserverThreshold(100); + return cx; + } + + @Override + protected void observeInstructionCount(Context cx, int instructionCount) { + ScriptThread th=(ScriptThread) Thread.currentThread(); + while (th.stopme) { + } + if (th.killme) { + Error er=new Error() { + + @Override + public String getMessage() { + return "Script killed..."; + } + }; + throw er; + } + if (th.isActionScript) { + if (th.executeActionScript||!th.busyActionScript) { + Error er=new Error() { + + @Override + public String getMessage() { + return "Action Script killed..."; + } + }; + throw er; + } + } + + } + }); + } +} diff --git a/eric/JSprogram/ScriptsManager.java b/eric/JSprogram/ScriptsManager.java new file mode 100644 index 0000000..06ab68f --- /dev/null +++ b/eric/JSprogram/ScriptsManager.java @@ -0,0 +1,300 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.JSprogram; + +import eric.GUI.ZDialog.ZButton; +import eric.GUI.ZDialog.ZCheckBox; +import eric.GUI.ZDialog.ZDialog; +import eric.GUI.ZDialog.ZLabel; +import eric.GUI.ZDialog.ZSep; +import eric.GUI.ZDialog.ZTextFieldAndLabel; +import eric.GUI.palette.PaletteManager; +import eric.OS; +import java.awt.Color; +import java.awt.event.FocusEvent; +import java.awt.event.FocusListener; +import java.awt.event.KeyEvent; +import javax.swing.DefaultListModel; +import javax.swing.JList; +import javax.swing.ListSelectionModel; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; +import rene.gui.Global; +import rene.zirkel.ZirkelCanvas; + +/** + * + * @author PM Mazat + */ +public class ScriptsManager extends ZDialog implements ListSelectionListener, FocusListener { + + private ZirkelCanvas ZC; + private int SCRIPTS_WIDTH=180, SCRIPTS_HEIGHT, ACTION_WIDTH=110,RENAME_WIDTH=70, BTN_Y; + private ZButton upBTN, downBTN; + private ZTextFieldAndLabel renameFIELD, mousedragFIELD, mouseupFIELD; + private ZCheckBox onstartCKBOX; + private ZSep behaveSEP, renameSEP; + private ZLabel behaveLBL; + private DefaultListModel listModel; + private ScriptItemsArray items=new ScriptItemsArray(); + private JList list; + private ScriptPanel JP; + + public ScriptsManager(ZirkelCanvas zc, ScriptPanel jp, ScriptItemsArray items, int x, int y, int w, int h) { + super(Global.Loc("JSmenu.ScriptsManager"), x, y, w, h, true, true); + ZC=zc; + JP=jp; + this.items=items; + SCRIPTS_HEIGHT=items.size()==1?0:items.size()*18; + BTN_Y=THEIGHT+(SCRIPTS_HEIGHT+(items.size()==2?1:0)*18)/2; + addContent(); + } + + private void addContent() { + upBTN=new ZButton(Global.Loc("JSmenu.up")) { + + @Override + public void action() { + if (list.getSelectedIndex()!=0) { + refreshList(list.getSelectedIndex(), -1); + } + } + }; + upBTN.addFocusListener(this); + + downBTN=new ZButton(Global.Loc("JSmenu.down")) { + + @Override + public void action() { + if (list.getSelectedIndex()!=items.size()-1) { + refreshList(list.getSelectedIndex(), 1); + } + } + }; + downBTN.addFocusListener(this); + if (OS.isUnix()) { + downBTN.setFont(downBTN.getFont().deriveFont(10f)); + } + + behaveSEP=new ZSep(75); + renameSEP=new ZSep(75); +// behaveLBL=new ZLabel("Script behavior :"); + + renameFIELD=new ZTextFieldAndLabel(Global.Loc("JSmenu.rename"), items.get(0).getScriptName(), RENAME_WIDTH, CHEIGHT) { + + @Override + public void actionKey(KeyEvent k){ + int i=list.getSelectedIndex(); + if (i!=-1&&!renameFIELD.getText().isEmpty()) { + items.get(i).setScriptName(renameFIELD.getText()); + listModel.setElementAt(renameFIELD.getText(), i); + } + } + + @Override + public void actionMouse() { + closeScriptTools(); + } + }; + renameFIELD.addFocusListener(this); + + + onstartCKBOX=new ZCheckBox(Global.Loc("JSmenu.executeonstart"), false) { + + @Override + public void action() { +// MAN.setHidefinals(hideFinalBox.isSelected()); + int i=list.getSelectedIndex(); + if (i!=-1&&!renameFIELD.getText().isEmpty()) { + items.get(i).setExecuteOnLoad(onstartCKBOX.isSelected()); + } + } + }; + + mousedragFIELD=new ZTextFieldAndLabel(Global.Loc("JSmenu.dragaction"), "", ACTION_WIDTH, CHEIGHT) { + + @Override + public void actionMouse() { + int i=list.getSelectedIndex(); + if (i!=-1&&!renameFIELD.getText().isEmpty()) { + items.get(i).setMouseDragTool(mousedragFIELD, mouseupFIELD); + } + } + + @Override + public void actionKey(KeyEvent k) { + int i=list.getSelectedIndex(); + if (i!=-1&&!renameFIELD.getText().isEmpty()) { + items.get(i).setMouseDragTargets(getText()); + } + } + }; + + mouseupFIELD=new ZTextFieldAndLabel("On mouse up :", "", ACTION_WIDTH, CHEIGHT) { + + @Override + public void actionMouse() { + int i=list.getSelectedIndex(); + if (i!=-1&&!renameFIELD.getText().isEmpty()) { + items.get(i).setMouseUpTool(mouseupFIELD, mousedragFIELD); + } + } + + @Override + public void actionKey(KeyEvent k) { + int i=list.getSelectedIndex(); + if (i!=-1&&!renameFIELD.getText().isEmpty()) { + items.get(i).setMouseUpTargets(getText()); + } + } + }; + +// mouseoverFIELD=new ZTextFieldAndLabel("Over :", "", RENAME_WIDTH, CHEIGHT) { +// +// @Override +// public void actionMouse() { +// int i=list.getSelectedIndex(); +// if (i!=-1&&!renameFIELD.getText().isEmpty()) { +// items.get(i).setMouseOverTool(mouseoverFIELD); +// } +// } +// +// @Override +// public void actionKey() { +// int i=list.getSelectedIndex(); +// if (i!=-1&&!renameFIELD.getText().isEmpty()) { +// items.get(i).setMouseOverTargets(getText()); +// } +// } +// }; + + + + listModel=new DefaultListModel(); + for (int i=0; i. + + */ +package eric; + +import java.io.IOException; +import java.io.PrintWriter; +import java.net.ServerSocket; +import java.net.Socket; +import java.util.Scanner; +import java.util.logging.Logger; + +import javax.swing.SwingUtilities; + +public class JUniqueInstance { + + private final int port; + private final String message; + + public JUniqueInstance(final int port, final String message) { + assert port>0&&port<1<<16 : "Le port doit être entre 1 et 65535"; + this.port=port; + this.message=message; + } + + public JUniqueInstance(final int port) { + this(port, null); + } + + public boolean launch() { + boolean unique; + + try { + final ServerSocket server=new ServerSocket(port); + unique=true; + final Thread portListenerThread=new Thread() { + + @Override + public void run() { + while (true) { + try { + final Socket socket=server.accept(); + new Thread() { + + @Override + public void run() { + receive(socket); + } + }.start(); + } catch (final IOException e) { + Logger.getLogger("UniqueProgInstance").warning( + "Attente de connexion échouée."); + } + } + } + }; + portListenerThread.setDaemon(true); + portListenerThread.start(); + + } catch (final IOException e) { + unique=false; + // javax.swing.JOptionPane.showMessageDialog(null, + // "launch()->send()"); + send(); + } + return unique; + } + + public void send() { + PrintWriter pw=null; + try { + final Socket socket=new Socket("localhost", port); + pw=new PrintWriter(socket.getOutputStream()); + pw.write(message); + } catch (final IOException e) { + Logger.getLogger("UniqueProgInstance").warning( + "Écriture de sortie échoué."); + } finally { + if (pw!=null) { + pw.close(); + } + } + } + + public synchronized void launchFiles(final String f) { + if (!f.equals("")) { + final String[] files=f.split(System.getProperty("path.separator")); + for (final String filename : files) { + if (FileTools.isStartup()) { + FileTools.addStartupFile(filename); + } else { + SwingUtilities.invokeLater(new Runnable() { + public void run() { + FileTools.open(filename); + } + }); + } + } + } + } + + private synchronized void receive(final Socket socket) { + Scanner sc=null; + + try { + socket.setSoTimeout(5000); + sc=new Scanner(socket.getInputStream()); + final String filename=sc.nextLine(); + + launchFiles(filename); + + } catch (final Exception e) { + // javax.swing.JOptionPane.showMessageDialog(null, + // "receive()->error"); + } finally { + if (sc!=null) { + sc.close(); + } + } + + } +} diff --git a/eric/JZirkelCanvas.java b/eric/JZirkelCanvas.java new file mode 100644 index 0000000..aa8e1ee --- /dev/null +++ b/eric/JZirkelCanvas.java @@ -0,0 +1,781 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric; + +import eric.GUI.palette.PaletteManager; +import eric.GUI.pipe_tools; +import eric.GUI.themes; +import eric.GUI.window.comments; +import eric.GUI.window.tab_main_panel; +import eric.JSprogram.JScriptsLeftPanel; +import eric.macros.MacroTools; +import eric.macros.MacrosList; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Rectangle; +import java.awt.event.MouseAdapter; +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import javax.swing.JOptionPane; +import rene.gui.Global; +import rene.util.FileName; +import rene.zirkel.ZirkelCanvas; +import rene.zirkel.ZirkelFrame; +import rene.zirkel.construction.Construction; +import rene.zirkel.construction.ConstructionDisplayPanel; +import rene.zirkel.dialogs.Replay; +import rene.zirkel.objects.PointObject; + +/** + * + * @author erichake + */ +public class JZirkelCanvas extends JEricPanel { + +// private static ArrayList allJZFs=new ArrayList(); + private ZirkelFrame ZF=null; + private JPointName PointLabel; + private Replay Dreplay; + private static boolean restrictedsession=false; + + // For unused figures in workbooks, store the inputstream in a + // byte array : + private byte[] byteinputfile=null; + private static String workbookFileName=null; + private static JHelpPanel InfoPanel=new JHelpPanel(); + private static MacrosList MacroPanel=null; + private static JScriptsLeftPanel ScriptsLeftPanel = new JScriptsLeftPanel(); + + @Override + public void paintComponent(final java.awt.Graphics g) { + } + + public JZirkelCanvas() { + super(); + setLayout(new BorderLayout()); + setOpaque(true); + ZF=new ZirkelFrame(pipe_tools.isApplet()); + ZF.ZC.addMouseListener(new MouseAdapter() { + + @Override + public void mousePressed(final java.awt.event.MouseEvent evt) { + if (Global.getParameter("smartboard", false)) { + return; + } + PointLabel.getBetterName(null, true); + } + + @Override + public void mouseReleased(final java.awt.event.MouseEvent evt) { + if (!Global.getParameter("smartboard", false)) { + return; + } + PointLabel.getBetterName(null, true); + } + }); + add(ZF.ZC); + newReplay(); + PointLabel=new JPointName(this); + PointObject.setPointLabel(PointLabel); + MacroTools.setDefaultMacros(ZF.ZC); + ZF.ZC.getLocalPreferences(); +// allJZFs.add(this); + } + + public void init() { + Rectangle r=new Rectangle(0, + 0, + pipe_tools.getWindowSize().width-themes.getLeftPanelWidth()-themes.getVerticalPanelBorderWidth()-themes.getTotalRightPanelWidth()-2*themes.getVerticalBorderWidth()-themes.getTabLeftBorderWidth()-themes.getTabRightBorderWidth(), + pipe_tools.getWindowSize().height-themes.getTitleBarHeight()-themes.getMenuBarHeight()-themes.getMainTabPanelHeight()-themes.getCommentsHeight()-themes.getStatusBarHeight()); + setBounds(r); + ZF.ZC.setBounds(r); + ZF.ZC.initRestrictDialog(); + ZF.ZC.initJobCreationDialog(); + ZF.ZC.init_cnt(); + } + + public byte[] getByteArrayInputFile() { + return byteinputfile; + } + + public void createByteArrayInputFile(InputStream in) { + if (byteinputfile==null) { + byteinputfile=FileTools.copyToByteArray(in); + } + } + + public void setInputFile(InputStream in) { + if (in!=null) { + createByteArrayInputFile(in); + } + } + + public void setInputFile(byte[] in) { + byteinputfile=in; + } + + public static void getCurrentLocalPreferences() { + if (getCurrentZC()!=null) { + getCurrentZC().getLocalPreferences(); + } + } + + + + public void onTabActivate() { + if (byteinputfile!=null) { + FileTools.openFile("", new ByteArrayInputStream(byteinputfile), 0); + byteinputfile=null; + } + ZF.ZC.setLocalPreferences(); + PointObject.setPointLabel(PointLabel); + ZF.ZC.updateDigits(); + ZF.ZC.paint(ZF.ZC.getGraphics()); + PaletteManager.refresh(); + } + + public static boolean isWorkBook() { + return (workbookFileName!=null); + } + + public static String getWorkBookFileName() { + return workbookFileName; + } + + public static String getFileName(){ + try{ + if (isWorkBook()){ + return getWorkBookFileName(); + }else{ + return getCurrentZF().Filename; + } + }catch(Exception e){ + return null; + } + } + + public static void setWorkBookFileName(String s, boolean force) { + if ((force)||(workbookFileName==null)) { + workbookFileName=s; + if (!pipe_tools.isApplet()){ + pipe_tools.setTitle(Global.Loc("program.name")+" - "+Global.Loc("workbook.workbookmode")+" : "+FileName.filename(s)); + pipe_tools.TabHaveChanged(false); + } + } + } + + public static boolean isRestrictedSession() { + return restrictedsession; + } + + public Replay getReplay() { + return Dreplay; + } + + public void disposeReplay() { + Dreplay.dispose(); + } + + public void newReplay() { + Dreplay=new Replay(null, ZF.ZC); + } + + public JPointName getPointLabel() { + return PointLabel; + } + + public ZirkelFrame getZF() { + return ZF; + } + + public ZirkelCanvas getZC() { + return ZF.ZC; + } + + + + public static String ToolTip(final String s) { + String ToolTipText=""; + final String purename=(s.startsWith("bi_"))?s.substring(3):s; + try { + ToolTipText=Global.Loc("palette.info."+purename); + } catch (final Exception e1) { + try { + ToolTipText=Global.Loc("palette.info."+s); + } catch (final Exception e2) { + ToolTipText=rene.gui.Global.name("iconhelp."+purename); + } + } + + return ToolTipText; + } + + public static String FilteredStatus(final String status) { + String newstatus=status; + int index; + if ((index=status.indexOf("@builtin@/DP_line"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/DP_line\\E", + Global.Loc("palette.info.DP_line")); + } + + + + + + else if ((index=status.indexOf("@builtin@/DP_midpoint"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/DP_midpoint\\E", + Global.Loc("palette.info.DP_midpoint")); + } + + else if ((index=status.indexOf("@builtin@/DP_bi_syma"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/DP_bi_syma\\E", + Global.Loc("palette.info.DP_bi_syma")); + } + + else if ((index=status.indexOf("@builtin@/DP_bi_symc"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/DP_bi_symc\\E", + Global.Loc("palette.info.DP_bi_symc")); + } + + else if ((index=status.indexOf("@builtin@/DP_plumb"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/DP_plumb\\E", + Global.Loc("palette.info.DP_plumb")); + } + + else if ((index=status.indexOf("@builtin@/DP_bi_med"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/DP_bi_med\\E", + Global.Loc("palette.info.DP_bi_med")); + } + + else if ((index=status.indexOf("@builtin@/DP_bi_biss"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/DP_bi_biss\\E", + Global.Loc("palette.info.DP_bi_biss")); + } + + else if ((index=status.indexOf("@builtin@/DP_segment"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/DP_segment\\E", + Global.Loc("palette.info.DP_segment")); + } + + else if ((index=status.indexOf("@builtin@/DP_ray"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/DP_ray\\E", + Global.Loc("palette.info.DP_ray")); + } + + else if ((index=status.indexOf("@builtin@/DP_angle"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/DP_angle\\E", + Global.Loc("palette.info.DP_angle")); + } + + else if ((index=status.indexOf("@builtin@/DP_circle"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/DP_circle\\E", + Global.Loc("palette.info.DP_circle")); + } + + else if ((index=status.indexOf("@builtin@/DP_bi_distance"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/DP_bi_distance\\E", + Global.Loc("palette.info.DP_bi_distance")); + } + + else if ((index=status.indexOf("@builtin@/DP_bi_lineIP"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/DP_bi_lineIP\\E", + Global.Loc("palette.info.DP_bi_lineIP")); + } + + else if ((index=status.indexOf("@builtin@/DP_bi_perp_common"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/DP_bi_perp_common\\E", + Global.Loc("palette.info.DP_bi_perp_common")); + } + + else if ((index=status.indexOf("@builtin@/DP_bi_pinceau1"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/DP_bi_pinceau1\\E", + Global.Loc("palette.info.DP_bi_pinceau1")); + } + + else if ((index=status.indexOf("@builtin@/DP_bi_pinceau3"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/DP_bi_pinceau3\\E", + Global.Loc("palette.info.DP_bi_pinceau3")); + } + + else if ((index=status.indexOf("@builtin@/DP_bi_pinceauinter"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/DP_bi_pinceauinter\\E", + Global.Loc("palette.info.DP_bi_pinceauinter")); + } + + else if ((index=status.indexOf("@builtin@/DP_bi_pinceauhauteur"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/DP_bi_pinceauhauteur\\E", + Global.Loc("palette.info.DP_bi_pinceauhauteur")); + } + + else if ((index=status.indexOf("@builtin@/DP_bi_pinceaucycle"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/DP_bi_pinceaucycle\\E", + Global.Loc("palette.info.DP_bi_pinceaucycle")); + } + + else if ((index=status.indexOf("@builtin@/DP_bi_pinceaubiss"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/DP_bi_pinceaubiss\\E", + Global.Loc("palette.info.DP_bi_pinceaubiss")); + } + + else if ((index=status.indexOf("@builtin@/DP_bi_equidistante"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/DP_bi_equidistante\\E", + Global.Loc("palette.info.DP_bi_equidistante")); + } + + else if ((index=status.indexOf("@builtin@/DP_bi_horocycle"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/DP_bi_horocycle\\E", + Global.Loc("palette.info.DP_bi_horocycle")); + } + + else if ((index=status.indexOf("@builtin@/DP_fixedangle"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/DP_fixedangle\\E", + Global.Loc("palette.info.DP_fixedangle")); + } + + else if ((index=status.indexOf("@builtin@/DP_bi_circ"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/DP_bi_circ\\E", + Global.Loc("palette.info.DP_bi_circ")); + } + + + + else if ((index=status.indexOf("@builtin@/syma"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/syma\\E", + Global.Loc("palette.info.bi_syma")); + } else if ((index=status.indexOf("@builtin@/symc"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/symc\\E", + Global.Loc("palette.info.bi_symc")); + } else if ((index=status.indexOf("@builtin@/trans"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/trans\\E", + Global.Loc("palette.info.bi_trans")); + } else if ((index=status.indexOf("@builtin@/med"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/med\\E", + Global.Loc("palette.info.bi_med")); + } else if ((index=status.indexOf("@builtin@/biss"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/biss\\E", + Global.Loc("palette.info.bi_biss")); + } else if ((index=status.indexOf("@builtin@/circ"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/circ\\E", + Global.Loc("palette.info.bi_circ")); + } else if ((index=status.indexOf("@builtin@/arc"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/arc\\E", + Global.Loc("palette.info.bi_arc")); + } else if ((index=status.indexOf("@builtin@/function_u"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/function_u\\E", + ToolTip("bi_function_u")); + } else if ((index=status.indexOf("@builtin@/t_align"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/t_align\\E", + Global.Loc("palette.info.bi_t_align")); + } else if ((index=status.indexOf("@builtin@/t_para"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/t_para\\E", + Global.Loc("palette.info.bi_t_para")); + } else if ((index=status.indexOf("@builtin@/t_perp"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/t_perp\\E", + Global.Loc("palette.info.bi_t_perp")); + } else if ((index=status.indexOf("@builtin@/t_equi"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/t_equi\\E", + Global.Loc("palette.info.bi_t_equi")); + } else if ((index=status.indexOf("@builtin@/t_app"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/t_app\\E", + Global.Loc("palette.info.bi_t_app")); + } else if ((index=status.indexOf("@builtin@/t_conf"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/t_conf\\E", + Global.Loc("palette.info.bi_t_conf")); + } else if ((index=status.indexOf("@builtin@/3Dcoords"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/3Dcoords\\E", + Global.Loc("palette.info.bi_3Dcoords")); + } else if ((index=status.indexOf("@builtin@/3Dcube"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/3Dcube\\E", + Global.Loc("palette.info.bi_3Dcube")); + } else if ((index=status.indexOf("@builtin@/3Darete"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/3Darete\\E", + Global.Loc("palette.info.bi_3Darete")); + } else if ((index=status.indexOf("@builtin@/3Dtetra"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/3Dtetra\\E", + Global.Loc("palette.info.bi_3Dtetra")); + } else if ((index=status.indexOf("@builtin@/3Docta"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/3Docta\\E", + Global.Loc("palette.info.bi_3Docta")); + } else if ((index=status.indexOf("@builtin@/3Disoc"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/3Disoc\\E", + Global.Loc("palette.info.bi_3Disoc")); + } else if ((index=status.indexOf("@builtin@/3Ddode"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/3Ddode\\E", + Global.Loc("palette.info.bi_3Ddode")); + } else if ((index=status.indexOf("@builtin@/3Dsymp"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/3Dsymp\\E", + Global.Loc("palette.info.bi_3Dsymp")); + } else if ((index=status.indexOf("@builtin@/3Dproj"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/3Dproj\\E", + Global.Loc("palette.info.bi_3Dproj")); + } else if ((index=status.indexOf("@builtin@/3Dsymc"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/3Dsymc\\E", + Global.Loc("palette.info.bi_3Dsymc")); + } else if ((index=status.indexOf("@builtin@/3Dtrans"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/3Dtrans\\E", + Global.Loc("palette.info.bi_3Dtrans")); + } else if ((index=status.indexOf("@builtin@/3Dcircle1"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/3Dcircle1\\E", + Global.Loc("palette.info.bi_3Dcircle1")); + } else if ((index=status.indexOf("@builtin@/3Dcircle2"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/3Dcircle2\\E", + Global.Loc("palette.info.bi_3Dcircle2")); + } else if ((index=status.indexOf("@builtin@/3Dcircle3pts"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/3Dcircle3pts\\E", + Global.Loc("palette.info.bi_3Dcircle3pts")); + } else if ((index=status.indexOf("@builtin@/3Dplandroite"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/3Dplandroite\\E", + Global.Loc("palette.info.bi_3Dplandroite")); + } else if ((index=status.indexOf("@builtin@/3Dplanplan"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/3Dplanplan\\E", + Global.Loc("palette.info.bi_3Dplanplan")); + } else if ((index=status.indexOf("@builtin@/3Dsphererayon"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/3Dsphererayon\\E", + Global.Loc("palette.info.bi_3Dsphererayon")); + } else if ((index=status.indexOf("@builtin@/3Dspherepoint"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/3Dspherepoint\\E", + Global.Loc("palette.info.bi_3Dspherepoint")); + } else if ((index=status.indexOf("@builtin@/3Dspheredroite"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/3Dspheredroite\\E", + Global.Loc("palette.info.bi_3Dspheredroite")); + } else if ((index=status.indexOf("@builtin@/3Dsphereplan"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/3Dsphereplan\\E", + Global.Loc("palette.info.bi_3Dsphereplan")); + } else if ((index=status.indexOf("@builtin@/3Dspheresphere"))>0) { + newstatus=newstatus.substring(index); + newstatus=newstatus.replaceAll("\\Q@builtin@/3Dspheresphere\\E", + Global.Loc("palette.info.bi_3Dspheresphere")); + } + + return newstatus; + } + + public static boolean workbookHaveChanged() { + boolean changed=false; + for (int i=0; i medias=new ArrayList(); + + private Media(String name, byte[] datas) { + imagefilename=name; + imagebytes=datas; + } + + private Media(String name, InputStream in) { + this(name, FileTools.copyToByteArray(in)); + } + + public String getImageFileName(){ + return imagefilename; + } + + public byte[] getImageBytes(){ + return imagebytes; + } + + static public ArrayList getMedias(){ + return medias; + } + + public static void clearMedias() { + medias=null; + medias=new ArrayList(); + } + + static public void createMedia(String name, byte[] datas) { + medias.add(new Media(name, datas)); + } + + static public void createMedia(String filename) { + String shortname=FileName.filename(filename); + for (int i=0; i=0; i--){ + compt = 0; + e = JZirkelCanvas.getCurrentZC().getConstruction().elements(); + while(e.hasMoreElements() && compt==0){ + ConstructionObject o = (ConstructionObject) e.nextElement(); + if(o instanceof ImageObject && ((ImageObject) o).getFilename().equals(medias.get(i).getImageFileName())){ + compt++; + } + } + if(compt==0) { + medias.remove(i); + } + } + + return medias.size(); + } + + static public Image getImage(String name) { + String shortname=FileName.filename(name); + for (int i=0; id) { + h=(int) d; + } + Thread.sleep((int) (d-h)); + time=System.currentTimeMillis(); + } catch (final Exception ex) { + } + if (P.getBound() instanceof SegmentObject) { + final SegmentObject s=(SegmentObject) P.getBound(); + synchronized (canvas) { + if (back) { + O.move(s.getP1().getX()+(s.getLength()-x) + *s.getDX(), s.getP1().getY() + +(s.getLength()-x)*s.getDY()); + } else { + O.move(s.getP1().getX()+x*s.getDX(), s.getP1().getY() + +x*s.getDY()); + } + ZC.dovalidate(); + ZC.repaint(); + x+=ZC.dx(2); + if (x>s.getLength()) { + back=!back; + x=0; + } + } + } else if (P.getBound() instanceof PrimitiveCircleObject) { + final PrimitiveCircleObject c=(PrimitiveCircleObject) P.getBound(); + synchronized (canvas) { + O.move(c.getP1().getX()+Math.cos(x) + *c.getR(), c.getP1().getY() + +Math.sin(x)*c.getR()); + ZC.dovalidate(); + ZC.repaint(); + if (Negative) { + x-=ZC.dx(2)/c.getR(); + } else { + x+=ZC.dx(2)/c.getR(); + } + } + } + } + TH=null; + } + }; + TH.setPriority(Thread.MIN_PRIORITY); + TH.start(); + } + + public void initSlidersParameters(ExpressionObject E) { + min=E.getMinValue(); + max=E.getMaxValue(); + positiveincrement=(max-min)/parts; + } + + public void runExpression() { + TH=new Thread() { + + public void run() { + + final ZirkelCanvas canvas=ZC; + ExpressionObject E=(ExpressionObject) O; + double x; + try { + x = E.getValue(); + } catch (Exception ex) { + x=0; + } + double increment=1; + + + long time=System.currentTimeMillis(); + while ((!PANEL.isStopped())&&(thread_alive)) { + + try { + final long t=System.currentTimeMillis(); + double d=PANEL.getDelay(); + int h=(int) (t-time); + if (h<0) { + h=0; + } + if (h>d) { + h=(int) d; + } + Thread.sleep((int) (d-h)); + time=System.currentTimeMillis(); + } catch (final Exception ex) { + } + try { + synchronized (canvas) { + if (E.isSlider()) { + initSlidersParameters(E); + if (Negative) { + if (x>max) { + x=min; + } else { + x+=positiveincrement; + } + } else { + if (x>max) { + x=max; + increment=-positiveincrement; + } else if (x V=new Vector(); + private static Image icon=themes.getImage("animation.png"); + private int W=32, H=32, X=10, Y=47; + private int minspeed=0; + private int maxspeed=100; + private int speed=40; + private boolean stopped=false; + private double a, b, A1, A2, B2; + + public void paintComponent(Graphics g) { + g.drawImage(icon, 0, 0, W, H, this); + } + + public int getMaxSpeed() { + return maxspeed; + } + + public AnimationPanel(ZirkelCanvas zc) { + ZC=zc; + setBounds(X, Y, W, H); + addMouseListener(this); + + a=maxspeed/10; + b=maxspeed-10; + A1=b/a; + A2=(maxspeed-b)/(maxspeed-a); + B2=maxspeed*(b-a)/(maxspeed-a); + } + + public double getDelay() { + int cur=speed; + double v; + if (cur>a) { + v=A2*cur+B2; + } else { + v=A1*cur; + } + double d=(maxspeed-v)*6; + return d; + } + + public void setDelay(double delay) { + double cur=maxspeed-delay/6; + if (cur>b) { + speed=(int) ((cur-B2)/A2); + } else { + speed=(int) (cur/A1); + } + } + + public void showPopup() { + JPopupMenu popup=new JPopupMenu(); + // add Cancel Item : + myJMenuItem item=new myJMenuItem(Global.Loc("animation.run")) { + + @Override + public void action() { + startAnimation(); + } + }; + popup.add(item); + + item=new myJMenuItem(Global.Loc("animation.stop")) { + + @Override + public void action() { + stopAnimation(); + } + }; + popup.add(item); + item=new myJMenuItem(Global.Loc("animation.reverse")) { + + @Override + public void action() { + reverseAnimation(); + } + }; + popup.add(item); + + popup.add(new JSeparator()); + + item=new myJMenuItem(Global.Loc("animation.removeall")) { + + @Override + public void action() { + removeAllAnimations(); + } + }; + popup.add(item); + popup.add(new JSeparator()); + + + popup.add(new SpeedSliderMenuItem()); + + + + + popup.show(this, W-10, H); + } + + public Vector getAnimations() { + return V; + } + + public void reverseAnimation() { + for (int i=0; iV3I2mnt58p3dsbTw(h{uH)^mQKKfoX0|IjzPOR<|q z(1VD~!0g+Pd9%AOA)5st-R0de&;ih*D<*9g8%)R5E0%gD;m6f47F;z)AuAKBRQT zEMV!;eL7gUD*&;{ZfC6PT|zl&z${?tks~zmRHCO!xMGN>vp)@SS-{exr$fT!L&D4w zZYbhrXa3ZMLo$z6ngXW4x&jT~?CAM_T7UmvCt1rBFa`dV0@CaadR=ZQoUN73=~. + + */ +package eric.bar; + +import eric.JZirkelCanvas; +import java.awt.Color; +import java.awt.Component; +import java.awt.event.FocusAdapter; +import java.awt.event.FocusEvent; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +import javax.swing.BorderFactory; +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JOptionPane; +import eric.JEricPanel; +import javax.swing.JScrollPane; +import javax.swing.JTextArea; +import javax.swing.ScrollPaneConstants; +import javax.swing.event.PopupMenuEvent; +import javax.swing.event.PopupMenuListener; + +import eric.controls.JCanvasButton; +import eric.controls.JCanvasPanel; +import eric.controls.JCanvasPopup; +import eric.controls.JCanvasSlider; +import eric.controls.JCanvasTxtfield; +import eric.textfieldpopup.JTextFieldPopup; + +/** + * + * @author erichake + */ +public class JControlProperties extends JProperties { + + /** + * + */ + + JCanvasPanel JCP; + myJSliderShowTicks jsShowTicks; + myJSliderSnapTicks jsSnapTicks; + myJSliderMin jsMin; + myJSliderMax jsMax; + myJSliderTicks jsTicks; + myJComment jsComment; + myJSliderUnit jsUnit; + myJSliderShowComment jsShowcom; + myJSliderShowVal jsShowval; + myJSliderShowUnit jsShowunit; + myJPopupItems jsPopupitems; + + public JControlProperties(final int w, final int h) { + super(w, h); + jsShowTicks=new myJSliderShowTicks(Loc("ctrlshowticks"), true, 200, + TextFieldHeight); + jsSnapTicks=new myJSliderSnapTicks(Loc("ctrlsnap"), true, 200, + TextFieldHeight); + jsMin=new myJSliderMin("min:", "", 50, 150, TextFieldHeight); + jsMax=new myJSliderMax("max:", "", 50, 150, TextFieldHeight); + jsTicks=new myJSliderTicks(Loc("ctrltickspacing"), "", 100, 200, + TextFieldHeight); + jsComment=new myJComment(Loc("expl"), "", 100, 250, TextFieldHeight); + jsUnit=new myJSliderUnit(Loc("unit"), "", 100, 250, TextFieldHeight); + jsShowcom=new myJSliderShowComment("", true, 18, TextFieldHeight); + jsShowval=new myJSliderShowVal(Loc("ctrlshowvalue"), true, 200, + TextFieldHeight); + jsShowunit=new myJSliderShowUnit("", true, 18, TextFieldHeight); + jsPopupitems=new myJPopupItems("", 250, TextFieldHeight*3+2); + } + + public void setObject(final JCanvasPanel jcp) { + if (JZirkelCanvas.getCurrentZF()==null) { + return; + } + ZF=JZirkelCanvas.getCurrentZF(); + ZC=JZirkelCanvas.getCurrentZC(); + JCP=jcp; + //O=JCP.O; + setObject(JCP.O); + + Cn=ZC.getConstruction(); + this.clearAll(); + addName(); + addCommonProps(); + addJSliderProps(); + addJPopupProps(); + addConditionals(); + selectTab(1); + this.revalidate(); + this.repaint(); + } + + private void addName() { + final JEricPanel rubname=new myRub(); + name.init(); + rubname.add(name); + addMain(margin(5)); + addMain(rubname); + addMain(margin(5)); + final JEricPanel rub=new myRub(); + addMain(rub); + } + + private void addCommonProps() { + jsComment.init(); + jsUnit.init(); + jsShowcom.init(); + jsShowval.init(); + jsShowunit.init(); + final ContentLine l1=new ContentLine(); + l1.add(jsShowcom); + l1.add(jsComment); + final ContentLine l2=new ContentLine(); + l2.add(jsShowunit); + l2.add(jsUnit); + final JEricPanel rub4=new myRub(); + rub4.add(margintop(2)); + rub4.add(l1); + if ((JCP instanceof JCanvasTxtfield)||(JCP instanceof JCanvasButton)) { + rub4.add(margintop(jsShowval.H*2+2)); + } else { + rub4.add(margintop(1)); + rub4.add(l2); + rub4.add(margintop(1)); + rub4.add(jsShowval); + } + addToNum(rub4); + addToNum(new myRubSep()); + } + + private void addJSliderProps() { + if (!(JCP instanceof JCanvasSlider)) { + return; + } + + jsShowTicks.init(); + jsSnapTicks.init(); + jsMin.init(); + jsMax.init(); + jsTicks.init(); + final JEricPanel rub1=new myRub(); + rub1.add(margintop(2)); + rub1.add(jsTicks); + rub1.add(margintop(1)); + rub1.add(jsSnapTicks); + rub1.add(margintop(1)); + rub1.add(jsShowTicks); + + addToNum(rub1); + addToNum(new myRubSep()); + + final JEricPanel rub2=new myRub(); + rub2.add(margintop(2)); + rub2.add(jsMin); + rub2.add(margintop(jsMin.H+2)); + rub2.add(jsMax); + + addToNum(rub2); + + } + + private void addJPopupProps() { + if (!(JCP instanceof JCanvasPopup)) { + return; + } + final JEricPanel rub2=new myRub(); + rub2.add(margintop(2)); + jsPopupitems.init(); + rub2.add(jsPopupitems); + addToNum(rub2); + } + + private void addConditionals() { + final JEricPanel rub=new myRub(); + chidden.init(); + csuperhidden.init(); + rub.add(margintop(1)); + rub.add(chidden); + rub.add(margintop(2*chidden.H+3)); + + addToConditional(rub); + + } + + // class myJSliderName extends myJLine { + // + // public myJSliderName(String comment, String txt, int comwidth, int width, + // int height) { + // super(comment, txt, comwidth, width, height); + // this.JTF.setHorizontalAlignment(SwingConstants.CENTER); + // + // } + // + // public void doAction(Component e) { + // JTextField jtf = (JTextField) e; + // if (O.getName().equals(jtf.getText())) { + // return; + // } + // O.setName(jtf.getText()); + // O.setShowName(true); + // show.forceSelect(2); // Force the ShowName icon to be selected + // if (ZC != null) { + // ZC.repaint(); + // } + // } + // + // public void init() { + // setText(O.getName()); + // } + // } + class myJComment extends myJLine { + + /** + * + */ + + + public myJComment(final String comment, final String txt, + final int comwidth, final int width, final int height) { + super(comment, txt, comwidth, width, height, true); + carPopup.setDisabled(","+JTextFieldPopup.LATEXMENU+","+JTextFieldPopup.FUNCTIONMENU+","); + } + + @Override + public void doAction(final Component e) { + + JCP.setComment(getText()); + } + + public void init() { + setText(JCP.getComment()); + } + } + + class myJSliderUnit extends myJLine { + + /** + * + */ + + + public myJSliderUnit(final String comment, final String txt, + final int comwidth, final int width, final int height) { + super(comment, txt, comwidth, width, height, true); + carPopup.setDisabled(","+JTextFieldPopup.LATEXMENU+","+JTextFieldPopup.FUNCTIONMENU+","); + } + + @Override + public void doAction(final Component e) { + + JCP.setUnit(getText()); + } + + public void init() { + setText(JCP.getUnit()); + } + } + + class myJSliderShowComment extends myJLine { + + /** + * + */ + + + public myJSliderShowComment(final String comment, final boolean bool, + final int width, final int height) { + super(comment, bool, width, height); + } + + @Override + public void doAction(final Component e) { + JCP.setShowComment(!isSelected()); + + } + + public void init() { + setSelected(JCP.getShowComment()); + } + } + + class myJSliderShowVal extends myJLine { + + /** + * + */ + + + public myJSliderShowVal(final String comment, final boolean bool, + final int width, final int height) { + super(comment, bool, width, height); + } + + @Override + public void doAction(final Component e) { + JCP.setShowVal(!isSelected()); + + } + + public void init() { + setSelected(JCP.getShowVal()); + } + } + + class myJSliderShowUnit extends myJLine { + + /** + * + */ + + + public myJSliderShowUnit(final String comment, final boolean bool, + final int width, final int height) { + super(comment, bool, width, height); + } + + @Override + public void doAction(final Component e) { + JCP.setShowUnit(!isSelected()); + + } + + public void init() { + setSelected(JCP.getShowUnit()); + } + } + + class myJSliderShowTicks extends myJLine { + + /** + * + */ + + + public myJSliderShowTicks(final String comment, final boolean bool, + final int width, final int height) { + super(comment, bool, width, height); + } + + @Override + public void doAction(final Component e) { + ((JCanvasSlider) JCP).setShowTicks(!isSelected()); + + } + + public void init() { + setSelected(((JCanvasSlider) JCP).getShowTicks()); + } + } + + class myJSliderSnapTicks extends myJLine { + + /** + * + */ + + + public myJSliderSnapTicks(final String comment, final boolean bool, + final int width, final int height) { + super(comment, bool, width, height); + } + + @Override + public void doAction(final Component e) { + ((JCanvasSlider) JCP).setSnap(!isSelected()); + + } + + public void init() { + setSelected(((JCanvasSlider) JCP).getSnap()); + } + } + + class myJSliderMin extends myJLine { + + /** + * + */ + + String current; + String origin; + + public myJSliderMin(final String comment, final String txt, + final int comwidth, final int width, final int height) { + super(comment, txt, comwidth, width, height); + } + + @Override + public void doAction(final Component e) { + if ((current.equals(getText()))||(!(isValidExpression(getText())))) { + return; + } + + current=getText(); + + } + + @Override + public void doQuitMe(final Component e) { + if (!(isValidExpression(getText()))) { + JOptionPane.showMessageDialog(null, Loc("error")); + ((JCanvasSlider) JCP).setMin(ValueOf(origin)); + setText(origin); + JTF.requestFocus(); + return; + } + current=getText(); + ((JCanvasSlider) JCP).setMin(ValueOf(current)); + jsMax.setText(((JCanvasSlider) JCP).getMax()); + } + + public void init() { + current=String.valueOf(((JCanvasSlider) JCP).getMin()); + origin=current; + setText(current); + System.out.println(JTF.getText()); + } + } + + class myJSliderMax extends myJLine { + + /** + * + */ + + String current; + String origin; + + public myJSliderMax(final String comment, final String txt, + final int comwidth, final int width, final int height) { + super(comment, txt, comwidth, width, height); + } + + @Override + public void doAction(final Component e) { + if ((current.equals(getText()))||(!(isValidExpression(getText())))) { + return; + } + + current=getText(); + + } + + @Override + public void doQuitMe(final Component e) { + if (!(isValidExpression(getText()))) { + JOptionPane.showMessageDialog(null, Loc("error")); + ((JCanvasSlider) JCP).setMax(ValueOf(origin)); + setText(origin); + JTF.requestFocus(); + return; + } + current=getText(); + ((JCanvasSlider) JCP).setMax(ValueOf(current)); + jsMin.setText(((JCanvasSlider) JCP).getMin()); + + } + + public void init() { + current=String.valueOf(((JCanvasSlider) JCP).getMax()); + origin=current; + setText(current); + } + } + + class myJSliderTicks extends myJLine { + + /** + * + */ + + String current, origin; + + public myJSliderTicks(final String comment, final String txt, + final int comwidth, final int width, final int height) { + super(comment, txt, comwidth, width, height); + } + + @Override + public void doAction(final Component e) { + if ((current.equals(getText()))||(!(isValidExpression(getText())))) { + return; + } + + current=getText(); + ((JCanvasSlider) JCP).setTicks(ValueOf(current)); + } + + @Override + public void doQuitMe(final Component e) { + if (!(isValidExpression(getText()))) { + JOptionPane.showMessageDialog(null, Loc("error")); + ((JCanvasSlider) JCP).setTicks(ValueOf(origin)); + setText(origin); + return; + } + current=getText(); + ((JCanvasSlider) JCP).setTicks(ValueOf(current)); + } + + public void init() { + current=String.valueOf(((JCanvasSlider) JCP).getTicks()); + origin=current; + setText(current); + + } + } + + class txtfieldTemplate extends myJLine { + + /** + * + */ + + + public txtfieldTemplate(final String comment, final String txt, + final int comwidth, final int width, final int height) { + super(comment, txt, comwidth, width, height, true); + } + + @Override + public void doAction(final Component e) { + } + + @Override + public void doQuitMe(final Component e) { + } + + public void init() { + } + } + + class myJPopupItems extends ContentLine { + + /** + * + */ + + JButton carBTN=null; + JTextArea JTX; + + public myJPopupItems(final String mytxt, final int width, + final int height) { + super(width, height); + this.setFocusable(false); + this.add(margin(5)); + JTX=new JTextArea(mytxt); + JTX.setFont(F_TextArea); + JTX.setBackground(new Color(245, 246, 255)); + // JTX.setBorder(BorderFactory.createEtchedBorder()); + + JTX.addKeyListener(new KeyAdapter() { + + @Override + public void keyReleased(final KeyEvent e) { + doAction(e.getComponent()); + } + }); + JTX.addFocusListener(new FocusAdapter() { + + @Override + public void focusGained(final FocusEvent e) { + // JTX.selectAll(); + carBTN.setEnabled(true); + } + + @Override + public void focusLost(final FocusEvent e) { + carBTN.setEnabled(false); + doQuitMe(e.getComponent()); + } + }); + JTX.setLineWrap(true); + + // + final JScrollPane jstxt=new JScrollPane(JTX); + jstxt.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); + jstxt.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); + + // jstxt.setViewportView(JTX); + // fixsize(jstxt,PW-11,h); + this.add(jstxt); + final ImageIcon carimg=new ImageIcon(getClass().getResource( + "/eric/GUI/icons/bar/carbtn.png")); + final ImageIcon carimg_dis=new ImageIcon(getClass().getResource( + "/eric/GUI/icons/bar/carbtn_dis.png")); + carBTN=new JButton(carimg); + carBTN.setDisabledIcon(carimg_dis); + // carbtn.setRolloverIcon(closeoverimg); + carBTN.setBorder(BorderFactory.createEmptyBorder()); + carBTN.setOpaque(false); + carBTN.setContentAreaFilled(false); + carBTN.setFocusable(false); + carBTN.addMouseListener(new MouseAdapter() { + + @Override + public void mousePressed(final MouseEvent e) { + doShowPopup(e); + } + }); + carBTN.setEnabled(false); + + this.add(margin(2)); + this.add(carBTN); + } + + public void doShowPopup(final MouseEvent e) { + if (carBTN.isEnabled()) { + final JTextFieldPopup mypop=new JTextFieldPopup(JTX); + mypop.setDisabled(","+JTextFieldPopup.LATEXMENU+","+JTextFieldPopup.FUNCTIONMENU+","); + mypop.addPopupMenuListener(new PopupMenuListener() { + + public void popupMenuWillBecomeVisible( + final PopupMenuEvent arg0) { + } + + public void popupMenuWillBecomeInvisible( + final PopupMenuEvent arg0) { + doAction(JTX); + } + + public void popupMenuCanceled(final PopupMenuEvent arg0) { + } + }); + mypop.openMenu(e); + } + } + + public void setText(final String txt) { + JTX.setText(txt); + } + + public String getText() { + return JTX.getText(); + } + + public void doAction(final Component cp) { + if (getObject().getText().equals(getText())) { + return; + } + ((JCanvasPopup) JCP).setItems(getText()); + // O.setLines(getText()); + // O.setText(getText(), true); + // ZC.recompute(); + // ZC.validate(); + // ZC.repaint(); + } + + public void doQuitMe(final Component cp) { + } + + public void init() { + // setText(O.getLines()); + setText(((JCanvasPopup) JCP).getItems()); + } + } +} diff --git a/eric/bar/JProperties.java b/eric/bar/JProperties.java new file mode 100644 index 0000000..a54e865 --- /dev/null +++ b/eric/bar/JProperties.java @@ -0,0 +1,5315 @@ +/* +Copyright 2006 Eric Hakenholz +This file is part of C.a.R. software. +C.a.R. is a free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 3 of the License. +C.a.R. is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. +You should have received a copy of the GNU General Public License +along with this program. If not, see . + */ +package eric.bar; + +import java.awt.AlphaComposite; +import java.awt.BasicStroke; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.Graphics2D; +import java.awt.KeyboardFocusManager; +import java.awt.RenderingHints; +import java.awt.Stroke; +import java.awt.event.FocusAdapter; +import java.awt.event.FocusEvent; +import java.awt.event.InputEvent; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import java.awt.event.KeyListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.net.URL; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Vector; + +import javax.swing.BorderFactory; +import javax.swing.BoxLayout; +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JComboBox; +import javax.swing.JComponent; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JScrollPane; +import javax.swing.JTextArea; +import javax.swing.JTextField; +import javax.swing.KeyStroke; +import javax.swing.ScrollPaneConstants; +import javax.swing.SwingConstants; +import javax.swing.SwingUtilities; +import javax.swing.event.PopupMenuEvent; +import javax.swing.event.PopupMenuListener; +import javax.swing.plaf.ComboBoxUI; +import javax.swing.plaf.ComponentUI; +import javax.swing.plaf.metal.MetalComboBoxUI; +import javax.swing.text.JTextComponent; + +import eric.JColorPicker; +import eric.JEricPanel; +import eric.JZirkelCanvas; +import eric.GUI.palette.PaletteManager; +import eric.textfieldpopup.JTextFieldPopup; +import rene.gui.Global; +import rene.zirkel.ZirkelCanvas; +import rene.zirkel.ZirkelFrame; +import rene.zirkel.construction.Construction; +import rene.zirkel.construction.ConstructionException; +import rene.zirkel.expression.Expression; +import rene.zirkel.objects.AngleObject; +import rene.zirkel.objects.ConstructionObject; +import rene.zirkel.objects.EquationXYObject; +import rene.zirkel.objects.FixedAngleObject; +import rene.zirkel.objects.FunctionObject; +import rene.zirkel.objects.InsideObject; +import rene.zirkel.objects.IntersectionObject; +import rene.zirkel.objects.MidpointObject; +import rene.zirkel.objects.PointObject; +import rene.zirkel.objects.PrimitiveCircleObject; +import rene.zirkel.objects.SegmentObject; +import rene.zirkel.objects.TrackObject; +import rene.zirkel.objects.UserFunctionObject; +import rene.zirkel.objects.VectorObject; + +/** + * + * @author erichake with addons by Dibs for 3D + */ +public class JProperties extends JTabPanel { + + Construction Cn=null; + private static ConstructionObject O=null; + ZirkelCanvas ZC=null; + ZirkelFrame ZF=null; + private static String typecode; + Color C_TextField=new Color(50, 50, 50); + Color C_TextField_OFF=new Color(150, 150, 150); + Color C_Comment=new Color(0, 0, 0); + int HRubSeparatorHeight=40; + int HRubSeparatorWidth=40; + int TextFieldHeight=17; + int TextFontSize=12; +// String GlobalFontName=JGlobals.GlobalFont; + String GlobalFontName="System"; + Font F_TextField=new Font(GlobalFontName, 0, TextFontSize); + Font F_NameField=new Font(GlobalFontName, 1, 12); + Font F_ConditionalField=new Font(GlobalFontName, 0, 10); + Font F_Label=new Font(GlobalFontName, 0, TextFontSize); + Font F_CheckBox=new Font(GlobalFontName, 0, TextFontSize); + Font F_Button=new Font(GlobalFontName, 0, 10); + Font F_ComboBox=new Font(GlobalFontName, 0, TextFontSize); + Font F_TextArea=new Font(GlobalFontName, 0, TextFontSize); + myJName name; + myJAlias alias; + myJRed redcolor; + myJGreen greencolor; + myJBlue bluecolor; + myJMagnetObj magnetobj; + myJMagnetPix magnetpix; + myJUnit unit; + myTRK track; + myJConditional czvalue; //Layer num + private static myJX X; + private static myJY Y; + private static myJX3D X3D; + private static myJY3D Y3D; + private static myJZ3D Z3D; + myXYlink XYlink; + myXYZlink XYZlink; + myJAbsolutePos AbsPos; + myJFx Fx; + myJFx3D Fx3D; + myJGrid Grid; + myJInside Inside; + private static myJR ray; + private static myJR3D ray3D; + myJRFx RFx; + myJRFx3D RFx3D; + private static myJA angle; + myJAFx aFx; + myJTextArea text; + myJExpression Exp; + myJPrompt prompt; + myJSMin min; + myJSMax max; + myJMinBoundary bound_left; + myJMaxBoundary bound_right; + myJSSlider slider; + ContentLine sliderline; + myJUserFunction userfunc; + myJUserF_Y fuey; + myJEqXY eqxy; + myJEqXYDHorChooser eqxychooser; + ContentLine btnline; + myMagnetBtn magnetbtn; + myArcBtn arcbtn; + myPtBindBtn ptbindbtn; + myPtAwayBtn ptawaybtn; + myPtCloseBtn ptclosebtn; + myJFunction func; + myJF_X fex; + myJF_Y fey; + myJF_d fd; + myJF_DMin fdmin; + myJF_Min fmin; + myJF_Max fmax; + myJF_pt fpt; + myJF_Discrete ftr; + myJColorLine color; + myJSegmentCodeLine segmentcode; + myJColorTypeLine colortype; + myJTypeLine type; + myJCircleLine circle; + myJShowLine show; + myJBoldLine boldlarge; + myJAreaLine area; + myJAngleLine0 angle0; + myJAngleLine1 angle1; + myJFilledLine filled; + myJLineLine line; + myJTrackDMinChooser dmintrack; + myJConditional csolid, chidden, cnormal, cthick, cthin, cblack, cgreen, cblue, ccyan, cred, cbrown, cshowvalue, cshowname, cbackground, csuperhidden; + // Text and checkbox items : + static String APoint=",PointObject,IntersectionObject,PointonObject,PointonObjectIntersectionObject,LineCircleIntersectionObject,LineQuadricIntersectionObject,QuadricQuadricIntersectionObject,LineIntersectionObject,CircleIntersectionObject,MidpointObject,"; + static String ACircle=",PrimitiveCircleObject,CircleObject,Circle3Object,FixedCircleObject,"; + String ALine=",PrimitiveLineObject,LineObject,TwoPointLineObject,RayObject,ParallelObject,PlumbObject,"; + static String AAngle=",AngleObject,FixedAngleObject,"; + static String AExpression=",ExpressionObject,"; + static String AText=",TextObject,"; + String AFunction=",FunctionObject,"; + String AEquationXY=",EquationXYObject,"; + static String AUserFunction=",UserFunctionObject,"; + String ATrack=",TrackObject,JLocusTrackObject,ObjectTracker,JLocusObjectTracker,"; + static String ASegment=",SegmentObject,VectorObject,"; + String AArea=",AreaObject,"; + ArrayList MultipleObjects=null; + + public JProperties(int w, int h) { + super(w, h); + + name=new myJName(Loc("name"), "", 40, 110, 20); + name.JTF.setFont(F_NameField); + alias=new myJAlias(Loc("alias"), "", 0, 90, 20); + unit=new myJUnit(Loc("unit"), "", 70, 150, TextFieldHeight); + + magnetobj=new myJMagnetObj(Loc("magnetobj"), "", 0, 150, TextFieldHeight); + magnetpix=new myJMagnetPix(Loc("magnetpix"), "", 0, 150, TextFieldHeight); + + + redcolor=new myJRed("R", "", 0, 78, TextFieldHeight); + greencolor=new myJGreen("G", "", 0, 78, TextFieldHeight); + bluecolor=new myJBlue("B", "", 0, 78, TextFieldHeight); + + + X=new myJX("X :", "", 25, 300, TextFieldHeight); + Y=new myJY("Y :", "", 25, 300, TextFieldHeight); + + X3D=new myJX3D("X :", "", 25, 300, TextFieldHeight); + Y3D=new myJY3D("Y :", "", 25, 300, TextFieldHeight); + Z3D=new myJZ3D("Z :", "", 25, 300, TextFieldHeight); + XYlink=new myXYlink(); + XYZlink=new myXYZlink(); + Fx=new myJFx(Loc("fix"), false, 130, TextFieldHeight); + Fx3D=new myJFx3D(Loc("fix"), false, 130, TextFieldHeight); + AbsPos=new myJAbsolutePos(Loc("fixedinwindow"), false, 150, TextFieldHeight); + ray=new myJR(Loc("fixedray"), "", 75, 300+XYlink.W, TextFieldHeight); + ray3D=new myJR3D(Loc("fixedray"), "", 80, 300+XYlink.W, TextFieldHeight); + RFx=new myJRFx(Loc("fix"), false, 300+XYlink.W, TextFieldHeight); + RFx3D=new myJRFx3D(Loc("fix"), false, 300+XYlink.W, TextFieldHeight); + angle=new myJA(Loc("fixedangle"), "", 75, 300+XYlink.W, TextFieldHeight); + aFx=new myJAFx(Loc("fix"), false, 300+XYlink.W, TextFieldHeight); + + czvalue=new myJConditional("z", Loc("belongto"), "", 70, 150, TextFieldHeight); + track=new myTRK(Loc("tracks"), false, 200, TextFieldHeight); + Grid=new myJGrid(Loc("grid"), "", 80, 170, TextFieldHeight); + + Inside=new myJInside(Loc("inside"), false, 130, TextFieldHeight); + + text=new myJTextArea("", 330, 55); + Exp=new myJExpression("Exp :", "", 40, 330, TextFieldHeight); + prompt=new myJPrompt(Loc("expl"), "", 100, 330, TextFieldHeight); + min=new myJSMin("min", "", 0, 113, TextFieldHeight); + max=new myJSMax("max", "", 0, 113, TextFieldHeight); + slider=new myJSSlider(Loc("showasslider"), false, 100, TextFieldHeight); + slider.JCBX.setText(slider.JCBX.getText()+" :"); + sliderline=new ContentLine(330, TextFieldHeight); + sliderline.add(slider); + sliderline.add(min); + sliderline.add(margin(4)); + sliderline.add(max); + userfunc=new myJUserFunction(Loc("vars"), "", 90, 330, TextFieldHeight); + fuey=new myJUserF_Y("f(x) =", "0", 90, 331, TextFieldHeight); + eqxy=new myJEqXY(Loc("equationxy"), "0", 90, 470, TextFieldHeight); + eqxychooser=new myJEqXYDHorChooser(Loc("equationxychooser"), 90, 250, TextFieldHeight); + +// btnline = new ContentLine(300, TextFieldHeight); + + magnetbtn=new myMagnetBtn(30, 30); + arcbtn=new myArcBtn(100, TextFieldHeight); + ptbindbtn=new myPtBindBtn(100, TextFieldHeight); +// ptawaybtn=new myPtAwayBtn(100, TextFieldHeight); + ptawaybtn=new myPtAwayBtn(Loc("setaway")+" :", "", 70, 150, TextFieldHeight); + ptclosebtn=new myPtCloseBtn(Loc("setclose")+" :", "", 70, 150, TextFieldHeight); + + func=new myJFunction("", "", 0, 470, TextFieldHeight); + fex=new myJF_X("x(t)=", "", 40, 470, TextFieldHeight); + fey=new myJF_Y("", "", 40, 470, TextFieldHeight); + fmin=new myJF_Min("Min :", "", 40, 176, TextFieldHeight); + fmax=new myJF_Max("Max :", "", 40, 176, TextFieldHeight); + fd=new myJF_d(Loc("step"), "", 40, 176, TextFieldHeight); + fdmin=new myJF_DMin(Loc("step"), "", 50, 300, TextFieldHeight); + fpt=new myJF_pt(Loc("pointsonly"), false, 200, TextFieldHeight); + ftr=new myJF_Discrete(Loc("pointsonly"), false, 300, TextFieldHeight); + + bound_left=new myJMinBoundary(20, 2); + bound_right=new myJMaxBoundary(20, 2); + + color=new myJColorLine(26, 2); + colortype=new myJColorTypeLine(32, 3); + segmentcode=new myJSegmentCodeLine(30, 3); + type=new myJTypeLine(26, 2); + circle=new myJCircleLine(24, 1); + show=new myJShowLine(28, 1); + boldlarge=new myJBoldLine(26, 2); + area=new myJAreaLine(26, 1); + angle0=new myJAngleLine0(26, 1); + angle1=new myJAngleLine1(26, 2); + filled=new myJFilledLine(26, 1); + line=new myJLineLine(26, 2); + + dmintrack=new myJTrackDMinChooser(Loc("trackdmin"), 150, 250, TextFieldHeight); + + int cdw=115; + csolid=new myJConditional("solid", cdw, TextFieldHeight); + chidden=new myJConditional("hidden", cdw, TextFieldHeight); + cnormal=new myJConditional("normal", cdw, TextFieldHeight); + cthick=new myJConditional("thick", cdw, TextFieldHeight); + cthin=new myJConditional("thin", cdw, TextFieldHeight); + cblack=new myJConditional("black", cdw, TextFieldHeight); + cgreen=new myJConditional("green", cdw, TextFieldHeight); + cblue=new myJConditional("blue", cdw, TextFieldHeight); + cbrown=new myJConditional("brown", cdw, TextFieldHeight); + ccyan=new myJConditional("cyan", cdw, TextFieldHeight); + cred=new myJConditional("red", cdw, TextFieldHeight); +// cinvisible=new myJConditional("invisible",Loc("invisible"),"",70,true); + csuperhidden=new myJConditional("superhidden", cdw, TextFieldHeight); + cshowname=new myJConditional("showname", cdw, TextFieldHeight); + cshowvalue=new myJConditional("showvalue", cdw, TextFieldHeight); + cbackground=new myJConditional("background", cdw, TextFieldHeight); + + + HashSet forwardKeys=new HashSet(); + forwardKeys.add(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0)); +// forwardKeys.add(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0)); + forwardKeys.add(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0)); + this.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, forwardKeys); + HashSet backwardKeys=new HashSet(); + backwardKeys.add(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0)); + backwardKeys.add(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, InputEvent.SHIFT_DOWN_MASK)); + this.setFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, backwardKeys); + } + + public static ConstructionObject getObject(){ + return O; + } + public static void setObject(ConstructionObject o){ + O = o; + } + + public void multiple_setType(int k) { + for (int i=0; i v) { + + if (JZirkelCanvas.getCurrentZF()==null) { + return; + } + + MultipleObjects=v; + ZF=JZirkelCanvas.getCurrentZF(); + ZC=JZirkelCanvas.getCurrentZC(); + Cn=ZC.getConstruction(); + + // Ici on crée un objet virtuel (point) dont chaque changement + // de propriété sera retranscrit dans les objets réels de la + // sélection multiple : + PointObject p=new PointObject(Cn, "MULTIPLE"); + O=p; + String[] tab=O.getClass().getName().split("\\."); + typecode=","+tab[tab.length-1]+","; + this.clearAll(); + addAspectIcons(); + addConditionals(); + color.deselectAll(); + colortype.deselectAll(); + type.deselectAll(); + this.revalidate(); + this.repaint(); + } + + public void setObject(ConstructionObject o, boolean forcevisible, boolean forcefocus) { + + if (JZirkelCanvas.getCurrentZF()==null) { + return; + } + MultipleObjects=null; + ZF=JZirkelCanvas.getCurrentZF(); + ZC=JZirkelCanvas.getCurrentZC(); + O=o; + + + + Cn=ZC.getConstruction(); + String[] tab=O.getClass().getName().split("\\."); + typecode=","+tab[tab.length-1]+","; + this.clearAll(); + + addTopStandardLine(); + +// addToNum(new myRubSep()); + + addCoords(); + if (O instanceof VectorObject &&((VectorObject) O).is3D()) { + JEricPanel rub=new myRub(); + rub.add(margintop(2)); + Fx3D.init(); + rub.add(Fx3D); + rub.add(margintop(Fx3D.H+2)); + addToNum(rub); + rub.add(margintop(2*Fx3D.H+4)); + addToNum(new myRubSep()); + } + addPointsGoodies(); + addRadius(); + addAngle(); + + addText(); + addExpressionLine(); + addUserFunction(); + addEquationXY(); + addButtons(); + addFunction(); + addTrack(); + addAspectIcons(); + + addConditionals(); + + this.revalidate(); + this.repaint(); + + + + if (forcefocus) { + if (isExpression()) { + if (O.isSlider()) { + FocusAndSelect(min.JTF, forcevisible); + } else { + FocusAndSelect(Exp.JTF, forcevisible); + } + } else if (isText()) { + FocusAndSelect(text.JTX, forcevisible); + } else if (isUserFunction()) { + FocusAndSelect(fuey.JTF, forcevisible); + } else if (isFunction()) { + FocusAndSelect(fey.JTF, forcevisible); + } else if ((ACircle.indexOf(typecode)!=-1)) { + FocusAndSelect(ray.JTF, forcevisible); + } else if ((ASegment.indexOf(typecode)!=-1)) { + FocusAndSelect(ray.JTF, forcevisible); + } else if ((ASegment.indexOf(typecode)!=-1)&&((SegmentObject)O).is3D()) { + FocusAndSelect(ray3D.JTF, forcevisible); + } else if ((AAngle.indexOf(typecode)!=-1)) { + FocusAndSelect(angle.JTF, forcevisible); + } else { + FocusAndSelect(name.JTF, forcevisible); + } + return; + } + FocusAndSelect(name.JTF, false); + } + + public void refresh() { + if (O instanceof PointObject) { + magnetobj.init(); + if (!O.isStrongSelected()) { + magnetbtn.setSelected(false); + } + ptawaybtn.init(); + ptclosebtn.init(); + } + + } + + public void clearme() { + O=null; + Cn=null; + this.clearAll(); + //System.out.println(Panes.size()); + +// for (int i = 0; i < Panes.size(); i++) { +// final JEricPanel mypane = (JEricPanel) Panes.get(i); +// mypane.removeAll(); +// String str = Global.Loc("props.help"); +// str = str.replace("
", " "); +// final JLabel hlp = new JLabel(str); +// hlp.setOpaque(false); +// hlp.setFont(new Font("System", 0, 12)); +// hlp.setHorizontalAlignment(SwingConstants.CENTER); +// hlp.setVerticalAlignment(SwingConstants.CENTER); +// fixsize(hlp, 600, RightPanel.getSize().height); +// hlp.setForeground(new Color(100, 100, 100)); +// mypane.add(hlp); +// mypane.revalidate(); +// } + + +// final JEricPanel mypane = new JEricPanel(); +// +// String str = Global.Loc("props.help"); +// str = str.replace("
", " "); +// +// JLabel hlp = new JLabel(str); +// hlp.setOpaque(false); +// hlp.setFont(new Font("System", 0, 12)); +// hlp.setHorizontalAlignment(SwingConstants.CENTER); +// hlp.setVerticalAlignment(SwingConstants.CENTER); +// fixsize(hlp, 600, RightPanel.getSize().height); +// hlp.setForeground(new Color(100,100,100)); +// this.add(hlp) ; +// mypane.add(hlp); +// mypane.revalidate(); + + repaint(); + } + + private void FocusAndSelect(final JTextComponent cp, final boolean forcevisible) { + SwingUtilities.invokeLater(new Runnable() { + + @Override + public void run() { + if (forcevisible) { + selectTab(1); + } + cp.requestFocus(); + cp.selectAll(); + } + }); + } + + private void addTopStandardLine() { + JEricPanel rubname=new myRub(); + name.init(); + rubname.add(name); + addMain(margin(5)); + addMain(rubname); + addMain(margin(5)); + JEricPanel rub=new myRub(); + alias.init(); + rub.add(alias); + + addMain(rub); + if (JZirkelCanvas.getCurrentZC().is3D()&&(O.getName().equals("O")||O.getName().equals("X")||O.getName().equals("Y")||O.getName().equals("Z")||O.getName().equals("s6")||O.getName().equals("s7")||O.getName().equals("s8"))) { // Dibs + name.setEditable(false); + alias.setEditable(false); + } + } + + public static void refreshCoords(){ + if(O==null) + return; + if(!isNotObjectWithCoords()){ + X.init(); + Y.init(); + X3D.init(); + Y3D.init(); + Z3D.init(); + if(ASegment.indexOf(typecode)==14) { + if (((SegmentObject) O).is3D()) ray3D.init(); + else ray.init(); + } + } else if(ASegment.indexOf(typecode)!=-1 || ACircle.indexOf(typecode)!=-1){ + if (O instanceof SegmentObject&&((SegmentObject) O).is3D()) ray3D.init(); + else ray.init(); + } else if(AAngle.indexOf(typecode)!=-1){ + angle.init(); + } + } + + + private void addCoords() { + JEricPanel rub=new myRub(); + if (isNotObjectWithCoords()) { + return; + } + if(O instanceof SegmentObject && !((SegmentObject) O).isArrow()) + return; + rub.add(margintop(2)); + if (((APoint.indexOf(typecode)!=-1)&&((PointObject) O).is3D())&&O!=ZC.getConstruction().find("O")||(O instanceof VectorObject &&((VectorObject) O).is3D())) { + X3D.init(); + Y3D.init(); + Z3D.init(); + if (O instanceof PointObject&&((PointObject) O).isPointOn()){ + X3D.setEditable(false); + Y3D.setEditable(false); + Z3D.setEditable(false); + } + else { + X3D.setEditable(true); + Y3D.setEditable(true); + Z3D.setEditable(true); + } + JEricPanel coordsCOL=new JEricPanel(); + coordsCOL.setOpaque(false); + coordsCOL.setLayout(new BoxLayout(coordsCOL, BoxLayout.Y_AXIS)); + JEricPanel coordsLNE=new JEricPanel(); + coordsLNE.setOpaque(false); + coordsLNE.setLayout(new BoxLayout(coordsLNE, BoxLayout.X_AXIS)); + coordsLNE.setAlignmentX(0F); + coordsCOL.add(X3D); + coordsCOL.add(margintop(1)); + coordsCOL.add(Y3D); + coordsCOL.add(margintop(1)); + coordsCOL.add(Z3D); + coordsLNE.add(coordsCOL); + coordsLNE.add(XYZlink); + rub.add(coordsLNE); + } + else { + X.init(); + Y.init(); + JEricPanel coordsCOL=new JEricPanel(); + coordsCOL.setOpaque(false); + coordsCOL.setLayout(new BoxLayout(coordsCOL, BoxLayout.Y_AXIS)); + JEricPanel coordsLNE=new JEricPanel(); + coordsLNE.setOpaque(false); + coordsLNE.setLayout(new BoxLayout(coordsLNE, BoxLayout.X_AXIS)); + coordsLNE.setAlignmentX(0F); + coordsCOL.add(X); + coordsCOL.add(margintop(1)); + coordsCOL.add(Y); + coordsLNE.add(coordsCOL); + coordsLNE.add(XYlink); + rub.add(coordsLNE); + // rub.add(margintop(1)); + // rub.add(AbsPos); + rub.add(margintop(1)); + + ContentLine myline=new ContentLine(X.W+XYlink.W, Fx.H); + rub.add(myline); + + // if it's a Point : (not moveable) or (a PointOn) or a Vector + if (!(O.fixed())) { + if (((APoint.indexOf(typecode)!=-1)&&((!((PointObject) O).moveable())||((PointObject) O).isPointOn()))) { + X.setEditable(false); + Y.setEditable(false); + } else { + X.setEditable(true); + Y.setEditable(true); + Fx.init(); + myline.add(Fx); + } + } else { + X.setEditable(true); + Y.setEditable(true); + //un vecteur ou tout autre objet mais pas un segment + if(ASegment.indexOf(typecode)==14 || ASegment.indexOf(typecode)==-1){ + Fx.init(); + myline.add(Fx); + } + } + + //if it's a point inside a polygon or circle : + if (((APoint.indexOf(typecode)!=-1))&&((PointObject) O).isPointOn()) { + X.setEditable(false); + Y.setEditable(false); + if (((PointObject) O).getBound() instanceof InsideObject) { + Inside.init(); + myline.add(Inside); + } + } + + + if (((APoint.indexOf(typecode)!=-1))&&((PointObject) O).moveable()&&(!(((PointObject) O).isPointOn()))) { + Grid.setEditable(true); + X.setEditable(true); + Y.setEditable(true); + Grid.init(); + + myline.add(Grid); + } + + if (((APoint.indexOf(typecode)!=-1))&&(((PointObject) O).isPointOn())) { + Grid.setEditable(true); + Grid.init(); +// myline.add(margin(Fx.W)); + myline.add(Grid); + } + + } + addToNum(rub); + addToNum(new myRubSep()); + +} + private void addPointsGoodies() { + if ((APoint.indexOf(typecode)==-1)) { + return; + } + if ((!O.fixed())&&(!((PointObject) O).moveable())) { + return; + } + JEricPanel rub=new myRub(); + rub.add(margintop(2)); + if (((O instanceof PointObject&&((PointObject) O).is3D()&&((PointObject) O).getBound()==null)&&O!=ZC.getConstruction().find("O"))||(O instanceof MidpointObject&&((MidpointObject) O).is3D())) { //Dibs + Fx3D.init(); + rub.add(Fx3D); + rub.add(margintop(Fx3D.H+2)); + //if it's a point inside a polygon or circle : + if (((APoint.indexOf(typecode)!=-1))&&((PointObject) O).isPointOn()) { + X.setEditable(false); + Y.setEditable(false); + if (((PointObject) O).getBound() instanceof InsideObject) { + Inside.init(); + rub.add(Inside); + } + } + else { + PointObject p=(PointObject) O; + if (p.moveablePoint()) { + ptbindbtn.init(); + rub.add(ptbindbtn); + } + } + addToNum(rub); + rub.add(margintop(2*Fx3D.H+4)); + addToNum(new myRubSep()); + return; + } + + if (!((PointObject) O).isPointOn()) { + AbsPos.init(); + rub.add(AbsPos); + rub.add(margintop(AbsPos.H+2)); + } else { + rub.add(margintop(2*AbsPos.H+2)); + } + + PointObject p=(PointObject) O; + if (p.moveablePoint()) { + ptbindbtn.init(); + rub.add(ptbindbtn); + } + + addToNum(rub); + rub.add(margintop(2*AbsPos.H+4)); + addToNum(new myRubSep()); + } + + private void addRadius() { + if ((ACircle.indexOf(typecode)==-1)&&(ASegment.indexOf(typecode)==-1)) { + return; + } + if (O instanceof SegmentObject&&((SegmentObject) O).is3D()) { + JEricPanel rub=new myRub(200,40); + ray3D.init(); + RFx3D.init(); + String mytxt=Loc("fixedsegment3D"); + ray3D.setLabelTxt(mytxt); + rub.add(ray3D); + //rub.add(margintop(ray3D.H+2)); + rub.add(margintop(2)); + // rub.add(RFx3D); ! Dibs : à gérer plus tard... déplacement en mode longueur fixe + addToNum(rub); + addToNum(new myRubSep()); + } + else if (O.canFix()) { + JEricPanel rub=new myRub(); + ray.init(); + RFx.init(); + String mytxt=(ACircle.indexOf(typecode)!=-1)?Loc("fixedray"):Loc("fixedsegment"); + ray.setLabelTxt(mytxt); + rub.add(ray); + rub.add(margintop(ray.H+2)); + rub.add(RFx); + addToNum(rub); + addToNum(new myRubSep()); + } + + } + + private void addAngle() { + if (AAngle.indexOf(typecode)==-1) { + return; + } + if (O.canFix()) { + JEricPanel rub=new myRub(); + angle.init(); + aFx.init(); + rub.add(margintop(2)); + rub.add(angle); + rub.add(margintop(angle.H+2)); + if (O instanceof AngleObject && ((AngleObject) O).getP1().is3D()&&((AngleObject) O).getP2().is3D()) { + angle.setEditable(false); + } + else { + rub.add(aFx); + angle.setEditable(true); + } + addToNum(rub); + addToNum(new myRubSep()); + } + + } + + public void addText() { + if (AText.indexOf(typecode)==-1) { + return; + } + JEricPanel rub=new myRub(); + text.init(); + rub.add(text); + addToNum(rub); + } + + private void addExpressionLine() { + if (AExpression.indexOf(typecode)==-1) { + return; + } + JEricPanel rub=new myRub(); + rub.add(margintop(2)); + Exp.init(); + prompt.init(); + slider.init(); + max.init(); + min.init(); + rub.add(Exp); + rub.add(margintop(1)); + rub.add(sliderline); + + rub.add(margintop(1)); + rub.add(prompt); + + addToNum(rub); + } + + private void addTrack() { + if (ATrack.indexOf(typecode)==-1) { + return; + } + JEricPanel rub=new myRub(); + rub.add(margintop(2)); + dmintrack.init(); + rub.add(dmintrack); + rub.add(margintop(dmintrack.H*2+4)); + addToNum(rub); + } + + private void addUserFunction() { + if (AUserFunction.indexOf(typecode)==-1) { + return; + } + + userfunc.init(); + addToNum(userfunc); + } + + private void addEquationXY() { + if (AEquationXY.indexOf(typecode)==-1) { + return; + } + JEricPanel rub=new myRub(); + rub.add(margintop(2)); + + eqxy.init(); + eqxychooser.init(); + rub.add(eqxy); + rub.add(margintop(eqxy.H+2)); + rub.add(eqxychooser); + addToNum(rub); + } + + private void addFunction() { + if (AFunction.indexOf(typecode)==-1) { + return; + } + + func.init(); + addToNum(func); + + addToNum(new myRubSep()); + + JEricPanel rub=new myRub(); + fmin.init(); + fmax.init(); + fd.init(); + + rub.add(margintop(2)); + rub.add(fmin); + rub.add(margintop(1)); + rub.add(fmax); + rub.add(margintop(1)); + rub.add(fd); + rub.add(margintop(1)); + + addToNum(rub); + + addToNum(new myRubSep()); + + rub=new myRub(); + rub.setLayout(null); + + JLabel title = new JLabel("Bornes :"); + title.setFont(F_Label); + bound_left.init(); + JLabel img = new JLabel(); + URL myurl=getClass().getResource("/eric/GUI/icons/bar/fnct.png"); + img.setIcon(new ImageIcon(myurl)); + bound_right.init(); + + rub.add(title); + rub.add(bound_left); + rub.add(img); + rub.add(bound_right); + + title.setBounds(0, 2, 50, 15); + bound_left.setBounds(0, 17, 20, 40); + img.setBounds(25, 21, 32, 32); + bound_right.setBounds(62, 17, 20, 40); + + addToNum(rub); + +// func.init(); + + +// content.add(func); +// content.add(new mySep()); + } + + public void addButtons() { + + JEricPanel rub=new myRub(); + rub.add(margintop(2)); + + if (ACircle.indexOf(typecode)!=-1) { + arcbtn.init(); + rub.add(arcbtn); + rub.add(margintop(1)); + } + if (APoint.indexOf(typecode)!=-1) { + PointObject p=(PointObject) O; + if ((p.moveablePoint())&&(!p.isPointOn())) { +// ptbindbtn.init(); + magnetobj.init(); + magnetpix.init(); + magnetbtn.init(); +// rub.add(ptbindbtn); +// rub.add(margintop(1)); + + JEricPanel jp=new JEricPanel(); + jp.setLayout(new BoxLayout(jp, BoxLayout.X_AXIS)); + jp.setOpaque(false); + jp.setAlignmentX(0F); + jp.add(magnetbtn); + jp.add(margin(15)); + JEricPanel rub2=new myRub(); + rub2.add(magnetobj); + rub2.add(margintop(5)); + rub2.add(magnetpix); + jp.add(rub2); + + rub.add(jp); + + } else if (p instanceof IntersectionObject&&((IntersectionObject) p).isSwitchable()) { + ptawaybtn.init(); + ptclosebtn.init(); + rub.add(ptawaybtn); + rub.add(margintop(1)); + rub.add(ptclosebtn); + } + } + if (rub.getComponentCount()>1) { + JEricPanel myspacer=new JEricPanel(); + myspacer.setOpaque(false); +// addToNum(myspacer); + addToNum(rub); + addToNum(margin(3)); + } + + } + + private void addMultipleAspectIcons() { + addAspectIcons(); + addPointsGoodies(); + } + + private void addAspectIcons() { + + + JEricPanel rub=new myRub(); + rub.add(margintop(2)); + redcolor.init(); + greencolor.init(); + bluecolor.init(); + rub.add(redcolor); + rub.add(margintop(1)); + rub.add(greencolor); + rub.add(margintop(1)); + rub.add(bluecolor); + addToAspect(margin(2)); + addToAspect(rub); + addToAspect(margin(5)); + + color.init(); + addToAspect(color); + + + addToAspect(new myRubSep()); + colortype.setSelect(O.getColorType(true)); + addToAspect(colortype); + addToAspect(new myRubSep()); + show.init(); + addToAspect(show); + + if (O.canDisplayName()) { + boldlarge.init(); + addToAspect(new myRubSep()); + addToAspect(boldlarge); + } + + if ((ASegment.indexOf(typecode))!=-1) { + segmentcode.init(); + addToAspect(new myRubSep()); + addToAspect(segmentcode); + } + + + if ((APoint.indexOf(typecode)!=-1)||(AFunction.indexOf(typecode)!=-1)||(ATrack.indexOf(typecode)!=-1)) { + type.setSelect(O.getType()); + addToAspect(new myRubSep()); + addToAspect(type); + } else if (AAngle.indexOf(typecode)!=-1) { + angle1.setSelect(O.getDisplaySize()); + addToAspect(new myRubSep()); + addToAspect(angle1); + } + + if (ACircle.indexOf(typecode)!=-1) { + circle.init(); + addToAspect(new myRubSep()); + addToAspect(circle); + } else if (ALine.indexOf(typecode)!=-1) { + line.init(); + addToAspect(new myRubSep()); + addToAspect(line); + } else if (AAngle.indexOf(typecode)!=-1) { + angle0.init(); + addToAspect(new myRubSep()); + addToAspect(angle0); + } else if (AFunction.indexOf(typecode)!=-1) { + filled.init(); + addToAspect(new myRubSep()); + addToAspect(filled); + + } else if (ATrack.indexOf(typecode)!=-1) { + filled.init(); + addToAspect(new myRubSep()); + addToAspect(filled); + } else if (AArea.indexOf(typecode)!=-1) { + area.init(); + addToAspect(new myRubSep()); + addToAspect(area); + } + + JEricPanel myspacer=new JEricPanel(); + myspacer.setOpaque(false); + + rub=new myRub(); + rub.add(margintop(2)); + + czvalue.init(); + rub.add(czvalue); + if (O.hasUnit()) { + rub.add(margintop(1)); + unit.init(); + rub.add(unit); + } + if ((AFunction.indexOf(typecode)!=-1)||(ATrack.indexOf(typecode)!=-1)) { + rub.add(margintop(1)); + fpt.init(); + rub.add(fpt); + } + rub.add(margintop(1)); + track.init(); + rub.add(track); + +// if (APoint.indexOf(typecode)!=-1) { +// track.init(); +// rub.add(track); +// } + +// addToAspect(new myRubSep()); + addToAspect(myspacer); + addToAspect(rub); + addToAspect(margin(3)); + } + + private void addConditionals() { + JEricPanel rub=new myRub(); + chidden.init(); + csuperhidden.init(); + csolid.init(); + rub.add(margintop(1)); + rub.add(chidden); + rub.add(margintop(1)); + rub.add(csuperhidden); + rub.add(margintop(1)); + rub.add(csolid); + addToConditional(rub); + addToConditional(new myRubSep(14)); + rub=new myRub(); + cnormal.init(); + cthick.init(); + cthin.init(); + rub.add(margintop(1)); + rub.add(cnormal); + rub.add(margintop(1)); + rub.add(cthick); + rub.add(margintop(1)); + rub.add(cthin); + addToConditional(rub); + addToConditional(new myRubSep(14)); + rub=new myRub(); + cshowname.init(); + cshowvalue.init(); +// cbackground.init(); + rub.add(margintop(1)); + rub.add(margintop(1)); + rub.add(cshowname); + rub.add(margintop(1)); + rub.add(cshowvalue); +// rub.add(cbackground); + rub.add(margintop(cshowname.H+1)); + addToConditional(rub); + addToConditional(new myRubSep(14)); + rub=new myRub(); + cblack.init(); + cgreen.init(); + cblue.init(); + rub.add(margintop(1)); + rub.add(cblack); + rub.add(margintop(1)); + rub.add(cgreen); + rub.add(margintop(1)); + rub.add(cblue); + addToConditional(rub); + addToConditional(new myRubSep(14)); + rub=new myRub(); + cbrown.init(); + ccyan.init(); + cred.init(); + rub.add(margintop(1)); + rub.add(cbrown); + rub.add(margintop(1)); + rub.add(ccyan); + rub.add(margintop(1)); + rub.add(cred); + addToConditional(rub); + + } + + public void addToNum(JComponent cp) { + add(cp, 1); + } + + public void addToAspect(JComponent cp) { + add(cp, 0); + } + + public void addToConditional(JComponent cp) { + add(cp, 2); + } + // A transférer dans JTabPanel pour éviter les "Overridable method call in construtor" + + public String Loc(String s) { + return Global.Loc("props."+s); + } + + static void fixsize(JComponent cp, int w, int h) { + Dimension d=new Dimension(w, h); + cp.setMaximumSize(d); + cp.setMinimumSize(d); + cp.setPreferredSize(d); + cp.setSize(d); + } + + static JEricPanel margin(int w) { + JEricPanel mypan=new JEricPanel(); + fixsize(mypan, w, 1); + mypan.setLayout(new javax.swing.BoxLayout(mypan, javax.swing.BoxLayout.X_AXIS)); + mypan.setAlignmentX(0F); + mypan.setAlignmentY(0F); + mypan.setOpaque(false); + mypan.setFocusable(false); + return mypan; + } + + JEricPanel margintop(int h) { + JEricPanel mypan=new JEricPanel(); + fixsize(mypan, 1, h); + mypan.setOpaque(false); + mypan.setFocusable(false); + return mypan; + } + + private boolean isExpression() { + boolean bool=(AExpression.indexOf(typecode)!=-1); + return (bool); + } + + private boolean isText() { + boolean bool=(AText.indexOf(typecode)!=-1); + return (bool); + } + + private boolean isUserFunction() { + boolean bool=(AUserFunction.indexOf(typecode)!=-1); + return (bool); + } + + private boolean isFunction() { + boolean bool=(AFunction.indexOf(typecode)!=-1); + return (bool); + } + + private static boolean isNotObjectWithCoords() { + boolean bad=(APoint.indexOf(typecode)==-1); + //bad&=(ASegment.indexOf(typecode)==-1); + bad&=(ASegment.indexOf(typecode)!=14); + bad&=(AExpression.indexOf(typecode)==-1); + bad&=(AText.indexOf(typecode)==-1); + bad&=(AUserFunction.indexOf(typecode)==-1); + return (bad); + } + + private boolean isAbsolutePoint() { + boolean b=O.fixed(); + if (b) { + String x=O.getEXpos(), y=O.getEY(); + b=b&&x.startsWith("(windoww/(windoww-d(windoww)))*("); + b=b&&x.endsWith("-windowcx)+windowcx+d(windowcx)"); + b=b&&y.startsWith("(windoww/(windoww-d(windoww)))*("); + b=b&&y.endsWith("-windowcy)+windowcy+d(windowcy)"); + } + return b; + } + + boolean isValidExpression(String myexp) { + boolean bool=true; + try { + Expression exp=new Expression(myexp, O.getConstruction(), O); + if (!(exp.isValid())) { + bool=false; + } + } catch (Exception ex) { + bool=false; + } + return bool; + } + + double ValueOf(String myexp) { + double rep; + try { + Expression exp=new Expression(myexp, O.getConstruction(), O); + rep=exp.getValue(); + } catch (Exception ex) { + rep=0.0; + } + return rep; + } +// static Construction V_CONST=new Construction(); +// static UserFunctionObject V_FONC=new UserFunctionObject(V_CONST); + static double VARS[]={1, 2, 3, 4}; + + // set text : + public static String Point_To_Comma(String mynum, Construction C, boolean check) { + if (C==null) { + return mynum; + } + if (check) { + try { + UserFunctionObject V_FONC=new UserFunctionObject(C); + V_FONC.setExpressions("x y z t", mynum.replace("invalid", "1")); + double d=V_FONC.evaluateF(VARS); + + } catch (Exception ex) { + return mynum; + } + } + if (Global.isDecimalWithComma()) { + String s=mynum.replace(",", ";"); + return s.replace(".", ","); + } else { + return mynum; + } + } + + // get text : + public static String Comma_To_Point(String mynum, Construction C, boolean check) { + if (C==null) { + return mynum; + } + String s=mynum.replace(",", "."); + s=s.replace(";", ","); + if (check) { + try { + UserFunctionObject V_FONC=new UserFunctionObject(C); + V_FONC.setExpressions("x y z t", s.replace("invalid", "1")); + double d=V_FONC.evaluateF(VARS); + } catch (Exception ex) { + return mynum; + } + } + if (Global.isDecimalWithComma()) { + return s; + } else { + return mynum; + } + } + + static class MyComboBoxUI extends MetalComboBoxUI { + + public static ComponentUI createUI(JComponent c) { + return new MyComboBoxUI(); + } + } + + class myRub extends JEricPanel { + + public myRub() { + this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); + this.setAlignmentX(0F); + this.setOpaque(false); + } + + public myRub(String rubname) { + this(); + } + + public myRub(int width, int height) { + this(""); + fixsize(this, width, height); + } + } + + class myRubSep extends JEricPanel { + + @Override + public void paintComponent(java.awt.Graphics g) { + super.paintComponent(g); + ImageIcon myicon=new ImageIcon(getClass().getResource("gui/sep.png")); + java.awt.Dimension d=this.getSize(); + int x=(d.width+myicon.getIconWidth())/2; + g.drawImage(myicon.getImage(), x, 0, myicon.getIconWidth(), d.height, this); + } + + public myRubSep() { + this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); + this.setAlignmentX(0f); + this.setAlignmentY(0.5f); + this.setOpaque(false); + fixsize(this, HRubSeparatorWidth, HRubSeparatorHeight); + } + + public myRubSep(int width) { + this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); + this.setAlignmentX(0f); + this.setAlignmentY(0.5f); + this.setOpaque(false); + fixsize(this, width, HRubSeparatorHeight); + } + } + + class ContentLine extends JEricPanel { + + int W, H; + + public ContentLine() { + setLayout(new javax.swing.BoxLayout(this, javax.swing.BoxLayout.X_AXIS)); + setAlignmentX(0F); + setAlignmentY(0F); + setFocusable(false); + setOpaque(false); + } + + public ContentLine(int width, int height) { + this(); + W=width; + H=height; + fixsize(this, width, height); + } + } + + class myJLine extends ContentLine { + + String contextHelp=""; + ArrayList carPopupMenuItemAllowed=new ArrayList(); + JTextFieldPopup carPopup=null; + JButton carBTN=null; + JLabel myTXT; + myJTextField JTF; + JCheckBox JCBX; + JButton JBTN; + int CW; + boolean Cinside; + String InitValue=""; + + // With text field : + public myJLine(String comment, String txt, int comwidth, int width, int height) { + super(width, height); + CW=comwidth; + Cinside=((!comment.equals(""))&&(comwidth==0)); //comment must be inside the JTF as an init value + if (Cinside) { + InitValue=comment; + InitValue=InitValue.trim(); + InitValue=InitValue.replace(":", ""); + InitValue=InitValue.trim(); + InitValue="<"+InitValue+">"; + } + + addnewlabel(comment, comwidth, H); + JTF=new myJTextField(txt); + JTF.setFont(F_TextField); + JTF.setForeground(C_TextField); + JTF.setBackground(new Color(245, 246, 255)); + JTF.setBorder(BorderFactory.createLineBorder(new Color(150, 150, 150), 1)); + + JTF.addMouseListener(new MouseAdapter() { + + @Override + public void mousePressed(MouseEvent arg0) { + doHelp(); + doEnter(); + } + }); + JTF.addKeyListener(new KeyAdapter() { + + @Override + public void keyPressed(KeyEvent e) { + if ((Cinside)&&(JTF.getText().equals(InitValue))) { + JTF.setForeground(C_TextField_OFF); + } else { + JTF.setForeground(C_TextField); + } + } + + @Override + public void keyReleased(KeyEvent e) { + doAction(e.getComponent()); + } + }); + JTF.addFocusListener(new FocusAdapter() { + + @Override + public void focusGained(FocusEvent e) { + if ((carPopup!=null)&&(carPopup.isVisible())) { + return; + } + if ((Cinside)&&(JTF.getText().equals(InitValue))) { + JTF.setText(""); + JTF.setForeground(C_TextField); + } + if (carBTN!=null) { + carBTN.setEnabled(true); + } + JTF.selectAll(); + + } + + @Override + public void focusLost(FocusEvent e) { + if ((carPopup!=null)&&(carPopup.isVisible())) { + return; + } + if ((Cinside)&&(JTF.getText().equals(""))) { + JTF.setText(InitValue); + JTF.setForeground(C_TextField_OFF); + } + if (carBTN!=null) { + carBTN.setEnabled(false); + } + doQuitMe(e.getComponent()); + } + }); + + + + this.add(JTF); + } + + public myJLine(String comment, String txt, int comwidth, int width, int height, boolean withhelp) { + this(comment, txt, comwidth, width, height); + carPopup=new JTextFieldPopup(JTF); + carPopup.addPopupMenuListener(new PopupMenuListener() { + + @Override + public void popupMenuWillBecomeVisible(PopupMenuEvent arg0) { + } + + @Override + public void popupMenuWillBecomeInvisible(PopupMenuEvent arg0) { + doAction(JTF); + } + + @Override + public void popupMenuCanceled(PopupMenuEvent arg0) { + } + }); + ImageIcon carimg=new ImageIcon(getClass().getResource("/eric/GUI/icons/bar/carbtn.png")); + ImageIcon carimg_dis=new ImageIcon(getClass().getResource("/eric/GUI/icons/bar/carbtn_dis.png")); + carBTN=new JButton(carimg); + carBTN.setDisabledIcon(carimg_dis); +// carbtn.setRolloverIcon(closeoverimg); + carBTN.setBorder(BorderFactory.createEmptyBorder()); + carBTN.setOpaque(false); + carBTN.setContentAreaFilled(false); + carBTN.setFocusable(false); + carBTN.addMouseListener(new MouseAdapter() { + + @Override + public void mousePressed(MouseEvent e) { + doShowPopup(e); + } + }); + carBTN.setEnabled(false); + fixsize(carBTN, carimg.getIconWidth(), carimg.getIconHeight()); + this.add(margin(2)); + this.add(carBTN); + } + + // with checkbox : + public myJLine(String comment, boolean checked, int width, int height) { + super(width, height); + this.setFocusable(false); + comment=comment.replace(":", ""); + comment=comment.trim(); + JCBX=new JCheckBox(""); + JCBX.setOpaque(false); + JCBX.setFocusable(false); + JCBX.setFont(F_CheckBox); + fixsize(JCBX, W, H); + JCBX.addMouseListener(new MouseAdapter() { + + @Override + public void mousePressed(MouseEvent e) { + doAction(e.getComponent()); + } + }); + JCBX.setIcon(new ImageIcon(getClass().getResource("gui/chkboxOFF.png"))); + JCBX.setSelectedIcon(new ImageIcon(getClass().getResource("gui/chkboxON.png"))); + JCBX.setText(comment); + this.add(JCBX); + } + + // with button : + public myJLine(String comment, int btnwidth, int width, int height) { + super(width, height); + JBTN=new JButton(); + JBTN.setFont(F_Button); +// JBTN.setBorder(BorderFactory.createEtchedBorder()); + fixsize(JBTN, btnwidth, H); + JBTN.addMouseListener(new MouseAdapter() { + + @Override + public void mousePressed(MouseEvent e) { + doAction(e.getComponent()); + } + }); + JBTN.setText(comment); + this.add(JBTN); + } + + // TxtField with caracter palette btn + public void addnewlabel(String comment, int w, int h) { + myTXT=new JLabel(comment); + myTXT.setFocusable(false); + myTXT.setFont(F_Label); + fixsize(myTXT, w, h); + myTXT.setHorizontalAlignment(SwingConstants.LEFT); + myTXT.setVerticalAlignment(SwingConstants.CENTER); + this.add(myTXT); + } + + public void setLabelTxt(String lbltxt) { + myTXT.setText(lbltxt); + } + + public void setSelected(boolean on) { + JCBX.setSelected(on); + } + + public boolean isSelected() { + return JCBX.isSelected(); + } + + public void setText(String txt) { + JTF.setText(Point_To_Comma(txt, Cn, true)); + } + + public String getText() { + return Comma_To_Point(JTF.getText(), Cn, true); + } + + public void setEditable(boolean bool) { + if (bool) { + JTF.setForeground(C_TextField); + } else { + JTF.setForeground(C_TextField_OFF); + } + JTF.setFocusable(bool); + JTF.setEditable(bool); + } + + public void setInitValue() { + if ((Cinside)&&(JTF.getText().equals(""))) { + JTF.setText(InitValue); + JTF.setForeground(C_TextField_OFF); + JTF.setHorizontalAlignment(SwingConstants.CENTER); + } else { + JTF.setForeground(C_TextField); + } + } + + public void doAction(Component cp) { + } + + public void doQuitMe(Component cp) { + } + + public void doEnter() { + } + + public void doShowPopup(MouseEvent e) { + if (carBTN.isEnabled()) { + carPopup.openMenu(e); + } + } + + public void doHelp() { + if (!contextHelp.equals("")) { + ZF.setinfo(contextHelp, false); + } + } + } + + class myJName extends myJLine { + String old_name; + + public myJName(String comment, String txt, int comwidth, int width, int height) { + super(comment, txt, comwidth, width, height); + contextHelp="prop_name"; + this.JTF.setHorizontalAlignment(SwingConstants.CENTER); + } + + @Override + public void doAction(Component e) { + JTextField jtf=(JTextField) e; + if (O.getName().equals(jtf.getText())) { + return; + } + old_name=O.getName(); + O.setName(jtf.getText()); + O.setShowName(true); + show.forceSelect(2); // Force the ShowName icon to be selected + if (ZC!=null) { + ZC.repaint(); + ZC.updateTexts(O, ""); + + ZC.update_distant(old_name, O.getName()); + ZC.update_distant(O, 3); + } + } + + public void init() { + setText(O.getName()); + } + } + + class myJAlias extends myJLine { + + public myJAlias(String comment, String txt, int comwidth, int width, int height) { + super(comment, txt, comwidth, width, height, true); + contextHelp="prop_alias"; + carPopup.setDisabled(","+JTextFieldPopup.FUNCTIONMENU+","); + } + + @Override + public void doAction(Component e) { + JTextField jtf=(JTextField) e; + if ((O.getAlias()!=null)&&(O.getAlias().equals(jtf.getText()))) { + return; + } + if (jtf.getText().equals("")) { + O.setAlias(null); + } else { + O.setAlias(jtf.getText()); +// jtf.setText(O.getAlias()); + } + O.setShowName(true); + show.forceSelect(2); + ZC.repaint(); + } + + public void init() { + setText(O.getAlias()); + setInitValue(); + } + } + + class myJRed extends myJLine { + + public myJRed(String comment, String txt, int comwidth, int width, int height) { + super(comment, txt, comwidth, width, height, true); + carPopup.setDisabled(","+JTextFieldPopup.LATEXMENU+","); +// contextHelp="prop_magnetic"; + } + + @Override + public void doAction(Component e) { + try { + O.setRed(getText()); + greencolor.init(); + bluecolor.init(); + color.init(); + ZC.validate(); + ZC.repaint(); + } catch (Exception ex) { + } + } + + public void init() { + setText(O.getRed()); + setInitValue(); + } + + @Override + public void doQuitMe(Component cp) { + redcolor.init(); + greencolor.init(); + bluecolor.init(); + color.init(); + } + } + + class myJGreen extends myJLine { + + public myJGreen(String comment, String txt, int comwidth, int width, int height) { + super(comment, txt, comwidth, width, height, true); + carPopup.setDisabled(","+JTextFieldPopup.LATEXMENU+","); +// contextHelp="prop_magnetic"; + } + + @Override + public void doAction(Component e) { + try { + O.setGreen(getText()); + redcolor.init(); + bluecolor.init(); + color.init(); + ZC.validate(); + ZC.repaint(); + } catch (Exception ex) { + } + } + + public void init() { + setText(O.getGreen()); + setInitValue(); + } + + @Override + public void doQuitMe(Component cp) { + redcolor.init(); + greencolor.init(); + bluecolor.init(); + color.init(); + } + } + + class myJBlue extends myJLine { + + public myJBlue(String comment, String txt, int comwidth, int width, int height) { + super(comment, txt, comwidth, width, height, true); + carPopup.setDisabled(","+JTextFieldPopup.LATEXMENU+","); +// contextHelp="prop_magnetic"; + } + + @Override + public void doAction(Component e) { + try { + O.setBlue(getText()); + redcolor.init(); + greencolor.init(); + color.init(); + ZC.validate(); + ZC.repaint(); + } catch (Exception ex) { + } + } + + public void init() { + setText(O.getBlue()); + setInitValue(); + } + + @Override + public void doQuitMe(Component cp) { + redcolor.init(); + greencolor.init(); + bluecolor.init(); + color.init(); + } + } + + class myJMagnetObj extends myJLine { + + public myJMagnetObj(String comment, String txt, int comwidth, int width, int height) { + super(comment, txt, comwidth, width, height); + contextHelp="prop_magnetic"; + } + + @Override + public void doEnter() { + PointObject P=(PointObject) O; + if (P==null) { + return; + } + magnetbtn.setSelected(true); + ZC.setMagnetTool(P); + } + + @Override + public void doAction(Component e) { + JTextField jtf=(JTextField) e; + + PointObject P=(PointObject) O; + P.selectMagnetObjects(false); + P.setMagnetObjects(Comma_To_Point(JTF.getText(), Cn, false)); + P.selectMagnetObjects(true); + ZC.repaint(); + } + + public void init() { + PointObject P=(PointObject) O; + JTF.setText(Point_To_Comma(P.getMagnetObjectsString(), Cn, false)); + setInitValue(); + } + } + + class myJMagnetPix extends myJLine { + + public myJMagnetPix(String comment, String txt, int comwidth, int width, int height) { + super(comment, txt, comwidth, width, height); + contextHelp="prop_magnetic"; + } + + @Override + public void doEnter() { + PointObject P=(PointObject) O; + if (P==null) { + return; + } + magnetbtn.setSelected(true); + ZC.setMagnetTool(P); + } + + @Override + public void doAction(Component e) { + PointObject P=(PointObject) O; + P.setMagnetRayExp(getText()); + P.magnet(); + ZC.validate(); + ZC.repaint(); + } + + public void init() { + PointObject P=(PointObject) O; +// setText("" + P.getMagnetRayExp()); + if (P.getMagnetRayExp().equals("20")) { + setText(""); + } else { + setText(P.getMagnetRayExp()); + } + setInitValue(); + } + } + + class myJUnit extends myJLine { + + public myJUnit(String comment, String txt, int comwidth, int width, int height) { + super(comment, txt, comwidth, width, height, true); + contextHelp="prop_unit"; + carPopup.setDisabled(","+JTextFieldPopup.LATEXMENU+","); + } + + @Override + public void doAction(Component e) { + if (O.hasUnit()) { + JTextField jtf=(JTextField) e; + if (O.getUnit().equals(jtf.getText())) { + return; + } + + if (MultipleObjects!=null) { + multiple_setUnit(jtf.getText()); + } + + O.setUnit(jtf.getText()); + O.setShowValue(true); + show.forceSelect(1); + ZC.repaint(); + } + } + + public void init() { + setText(O.getUnit()); + setInitValue(); + } + } + + class myJX extends myJLine { + String origin=""; + String current=""; + + public myJX(String comment, String txt, int comwidth, int width, int height) { + super(comment, txt, comwidth, width, height, true); + contextHelp="prop_coordinates"; + carPopup.setDisabled(","+JTextFieldPopup.LATEXMENU+","); +// fixsize(this.JTF,this.JTF.getSize().width-18,this.JTF.getSize().height); +// fixsize(this,this.getSize().width-30,this.getSize().height); + } + + @Override + public void doAction(Component e) { + if (current.equals(getText())) { + return; + } + if (XYlink.isSelected()) { + String myX=X.getText(); + myX=myX.replace("x(", "y("); + Y.setText(myX); + } + O.setFixed(X.getText(), Y.getText()); + Fx.setSelected(true); + current=getText(); + O.move(O.getX(), O.getY()); + ZC.recompute(); + ZC.validate(); + ZC.repaint(); + ZC.update_distant(O, 3); + } + + @Override + public void doQuitMe(Component e) { + if (O==null) { + return; + } + if (!(isValidExpression(getText()))) { + JOptionPane.showMessageDialog(null, Loc("error")); + if (!(isValidExpression(origin))) { + origin="0"; + } + setText(origin); + + if (XYlink.isSelected()) { + Y.setText(Y.origin); + } + Fx.setSelected(true); + O.setFixed(X.getText(), Y.getText()); + O.move(O.getX(), O.getY()); + ZC.recompute(); + ZC.validate(); + ZC.repaint(); + this.JTF.requestFocus(); + } else { + origin=getText(); + if (XYlink.isSelected()) { + Y.origin=Y.getText(); + } + } + } + + public void init() { + boolean fixed = (O instanceof VectorObject || O.fixed()) && O.fixedCoord(); + + if (fixed) { + if (isAbsolutePoint()) { + current=Loc("fixedinwindow"); + } else { + current=(isValidExpression(O.getEXpos()))?O.getEXpos():"????"; + } + } else { + if(ASegment.indexOf(typecode)==14){ + VectorObject v = (VectorObject) O; + current=String.valueOf(v.getDeltaX()); + } else { + current=String.valueOf(O.getX()); + } + } + setText(current); + origin=current; + } + } + + class myJY extends myJLine { + String origin=""; + String current=""; + + public myJY(String comment, String txt, int comwidth, int width, int height) { + super(comment, txt, comwidth, width, height, true); + contextHelp="prop_coordinates"; + carPopup.setDisabled(","+JTextFieldPopup.LATEXMENU+","); +// fixsize(this.JTF,this.JTF.getSize().width-18,this.JTF.getSize().height); +// fixsize(this,this.getSize().width-30,this.getSize().height); + } + + @Override + public void doAction(Component e) { + if (current.equals(getText())) { + return; + } + O.setFixed(X.getText(), Y.getText()); + Fx.setSelected(true); + current=getText(); + O.move(O.getX(), O.getY()); + ZC.recompute(); + ZC.validate(); + ZC.repaint(); + ZC.update_distant(O, 3); + } + + @Override + public void doQuitMe(Component e) { + if (O==null) { + return; + } + if (!(isValidExpression(getText()))) { + JOptionPane.showMessageDialog(null, Loc("error")); + if (!(isValidExpression(origin))) { + origin="0"; + } + setText(origin); + O.setFixed(X.getText(), Y.getText()); + Fx.setSelected(true); + O.move(O.getX(), O.getY()); + ZC.recompute(); + ZC.validate(); + ZC.repaint(); + this.JTF.requestFocus(); + } else { + origin=getText(); + } + } + + public void init() { + boolean fixed = (O instanceof VectorObject || O.fixed()) && O.fixedCoord(); + + if (fixed) { + if (isAbsolutePoint()) { + current=Loc("fixedinwindow"); + } else { + current=(isValidExpression(O.getEYpos()))?O.getEYpos():"????"; + } + } else { + if(ASegment.indexOf(typecode)==14){ + VectorObject v = (VectorObject) O; + current=String.valueOf(v.getDeltaY()); + } else { + current=String.valueOf(O.getY()); + } + } + setText(current); + origin=current; + } + } + + class myJX3D extends myJLine { + String origin=""; + String current=""; + + public myJX3D(String comment, String txt, int comwidth, int width, int height) { + super(comment, txt, comwidth, width, height, true); + contextHelp="prop_coordinates"; + carPopup.setDisabled(","+JTextFieldPopup.LATEXMENU+","); +// fixsize(this.JTF,this.JTF.getSize().width-18,this.JTF.getSize().height); +// fixsize(this,this.getSize().width-30,this.getSize().height); + } + + @Override + public void doAction(Component e) { + if (current.equals(getText())) { + return; + } + if (XYZlink.isSelected()) { + String myX3D=X3D.getText(); + String myY3D, myZ3D; + myY3D=myX3D.replace("x3D(", "y3D("); + myZ3D=myX3D.replace("x3D(", "z3D("); + Y3D.setText(myY3D); + Z3D.setText(myZ3D); + } + Fx3D.setSelected(true); + O.setFixed(X3D.getText(), Y3D.getText(), Z3D.getText()); + //O.setFixed("x(O)+("+X3D.getText()+")*(x(X)-x(O))+("+Y3D.getText()+")*(x(Y)-x(O))+("+Z3D.getText()+")*(x(Z)-x(O))", "y(O)+("+X3D.getText()+")*(y(X)-y(O))+("+Y3D.getText()+")*(y(Y)-y(O))+("+Z3D.getText()+")*(y(Z)-y(O))"); + current=getText(); + // Fx3D.init(); + //O.move(O.getX(), O.getY()); + ZC.recompute(); + ZC.validate(); + ZC.repaint(); + ZC.update_distant(O, 3); + } + + @Override + public void doQuitMe(Component e) { + if (O==null) { + return; + } + if (!(isValidExpression(getText()))) { + JOptionPane.showMessageDialog(null, Loc("error")); + if (!(isValidExpression(origin))) { + origin="0"; + } + setText(origin); + if (XYZlink.isSelected()) { + Y3D.setText(Y3D.origin); + Z3D.setText(Z3D.origin); + } + O.setFixed(X3D.getText(), Y3D.getText(), Z3D.getText()); + //O.setFixed("x(O)+("+X3D.getText()+")*(x(X)-x(O))+("+Y3D.getText()+")*(x(Y)-x(O))+("+Z3D.getText()+")*(x(Z)-x(O))", "y(O)+("+X3D.getText()+")*(y(X)-y(O))+("+Y3D.getText()+")*(y(Y)-y(O))+("+Z3D.getText()+")*(y(Z)-y(O))"); + //O.move(O.getX(), O.getY()); + Fx3D.setSelected(true); + ZC.recompute(); + ZC.validate(); + ZC.repaint(); + this.JTF.requestFocus(); + } else { + origin=getText(); + if (XYZlink.isSelected()) { + Y3D.origin=Y.getText(); + Z3D.origin=Z3D.getText(); + } + } + } + + public void init() { + boolean fixed3D = (O instanceof VectorObject || O.fixed3D()) && O.fixedCoord3D(); + + if (fixed3D) { + if (isAbsolutePoint()) { + current=Loc("fixedinwindow"); + } else { + current=(isValidExpression(O.getEX3Dpos()))?O.getEX3Dpos():"????"; + } + } else { + if(ASegment.indexOf(typecode)==14){ + VectorObject v = (VectorObject) O; + current=String.valueOf(v.getDeltaX3D()); + } else { + current=String.valueOf(O.getX3D()); + } + } + setText(current); + origin=current; + } + + } + + class myJY3D extends myJLine { + String origin=""; + String current=""; + + public myJY3D(String comment, String txt, int comwidth, int width, int height) { + super(comment, txt, comwidth, width, height, true); + contextHelp="prop_coordinates"; + carPopup.setDisabled(","+JTextFieldPopup.LATEXMENU+","); +// fixsize(this.JTF,this.JTF.getSize().width-18,this.JTF.getSize().height); +// fixsize(this,this.getSize().width-30,this.getSize().height); + } + + @Override + public void doAction(Component e) { + if (current.equals(getText())) { + return; + } + Fx3D.setSelected(true); + O.setFixed(X3D.getText(), Y3D.getText(), Z3D.getText()); + //O.setFixed("x(O)+("+X3D.getText()+")*(x(X)-x(O))+("+Y3D.getText()+")*(x(Y)-x(O))+("+Z3D.getText()+")*(x(Z)-x(O))", "y(O)+("+X3D.getText()+")*(y(X)-y(O))+("+Y3D.getText()+")*(y(Y)-y(O))+("+Z3D.getText()+")*(y(Z)-y(O))"); + current=getText(); + //Fx3D.init(); + //O.move(O.getX(), O.getY()); + ZC.recompute(); + ZC.validate(); + ZC.repaint(); + ZC.update_distant(O, 3); + } + + @Override + public void doQuitMe(Component e) { + if (O==null) { + return; + } + if (!(isValidExpression(getText()))) { + JOptionPane.showMessageDialog(null, Loc("error")); + if (!(isValidExpression(origin))) { + origin="0"; + } + setText(origin); + if (XYZlink.isSelected()) { + X3D.setText(X3D.origin); + Z3D.setText(Z3D.origin); + } + O.setFixed(X3D.getText(), Y3D.getText(), Z3D.getText()); + //O.setFixed("x(O)+("+X3D.getText()+")*(x(X)-x(O))+("+Y3D.getText()+")*(x(Y)-x(O))+("+Z3D.getText()+")*(x(Z)-x(O))", "y(O)+("+X3D.getText()+")*(y(X)-y(O))+("+Y3D.getText()+")*(y(Y)-y(O))+("+Z3D.getText()+")*(y(Z)-y(O))"); + //O.move(O.getX(), O.getY()); + Fx3D.setSelected(true); + ZC.recompute(); + ZC.validate(); + ZC.repaint(); + this.JTF.requestFocus(); + } else { + origin=getText(); + } + } + + public void init() { + boolean fixed3D = (O instanceof VectorObject || O.fixed3D()) && O.fixedCoord3D(); + + if (fixed3D) { + if (isAbsolutePoint()) { + current=Loc("fixedinwindow"); + } else { + current=(isValidExpression(O.getEY3Dpos()))?O.getEY3Dpos():"????"; + } + } else { + if(ASegment.indexOf(typecode)==14){ + VectorObject v = (VectorObject) O; + current=String.valueOf(v.getDeltaY3D()); + } else { + current=String.valueOf(O.getY3D()); + } + } + setText(current); + origin=current; + } + + } + + class myJZ3D extends myJLine { + String origin=""; + String current=""; + + public myJZ3D(String comment, String txt, int comwidth, int width, int height) { + super(comment, txt, comwidth, width, height, true); + contextHelp="prop_coordinates"; + carPopup.setDisabled(","+JTextFieldPopup.LATEXMENU+","); +// fixsize(this.JTF,this.JTF.getSize().width-18,this.JTF.getSize().height); +// fixsize(this,this.getSize().width-30,this.getSize().height); + } + + @Override + public void doAction(Component e) { + if (current.equals(getText())) { + return; + } + Fx3D.setSelected(true); + O.setFixed(X3D.getText(), Y3D.getText(), Z3D.getText()); + //O.setFixed("x(O)+("+X3D.getText()+")*(x(X)-x(O))+("+Y3D.getText()+")*(x(Y)-x(O))+("+Z3D.getText()+")*(x(Z)-x(O))", "y(O)+("+X3D.getText()+")*(y(X)-y(O))+("+Y3D.getText()+")*(y(Y)-y(O))+("+Z3D.getText()+")*(y(Z)-y(O))"); + current=getText(); + //Fx3D.init(); + //O.move(O.getX(), O.getY()); + ZC.recompute(); + ZC.validate(); + ZC.repaint(); + ZC.update_distant(O, 3); + } + + @Override + public void doQuitMe(Component e) { + if (O==null) { + return; + } + if (!(isValidExpression(getText()))) { + JOptionPane.showMessageDialog(null, Loc("error")); + if (!(isValidExpression(origin))) { + origin="0"; + } + setText(origin); + if (XYZlink.isSelected()) { + Y3D.setText(Y3D.origin); + X3D.setText(X3D.origin); + } + O.setFixed(X3D.getText(), Y3D.getText(), Z3D.getText()); + //O.setFixed("x(O)+("+X3D.getText()+")*(x(X)-x(O))+("+Y3D.getText()+")*(x(Y)-x(O))+("+Z3D.getText()+")*(x(Z)-x(O))", "y(O)+("+X3D.getText()+")*(y(X)-y(O))+("+Y3D.getText()+")*(y(Y)-y(O))+("+Z3D.getText()+")*(y(Z)-y(O))"); + //O.move(O.getX(), O.getY()); + Fx3D.setSelected(true); + ZC.recompute(); + ZC.validate(); + ZC.repaint(); + this.JTF.requestFocus(); + } else { + origin=getText(); + } + } + + public void init() { + boolean fixed3D = (O instanceof VectorObject || O.fixed3D()) && O.fixedCoord3D(); + + if (fixed3D) { + if (isAbsolutePoint()) { + current=Loc("fixedinwindow"); + } else { + current=(isValidExpression(O.getEZ3Dpos()))?O.getEZ3Dpos():"????"; + } + } else { + if(ASegment.indexOf(typecode)==14){ + VectorObject v = (VectorObject) O; + current=String.valueOf(v.getDeltaZ3D()); + } else { + current=String.valueOf(O.getZ3D()); + } + } + setText(current); + origin=current; + } + + } + + class myJR extends myJLine { + + String origin=""; + String current=""; + + public myJR(String comment, String txt, int comwidth, int width, int height) { + super(comment, txt, comwidth, width, height, true); + contextHelp="prop_length"; + carPopup.setDisabled(","+JTextFieldPopup.LATEXMENU+","); + } + + @Override + public void doAction(Component e) { + if (current.equals(getText())) { + return; + } + try { + O.setFixed(true, getText()); + O.setFixed(getText()); + O.setDragable(false); + RFx.setSelected(true); + current=getText(); + ZC.recompute(); + ZC.validate(); + ZC.repaint(); + } catch (Exception ex) { + } + + } + + @Override + public void doQuitMe(Component e) { + if (O==null) { + return; + } + if (!(isValidExpression(getText()))) { + JOptionPane.showMessageDialog(null, Loc("error")); + if (!(isValidExpression(origin))) { + origin="0"; + } + + try { + O.setFixed(true, origin); + setText(origin); + RFx.setSelected(true); + ZC.recompute(); + ZC.validate(); + ZC.repaint(); + } catch (Exception ex) { + } + this.JTF.requestFocus(); + } else { + origin=getText(); + } + } + + public void init() { + current=O.getStringLength(); + setText(current); + origin=current; + } + } + + class myJR3D extends myJLine { + + String origin=""; + String current=""; + + public myJR3D(String comment, String txt, int comwidth, int width, int height) { + super(comment, txt, comwidth, width, height, true); + contextHelp="prop_length"; + carPopup.setDisabled(","+JTextFieldPopup.LATEXMENU+","); + } + + @Override + public void doAction(Component e) { + if (current.equals(getText())) { + return; + } + try { + O.setFixed3D(true, getText()); + O.setFixed(getText()); + O.setDragable(false); + RFx3D.setSelected(false); + current=getText(); + ZC.recompute(); + ZC.validate(); + ZC.repaint(); + } catch (Exception ex) { + } + + } + + @Override + public void doQuitMe(Component e) { + if (O==null) { + return; + } + if (!(isValidExpression(getText()))) { + JOptionPane.showMessageDialog(null, Loc("error")); + if (!(isValidExpression(origin))) { + origin="0"; + } + + try { + O.setFixed3D(true, origin); + setText(origin); + RFx3D.setSelected(true); + ZC.recompute(); + ZC.validate(); + ZC.repaint(); + } catch (Exception ex) { + } + this.JTF.requestFocus(); + } else { + origin=getText(); + } + } + + public void init() { + current=((SegmentObject)O).getStringLength3D(); + setText(current); + origin=current; + setEditable(false); + } + } + + class myJA extends myJLine { + + String origin=""; + String current=""; + + public myJA(String comment, String txt, int comwidth, int width, int height) { + super(comment, txt, comwidth, width, height, true); + contextHelp="prop_angle"; + carPopup.setDisabled(","+JTextFieldPopup.LATEXMENU+","); + } + + @Override + public void doAction(Component e) { + if (current.equals(getText())) { + return; + } + try { + O.setFixed(getText()); + O.setDragable(false); + aFx.setSelected(true); + current=getText(); + ZC.recompute(); + ZC.validate(); + ZC.repaint(); + } catch (Exception ex) { + } + + } + + @Override + public void doQuitMe(Component e) { + if (O==null) { + return; + } + if (!(isValidExpression(getText()))) { + JOptionPane.showMessageDialog(null, Loc("error")); + if (!(isValidExpression(origin))) { + origin="0"; + } + + try { + O.setFixed(origin); + setText(origin); + aFx.setSelected(true); + ZC.recompute(); + ZC.validate(); + ZC.repaint(); + } catch (Exception ex) { + } + this.JTF.requestFocus(); + } else { + origin=getText(); + } + } + + public void init() { + current=O.getE(); + setText(current); + origin=current; + } + } + + class myJRFx extends myJLine { + + public myJRFx(String comment, boolean bool, int width, int height) { + super(comment, bool, width, height); + + JCBX.addMouseListener(new MouseAdapter() { + @Override + public void mouseReleased(MouseEvent e) { + if(ASegment.indexOf(typecode)!=-1) { + setObject(O, false, false); + } + } + }); + } + + @Override + public void doAction(Component e) { + if (isSelected()) { + try { + String val=String.valueOf(ValueOf(O.getStringLength())); + ray.setText(val); + O.setDragable(true); + O.setFixed(false, val); + O.setFixed(false); + } catch (Exception ex) { + } + + } else { + try { + String val=String.valueOf(ValueOf(O.getStringLength())); + ray.setText(val); + O.setDragable(false); + O.setFixed(true, val); + O.setFixed(true); + if(ASegment.indexOf(typecode)==14 && O.fixedCoord()){ + O.setFixed(false); + } + } catch (Exception ex) { + } + } + } + + public void init() { + setSelected((!(O.isDragable()))&&(O.fixed())); + } + } + + class myJRFx3D extends myJLine { + + public myJRFx3D(String comment, boolean bool, int width, int height) { + super(comment, bool, width, height); + + JCBX.addMouseListener(new MouseAdapter() { + @Override + public void mouseReleased(MouseEvent e) { + if(ASegment.indexOf(typecode)!=-1) { + setObject(O, false, false); + } + } + }); + } + + @Override + public void doAction(Component e) { + if (isSelected()) { + try { + String val=String.valueOf(ValueOf(O.getStringLength3D())); + O.setFixed3D(false, val); + O.setFixed3D(false); + ray3D.setText(val); + O.setDragable(true); + } catch (Exception ex) { + } + + } else { + try { + String val=String.valueOf(ValueOf(O.getStringLength3D())); + ray3D.setText(val); + O.setDragable(false); + O.setFixed3D(true, val); + O.setFixed3D(true); + if(ASegment.indexOf(typecode)==14 && O.fixedCoord3D()){ + O.setFixed3D(false); + } + } catch (Exception ex) { + } + } + } + + public void init() { + setSelected((!(O.isDragable()))&&(O.fixed3D())); + } + } + + class myJAFx extends myJLine { + + public myJAFx(String comment, boolean bool, int width, int height) { + super(comment, bool, width, height); + } + + @Override + public void doAction(Component e) { + if (isSelected()) { + try { + String val=String.valueOf(ValueOf(O.getE())); + angle.setText(val); + O.setDragable(true); + O.setFixed(false); + } catch (Exception ex) { + } + + } else { + try { + String val=String.valueOf(ValueOf(O.getE())); + angle.setText(val); + O.setDragable(false); + O.setFixed(val); + } catch (Exception ex) { + } + } + } + + public void init() { + setSelected((!(O.isDragable()))&&(O.fixed())); + } + } + + class myJAbsolutePos extends myJLine { + + public myJAbsolutePos(String comment, boolean bool, int width, int height) { + super(comment, bool, width, height); + } + + @Override + public void doAction(Component e) { + if (isSelected()) { + O.setFixed(false); + X.setText(String.valueOf(O.getX())); + Y.setText(String.valueOf(O.getY())); + X.setEditable(true); + Y.setEditable(true); + Fx.setSelected(false); + Fx.JCBX.setEnabled(true); + } else { + String x="(windoww/(windoww-d(windoww)))*(x("+O.getName()+")-windowcx)+windowcx+d(windowcx)"; + String y="(windoww/(windoww-d(windoww)))*(y("+O.getName()+")-windowcy)+windowcy+d(windowcy)"; + O.setFixed(x, y); + X.setEditable(false); + Y.setEditable(false); + X.setText(Loc("fixedinwindow")); + Y.setText(Loc("fixedinwindow")); + Fx.setSelected(true); + Fx.JCBX.setEnabled(false); + ZC.recompute(); + ZC.validate(); + ZC.repaint(); + } + } + + public void init() { + boolean b=isAbsolutePoint(); + setSelected(b); + if (b) { + X.setEditable(false); + Y.setEditable(false); + Fx.JCBX.setEnabled(false); + } + } + } + + class myXYlink extends JEricPanel { + + int H, W; + JButton btn; +// ImageIcon myimage; + + public myXYlink() { + this.setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); + this.setOpaque(false); + btn=new JButton(); + ImageIcon imgOFF=new ImageIcon(getClass().getResource("/eric/GUI/icons/palette/chaineOFF.png")); + btn.setIcon(imgOFF); + btn.setSelectedIcon(new ImageIcon(getClass().getResource("/eric/GUI/icons/palette/chaine.png"))); + btn.setSelected(true); + btn.addMouseListener(new java.awt.event.MouseAdapter() { + + @Override + public void mousePressed(java.awt.event.MouseEvent evt) { + btn.setSelected(!btn.isSelected()); + } + }); + btn.setOpaque(false); + btn.setContentAreaFilled(false); + btn.setFocusable(false); + W=imgOFF.getIconWidth(); + H=imgOFF.getIconHeight(); + fixsize(btn, W, H); + btn.setBorder(BorderFactory.createEmptyBorder()); + this.add(btn); + } + + public boolean isSelected() { + return btn.isSelected(); + } + } + + class myXYZlink extends JEricPanel { + + int H, W; + JButton btn; +// ImageIcon myimage; + + public myXYZlink() { + this.setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); + this.setOpaque(false); + btn=new JButton(); + ImageIcon imgOFF=new ImageIcon(getClass().getResource("/eric/GUI/icons/palette/chaineOFF.png")); + btn.setIcon(imgOFF); + btn.setSelectedIcon(new ImageIcon(getClass().getResource("/eric/GUI/icons/palette/chaine.png"))); + btn.setSelected(true); + btn.addMouseListener(new java.awt.event.MouseAdapter() { + + @Override + public void mousePressed(java.awt.event.MouseEvent evt) { + btn.setSelected(!btn.isSelected()); + } + }); + btn.setOpaque(false); + btn.setContentAreaFilled(false); + btn.setFocusable(false); + W=imgOFF.getIconWidth(); + H=imgOFF.getIconHeight(); + fixsize(btn, W, H); + btn.setBorder(BorderFactory.createEmptyBorder()); + this.add(btn); + } + + public boolean isSelected() { + return btn.isSelected(); + } + } + + class myJGrid extends myJLine { + + String origin=""; + String current=""; + + public myJGrid(String comment, String txt, int comwidth, int width, int height) { + super(comment, txt, comwidth, width, height, true); + contextHelp="prop_grid"; + carPopup.setDisabled(","+JTextFieldPopup.LATEXMENU+","); + } + + @Override + public void doAction(Component e) { + if (current.equals(getText())) { + return; + } + current=getText(); + if (isValidExpression(current)) { + O.setIncrement(ValueOf(current)); + } + ZC.recompute(); + ZC.validate(); + ZC.repaint(); + } + + @Override + public void doQuitMe(Component e) { + if (O==null) { + return; + } + if (!(isValidExpression(getText()))) { + JOptionPane.showMessageDialog(null, Loc("error")); + current=origin; + setText(current); + O.setIncrement(ValueOf(current)); + ZC.recompute(); + ZC.validate(); + ZC.repaint(); + this.JTF.requestFocus(); + } else { + origin=getText(); + setText(String.valueOf(ValueOf(origin))); + } + } + + public void init() { + current=String.valueOf(O.getIncrement()); + setText(current); + origin=current; + } + } + + class myJFx extends myJLine { + + public myJFx(String comment, boolean bool, int width, int height) { + super(comment, bool, width, height); + + JCBX.addMouseListener(new MouseAdapter() { + @Override + public void mouseReleased(MouseEvent e) { + setObject(O, false, false); + } + }); + } + + @Override + public void doAction(Component e) { + if (isSelected()) { + O.setFixed(false); + if(ASegment.indexOf(typecode)==14){ + VectorObject o = (VectorObject) O; + X.setText(String.valueOf(o.getDeltaX())); + Y.setText(String.valueOf(o.getDeltaY())); + } else { + X.setText(String.valueOf(O.getX())); + Y.setText(String.valueOf(O.getY())); + } + } else { + if(ASegment.indexOf(typecode)==14){ + VectorObject o = (VectorObject) O; + O.setFixed(String.valueOf(o.getDeltaX()), String.valueOf(o.getDeltaY())); + if(o.fixed()){ + try{ + o.setFixed(false, O.getStringLength()); + } catch (Exception ee){} + //RFx.init(); + } + } else { + O.setFixed(String.valueOf(O.getX()), String.valueOf(O.getY())); + } + } + } + + public void init() { + JCBX.setEnabled(true); + boolean fixed = (O instanceof VectorObject || O.fixed()) && O.fixedCoord(); + setSelected(fixed); + + } + } + + class myJFx3D extends myJLine { + + public myJFx3D(String comment, boolean bool, int width, int height) { + super(comment, bool, width, height); + + JCBX.addMouseListener(new MouseAdapter() { + @Override + public void mouseReleased(MouseEvent e) { + setObject(O, false, false); + } + }); + } + + @Override + public void doAction(Component e) { + if (isSelected()) { + if (O instanceof PointObject) ((PointObject) O).setFixed3D(false); + if(ASegment.indexOf(typecode)==14){ + VectorObject o = (VectorObject) O; + X3D.setText(String.valueOf(o.getDeltaX3D())); + Y3D.setText(String.valueOf(o.getDeltaY3D())); + Z3D.setText(String.valueOf(o.getDeltaZ3D())); + } else { + X3D.setText(String.valueOf(((PointObject)O).getX3D())); + Y3D.setText(String.valueOf(((PointObject)O).getY3D())); + Z3D.setText(String.valueOf(((PointObject)O).getZ3D())); + } + } else { + if(ASegment.indexOf(typecode)==14){ + VectorObject o = (VectorObject) O; + ((VectorObject)O).setFixed(String.valueOf(o.getDeltaX3D()), String.valueOf(o.getDeltaY3D()), String.valueOf(o.getDeltaZ3D())); + } else { + ((PointObject) O).setFixed(String.valueOf(((PointObject)O).getX3D()), String.valueOf(((PointObject)O).getY3D()),String.valueOf(((PointObject)O).getZ3D())); + setSelected(true); + } + } + } + + public void init() { + JCBX.setEnabled(true); + boolean fixed = (O instanceof VectorObject || (O instanceof PointObject&&((PointObject)O).fixed3D())) && O.fixedCoord3D(); + setSelected(fixed); + } + } + + class myTRK extends myJLine { + + public myTRK(String comment, boolean bool, int width, int height) { + super(comment, bool, width, height); + } + + @Override + public void doAction(Component e) { + if (isSelected()) { + if (MultipleObjects!=null) { + multiple_setTracked(false); + } + O.setTracked(false); + } else { + if (MultipleObjects!=null) { + multiple_setTracked(true); + } + O.setTracked(true); + } + ZC.update_distant(O, 3); + } + + public void init() { + JCBX.setEnabled(true); + setSelected(O.tracked()); + + } + } + + class myJInside extends myJLine { + + public myJInside(String comment, boolean bool, int width, int height) { + super(comment, bool, width, height); + } + + @Override + public void doAction(Component e) { + O.setInside(!isSelected()); + ZC.recompute(); + ZC.validate(); + ZC.repaint(); + } + + public void init() { + setSelected(O.isInside()); + } + } + + class myJTextArea extends ContentLine { + + JButton carBTN=null; + JTextArea JTX; + + public myJTextArea(String mytxt, int width, int height) { + super(width, height); + this.setFocusable(false); + this.add(margin(5)); + JTX=new JTextArea(mytxt); + JTX.setFont(F_TextArea); + JTX.setBackground(new Color(245, 246, 255)); +// JTX.setBorder(BorderFactory.createEtchedBorder()); + + JTX.addKeyListener(new KeyAdapter() { + + @Override + public void keyReleased(KeyEvent e) { + doAction(e.getComponent()); + } + }); + JTX.addFocusListener(new FocusAdapter() { + + @Override + public void focusGained(FocusEvent e) { +// JTX.selectAll(); + carBTN.setEnabled(true); + } + + @Override + public void focusLost(FocusEvent e) { + carBTN.setEnabled(false); + doQuitMe(e.getComponent()); + } + }); + JTX.setLineWrap(true); + +// + JScrollPane jstxt=new JScrollPane(JTX); + jstxt.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); + jstxt.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); + +// jstxt.setViewportView(JTX); +// fixsize(jstxt,PW-11,h); + this.add(jstxt); + ImageIcon carimg=new ImageIcon(getClass().getResource("/eric/GUI/icons/bar/carbtn.png")); + ImageIcon carimg_dis=new ImageIcon(getClass().getResource("/eric/GUI/icons/bar/carbtn_dis.png")); + carBTN=new JButton(carimg); + carBTN.setDisabledIcon(carimg_dis); +// carbtn.setRolloverIcon(closeoverimg); + carBTN.setBorder(BorderFactory.createEmptyBorder()); + carBTN.setOpaque(false); + carBTN.setContentAreaFilled(false); + carBTN.setFocusable(false); + carBTN.addMouseListener(new MouseAdapter() { + + @Override + public void mousePressed(MouseEvent e) { + doShowPopup(e); + } + }); + carBTN.setEnabled(false); + this.add(margin(2)); + this.add(carBTN); + } + + public void doShowPopup(MouseEvent e) { + if (carBTN.isEnabled()) { + JTextFieldPopup mypop=new JTextFieldPopup(JTX); + mypop.addPopupMenuListener(new PopupMenuListener() { + + @Override + public void popupMenuWillBecomeVisible(PopupMenuEvent arg0) { + } + + @Override + public void popupMenuWillBecomeInvisible(PopupMenuEvent arg0) { + doAction(JTX); + } + + @Override + public void popupMenuCanceled(PopupMenuEvent arg0) { + } + }); + mypop.openMenu(e); + } + } + + public void setText(String txt) { + JTX.setText(txt); + } + + public String getText() { + return JTX.getText(); + } + + public void doAction(Component cp) { + if (O.getText().equals(getText())) { + return; + } + O.setLines(getText()); + O.setText(getText(), true); +// setText(O.getText()); + ZC.recompute(); + ZC.validate(); + ZC.repaint(); + ZC.update_distant(O, 3); + } + + public void doQuitMe(Component cp) { + } + + public void init() { + setText(O.getLines()); + } + + ; + } + + class myJExpression extends myJLine { + + String origin=""; + + public myJExpression(String comment, String txt, int comwidth, int width, int height) { + super(comment, txt, comwidth, width, height, true); + carPopup.setDisabled(","+JTextFieldPopup.LATEXMENU+","); + } + + public void init() { + origin=O.getExpression(); + if (O.isSlider()) { + setText(""); + } else { + setText(origin); + } + } + + @Override + public void doAction(Component e) { + if (getText().equals("")) { + O.setSlider(min.getText(), max.getText()); + slider.setSelected(true); + try { + O.setExpression(min.getText(), O.getConstruction()); + } catch (Exception ex) { + } + } else { + try { + O.setExpression(getText(), O.getConstruction()); + O.setSlider(false); + slider.setSelected(false); + } catch (Exception ex) { + } + } + ZC.recompute(); + ZC.validate(); + ZC.repaint(); + } + + @Override + public void doQuitMe(Component e) { + if (O==null) { + return; + } + if (getText().equals("")) { + return; + } + if (!(isValidExpression(getText()))) { + JOptionPane.showMessageDialog(null, Loc("error")); + if (!(isValidExpression(origin))) { + origin="0"; + } + setText(origin); + try { + O.setExpression(origin, O.getConstruction()); + } catch (ConstructionException ex) { + } + this.JTF.requestFocus(); + } else { + origin=getText(); + try { + O.setExpression(origin, O.getConstruction()); + O.setSlider(false); + slider.setSelected(false); + } catch (ConstructionException ex) { + } + } + ZC.recompute(); + ZC.validate(); + ZC.repaint(); + + } + } + + class myJPrompt extends myJLine { + + public myJPrompt(String comment, String txt, int comwidth, int width, int height) { + super(comment, txt, comwidth, width, height, true); + carPopup.setDisabled(","+JTextFieldPopup.FUNCTIONMENU+","); + } + + @Override + public void doAction(Component e) { + if ((O.getPrompt()!=null)&&(O.getPrompt().equals(getText()))) { + return; + } + O.setPrompt(getText()); + O.setShowName(true); + show.forceSelect(2); + ZC.repaint(); + } + + public void init() { + setText(O.getPrompt()); + } + } + + class myJSMin extends myJLine { + + String origin=""; + String current=""; + + public myJSMin(String comment, String txt, int comwidth, int width, int height) { + super(comment, txt, comwidth, width, height, true); + carPopup.setDisabled(","+JTextFieldPopup.LATEXMENU+","); + } + + @Override + public void doAction(Component e) { + if (current.equals(getText())) { + return; + } + + O.setSlider(getText(), max.getText()); + slider.setSelected(true); + current=getText(); + Exp.setText(""); + if (isValidExpression(current)) { + try { + O.setExpression(current, O.getConstruction()); + } catch (ConstructionException ex) { + } + } + ZC.recompute(); + ZC.validate(); + ZC.repaint(); + } + + @Override + public void doQuitMe(Component e) { + if (O==null) { + return; + } + if (!(isValidExpression(getText()))) { + JOptionPane.showMessageDialog(null, Loc("error")); + if (!(isValidExpression(origin))) { + origin="0"; + } + setText(origin); + O.setSlider(getText(), max.getText()); + try { + O.setExpression(origin, O.getConstruction()); + } catch (ConstructionException ex) { + } +// slider.setSelected(true); + ZC.recompute(); + ZC.validate(); + ZC.repaint(); + this.JTF.requestFocus(); + } else { + origin=getText(); + current=origin; + if (ValueOf(current)>=ValueOf(max.getText())) { + String goodmax=String.valueOf(ValueOf(getText())+10); + max.setText(goodmax); + if (O.isSlider()) { + O.setSlider(getText(), goodmax); + try { + O.setExpression(current, O.getConstruction()); + } catch (ConstructionException ex) { + } + ZC.recompute(); + ZC.validate(); + ZC.repaint(); + } + } + } + } + + public void init() { + if (O.isSlider()) { + setText(O.getMin()); + } else { + setText("-5"); + } + origin=getText(); + } + } + + class myJSMax extends myJLine { + + String origin=""; + String current=""; + + public myJSMax(String comment, String txt, int comwidth, int width, int height) { + super(comment, txt, comwidth, width, height, true); + carPopup.setDisabled(","+JTextFieldPopup.LATEXMENU+","); + } + + @Override + public void doAction(Component e) { + if (current.equals(getText())) { + return; + } + O.setSlider(min.getText(), getText()); + slider.setSelected(true); + current=getText(); + Exp.setText(""); + if (isValidExpression(current)) { + try { + O.setExpression(min.getText(), O.getConstruction()); + } catch (ConstructionException ex) { + } + } + ZC.recompute(); + ZC.validate(); + ZC.repaint(); + } + + @Override + public void doQuitMe(Component e) { + if (O==null) { + return; + } + if (!(isValidExpression(getText()))) { + JOptionPane.showMessageDialog(null, Loc("error")); + if (!(isValidExpression(origin))) { + origin="0"; + } + setText(origin); + O.setSlider(min.getText(), getText()); + slider.setSelected(true); + ZC.recompute(); + ZC.validate(); + ZC.repaint(); + this.JTF.requestFocus(); + } else { + origin=getText(); + current=origin; + if (ValueOf(current)<=ValueOf(min.getText())) { + String goodmin=String.valueOf(ValueOf(getText())-10); + O.setSlider(goodmin, getText()); + min.setText(goodmin); + try { + O.setExpression(goodmin, O.getConstruction()); + } catch (ConstructionException ex) { + } + ZC.recompute(); + ZC.validate(); + ZC.repaint(); + } + } + } + + public void init() { + if (O.isSlider()) { + setText(O.getMax()); + } else { + setText("5"); + } + origin=getText(); + } + } + + class myJSSlider extends myJLine { + + public myJSSlider(String comment, boolean bool, int width, int height) { + super(comment, bool, width, height); + } + + @Override + public void doAction(Component e) { + if (isSelected()) { + O.setSlider(false); + Exp.setText(Exp.origin); + try { + O.setExpression(Exp.origin, O.getConstruction()); + } catch (ConstructionException ex) { + } + Exp.JTF.selectAll(); + Exp.JTF.requestFocus(); + } else { + Exp.setText(""); + O.setSlider(min.getText(), max.getText()); + try { + O.setExpression(min.getText(), O.getConstruction()); + } catch (ConstructionException ex) { + } + min.JTF.selectAll(); + min.JTF.requestFocus(); + } + ZC.recompute(); + ZC.validate(); + ZC.repaint(); + } + + public void init() { + setSelected(O.isSlider()); + } + } + + class myJUserFunction extends myRub { + + JComboBox JCB; + ContentLine comboline; + UserFunctionObject f; + boolean doaction=true; + + public myJUserFunction(String comment, String txt, int comwidth, int linewidth, int lineheight) { + super("user fonction"); + comboline=new ContentLine(linewidth, lineheight); + comboline.setFocusable(false); + addnewlabel(comment, comwidth, lineheight); + + JCB=new JComboBox(); + JCB.setUI((ComboBoxUI) MyComboBoxUI.createUI(JCB)); + JCB.setFont(F_ComboBox); + JCB.addItem("x"); + JCB.addItem("x y"); + JCB.addItem("x y z"); + JCB.addItem("x y z t"); + JCB.setMaximumRowCount(5); + JCB.setOpaque(false); + JCB.setFocusable(false); + JCB.setEditable(false); + fixsize(JCB, linewidth-comwidth, lineheight); + JCB.addItemListener(new ItemAdapter()); + comboline.add(JCB); + } + + class ItemAdapter implements ItemListener { + + @Override + public void itemStateChanged(ItemEvent evt) { + if (evt.getStateChange()==ItemEvent.SELECTED) { + if (doaction) { + String menuitem=(String) evt.getItem(); + doAction(menuitem); + } + } + } + } + + public void addnewlabel(String comment, int w, int h) { + JLabel myTXT=new JLabel(comment); + myTXT.setFocusable(false); + myTXT.setFont(F_Label); + fixsize(myTXT, w, h); + comboline.add(myTXT); + } + + public void doAction(Object item) { + fuey.setVar((String) item); + fuey.JTF.requestFocus(); + ZC.recompute(); + ZC.validate(); + ZC.repaint(); + this.validate(); + } + + public void init() { + f=(UserFunctionObject) O; + this.removeAll(); + this.add(margintop(2)); + fuey.init(); + this.add(fuey); + this.add(margintop(fuey.H+1)); + this.add(comboline); + + this.revalidate(); + JCB.setSelectedItem(f.getVar()); + doaction=true; + } + } + + class myJEqXY extends myJLine { + + String origin=""; + String current="0"; + EquationXYObject f; + + public myJEqXY(String comment, String txt, int comwidth, int width, int height) { + super(comment, txt, comwidth, width, height, true); + remove(carBTN); + addnewlabel(" = 0", 35, H); + carPopup.setDisabled(","+JTextFieldPopup.LATEXMENU+","); + add(carBTN); + } + + @Override + public void doAction(Component e) { + if (current.equals(getText())) { + return; + } + setEquation(getText()); + } + + public void setEquation(String cf) { + current=cf; + f=(EquationXYObject) O; + f.setEquation(cf, ZC); + ZC.recompute(); + ZC.validate(); + ZC.repaint(); + ZC.reloadCD(); + f.compute(); +// } + } + + @Override + public void doQuitMe(Component e) { + if (O==null) { + return; + } + origin=getText(); + } + + public void init() { + f=(EquationXYObject) O; + current=f.getEY(); + setText(current); + origin=current; + } + } + + class myJUserF_Y extends myJLine { + + String origin=""; + String current="0"; + String currentvars="x"; + UserFunctionObject f; + + public myJUserF_Y(String comment, String txt, int comwidth, int width, int height) { + super(comment, txt, comwidth, width, height, true); + carPopup.setDisabled(","+JTextFieldPopup.LATEXMENU+","); + } + + @Override + public void doAction(Component e) { + if (current.equals(getText())) { + return; + } + setExpression(currentvars, getText()); + } + + public void setExpression(String v, String cf) { +// if (isValidExpression(cf)){ + currentvars=v; + current=cf; + f=(UserFunctionObject) O; + f.setExpressions(currentvars, current); + myTXT.setText("f("+currentvars.replaceAll(" ", ",")+")="); + ZC.recompute(); + ZC.validate(); + ZC.repaint(); + ZC.reloadCD(); +// } + } + + public void setVar(String v) { + setExpression(v, current); + } + + @Override + public void doQuitMe(Component e) { + if (O==null) { + return; + } + origin=getText(); + } + + public void init() { + f=(UserFunctionObject) O; + current=f.getEY(); + currentvars=f.getVar(); + setText(current); + origin=current; + } + } + + // Tells if the function or track must be plot + // with points only or segments : + class myJF_pt extends myJLine { + + public myJF_pt(String comment, boolean bool, int width, int height) { + super(comment, bool, width, height); + } + + @Override + public void doAction(Component e) { + + O.setSpecial((!isSelected())); + ZC.recompute(); + ZC.validate(); + ZC.repaint(); + } + + public void init() { + setSelected(O.isSpecial()); + } + } + + class myJF_Discrete extends myJLine { + + TrackObject t; + + public myJF_Discrete(String comment, boolean bool, int width, int height) { + super(comment, bool, width, height); + } + + @Override + public void doAction(Component e) { + t.setDiscrete((!isSelected())); + ZC.recompute(); + ZC.validate(); + ZC.repaint(); + } + + public void init() { + t=(TrackObject) O; + setSelected(t.isDiscrete()); + } + } + + class myJF_d extends myJLine { + + String origin=""; + String current=""; + FunctionObject f; + + public myJF_d(String comment, String txt, int comwidth, int width, int height) { + super(comment, txt, comwidth, width, height, true); + carPopup.setDisabled(","+JTextFieldPopup.LATEXMENU+","); + } + + @Override + public void doAction(Component e) { + if (current.equals(getText())) { + return; + } + current=getText(); + if (current.equals("")) { + current="0"; + } +// if (isValidExpression(current)){ + f.setRange(f.VarMin.toString(), f.VarMax.toString(), current); + ZC.recompute(); + ZC.validate(); + ZC.repaint(); +// } + } + + @Override + public void doQuitMe(Component e) { +// origin=getText(); + if (O==null) { + return; + } + if (!(isValidExpression(current))) { + JOptionPane.showMessageDialog(null, Loc("error")); + if (!(isValidExpression(origin))) { + origin="0"; + } + setText(origin); + current=origin; + f.setRange(f.VarMin.toString(), f.VarMax.toString(), current); + ZC.recompute(); + ZC.validate(); + ZC.repaint(); + this.JTF.requestFocus(); + } else { + origin=current; + } + } + + public void init() { + f=(FunctionObject) O; + current=f.DVar.toString(); + if (current.equals("0")) { + setText(""); + } else { + setText(current); + } + origin=current; + } + } + + class myJF_DMin extends myJLine { + + String origin=""; + String current=""; + TrackObject t; + + public myJF_DMin(String comment, String txt, int comwidth, int width, int height) { + super(comment, txt, comwidth, width, height); + } + + @Override + public void doAction(Component e) { + if (current.equals(getText())) { + return; + } + current=getText(); + if (isValidExpression(current)) { + t.setDMin(ValueOf(current)); + } + ZC.recompute(); + ZC.validate(); + ZC.repaint(); + } + + @Override + public void doQuitMe(Component e) { + if (O==null) { + return; + } + if (!(isValidExpression(getText()))) { + JOptionPane.showMessageDialog(null, Loc("error")); + current=origin; + setText(current); + t.setDMin(ValueOf(current)); + ZC.recompute(); + ZC.validate(); + ZC.repaint(); + this.JTF.requestFocus(); + } else { + origin=getText(); + setText(String.valueOf(ValueOf(origin))); + } + } + + public void init() { + t=(TrackObject) O; + current=String.valueOf(t.getDMin()); + setText(current); + origin=current; + } + } + + class myJF_Min extends myJLine { + + String origin=""; + String current=""; + FunctionObject f; + + public myJF_Min(String comment, String txt, int comwidth, int width, int height) { + super(comment, txt, comwidth, width, height, true); + carPopup.setDisabled(","+JTextFieldPopup.LATEXMENU+","); + } + + @Override + public void doAction(Component e) { + if (current.equals(getText())) { + return; + } + current=getText(); + if (current.equals("")) { + current="windowcx-windoww"; + } + f.setRange(current, f.VarMax.toString(), f.DVar.toString()); + ZC.recompute(); + ZC.validate(); + ZC.repaint(); + } + + @Override + public void doQuitMe(Component e) { + if (O==null) { + return; + } + if (!(isValidExpression(current))) { + JOptionPane.showMessageDialog(null, Loc("error")); + if (!(isValidExpression(origin))) { + origin="0"; + } + setText(origin); + current=origin; + f.setRange(current, f.VarMax.toString(), f.DVar.toString()); + ZC.recompute(); + ZC.validate(); + ZC.repaint(); + this.JTF.requestFocus(); + } else { + origin=current; + } + } + + public void init() { + f=(FunctionObject) O; + current=f.VarMin.toString(); + if (current.equals("windowcx-windoww")) { + setText(""); + } else { + setText(current); + } + origin=current; + } + } + + class myJF_Max extends myJLine { + + String origin=""; + String current=""; + FunctionObject f; + + public myJF_Max(String comment, String txt, int comwidth, int width, int height) { + super(comment, txt, comwidth, width, height, true); + carPopup.setDisabled(","+JTextFieldPopup.LATEXMENU+","); + } + + @Override + public void doAction(Component e) { + if (current.equals(getText())) { + return; + } + current=getText(); + if (current.equals("")) { + current="windowcx+windoww"; + } + f.setRange(f.VarMin.toString(), current, f.DVar.toString()); + ZC.recompute(); + ZC.validate(); + ZC.repaint(); + } + + @Override + public void doQuitMe(Component e) { + if (O==null) { + return; + } + if (!(isValidExpression(current))) { + JOptionPane.showMessageDialog(null, Loc("error")); + if (!(isValidExpression(origin))) { + origin="0"; + } + setText(origin); + current=origin; + f.setRange(f.VarMin.toString(), current, f.DVar.toString()); + ZC.recompute(); + ZC.validate(); + ZC.repaint(); + this.JTF.requestFocus(); + } else { + origin=current; + } + } + + public void init() { + f=(FunctionObject) O; + current=f.VarMax.toString(); + if (current.equals("windowcx+windoww")) { + setText(""); + } else { + setText(current); + } + origin=current; + } + } + + class myJF_X extends myJLine { + + String origin=""; + String current=""; + FunctionObject f; + + public myJF_X(String comment, String txt, int comwidth, int width, int height) { + super(comment, txt, comwidth, width, height, true); + carPopup.setDisabled(","+JTextFieldPopup.LATEXMENU+","); + } + + @Override + public void doAction(Component e) { + if (current.equals(getText())) { + return; + } + current=getText(); +// if (isValidExpression(current)){ + f.setExpressions(f.Var[0], current, f.getEY()); + ZC.recompute(); + ZC.validate(); + ZC.repaint(); + ZC.update_distant(f, 3); +// } + } + + @Override + public void doQuitMe(Component e) { + if (O==null) { + return; + } + origin=getText(); +// if (!(isValidExpression(getText()))) { +// JOptionPane.showMessageDialog(null, Loc("error")); +// if (!(isValidExpression(origin))) origin="0"; +// setText(origin); +// current=origin; +// this.JTF.requestFocus(); +// }else{ +// origin=getText(); +// } + } + + public void init() { + f=(FunctionObject) O; + current=f.getEX(); + setText(current); + origin=current; + } + } + + class myJF_Y extends myJLine { + + String origin=""; + String current=""; + FunctionObject f; + + public myJF_Y(String comment, String txt, int comwidth, int width, int height) { + super(comment, txt, comwidth, width, height, true); + carPopup.setDisabled(","+JTextFieldPopup.LATEXMENU+","); + } + + @Override + public void doAction(Component e) { + if (current.equals(getText())) { + return; + } + current=getText(); +// if (isValidExpression(current)){ + f.setExpressions(f.Var[0], f.getEX(), current); + ZC.recompute(); + ZC.validate(); + ZC.repaint(); + ZC.update_distant(f, 3); +// } + } + + @Override + public void doQuitMe(Component e) { + if (O==null) { + return; + } + origin=getText(); +// if (!(isValidExpression(getText()))) { +// JOptionPane.showMessageDialog(null, Loc("error")); +// if (!(isValidExpression(origin))) origin="0"; +// setText(origin); +// current=origin; +// this.JTF.requestFocus(); +// }else{ +// origin=getText(); +// } + } + + public void init() { + f=(FunctionObject) O; + current=f.getEY(); + setText(current); + if (func.cartesian) { + this.setLabelTxt("f(x)="); + } else { + this.setLabelTxt("y(t)="); + } + origin=current; + } + } + + class myJFunction extends myRub { + + myJFunctionselector myJsel; + myJFunction ME; + FunctionObject f; + public boolean cartesian; + boolean doaction=true; + + public myJFunction(String comment, String txt, int comwidth, int linewidth, int lineheight) { + super("fonction"); + myJsel=new myJFunctionselector(Loc("parametric"), true, linewidth, lineheight); + ME=this; + } + + public void init() { + f=(FunctionObject) O; + cartesian=(f.Var[0].equals(f.getEX())); + this.removeAll(); + this.add(margintop(2)); + doaction=false; +// f.setRange("-5","5","0.1"); + + if (cartesian) { + + fey.init(); + this.add(fey); + myJsel.setSelected(false); + this.add(margintop(fex.H+2)); + } else { + + fex.init(); + fey.init(); + this.add(fex); + this.add(margintop(1)); + this.add(fey); + this.add(margintop(1)); + myJsel.setSelected(true); + } + this.add(myJsel); + this.revalidate(); + this.repaint(); + doaction=true; + } + + class myJFunctionselector extends myJLine { + + public myJFunctionselector(String comment, boolean bool, int width, int height) { + super(comment, bool, width, height); + } + + @Override + public void doAction(Component e) { + ME.removeAll(); + ME.add(margintop(2)); + cartesian=isSelected(); + if (cartesian) { + f.setRange("windowcx-windoww", "windowcx+windoww", "0"); + f.setExpressions("x", "", "0"); + + fmin.init(); + fmax.init(); + fd.init(); + fey.init(); + ME.add(fey); + fey.JTF.requestFocus(); + ME.add(margintop(fex.H+2)); + } else { + f.setRange("-pi", "pi", "0"); + f.setExpressions("t", "rsin(t)", "rcos(t)"); + fmin.init(); + fmax.init(); + fd.init(); + fex.init(); + fey.init(); + ME.add(fex); + ME.add(margintop(1)); + ME.add(fey); + ME.add(margintop(1)); + fex.JTF.requestFocus(); + } + ME.add(this); + ZC.recompute(); + ZC.validate(); + ZC.repaint(); + ME.revalidate(); + ME.repaint(); + } + } + } + + class myBtn extends JButton { + + int H, W; + + public myBtn(String label, int width, int height) { + H=height; + W=width; + this.setText(label); + this.setFont(F_Button); + fixsize(this, width, height); + this.setFocusable(false); + this.addMouseListener(new MouseAdapter() { + + @Override + public void mouseClicked(MouseEvent evt) { + doClick(); + } + }); + } + + @Override + public void doClick() { + } + } + + class myMagnetBtn extends myBtn { + + public myMagnetBtn(int width, int height) { + super("", width, height); + ImageIcon img=new ImageIcon(getClass().getResource("/eric/GUI/icons/bar/aimant.png")); + ImageIcon selimg=new ImageIcon(getClass().getResource("/eric/GUI/icons/bar/aimantON.png")); + setIcon(img); + setSelectedIcon(selimg); + setBorder(BorderFactory.createEtchedBorder()); + this.setFocusable(true); + } + + public void init() { +// PointObject p = (PointObject) O; +// if (p.isPointOn()) { +// this.setText(Loc("release")); +// } else { +// this.setText(Loc("bind")); +// } + setSelected(false); + } + + @Override + public void doClick() { + if (!isSelected()) { + ZC.setMagnetTool((PointObject) O); + setSelected(true); + } else { + setSelected(false); + ZC.reset(); + } + } + } + + class myArcBtn extends myBtn { + + public myArcBtn(int width, int height) { + super("", width, height); + } + + public void init() { + PrimitiveCircleObject o=(PrimitiveCircleObject) O; + if (o.hasRange()) { + this.setText(Loc("killarc")); + } else { + this.setText(Loc("arc")); + } + } + + @Override + public void doClick() { + PrimitiveCircleObject o=(PrimitiveCircleObject) O; + if (o.hasRange()) { + o.clearRange(); + this.setText(Loc("arc")); + } else { + ZC.range(o); + this.setText(Loc("killarc")); + } + ZC.validate(); + ZC.repaint(); + } + } + + class myPtBindBtn extends myBtn { + + public myPtBindBtn(int width, int height) { + super("", width, height); + } + + public void init() { + PointObject p=(PointObject) O; + if (p.isPointOn()) { + this.setText(Loc("release")); + } else { + this.setText(Loc("bind")); + } + } + + @Override + public void doClick() { + PointObject p=(PointObject) O; + if (p.isPointOn()) { + p.setBound(""); + O.getConstruction().updateCircleDep(); + this.setText(Loc("bind")); + setObject(O, false, false); + } else { + ZC.bind(p); + this.setText(Loc("release")); + } + ZC.validate(); + ZC.repaint(); + } + } + + class myPtAwayBtn extends myJLine { + + public myPtAwayBtn(String comment, String txt, int comwidth, int width, int height) { + super(comment, txt, comwidth, width, height); + JTF.setHorizontalAlignment(JTextField.CENTER); + } + + public void clear(){ + if (O instanceof IntersectionObject) { + IntersectionObject P=(IntersectionObject) O; + if ((P.getAway()!=null)&&(P.stayAway())) { + P.setAway(""); + ZC.validate(); + ZC.repaint(); + } + } + JTF.setText(""); + } + + @Override + public void doEnter() { + ptclosebtn.clear(); + ZC.setAway((IntersectionObject) O, true); + O.setStrongSelected(true); + if (O instanceof IntersectionObject) { + IntersectionObject P=(IntersectionObject) O; + if (P.getAway()!=null) { + P.getAway().setSelected(true); + } + } + } + + public void init() { + if (O instanceof IntersectionObject) { + IntersectionObject P=(IntersectionObject) O; + if ((P.getAway()!=null)&&(P.stayAway())) { + JTF.setText(P.getAway().getName()); + } else { + JTF.setText(""); + } + } else { + JTF.setText(""); + } + setInitValue(); + } + + @Override + public void doAction(Component e) { + ZC.clearSelected(); + O.setStrongSelected(true); + if (O instanceof IntersectionObject) { + IntersectionObject P=(IntersectionObject) O; + P.setAway(JTF.getText()); + if (P.getAway()!=null) { + P.getAway().setSelected(true); + } + } + ZC.validate(); + ZC.repaint(); + } + } + + class myPtCloseBtn extends myJLine { + + public myPtCloseBtn(String comment, String txt, int comwidth, int width, int height) { + super(comment, txt, comwidth, width, height); + JTF.setHorizontalAlignment(JTextField.CENTER); + } + + public void clear(){ + if (O instanceof IntersectionObject) { + IntersectionObject P=(IntersectionObject) O; + if ((P.getAway()!=null)&&(!P.stayAway())) { + P.setAway(""); + ZC.validate(); + ZC.repaint(); + } + } + JTF.setText(""); + } + + @Override + public void doEnter() { + ptawaybtn.clear(); + ZC.setAway((IntersectionObject) O, false); + O.setStrongSelected(true); + if (O instanceof IntersectionObject) { + IntersectionObject P=(IntersectionObject) O; + if (P.getAway()!=null) { + P.getAway().setSelected(true); + } + } + } + + public void init() { + if (O instanceof IntersectionObject) { + IntersectionObject P=(IntersectionObject) O; + if ((P.getAway()!=null)&&(!P.stayAway())) { + JTF.setText(P.getAway().getName()); + } else { + JTF.setText(""); + } + } else { + JTF.setText(""); + } + setInitValue(); + } + + @Override + public void doAction(Component e) { + ZC.clearSelected(); + O.setStrongSelected(true); + if (O instanceof IntersectionObject) { + IntersectionObject P=(IntersectionObject) O; + P.setAway(JTF.getText(),false); + if (P.getAway()!=null) { + P.getAway().setSelected(true); + } + } + ZC.validate(); + ZC.repaint(); + } + } + + + + class myJIcon extends JButton implements MouseListener { + + String name; + Vector V;// contain 1 elt-> togglebutton , contain more elts-> group member + public int code;// + boolean isSelected; // icon state + boolean isGrouped; + boolean isEntered=false; // Mouseover ? + private ImageIcon myimage; + int iconsize; + + @Override + public void paintComponent(java.awt.Graphics g) { + /* I learned things from this pages : + http://java.sun.com/developer/technicalArticles/GUI/java2d/java2dpart1.html + http://www.apl.jhu.edu/~hall/java/Java2D-Tutorial.html + */ + super.paintComponent(g); + java.awt.Dimension d=this.getSize(); + int w=d.width; + int h=d.height; + + Graphics2D g2=(Graphics2D) g; + g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, + RenderingHints.VALUE_ANTIALIAS_ON); + g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, + RenderingHints.VALUE_TEXT_ANTIALIAS_ON); + g2.setRenderingHint(RenderingHints.KEY_RENDERING, + RenderingHints.VALUE_RENDER_QUALITY); + g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, + RenderingHints.VALUE_INTERPOLATION_BICUBIC); + g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, + RenderingHints.VALUE_STROKE_PURE); + g2.drawImage(myimage.getImage(), 0, 0, w, h, this); + + if (isSelected) { + AlphaComposite ac= + AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.2f); + g2.setComposite(ac); + g2.setColor(new Color(0, 0, 100)); + g2.fillRect(1, 1, w-2, h-2); + } + if (isEntered) { + AlphaComposite ac= + AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.1f); + g2.setComposite(ac); + g2.setColor(new Color(0, 0, 80)); + Stroke stroke=new BasicStroke(3f); + g2.setStroke(stroke); + g2.drawRect(2, 2, w-4, h-4); + + } + + } + + // Create an Icon wich belongs to a group + // If Vector is null, then it's a simple toggle button + public myJIcon(String nm, Vector v, int sze, boolean isgrouped) { + name=nm; + this.isSelected=false; + this.isGrouped=isgrouped; + this.V=v; + this.iconsize=sze; + URL myurl=getClass().getResource("/eric/GUI/icons/bar/"+name+".png"); + myimage=new ImageIcon(myurl); +// this.setIcon(new ImageIcon(myurl)); + this.setOpaque(false); + this.setBorder(BorderFactory.createEmptyBorder()); + + float k=(1.0f*sze)/myimage.getIconWidth(); + int w=Math.round(k*myimage.getIconWidth()); + int h=Math.round(k*myimage.getIconHeight()); + fixsize(this, w, h); + this.setContentAreaFilled(false); + this.setFocusable(false); + this.addMouseListener(this); + code=V.size(); + V.add(this); + } + + @Override + public void setSelected(boolean bool) { + isSelected=bool; + repaint(); + } + + @Override + public boolean isSelected() { + return isSelected; + } + + public void select() { + if (isGrouped) { + for (int i=0; i. + + */ +package eric.bar; + +import eric.GUI.palette.PaletteManager; +import eric.GUI.pipe_tools; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Point; +import java.awt.Toolkit; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionListener; + +import javax.swing.BorderFactory; +import javax.swing.BoxLayout; +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JComponent; +import javax.swing.JFrame; +import eric.JEricPanel; + +import rene.gui.Global; +import rene.zirkel.objects.ConstructionObject; +import eric.controls.JCanvasPanel; +import eric.macros.CreateMacroDialog; +import java.awt.event.ActionEvent; +import java.awt.event.KeyEvent; +import java.util.ArrayList; +import javax.swing.AbstractAction; +import javax.swing.KeyStroke; + +/** + * + * @author erichake + */ +public class JPropertiesBar extends JFrame implements MouseListener, + MouseMotionListener { + + static private int Bx=0, By=0, Bwidth=1078, Bheight=60; + CPane CP; + TitleBar titlebar; + static JControlProperties Content; + private MouseEvent pressed; + private Point location; + private static JPropertiesBar JPB=null; + + public JPropertiesBar() { + JPB=this; + Bx=Global.getParameter("props.paletteX", 0); + if (Bx v){ + if ((JPB!=null)&&(v!=null)&&(v.size()>0)) { + JPB.setObjects(v); + } + } + + static public void EditObject(final ConstructionObject o) { + EditObject(o, true, true); + } + + static public void EditObject(final ConstructionObject o, + final boolean forcevisible, final boolean forcefocus) { + if ((JPB!=null)&&(o!=null)) { + + JPB.setObject(o, forcevisible, forcefocus); + } + } + + static public void EditObject(final JCanvasPanel jcp) { + if ((JPB!=null)&&(jcp.O!=null)) { + JPB.setObject(jcp); + } + } + + static public void SelectPropertiesTab(final int i) { + JPB.selectTab(i); + } + + static public void RefreshBar() { + if (JPB!=null) { + JPB.refresh(); + } + } + + // Only called at first launch (applet or application) : + static public void CreatePropertiesBar() { + JPB=new JPropertiesBar(); + JPB.showme(false); + } + + private void setObjects(ArrayList v) { + showme(true); + Content.setObjects(v); + } + + public void setObject(final ConstructionObject O, + final boolean forcevisible, final boolean forcefocus) { + + if (forcevisible) { + showme(true); + } + if ((!this.isVisible())&&(!forcefocus)) { + return; + } + + Content.setObject(O, forcevisible, forcefocus); + + } + + public void selectTab(final int i) { + Content.selectTab(i); + } + + public void setObject(final JCanvasPanel jcp) { + showme(true); + Content.setObject(jcp); + } + + private static void fixsize(final JComponent cp, final int w, final int h) { + final Dimension d=new Dimension(w, h); + cp.setMaximumSize(d); + cp.setMinimumSize(d); + cp.setPreferredSize(d); + cp.setSize(d); + } + + + + private class TitleBar extends JEricPanel { + + ImageIcon closeimg=new ImageIcon(getClass().getResource( + "gui/Pclose.png")); + ImageIcon closeoverimg=new ImageIcon(getClass().getResource( + "gui/Pcloseover.png")); + ImageIcon myicon=new ImageIcon(getClass().getResource( + "gui/titlebar.png")); + JButton closebtn; + JPropertiesBar Mother; + + @Override + public void paintComponent(final java.awt.Graphics g) { + + final java.awt.Dimension d=this.getSize(); + g.drawImage(myicon.getImage(), 0, 0, d.width, d.height, this); + super.paintComponent(g); + } + + public TitleBar(final JPropertiesBar parent, final int width) { + Mother=parent; + this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); + // this.setAlignmentX(0F); + this.setOpaque(false); + fixsize(this, width, Bheight); + this.addMouseListener(parent); + this.addMouseMotionListener(parent); + closebtn=new JButton(closeimg); + closebtn.setRolloverIcon(closeoverimg); + closebtn.setBorder(BorderFactory.createEmptyBorder()); + closebtn.setOpaque(false); + closebtn.setContentAreaFilled(false); + closebtn.addMouseListener(new MouseAdapter() { + + @Override + public void mousePressed(final MouseEvent e) { +// Mother.setVisible(false); + Mother.showme(false); + } + }); + this.add(closebtn); + + } + } + + private class CPane extends JEricPanel { + + public CPane() { + this.setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); + this.setOpaque(false); + this.setBorder(BorderFactory.createLineBorder( + new Color(80, 80, 80), 1)); + } + } + + private void setBarLocation(final MouseEvent me) { + location=getLocation(location); + int x=location.x-pressed.getX()+me.getX(); + if (xGlobal.getScreenX()+Global.getScreenW()-20) { + x=Global.getScreenX()+Global.getScreenW()-Bwidth; + } + setLocation(x, Global.getScreenY()); + Toolkit.getDefaultToolkit().sync(); + } + + @Override + public void mouseDragged(final MouseEvent me) { + setBarLocation(me); + } + + @Override + public void mousePressed(final MouseEvent me) { + pressed=me; + } + + @Override + public void mouseMoved(final MouseEvent e) { + } + + @Override + public void mouseReleased(final MouseEvent e) { + setBarLocation(e); + Global.setParameter("props.paletteX", getLocation().x); + Bx=getLocation().x; + By=getLocation().y; + pipe_tools.setWindowLocation(); + pipe_tools.toFront(); + } + + @Override + public void mouseClicked(final MouseEvent e) { + } + + @Override + public void mouseEntered(final MouseEvent e) { + } + + @Override + public void mouseExited(final MouseEvent e) { + } +} \ No newline at end of file diff --git a/eric/bar/JTabPanel.java b/eric/bar/JTabPanel.java new file mode 100644 index 0000000..dd7818b --- /dev/null +++ b/eric/bar/JTabPanel.java @@ -0,0 +1,166 @@ +/* + +Copyright 2006 Eric Hakenholz + +This file is part of C.a.R. software. + + C.a.R. is a free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 3 of the License. + + C.a.R. is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + */ + + + package eric.bar; + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.Graphics; +import java.util.ArrayList; + +import javax.swing.BoxLayout; +import javax.swing.ImageIcon; +import javax.swing.JComponent; +import javax.swing.JLabel; +import eric.JEricPanel; +import javax.swing.SwingConstants; + +import rene.gui.Global; + +/** + * + * @author erichake + */ +public class JTabPanel extends JEricPanel { + + /** + * + */ + private static final long serialVersionUID = 1L; + JEricPanel LeftPanel = new JEricPanel(); + JEricPanel SouthPanel = new JEricPanel(); + JEricPanel RightPanel = new JEricPanel(); + ArrayList Panes = new ArrayList(); + JTabPanelTitleBar JTitle; + int Leftmargin = 5;// margin before the tabs + int Rightmargin = 35;// margin after the tabs + int TabHeight = 18; // tab title line height + int TabTitleSize = 11; // Tab title font size + int TabTitleMargin = 5; // space before and after the Tab Title + + @Override + public void paintComponent(final Graphics g) { + super.paintComponent(g); + final ImageIcon myicon = new ImageIcon(getClass().getResource( + "gui/panel_back.png")); + final java.awt.Dimension d = this.getSize(); + g.drawImage(myicon.getImage(), 0, 0, d.width, d.height, this); + } + + public JTabPanel(final int w, final int h) { + this.setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); + LeftPanel.setLayout(new BoxLayout(LeftPanel, BoxLayout.Y_AXIS)); + RightPanel.setLayout(new BoxLayout(RightPanel, BoxLayout.Y_AXIS)); + SouthPanel.setLayout(new BoxLayout(SouthPanel, BoxLayout.X_AXIS)); + JTitle = new JTabPanelTitleBar(this); + LeftPanel.add(JTitle); + LeftPanel.add(SouthPanel); + add(LeftPanel); + add(RightPanel); + RightPanel.setOpaque(false); + SouthPanel.setOpaque(false); + LeftPanel.setOpaque(false); + SouthPanel.setAlignmentX(0.0f); + SouthPanel.setAlignmentY(0.0f); + fixsize(this, w, h); + // this.setBorder(BorderFactory.createLineBorder(new + // Color(82,82,82),1)); + } + + public void add(final JComponent cp, final int i) { + final JEricPanel mypane = (JEricPanel) Panes.get(i); + mypane.add(cp); + } + + public void addMain(final JComponent cp) { + SouthPanel.add(cp); + } + + public void setMainCenteredContent(final JComponent cp) { + final JEricPanel myjp1 = new JEricPanel(); + myjp1.setOpaque(false); + final JEricPanel myjp2 = new JEricPanel(); + myjp2.setOpaque(false); + SouthPanel.add(myjp1); + SouthPanel.add(cp); + SouthPanel.add(myjp2); + } + + public void clearAll() { + SouthPanel.removeAll(); + SouthPanel.revalidate(); + for (int i = 0; i < Panes.size(); i++) { + final JEricPanel mypane = (JEricPanel) Panes.get(i); + mypane.removeAll(); + mypane.revalidate(); + } + } + + public void addPanel(final String name) { + JTitle.addTabTitle(name); + final JEricPanel mypane = new JEricPanel(); + mypane.setLayout(new BoxLayout(mypane, BoxLayout.X_AXIS)); + mypane.setOpaque(false); + String str = Global.Loc("props.help"); + str = str.replace("
", " "); + + Panes.add(mypane); + JTitle.revalidate(); + + fixsize(LeftPanel, JTitle.getSize().width, this.getSize().height); + fixsize(SouthPanel, JTitle.getSize().width, this.getSize().height + - TabHeight); + fixsize(RightPanel, this.getSize().width - LeftPanel.getSize().width, + this.getSize().height); + + final JLabel hlp = new JLabel(str); + hlp.setOpaque(false); + hlp.setFont(new Font("System", 0, 12)); + hlp.setHorizontalAlignment(SwingConstants.CENTER); + hlp.setVerticalAlignment(SwingConstants.CENTER); + fixsize(hlp, 600, RightPanel.getSize().height); + hlp.setForeground(new Color(100, 100, 100)); + mypane.add(hlp); + mypane.revalidate(); + } + + + public void selectTab(final int i) { + JTitle.selectTabTitle(i); + RightPanel.removeAll(); + final JEricPanel mypane = (JEricPanel) Panes.get(i); + fixsize(mypane, RightPanel.getSize().width, RightPanel.getSize().height); + RightPanel.add(mypane); + RightPanel.revalidate(); + RightPanel.repaint(); + JTitle.repaint(); + Global.setParameter("props.selectedtab", i); + } + + private void fixsize(final JComponent cp, final int w, final int h) { + final Dimension d = new Dimension(w, h); + cp.setMaximumSize(d); + cp.setMinimumSize(d); + cp.setPreferredSize(d); + cp.setSize(d); + } +} diff --git a/eric/bar/JTabPanelTitleBar.java b/eric/bar/JTabPanelTitleBar.java new file mode 100644 index 0000000..1cfbd47 --- /dev/null +++ b/eric/bar/JTabPanelTitleBar.java @@ -0,0 +1,173 @@ +/* + +Copyright 2006 Eric Hakenholz + +This file is part of C.a.R. software. + + C.a.R. is a free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 3 of the License. + + C.a.R. is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + */ + + + package eric.bar; + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.util.ArrayList; + +import javax.swing.BoxLayout; +import javax.swing.ImageIcon; +import javax.swing.JComponent; +import javax.swing.JLabel; +import eric.JEricPanel; +import javax.swing.SwingConstants; +import rene.gui.Global; + + +/** + * + * @author erichake + */ +public class JTabPanelTitleBar extends JEricPanel { + /** + * + */ + private static final long serialVersionUID = 1L; + ArrayList TabTitles = new ArrayList(); + JTabPanel Mother; + + @Override + public void paintComponent(final Graphics g) { + super.paintComponent(g); + final ImageIcon myicon1 = new ImageIcon(getClass().getResource( + "gui/titles_back.png")); + final ImageIcon myicon2 = new ImageIcon(getClass().getResource( + "gui/title_back_end.png")); + final java.awt.Dimension d = this.getSize(); + g.drawImage(myicon1.getImage(), 0, 0, d.width, d.height, this); + g.drawImage(myicon2.getImage(), d.width - d.height, 0, this); + } + + public JTabPanelTitleBar(final JTabPanel parent) { + Mother = parent; + setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); + setAlignmentX(0.0f); + setAlignmentY(0.0f); + add(margin(Mother.Leftmargin)); + add(margin(Mother.Rightmargin)); + } + + public void addTabTitle(final String name) { + final int cnt = this.getComponentCount(); + final JTabTitle jtt = new JTabTitle(Mother, name); + + TabTitles.add(jtt); + this.add(jtt, cnt - 1); + fixsize(this, getLeftWidth(), Mother.TabHeight); + } + + public void selectTabTitle(final int n) { + for (int i = 0; i < TabTitles.size(); i++) { + ((JTabTitle) TabTitles.get(i)).setSelected(i == n); + } + } + + public int getLeftWidth() { + int w = Mother.Leftmargin + Mother.Rightmargin; + for (int i = 0; i < TabTitles.size(); i++) { + final JTabTitle jtt = (JTabTitle) TabTitles.get(i); + w += jtt.getSize().width; + } + return w; + } + + static JEricPanel margin(final int w) { + final JEricPanel mypan = new JEricPanel(); + fixsize(mypan, w, 1); + mypan.setOpaque(false); + mypan.setFocusable(false); + return mypan; + } + + static void fixsize(final JComponent cp, final int w, final int h) { + final Dimension d = new Dimension(w, h); + cp.setMaximumSize(d); + cp.setMinimumSize(d); + cp.setPreferredSize(d); + cp.setSize(d); + } + +} + +class JTabTitle extends JEricPanel { + /** + * + */ + private static final long serialVersionUID = 1L; + boolean isActive = false; + JTabPanel Mother; + int Pos; + JLabel JLB = new JLabel(); + ImageIcon IcON = new ImageIcon(getClass().getResource("gui/tab_on.png")); + ImageIcon IcOFF = new ImageIcon(getClass().getResource("gui/tab_off.png")); + + @Override + public void paintComponent(final Graphics g) { + super.paintComponent(g); + final ImageIcon icn = (isActive) ? IcON : IcOFF; + final java.awt.Dimension d = this.getSize(); + g.drawImage(icn.getImage(), 0, 0, d.width, d.height, this); + } + + public JTabTitle(final JTabPanel parent, final String txt) { + Mother = parent; + Pos = Mother.Panes.size(); + setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); + setOpaque(false); + // JTabPanelTitleBar.fixsize(this,Mother.TabWidth,Mother.TabHeight); + JTabPanelTitleBar.fixsize(this, titleWidth(txt) + 2 + * Mother.TabTitleMargin, Mother.TabHeight); + JLB.setText(txt); + JLB.setFont(new Font(Global.GlobalFont, 0, 11)); + JLB.setOpaque(false); + JLB.setHorizontalAlignment(SwingConstants.CENTER); + JLB.setVerticalAlignment(SwingConstants.BOTTOM); + JLB.setForeground(new Color(40, 40, 40)); + JTabPanelTitleBar.fixsize(JLB, titleWidth(txt) + 2 + * Mother.TabTitleMargin, Mother.TabHeight); + // JTabPanelTitleBar.fixsize(JLB,Mother.TabWidth,Mother.TabHeight); + JLB.addMouseListener(new java.awt.event.MouseAdapter() { + @Override + public void mousePressed(final java.awt.event.MouseEvent evt) { + Mother.selectTab(Pos); + Mother.repaint(); + } + }); + this.add(JLB); + } + + private int titleWidth(final String s) { + // FontMetrics fm = getFontMetrics(getFont()); + final FontMetrics fm = getFontMetrics(new Font(Global.GlobalFont, 0, + Mother.TabTitleSize)); + + return fm.stringWidth(s); + } + + public void setSelected(final boolean b) { + isActive = b; + } +} diff --git a/eric/bar/gui/Pclose.png b/eric/bar/gui/Pclose.png new file mode 100644 index 0000000000000000000000000000000000000000..7b905623bdcfa46a927267b3e2458b76f3fdbad2 GIT binary patch literal 608 zcmV-m0-ybfP)}xJ&CQ?`XBLfw;V@JN2UGthQEjG&V$O9)MTkFir-%Ko$cDdr6ek zA`r_ZLf*@$y+D<~DP@uoxhg3$h3n?B)04bZ0m0UJ(f?18Hgocc>E5 zH0+)LPIY!+55JFX1zC_v-AbBIXwY@p0KL>@&nibP^V^%f=44U^bMGh%jMYuS$-^P=dD+oky!(??p6hm6pl?7!V<~V;)i6o_Tfnbnz|Bv7Q=lTh`ewwQIvZKoY0000*ccXA&5Pp7e%M8Y)2$lgG+F~CJBRQG#=(>WD4GZ) z3h1%s;OLfxtK5vX{sSZ8#@gGgJ-sjU_IOhlb@A+d_WgeLdEc9t1MpY!kBjp8JSPYO z7mLMsdJ>b#M07eGOTDw%{*JNQB1KU+pU>ww*KUQ;*b2AXgG6GEh4uQ3?HEJZ14S;Y z)q<1FE$|Kq*xD}RbL9(mDpl6mtiEH6qAa^KMWQI6@u(h`uG~bk@hrM;^H|>~LEYGd zo%U07cJcBJG#+V!D2mV&ncFPHaHa#!zCpBFZ8+3$oJw!8)cfgn8=M|L3~e1Sn=M3B zq&uu9*Ls`?$O%N}vbfrP2QB6cH0No*i^=p7q(~B7y*zXcdTr6M69#h6JA~QAmr#nY z;e8y0ZU066{t#ByHj&J&;{L;7G*MPl)Y)Yx9&r@Qg$)GdS@byE2#m!Mcsh+<+JoU| zSW!znH34Q|jMN|9!1Mfb3L@M_J{em9_RdpRC;v&&Whd4NjiK!&syf0&? zRz;=u6>rO*5Km{}4@ihcV~!$aHARJ@%1y{Jmswcglj(U99GA(^lOP!hNkpESAYS literal 0 HcmV?d00001 diff --git a/eric/bar/gui/chkboxOFF.png b/eric/bar/gui/chkboxOFF.png new file mode 100644 index 0000000000000000000000000000000000000000..312a368a386c5d22b89f937e900afc249f7c9d43 GIT binary patch literal 296 zcmV+@0oVSCP)m>WETO6@%P^_yI%t}P`~8l(uDMiI1zp!c*{5V#7MiBPFbrI7 zw;OERewQ4_VKZ&p#)Z1MuKO+pL4e~p@U7-~Mi_=9y|!l<1{?A`PcB7Kz%Fl)iV5)U|XI50000aE{XhpKl00U zu3cVS{?5%CEMsML9|ZXJ->oOK&I!&rD^ z9GQaa<^i|QZ-mn;A3RU5KYRP}B?irm5QT29yVnRe|A_aG&xjm2IrJG#2)dzn;y4Z# uiv=`Ii(nWAEXxu{a7Eup7)IjvxB3G4Jnss&B?id=0000DSr z1<%~X^wgl##FWaylc_d9Me?35jv*Y;$v=*LncvCC_y2L?-{a1UHf`us_DK2sAcx`D WfAREnI%f}q%=L8jb6Mw<&;$T7>M0Na literal 0 HcmV?d00001 diff --git a/eric/bar/gui/sep.png b/eric/bar/gui/sep.png new file mode 100644 index 0000000000000000000000000000000000000000..6156c67ca5b4817502e0e49e52677e022f3ba549 GIT binary patch literal 89 zcmeAS@N?(olHy`uVBq!ia0vp^OhC-Y!3-o1|LNZWq}T#{LR?p`+4TSa|10ad%77w# lo-U3d6}K3f8UFkSDrR6|U~=V9+X9qf@O1TaS?83{1OUTj7ghiO literal 0 HcmV?d00001 diff --git a/eric/bar/gui/tab_off.png b/eric/bar/gui/tab_off.png new file mode 100644 index 0000000000000000000000000000000000000000..93ca2516b8f24bd89fd2018efadc37e4c6031b49 GIT binary patch literal 353 zcmV-n0iOPeP)yh zygX(ye-OL!CROMa+7k$^3qb@ytK!C;Ucld!9KqG=mq#GXOyC3AjIq=b_aSDY9AodC zEEcw|n!0YPs#z|*^Wq58avCCMXOkxhoUvu@W6T_LN+Y&}qezH4<{^YkAt#wc#(C0! zwd*E)5<-XZ9&ZX(YuUL(p_TK~|2;5|>%jfWiTS>a%;9+4+-%FwV|T?afYH;t%b?I6F_;E6!K#73Yigit|}}#rdSY;(XLz zaXx6TI1kz@&U@|6&Xr5M-CpD%U?^vP#nhb^MYgNupRd2 zoHOaKZ$Q-9a=Dz_syh(|5(I(>LPSLL2JEUkZTIchD6;8x)|ZFp?t?JaF{T(Bs>%p4 zF)=kNDCIDXWp5ZlRV_k{Y>Gk;6sqZBwR%JEbsA3+`>>g@G)>W~bWwcE8)rEK`65>s z-SEcg4+Hru(I~wB!$3Y&6^!B{1Nm6mFo<&YQ3yTk&mV@|-pxQR_cZW>5(aXyEAR4( z+b1Oq?R(%H2;z$2rS)aGNS_R^NY!Uzf002ovPDHLkV1k9sk!%0} literal 0 HcmV?d00001 diff --git a/eric/bar/gui/titlebar.png b/eric/bar/gui/titlebar.png new file mode 100644 index 0000000000000000000000000000000000000000..bef4e05da50608333bcd8af4cbd59e4e7cfdff55 GIT binary patch literal 120 zcmeAS@N?(olHy`uVBq!ia0vp^f8U}fi7AzZCsS>JiljVU978x{ljCfR4ONwOO)U)#^~|iaY`nx6oP614uWQ%M P2N~(<>gTe~DWM4fF5?`r literal 0 HcmV?d00001 diff --git a/eric/bar/gui/titles_back.png b/eric/bar/gui/titles_back.png new file mode 100644 index 0000000000000000000000000000000000000000..4a2b4dd6c824d9cfefb15149fbd71b8bd883450a GIT binary patch literal 136 zcmeAS@N?(olHy`uVBq!ia0vp^j6f{J!2~2lO_g5*DajJoh?3y^w370~qErUQl>DSr z1<%~X^wgl##FWaylc_d9MOvONjv*Y;$tTb2r>|V8nOOPx8Sm-+_5Te%+}~e+P-159 infm|#m``ubHfLP9$naqO>r;L}T@0SCelF{r5}E+`UoOZ1 literal 0 HcmV?d00001 diff --git a/eric/controls/JCanvasButton.java b/eric/controls/JCanvasButton.java new file mode 100644 index 0000000..b2afdc6 --- /dev/null +++ b/eric/controls/JCanvasButton.java @@ -0,0 +1,146 @@ +/* + +Copyright 2006 Eric Hakenholz + +This file is part of C.a.R. software. + +C.a.R. is a free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 3 of the License. + +C.a.R. is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + + */ +package eric.controls; + +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +import javax.swing.JButton; + +import rene.util.xml.XmlWriter; +import rene.zirkel.ZirkelCanvas; +import rene.zirkel.objects.ExpressionObject; + +/** + * + * @author erichake + */ +public class JCanvasButton extends JCanvasPanel { + + /** + * + */ + private static final long serialVersionUID=1L; + MyJButton JCB; + + public JCanvasButton(final ZirkelCanvas zc, final ExpressionObject o) { + super(zc, o); + JSL=new MyJButton(); + JCB=(MyJButton) JSL; + JCB.addMouseListener(this); + JCB.addMouseMotionListener(this); + final JCanvasButton btn=this; + JCB.addMouseListener(new MouseAdapter() { + + @Override + public void mouseClicked(final MouseEvent e) { + if (!isEditMode()&&!isTargetMode()) { + ZC.runControlScripts(btn); + } + } + + @Override + public void mousePressed(final MouseEvent e) { + if (isEditMode()||isTargetMode()) { + JCB.setEnabled(false); + } + } + + @Override + public void mouseReleased(final MouseEvent e) { + if (!hidden()) { + JCB.setEnabled(true); + if (getVal()==0) { + setVal(1); + } else { + setVal(0); + } + } + } + }); + showval=false; + showunit=false; + showcom=false; + setComment("ok"); + setVal(0); + this.add(JCPlabel); + this.add(JCB); + this.add(JCPresize); + zc.add(this); + } + + @Override + public void setComment(final String s) { + lbl_com=s; + JCPlabel.setText(goodLabel()); + if (showcom) { + JCB.setText(""); + } else { + JCB.setText(s); + } + setDims(); + } + + @Override + public void setShowComment(final boolean b) { + showcom=b; + JCPlabel.setText(goodLabel()); + if (showcom) { + JCB.setText(""); + } else { + JCB.setText(lbl_com); + } + setDims(); + } + + @Override + public double getVal() { + double s; + try { + s=O.getValue(); + } catch (final Exception ex) { + s=0; + } + return s; + } + + class MyJButton extends JButton { + + /** + * + */ + private static final long serialVersionUID=1L; + + MyJButton() { + super(); + setFocusable(false); + setOpaque(false); + } + } + + @Override + public void PrintXmlTags(final XmlWriter xml) { + xml.startTagStart("CTRLbutton"); + + super.PrintXmlTags(xml); + xml.finishTagNewLine(); + + } +} diff --git a/eric/controls/JCanvasCheckBox.java b/eric/controls/JCanvasCheckBox.java new file mode 100644 index 0000000..5cb73ef --- /dev/null +++ b/eric/controls/JCanvasCheckBox.java @@ -0,0 +1,128 @@ +/* + +Copyright 2006 Eric Hakenholz + +This file is part of C.a.R. software. + + C.a.R. is a free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 3 of the License. + + C.a.R. is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + */ + + + package eric.controls; + +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +import javax.swing.JCheckBox; + +import rene.gui.Global; +import rene.util.xml.XmlWriter; +import rene.zirkel.ZirkelCanvas; +import rene.zirkel.objects.ExpressionObject; + +/** + * + * @author erichake + */ +public class JCanvasCheckBox extends JCanvasPanel implements ItemListener { + + /** + * + */ + private static final long serialVersionUID = 1L; + MyJCheckBox JCB; + + public JCanvasCheckBox(final ZirkelCanvas zc, final ExpressionObject o) { + super(zc, o); + JSL = new MyJCheckBox(); + JCB = (MyJCheckBox) JSL; + // JCanvasPanel.fixsize(JCB, 50, 22); + JCB.addMouseListener(this); + JCB.addMouseMotionListener(this); + JCB.addItemListener(this); + JCB.addMouseListener(new MouseAdapter() { + + @Override + public void mousePressed(final MouseEvent e) { + if (isEditMode()||isTargetMode()) { + JCB.setEnabled(false); + } + + } + + @Override + public void mouseReleased(final MouseEvent e) { + JCB.setEnabled(true); + } + }); + this.add(JCB); + showval = false; + showunit = false; + showcom = true; + String s = Global.Loc("props.expl"); + s = s.trim(); + s = s.replace(":", ""); + s = s.trim(); + setComment(s); + setVal(0); + this.add(JCPlabel); + this.add(JCPresize); + zc.add(this); + } + + @Override + public double getVal() { + final double s = JCB.isSelected() ? 1 : 0; + return s; + } + + public void setSelected(boolean b){ + JCB.setSelected(b); + } + + class MyJCheckBox extends JCheckBox { + + /** + * + */ + private static final long serialVersionUID = 1L; + + MyJCheckBox() { + super(); + setFocusable(false); + setOpaque(false); + } + + } + + public void itemStateChanged(final ItemEvent arg0) { + if(!hidden()){ + try { + final int s = JCB.isSelected() ? 1 : 0; + setVal(s); + } catch (final Exception ex) { + } + } + } + + @Override + public void PrintXmlTags(final XmlWriter xml) { + xml.startTagStart("CTRLcheckbox"); + super.PrintXmlTags(xml); + xml.finishTagNewLine(); + + } +} diff --git a/eric/controls/JCanvasPanel.java b/eric/controls/JCanvasPanel.java new file mode 100644 index 0000000..c360203 --- /dev/null +++ b/eric/controls/JCanvasPanel.java @@ -0,0 +1,532 @@ +/* + +Copyright 2006 Eric Hakenholz + +This file is part of C.a.R. software. + +C.a.R. is a free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 3 of the License. + +C.a.R. is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + + */ +package eric.controls; + +import eric.GUI.palette.PaletteManager; +import java.awt.BasicStroke; +import java.awt.Color; +import java.awt.Cursor; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Point; +import java.awt.Toolkit; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionAdapter; +import java.awt.event.MouseMotionListener; +import java.awt.geom.Rectangle2D; +import java.text.DecimalFormat; +import java.text.DecimalFormatSymbols; + +import javax.swing.BorderFactory; +import javax.swing.BoxLayout; +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JComponent; +import javax.swing.JLabel; +import eric.JEricPanel; +import javax.swing.SwingConstants; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; + +import rene.gui.Global; +import rene.util.xml.XmlWriter; +import rene.zirkel.ZirkelCanvas; +import rene.zirkel.objects.ExpressionObject; +import eric.JPointName; +import eric.JZirkelCanvas; +import eric.bar.JPropertiesBar; +import java.awt.Image; +import java.awt.image.BufferedImage; +import java.awt.image.FilteredImageSource; +import java.awt.image.ImageFilter; +import javax.swing.GrayFilter; +import rene.zirkel.tools.JSmacroTool; +import rene.zirkel.tools.Scripts_SetMouseDrag; + +/** + * + * @author erichake + */ +public class JCanvasPanel extends JEricPanel implements MouseListener, + MouseMotionListener, ChangeListener { + + /** + * + */ + private static final long serialVersionUID=1L; + ImageIcon ctrlresizeicon=new ImageIcon(getClass().getResource( + "/eric/GUI/icons/palette/ctrl_resize.png")); + static int COMFONTSIZE=14; + static int COMSIZE=50; + static Color COMCOLOR=new Color(80, 80, 80); + JComponent JSL; + String lbl_com="", lbl_val="", lbl_unit="°"; + boolean showcom=true, showval=true, showunit=false; + JLabel JCPlabel=new JLabel(); + JButton JCPresize=new JButton(); + // int W, H; + ZirkelCanvas ZC; + public ExpressionObject O; + boolean hidden=false; + private boolean showborder1=false; + private boolean showborder2=false; + private boolean showhandle=false; + private MouseEvent pressed; + private Point location; + private final DecimalFormat decFormat; + + public boolean hidden(){ + return hidden; + } + + public void paint(Graphics g) { + Graphics2D g2D=null; + BufferedImage sprite=null; + if ((!isHidden())||(ZC.getShowHidden())) { + sprite=new BufferedImage(getSize().width, + getSize().height, BufferedImage.TYPE_INT_ARGB); + g2D=sprite.createGraphics(); +// super.paintChildren(g2D); + super.paint(g2D); + } + if ((isHidden())&&(ZC.getShowHidden())) { + final ImageFilter filter=new GrayFilter(true, 60); + final Image disImage=this.createImage(new FilteredImageSource( + sprite.getSource(), filter)); + final ImageIcon myicn=new ImageIcon(disImage); + g2D.drawImage(myicn.getImage(), 0, 0, getSize().width, getSize().height, this); + } + if (sprite!=null) { + ZC.I.getGraphics().drawImage(sprite, getLocation().x, + getLocation().y, this); + } + // when mouseentered : + final Dimension d=getSize(); + if (O.selected()) { + g.setColor(JControlsManager.bordercolor3); + g.drawRect(0, 0, d.width-8, d.height-1); + } + else if(showhandle) { + final Graphics2D g2d=(Graphics2D) g; + + final Rectangle2D rectangle=new Rectangle2D.Double(0, 0, + d.width-8, d.height-1); + g2d.setColor(new Color(119, 136, 153)); + g2d.setStroke(new BasicStroke(1f, BasicStroke.CAP_SQUARE, + BasicStroke.JOIN_BEVEL, 1f, new float[]{2f}, 0f)); + g2d.draw(rectangle); + g.drawImage(ctrlresizeicon.getImage(), d.width-12, + d.height/2-4, this); + } else { + if (showborder1) { + g.setColor(JControlsManager.bordercolor1); + g.drawRect(0, 0, d.width-8, d.height-1); + } else if (showborder2) { + g.setColor(JControlsManager.bordercolor2); + g.drawRect(0, 0, d.width-8, d.height-1); + } + } + } + + @Override + public void paintComponent(final Graphics g) { + + } + + // withoutExpr unused, just to make another constructor : + public JCanvasPanel(final ZirkelCanvas zc, final ExpressionObject o) { + super(); + ZC=zc; + O=(o==null)?createExpression():o; + this.setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); + this.setOpaque(false); + this.addMouseListener(this); + this.addMouseMotionListener(this); + + JCPlabel.setHorizontalAlignment(SwingConstants.LEFT); + JCPlabel.setFont(new Font(Global.GlobalFont, 0, COMFONTSIZE)); + JCPlabel.setForeground(COMCOLOR); + + // JCPresize.setIcon(ctrlresizeicon); + JCPresize.setOpaque(false); + JCPresize.setContentAreaFilled(false); + JCPresize.setBorder(BorderFactory.createEmptyBorder()); + JCPresize.setCursor(new Cursor(Cursor.E_RESIZE_CURSOR)); + + JCPresize.addMouseListener(new MouseAdapter() { + + @Override + public void mousePressed(final MouseEvent me) { + pressed=me; + } + + @Override + public void mouseReleased(final MouseEvent me) { + ZC.JCM.hideBorders((JCanvasPanel) ((JComponent) me.getSource()).getParent()); + } + }); + + JCPresize.addMouseMotionListener(new MouseMotionAdapter() { + + @Override + public void mouseDragged(final MouseEvent me) { + final int w=JSL.getSize().width+me.getX(); + setDims(w-pressed.getX(), getSize().height); + ZC.JCM.analyseResize((JCanvasPanel) ((JComponent) me.getSource()).getParent()); + } + }); + + decFormat=new DecimalFormat(); + final DecimalFormatSymbols dfs=new DecimalFormatSymbols(); + dfs.setDecimalSeparator('.'); + decFormat.setDecimalFormatSymbols(dfs); + } + + private ExpressionObject createExpression() { + final ExpressionObject o=new ExpressionObject(ZC.getConstruction(), + 0, 0); + o.setDefaults(); + o.setSuperHidden(true); + o.setOwnedByControl(true); + ZC.getConstruction().add(o); + + if (JZirkelCanvas.getCurrentJZF()!=null) { + final int i=JZirkelCanvas.getCurrentJZF().getPointLabel().getCurrentLetterSetCode(); + final boolean b=Global.getParameter("options.point.shownames", + false); + Global.setParameter("options.point.shownames", true); + final String s=JZirkelCanvas.getCurrentJZF().getPointLabel().setLetterSet(JPointName.minLettersSetCode); + + Global.setParameter("options.point.shownames", b); + JZirkelCanvas.getCurrentJZF().getPointLabel().setLetterSet(i); + o.setName(s); + } + return o; + } + + public int StringwWidth(final String s) { + // FontMetrics fm = getFontMetrics(getFont()); + final FontMetrics fm=getFontMetrics(new Font(Global.GlobalFont, 0, + COMFONTSIZE)); + + return fm.stringWidth(s); + } + + // MUST BE OVERRIDE : + public double getVal() { + return 0.0; + } + + public void setOnlyValue(final double x) { + decFormat.setMaximumFractionDigits(Global.getParameter("digits.edit", 5)); + lbl_val=String.valueOf(decFormat.format(x)); + } + + public void setVal(final double x) { + setOnlyValue(x); + setVal(String.valueOf(x)); + } + + public void setVal(final String s) { + JCPlabel.setText(goodLabel()); + try { + O.setExpression(s, ZC.getConstruction()); + ZC.recompute(); + setDims(); + // ZC.validate(); + // ZC.repaint(); + } catch (final Exception ex) { + } + } + + public void setDims(final int x, final int y, final int w, final int h) { + final int W=w+StringwWidth(JCPlabel.getText())+15; + fixsize(JCPlabel, StringwWidth(JCPlabel.getText()), h); + fixsize(JCPresize, 15, h); + fixsize(JSL, w, h); + revalidate(); + setBounds(x, y, W, h); + ZC.validate(); + ZC.repaint(); + } + + public void setDims(final int w, final int h) { + final int x=getLocation().x; + final int y=getLocation().y; + setDims(x, y, w, h); + } + + public void setDims() { + setDims(JSL.getSize().width, JSL.getSize().height); + } + + public void grow(final int w, final int h) { + setDims(JSL.getSize().width+w, JSL.getSize().height+h); + } + + public String getComment() { + return lbl_com; + } + + public void setComment(final String s) { + lbl_com=s; + JCPlabel.setText(goodLabel()); + setDims(); + } + + public String getUnit() { + return lbl_unit; + } + + public void setUnit(final String s) { + lbl_unit=s; + JCPlabel.setText(goodLabel()); + setDims(); + } + + public void setShowComment(final boolean b) { + showcom=b; + JCPlabel.setText(goodLabel()); + setDims(); + } + + public void setShowVal(final boolean b) { + showval=b; + JCPlabel.setText(goodLabel()); + setDims(); + } + + public void setShowUnit(final boolean b) { + showunit=b; + JCPlabel.setText(goodLabel()); + setDims(); + } + + public boolean getShowComment() { + return showcom; + } + + public boolean getShowVal() { + return showval; + } + + public boolean getShowUnit() { + return showunit; + } + + public String goodLabel() { + String lbl=""; + if (showcom) { + lbl+=lbl_com; + } + if (showval) { + lbl+=lbl_val; + } + if (showunit) { + lbl+=lbl_unit; + } + return lbl; + } + + static public void fixsize(final JComponent cp, final int w, final int h) { + final Dimension d=new Dimension(w, h); + cp.setMaximumSize(d); + cp.setMinimumSize(d); + cp.setPreferredSize(d); + cp.setSize(d); + } + + public boolean isTargetMode(){ + return ((ZC.getTool() instanceof Scripts_SetMouseDrag)&&(this instanceof JCanvasButton)); + } + + public boolean isEditMode() { + if (JZirkelCanvas.getCurrentJZF()==null) { + return false; + } + boolean bool=(PaletteManager.isSelected("edit")) + ||(PaletteManager.isSelected("ctrl_edit")); + bool=(bool||(PaletteManager.isSelected("ctrl_slider"))); + bool=(bool||(PaletteManager.isSelected("ctrl_popup"))); + bool=(bool||(PaletteManager.isSelected("ctrl_chkbox"))); + bool=(bool||(PaletteManager.isSelected("ctrl_txtfield"))); + bool=(bool||(PaletteManager.isSelected("ctrl_button"))); + bool=(bool||(PaletteManager.isSelected("delete"))); + bool=(bool||(PaletteManager.isSelected("hide"))); + return bool; + } + + public boolean isDeleteMode() { + if (JZirkelCanvas.getCurrentJZF()==null) { + return false; + } + return (PaletteManager.isSelected("delete")); + } + + public boolean isHideToolSelected() { + if (JZirkelCanvas.getCurrentJZF()==null) { + return false; + } + return (PaletteManager.isSelected("hide")); + } + + public boolean isHidden() { + return (hidden||O.testConditional("hidden")); + } + + public void setHidden(final boolean b) { + hidden=b; + } + + public void showBorder() { + showborder2=true; + repaint(); + } + + public void hideBorder() { + showborder2=false; + repaint(); + } + + public void showHandle() { + showhandle=true; + + setDims(); + } + + public void hideHandle() { + showhandle=false; + setDims(); + } + + public void mouseClicked(final MouseEvent arg0) { + } + + public void mousePressed(final MouseEvent e) { + pressed=e; + if (e.isPopupTrigger()) { + return; + } + ZC.JCM.hideHandles(null); + } + + public void mouseReleased(final MouseEvent e) { + if (e.isPopupTrigger()) { + return; + } + if ((!ZC.getShowHidden())&&(isHidden())) { + + return; + } + if (isHideToolSelected()) { + setHidden(!isHidden()); + setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); + showborder1=false; + repaint(); + } + if (isDeleteMode()) { + ZC.JCM.removeControl(this); + } + + ZC.JCM.hideBorders(this); + if ((isEditMode())&&(!isHidden())) { + showHandle(); + JPropertiesBar.EditObject(this); + } + if (isTargetMode()) { + Scripts_SetMouseDrag tool=(Scripts_SetMouseDrag) ZC.getTool(); + tool.addFromControl(O, ZC); + repaint(); + } + + } + + public void mouseEntered(final MouseEvent arg0) { + if (isHidden()) { + setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); + showborder1=false; + // repaint(); + return; + } + if (isTargetMode()||isEditMode()) { + setCursor(new Cursor(Cursor.HAND_CURSOR)); + showborder1=true; + repaint(); + } + } + + public void mouseExited(final MouseEvent arg0) { + setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); + showborder1=false; + repaint(); + } + + public void mouseDragged(final MouseEvent me) { + if (!isEditMode()) { + return; + } + + location=getLocation(location); + int x=location.x-pressed.getX()+me.getX(); + int y=location.y-pressed.getY()+me.getY(); + if (x<0) { + x=0; + } else if (x+getSize().width>ZC.getSize().width) { + x=ZC.getSize().width-getSize().width; + } + if (y<0) { + y=0; + } else if (y+getSize().height>ZC.getSize().height) { + y=ZC.getSize().height-getSize().height; + } + setLocation(x, y); + Toolkit.getDefaultToolkit().sync(); + ZC.JCM.analyseXY(this); + } + + public void mouseMoved(final MouseEvent arg0) { + } + + // Change event from JSlider : + public void stateChanged(final ChangeEvent arg0) { + } + + public void PrintXmlTags(final XmlWriter xml) { + + xml.printArg("Ename", ""+O.getName()); + xml.printArg("x", ""+getLocation().x); + xml.printArg("y", ""+getLocation().y); + xml.printArg("w", ""+JSL.getSize().width); + xml.printArg("h", ""+JSL.getSize().height); + xml.printArg("showC", ""+showcom); + xml.printArg("showU", ""+showunit); + xml.printArg("showV", ""+showval); + xml.printArg("hidden", ""+hidden); + xml.printArg("C", ""+lbl_com); + xml.printArg("U", ""+lbl_unit); + xml.printArg("V", ""+lbl_val); + + } +} diff --git a/eric/controls/JCanvasPopup.java b/eric/controls/JCanvasPopup.java new file mode 100644 index 0000000..37939f6 --- /dev/null +++ b/eric/controls/JCanvasPopup.java @@ -0,0 +1,171 @@ +/* + +Copyright 2006 Eric Hakenholz + +This file is part of C.a.R. software. + + C.a.R. is a free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 3 of the License. + + C.a.R. is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + */ + + + package eric.controls; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +import javax.swing.DefaultComboBoxModel; +import javax.swing.JComboBox; +import javax.swing.JComponent; +import javax.swing.plaf.ComboBoxUI; +import javax.swing.plaf.ComponentUI; +import javax.swing.plaf.metal.MetalComboBoxUI; + +import rene.gui.Global; +import rene.util.xml.XmlWriter; +import rene.zirkel.ZirkelCanvas; +import rene.zirkel.objects.ExpressionObject; + +/** + * + * @author erichake + */ +public class JCanvasPopup extends JCanvasPanel implements ActionListener { + + /** + * + */ + private static final long serialVersionUID = 1L; + MyJComboBox JCB; + + public JCanvasPopup(final ZirkelCanvas zc, final ExpressionObject o) { + super(zc, o); + JSL = new MyJComboBox(); + JCB = (MyJComboBox) JSL; + JCB.setUI((ComboBoxUI) MyComboBoxUI.createUI(JCB)); + // JCanvasPanel.fixsize(JCB, 100, 18); + // addMouseEvents(); + JCB.addMouseListener(this); + JCB.addMouseMotionListener(this); + JCB.addMouseListener(new MouseAdapter() { + + @Override + public void mousePressed(final MouseEvent e) { + if (isEditMode()) { + JCB.hidePopup(); + } + + + } + }); + addMouseEvents(); + JCB.addActionListener(this); + showval = false; + showunit = false; + showcom = true; + setComment(Global.Loc("props.expl") + " "); + setVal(1); + this.add(JCPlabel); + this.add(JCB); + this.add(JCPresize); + zc.add(this); + } + + static class MyComboBoxUI extends MetalComboBoxUI { + + public static ComponentUI createUI(final JComponent c) { + return new MyComboBoxUI(); + } + } + + public void addMouseEvents() { + for (int i = 0; i < JCB.getComponentCount(); i++) { + JCB.getComponent(i).addMouseListener(new MouseAdapter() { + + @Override + public void mousePressed(final MouseEvent e) { + if (isEditMode()) { + JCB.hidePopup(); + } + + + } + }); + JCB.getComponent(i).addMouseListener(this); + JCB.getComponent(i).addMouseMotionListener(this); + } + } + + public String getItems() { + String s = ""; + for (int i = 0; i < JCB.getItemCount() - 1; i++) { + s += JCB.getItemAt(i) + "\n"; + } + s += JCB.getItemAt(JCB.getItemCount() - 1); + return s; + } + + public void setItems(final String s) { + JCB.removeAllItems(); + final String[] itms = s.split("\n"); + for (final String itm : itms) { + JCB.addItem(itm); + } + setDims(); + } + + @Override + public double getVal() { + return (JCB.getSelectedIndex() + 1); + } + + class MyJComboBox extends JComboBox { + + /** + * + */ + private static final long serialVersionUID = 1L; + + MyJComboBox() { + super(); + setFocusable(false); + + setModel(new DefaultComboBoxModel(new String[] { "Item 1", + "Item 2", "Item 3" })); + } + } + + public void actionPerformed(final ActionEvent e) { + if (e.getSource() == JCB) { + final int selectedIndex = JCB.getSelectedIndex() + 1; + + try { + setVal(selectedIndex); + } catch (final Exception ex) { + } + + } + } + + @Override + public void PrintXmlTags(final XmlWriter xml) { + xml.startTagStart("CTRLpopup"); + super.PrintXmlTags(xml); + final String s = getItems().replace("\n", "@@@"); + xml.printArg("Items", "" + s); + xml.finishTagNewLine(); + + } +} diff --git a/eric/controls/JCanvasSlider.java b/eric/controls/JCanvasSlider.java new file mode 100644 index 0000000..cb3f263 --- /dev/null +++ b/eric/controls/JCanvasSlider.java @@ -0,0 +1,249 @@ +/* + +Copyright 2006 Eric Hakenholz + +This file is part of C.a.R. software. + + C.a.R. is a free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 3 of the License. + + C.a.R. is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + */ + + + package eric.controls; + +import javax.swing.JSlider; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; + +import rene.util.xml.XmlWriter; +import rene.zirkel.ZirkelCanvas; +import rene.zirkel.objects.ExpressionObject; + +/** + * + * @author erichake + */ +public class JCanvasSlider extends JCanvasPanel { + + /** + * + */ + private static final long serialVersionUID = 1L; + static int PREFEREDVMAX = 10000; + int VMAX = PREFEREDVMAX; + int TICKS = 1000; + double xMIN, xMAX, xTICKS; + MyJSlider JCS; + + public JCanvasSlider(final ZirkelCanvas zc, final ExpressionObject o, + final double min, final double max, final double val) { + super(zc, o); + xMIN = min; + xMAX = max; + xTICKS = getCurrentTicks(); + setVal(val); + JSL = new MyJSlider(0, VMAX, TICKS, (int) Math.round((val - xMIN) + * VMAX / (xMAX - xMIN))); + JSL.putClientProperty("JComponent.sizeVariant", "regular"); + JCS = (MyJSlider) JSL; + JCS.addMouseListener(this); + JCS.addMouseMotionListener(this); + setComment(O.getName() + "="); + this.add(JCS); + this.add(JCPlabel); + this.add(JCPresize); + zc.add(this); + } + + public void setGoodKnobPos(final double x) { + final int i = (int) Math.round((x - xMIN) * (VMAX / (xMAX - xMIN))); + JCS.setValue(i); + } + + public double getCurrentTicks() { + return TICKS * (xMAX - xMIN) / (VMAX); + } + + public void setTicks(final String s) { + setTicks(Double.parseDouble(s)); + } + + public void setTicks(final double x) { + xTICKS = x; + adjustVirtualMax(); + TICKS = (int) Math.round(x * VMAX / (xMAX - xMIN)); + JCS.setMinorTickSpacing(TICKS); + this.revalidate(); + this.repaint(); + } + + public String getTicks() { + return String.valueOf(xTICKS); + } + + public void adjustVirtualMax() { + if ((xMAX - xMIN) < 1) { + return; + } + final int mySQRT = (int) Math.round(Math.sqrt(PREFEREDVMAX)); + + // VMAX/(xMAX-xMIN) must be an integer : + VMAX = (int) Math.round(Math.ceil(mySQRT / (xMAX - xMIN)) + * (xMAX - xMIN)); + // VMAX/xTICKS must also be an integer : + VMAX *= (int) Math.round(Math.ceil(mySQRT / xTICKS) * xTICKS); + JCS.setMaximum(VMAX); + } + + public void setMax(final String s) { + setMax(Double.parseDouble(s)); + } + + public void setMax(final double x) { + xMAX = x; + if (xMIN > xMAX) { + xMIN = xMAX - 10; + } + adjustVirtualMax(); + double newval = (getVal() > xMAX) ? xMAX : getVal(); + newval = (getVal() < xMIN) ? xMIN : getVal(); + setVal(newval); + JCS.setValue((int) Math.round((newval - xMIN) * VMAX / (xMAX - xMIN))); + setTicks(xTICKS); + this.revalidate(); + this.repaint(); + } + + public String getMax() { + return String.valueOf(xMAX); + } + + public void setMin(final String s) { + setMin(Double.parseDouble(s)); + } + + public void setMin(final double x) { + xMIN = x; + if (xMIN > xMAX) { + xMAX = xMIN + 10; + } + adjustVirtualMax(); + double newval = (getVal() > xMAX) ? xMAX : getVal(); + newval = (getVal() < xMIN) ? xMIN : getVal(); + setVal(newval); + JCS.setValue((int) Math.round((newval - xMIN) * VMAX / (xMAX - xMIN))); + setTicks(xTICKS); + this.revalidate(); + this.repaint(); + } + + public String getMin() { + return String.valueOf(xMIN); + } + + public void setSnap(final boolean b) { + JCS.setSnapToTicks(b); + this.revalidate(); + this.repaint(); + } + + public boolean getSnap() { + return JCS.getSnapToTicks(); + } + + public void setShowTicks(final boolean b) { + JCS.setPaintTicks(b); + this.revalidate(); + this.repaint(); + } + + public boolean getShowTicks() { + return JCS.getPaintTicks(); + } + + @Override + public double getVal() { + return xMIN + JCS.getValue() * (xMAX - xMIN) / VMAX; + } + + class MyJSlider extends JSlider implements ChangeListener { + + /** + * + */ + private static final long serialVersionUID = 1L; + int oldvalue; + + MyJSlider(final int min, final int max, final int ticks, final int val) { + super(min, max, val); + oldvalue = val; + this.setOpaque(false); + this.setFocusable(false); + + // this.setMajorTickSpacing((max-min)/5); + this.setMinorTickSpacing(ticks); + this.setPaintTicks(true); + this.setSnapToTicks(true); + this.setOpaque(false); + + this.addChangeListener(this); + } + + @Override + public int getValue() { + + if (isEditMode()) { + return oldvalue; + } + oldvalue = super.getValue(); + return oldvalue; + + } + + public void stateChanged(final ChangeEvent e) { + try { + if (!hidden()){ + double val = getValue(); + val = xMIN + ((xMAX - xMIN) / VMAX) * val; + if (getSnapToTicks()) { + // snap to good value : + final int i = (int) Math.round((val - xMIN) / xTICKS); + val = xMIN + xTICKS * i; + // eliminate side effects : + final double ex = Math.pow(10, 5 - Math.round(Math + .log10(val))); + val = Math.round(val * ex) / ex; + if (Double.isNaN(val)) { + val = 0; + } + } + + setVal(val); + } + } catch (final Exception ex) { + } + } + } + + @Override + public void PrintXmlTags(final XmlWriter xml) { + xml.startTagStart("CTRLslider"); + super.PrintXmlTags(xml); + xml.printArg("min", "" + xMIN); + xml.printArg("max", "" + xMAX); + xml.printArg("T", "" + xTICKS); + xml.printArg("fixT", "" + JCS.getSnapToTicks()); + xml.printArg("showT", "" + JCS.getPaintTicks()); + xml.finishTagNewLine(); + } +} diff --git a/eric/controls/JCanvasTxtfield.java b/eric/controls/JCanvasTxtfield.java new file mode 100644 index 0000000..fdbe82f --- /dev/null +++ b/eric/controls/JCanvasTxtfield.java @@ -0,0 +1,143 @@ +/* + +Copyright 2006 Eric Hakenholz + +This file is part of C.a.R. software. + + C.a.R. is a free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 3 of the License. + + C.a.R. is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + */ + + + package eric.controls; + +import java.awt.Color; +import java.awt.event.FocusAdapter; +import java.awt.event.FocusEvent; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +import javax.swing.JTextField; + +import rene.util.xml.XmlWriter; +import rene.zirkel.ZirkelCanvas; +import rene.zirkel.objects.ExpressionObject; +import rene.gui.Global; + +/** + * + * @author erichake + */ +public class JCanvasTxtfield extends JCanvasPanel { + + /** + * + */ + private static final long serialVersionUID = 1L; + MyJTextField JCB; + Color errColor = new Color(201, 68, 27); + Color goodColor = new Color(50, 50, 50); + + public JCanvasTxtfield(final ZirkelCanvas zc, final ExpressionObject o) { + super(zc, o); + JSL = new MyJTextField(); + JCB = (MyJTextField) JSL; + JCB.addKeyListener(new KeyAdapter() { + + @Override + public void keyPressed(final KeyEvent e) { + } + + @Override + public void keyReleased(final KeyEvent e) { + setVal(Global.Comma_To_Point(JCB.getText(), O + .getConstruction(), true)); + if (O.getExp().isValid()) { + JCB.setForeground(goodColor); + } else { + JCB.setForeground(errColor); + } + } + }); + JCB.addFocusListener(new FocusAdapter() { + + @Override + public void focusGained(final FocusEvent e) { + JCB.selectAll(); + } + + @Override + public void focusLost(final FocusEvent e) { + } + }); + JCB.addMouseListener(this); + JCB.addMouseMotionListener(this); + JCB.addMouseListener(new MouseAdapter() { + + @Override + public void mousePressed(final MouseEvent e) { + if (isEditMode()) { + JCB.setFocusable(false); + JCB.setEnabled(false); + } + } + + @Override + public void mouseReleased(final MouseEvent e) { + if (!JCB.isEnabled()&&!hidden()) { + JCB.setEnabled(true); + JCB.setFocusable(true); + } + } + }); + showval = false; + showunit = false; + showcom = true; + setComment(O.getName() + " = "); + setVal(1); + JCB.setText("1"); + JCB.setForeground(goodColor); + this.add(JCPlabel); + this.add(JCB); + this.add(JCPresize); + zc.add(this); + } + + @Override + public double getVal() { + return (Double.valueOf(JCB.getText())); + } + + class MyJTextField extends JTextField { + + /** + * + */ + private static final long serialVersionUID = 1L; + JTextField jtf; + + MyJTextField() { + super(); + } + } + + @Override + public void PrintXmlTags(final XmlWriter xml) { + xml.startTagStart("CTRLtxtfield"); + super.PrintXmlTags(xml); + xml.printArg("txt", "" + JCB.getText()); + xml.finishTagNewLine(); + } +} diff --git a/eric/controls/JControlsManager.java b/eric/controls/JControlsManager.java new file mode 100644 index 0000000..0214601 --- /dev/null +++ b/eric/controls/JControlsManager.java @@ -0,0 +1,450 @@ +/* + +Copyright 2006 Eric Hakenholz + +This file is part of C.a.R. software. + +C.a.R. is a free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 3 of the License. + +C.a.R. is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + + */ +package eric.controls; + +import java.awt.Color; +import java.awt.Rectangle; +import java.awt.event.MouseEvent; +import java.util.ArrayList; +import rene.util.xml.XmlTag; +import rene.util.xml.XmlWriter; +import rene.zirkel.ZirkelCanvas; +import rene.zirkel.objects.ExpressionObject; +import rene.zirkel.objects.TextObject; +import eric.GUI.palette.PaletteManager; +import eric.JZirkelCanvas; +import eric.bar.JPropertiesBar; +import rene.gui.Global; +import rene.zirkel.objects.ConstructionObject; + +/** + * + * @author erichake + */ +public class JControlsManager { + + static Color bordercolor1=new Color(80, 80, 80); + static Color bordercolor2=new Color(180, 180, 250); + static Color bordercolor3=new Color(255, 25, 25); + static int MAGNET=10; + ZirkelCanvas ZC; + public ArrayList CPs=new ArrayList(); + Rectangle r=new Rectangle(); + Rectangle r2=new Rectangle(); + ArrayList XmlTags=new ArrayList(); + + public JControlsManager(final ZirkelCanvas zc) { + ZC=zc; + + } + + + public void addControl(final JCanvasPanel jcp, final boolean editme, + final int x, final int y, final int w, final int h) { + jcp.setDims(x, y, w, h); + CPs.add(jcp); + ZC.add(jcp); + showHandles(jcp); + ZC.revalidate(); + if (editme) { + JPropertiesBar.EditObject(jcp); + } + } + + public JCanvasCheckBox addChkBox(final ExpressionObject o, final int x, + final int y, final int w, final int h) { + final JCanvasCheckBox jcb=new JCanvasCheckBox(ZC, o); + addControl(jcb, o==null, x, y, w, h); + return jcb; + } + + public JCanvasButton addButton(final ExpressionObject o, final int x, + final int y, final int w, final int h) { + final JCanvasButton jcb=new JCanvasButton(ZC, o); + addControl(jcb, o==null, x, y, w, h); + return jcb; + } + + public JCanvasTxtfield addTxtField(final ExpressionObject o, final int x, + final int y, final int w, final int h) { + final JCanvasTxtfield jcb=new JCanvasTxtfield(ZC, o); + addControl(jcb, o==null, x, y, w, h); + return jcb; + } + + public JCanvasSlider addSlider(final ExpressionObject o, final int x, + final int y, final int w, final int h) { + final JCanvasSlider jcs=new JCanvasSlider(ZC, o, -5, 5, -2); + addControl(jcs, o==null, x, y, w, h); + return jcs; + } + + public JCanvasPopup addPopup(final ExpressionObject o, final int x, + final int y, final int w, final int h) { + final JCanvasPopup jcp=new JCanvasPopup(ZC, o); + addControl(jcp, o==null, x, y, w, h); + return jcp; + } + + public void analyseResize(final JCanvasPanel jp) { + r=jp.getBounds(r); + for (int i=0; i1) { + JCanvasPanel jp=(JCanvasPanel) CPs.get(0); + jp.setComment(Global.Loc("canvas.3D.floor")); + jp=(JCanvasPanel) CPs.get(1); + jp.setComment(Global.Loc("canvas.3D.system")); + final TextObject t=(TextObject) ZC.getConstruction().find("Text2"); + if (t!=null) { + t.setLines(Global.Loc("canvas.3D.rightclic")); + } + } + } + + public void collectXmlTag(final XmlTag tag) { + XmlTags.add(tag); + } + + public void readXmlTags() { + for (int i=0; i0) { + XmlTags.clear(); + hideHandles(null); + } + } +} diff --git a/eric/controls/SliderSnap.java b/eric/controls/SliderSnap.java new file mode 100644 index 0000000..22277e8 --- /dev/null +++ b/eric/controls/SliderSnap.java @@ -0,0 +1,296 @@ +/* + +Copyright 2006 Eric Hakenholz + +This file is part of C.a.R. software. + + C.a.R. is a free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 3 of the License. + + C.a.R. is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + */ + + + package eric.controls; + +import java.awt.EventQueue; +import java.awt.event.HierarchyEvent; +import java.awt.event.HierarchyListener; +import java.awt.event.MouseEvent; +import java.awt.event.MouseMotionListener; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + +import javax.swing.JComponent; +import javax.swing.JSlider; +import javax.swing.UIDefaults; +import javax.swing.UIManager; +import javax.swing.event.MouseInputAdapter; +import javax.swing.plaf.ComponentUI; +import javax.swing.plaf.basic.BasicSliderUI; + +public class SliderSnap extends BasicSliderUI { + /** + * The UI class implements the current slider Look and Feel. + */ + private static Class sliderClass; + private static Method xForVal, yForVal; + private static ReinitListener reinitListener = new ReinitListener(); + + public SliderSnap() { + super(null); + } + + /** + * Returns the UI as normal, but intercepts the call, so a listener can be + * attached. + */ + public static ComponentUI createUI(final JComponent c) { + if (c == null || sliderClass == null) + return null; + final UIDefaults defaults = UIManager.getLookAndFeelDefaults(); + try { + Method m = (Method) defaults.get(sliderClass); + if (m == null) { + m = sliderClass.getMethod("createUI", + new Class[] { JComponent.class }); + defaults.put(sliderClass, m); + } + final ComponentUI uiObject = (ComponentUI) m.invoke(null, + new Object[] { c }); + if (uiObject instanceof BasicSliderUI) + c.addHierarchyListener(new MouseAttacher()); + return uiObject; + } catch (final Exception e) { + throw new RuntimeException(e); + } + } + + public static void init() { + // check we don't initialise twice + if (sliderClass != null) + return; + final Init init = new Init(); + if (EventQueue.isDispatchThread()) { + init.run(); + } else { + // This code must run on the EDT for data visibility + try { + EventQueue.invokeAndWait(init); + } catch (final Exception e) { + throw new RuntimeException(e); + } + } + } + + /** + * Listeners for when the JSlider becomes visible then attaches the mouse + * listeners, then removes itself. + */ + private static class MouseAttacher implements HierarchyListener { + public void hierarchyChanged(final HierarchyEvent evt) { + final long flags = evt.getChangeFlags(); + if ((flags & HierarchyEvent.DISPLAYABILITY_CHANGED) > 0 + && evt.getComponent() instanceof JSlider) { + final JSlider c = (JSlider) evt.getComponent(); + c.removeHierarchyListener(this); + attachTo(c); + } + } + } + + /** + * Listens for Look and Feel changes and re-initialises the class. + */ + private static class ReinitListener implements PropertyChangeListener { + public void propertyChange(final PropertyChangeEvent evt) { + if ("lookAndFeel".equals(evt.getPropertyName())) { + // The look and feel was changed so we need to re-insert + // Our hook into the new UIDefaults map + sliderClass = null; + xForVal = yForVal = null; + UIManager.removePropertyChangeListener(reinitListener); + init(); + } + } + } + + /** + * Initialises the reflective methods and adjusts the current Look and Feel. + */ + private static class Init implements Runnable { + public void run() { + try { + final UIDefaults defaults = UIManager.getLookAndFeelDefaults(); + sliderClass = defaults.getUIClass("SliderUI"); + // Set up two reflective method calls + xForVal = BasicSliderUI.class.getDeclaredMethod( + "xPositionForValue", new Class[] { int.class }); + yForVal = BasicSliderUI.class.getDeclaredMethod( + "yPositionForValue", new Class[] { int.class }); + // Allow us access to the methods + xForVal.setAccessible(true); + yForVal.setAccessible(true); + // Replace UI class with ourselves + defaults.put("SliderUI", SliderSnap.class.getName()); + UIManager.addPropertyChangeListener(reinitListener); + } catch (final Exception e) { + sliderClass = null; + xForVal = yForVal = null; + } + } + } + + /** + * Called to attach mouse listeners to the JSlider. + */ + private static void attachTo(final JSlider c) { + final MouseMotionListener[] listeners = c.getMouseMotionListeners(); + for (final MouseMotionListener m : listeners) { + if (m instanceof TrackListener) { + c.removeMouseMotionListener(m); // remove original + final SnapListener listen = new SnapListener(m, + (BasicSliderUI) c.getUI(), c); + c.addMouseMotionListener(listen); + c.addMouseListener(listen); + c.addPropertyChangeListener("UI", listen); + } + } + } + + private static class SnapListener extends MouseInputAdapter implements + PropertyChangeListener { + private final MouseMotionListener delegate; + /** + * Original Look and Feel implementation + */ + private final BasicSliderUI ui; + /** + * Our slider + */ + private final JSlider slider; + /** + * Offset of mouse click from centre of slider thumb + */ + private int offset; + + public SnapListener(final MouseMotionListener delegate, + final BasicSliderUI ui, final JSlider slider) { + this.delegate = delegate; + this.ui = ui; + this.slider = slider; + } + + /** + * UI can change at any point, so we need to listen for these events. + */ + public void propertyChange(final PropertyChangeEvent evt) { + if ("UI".equals(evt.getPropertyName())) { + // Remove old listeners and create new ones + slider.removeMouseMotionListener(this); + slider.removeMouseListener(this); + slider.removePropertyChangeListener("UI", this); + attachTo(slider); + } + } + + /** + * Implements the actual "snap while dragging" behaviour. If snap to + * ticks is enabled on this slider, then the location for the nearest + * tick/label is calculated and the click location is translated before + * being passed to the delegate. + */ + @Override + public void mouseDragged(final MouseEvent evt) { + if (slider.getSnapToTicks()) { // if we are set to snap + final int pos = getLocationForValue(getSnappedValue(evt)); + // if above call fails and returns -1, take no action + if (pos > -1) { + if (slider.getOrientation() == JSlider.HORIZONTAL) + evt.translatePoint(pos - evt.getX() + offset, 0); + else + evt.translatePoint(0, pos - evt.getY() + offset); + } + } + delegate.mouseDragged(evt); + } + + /** + * When the slider is clicked we need to record the offset from thumb + * center. + */ + @Override + public void mousePressed(final MouseEvent evt) { + + final int pos = (slider.getOrientation() == JSlider.HORIZONTAL) ? evt + .getX() + : evt.getY(); + final int loc = getLocationForValue(getSnappedValue(evt)); + this.offset = (loc < 0) ? 0 : pos - loc; + } + + /* Pass straight to delegate. */ + @Override + public void mouseMoved(final MouseEvent evt) { + delegate.mouseMoved(evt); + } + + /** + * Calculates the nearest snapable value given a MouseEvent. Code + * adapted from BasicSliderUI. + */ + public int getSnappedValue(final MouseEvent evt) { + final int value = slider.getOrientation() == JSlider.HORIZONTAL ? ui + .valueForXPosition(evt.getX()) + : ui.valueForYPosition(evt.getY()); + // Now calculate if we should adjust the value + int snappedValue = value; + int tickSpacing = 0; + final int majorTickSpacing = slider.getMajorTickSpacing(); + final int minorTickSpacing = slider.getMinorTickSpacing(); + if (minorTickSpacing > 0) + tickSpacing = minorTickSpacing; + else if (majorTickSpacing > 0) + tickSpacing = majorTickSpacing; + // If it's not on a tick, change the value + if (tickSpacing != 0) { + if ((value - slider.getMinimum()) % tickSpacing != 0) { + final float temp = (float) (value - slider.getMinimum()) + / (float) tickSpacing; + snappedValue = slider.getMinimum() + + (Math.round(temp) * tickSpacing); + } + } + return snappedValue; + } + + /** + * Provides the x or y co-ordinate for a slider value, depending on + * orientation. + */ + public int getLocationForValue(final int value) { + try { + // Reflectively call slider ui code + final Method m = slider.getOrientation() == JSlider.HORIZONTAL ? xForVal + : yForVal; + final Integer result = (Integer) m.invoke(ui, + new Object[] { new Integer(value) }); + return result.intValue(); + } catch (final InvocationTargetException e) { + return -1; + } catch (final IllegalAccessException e) { + return -1; + } + } + } +} \ No newline at end of file diff --git a/eric/docs/.DS_Store b/eric/docs/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..07a4620d212a2c7bf54b6ef243227b5d0f84d7b5 GIT binary patch literal 12292 zcmeI1&u$Yj5XL_zIYjh84;*@^#Hy#Bka&YtRFK+3g#uM24h@v1P*|EM{Ug-VK1Ls^ z56}nb1Mmj$&DfyLE>)*{K$MIldsbf0*#51@);Ivd;OyWzumYgZEOL2?#UGNqm)uC5 zRP%%~P#+lM6wmO9<<~}QuW$lRzzH}3C*TDB1p+*?CG~GP_v2eHoq!WqNCL7yWXvM- zB+Dpu>tLZF0A-KWn)u8(Ky|Vt^CZhCRh2el^bnG2NFhdu>U^I`bILr)GRmlq5Y-V< z&ml!9L3^iOrp*!ZD7|z7PM}FZV)rGy$CSTfE`BdIi^+%mVzSQ`;#616>pwK{33xoG zHKOjfO7vgXep%Cggd-f|K(&6|7}Rvau%@$$Exe`P3}2{M;1!=H9QT;=l=Wkr@b+Qa ztZmLD^eZ!2GuRz*wlj?I2HTcC!gX!zPfdLY55o*Pd#$XGN!()nrloZg{qE;h)(=VF zF!t{ER@OgqH5sh;&RbbOQop!+U5bxfR@S9$%^cgtuKwG``ouyeh_Bw?y6iay?&?i# ztjlfWo!mRJ-mBJa`@xi7b%X(irar`D@88D^XY6B$9ZMhTS=Byl>*vJw4b-#RSU>6PQVE`0Vm)DoPZN>0#4w;5cmmvs6wj% literal 0 HcmV?d00001 diff --git a/eric/docs/JZirkelProperties.properties b/eric/docs/JZirkelProperties.properties new file mode 100644 index 0000000..9d2622f --- /dev/null +++ b/eric/docs/JZirkelProperties.properties @@ -0,0 +1,824 @@ +# Sample ResourceBundle properties file +menu.file=File +menu.file.new=New +menu.file.load=Open... +menu.file.save=Save +menu.file.saveas=Save As... + +menu.file.exportpng=Export to PNG +menu.file.exporteps=Export to EPS +menu.file.exportsvg=Export to SVG +menu.file.quit=Quit +menu.edit=Edit +menu.edit.copy=Copy +menu.edit.move=Move object +menu.edit.rename=Rename +menu.edit.edit=Edit +menu.edit.hide=Hide +menu.edit.delete=Delete +menu.display=Display +menu.display.hidden=Show/Hide Objects +menu.display.grid=Show/Hide Grid +menu.display.finegrid=Axis only +menu.display.leftsnap=Snap with left button drag +menu.display.manage_macros=Macro Inspector +menu.display.history_panel=History +menu.display.help_panel=Help +menu.display.properties_panel=Object Properties Panel +menu.display.small=Small icons +menu.display.medium=Medium icons +menu.display.large=Large icons +menu.display.restrictedpalette=Show Restricted Palette +menu.display.restrictedpaletteedit=Edit Restricted Palette +menu.display.restrictmessage=
This item allows you to visualize restricted palette.

It only concerns the current file :

when you will 'save as', it will be possible to choose the 'also save the restrict figure'
two files will be created : the first (.zir) will open in 'normal' mode, and
the second (.r.zir) in restricted mode
+menu.macros=Macros +menu.special=Special +menu.special.newmacro=New Macro +menu.special.loadmacros=Open Macro File... +menu.special.definejob=Define an Assignment +menu.special.loadjob=Load an Assignment ... +menu.special.jobcomment=Set Assignment Text ... +menu.special.testjob=Test this Assignment +menu.special.savejob=Save as Assignment ... +menu.special.export=Create HTML File and Browser Preview +menu.special.exporttemplate=HTML Export with Templates +menu.help=Help +menu.help.about=About CaRMetal... +menu.help.info=Context help +menu.help.url0=Go to CaRMetal site +menu.help.url1=Go to CARzine site +menu.help.url2=Go to official C.a.R. site + +filedialog.saveas=Save Figure +filedialog.alsorestricted=Also save restricted figure +filedialog.options=Saving options +filedialog.restrictedmessage=You are working in a restricted session,
so your figure will be save in restricted mode +filedialog.filefilter=CaR File (.zir) +filedialog.compressedfilefilter=Compressed CaR File (.zirz) +filedialog.macrofilefilter=CaR Macro File (.mcr) +filedialog.savemessage1=File :\n +filedialog.savemessage2=\nalready exists. Do you really want to replace it ? + +palette.file=File +palette.edit=Edit +palette.construction=Construction +palette.aspect=Aspect & Color +palette.history=History +palette.sizes=Sizes +palette.sizes.point=Point +palette.sizes.line=Line +palette.sizes.arrow=Arrow +palette.sizes.font=Font +palette.prec=Numerical precision +palette.prec.lengths=Lengths +palette.prec.edit=Expressions +palette.prec.angles=Angles +palette.colors=Background color & image +palette.colors.saturated1=Saturated colors +palette.colors.desaturated1=Desaturated colors +palette.colors.saturated2=Saturated colors 2 +palette.colors.desaturated2=Desaturated colors 2 +palette.colors.constants=Web constants +palette.image.fileerror=You must save this figure before using this tool

After, the picture you will choose must be
in the same directory. +palette.info.vector=Vector +palette.info.image3=Insert image+with 2 or 3 points +palette.info.background=Choose/Clear background image +palette.info.imcenter=Center the background image +palette.info.imstretch=Stretch the background image+to fit the construction window +palette.info.imtile=Tile the background image +palette.info.copy=Copy the construction window +palette.info.exportpng=Export the construction+window to png format +palette.info.exporteps=Export the construction+window to eps format +palette.info.newmacro=Create a new macro +palette.info.loadmacros=Load a macros file +palette.info.manage_macros=Show/Hide the macro panel +palette.info.properties_panel=Show/Hide the objects+properties panel +palette.info.history_panel=Show/Hide the construction+history panel +palette.info.help_panel=Show/Hide the contextual help panel + + + +macros.untitledmacro=Untitled Macro +macros.untitledfolder=Untitled Folder +macros.emptynode=-- Empty -- +macros.addfolder=Add new folder +macros.deleteselected=Delete selected macros +macros.renamemacro=Rename selected macro +macros.recordmacro=Record macro +macros.initials=Initial objects ? +macros.pleaseselect=please select ! +macros.finals=Final objects ? +macros.cancel=Cancel ? +macros.popup.run=Run macro +macros.popup.rename=Rename +macros.popup.delete=Delete +macros.popup.addtolibrary=Add to library +macros.popup.removefromlibrary=Remove from library +macros.popup.publish=Include in the figure +macros.popup.notpublish=Do not include in the figure +macros.popup.saveas=Save As... +macros.popup.properties=Show properties +macros.popup.duplicate=Duplicate +macros.savedlog.buttonok=Save macro file +macros.question.delete=Are you sure you want to delete these macros ? + +rene.zirkel.objects.PointObject=Pt +rene.zirkel.objects.PrimitiveCircleObject=Cir +rene.zirkel.objects.PrimitiveLineObject=Lne +rene.zirkel.objects.ExpressionObject=Exp. +rene.zirkel.objects.FixedAngleObject=Fangle. +rene.zirkel.objects.SegmentObject=Seg. +rene.zirkel.objects.RayObject=Ray +rene.zirkel.objects.TwoPointLineObject=Lne +rene.zirkel.objects.FunctionObject=Fct +rene.zirkel.objects.AreaObject=Area + + +mi.pal.name=Macros inspector +mi.name=Name : +mi.comment=Comment : +mi.properties=Parameters properties : +mi.hideproperties=Targets properties : +mi.hideduplicates=Hide duplicates +mi.apply=Apply +mi.tab.type=Type +mi.tab.name=Name +mi.tab.prompt=Prompt +mi.tab.fix=Fix ? +mi.tab.ask=Ask ? +mi.error.initial=Error : at least one parameter \nhave to be free (no fix, no ask)\n\nThis macro will not be changed + +props.help=In order to see properties, you must right-clic on an object.

If you create a new object with this panel open, you will be able to change the properties during the creation. +props.name=Name : +props.alias=Alias : +props.unit=Unit : +props.fix=Fix : +props.expl=Explanation : +props.belongto=Layer : +props.conditional=Conditional aspect : +props.solid=Solid : +props.hidden=Hidden : +props.normal=Normal : +props.bold=Thick : +props.thin=Dotted : +props.black=Black : +props.green=Green : +props.blue=Blue : +props.brown=Brown : +props.cyan=Cyan : +props.red=Red : +props.showasslider=Slider +props.error=There is a syntax error in this expression.
It will be reinitialized +props.cartesian=Cartesian function +props.parametric=Parametric function +props.functiontype=Type : +props.killarc=Kill arc +props.arc=Arc +props.release=Release +props.bind=Bind +props.setaway=Set away +props.setclose=Set close + + +# v1.3 : +props.grid=Increment : +props.inside=Inside object : +props.pointsonly=With points only : +props.step=Step : +palette.grid=Grid aspect +leftpanel.macros=Macros panel +leftpanel.properties=Properties panel +leftpanel.history=History panel +leftpanel.help=Help panel +selectpopup.whatobject=which object ? +selectpopup.RightClick=Select +selectpopup.MoverTool=Move +selectpopup.HiderTool=Show/Hide +selectpopup.DeleteTool=Delete +selectpopup.RenamerTool=Rename +selectpopup.EditTool=Edit +selectpopup.SetParameterTool=Macro parameters : +selectpopup.SetTargetsTool=Macro targets : +selectpopup.JSmacroTool=Select +palette.info.locus=Locus of point+Envelope of line + +# v1.4 : +menu.special.savezirset=Create slideshow... +filedialog.openfolder.title=Slideshow folder selection dialog +filedialog.openfolder.approve=Select slideshow folder +filedialog.openfolder.saveicons=Also save the restrict icons +slideshow.next=next +slideshow.previous=previous +slideshow.download=Download file +slideshow.signature=Slideshow made with + +# v1.5 : +menu.language=Languages +menu.language.de=Deutsch +menu.language.en=English +menu.language.fr=Fran\u00e7ais +menu.language.es=Espa\u00f1ol +menu.language.gl=Galego +menu.language.zh_TW=Chinese (Traditional) +menu.help.url3=Translate CaRMetal +menu.display.smartboard=Smartboard mode + +# v1.6 : +menu.language.no=Norsk +palette.info.bi_syma=Reflection +palette.info.bi_symc=Symmetry +palette.info.bi_trans=Translation +palette.info.bi_med=Perpendicular bisector +palette.info.bi_biss=Angle bisector +palette.info.bi_circ=Circle through 3 points +palette.info.bi_arc=Circumcircular arc through 3 points +palette.info.bi_t_align=Collinear points ? +palette.info.bi_t_para=Parallel lines ? +palette.info.bi_t_perp=Perpendicular lines ? +palette.info.bi_t_equi=Equidistant from two points ? +palette.info.bi_t_app=Lies on a line ? +palette.info.bi_t_conf=Points at the same place ? +macro.bi_syma.0=Reflection line ? +macro.bi_syma.1=Point to reflect ? +macro.bi_symc.0=Symmetry center ? +macro.bi_symc.1=Point to reflect ? +macro.bi_trans.0=First point of the vector ? +macro.bi_trans.1=Second point of the vector ? +macro.bi_trans.2=Point to translate ? +macro.bi_med.0=First point of the segment ? +macro.bi_med.1=Second point of the segment ? +macro.bi_biss.0=First point ? +macro.bi_biss.1=Angle vertex ? +macro.bi_biss.2=Last point ? +macro.bi_circ.0=First point ? +macro.bi_circ.1=Second point ? +macro.bi_circ.2=Third point ? +macro.bi_t_para.0=First line ? +macro.bi_t_para.1=Second line ? +macro.bi_t_equi.0=Is this point equidistant ... +macro.bi_t_equi.1=From this point ... +macro.bi_t_equi.2=And this point ? +macro.bi_t_app.0=Which point ? +macro.bi_t_app.1=Lies on which line (or segment) ? +macro.bi_t_conf.0=Which point ? +macro.bi_t_conf.1=Is on which point ? +macro.bi_t_align.text0=Points are collinear +macro.bi_t_align.text1=Points are not collinear +macro.bi_t_para.text0=Objects are parallel +macro.bi_t_para.text1=Objects are not parallel +macro.bi_t_perp.text0=Objects are perpendicular +macro.bi_t_perp.text1=Objects are not perpendicular +macro.bi_t_equi.text0=Points are equidistant +macro.bi_t_equi.text1=Points are not equidistant +macro.bi_t_app.text0=The point lies on the object +macro.bi_t_app.text1=The point doesn't lie on the object +macro.bi_t_conf.text0=The two points are at the same place +macro.bi_t_conf.text1=The two points are not at the same place +palette.test=Tests + +# v1.7 : +filedialog.openfolder.appletsize=Applet size : +filedialog.openfolder.actualsize=Actual size +filedialog.openfolder.other=Other... +filedialog.openfolder.selected=Selected folder : +filedialog.openfolder.cancel=Cancel +menu.file.exportsvg=Export to SVG +menu.language.sl=Slovenski +menu.language.nl=Nederlands +menu.language.pt=Portugu\u00eas +props.vars=Variables : +menu.objects.points=Points +menu.objects.lines=Lines +menu.objects.segments=Segments +menu.objects.circles=Circles and conics +menu.objects.angles=Angles +menu.objects.tracks=Tracks and locus +menu.objects.functions=Functions and expressions +palette.info.function_u=User defined function +palette.info.function=Display function+or parametric curve +props.superhidden=Completely hidden : +props.showvalue=Show value : +props.showname=Show name : +props.background=Background : +macro.bi_expression.0=Anchor point ? + +# v1.9a : +menu.help.licence=Licence... +licence.txt=

This program is free software under GNU-GPL licence, which means you can redistribute it and/or modify it under the terms of the licence published by the Free Software Foundation;
See :

+ + +# v2.0 : +menu.special.theme=Themes +menu.special.theme.gray=Polished metal +menu.special.theme.brushed=Brushed metal +menu.special.options=Preferences... +menu.special.options.sizes=Sizes +menu.special.options.sizes.minpointsize=Point size +menu.special.options.sizes.minlinesize=Line size +menu.special.options.sizes.arrowsize=Arrow size +menu.special.options.sizes.minfontsize=Font size +menu.special.options.sizes.digits.lengths=Length precision +menu.special.options.sizes.digits.edit=Expression precision +menu.special.options.sizes.digits.angles=Angle precision +menu.special.options.colors=Colors +menu.special.options.others=Others +menu.special.options.others.undock=Able to undock palettes + +# v2.1 : +menu.file.close=Close window + +# v2.3 : +alert.toomuchwins=There are too many open windows :
please close some of them before opening
a new one + +# v2.4 : +menu.file.new3D=New 3D figure +palette.3D=3D +palette.info.bi_3Dcoords=3D coordinates +macro.bi_3Dcoords.0=Anchor point ? +palette.info.bi_3Dcube=Cube +macro.bi_3Dcube.0=Center of cube ? +palette.info.bi_3Darete=3D edges +macro.bi_3Darete.0=First point ? +macro.bi_3Darete.1=Second point ? +macro.bi_3Darete.2=Third point ? +macro.bi_3Darete.3=Forth point ? +palette.info.bi_3Dtetra=Regular tetrahedon +macro.bi_3Dtetra.0=Center of tetrahedon ? +menu.newdoc=New +menu.language.it=Italiano + +# v2.5.5 : +palette.aspect.label.text_title=Aspect of +palette.aspect.label.point=points +palette.aspect.label.line=lines +palette.aspect.label.segment=segments +palette.aspect.label.circle=circles +palette.aspect.label.angle=angles +palette.aspect.label.area=polygons +palette.aspect.label.text=texts +palette.info.bi_3Ddode=Regular dodecahedron +macro.bi_3Ddode.0=Center of dodecahedron ? + +# v2.7 : +palette.aspect.label.pointshape=Points shape & name : +palette.aspect.label.locus=loci +menu.edit.deleteall=Delete all + + +# v2.7.1 : +java.old.message=Sorry, you can't start CaRMetal program, because your java version is too old ! +java.old.quit=Quit +java.old.go=Download new java version +palette.info.boundedpoint=Place a point into a plane+or onto a polyhedron face + +#v2.7.2 : +user.foldername=CarMetal User Profile + +#v2.8 +props.fixedray=Ray : +props.fixedsegment=Length : +props.fixedangle=Angle : +props.expl=Comment line : +props.aspecttab=Aspect +props.numerictab=Numeric +props.conditionaltab=Conditional +props.thick=Thick : +props.popup.special=Special Characters +props.popup.functions=Predefined functions +props.popup.latex=LaTeX commands +menu.language.pl=Polski + +#v2.8.1 +props.fixedinwindow=Linked to window + +#v2.8.5 +palette.controls=Controls +props.ctrlshowvalue=Show value +props.ctrlsnap=Snap to ticks +props.ctrlshowticks=Show ticks +props.ctrltickspacing=Increment : +palette.info.ctrl_edit=Edit, move or resize control +palette.info.ctrl_chkbox=Add CheckBox +palette.info.ctrl_popup=Add Popup Menu +palette.info.ctrl_slider=Add Slider + +#v2.8.6 +props.trackdmin=Number of steps : +opendialog.preview=Preview : +pngdialog.options=Export options : +pngdialog.scale=Scale : +pngdialog.originsize=Original size : +pngdialog.scaledsize=Scaled size : + +#v2.8.7 +canvas.3D.floor=Floor +canvas.3D.system=Coordinate system +canvas.3D.rightclic=Use right-clic-drag to rotate the coordinate system + + +#v2.8.8 +palette.info.equationxy=Implicit curve defined by f(x,y)=0 +props.equationxy=Equation : +props.equationxychooser=Precision : +palette.function=Functions & locus + +#v2.8.9 +menu.edit.deletealltracks=Clear tracks +menu.edit.deactivatealltracks=Deactivate tracks +props.tracks=Activate track +menu.edit.zoom=Zoom or move + +#v2.9.0 +menu.windows=Window + +#v2.9.1 +contexthelp.seealso=See also : + +#v2.9.2 +menu.language.pt_BR=Brazilian +menu.display.restrictmessage.dontdisplay=Don't display this message anymore + +#v2.9.6 +props.magnetmessage=Clic on the objects you want to add to (or remove from) the magnetic list +props.magnetobj=Magnetic objects +props.magnetpix=Attraction (20 px) : +props.show=Show + +#v2.9.7 +palette.info.ctrl_txtfield=Add Numerical Input Box +palette.info.ctrl_button=Add Button + +#v2.9.8.4 +JSerror.title=Syntax error +JSerror.line=line +JSerror.pointcoords=Syntax error in the coordinates of point +JSerror.interactiveinput=Error during selection of the object +JSerror.notfound=Object not found +JSerror.notgoodtype=Impossible to apply to this type of object +JScmd.inputmessage=Your question ? +JScmd.promptmessage=Your message... +menu.js=Javascript +menu.js.script=Open javascript file... +menu.js.command=Open the script editor +JSeditor.title=Javascript editor + +#v3.0 +JSeditor.save=Save script +JSeditor.open=Open script +JSeditor.opendlogmsg=Open script +JSeditor.savedlogmsg=Save script +JSeditor.format=Format script +JSeditor.restore=Cancel last run +JSeditor.run=Run script +JSeditor.help=Get syntax help +JSEditor.comment=Comment/Uncomment selection +JSEditor.savequestion=This script has changed : would you like to save it ? +menu.language.ar_TN=Arabic + +# v3.1.1 +menu.js.define=Define scripts folder... +menu.js.dumb=Execute favorites scripts without editor +JSeditor.opendfavfolder=Select script folder +JSeditor.saveas=Save script as... + +# v3.5 +menu.language.sv=Svenska +tab.popup.newfigure=New figure +tab.popup.rename=Rename figure +tab.popup.duplicate=Duplicate figure +tab.popup.openworkbook=Open workbook... +tab.popup.saveworkbookas=Save workbook as... +tab.popup.saveworkbook=Save workbook +tab.newfigurebasename=Figure +workbook.workbookmode=Workbook mode +workbook.savequestion=This Workbook have been modified. Do you want to save it ? +progressbar.loadmessage=Loading file : please wait... +progressbar.workbookloadmessage=Loading workbook : please wait... +progressbar.workbooksavemessage=Saving workbook : please wait... +macro.creationdlog.title=Macro creation +macros.name=Macro name ? +JSmenu.cancel=Cancel last run +JSmenu.add=Add new script +JSmenu.modify=Modify script +JSmenu.delete=Delete script +JSeditor.saveinfig.question=Enter script name : +JSeditor.saveinfig.title=Save script to current file +JSeditor.saveinfig=Save script to current file +JSeditor.infig=File included script : +menu.js.newscriptinconstruction=New script in construction... +menu.workbook.saveas=Save Workbook As... +media.saveas=Images were found in open constructions,
so you're going to save files in a same workbook. +menu.display.comment=Show/Hide comments +menu.display.palette=Show/Hide palette +menu.display.leftpanel=Show/Hide left panel +comment.emptycomment= +menu.export.workbook=Workbook HTML page export +menu.export.workbook.error=You must +menu.assigment=Exercise +JSerror.condition=Conditional expression error +filedialog.workbook=CaRMetal workbook (.zirs) +filedialog.job=CaRMetal exercise (.job) +filedialog.js=CaRMetal scripts (.js) +filedialog.allfiles=CaRMetal files (.zirs,.zir,.zirz,.mcr,.job,.js) +tab.popup.savefileonly=Save figure +animation.run=Start Animations +animation.stop=Stop Animations +animation.speed=Animations Speed +animation.removeall=Remove All Animations +animation.reverse=Reverse Animations +restrict.title=Restricted environment manager +menu.display.restrictedenvironment=Restricted environment manager +restrict.ok=Ok +restrict.cancel=Cancel +restrict.activate=Activate restricted environment +restrict.factory=Factory settings +restrict.comment=In order to select or deselect easily multiple palette tools, you can use a right-click/drag on icons. +restrict.menubar=Display menu bar +restrict.librarymacros=Allow library macros +menu.help.opendefaultfolder=Open configuration folder +monkey.btn.tooltip=Shaking construction +job.message.ok=Well Done ! +job.message.failed=Invalid construction... +job.gui.hidebox=Hide target objects +job.gui.ok=Success message : +job.gui.failed=Failed message : +job.gui.targets=Targets list : click here to select +job.gui.close=Create +job.gui.delete=Remove +job.gui.valid=Verify construction +job.gui.restore=Back to origin +job.gui.exercise=This is an exercise : +job.gui.progressmessage=Construction checking in progress +job.gui.alignment=but construction is not valid in some alignment cases +job.gui.title=Exercise editor +restrict.historypanel=Allow history panel display +restrict.macropanel=Allow macro panel display +restrict.helppanel=Allow help panel display +restrict.failed.percent=the recorded failure rate was : +restrict.failed.initial=failed in initial position + +# v3.5.3 +job.gui.staticjob=Static exercise + +# v3.5.5 +menu.edit.copyURL=Copy workbook as URL +palette.aspect.label.image=images +canvas.copy.message=Release mouse to copy selection. ESC : Cancel | MAJ : Square | ALT : 10 x 10 increment. +menu.file.newDP=New hyperbolic geometry figure +palette.info.DP_line=Hyperbolic line +palette.info.DP_midpoint=Hyperbolic midpoint +palette.info.DP_bi_syma=Hyperbolic reflection +palette.info.DP_bi_symc=Hyperbolic symmetry +palette.info.DP_plumb=Hyperbolic perpendicular line +palette.info.DP_bi_med=Hyperbolic perpendicular bissector +palette.info.DP_bi_biss=Hyperbolic angle bissector +palette.info.DP_segment=Hyperbolic segment +palette.info.DP_ray=Hyperbolic ray +palette.info.DP_angle=Hyperbolic angle +palette.info.DP_circle=Hyperbolic circle +palette.info.DP_bi_distance=Hyperbolic distance +palette.info.DP_bi_perp_common=Hyperbolic common perpendicular +palette.info.DP_bi_lineIP=Hyperbolic line with points at infinity +palette.info.DP_bi_horocycle=Horocycles through 2 points +palette.info.DP_bi_equidistante=Equidistant to a line through 1 point +palette.info.DP_fixedangle=Fixed hyperbolic angle +palette.info.DP_bi_circ=Hyperbolic circle through 3 points +macro.DP_line.1=First point of hyperbolic line +macro.DP_line.2=Second point of hyperbolic line +macro.DP_midpoint.1=First point +macro.DP_midpoint.2=Second point +macro.DP_bi_syma.1=Hyperbolic line +macro.DP_bi_syma.2=Point +macro.DP_bi_symc.1=Center +macro.DP_bi_symc.2=Point +macro.DP_plumb.1=Hyperbolic line +macro.DP_plumb.2=Point +macro.DP_bi_med.1=First point +macro.DP_bi_med.2=Second point +macro.DP_bi_biss.1=First point +macro.DP_bi_biss.2=Angle vertex +macro.DP_bi_biss.3=Third point +macro.DP_segment.1=First point +macro.DP_segment.2=Second point +macro.DP_ray.1=First point +macro.DP_ray.2=Second point +macro.DP_angle.1=First point +macro.DP_angle.2=Angle vertex +macro.DP_angle.3=Third point +macro.DP_circle.1=Center point +macro.DP_circle.2=Second point +macro.DP_bi_distance.1=Premier point +macro.DP_bi_distance.2=Second point +macro.DP_bi_distance.3=Anchor point to display the distance +macro.DP_bi_perp_common.1=First hyperbolic line +macro.DP_bi_perp_common.2=Second hyperbolic line +macro.DP_bi_lineIP.1=First point +macro.DP_bi_lineIP.2=Second point +macro.DP_bi_horocycle.1=First point +macro.DP_bi_horocycle.2=Second point +macro.DP_bi_equidistante.1=Hyperbolic line +macro.DP_bi_equidistante.2=A point on the equidistant +macro.DP_fixedangle.1=First point +macro.DP_fixedangle.2=Angle vertex +macro.DP_fixedangle.3=Angle value +macro.DP_bi_circ.1=First point +macro.DP_bi_circ.2=Second point +macro.DP_bi_circ.3=Third point +canvas.DP.message1=The circle is the horizon of Poincar\u00e9 circle. +canvas.DP.message2=Use "Construction" palette zone to add objects to this hyperbolic plane. +JSmenu.ScriptsManager=Scripts Manager +JSmenu.up=Up +JSmenu.down=Down +JSmenu.rename=Rename : +JSmenu.killall=Kill all threads +JSmenu.stopall=Stop all threads +JSmenu.restartall=Restart all threads +palette.construction.euclidian=Euclidian tools +JSmenu.executeonstart=Script runs when file open +JSmenu.dragaction=Clic or drag : +palette.sizes.selectionsize=Selection +palette.sizes.monkeyspeed=Monkey +JSmenu.dragaction.message=Select points or buttons to which you want to attach this script +splash.message=Dynamic geometry software + +#v3.6.2 +palette.sizes.gridopacity=Grid + +#v3.6.3 +menu.file.exportpdf=Export to PDF +filedialog.allexportfiles=Images (.pdf,.eps,.svg,.png) +menu.edit.copyto=Copy to +palette.info.select=Selection zone+for export and copy +palette.info.DP_bi_pinceau1=Hyperbolic pencil by one point +macro.DP_bi_pinceau1.1=First hyperbolic line +macro.DP_bi_pinceau1.2=Second hyperbolic line +macro.DP_bi_pinceau1.3=Point +palette.info.DP_bi_pinceau3=Hyperbolic pencils product +macro.DP_bi_pinceau3.1=First hyperbolic line +macro.DP_bi_pinceau3.2=Second hyperbolic line +macro.DP_bi_pinceau3.3=Third hyperbolic line +palette.info.DP_bi_pinceauinter=Hyperbolic intersection of two pencils +macro.DP_bi_pinceauinter.1=First hyperbolic line +macro.DP_bi_pinceauinter.2=Second hyperbolic line +macro.DP_bi_pinceauinter.3=Third hyperbolic line +macro.DP_bi_pinceauinter.4=Forth hyperbolic line +palette.info.DP_bi_pinceauhauteur=Perpendicular from a pencil +macro.DP_bi_pinceauhauteur.1=First brush hyperbolic line +macro.DP_bi_pinceauhauteur.2=Second brush hyperbolic line +macro.DP_bi_pinceauhauteur.3=Hyperbolic perpendicular line +palette.info.DP_bi_pinceaucycle=Hyperbolic cycle by pencil and point +macro.DP_bi_pinceaucycle.1=First brush hyperbolic line +macro.DP_bi_pinceaucycle.2=Second brush hyperbolic line +macro.DP_bi_pinceaucycle.3=Point +palette.info.DP_bi_pinceaubiss=Hyperbolic bissector +macro.DP_bi_pinceaubiss.1=First hyperbolic line +macro.DP_bi_pinceaubiss.2=First point at infinity of line 1 +macro.DP_bi_pinceaubiss.3=Second point at infinity of line 1 +macro.DP_bi_pinceaubiss.4=Second hyperbolic line +macro.DP_bi_pinceaubiss.5=First point at infinity of line 2 +macro.DP_bi_pinceaubiss.6=Second point at infinity of line 2 +menu.language.ru_RU=Russian + +#v3.7.2 +JSFonctions.Input=Input +JSFonctions.Print=Print +JSFonctions.Println=Println +JSFonctions.Alert=Alert +JSFonctions.ifelse=if... else +JSFonctions.switchcase=switch case +JSFonctions.for=for +JSFonctions.while=while +JSFonctions.dowhile=do{...} while() +JSFonctions.function=function{...} + +#v3.7.6 +menu.export.embedworkbook=Embed workbook in HTML page +menu.edit.copyapplettag=Copy applet tag + +#v3.8 +menu.network=Network +network.menu.launch=Launch / Shut down server +network.menu.connect=Login to server / Logout +network.server.title=Server +network.server.ip=Local IP +network.server.launch=Launch +network.server.receive=Receive only (Global) +network.server.circles=Circles +network.server.functions=Functions +network.server.rtw=Real Time View +network.server.send=Send to : +network.server.all=All +network.client.title=Connection manager +network.client.Name=Name : +network.client.name= +network.client.ip=Server IP : +network.client.port=Port : +network.client.connect=Connect +network.client.sendwork=Send all work +network.client.share=Share + +#v4.0 +JSFonctions.dountil=do{...} until(); +palette.info.vector3D=Vector +palette.info.midpoint3D=Midpoint 3D +palette.info.segment3D=Segment 3D +palette.info.line3D=Line 3D +palette.info.ray3D=Ray 3D +palette.info.area3D=Polygon 3D +props.fixedsegment3D=Length3D : +palette.info.bi_3Dsymp=Reflection to a plan +palette.info.bi_3Dproj=Projection to a plan +palette.info.bi_3Dsymc=3D Symmetry +palette.info.bi_3Dtrans=3D Translation +palette.info.bi_3Dcircle1=Circle 3D given axis through 1 point +palette.info.bi_3Dcircle2=Circle 3D given axis, center and radius +palette.info.bi_3Dcircle3pts=Circle 3D through 3 points +palette.info.bi_3Dplandroite=Intersection of a plane and a line +palette.info.bi_3Dplanplan=Intersection of two planes +palette.info.bi_3Dsphererayon=Sphere with fixed radius +palette.info.bi_3Dspherepoint=Sphere through a point +palette.info.bi_3Dspheredroite=Intersection of a sphere and a line +palette.info.bi_3Dsphereplan=Intersection of a sphere and a plane +palette.info.bi_3Dspheresphere=Intersection of two spheres +macro.bi_3Dsymp.0=Plane of Reflection : First point ? +macro.bi_3Dsymp.1=Plane of Reflection : Second point ? +macro.bi_3Dsymp.2=Plane of Reflection : Third point ? +macro.bi_3Dsymp.3=Point to reflect ? +macro.bi_3Dproj.0=Projection Plane : First point ? +macro.bi_3Dproj.1=Projection Plane : Second point ? +macro.bi_3Dproj.2=Projection Plane : Third point ? +macro.bi_3Dproj.3=Point to project ? +macro.bi_3Dsymc.0=Symmetry center ? +macro.bi_3Dsymc.1=Point to reflect ? +macro.bi_3Dtrans.0=First point of the vector ? +macro.bi_3Dtrans.1=Second point of the vector ? +macro.bi_3Dtrans.2=Point to translate ? +macro.bi_3Dcircle1.0=Circle axis ? +macro.bi_3Dcircle1.1=Point to go through ? +macro.bi_3Dcircle2.0=Circle axis (direction) ? +macro.bi_3Dcircle2.1=Circle center ? +macro.bi_3Dcircle2.2=Numeric radius ? +macro.bi_3Dcircle3pts.0=First point ? +macro.bi_3Dcircle3pts.1=Second point ? +macro.bi_3Dcircle3pts.2=Third point ? +macro.bi_3Dplandroite.0=Plan : first point ? +macro.bi_3Dplandroite.1=Plan : second point ? +macro.bi_3Dplandroite.2=Plan : third point ? +macro.bi_3Dplandroite.3=Line ? +macro.bi_3Dplanplan.0=Plane 1 : first point ? +macro.bi_3Dplanplan.1=Plane 1 : second point ? +macro.bi_3Dplanplan.2=Plane 1 : third point ? +macro.bi_3Dplanplan.3=Plane 2 : first point ? +macro.bi_3Dplanplan.4=Plane 2 : second point ? +macro.bi_3Dplanplan.5=Plane 2 : third point ? +macro.bi_3Dsphererayon.0=Center of the sphere ? +macro.bi_3Dspherepoint.0=Center of the sphere ? +macro.bi_3Dspherepoint.1=Going through point ? +macro.bi_3Dspheredroite.0=Sphere ? +macro.bi_3Dspheredroite.1=Line ? +macro.bi_3Dsphereplan.0=Sphere ? +macro.bi_3Dsphereplan.1=Plane : first point ? +macro.bi_3Dsphereplan.2=Plane : second point ? +macro.bi_3Dsphereplan.3=Plane : third point ? +macro.bi_3Dspheresphere.0=Sphere 1 ? +macro.bi_3Dspheresphere.1=Sphere 2 ? +palette.info.bi_3Docta=Regular octahedon +macro.bi_3Docta.0=Center of the ooctahedon ? +palette.info.bi_3Disoc=Regular icosahedon +macro.bi_3Disoc.0=Center of the icosahedon ? +palette.info.angle3D=Angle 3D +palette.info.intersection3D=3D curves intersection +JSeditor.choseGenerator=switch beginners mode (checked) / standart mode (not checked) +aerialview=aerial view +frontview=front view +rightview=right view +backview=back in mobile view + +#v4.0.3.2 +JSeditor.tortue=Create the turtle and/or Fix it to a point +JSeditor.avancer=Move Forward +JSeditor.reculer=Move Backward +JSeditor.tournerG=Turn Left +JSeditor.tournerD=Turn Right +JSeditor.vitesse=Fix the speed of the turtle +JSeditor.crayonB=Pen down +JSeditor.crayonH=Pen up +JSeditor.cacher=Hide the turtle +JSeditor.montrer=Show the turtle +JSeditor.orienter=Orientate the turtle +JSeditor.viser=Orientate the turtle towards a point +JSeditor.avancer2=Move Forward and return the reached point +JSeditor.avancer3=Move Forward and return the segment run +JSeditor.avancer4=Move Forward and return the reached point and the segment run +JSeditor.reculer2=Move Backward and return the reached point +JSeditor.reculer3=Move Backward and return the segment run +JSeditor.reculer4=Move Backward and return the reached point and the segment run +JSeditor.tournerG3D=Turn Left +JSeditor.tournerD3D=Turn Right +JSeditor.pivoterH=Pitch Up +JSeditor.pivoterB=Pitch Down +JSeditor.pivoterG=Roll Left +JSeditor.pivoterD=Roll Right + +#v4.2.8 +JSeditor.choseFrench=switch code in french (checked) / code in english (not checked) \ No newline at end of file diff --git a/eric/docs/JZirkelProperties_ar_TN.properties b/eric/docs/JZirkelProperties_ar_TN.properties new file mode 100644 index 0000000..e3e9530 --- /dev/null +++ b/eric/docs/JZirkelProperties_ar_TN.properties @@ -0,0 +1,447 @@ +# Sample ResourceBundle properties file +menu.file=\u0645\u0644\u0641 +menu.file.new=\u0634\u0643\u0644 \u062C\u062F\u064A\u062F +menu.file.load=\u0641\u062A\u062D... +menu.file.save=\u062D\u0641\u0638 +menu.file.saveas=\u062D\u0641\u0638 \u0628\u0625\u0633\u0645 +menu.file.exportpng=PNG \u062A\u0635\u062F\u064A\u0631 \u0628\u0635\u064A\u063A\u0629 +menu.file.exporteps=EPS \u062A\u0635\u062F\u064A\u0631 \u0628\u0635\u064A\u063A\u0629 +menu.file.quit=\u062E\u0631\u0648\u062C +menu.edit=\u062A\u062D\u0631\u064A\u0631 +menu.edit.copy=\u0646\u0633\u062E +menu.edit.move=\u062D\u0631\u0643 \u0639\u0646\u0635\u0631 +menu.edit.rename=\u0625\u0639\u0627\u062F\u0629 \u062A\u0633\u0645\u064A\u0629 +menu.edit.edit=\u062A\u063A\u064A\u064A\u0631 +menu.edit.hide=\u0625\u062E\u0641\u0627\u0621 +menu.edit.delete=\u062D\u0630\u0641 +menu.display=\u0639\u0631\u0636 +menu.display.hidden=\u0625\u0638\u0647\u0627\u0631\ \u0625\u062E\u0641\u0627\u0621 \u0627\u0644\u0639\u0646\u0627\u0635\u0631\u0627\u0644\u063A\u064A\u0631 \u0645\u0631\u0626\u064A\u0629 +menu.display.grid=\u0625\u0638\u0647\u0627\u0631\ \u0625\u062E\u0641\u0627\u0621 \u0627\u0644\u0634\u0628\u0643\u0629 +menu.display.finegrid=\u0627\u0644\u0645\u062D\u0627\u0648\u0631 \u0641\u0642\u0637 +menu.display.leftsnap=\u0634\u0628\u0643\u0629 \u0645\u063A\u0646\u0627\u0637\u064A\u0633\u064A\u0629 +menu.display.manage_macros=\u0644\u0648\u062D\u0629 \u062E\u0627\u0635\u064A\u0627\u062A \u0627\u0644\u0623\u062F\u0648\u0627\u062A \u0627\u0644\u062C\u062F\u064A\u062F\u0629 +menu.display.history_panel=\u0645\u0631\u0627\u062D\u0644 \u0627\u0644\u0628\u0646\u0627\u0621 +menu.display.help_panel=\u0644\u0648\u062D\u0629 \u0627\u0644\u0645\u0633\u0627\u0639\u062F\u0629 +menu.display.properties_panel=\u0644\u0648\u062D\u0629 \u062E\u0627\u0635\u064A\u0627\u062A \u0627\u0644\u0639\u0646\u0627\u0635\u0631 +menu.display.small=\u0623\u064A\u0642\u0648\u0646\u0627\u062A \u0635\u063A\u064A\u0631\u0629 +menu.display.medium=\u0623\u064A\u0642\u0648\u0646\u0627\u062A \u0645\u062A\u0648\u0633\u0637\u0629 +menu.display.large=\u0623\u064A\u0642\u0648\u0646\u0627\u062A \u0643\u0628\u064A\u0631\u0629 +menu.display.restrictedpalette=\u0625\u0638\u0647\u0627\u0631 \u0627\u0644\u0644\u0648\u062D\u0629 \u0630\u0627\u062A \u0627\u0644\u0623\u062F\u0648\u0627\u062A \u0627\u0644\u0645\u062E\u062A\u0627\u0631\u0629 +menu.display.restrictedpaletteedit= \u062A\u063A\u064A\u064A\u0631 \u0627\u0644\u0644\u0648\u062D\u0629 \u0630\u0627\u062A \u0627\u0644\u0623\u062F\u0648\u0627\u062A \u0627\u0644\u0645\u062E\u062A\u0627\u0631\u0629 +menu.display.restrictmessage=
\u0647\u0630\u0647 \u0627\u0644\u0645\u064A\u0632\u0629 \u062A\u0645\u0643\u0646\u0643 \u0645\u0646 \u0631\u0624\u064A\u0629  \u0627\u0644\u0644\u0648\u062D\u0629 \u0630\u0627\u062A \u0627\u0644\u0623\u062F\u0648\u0627\u062A \u0627\u0644\u0645\u062E\u062A\u0627\u0631\u0629
\u0644\u0627 \u062A\u062E\u0635  \u0625\u0644\u0627 \u0627\u0644\u0645\u0644\u0641 \u0627\u0644\u062D\u0627\u0644\u064A
\u0639\u0646\u062F \u0627\u0644\u062D\u0641\u0638\u060C \u064A\u0645\u0643\u0646\u0643 \u0625\u062E\u062A\u064A\u0627\u0631"\u062D\u0641\u0638 \u0627\u0627\u0644\u0634\u0643\u0644 \u0623\u064A\u0636\u0627 \u0628\u0623\u062F\u0648\u0627\u062A \u0645\u062E\u062A\u0627\u0631\u0629"
\u0645\u0644\u0641\u0627\u0646 \u0633\u064A\u0642\u0639 \u0625\u0646\u0634\u0627\u0626\u0647\u0645\u0627 : \u0627\u0644\u0623\u0648\u0651\u0644 \u0628\u0635\u064A\u063A\u0629 (zir.)\u0633\u064A\u0641\u062A\u062D \u0641\u064A \u0634\u0643\u0644 \u0639\u0627\u062F\u064A
\u0648 \u0627\u0644\u062B\u0627\u0646\u064A \u0628\u0635\u064A\u063A\u0629(.r.zir) \u0633\u064A\u0641\u062A\u062D \u0628\u0623\u062F\u0648\u0627\u062A \u0645\u062E\u062A\u0627\u0631\u0629
+menu.macros=\u0627\u0644\u0623\u062F\u0648\u0627\u062A \u0627\u0644\u062C\u062F\u064A\u062F\u0629 +menu.special=\u062E\u0627\u0635 +menu.special.newmacro=\u0625\u0646\u0634\u0627\u0621 \u0623\u062F\u0627\u0629 \u062C\u062F\u064A\u062F\u0629 +menu.special.loadmacros=\u0641\u062A\u062D \u0623\u062F\u0627\u0629 \u062C\u062F\u064A\u062F\u0629... +menu.special.definejob=\u062A\u062D\u062F\u064A\u062F \u062A\u0645\u0631\u064A\u0646 +menu.special.loadjob=\u0641\u062A\u062D \u062A\u0645\u0631\u064A\u0646... +menu.special.jobcomment=\u062D\u0631\u0631 \u0646\u0635 \u0627\u0644\u062A\u0645\u0631\u064A\u0646 +menu.special.testjob=\u0627\u062E\u062A\u0628\u0631 \u0647\u0630\u0627 \u0627\u0644\u062A\u0645\u0631\u064A\u0646 +menu.special.savejob=\u062D\u0641\u0638 \u0643\u062A\u0645\u0631\u064A\u0646 +menu.special.export=\u0625\u0646\u0634\u0627\u0621 \u0635\u0641\u062D\u0629 \u0648\u0627\u0628 \u0648 \u0631\u0624\u064A\u062A\u0647\u0627 \u0641\u064A \u0627\u0644\u0645\u062A\u0635\u0641\u062D +menu.special.exporttemplate=\u062A\u0635\u062F\u064A\u0631 \u0644\u0644\u0648\u0627\u0628 \u0645\u0639 \u0646\u0645\u0627\u0630\u062C +menu.help=\u0645\u0633\u0627\u0639\u062F\u0629 +menu.help.about=CaRMetal\u062A\u0639\u0644\u064A\u0645\u0627\u062A \u0639\u0646 +menu.help.info=\u0645\u0633\u0627\u0639\u062F\u0629 \u0646\u0635\u064A\u0629 +menu.help.url0=CaRMetal \u0645\u0648\u0642\u0639 +menu.help.url1=CARzine \u0645\u0648\u0642\u0639 +menu.help.url2=C.a.R.\u0627\u0644\u0645\u0648\u0642\u0639 \u0627\u0644\u0631\u0633\u0645\u064A \u0644\u0640 + +filedialog.options=\u062E\u064A\u0627\u0631\u0627\u062A \u0627\u0644\u062D\u0641\u0638 +filedialog.saveas=\u062D\u0641\u0638 \u0627\u0644\u0634\u0643\u0644 +filedialog.alsorestricted=\u062D\u0641\u0638 \u0623\u064A\u0636\u0627 \u0627\u0644\u0634\u0643\u0644 \u0628\u0623\u062F\u0648\u0627\u062A \u0645\u062E\u062A\u0627\u0631\u0629 +filedialog.restrictedmessage=

\u062D\u0627\u0644\u064A\u0627\u060C \u0627\u0644\u0639\u0645\u0644 \u0641\u064A \u062C\u0644\u0633\u0629 \u062E\u0627\u0635\u0629
\u0633\u064A\u062D\u0641\u0638 \u0627\u0644\u0634\u0643\u0644 \u0628\u0627\u0644\u0623\u062F\u0648\u0627\u062A \u0627\u0644\u0645\u062E\u062A\u0627\u0631\u0629

+filedialog.filefilter=\u0645\u0644\u0641 CaR(.zir) +filedialog.compressedfilefilter=(.zirz) \u0645\u0636\u063A\u0648\u0637 CaR \u0645\u0644\u0641 +filedialog.macrofilefilter=(.mcr) \u0645\u0644\u0641 \u0627\u0644\u0623\u062F\u0648\u0627\u062A \u0627\u0644\u062C\u062F\u064A\u062F\u0629 +filedialog.savemessage1=\n:\u0627\u0644\u0645\u0644\u0641 +filedialog.savemessage2=\n \u0645\u0648\u062C\u0648\u062F. \u0647\u0644 \u062A\u0631\u064A\u062F \u062A\u0639\u0648\u064A\u0636\u0647\u061F + +palette.file=\u0645\u0644\u0641 +palette.edit=\u062A\u062D\u0631\u064A\u0631 +palette.construction=\u0628\u0646\u0627\u0621 +palette.aspect=\u0647\u064A\u0626\u0629 \u0648 \u0644\u0648\u0646 +palette.history=\u0627\u0644\u0645\u0631\u0627\u062D\u0644 \u0627\u0644\u0645\u0646\u062C\u0632\u0629 +palette.sizes=\u0623\u062D\u062C\u0627\u0645 +palette.sizes.point=\u0646\u0642\u0627\u0637 +palette.sizes.line=\u062E\u0637\u0648\u0637 +palette.sizes.arrow=\u0623\u0633\u0647\u0645 +palette.sizes.font=\u0637\u0627\u0642\u0645 \u0627\u0644\u062D\u0631\u0648\u0641 +palette.prec=\u0627\u0644\u062F\u0642\u0629 \u0627\u0644\u0631\u0642\u0645\u064A\u0629 +palette.prec.lengths=\u0623\u0637\u0648\u0627\u0644 +palette.prec.edit=\u0639\u0628\u0627\u0631\u0627\u062A +palette.prec.angles=\u0632\u0648\u0627\u064A\u0627 +palette.colors=\u0644\u0648\u0646 \u0648 \u0635\u0648\u0631\u0629 +palette.colors.saturated1=\u0623\u0644\u0648\u0627\u0646 \u0645\u062D\u062A\u0642\u0646\u0629 +palette.colors.desaturated1=\u0623\u0644\u0648\u0627\u0646 \u063A\u064A\u0631 \u0645\u062D\u062A\u0642\u0646\u0629 +palette.colors.saturated2=\u0623\u0644\u0648\u0627\u0646 \u0645\u062D\u062A\u0642\u0646\u0629 2 +palette.colors.desaturated2=\u0623\u0644\u0648\u0627\u0646 \u063A\u064A\u0631 \u0645\u062D\u062A\u0642\u0646\u0629 2 +palette.colors.constants=\u0623\u0644\u0648\u0627\u0646 \u062E\u0627\u0635\u0629 \u0628\u0627\u0644\u0648\u0627\u0628 +palette.image.fileerror=

\u064A\u062C\u0628 \u0639\u0644\u064A\u0643 \u062D\u0641\u0638 \u0647\u0630\u0627 \u0627\u0627\u0644\u0634\u0643\u0644 \u0642\u0628\u0644 \u0627\u0633\u062A\u0639\u0645\u0627\u0644 \u0647\u0630\u0647 \u0627\u0644\u0645\u064A\u0632\u0629
\u0648 \u0623\u0646 \u062A\u0643\u0648\u0646 \u0627\u0644\u0635\u0648\u0631\u0629 \u0627\u0644\u062A\u064A \u0627\u062E\u062A\u0631\u062A\u0647\u0627 \u0645\u0648\u062C\u0648\u062F\u0629
\u0641\u064A \u0646\u0641\u0633 \u0645\u0643\u0627\u0646  \u0627\u0644\u0634\u0643\u0644

+ +palette.info.vector=\u0645\u062A\u0651\u062C\u0647 +palette.info.image3=\u0625\u062F\u0631\u0627\u062C \u0635\u0648\u0631\u0629+\u0628\u0640 2 \u0623\u0648 3 \u0646\u0642\u0627\u0637 +palette.info.background=\u0627\u062E\u062A\u064A\u0627\u0631\ \u062D\u0630\u0641 \u0635\u0648\u0631\u0629 \u062E\u0644\u0641\u064A\u0629 +palette.info.imcenter=\u0648\u0633\u0637 \u0627\u0644\u0635\u0648\u0631\u0629 \u0627\u0644\u062E\u0644\u0641\u064A\u0629 +palette.info.imstretch=\u062A\u0645\u062F\u064A\u062F \u0627\u0644\u0635\u0648\u0631\u0629 \u0627\u0644\u062E\u0644\u0641\u064A\u0629+\u0644\u062A\u0639\u0628\u0626\u0629 + \u0646\u0627\u0641\u0630\u0629 \u0627\u0644\u0628\u0646\u0627\u0621 +palette.info.imtile=\u0643\u0631\u0631 \u0627\u0644\u0635\u0648\u0631\u0629 \u0627\u0644\u062E\u0644\u0641\u064A\u0629 +palette.info.copy=\u0627\u0646\u0633\u062E \u0646\u0627\u0641\u0630\u0629 \u0627\u0644\u0628\u0646\u0627\u0621+\u0641\u064A \u0627\u0644\u062D\u0627\u0641\u0638\u0629 +palette.info.exportpng=PNG \u062A\u0635\u062F\u064A\u0631 \u0627\u0644\u0628\u0646\u0627\u0621+\u0641\u064A \u0627\u0644\u0646\u0627\u0641\u0630\u0629 \u0627\u0644\u062D\u0627\u0644\u064A\u0629 \u0628\u0635\u064A\u063A\u0629 +palette.info.exporteps=EPS \u062A\u0635\u062F\u064A\u0631 \u0627\u0644\u0628\u0646\u0627\u0621+\u0641\u064A \u0627\u0644\u0646\u0627\u0641\u0630\u0629 \u0627\u0644\u062D\u0627\u0644\u064A\u0629 \u0628\u0635\u064A\u063A\u0629 +palette.info.newmacro=\u0625\u0646\u0634\u0627\u0621 \u0623\u062F\u0627\u0629 \u062C\u062F\u064A\u062F\u0629 +palette.info.loadmacros=\u0641\u062A\u062D \u0645\u0644\u0641 \u0623\u062F\u0627\u0629 \u062C\u062F\u064A\u062F\u0629 +palette.info.manage_macros=\u0625\u0638\u0647\u0627\u0631\\u0625\u062E\u0641\u0627\u0621 \u0644\u0648\u062D\u0629+ \u0627\u0644\u062A\u0635\u0631\u0641 \u0641\u064A \u0627\u0644\u0623\u062F\u0648\u0627\u062A \u0627\u0644\u062C\u062F\u064A\u062F\u0629 +palette.info.properties_panel=\u0625\u0638\u0647\u0627\u0631\\u0625\u062E\u0641\u0627\u0621 \u0644\u0648\u062D\u0629+\u062E\u0627\u0635\u064A\u0627\u062A \u0627\u0644\u0639\u0646\u0627\u0635\u0631 +palette.info.history_panel=\u0625\u0638\u0647\u0627\u0631\\u0625\u062E\u0641\u0627\u0621 \u0644\u0648\u062D\u0629+\u0645\u0631\u0627\u062D\u0644 \u0627\u0644\u0628\u0646\u0627\u0621 +palette.info.help_panel=\u0625\u0638\u0647\u0627\u0631\\u0625\u062E\u0641\u0627\u0621 \u0644\u0648\u062D\u0629+\u0627\u0644\u0645\u0633\u0627\u0639\u062F\u0629 \u0627\u0644\u0646\u0635\u064A\u0629 + + +macros.untitledmacro=\u0623\u062F\u0648\u0627\u062A \u062C\u062F\u064A\u062F\u0629 \u0628\u062F\u0648\u0646 \u0639\u0646\u0648\u0627\u0646 +macros.untitledfolder= \u0645\u062C\u0644\u062F \u0628\u062F\u0648\u0646 \u0639\u0646\u0648\u0627\u0646 +macros.emptynode=\u0641\u0627\u0631\u063A +macros.addfolder=\u0623\u0636\u0641 \u0645\u062C\u0644\u062F \u062C\u062F\u064A\u062F +macros.deleteselected=\u062D\u0630\u0641 \u0627\u0644\u0623\u062F\u0648\u0627\u062A \u0627\u0644\u062C\u062F\u064A\u062F\u0629 \u0627\u0644\u0645\u0646\u062A\u0642\u0627\u062A +macros.renamemacro=\u0625\u0639\u0627\u062F\u0629 \u062A\u0633\u0645\u064A\u0629 \u0627\u0644\u0623\u062F\u0627\u0629 \u0627\u0644\u062C\u062F\u064A\u062F\u0629 \u0627\u0644\u0645\u0646\u062A\u0642\u0627\u0629 +macros.recordmacro= \u062D\u0641\u0638 \u0623\u062F\u0627\u0629 \u062C\u062F\u064A\u062F\u0629 +macros.initials=\u0639\u0646\u0627\u0635\u0631 \u0625\u0628\u062A\u062F\u0627\u0626\u064A\u0629 \u061F +macros.pleaseselect=!\u0627\u0644\u0631\u062C\u0627\u0621 \u0627\u0646\u062A\u0642\u064A +macros.finals=\u0639\u0646\u0627\u0635\u0631 \u0646\u0647\u0627\u0626\u064A\u0629\u061F +macros.cancel=\u0625\u0644\u063A\u0627\u0621\u061F +macros.popup.run=\u0627\u0633\u062A\u0639\u0645\u0644 \u0627\u0644\u0623\u062F\u0627\u0629 \u0627\u0644\u062C\u062F\u064A\u062F\u0629 +macros.popup.rename=\u0625\u0639\u0627\u062F\u0629 \u062A\u0633\u0645\u064A\u0629 +macros.popup.delete=\u062D\u0630\u0641... +macros.popup.addtolibrary=\u0625\u0636\u0627\u0641\u0629 \u0625\u0644\u0649 \u0627\u0644\u0645\u0643\u062A\u0628\u0629 +macros.popup.removefromlibrary=\u0633\u062D\u0628 \u0645\u0646 \u0627\u0644\u0645\u0643\u062A\u0628\u0629 +macros.popup.publish=\u0625\u062F\u0631\u0627\u062C \u0641\u064A \u0627\u0644\u0634\u0643\u0644 +macros.popup.notpublish=\u0639\u062F\u0645 \u0625\u062F\u0631\u0627\u062C\u0647\u0627 \u0641\u064A \u0627\u0644\u0634\u0643\u0644 +macros.popup.saveas=\u062D\u0641\u0638 \u0628\u0625\u0633\u0645... +macros.popup.properties=\u0625\u0638\u0647\u0627\u0631 \u0627\u0644\u062E\u0627\u0635\u0628\u0627\u062A +macros.popup.duplicate=\u0625\u0639\u0627\u062F\u0629 \u0627\u0633\u062A\u0639\u0645\u0627\u0644 +macros.savedlog.buttonok=\u062D\u0641\u0638 \u0645\u0644\u0641 \u0627\u0644\u0623\u062F\u0627\u0629 (\u0627\u0644\u0623\u062F\u0648\u0627\u062A) \u0627\u0644\u062C\u062F\u064A\u062F\u0629 +macros.question.delete=\u0647\u0644 \u0623\u0646\u062A \u0645\u062A\u0623\u0643\u062F \u0645\u0646 \u062D\u0630\u0641 \u0647\u0630\u0647 \u0627\u0644\u0623\u062F\u0648\u0627\u062A \u0627\u0644\u062C\u062F\u064A\u062F\u0629\u061F + +rene.zirkel.objects.PointObject=\u0646\u0642\u0637\u0629 +rene.zirkel.objects.PrimitiveCircleObject=\u062F\u0627\u0626\u0631\u0629 +rene.zirkel.objects.PrimitiveLineObject=\u0645\u0633\u062A\u0642\u064A\u0645 +rene.zirkel.objects.ExpressionObject=\u0646\u0635 +rene.zirkel.objects.FixedAngleObject=\u0632\u0627\u0648\u064A\u0629 \u062B\u0627\u0628\u062A\u0629 +rene.zirkel.objects.SegmentObject=\u0642\u0637\u0639\u0629 \u0645\u0633\u062A\u0642\u064A\u0645 +rene.zirkel.objects.RayObject=\u0634\u0639\u0627\u0639 +rene.zirkel.objects.TwoPointLineObject=\u062E\u0637 +rene.zirkel.objects.FunctionObject=\u062F\u0627\u0644\u0629 +rene.zirkel.objects.AreaObject=\u0645\u0633\u0627\u062D\u0629 + +mi.pal.name=\u0644\u0648\u062D\u0629 \u062E\u0627\u0635\u064A\u0627\u062A \u0627\u0644\u0623\u062F\u0648\u0627\u062A \u0627\u0644\u062C\u062F\u064A\u062F\u0629 +mi.name=\u0623\u0633\u0645 +mi.comment=\u062A\u0639\u0644\u064A\u0642 : +mi.properties=\u062E\u0627\u0635\u064A\u0627\u062A \u0627\u0644\u0639\u0646\u0627\u0635\u0631 \u0627\u0644\u0625\u0628\u062A\u062F\u0627\u0626\u064A\u0629: +mi.hideproperties=\u062E\u0627\u0635\u064A\u0627\u062A \u0627\u0644\u0639\u0646\u0627\u0635\u0631 \u0627\u0644\u0646\u0647\u0627\u0626\u064A\u0629: +mi.hideduplicates=\u0625\u062E\u0641\u0627\u0621 \u0627\u0644\u0639\u0646\u0627\u0635\u0631 \u0645\u062D\u062A\u0645\u0644\u0629 \u0627\u0644\u062A\u0643\u0631\u0627\u0631 +mi.apply=\u0637\u0628\u0642 +mi.tab.type=\u0646\u0648\u0639 +mi.tab.name=\u0623\u0633\u0645 +mi.tab.prompt=\u062F\u0639\u0648\u0629 +mi.tab.fix=\u062B\u0627\u0628\u062A\u061F +mi.tab.ask=\u0627\u0633\u0623\u0644\u061F +mi.error.initial=\u062E\u0637\u0623: \u0639\u0644\u0649 \u0627\u0644\u0623\u0642\u0644 \u0639\u0646\u0635\u0631 \u0627\u0628\u062A\u062F\u0627\u0626\u064A\n \u064A\u0643\u0648\u0646 \u062D\u0631\u0651\u0627(\u063A\u064A\u0631 \u062B\u0627\u0628\u062A \u060C\u063A\u064A\u0631 \u0645\u0637\u0644\u0648\u0628)\n\n \u0644\u0627 \u062A\u063A\u064A\u064A\u0631 \u064A\u062D\u062F\u062B \u0639\u0644\u0649\n \u0647\u0630\u0647 \u0627\u0644\u0623\u062F\u0627\u0629 \u0627\u0644\u062C\u062F\u064A\u062F\u0629 + +props.help= \u0644\u0631\u0624\u064A\u0629 \u062E\u0627\u0635\u064A\u0627\u062A \u0627\u0644\u0639\u0646\u0635\u0631\u060C \u0623\u0646\u0642\u0631 \u0639\u0644\u064A\u0647 \u0628\u0627\u0644\u0632\u0631 \u0627\u0644\u0623\u064A\u0645\u0646 \u0644\u0644\u0641\u0623\u0631\u0629
\u0625\u0630\u0627 \u0623\u0646\u0634\u0623\u062A \u0639\u0646\u0635\u0631\u062C\u062F\u064A\u062F \u0628\u0647 \u0646\u0642\u0627\u0637 \u060C \u064A\u0645\u0643\u0646\u0643 \u0631\u0624\u064A\u062A\u0647 \u0648\u062A\u062D\u0631\u064A\u0631 \u062E\u0627\u0635\u064A\u0627\u062A \u0647\u0630\u0647 \u0627\u0644\u0646\u0642\u0627\u0637 \u062E\u0644\u0627\u0644 \u0627\u0644\u0625\u0646\u0634\u0627\u0621 +props.name=:\u0627\u0633\u0645 +props.alias=:\u0627\u0633\u0645 \u0645\u0633\u062A\u0639\u0627\u0631 +props.unit=:\u0648\u062D\u062F\u0629 +props.fix=:\u062B\u0627\u0628\u062A +props.expl=:\u062A\u0641\u0633\u064A\u0631 +props.belongto=:\u0637\u0628\u0642\u0629 +props.conditional=:\u0647\u064A\u0626\u0629 \u0645\u0634\u0631\u0648\u0637\u0629 +props.solid=:\u0643\u062B\u064A\u0641 +props.hidden=:\u0645\u062E\u0641\u064A +props.normal=:\u0639\u0627\u062F\u064A +props.bold=:\u0633\u0645\u064A\u0643 +props.thin=:\u0645\u0646\u0642\u0637 +props.black=:\u0623\u0633\u0648\u062F +props.green=:\u0623\u062E\u0636\u0631 +props.blue=:\u0623\u0632\u0631\u0642 +props.brown=:\u0628\u0646\u064A +props.cyan=:\u0633\u0645\u0627\u0648\u064A +props.red=:\u0623\u062D\u0645\u0631 +props.showasslider=\u0632\u0631 \u0627\u0644\u0645\u062A\u063A\u064A\u0631\u0627\u062A +props.error=

\u0647\u0646\u0627\u0643 \u062E\u0637\u0623 \u0641\u064A \u0627\u0644\u062A\u0631\u0643\u064A\u0628\u0629 \u0627\u0644\u0639\u0644\u0645\u064A\u0629.
\u0633\u062A\u062A\u0645 \u0645\u0639\u0627\u0644\u062C\u062A\u0647\u0627.

+props.cartesian=\u062F\u0627\u0644\u0629 \u062F\u064A\u0643\u0627\u0631\u062A\u064A\u0629 +props.parametric= \u062F\u0627\u0644\u0629 \u0648\u0633\u064A\u0637\u064A\u0629 +props.functiontype=:\u0646\u0648\u0639 +props.killarc=\u062D\u0630\u0641 \u0642\u0648\u0633 +props.arc=\u0642\u0648\u0633 +props.release=\u0641\u0635\u0644 +props.bind=\u0631\u0628\u0637 +props.setaway=\u0628\u0639\u064A\u062F \u0639\u0646 +props.setclose=\u0642\u0631\u064A\u0628 \u0645\u0646 + +# v1.3 : +props.grid=:\u0632\u064A\u0627\u062F\u0629 +props.inside=:\u062F\u0627\u062E\u0644 \u0627\u0644\u0639\u0646\u0635\u0631 +props.pointsonly=:\u0628\u0627\u0644\u0646\u0642\u0627\u0637 \u0641\u0642\u0637 +props.step=:\u062E\u0637\u0648\u0629 +palette.grid=\u0647\u064A\u0626\u0629 \u0627\u0644\u0634\u0628\u0643\u0629 +leftpanel.macros=\u0644\u0648\u062D\u0629 \u0627\u0644\u062A\u0635\u0631\u0641 \u0641\u064A \u0627\u0644\u0623\u062F\u0648\u0627\u062A \u0627\u0644\u062C\u062F\u064A\u062F\u0629 +leftpanel.properties=\u0644\u0648\u062D\u0629 \u062E\u0627\u0635\u064A\u0627\u062A \u0627\u0644\u0639\u0646\u0627\u0635\u0631 +leftpanel.history=:\u0644\u0648\u062D\u0629 \u0627\u0644\u0645\u0631\u0627\u062D\u0644 \u0627\u0644\u0645\u0646\u062C\u0632\u0629 +leftpanel.help=:\u0644\u0648\u062D\u0629 \u0627\u0644\u0645\u0633\u0627\u0639\u062F\u0629 +selectpopup.whatobject= \u0623\u064A \u0639\u0646\u0635\u0631\u061F +selectpopup.RightClick=:\u0627\u0646\u062A\u0642\u064A +selectpopup.MoverTool=\u062D\u0631\u0643 +selectpopup.HiderTool=\u0627\u062E\u0641\u0627\u0621\\u0625\u0638\u0647\u0627\u0631 +selectpopup.DeleteTool= \u062D\u0630\u0641 +selectpopup.RenamerTool=\u0625\u0639\u0627\u062F\u0629 \u0627\u0644\u062A\u0633\u0645\u064A\u0629 +selectpopup.EditTool=\u062A\u062D\u0631\u064A\u0631 +selectpopup.SetParameterTool=\u0627\u0644\u0623\u062F\u0648\u0627\u062A \u0627\u0644\u062C\u062F\u064A\u062F\u0629 \u0627\u0644\u0627\u0628\u062A\u062F\u0627\u0626\u064A\u0629 +selectpopup.SetTargetsTool=\u0627\u0644\u0623\u062F\u0648\u0627\u062A \u0627\u0644\u062C\u062F\u064A\u062F\u0629 \u0627\u0644\u0646\u0647\u0627\u0626\u064A\u0629 +palette.info.locus=\u0645\u062D\u0644 \u0647\u0646\u062F\u0633\u064A \u0644\u0644\u0646\u0642\u0637\u0629+ \u0645\u062D\u0644 \u0647\u0646\u062F\u0633\u064A \u0644\u0644\u0645\u0633\u062A\u0642\u064A\u0645\u0627\u062A + + +# v1.4 : +menu.special.savezirset=: \u0625\u0646\u0634\u0627\u0621 \u0639\u0631\u0636 \u0627\u0644\u0634\u0631\u0627\u0626\u062D +filedialog.openfolder.title=\u0641\u064A \u0645\u0631\u0628\u0639 \u0627\u0644\u062D\u0648\u0627\u0631 \u0627\u062E\u062A\u064A\u0627\u0631 \u0645\u062C\u0644\u062F \u0639\u0631\u0636 \u0627\u0644\u0634\u0631\u0627\u0626\u062D +filedialog.openfolder.approve=\u0627\u0646\u062A\u0642\u064A \u0645\u062C\u0644\u062F \u0639\u0631\u0636 \u0627\u0644\u0634\u0631\u0627\u0626\u062D +filedialog.openfolder.saveicons\u062D\u0641\u0638 \u0623\u064A\u0636\u0627 \u0644\u0623\u062F\u0648\u0627\u062A \u0627\u0644\u0645\u062E\u062A\u0627\u0631\u0629 +slideshow.next=\u0627\u0644\u062A\u0627\u0644\u064A +slideshow.previous=\u0627\u0644\u0633\u0627\u0628\u0642 +slideshow.download=\u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0645\u0644\u0641 +slideshow.signature=:\u0639\u0631\u0636 \u0627\u0644\u0634\u0631\u0627\u0626\u062D \u0627\u0644\u0645\u0633\u062A\u062E\u062F\u0645\u0629 + +# v1.5 : +menu.language= \u0627\u0644\u0644\u063A\u0627\u062A : +menu.help.url3=CaRMetal\u062A\u0631\u062C\u0645 +menu.display.smartboard=\u0627\u0644\u0633\u0628\u0648\u0631\u0629 \u0627\u0644\u062A\u0641\u0627\u0639\u0644\u064A\u0629 \u0627\u0644\u0631\u0642\u0645\u064A\u0629 + +# v1.6 : +palette.info.bi_syma=\u0627\u0644\u062A\u0646\u0627\u0638\u0631 \u0627\u0644\u0645\u062D\u0648\u0631\u064A +palette.info.bi_symc=\u0627\u0644\u062A\u0646\u0627\u0638\u0631 \u0627\u0644\u0645\u0631\u0643\u0632\u064A +palette.info.bi_trans=\u0627\u0646\u0633\u062D\u0627\u0628 +palette.info.bi_med=\u0627\u0644\u0645\u0648\u0633\u0637 \u0627\u0644\u0639\u0645\u0648\u062F\u064A +palette.info.bi_biss=\u0645\u0646\u0635\u0641 \u0627\u0644\u0632\u0627\u0648\u064A\u0629 +palette.info.bi_circ=\u0627\u0644\u062F\u0627\u0626\u0631\u0629 \u0627\u0644\u0645\u062D\u064A\u0637\u0629 +palette.info.bi_arc=\u0642\u0648\u0633 \u064A\u0645\u0631 \u0645\u0646 \u062B\u0644\u0627\u062B \u0646\u0642\u0627\u0637 +palette.info.bi_t_align=\u0646\u0642\u0627\u0637 \u0639\u0644\u0649 \u0627\u0633\u062A\u0642\u0627\u0645\u0629 \u0648\u0627\u062D\u062F\u0629 \u061F +palette.info.bi_t_para=\u0645\u0633\u062A\u0642\u064A\u0645\u0627\u0646 \u0645\u062A\u0648\u0627\u0632\u064A\u0627\u0646 \u061F +palette.info.bi_t_perp=\u0645\u0633\u062A\u0642\u064A\u0645\u0627\u0646 \u0645\u062A\u0639\u0627\u0645\u062F\u0627\u0646 \u061F +palette.info.bi_t_equi=\u0627\u0644\u0646\u0642\u0637\u0629 \u0645\u062A\u0642\u0627\u064A\u0633\u0629 \u0627\u0644\u0628\u0639\u062F \u0639\u0646 \u0627\u0644\u0646\u0642\u0637\u062A\u064A\u0646 \u0627\u0644\u0622\u062E\u0631\u062A\u064A\u0646\u061F +palette.info.bi_t_app=\u062A\u0646\u062A\u0645\u064A \u0625\u0644\u0649 \u0645\u0633\u062A\u0642\u064A\u0645 \u061F +palette.info.bi_t_conf=\u0627\u0644\u0646\u0642\u0627\u0637 \u0645\u062A\u0637\u0627\u0628\u0642\u0629\u061F +macro.bi_syma.0=\u0645\u062D\u0648\u0631 \u0627\u0644\u062A\u0646\u0627\u0638\u0631\u061F +macro.bi_syma.1=\u062A\u0646\u0627\u0638\u0631 \u0645\u062D\u0648\u0631\u064A \u0644\u0623\u064A \u0646\u0642\u0637\u0629\u061F +macro.bi_symc.0=\u0645\u0631\u0643\u0632 \u0627\u0644\u062A\u0646\u0627\u0638\u0631\u061F +macro.bi_symc.1=\u062A\u0646\u0627\u0638\u0631 \u0645\u0631\u0643\u0632\u064A \u0644\u0623\u064A \u0646\u0642\u0637\u0629\u061F +macro.bi_trans.0=\u062D\u062F\u062F \u0623\u0635\u0644 \u0627\u0644\u0645\u062A\u0651\u062C\u0647 \u061F +macro.bi_trans.1=\u062D\u062F\u062F \u0637\u0631\u0641 \u0627\u0644\u0645\u062A\u062C\u0651\u0647\u061F +macro.bi_trans.2=\u0635\u0648\u0631\u0629 \u0644\u0623\u064A \u0646\u0642\u0637\u0629 \u061F +macro.bi_med.0=\u062D\u062F\u062F \u0637\u0631\u0641 \u0627\u0644\u0623\u0648\u0651\u0644 \u0644\u0642\u0637\u0639\u0629 \u0627\u0644\u0645\u0633\u062A\u0642\u064A\u0645\u061F +macro.bi_med.1=\u062D\u062F\u062F \u0637\u0631\u0641 \u0627\u0644\u062B\u0627\u0646\u064A \u0644\u0642\u0637\u0639\u0629 \u0627\u0644\u0645\u0633\u062A\u0642\u064A\u0645\u061F +macro.bi_biss.0=\u062D\u062F\u062F \u0627\u0644\u0646\u0642\u0637\u0629 \u0627\u0644\u0623\u0648\u0644\u0649 \u061F +macro.bi_biss.1=\u062D\u062F\u062F \u0631\u0623\u0633 \u0627\u0644\u0632\u0627\u0648\u064A\u0629 \u061F +macro.bi_biss.2=\u062D\u062F\u062F \u0627\u0644\u0646\u0642\u0637\u0629 \u0627\u0644\u062B\u0627\u0644\u062B\u0629 \u061F +macro.bi_circ.0=\u062D\u062F\u062F \u0627\u0644\u0646\u0642\u0637\u0629 \u0627\u0644\u0623\u0648\u0644\u0649 \u061F +macro.bi_circ.1=\u062D\u062F\u062F \u0627\u0644\u0646\u0642\u0637\u0629 \u0627\u0644\u062B\u0627\u0646\u064A\u0629 \u061F +macro.bi_circ.2=\u062D\u062F\u062F \u0627\u0644\u0646\u0642\u0637\u0629 \u0627\u0644\u062B\u0627\u0644\u062B\u0629 \u061F +macro.bi_t_para.0=\u062D\u062F\u062F \u0627\u0644\u0645\u0633\u062A\u0642\u064A\u0645 (\u0623\u0648 \u0642\u0637\u0639\u0629 \u0645\u0633\u062A\u0642\u064A\u0645)\u0627\u0644\u0623\u0648\u0644 \u061F +macro.bi_t_para.1=\u062D\u062F\u062F \u0627\u0644\u0645\u0633\u062A\u0642\u064A\u0645 (\u0623\u0648 \u0642\u0637\u0639\u0629 \u0645\u0633\u062A\u0642\u064A\u0645)\u0627\u0644\u062B\u0627\u0646\u064A \u061F +macro.bi_t_equi.0=...\u0647\u0644 \u0647\u0630\u0647 \u0627\u0644\u0646\u0642\u0637\u0629 \u0645\u062A\u0642\u0627\u064A\u0633\u0629 \u0627\u0644\u0628\u0639\u062F +macro.bi_t_equi.1=...\u0645\u0646 \u0647\u0630\u0647 \u0627\u0644\u0646\u0642\u0637\u0629 +macro.bi_t_equi.2=\u0648 \u0647\u0630\u0647 \u0627\u0644\u0646\u0642\u0637\u0629\u061F +macro.bi_t_app.0=\u0623\u064A\u0651 \u0646\u0642\u0637\u0629 \u061F +macro.bi_t_app.1=\u062A\u0646\u062A\u0645\u064A \u0644\u0623\u064A\u0651 \u0645\u0633\u062A\u0642\u064A\u0645 ( \u0623\u0648 \u0642\u0637\u0639\u0629 \u0645\u0633\u062A\u0642\u064A\u0645)\u061F +macro.bi_t_conf.0=\u0623\u064A\u0651 \u0646\u0642\u0637\u0629 \u061F +macro.bi_t_conf.1=\u0645\u062A\u0637\u0627\u0628\u0642\u0629 \u0645\u0639 \u0623\u064A\u0651 \u0646\u0642\u0637\u0629\u061F +macro.bi_t_align.text0=\u0627\u0644\u0646\u0642\u0627\u0637 \u0639\u0644\u0649 \u0627\u0633\u062A\u0642\u0627\u0645\u0629 \u0648\u0627\u062D\u062F\u0629 +macro.bi_t_align.text1=\u0627\u0644\u0646\u0642\u0627\u0637 \u0644\u064A\u0633\u0648\u0627 \u0639\u0644\u0649 \u0627\u0633\u062A\u0642\u0627\u0645\u0629 \u0648\u0627\u062D\u062F\u0629 +macro.bi_t_para.text0=\u0627\u0644\u0639\u0646\u0627\u0635\u0631 \u0645\u062A\u0648\u0627\u0632\u064A\u0629 +macro.bi_t_para.text1=\u0627\u0644\u0639\u0646\u0627\u0635\u0631\u063A\u064A\u0631\u0645\u062A\u0648\u0627\u0632\u064A\u0629 +macro.bi_t_perp.text0=\u0627\u0644\u0639\u0646\u0627\u0635\u0631 \u0645\u062A\u0639\u0627\u0645\u062F\u0629 +macro.bi_t_perp.text1=\u0627\u0644\u0639\u0646\u0627\u0635\u0631\u063A\u064A\u0631\u0645\u062A\u0639\u0627\u0645\u062F\u0629 +macro.bi_t_equi.text0=\u0627\u0644\u0646\u0642\u0627\u0637 \u0645\u062A\u0642\u0627\u064A\u0633\u0629 \u0627\u0644\u0628\u0639\u062F +macro.bi_t_equi.text1=\u0627\u0644\u0646\u0642\u0627\u0637 \u063A\u064A\u0631 \u0645\u062A\u0642\u0627\u064A\u0633\u0629 \u0627\u0644\u0628\u0639\u062F +macro.bi_t_app.text0=...\u0627\u0644\u0646\u0642\u0637\u0629 \u062A\u0646\u062A\u0645\u064A +macro.bi_t_app.text1=...\u0627\u0644\u0646\u0642\u0637\u0629 \u0644\u0627 \u062A\u0646\u062A\u0645\u064A +macro.bi_t_conf.text0=\u0627\u0644\u0646\u0642\u0637\u062A\u0627\u0646 \u0645\u062A\u0637\u0627\u0628\u0642\u062A\u0627\u0646 +macro.bi_t_conf.text1=\u0627\u0644\u0646\u0642\u0637\u062A\u0627\u0646 \u063A\u064A\u0631 \u0645\u062A\u0637\u0627\u0628\u0642\u062A\u064A\u0646 +palette.test=\u0627\u062E\u062A\u0628\u0631 + +# v1.7 : +filedialog.openfolder.appletsize=\u062D\u062C\u0645 \u0627\u0644\u062A\u0637\u0628\u064A\u0642 +filedialog.openfolder.actualsize=:\u0627\u0644\u062D\u062C\u0645 \u0627\u0644\u062D\u0627\u0644\u064A +filedialog.openfolder.other=...\u063A\u064A\u0631 + filedialog.openfolder.selected=:\u0627\u0644\u0645\u062C\u0644\u062F \u0627\u0644\u0645\u062E\u062A\u0627\u0631 +filedialog.openfolder.cancel=:\u0627\u0644\u063A\u0627\u0621 +menu.file.exportsvg=: SVG \u0635\u062F\u064A\u0631 \u0628\u0635\u064A\u063A\u0629 +menu.objects.points=:\u0646\u0642\u0627\u0637 +menu.objects.lines=:\u0645\u0633\u062A\u0642\u064A\u0645\u0627\u062A +menu.objects.segments=:\u0642\u0637\u0639 \u0645\u0633\u062A\u0642\u064A\u0645\u0627\u062A +menu.objects.circles= \u062F\u0648\u0627\u0626\u0631\u0648 \u0645\u062E\u0631\u0648\u0637\u064A\u0627\u062A +menu.objects.angles=:\u0632\u0648\u0627\u064A\u0627 +menu.objects.tracks=:\u0622\u062B\u0627\u0631 \u0648\u0645\u062D\u0644\u0627\u062A \u0647\u0646\u062F\u0633\u064A\u0629 +menu.objects.functions=:\u062F\u0627\u0644\u0627\u062A \u0648 \u0639\u0628\u0627\u0631\u0627\u062A +palette.info.function_u=:\u062F\u0627\u0644\u0629 \u064A\u062D\u062F\u062F\u0647\u0627 \u0627\u0644\u0645\u0633\u062A\u0639\u0645\u0644 +palette.info.function=\u0631\u0633\u0645 \u062F\u0627\u0644\u0629 +\u0623\u0648 \u0645\u0646\u062D\u0646\u0649 \u0648\u0633\u064A\u0637\u064A +props.superhidden=\u0645\u062E\u0641\u064A \u062A\u0645\u0627\u0645\u0627 +props.showvalue=\u0627\u0638\u0647\u0627\u0631 \u0627\u0644\u0642\u064A\u0645\u0629 +props.showname=\u0627\u0638\u0647\u0627\u0631 \u0627\u0644\u0627\u0633\u0645 +props.background=\u062E\u0644\u0641\u064A\u0629 +macro.bi_expression.0=\u0646\u0642\u0637\u0629 \u0645\u0631\u0633\u0627\u0629 \u061F + +# v1.9a : +menu.help.licence=\u062A\u0631\u062E\u064A\u0635 +licence.txt=

\u0647\u0630\u0627 \u0627\u0644\u0628\u0631\u0646\u0627\u0645\u062C \u0645\u062C\u0627\u0646\u064A  \u0636\u0645\u0646  \u0627\u062A\u0641\u0627\u0642\u064A\u0629 \u0627\u0644\u062A\u0631\u062E\u064A\u0635 \u0627\u0644\u0639\u0645\u0648\u0645\u064A\u0629  GNU-GPL \u060C \u0648 \u0647\u0630\u0627 \u064A\u0639\u0646\u064A  \u064A\u0645\u0643\u0646 \u0625\u0639\u0627\u062F\u0629 \u062A\u0648\u0632\u064A\u0639\u0647 \u0623\u0648 \u062A\u063A\u064A\u064A\u0631\u0647 \u062D\u0633\u0628  \u0634\u0631\u0648\u0637  \u0627\u0644\u0623\u062A\u0641\u0627\u0642\u064A\u0629 \u0627\u0644\u0645\u0646\u0634\u0648\u0631\u0629 \u0645\u0646 \u0637\u0631\u0641 "\u0624\u0633\u0633\u0629 \u0627\u0644\u0628\u0631\u0645\u0627\u062C\u064A\u0627\u062A \u0627\u0644\u062D\u0631\u0651\u0629"
\u0627\u0646\u0638\u0631  :

+ + +# v2.0 : +menu.special.theme=\u062E\u0644\u0641\u064A\u0627\u062A \u0627\u0644\u0628\u0631\u0646\u0627\u0645\u062C +menu.special.theme.gray=\u0631\u0635\u0627\u0635\u064A +menu.special.theme.brushed=\u0631\u0635\u0627\u0635\u064A \u0645\u0635\u0642\u0648\u0644 +menu.special.options=...\u0627\u0644\u0645\u0641\u0636\u0644\u0627\u062A. +menu.special.options.sizes=\u0627\u0644\u0623\u062D\u062C\u0627\u0645 +menu.special.options.sizes.minpointsize= \u062D\u062C\u0645 \u0627\u0644\u0646\u0642\u0627\u0637 +menu.special.options.sizes.minlinesize=\u0633\u0645\u0643 \u0627\u0644\u062E\u0637\u0648\u0637 +menu.special.options.sizes.arrowsize=\u062D\u062C\u0645 \u0627\u0644\u0623\u0633\u0647\u0645 +menu.special.options.sizes.minfontsize=\u062D\u062C\u0645 \u0627\u0644\u062D\u0631\u0648\u0641 +menu.special.options.sizes.digits.lengths=\u062F\u0642\u0629 \u0627\u0644\u0623\u0637\u0648\u0627\u0644 +menu.special.options.sizes.digits.edit=\u062F\u0642\u0629 \u0627\u0644\u0639\u0628\u0627\u0631\u0627\u062A +menu.special.options.sizes.digits.angles=\u062F\u0642\u0629 \u0627\u0644\u0632\u0648\u0627\u064A\u0627 +menu.special.options.colors=\u0623\u0644\u0648\u0627\u0646 +menu.special.options.others=\u063A\u064A\u0631 +menu.special.options.others.undock=\u0625\u0645\u0643\u0627\u0646\u064A\u0629 \u0641\u0635\u0644 \u0627\u0644\u0623\u0644\u0648\u0627\u062D + + +# v2.1 : +menu.file.close=\u0623\u063A\u0644\u0642 \u0627\u0644\u0646\u0627\u0641\u0630\u0629 + +# v2.3 : +alert.toomuchwins=

\u0647\u0646\u0627\u0643 \u0627\u0644\u0643\u062B\u064A\u0631 \u0645\u0646 \u0627\u0644\u0646\u0648\u0627\u0641\u0630 \u0627\u0644\u0645\u0641\u062A\u0648\u062D\u0629 :
\u0627\u0644\u0631\u062C\u0627\u0621 \u0625\u063A\u0644\u0627\u0642 \u0627\u0644\u0628\u0639\u0636 \u0645\u0646\u0647\u0627
\u0645\u0646 \u0623\u062C\u0644 \u0641\u062A\u062D \u0627\u0644\u0645\u0632\u064A\u062F....

+ +# v2.4 : +menu.file.new3D=\u0645\u0644\u0641 \u062C\u062F\u064A\u062F \u062B\u0644\u0627\u062B\u064A \u0627\u0644\u0623\u0628\u0639\u0627\u062F +palette.info.bi_3Dcoords=\u0625\u062D\u062F\u0627\u062B\u064A\u0627\u062A \u062B\u0644\u0627\u062B\u064A\u0629 \u0627\u0644\u0623\u0628\u0639\u0627\u062F +macro.bi_3Dcoords.0=\u0646\u0642\u0637\u0629 \u062A\u062B\u0628\u064A\u062A \u0627\u0644\u0625\u062D\u062F\u0627\u062B\u064A\u0627\u062A \u061F +palette.info.bi_3Dcube=\u0645\u0643\u0639\u0628 +macro.bi_3Dcube.0=\u0645\u0631\u0643\u0632 \u0627\u0644\u0645\u0643\u0639\u0628 +palette.info.bi_3Darete=\u062D\u0631\u0641 \u062B\u0644\u0627\u062B\u064A \u0627\u0644\u0623\u0628\u0639\u0627\u062F ( \u0627\u0644\u062A\u0635\u0631\u0641 \u0641\u064A \u0627\u0644\u0645\u0646\u0642\u0648\u0637) +macro.bi_3Darete.0=\u0627\u0644\u0646\u0642\u0637\u0629 \u0627\u0644\u0623\u0648\u0644\u0649 \u061F +macro.bi_3Darete.1=\u0627\u0644\u0646\u0642\u0637\u0629 \u0627\u0644\u062B\u0627\u0646\u064A\u0629 \u061F +macro.bi_3Darete.2=\u0627\u0644\u0646\u0642\u0637\u0629 \u0627\u0644\u062B\u0627\u0644\u062B\u0629 \u061F +macro.bi_3Darete.3=\u0627\u0644\u0646\u0642\u0637\u0629 \u0627\u0644\u0631\u0627\u0628\u0639\u0629 \u061F +palette.info.bi_3Dtetra=\u0631\u0628\u0627\u0639\u064A \u0627\u0644\u0623\u0648\u062C\u0647 \u0645\u0646\u062A\u0638\u0645 +macro.bi_3Dtetra.0=\u0645\u0631\u0643\u0632 \u0631\u0628\u0627\u0639\u064A \u0627\u0644\u0623\u0648\u062C\u0647 +menu.newdoc=\u062C\u062F\u064A\u062F + +# v2.5.5 : +palette.aspect.label.text_title=\u0647\u064A\u0626\u0629 +palette.aspect.label.point=\u0646\u0642\u0627\u0637 +palette.aspect.label.line=\u0645\u0633\u062A\u0642\u064A\u0645\u0627\u062A +palette.aspect.label.segment=\u0642\u0637\u0639 \u0627\u0644\u0645\u0633\u062A\u0642\u064A\u0645\u0627\u062A +palette.aspect.label.circle=\u062F\u0648\u0627\u0626\u0631 +palette.aspect.label.angle=\u0632\u0648\u0627\u064A\u0627 +palette.aspect.label.area=\u0645\u0636\u0644\u0639\u0627\u062A +palette.aspect.label.text=\u0646\u0635\u0648\u0635 +palette.info.bi_3Ddode=\u0627\u0644\u0627\u062B\u0646\u0627 \u0639\u0634\u0631\u064A \u0627\u0644\u0623\u0648\u062C\u0647 \u0645\u0646\u062A\u0638\u0645 +macro.bi_3Ddode.0=\u0645\u0631\u0643\u0632 \u0627\u0644\u0627\u062B\u0646\u0627 \u0639\u0634\u0631\u064A \u0627\u0644\u0623\u0648\u062C\u0647 + + +# v2.7 : +palette.aspect.label.pointshape=:\u0634\u0643\u0644 \u0648 \u0627\u0633\u0645 \u0627\u0644\u0646\u0642\u0627\u0637 +palette.aspect.label.locus=\u0645\u062D\u0644\u0651 \u0647\u0646\u062F\u0633\u064A +menu.edit.deleteall=\u0645\u0633\u062D \u0643\u0644\u064A + + +# v2.7.1 : +jjava.old.message=\u0639\u0641\u0648\u0627 ... \u063A\u064A\u0631 \u0645\u0645\u0643\u0646 \u062A\u0634\u063A\u064A\u0644 \u0627\u0644\u0628\u0631\u0646\u0627\u0645\u062C Carmetal \u0644\u0623\u0646 \u0646\u0633\u062E\u0629 Java \u0639\u064A\u0631 \u0645\u062D\u064A\u0646\u0629... +java.old.quit=\u062E\u0631\u0648\u062C +java.old.go=Java \u062A\u062D\u0645\u064A\u0644 \u0646\u0633\u062E\u0629 \u062C\u062F\u064A\u062F\u0629 \u0645\u0646 +palette.info.boundedpoint=\u0639\u064A\u0651\u0646 \u0646\u0642\u0637\u0629 \u0639\u0644\u0649 \u0627\u0644\u0645\u0633\u062A\u0648\u064A+\u0623\u0648 \u0639\u0644\u0649 \u0648\u062C\u0647 \u0645\u0646 \u062C\u0633\u0645 \u0645\u062A\u0639\u062F\u062F \u0627\u0644\u0623\u0648\u062C\u0647 + +#v2.7.2 : +user.foldername=CaRMetal \u0645\u0639\u0637\u064A\u0627\u062A \u0639\u0646 \u0645\u0633\u062A\u062E\u062F\u0645 + +#v2.8 +props.fixedray=:\u0634\u0639\u0627\u0639 +props.fixedsegment=:\u0637\u0648\u0644 +props.fixedangle=:\u0632\u0627\u0648\u064A\u0629 +props.expl=:\u062A\u0639\u0644\u064A\u0642 +props.aspecttab=\u0647\u064A\u0626\u0629 +props.numerictab=\u0631\u0642\u0645\u064A +props.conditionaltab=\u0634\u0631\u0637\u064A +props.popup.special=\u0623\u062D\u0631\u0641 \u062E\u0627\u0635\u0629 +props.popup.functions=\u062F\u0627\u0644\u0627\u062A \u0627\u0644\u0645\u062A\u0639\u0627\u0631\u0641 \u0639\u0644\u064A\u0647\u0627 +props.popup.latex=LaTex \u0623\u0648\u0627\u0645\u0631 + +#v2.8.1 +props.fixedinwindow=\u0645\u0631\u062A\u0628\u0637 \u0628\u0627\u0644\u0646\u0627\u0641\u0630\u0629 + +#v2.8.5 +palette.controls=\u0627\u0644\u062A\u062D\u0643\u0645 +props.ctrlshowvalue=\u0625\u0638\u0647\u0627\u0631 \u062F\u0631\u062C\u0629 \u0627\u0644\u062A\u062D\u0643\u0645 +props.ctrlsnap=\u0645\u0631\u062A\u0628\u0637 \u0628\u0627\u0644\u062A\u062F\u0631\u062C +props.ctrlshowticks=\u0625\u0638\u0647\u0627\u0631 \u0627\u0644\u062A\u062F\u0631\u062C +props.ctrltickspacing=\u0627\u0644\u0632\u064A\u0627\u062F\u0629 +palette.info.ctrl_edit=\u062D\u0631\u0651\u0631\u060C \u062D\u0631\u0643+\u0623\u0648 \u0635\u063A\u0631\\u0643\u0628\u0631 \u0627\u0644\u062A\u062D\u0643\u0645 +palette.info.ctrl_chkbox=\u0623\u0636\u0641 \u0645\u0631\u0628\u0639 \u0625\u062E\u062A\u064A\u0627\u0631 +palette.info.ctrl_popup=\u0623\u0636\u0641 \u0642\u0627\u0626\u0645\u0629 \u0645\u0646\u0633\u062F\u0644\u0629 +palette.info.ctrl_slider= \u0625\u0636\u0627\u0641\u0629 \u0632\u0631 \u0645\u062A\u063A\u064A\u0631\u0627\u062A + +#v2.8.6 +props.trackdmin=:\u0639\u062F\u062F \u0627\u0644\u0645\u0631\u0627\u062D\u0644 +opendialog.preview=:\u0645\u0639\u0627\u064A\u0646\u0629 +pngdialog.options=:\u062E\u064A\u0627\u0631\u0627\u062A \u0627\u0644\u062A\u0635\u062F\u064A\u0631 +pngdialog.scale=:\u0633\u0644\u0645 +pngdialog.originsize=:\u062D\u062C\u0645 \u0627\u0644\u0623\u0635\u0644\u064A +pngdialog.scaledsize=:\u062D\u062C\u0645 \u062D\u0633\u0628 \u0627\u0644\u0633\u0644\u0645 + + +#v2.8.7 +canvas.3D.floor=\u0623\u0631\u0636\u064A\u0629 +canvas.3D.system=\u0645\u0639\u064A\u0646 +canvas.3D.rightclic=\u0623\u0646\u0642\u0631 \u0627\u0644\u0632\u0631 \u0627\u0644\u0623\u064A\u0645\u0646 \u0648 \u062C\u0631 \u0644\u0644\u0642\u064A\u0627\u0645 \u0628\u0627\u0644\u062F\u0648\u0631\u0627\u0646 + +#v2.8.8 +palette.info.equationxy=f(x,y)=0 \u0645\u0646\u062D\u0646\u064A \u0645\u062D\u062F\u062F \u0628 +props.equationxy=:\u0645\u0639\u0627\u062F\u0644\u0629 +props.equationxychooser=:\u062F\u0642\u0629 +palette.function=\u062F\u0627\u0644\u0627\u062A \u0648 \u0645\u062D\u0644\u0627\u062A \u0647\u0646\u062F\u0633\u064A\u0629 + +#v2.8.9 +menu.edit.deletealltracks=\u0645\u0633\u062D \u0627\u0644\u0622\u062B\u0627\u0631 +menu.edit.deactivatealltracks=\u062A\u0639\u0637\u064A\u0644 \u0627\u0644\u0623\u062B\u0627\u0631 +props.tracks=\u0625\u0638\u0647\u0627\u0631 \u0627\u0644\u0623\u062B\u0627\u0631 +menu.edit.zoom=\u062A\u0643\u0628\u064A\u0631 \u0623\u0648 \u062A\u062D\u0631\u064A\u0643 + +#v2.9.0 +menu.windows=\u0646\u0627\u0641\u0630\u0629 + +#v2.9.1 +contexthelp.seealso=:\u0645\u0648\u0636\u0648\u0639\u0627\u062A \u0630\u0627\u062A \u0635\u0644\u0629 + +#v2.9.2 +menu.display.restrictmessage.dontdisplay=\u0644\u0627 \u062A\u0638\u0647\u0631 \u0647\u0630\u0647 \u0627\u0644\u0631\u0633\u0627\u0644\u0629 +props.thick=:\u0633\u0645\u064A\u0643 + +#v2.9.6 +props.magnetmessage=\u0623\u0646\u0642\u0631 \u0639\u0644\u0649 \u0627\u0644\u0639\u0646\u0627\u0635\u0631 \u0627\u0644\u062A\u064A \u062A\u0631\u064A\u062F \u0625\u0636\u0627\u0641\u062A\u0647\u0627 \u0623\u0648 \u0625\u062E\u0641\u0627\u0626\u0647\u0627 \u0645\u0646 \u0644\u0627\u0626\u062D\u0629 \u0627\u0644\u0639\u0646\u0627\u0635\u0631 \u0627\u0644\u0645\u063A\u0646\u0627\u0637\u0633\u064A\u0629 +props.magnetobj=\u0627\u0644\u0639\u0646\u0627\u0635\u0631 \u0627\u0644\u0645\u063A\u0646\u0627\u0637\u0633\u064A\u0629 +props.magnetpix=(20px) \u062C\u0627\u0630\u0628\u064A\u0629 + + +#v2.9.7 +palette.info.ctrl_txtfield=\u0625\u0636\u0627\u0641\u0629 \u0645\u0631\u0628\u0639 \u0645\u062F\u062E\u0644\u0627\u062A \u0631\u0642\u0645\u064A\u0629 +palette.info.ctrl_button=\u0625\u0636\u0627\u0641\u0629 \u0632\u0631 + +#v2.9.8.4 +JSerror.title=\u062E\u0637\u0623 \u062A\u0631\u0643\u064A\u0628\u064A +JSerror.line=\u062E\u0637 +JSerror.pointcoords=\u062E\u0637\u0623 \u062A\u0631\u0643\u064A\u0628\u064A \u0641\u064A \u0625\u062D\u062F\u0627\u062B\u064A\u0627\u062A \u0627\u0644\u0646\u0642\u0637\u0629 +JSerror.interactiveinput=\u062E\u0637\u0623 \u0641\u064A \u062A\u0633\u0645\u064A\u0629 \u0627\u0644\u0639\u0646\u0635\u0631 +JSerror.notfound=\u0639\u0646\u0635\u0631 \u063A\u064A\u0631 \u0645\u0648\u062C\u0648\u062F +JSerror.notgoodtype=\u0645\u0633\u062A\u062D\u064A\u0644 \u0627\u0644\u062A\u0637\u0628\u064A\u0642 \u0639\u0644\u0649 \u0647\u0630\u0627 \u0627\u0644\u0646\u0648\u0639 \u0645\u0646 \u0627\u0644\u0639\u0646\u0627\u0635\u0631 +JScmd.inputmessage=\u0645\u0627 \u0647\u0648 \u0633\u0624\u0627\u0644\u0643 \u061F +JScmd.promptmessage=...\u0631\u0633\u0627\u0644\u062A\u0643 +menu.js=\u062C\u0627\u0641\u0627 \u0633\u0643\u0631\u064A\u0628\u062A +menu.js.script=Javascript\u0625\u0641\u062A\u062D \u0645\u0644\u0641 +menu.js.command=script \u0625\u0641\u062A\u062D \u0645\u062D\u0631\u0631 +JSeditor.title=javascript \u0645\u062D\u0631\u0631 + diff --git a/eric/docs/JZirkelProperties_de.properties b/eric/docs/JZirkelProperties_de.properties new file mode 100644 index 0000000..73d5967 --- /dev/null +++ b/eric/docs/JZirkelProperties_de.properties @@ -0,0 +1,290 @@ +# Sample ResourceBundle properties file +menu.file=Datei +menu.file.new=Neu +menu.file.load=\u00D6ffnen ... +menu.file.save=Speichern +menu.file.saveas=Speichern unter ... +menu.file.exportpng=Exportieren nach PNG +menu.file.exporteps=Exportieren nach EPS +menu.file.quit=Schlie\u00DFen +menu.edit=Bearbeiten +menu.edit.copy=Kopieren +menu.edit.move=Verschieben +menu.edit.rename=Umbenennen +menu.edit.edit=\u00C4ndern +menu.edit.hide=Verbergen +menu.edit.delete=L\u00F6schen +menu.display=Ansicht +menu.display.hidden=Anzeigen/Verbergen von unsichtbaren Objekten +menu.display.grid=Anzeigen/Verbergen des Gitters +menu.display.finegrid=Nur die Achsen +menu.display.leftsnap=Magnetisches Gitter +menu.display.manage_macros=Makroliste +menu.display.history_panel=Historie und Haltepunkte +menu.display.help_panel=Hilfefenster +menu.display.properties_panel=Objektliste +menu.display.small=Kleine Symbole +menu.display.medium=Mittlere Symbole +menu.display.large=Gro\u00DFe Symbole +menu.display.restrictedpalette=Reduzierte Palette anzeigen +menu.display.restrictedpaletteedit=Reduzierte Palette \u00E4ndern +menu.display.restrictmessage=
Mit dieser Funktion k\u00F6nnen Sie die reduzierte Palette anzeigen.

Das betrifft nur die gerade ge\u00F6ffnete Datei.

Beim Speichern k\u00F6nnen Sie die Option «auch die reduzierte Figur speichern» w\u00E4hlen.
Es werden also zwei Dateien kreiert : Die erste (.zir) \u00F6ffnet sich im nomalen Modus, und
die zweite (.r.zir) im reduzierten Modus.
+menu.macros=Makros +menu.special=Spezielles +menu.special.newmacro=Neues Makro +menu.special.loadmacros=Makros laden ... +menu.special.definejob=Aufgabe definieren +menu.special.loadjob=Aufgabe \u00F6ffnen ... +menu.special.jobcomment=Aufgabentext bearbeiten +menu.special.testjob=Aufgabe testen +menu.special.savejob=Als Aufgabe speichern +menu.special.export=HTML-Datei erzeugen und ansehen +menu.special.exporttemplate=HTML-Export mit Vorlage +menu.help=Hilfe +menu.help.about=\u00DCber CaRMetal ... +menu.help.info=Kontexthilfe +menu.help.url0=Homepage von CaRMetal +menu.help.url1=Homepage von CARzine +menu.help.url2=Offizielle Homepage von C.a.R. + +filedialog.options=Speicherm\u00F6glichkeiten +filedialog.saveas=Figur speichern +filedialog.alsorestricted=Auch die reduzierte Figur speichern +filedialog.restrictedmessage=Sie arbeiten momentan in einer reduzierten Umgebung,
Ihre Figur wird also im reduzierten Modus gespeichert. +filedialog.filefilter=C.a.R.-Datei (.zir) +filedialog.compressedfilefilter=Komprimierte C.a.R.-Datei (.zirz) +filedialog.macrofilefilter=Makrodatei (.mcr) +filedialog.savemessage1=Die Datei :\n +filedialog.savemessage2=\nexistiert bereits. M\u00F6chten Sie sie wirklich ersetzen? + +palette.file=Datei +palette.edit=Bearbeiten +palette.construction=Konstruktion +palette.aspect=Einstellungen & Farben +palette.history=Historie +palette.sizes=Gr\u00F6\u00DFen +palette.sizes.point=Punkte +palette.sizes.line=Linien +palette.sizes.arrow=Pfeile +palette.sizes.font=Schriftgr\u00F6\u00DFe +palette.prec=Nachkommastellen +palette.prec.lengths=Im Eigenschaftendialog +palette.prec.edit=F\u00FCr die Anzeige +palette.prec.angles=F\u00FCr Winkel +palette.colors=Farbe & Bild +palette.colors.saturated1=Fes\u00E4ttigte Farben +palette.colors.desaturated1=Unges\u00E4ttigte Farben +palette.colors.saturated2=ges\u00E4ttigte Farben 2 +palette.colors.desaturated2=unges\u00E4ttigte Farben 2 +palette.colors.constants=Web-Farben +palette.image.fileerror=Speichern Sie die Figur ab, bevor Sie diese Funktion ausf\u00FChren.

Anschlie\u00DFend muss Ihr ausgew\u00E4hltes Bild sich
im selben Verzeichnis wie diese Figur befinden. + +palette.info.vector=Vektor +palette.info.image3=Bild einf\u00FCgen+orientiert an 2 oder 3 Punkten +palette.info.background=Auswahl/L\u00F6schen eines Hintergrundbildes +palette.info.imcenter=Hintergrundbild zentrieren +palette.info.imstretch=Hintergrundbild vergr\u00F6\u00DFern,+so dass es das Fenster+der Konstruktion ausf\u00FCllt +palette.info.imtile=Hintergrundbild wiederholen +palette.info.copy=Das Konstruktionsfenster kopieren+in der Papierpresse +palette.info.exportpng=Exportieren der Konstruktion+aus dem aktuellen Fenster in das Format PNG +palette.info.exporteps=Exportieren der Konstruktion+aus dem aktuellen Fenster in das Format EPS +palette.info.newmacro=Neues Makro erzeugen +palette.info.loadmacros=Makro \u00F6ffnen +palette.info.manage_macros=Anzeigen/Verbergen des+Makro-Bearbeitungsfensters +palette.info.properties_panel=Anzeigen/Verbergen der+Objekteigenschaften +palette.info.history_panel=Anzeigen/Verbergen des Fensters+der Konstruktionshistorie +palette.info.help_panel=Anzeigen/Verbergen des Fensters+zur Kontexthilfe + + +macros.untitledmacro=Makro ohne Titel +macros.untitledfolder=Ordner ohne Titel +macros.emptynode=-- leer -- +macros.addfolder=Neuen Ordner hinzuf\u00FCgen +macros.deleteselected=Ausgew\u00E4hlte Makros l\u00F6schen +macros.renamemacro=Ausgew\u00E4hlte Makros umbenennen +macros.recordmacro=Makro speichern +macros.initials=Ausgangsobjekte? +macros.pleaseselect=Bitte ausw\u00E4hlen! +macros.finals=Zielobjekte? +macros.cancel=Abbrechen? +macros.popup.run=Makro starten +macros.popup.rename=Umbenennen +macros.popup.delete=L\u00F6schen ... +macros.popup.addtolibrary=Zur Bibliothek hinzuf\u00FCgen +macros.popup.removefromlibrary=Aus der Bibliothek l\u00F6schen +macros.popup.publish=In die Figur einf\u00FCgen +macros.popup.notpublish=Nicht in die Ausgabe einf\u00FCgen +macros.popup.saveas=Speichern unter ... +macros.popup.properties=Eigenschaften anzeigen +macros.popup.duplicate=Duplizieren +macros.savedlog.buttonok=Makro(s) speichern +macros.question.delete=Sollen die Makros wirklich gel\u00F6scht werden? + +rene.zirkel.objects.PointObject=Pkt +rene.zirkel.objects.PrimitiveCircleObject=Kr +rene.zirkel.objects.PrimitiveLineObject=Ger +rene.zirkel.objects.ExpressionObject=Ausdr +rene.zirkel.objects.FixedAngleObject=fWink. +rene.zirkel.objects.SegmentObject=Str +rene.zirkel.objects.RayObject=HGer +rene.zirkel.objects.TwoPointLineObject=2PGer +rene.zirkel.objects.FunctionObject=Fkt +rene.zirkel.objects.AreaObject=A + +mi.pal.name=Makroliste +mi.name=Name : +mi.comment=Kommentar : +mi.properties=Eigenschaften der Objekte zu Beginn : +mi.hideproperties=Eigenschaften der Objekte am Ende : +mi.hideduplicates=Dopplungen verbergen +mi.apply=Anwenden +mi.tab.type=Typ +mi.tab.name=Name +mi.tab.prompt=Prompt +mi.tab.fix=Fixiert? +mi.tab.ask=Gr\u00F6\u00DFe abfragen? +mi.error.initial=Fehler : wenigstens ein Objekt \nmuss frei sein\n\Der Makro wird nicht ver\u00E4ndert. + +props.help=Mit der rechten Maustaste auf das Objekt klicken, um seine Eigenschaften anzuzeigen.

Wenn Sie ein neues Objekt, das Punkte beinhaltet, erzeugen, k\u00F6nnen Sie die Eigenschaften dieser Punkte sehen und ver\u00E4ndern. +props.name=Name : +props.alias=Alias : +props.unit=Einheit : +props.fix=Gr\u00F6\u00DFe : +props.expl=Erkl\u00E4rung : + +props.conditional=Bedingungen: +props.solid=Nicht transparent: +props.hidden=Verborgen: +props.normal=Normal: +props.bold=Fett: +props.thin=Gepunktet: +props.black=Schwarz: +props.green=Gr\u00FCn: +props.blue=Blau: +props.brown=Braun: +props.cyan=T\u00FCrkis: +props.red=Rot: +props.showasslider=Schieber +props.error=In dem Ausdruck ist ein Syntaxerror.
Er wird reinitialisiert. +props.cartesian=Parametrisierte Kurve +props.parametric=Funktionenschar +props.functiontype=Typ : +props.killarc=Als Vollkreis +props.arc=Bogen +props.release=L\u00F6sen +props.bind=Verbinden +props.setaway=Weg von +props.setclose=Hin zu + +# v1.3 : +props.grid=Gitter : +props.inside=Innerhalb : +props.pointsonly=Nur bei Punkten : +props.step=Schritt : +palette.grid=Gittereinstellungen +leftpanel.macros=Makros +leftpanel.properties=Objekteigenschaften +leftpanel.history=Objektliste +leftpanel.help=Hilfe +selectpopup.whatobject=Welches Objekt? +selectpopup.RightClick=Bearbeiten +selectpopup.MoverTool=Bewegen +selectpopup.HiderTool=Verbergen/Anzeigen +selectpopup.DeleteTool=L\u00F6schen +selectpopup.RenamerTool=Umbenennen +selectpopup.EditTool=Bearbeiten +selectpopup.SetParameterTool=Makroparameter : +selectpopup.SetTargetsTool=Makroziele : +palette.info.locus=Ortslinie+Einh\u00FCllende + +# v1.4 : +menu.special.savezirset=Konstruktionssammlung erzeugen +filedialog.openfolder.title=Ordner f\u00FCr die Konstruktionssammlung +filedialog.openfolder.approve=Ordner \u00F6ffnen +filedialog.openfolder.saveicons=Icons verwenden +slideshow.next=Weiter +slideshow.previous=Zur\u00FCck +slideshow.download=Download +slideshow.signature=Konstruktionssammlung erzeugt mit + + +# v1.5 : +menu.language=Sprachen +menu.language.de=Deutsch +menu.language.en=Englisch +menu.language.fr=Franz\u00F6sisch +menu.language.es=Spanisch +menu.language.gl=Galicisch +menu.language.zh_TW=Chinesisch (traditionell) +menu.help.url3=\u00DCbersetzen CaRMetal +menu.display.smartboard=Smartboard Modus + + + +# v3.6 : +menu.edit.copyURL=Kopiere workbook als URL +canvas.copy.message=Maus loslassen um die Auswahl zu kopieren. ESC: Abbruch | MAJ : Quadratisch | ALT : 10 x 10 Inkrement. +menu.file.newDP=Neue Figur in hyperbolischer Geometrie +palette.info.DP_line=Hyperbolische Linie +palette.info.DP_midpoint=Hyperbolischer Mittelpunkt +palette.info.DP_bi_syma=Hyperbolische Spiegelung +palette.info.DP_bi_symc=Hyperbolische Symmetrie +palette.info.DP_plumb=Hyperbolische Senkrechte +palette.info.DP_bi_med=Hyperbolische Mittelsenkrechte +palette.info.DP_bi_biss=Hyperbolische Winkelhalbierende +palette.info.DP_segment=Hyperbolisches Segment + +palette.info.DP_angle=Hyperbolischer Winkel +palette.info.DP_circle=Hyperbolischer Kreis +palette.info.DP_bi_distance=Hyperbolische Distanz +palette.info.DP_bi_perp_common=Hyperbolische gemeinsame Senkrechte +palette.info.DP_bi_lineIP=Hyperbolische Linie mit Punkten im Unendlichen +palette.info.DP_bi_horocycle=Horokreis durch zwei Punkte +palette.info.DP_bi_equidistante=Equidistant zu einer Linie und durch einen Punkt + + +macro.DP_line.1=Erster Punkt der hyperbolischen Linie +macro.DP_line.2=Zweiter Punkt der hyperbolischen Linie +macro.DP_midpoint.1=Erster Punkt +macro.DP_midpoint.2=Zweiter Punkt +macro.DP_bi_syma.1=Hyperbolische Linie +macro.DP_bi_syma.2=Punkt +macro.DP_bi_symc.1=Zentrum +macro.DP_bi_symc.2=Punkt +macro.DP_plumb.1=Hyperbolische Linie +macro.DP_plumb.2=Punkt +macro.DP_bi_med.1=Erster Punkt +macro.DP_bi_med.2=Zweiter Punkt +macro.DP_bi_biss.1=Erster Punkt +macro.DP_bi_biss.2=Scheitelpunkt des Winkels +macro.DP_bi_biss.3=Dritter Punkt +macro.DP_segment.1=Erster Punkt +macro.DP_segment.2=Zweiter Punkt +macro.DP_ray.1=Erster Punkt +macro.DP_ray.2=Zweiter Punkt +macro.DP_angle.1=Erster Punkt +macro.DP_angle.2=Scheitelpunkt des Winkels +macro.DP_angle.3=Dritter Punkt +macro.DP_circle.1=Zentrum +macro.DP_circle.2=Zweiter Punkt +macro.DP.distance.1=Erster Punkt +macro.DP_bi_distance.2=Zweiter Punkt +macro.DP_bi_distance.3=Ankerpunkt um die Distanz anzuzeigen +macro.DP_bi_perp_common.1=Erste hyperbolische Linie +macro.DP_bi_perp_common.2=Zweite hyperbolische Linie +macro.DP_bi_lineIP.1=Erster Punkt +macro.DP_bi_lineIP.2=Zweiter Punkt +macro.DP_bi_horocycle.1=Erster Punkt +macro.DP_bi_horocycle.2=Zweiter Punkt +macro.DP_bi_equidistante.1=hyperbolische Linie +macro.DP_bi_equidistante.2=Punkt \u00FCber die equidistant +macro.DP_fixedangle.1=Erster Punkt +macro.DP_fixedangle.2=Scheitelpunkt des Winkels + +macro.DP_bi_circ.1=Erster Punkt +macro.DP_bi_circ.2=Zweiter Punkt +macro.DP_bi_circ.3=Dritter Punkt +canvas.DP.message1=Dieser Kreis ist der Horizont der Poincar\u00E9 Scheibe. +canvas.DP.message2=Benutzen Sie die "Konstruktionen" Palette um Objekte zu dieser hyperbolischen Ebene hinzuzuf\u00FCgen. + +JSmenu.changescriptsorder=\u00C4ndere die Reihenfolge der Skripte diff --git a/eric/docs/JZirkelProperties_en.properties b/eric/docs/JZirkelProperties_en.properties new file mode 100644 index 0000000..e69de29 diff --git a/eric/docs/JZirkelProperties_es.properties b/eric/docs/JZirkelProperties_es.properties new file mode 100644 index 0000000..87277d9 --- /dev/null +++ b/eric/docs/JZirkelProperties_es.properties @@ -0,0 +1,762 @@ +# Sample ResourceBundle properties file +menu.file=Archivo +menu.file.new=Nuevo +menu.file.load=Abrir... +menu.file.save=Guardar +menu.file.saveas=Guardar como... +menu.file.exportpng=Exportar como PNG +menu.file.exporteps=Exportar como EPS +menu.file.quit=Salir +menu.edit=Edici\u00f3n +menu.edit.copy=Copiar +menu.edit.move=Mover +menu.edit.rename=Cambiar nombre +menu.edit.edit=Modificar +menu.edit.hide=Ocultar +menu.edit.delete=Suprimir +menu.display=Mostrar +menu.display.hidden=Mostrar/Ocultar los objetos invisibles +menu.display.grid=Mostrar/Ocultar la rejilla +menu.display.finegrid=Ejes solamente +menu.display.leftsnap=Rejilla magn\u00e9tica +menu.display.manage_macros=Inspector de macros +menu.display.history_panel=Hist\u00f3rico +menu.display.help_panel=Panel de ayuda +menu.display.properties_panel=Inspector de objetos +menu.display.small= Iconos peque\u00f1os +menu.display.medium= Iconos medianos +menu.display.large=Iconos grandes +menu.display.restrictedpalette=Fijar la paleta restringida +menu.display.restrictedpaletteedit=Modificar la paleta restringida +menu.display.restrictmessage=
Esta funci\u00f3n permite visualizar la paleta restringida.

Esto solo afecta al archivo en uso.

Al guardar, usted podr\u00e1 elegir la opci\u00f3n de guardar tambi\u00e9n la figura restringida;.
Se crean entonces dos archivos: El primero (.zir) se abrir\u00e1 en modo normal, y
el segundo (.r.zir) en modo restringido.
+menu.macros=Macros +menu.special=Especial +menu.special.newmacro=Crear macro +menu.special.loadmacros=Abrir un archivo de macros... +menu.special.definejob=Definir un ejercicio +menu.special.loadjob=Abrir un ejercicio... +menu.special.jobcomment=Redactar el texto del ejercicio +menu.special.testjob=Revisar este ejercicio +menu.special.savejob=Guardar el ejercicio +menu.special.export=Crear un archivo HTML y verlo con el navegador +menu.special.exporttemplate=Exportar a HTML con las plantillas +menu.help=Ayuda +menu.help.about=Acerca de CaRMetal... +menu.help.info=Ayuda contextual +menu.help.url0=P\u00e1gina de CaRMetal +menu.help.url1=P\u00e1gina de CARzine +menu.help.url2=P\u00e1gina oficial de C.a.R. + +filedialog.options=Opciones de guardado +filedialog.saveas=Guardar construcci\u00f3n +filedialog.alsorestricted=Guardar tambi\u00e9n las restricciones de la construcci\u00f3n +filedialog.restrictedmessage=Est\u00e1 trabajando ahora en una sesi\u00f3n restringida,
la construcci\u00f3n se guardar\u00e1 en modo restringido. +filedialog.filefilter=Archivo CaR (.zir) +filedialog.compressedfilefilter=Archivo CaR comprimido (.zirz) +filedialog.macrofilefilter=Archivo de macros (.mcr) +filedialog.savemessage1=El archivo:\n +filedialog.savemessage2=\ya existe, \u00bfest\u00e1 desea reemplazarlo ? + +palette.file=Archivo +palette.edit=Edici\u00f3n +palette.construction=Construcci\u00f3n +palette.aspect=Aspecto y color +palette.history=Hist\u00f3rico +palette.sizes=Tama\u00f1o +palette.sizes.Point=Puntos +palette.sizes.line=L\u00edneas +palette.sizes.arrow=Flechas +palette.sizes.font=Fuentes +palette.prec=Precisi\u00f3n num\u00e9rica +palette.prec.lengths=Longitud +palette.prec.edit=F\u00f3rmulas +palette.prec.angles=\u00c1ngulos +palette.colors=Fondo: color e imagen +palette.colors.saturated1=Colores saturados +palette.colors.desaturated1=Colores desaturados +palette.colors.saturated2=Colores saturados 2 +palette.colors.desaturated2=Colores desaturados 2 +palette.colors.constants=Colores Web +palette.image.fileerror=Debe guardar la construcci\u00f3n antes de utilizar esta herramienta.

Despu\u00e9s, la imagen que elija debe figurar
en la misma ubicaci\u00f3n que esta figura. + +palette.info.vector=Vector +palette.info.image3=Insertar una imagen utilizando 2 o 3 puntos +palette.info.background=Elegir/borrar una imagen de fondo +palette.info.imcenter=Centrar la imagen de fondo +palette.info.imstretch=Adecuar el tama\u00f1o de la imagen a la ventana de la construcci\u00f3n +palette.info.imtile=Fondo con mosaico de imagen +palette.info.copy=Copiar la ventana de construcci\u00f3n en el portapapeles +palette.info.exportpng=Exportar la construcci\u00f3n de la ventana actual al formato PNG +palette.info.exportpng= Exportar la construcci\u00f3n de la ventana actual al formato PNG +palette.info.exporteps= Exportar la construcci\u00f3n de la ventana actual al formato EPS +palette.info.newmacro=Crear una nueva macro +palette.info.loadmacros=Abrir un archivo de macros +palette.info.manage_macros=Mostrar/Ocultar el panel de gestion de macros +palette.info.properties_panel=Mostrar/Ocultar el panel de propiedades de los objetos +palette.info.history_panel=Mostrar/ Ocultar el panel de hist\u00f3rico de la construcci\u00f3n +palette.info.help_panel=Mostrar/ Ocultar el panel de ayuda contextual + + +macros.untitledmacro=Macro sin nombre +macros.untitledfolder=Carpeta sin nombre +macros.emptynode=-- Vac\u00edo -- +macros.addfolder=A\u00f1adir una nueva carpeta +macros.deleteselected=Suprimir las macros seleccionadas +macros.renamemacro=Cambiar el nombre de la macro seleccionada +macros.recordmacro=Guardar una macro +macros.initials=\u00bfCuáles son los Objetos iniciales? +macros.pleaseselect=!Seleccione, por favor! +macros.finals=\u00bfCuáles son los Objetos finales? +macros.cancel=\u00bfCancelar? +macros.popup.run=Iniciar la macro +macros.popup.rename= Cambiar nombre +macros.popup.delete=Borrar +macros.popup.addtolibrary=A\u00f1adir a la biblioteca +macros.popup.removefromlibrary=Quitar de la biblioteca +macros.popup.publish=Incluir en la figura +macros.popup.notpublish=No incluir en la figura +macros.popup.saveas=Guardar como... +macros.popup.properties=Mostrar las propiedades +macros.popup.duplicate=Duplicar +macros.savedlog.buttonok=Guardar el archivo de macro(s) +macros.question.delete=\u00bfSeguro desea borrar estas macros ? + +rene.zirkel.objects.PointObject=Pto. +rene.zirkel.objects.PrimitiveCircleObject=Cir. +rene.zirkel.objects.PrimitiveLineObject=Lin. +rene.zirkel.objects.ExpressionObject=Exp. +rene.zirkel.objects.FixedAngleObject=AngF. +rene.zirkel.objects.SegmentObject=Seg. +rene.zirkel.objects.RayObject=Ray +rene.zirkel.objects.TwoPointLineObject=Rec. +rene.zirkel.objects.FunctionObject=Func. +rene.zirkel.objects.AreaObject=\u00c1rea + +mi.pal.name=Revisar macros +mi.name=Nombre: +mi.comment=Comentario: +mi.properties=Propiedades de los objetos iniciales: +mi.hideproperties=Propiedades de los objetos finales: +mi.hideduplicates=Buscar duplicados +mi.apply=Aplicar +mi.tab.type=Tipo +mi.tab.name=Nombre +mi.tab.prompt=invitaci\u00f3n +mi.tab.fix=\u00bfFijar ? +mi.tab.ask=\u00bfasociar? +mi.error.initial=Error: al menos un objeto inicial\ndebe estar libre (ni fijo, ni dependiente)\n\nNinguna modificaci\u00f3n\nser\u00e1 guardada en esta macro. + +props.help=Para poder visualizar las propiedades de un objeto hacer clic aqu\u00ed con el bot\u00f3n derecho.

Si se crea un nuevo objeto conteniendo estos puntos, podr\u00e1 editar sus propiedades durante el proceso. +props.name=Nombre: +props.alias=Alias: +props.unit=Unidades: +props.fix=Fijar: +props.expl=Explicaci\u00f3n: +props.belongto=Capa: +props.conditional=Apariencia: +props.solid=Opaco: +props.hidden=Oculto: +props.normal=Normal: +props.bold=s\u00f3lido: +props.thin=Punteado: +props.black=Negro: +props.green=Verde: +props.blue=Azul: +props.brown=Marr\u00f3n: +props.cyan=Cyan: +props.red=Rojo: +props.showasslider=cursor +props.error=Error de sintaxis en esta expresi\u00f3n.
Se va a reiniciar. +props.cartesian=Funci\u00f3n cartesiana +props.parametric= Funci\u00f3n param\u00e9trica +props.functiontype=Tipo: +props.killarc=Quitar arco +props.arc=Arco +props.release=liberar +props.bind=asociar +props.setaway=Lejos de +props.setclose=Cerca de + +# v1.3: +props.grid=Incremento de la rejilla (0=libre): +props.inside=Sobre el objeto: +props.Pointsonly=Solamente con dos puntos: +props.step=Paso: +palette.grid=Aspecto de la rejilla +leftpanel.macros=Panel de gesti\u00f3n de macros +leftpanel.properties=Panel de propiedades de los objetos +leftpanel.history=Panel de historico +leftpanel.help=Panel de ayuda +selectpopup.whatobject=\u00bfQu\u00e9 objeto ? +selectpopup.RightClick=Editar +selectpopup.MoverTool=Desplazar +selectpopup.HiderTool=Mostrar/Ocultar +selectpopup.DeleteTool=Suprimir +selectpopup.RenamerTool=Cambiar nombre +selectpopup.EditTool=Editar +selectpopup.SetParameterTool=Macro inciales: +selectpopup.SetTargetsTool=Macro finales: +palette.info.locus=Lugar del punto+ envolvente de recta + + +# v1.4: +menu.special.savezirset=Crear un diaporama +filedialog.openfolder.title=Di\u00e1logo de selecci\u00f3n de la carpeta del diaporama +filedialog.openfolder.approve=Seleccionar la carpeta del diaporama +filedialog.openfolder.saveicons=Guardar tambi\u00e9n las restricciones de iconos +slideshow.next=siguiente +slideshow.previous=anterior +slideshow.download=Cargar el archivo +slideshow.signature=Diaporama realizado con + +# v1.5: +menu.language=Idiomas +menu.help.url3=Traducir CaRMetal + +# v1.6: +palette.info.bi_syma=Simetría Axial +palette.info.bi_symc=Simetría Central +palette.info.bi_trans=Traslación +palette.info.bi_med=Mediatriz +palette.info.bi_biss=Bisectriz +palette.info.bi_circ=Círculo por 3 puntos +palette.info.bi_arc=Arco por 3 puntos +palette.info.bi_t_align=Puntos alineados ? +palette.info.bi_t_para=Rectas paralelas ? +palette.info.bi_t_perp=Rectas perpendiculares ? +palette.info.bi_t_equi=Punto equidista de otros dos ? +palette.info.bi_t_app=Punto pertenece a una recta ? +palette.info.bi_t_conf=Puntos coinciden ? +macro.bi_syma.0=\u00bfCuál es el Eje de simetr\u00eda? +macro.bi_syma.1=\u00bfde qu\u00e9 punto quiere construir el Sim\u00e9trico? +macro.bi_symc.0=\u00bfCuál es el Centro de simetr\u00eda? +macro.bi_symc.1=\u00bfde qu\u00e9 punto quiere construir el Sim\u00e9trico? +macro.bi_trans.0=\u00bfCual es el Origen del vector que define la traslación? +macro.bi_trans.1=\u00bfCual es el Extremo del vector que define la traslación? +macro.bi_trans.2=\u00bfqu\u00e9 punto desea trasladar? +macro.bi_med.0=\u00bfCual es el Primer extremo del segmento del que quiere la mediatriz? +macro.bi_med.1=\u00bfCual es el Segundo extremo del segmento del que quiere la mediatriz? +macro.bi_biss.0=\u00bfCual es el Primer punto del ángulo que quiere bisecar? +macro.bi_biss.1=\u00bfCual es el v\u00e9rtice del \u00e1ngulo que quiere bisecar? +macro.bi_biss.2=\u00bfCual es el tercer punto del \u00e1ngulo que quiere bisecar? +macro.bi_circ.0=\u00bfCual es el Primer punto? +macro.bi_circ.1=\u00bfCual es el Segundo punto? +macro.bi_circ.2=\u00bfCual es el Tercer punto? +macro.bi_t_para.0=\u00bfPrimera recta (o segmento)? +macro.bi_t_para.1=\u00bfsegunda recta (o segemento)? +macro.bi_t_equi.0=\u00bfEste punto es equidistante... +macro.bi_t_equi.1=De este punto... +macro.bi_t_equi.2=\u00bfy de este punto? +macro.bi_t_app.0=\u00bfQu\u00e9 punto? +macro.bi_t_app.1=\u00bfPertenece a cu\u00e1l recta (segmento)? +macro.bi_t_conf.0=\u00bfQu\u00e9 punto? +macro.bi_t_conf.1=\u00bfcoincide con cu\u00e1l punto? +macro.bi_t_align.text0=Los puntos est\u00e1n alineados +macro.bi_t_align.text1=Los puntos no est\u00e1n alineados +macro.bi_t_para.text0=Los objetos son paralelos +macro.bi_t_para.text1=Los objetos no son paralelos +macro.bi_t_perp.text0=Los objetos son perpendiculares +macro.bi_t_perp.text1=Los objetos no son perpendiculares +macro.bi_t_equi.text0=Los puntos son equidistantes +macro.bi_t_equi.text1=Los puntos no son equidistantes +macro.bi_t_app.text0=El punto est\u00e1 sobre el objeto +macro.bi_t_app.text1=El punto no est\u00e1 sobre el objeto +macro.bi_t_conf.text0=Los dos puntos coinciden +macro.bi_t_conf.text1=Los dos puntos no coinciden +# v1.7: +filedialog.openfolder.appletsize=Tama\u00f1o del applet: +filedialog.openfolder.actualsize=Tama\u00f1o actual +filedialog.openfolder.other=Otro... +filedialog.openfolder.selected=Carpeta seleccionada: +filedialog.openfolder.cancel=Cancelar +menu.file.exportsvg=Exportar como SVG +menu.objects.Point=Puntos +menu.objects.lines=Rectas +menu.objects.segments=Segmentos +menu.objects.circles=C\u00edrculos y c\u00f3nicas +menu.objects.angles=Angulos +menu.objects.tracks=Trazas y lugares +menu.objects.functions=Funciones y f\u00f3rmulas +palette.info.function_u=Funci\u00f3n definida por el usuario +palette.info.function=Trazar una funci\u00f3n o una curva param\u00e9trica +props.superhidden=Super-Ocultar: +props.showvalue=Mostrar valor: +props.showname=Mostrar nombre: +props.background=Fondo: +macro.bi_expression.0=\u00bfPunto de anclaje? + +# v1.9a: +licence.txt=

Este programa es gratuito bajo licencia GNU-GPL, lo que significa que usted puede redistribuirlo y/o modificarlo seg\u00fan los t\u00e9rminos +de la licencia publicada por la "Free Software Foundation"
Voir:

+ + +# v2.0: +menu.special.theme=Temas +menu.special.theme.gray=Metal pulido +menu.special.theme.brushed=Metal cepillado +menu.special.options=Preferencias... +menu.special.options.sizes=Tama\u00f1os +menu.special.options.sizes.minPointsize=Tama\u00f1o de puntos +menu.special.options.sizes.minlinesize=Grosor de l\u00edneas +menu.special.options.sizes.arrowsize=Tama\u00f1o de flechas +menu.special.options.sizes.minfontsize=Tama\u00f1o de caracteres +menu.special.options.sizes.digits.lengths=Precisi\u00f3n de longitudes +menu.special.options.sizes.digits.edit=Precisi\u00f3n de f\u00f3rmulas +menu.special.options.sizes.digits.angles=Precisi\u00f3n de \u00e1ngulos +menu.special.options.colors=Colores +menu.special.options.others=Otros +menu.special.options.others.undock=Posibilidad de separar las paletas + + +# v2.1: +menu.file.close=Cerrar ventana + +# v2.3: +alert.toomuchwins=Hay demadiadas ventanas abiertas:
cierre algunas
para poder abrir otras... + +# v2.4: +menu.file.new3D=Nueva figura 3D +palette.info.bi_3Dcoords= punto 3D +macro.bi_3Dcoords.0=Usted quiere construir un punto 3D: Haga clic cualquier parte +palette.info.bi_3Dcube=Cubo +macro.bi_3Dcube.0=Usted quiere construir un Cubo: \u00bfCuál es el Centro del cubo? +palette.info.bi_3Darete=Arista 3D (gesti\u00f3n de punteado) +macro.bi_3Darete.0=Usted quiere construir una Arista 3D: \u00bfcuál es el Primer punto? +macro.bi_3Darete.1=Usted quiere construir una Arista 3D: \u00bfCuál es el Segundo punto? +macro.bi_3Darete.2=Usted quiere construir una Arista 3D: \u00bfCuále es el Tercer punto? +macro.bi_3Darete.3=Usted quiere construir una Arista 3D: \u00bfCuále es el cuarto punto? +palette.info.bi_3Dtetra=Tetraedro regular +macro.bi_3Dtetra.0=Usted quiere construir un Tetraedro regular:\u00bfCuál es el Centro del tetraedro? +menu.newdoc=Nuevo + +# v2.5.5: +palette.aspect.label.text_title=Aspecto de +palette.aspect.label.Point=puntos +palette.aspect.label.line=rectas +palette.aspect.label.segment=segmentos +palette.aspect.label.circle=c\u00edrculos +palette.aspect.label.angle=\u00e1ngulos +palette.aspect.label.area=pol\u00edgonos +palette.aspect.label.text=textos +palette.info.bi_3Ddode=Dodecaedro regular +macro.bi_3Ddode.0=Usted quiere construir un Dodecaedro regular:\u00bfCuál es el Centro del dodecaedro? + + +# v2.7: +palette.aspect.label.Pointshape=Forma & nombre de los puntos: +palette.aspect.label.locus=lugares +menu.edit.deleteall=Borrar todo + + +# v2.7.1: +java.old.message=No puede lanzar CaRMetal porque su versi\u00f3n de Java es muy vieja... +java.old.quit=Salir +java.old.go=Descargar una nueva versi\u00f3n de java +palette.info.boundedpoint=punto sobre plano o sobre cara de un poliedro + +#v2.7.2: +user.foldername=Perfil de usuario CaRMetal + +#v2.8 +props.fixedray=Radio: +props.fixedsegment=Longitud: +props.fixedangle=Angulo: +props.expl=Comentario: +props.aspecttab=Aspecto +props.numerictab=Num\u00e9rico +props.conditionaltab=Condicional +props.popup.special=Caracteres especiales +props.popup.functions=Funciones predefinidas +props.popup.latex=Comandos LaTeX + +#v2.8.1 +props.fixedinwindow=Atado a la ventana + +#v2.8.5 +palette.controls=Controles +props.ctrlshowvalue=Mostrar el valor del control +props.ctrlsnap=Atado a las graduaciones +props.ctrlshowticks=Mostrar las graduaciones +props.ctrltickspacing=Incremento: +palette.info.ctrl_edit=Editar, desplazar o redimensionar el control +palette.info.ctrl_chkbox=Agregar una casilla de selecci\u00f3n +palette.info.ctrl_popup=Agregar un men\u00fa desplegable +palette.info.ctrl_slider=Agregar un cursor + +#v2.8.6 +props.trackdmin=N\u00famero de etapas: +opendialog.preview=Vista previa: +pngdialog.options=Opciones de exportaci\u00f3n: +pngdialog.scale=Escala: +pngdialog.originsize=Tama\u00f1o original: +pngdialog.scaledsize=Tama\u00f1o a escala: + +#v2.8.7 +canvas.3D.floor=Piso +canvas.3D.system=sistema de coordenadas +canvas.3D.rightclic=Utilizar el clic derecho para hacer girar + +#v2.8.8 +palette.info.equationxy=Curva definida por f(x,y)=0 +props.equationxy=Ecuaci\u00f3n: +props.equationxychooser=Precisi\u00f3n: +palette.function=Funciones y lugares + +#v2.8.9 +menu.edit.deletealltracks=Borrar las trazas +menu.edit.deactivatealltracks=Desactivar las trazas +props.tracks=Activar la traza +menu.edit.zoom=Agrandar o desplazar + +#v2.9.0 +menu.windows=Ventana + +#v2.9.1 +contexthelp.seealso=Temas relacionados: + +#v2.9.2 +menu.help.licence=Licencia... +#v2.9.2 +menu.display.restrictmessage.dontdisplay=No mostrar m\u00e1s este mensaje +props.thick=Grueso: + +#v2.9.6 +props.magnetmessage=Haga clic sobre los objetos que quiere a\u00f1adir a (o eliminar de) la lista de objetos magn\u00e9ticos +props.magnetobj=Objetos magn\u00e9ticos +props.magnetpix=Atracci\u00f3n (20 px): + +#v2.9.7 +palette.info.ctrl_txtfield=A\u00f1adir una zona de entrada num\u00e9rica +palette.info.ctrl_button=A\u00f1adir un bot\u00f3n + +#v2.9.8.4 +JSerror.title=Error de sintaxis +JSerror.line=l\u00ednea +JSerror.Pointcoords=Error de sintaxis en las coordenadas del punto +JSerror.interactiveinput=Error en la designaci\u00f3n del objeto +JSerror.notfound=Objeto no encontrado +JSerror.notgoodtype=Imposibla aplicar a este tipo de objeto +JScmd.inputmessage=\u00bfPregunta? +JScmd.promptmessage=Mensaje... +menu.js=Javascript +menu.js.script=Abrir un archivo javascript... +menu.js.command=Abrir el editor de script +JSeditor.title=Editor javascript + + +#v3.0 +JSeditor.save=Guardar el script +JSeditor.open=Abrir un script +JSeditor.opendlogmsg=Abrir el script +JSeditor.savedlogmsg=Guardar el script +JSeditor.format=Formatear el script +JSeditor.restore=Anular los efectos del \u00faltimo script +JSeditor.run=Lanzar el script +JSeditor.help=Obtener ayuda de sintaxis +JSEditor.comment=Comentar la selecci\u00f3n +JSEditor.savequestion=Este script cambi\u00f3: \u00bfquiere guardarlo? + +# v3.1.1 +menu.js.define=Definir la carpeta de scripts... +menu.js.dumb=Ejecutar los scripts sin editor +JSeditor.opendfavfolder=Seleccionar como carpeta de scripts +JSeditor.saveas=Guardar el script como... + +# v3.5 +tab.popup.newfigure=Figura Nueva +tab.popup.rename=Cambiar Nombre +tab.popup.duplicate=Duplicar figura +tab.popup.openworkbook=Abrir una carpeta... +tab.popup.saveworkbookas=Guardar la carpteta como... +tab.popup.saveworkbook=Guardar la carpeta +tab.newfigurebasename=Figura +workbook.workbookmode=Modo carpeta +workbook.savequestion=Esta carpeta ha sido modificada. \u00bfQuiere guardarla? +progressbar.loadmessage=Abriendo la figura... paciencia... +progressbar.workbookloadmessage=Abriendo la carpeta... paciencia... +progressbar.workbooksavemessage=Guardando la carpeta... paciencia... +macro.creationdlog.title=Crear una macro +macros.name=Nombre de la macro? +JSmenu.cancel=Cancelar +JSmenu.add=A\u00f1adir un script nuevo +JSmenu.modify=Modificar el script +JSmenu.delete=Suprimir el script +JSeditor.saveinfig.question=Escribir el nombre del script: +JSeditor.saveinfig.title=Guardar el script en la figura +JSeditor.saveinfig=Guardar el script en la figura actual +JSeditor.infig=Script incluido en la figura: +menu.js.newscriptinconstruction=Nuevo script en la construcci\u00f3n... +menu.workbook.saveas=Guardar la carpeta como... +media.saveas=Hay imagenes en la construcci\u00f3n,
los archivos se guardar\u00e1n en una misma carpeta. +menu.display.comment=Mostrat/Ocultar comentarios +menu.display.palette=Mostrar/Ocultar la paleta +menu.display.leftpanel=Mostrar/Ocultar el marco izquierdo +comment.emptycomment= +menu.export.workbook=Exportar la carpeta en una pagina HTML +menu.assigment=Ejercicio +JSerror.condition=Error en la expresi\u00f3n de condici\u00f3n +filedialog.workbook=Carpeta CaRMetal (.zirs) +filedialog.job=Ejercicio CaRMetal (.job) +filedialog.js=Scripts CaRMetal (.js) +filedialog.allfiles=Archivos CaRMetal (.zirs,.zir,.zirz,.mcr,.job,.js) +tab.popup.savefileonly=Guardar la figura como... +animation.run=Iniciar las animaciones +animation.stop=Detener las animaciones +animation.speed=Rapidez de las animaciones +animation.removeall=Suprimir todas las animaciones +animation.reverse=Invertir el sentido de las animaciones +restrict.title=Restricci\u00f3n de herramientas +menu.display.restrictedenvironment=Restricci\u00f3n de herramientas +restrict.ok=Ok +restrict.cancel=Anular +restrict.activate=Activar restricci\u00f3n de herramientas +restrict.factory=Par\u00e1metros originales +restrict.comment=Para seleccionar o desseleccionar f\u00e1cilmente varias herramientas, haga clic derecho y arrastre sobre los iconos. +restrict.menubar=Mostrar la barra de men\u00fas +restrict.librarymacros=Permitir las macros de biblioteca +menu.help.opendefaultfolder=Abrir la carpeta de configuraci\u00f3n +monkey.btn.tooltip=Sacudir la construcci\u00f3n
(Mantener oprimido el bot\u00f3n) +job.message.ok=\u00a1Bravo! +job.message.failed=Construcci\u00f3n inv\u00e1lida... +job.gui.hidebox=Ocultar las metas +job.gui.ok=Mensaje de \u00e9xito: +job.gui.failed=Mensaje de fracaso: +job.gui.targets=Lista de metas: clic para seleccionar +job.gui.close=Crear +job.gui.delete=Suprimir +job.gui.valid=Verificar la construcci\u00f3n +job.gui.restore=Reintentar +job.gui.exercise=Esto es un ejercicio: +job.gui.progressmessage=Verificando su construcci\u00f3n +job.gui.alignment=pero la construcci\u00f3n no es v\u00e1lida en algunos casos de alineaci\u00f3n +job.gui.title=Editor de ejercicios +restrict.historypanel=Permitir el panel de hist\u00f3rico +restrict.macropanel=Permitir el panel de macros +restrict.helppanel=Permitir el panel de ayuda +restrict.failed.percent=La taza de error es de: +restrict.failed.initial=Error desde la posici\u00f3n inicial + +# v3.5.3 +job.gui.staticjob=Ejercicio est\u00e1tico + +# v3.6 +menu.edit.copyURL=Copiar la carpeta como URL +canvas.copy.message=Soltar el rat\u00f3n para copiar la selecci\u00f3n.ESC: Cancelar | MAJ: Cuadrado | ALT: Incremento 10 x 10. +menu.file.newDP=Nuevo disco de Poincar\u00e9 +palette.info.DP_line=Recta hiperb\u00f3lica +palette.info.DP_midPoint=Punto medio hiperb\u00f3lico +palette.info.DP_bi_syma=Simetr\u00eda axial hioperb\u00f3lica +palette.info.DP_bi_symc=Simetr\u00eda central hiperb\u00f3lica +palette.info.DP_plumb=Perpendicular hiperb\u00f3lica +palette.info.DP_bi_med=Mediatriz hiperb\u00f3lica +palette.info.DP_bi_biss=Bisectriz hiperb\u00f3lica +palette.info.DP_segment=Segmento hiperb\u00f3lico +palette.info.DP_ray=Semirrecta hiperb\u00f3lica +palette.info.DP_angle=Angulo hiperb\u00f3lico +palette.info.DP_circle=C\u00edrculo hiperb\u00f3lico +palette.info.DP_bi_distance=Distancia hiperb\u00f3lica +palette.info.DP_bi_perp_common=Perpendicular com\u00fan +palette.info.DP_bi_lineIP=Recta con puntos ideales +palette.info.DP_bi_horocycle=Horociclos por dos puntos +palette.info.DP_bi_equidistante=Equidistante a una recta por un punto +palette.info.DP_fixedangle=Angulo fijo hiperb\u00f3lico +palette.info.DP_bi_circ=C\u00edrculo hiperb\u00f3lico por tres puntos +macro.DP_line.1=Primer punto de la recta hiperb\u00f3lica +macro.DP_line.2=Segundo punto de la recta hiperb\u00f3lica +macro.DP_midPoint.1=Primer punto +macro.DP_midPoint.2=Segundo punto +macro.DP_bi_syma.1=Recta hiperb\u00f3lica +macro.DP_bi_syma.2=Punto +macro.DP_bi_symc.1=Centro +macro.DP_bi_symc.2=Punto +macro.DP_plumb.1=Recta hiperb\u00f3lica +macro.DP_plumb.2=Punto +macro.DP_bi_med.1=Primer punto +macro.DP_bi_med.2=Segundo punto +macro.DP_bi_biss.1=Primer punto +macro.DP_bi_biss.2=v\u00e9rtice del \u00e1ngulo +macro.DP_bi_biss.3=Tercer punto +macro.DP_segment.1=Primer punto +macro.DP_segment.2=Segundo punto +macro.DP_ray.1=Primer punto +macro.DP_ray.2=Segundo punto +macro.DP_angle.1=Primer punto +macro.DP_angle.2=V\u00e9rtice del \u00e1ngulo +macro.DP_angle.3=Tercer punto +macro.DP_circle.1=Centro +macro.DP_circle.2=Segundo punto +macro.DP.distance.1=Primer punto +macro.DP_bi_distance.2=Segundo punto +macro.DP_bi_distance.3=Punto de anclaje para mostrar la distancia +macro.DP_bi_perp_common.1=Primera Recta hiperb\u00f3lica +macro.DP_bi_perp_common.2=Segunda Recta hiperb\u00f3lica +macro.DP_bi_lineIP.1=Primer punto +macro.DP_bi_lineIP.2=Segundo punto +macro.DP_bi_horocycle.1=Primer punto +macro.DP_bi_horocycle.2=Segundo punto +macro.DP_bi_equidistante.1=Recta hiperb\u00f3lica +macro.DP_bi_equidistante.2=Un punto sobre la equidistante +macro.DP_fixedangle.1=Primer punto +macro.DP_fixedangle.2=V\u00e9rtice del \u00e1ngulo +macro.DP_fixedangle.3=Valor del \u00e1ngulo +macro.DP_bi_circ.1=Primer punto +macro.DP_bi_circ.2=Segundo punto +macro.DP_bi_circ.3=Tercer punto +canvas.DP.message1=El c\u00edrculo es el horizonte del disco de Poincar\u00e9. +canvas.DP.message2=Utilizar la zona de paleta "Construcci\u00f3n" para a\u00f1adir objetos sobre ese plano hiperb\u00f3lico. +JSmenu.ScriptsManager=Administrador de scripts +JSmenu.up=Subir +JSmenu.down=Bajar +JSmenu.rename=cambiar nombre: +JSmenu.killall=Matar todas las tareas +JSmenu.stopall=Detener todas las tareas +JSmenu.restartall=Volver a lanzar todas las tareas +palette.construction.euclidian=Herramientas euclidianas +JSmenu.executeonstart=El script se inicia al abrir la figura +JSmenu.dragaction=Hacer clic o deslizar: +palette.sizes.selectionsize=Selecci\u00f3n +palette.sizes.monkeyspeed=Mono +JSmenu.dragaction.message=Seleccionar los puntos o los botones que quiere asociar al script +splash.message=Software de geometr\u00eda din\u00e1mica + +#v3.6.2 +palette.sizes.gridopacity=Cuadr\u00edcula + + + + +#v3.6.3 +menu.file.exportpdf=Exportar en PDF +menu.edit.copyto=Copiar +palette.info.select=Zona de selecci\u00f3n para copiar y exportar +palette.info.DP_bi_pinceau1=Recta haz que pasa por un punto +macro.DP_bi_pinceau1.1=Primera recta +macro.DP_bi_pinceau1.2=Segunda recta +macro.DP_bi_pinceau1.3=Punto +palette.info.DP_bi_pinceau3=Producto de tres rectas en haz +macro.DP_bi_pinceau3.1=Primera recta +macro.DP_bi_pinceau3.2=Segunda recta +macro.DP_bi_pinceau3.3=Tercera recta +palette.info.DP_bi_pinceauinter=Intersecci\u00f3n de dos haces +macro.DP_bi_pinceauinter.1=Haz 1 - recta 1 +macro.DP_bi_pinceauinter.2=Haz 1 - recta 2 +macro.DP_bi_pinceauinter.3=Haz 2 - recta 1 +macro.DP_bi_pinceauinter.4=Haz 2 - recta 2 +palette.info.DP_bi_pinceauhauteur=Perpendicular producto de un haz +macro.DP_bi_pinceauhauteur.1=recta 1 del haz +macro.DP_bi_pinceauhauteur.2=recta 2 del haz +macro.DP_bi_pinceauhauteur.3=recta ortogonal al haz +palette.info.DP_bi_pinceaucycle=Ciclo por Haz y por Punto +macro.DP_bi_pinceaucycle.1=recta 1 del haz +macro.DP_bi_pinceaucycle.2=recta 2 del haz +macro.DP_bi_pinceaucycle.3=Punto +palette.info.DP_bi_pinceaubiss=Bisectriz de rectas orientadas +macro.DP_bi_pinceaubiss.1=recta 1 +macro.DP_bi_pinceaubiss.2=Pt ideal 1 de Rta 1 +macro.DP_bi_pinceaubiss.3=Pt ideal 2 de Rta 1 +macro.DP_bi_pinceaubiss.4=recta 2 +macro.DP_bi_pinceaubiss.5=Pt ideal 1 de Rta 2 +macro.DP_bi_pinceaubiss.6=Pt ideal 2 de Rta 2 + + +#v3.7.6 +menu.export.embedworkbook=Encapsular la carpeta en una p\u00e1gina HTML +menu.edit.copyapplettag=Copiar el tag Applet + +#v3.8 +menu.network=Red +network.menu.launch=Encender/Apagar el servidor +network.menu.connect=Conectar/Desconectar el servidor +network.server.title=Servidor +network.server.ip=IP local +network.server.launch=Arrancar +network.server.receive=S\u00f3lo recibir (Global) +network.server.circles=C\u00edrculos +network.server.functions=Funciones +network.server.rtw=Vista en tiempo real +network.server.send=Enviar a: +network.server.all=Todos +network.client.title=Explorador de conexi\u00f3n +network.client.Name=Nombre: +network.client.name= +network.client.ip=IP del servidor: +network.client.connect=Conectarse +network.client.sendwork=Enviar todo el trabajo +network.client.share=Compartir + +#v4.0 +JSFonctions.dountil=hacer{..} hasta que (); +palette.info.vector3D=Vector 3D +palette.info.midpoint3D=Punto medio 3D +palette.info.segment3D=Segmento 3D +palette.info.line3D=Recta 3D +palette.info.ray3D=Semirrecta 3D +palette.info.area3D=Polígono 3D +props.fixedsegment3D=Longitud 3D: +palette.info.bi_3Dtrans=Traslación 3D +palette.info.bi_3Dcircle1=Círculo 3D +palette.info.bi_3Dcircle2=Compás 3D +palette.info.bi_3Dcircle3pts=Círculo 3D por tres puntos +palette.info.bi_3Dplandroite=Intersección de un plano y una recta +palette.info.bi_3Dplanplan=Intersección de dos planos +palette.info.bi_3Dsphererayon=Esfera de radio dado +palette.info.bi_3Dspherepoint=Esfera centro y punto +palette.info.bi_3Dspheredroite=Intersección de una esfera y una recta +palette.info.bi_3Dsphereplan=Intersección de una esfera y un plano +palette.info.bi_3Dspheresphere=Intersección de dos esferas +palette.info.bi_3Dsymc=Simetría central 3D +palette.info.bi_3Dsymp=Simetría plana +palette.info.bi_3Dproj=Proyección sobre un plano +macro.bi_3Dsymc.0=Usted quiere construir el simétrico de un punto: ¿Cuál es el centro de simetría? +macro.bi_3Dsymc.1=Usted quiere construir el simétrico de un punto: ¿simétrico de qué punto? +macro.bi_3Dsymp.0=Usted quiere construir el simétrico con respecto a un plano: ¿cuál plano? primer punto +macro.bi_3Dsymp.1=Usted quiere construir el simétrico con respecto a un plano: ¿cuál plano? segundo punto +macro.bi_3Dsymp.2=Usted quiere construir el simétrico con respecto a un plano: ¿cuál plano? tercer punto +macro.bi_3Dsymp.3=Usted quiere construir el simétrico con respecto a un plano: ¿simétrico de cuál punto? +macro.bi_3Dproj.0=Usted quiere construir la proyección sobre un plano:¿cuál plano? primer punto +macro.bi_3Dproj.1=Usted quiere construir la proyección sobre un plano:¿cuál plano? segundo punto +macro.bi_3Dproj.2=Usted quiere construir la proyección sobre un plano:¿cuál plano? tercer punto +macro.bi_3Dproj.3=Usted quiere construir la proyección sobre un plano:¿cuál es el punto que quiere proyectar? +macro.bi_3Dtrans.0=Usted quiere construir la traslación de un punto: ¿cuál es el origen del vector? +macro.bi_3Dtrans.1=Usted quiere construir la traslación de un punto: ¿cuál es el extremo del vector? +macro.bi_3Dtrans.2=Usted quiere construir la traslación de un punto: ¿de cuál punto? +macro.bi_3Dcircle1.0=Usted quiere construir un círculo: ¿alrededor de cuál eje? +macro.bi_3Dcircle1.1=Usted quiere construir un círculo: ¿que pase por cuál punto? +macro.bi_3Dcircle2.0=Usted quiere construir un círculo de radio dado: ¿cuál es la dirección? señale una recta +macro.bi_3Dcircle2.1=Usted quiere construir un círculo de radio dado: ¿cuál es la centro? señale un punto +macro.bi_3Dcircle2.2=Usted quiere construir un círculo de radio dado: ¿de qué radio? señale un número +macro.bi_3Dcircle3pts.0=Usted quiere construir un círculo por tres puntos: ¿cuál es el primer punto? +macro.bi_3Dcircle3pts.1=Usted quiere construir un círculo por tres puntos: ¿cuál es el segundo punto? +macro.bi_3Dcircle3pts.2=Usted quiere construir un círculo por tres puntos: ¿cuál es el tercer punto? +macro.bi_3Dplandroite.0=Usted quiere construir la intersección de un plano y una recta: ¿cuál plano? primer punto +macro.bi_3Dplandroite.1=Usted quiere construir la intersección de un plano y una recta: ¿cuál plano? segundo punto +macro.bi_3Dplandroite.2=Usted quiere construir la intersección de un plano y una recta: ¿cuál plano? tercer punto +macro.bi_3Dplandroite.3=Usted quiere construir la intersección de un plano y una recta: ¿cuál es la recta? +macro.bi_3Dplanplan.0=Usted quiere construir la intersección de dos planos: ¿primer plano? primer punto +macro.bi_3Dplanplan.1=Usted quiere construir la intersección de dos planos: ¿primer plano? segundo punto +macro.bi_3Dplanplan.2=Usted quiere construir la intersección de dos planos: ¿priemr plano? tercer punto +macro.bi_3Dplanplan.3=Usted quiere construir la intersección de dos planos: ¿segundo plano? primer punto +macro.bi_3Dplanplan.4=Usted quiere construir la intersección de dos planos: ¿segundo plano? segundo punto +macro.bi_3Dplanplan.5=Usted quiere construir la intersección de dos planos: ¿segundo plano? tercer punto +macro.bi_3Dsphererayon.0=Usted quiere construir una esfera: ¿cuál es el centro? +macro.bi_3Dspherepoint.0=Usted quiere construir una esfera: ¿cuál es el centro? +macro.bi_3Dspherepoint.1=Usted quiere construir una esfera: ¿que pase por qué punto? +macro.bi_3Dspheredroite.0=Usted quiere la intersección de una esfera y una recta: ¿cuál esfera? +macro.bi_3Dspheredroite.1=Usted quiere la intersección de una esfera y una recta: ¿cuál recta? +macro.bi_3Dsphereplan.0=Usted quiere la intersección de una esfera y un plano: ¿cuál esfera? +macro.bi_3Dsphereplan.1=Usted quiere la intersección de una esfera y un plano: ¿cuál plano? primer punto +macro.bi_3Dsphereplan.2=Usted quiere la intersección de una esfera y un plano: ¿cuál plano? segundo punto +macro.bi_3Dsphereplan.3=Usted quiere la intersección de una esfera y un plano: ¿cuál plano? tercer punto +macro.bi_3Dspheresphere.0=Usted quiere la intersección de dos esferas: ¿Cuál es la primera? +macro.bi_3Dspheresphere.1=Usted quiere la intersección de dos esferas: ¿Cuál es la segunda? +palette.info.bi_3Docta=Octaedro regular +macro.bi_3Docta.0=Usted quiere un octaedro regular: ¿cuál es el centro? +palette.info.bi_3Disoc=Icosaedro regular +macro.bi_3Disoc.0=Usted quiere un icosaedro regular: ¿cuál es el centro? +palette.info.angle3D=Ángulo 3D +palette.info.intersection3D=Intersección 3D +JSeditor.choseGenerator=Interruptor modo principiante (seleccioando) / modo normal (desseleccionado) +aerialview=vista de techo +frontview=vista de frente +rightview=vista derecha +backview=vista estándar diff --git a/eric/docs/JZirkelProperties_fr.properties b/eric/docs/JZirkelProperties_fr.properties new file mode 100644 index 0000000..1ed0486 --- /dev/null +++ b/eric/docs/JZirkelProperties_fr.properties @@ -0,0 +1,801 @@ +# Sample ResourceBundle properties file +menu.file=Fichier +menu.file.new=Nouvelle figure +menu.file.load=Ouvrir... +menu.file.save=Enregistrer +menu.file.saveas=Enregistrer sous... +menu.file.exportpng=Exporter vers PNG +menu.file.exporteps=Exporter vers EPS +menu.file.exportsvg=Exporter vers SVG +menu.file.quit=Quitter +menu.edit=\u00c9dition +menu.edit.copy=Copier +menu.edit.move=D\u00e9placer un objet +menu.edit.rename=Renommer +menu.edit.edit=Modifier +menu.edit.hide=Cacher +menu.edit.delete=Supprimer +menu.display=Affichage +menu.display.hidden=Montrer/Cacher les objets invisibles +menu.display.grid=Montrer/Cacher la grille +menu.display.finegrid=Axes seulement +menu.display.leftsnap=Grille magn\u00e9tique +menu.display.manage_macros=Inspecteur de macros +menu.display.history_panel=Historique +menu.display.help_panel=Panneau d'aide +menu.display.properties_panel=Inspecteur d'objets +menu.display.small=Petites ic\u00f4nes +menu.display.medium=Moyennes ic\u00f4nes +menu.display.large=Grandes ic\u00f4nes +menu.display.restrictedpalette=Afficher la palette restreinte +menu.display.restrictedpaletteedit=Modifier la palette restreinte +menu.display.restrictmessage=
Cette fonctionnalit\u00e9 vous permet de visualiser la palette restreinte.

Elle ne concerne que le fichier en cours.

Lors de l'enregistrement, vous pourrez choisir l'option «enregistrer aussi la figure restreinte».
Deux fichiers seront alors cr\u00e9\u00e9s : le premier (.zir) s'ouvrira en mode normal, et
le deuxi\u00e8me (.r.zir) en mode restreint.
+menu.macros=Macros +menu.special=Sp\u00e9cial +menu.special.newmacro=Cr\u00e9er macro +menu.special.loadmacros=Ouvrir un fichier de macros... +menu.special.definejob=D\u00e9finir un exercice +menu.special.loadjob=Ouvrir un exercice... +menu.special.jobcomment=R\u00e9diger texte de l'exercice +menu.special.testjob=Tester cet exercice +menu.special.savejob=Enregistrer en tant qu'exercice +menu.special.export=Cr\u00e9er un fichier HTML et voir dans le navigateur +menu.special.exporttemplate=Exporter en HTML avec mod\u00e8les +menu.help=Aide +menu.help.about=\u00c0 propos de CaRMetal... +menu.help.info=Aide contextuelle +menu.help.url0=Site CaRMetal +menu.help.url1=Site CARzine +menu.help.url2=Site officiel de C.a.R. + +filedialog.options=Options de sauvegarde +filedialog.saveas=Enregistrer la figure +filedialog.alsorestricted=Enregistrer aussi la figure restreinte +filedialog.restrictedmessage=Vous travaillez actuellement dans une session restreinte,
votre figure sera donc enregistr\u00e9e en mode restreint. +filedialog.filefilter=Fichier CaR (.zir) +filedialog.compressedfilefilter=Fichier CaR compress\u00e9 (.zirz) +filedialog.macrofilefilter=Fichier de macros (.mcr) +filedialog.savemessage1=Le fichier :\n +filedialog.savemessage2=\nexiste d\u00e9j\u00e0. Voulez-vous vraiment le remplacer ? + +palette.file=Fichier +palette.edit=\u00c9dition +palette.construction=Construction +palette.aspect=Aspect & couleur +palette.history=Historique +palette.sizes=Tailles +palette.sizes.point=Points +palette.sizes.line=Lignes +palette.sizes.arrow=Fl\u00e8ches +palette.sizes.font=Police +palette.prec=Pr\u00e9cision num\u00e9rique +palette.prec.lengths=Longueurs +palette.prec.edit=Expressions +palette.prec.angles=Angles +palette.colors=Fond : couleur & image +palette.colors.saturated1=Couleurs satur\u00e9es +palette.colors.desaturated1=Couleurs d\u00e9satur\u00e9es +palette.colors.saturated2=Couleurs satur\u00e9es 2 +palette.colors.desaturated2=Couleurs d\u00e9satur\u00e9es 2 +palette.colors.constants=Couleurs Web +palette.image.fileerror=Vous devez enregistrer cette figure avant d'utiliser cette fonctionnalit\u00e9.

Ensuite, l'image que vous choisirez doit figurer
dans le m\u00eame r\u00e9pertoire que cette figure. + +palette.info.vector=Vecteur +palette.info.image3=Ins\u00e9rer une image+\u00e0 partir de 2 ou 3 points +palette.info.background=Choisir/Effacer une image de fond +palette.info.imcenter=Centrer l'image de fond +palette.info.imstretch=\u00c9tirer l'image de fond+pour qu'elle remplisse+la fen\u00eatre de construction +palette.info.imtile=R\u00e9p\u00e9ter l'image de fond +palette.info.copy=Copier la fen\u00eatre de construction+dans le presse-papier +palette.info.exportpng=Exporter la construction+de la fen\u00eatre actuelle au format PNG +palette.info.exporteps=Exporter la construction+de la fen\u00eatre actuelle au format EPS +palette.info.newmacro=Cr\u00e9er une nouvelle macro +palette.info.loadmacros=Ouvrir un fichier de macros +palette.info.manage_macros=Montrer/Cacher le panneau+de gestion des macros +palette.info.properties_panel=Montrer/Cacher le panneau+des propri\u00e9t\u00e9s des objets +palette.info.history_panel=Montrer/Cacher le panneau+de l'historique de la construction +palette.info.help_panel=Montrer/Cacher le panneau+d'aide contextuelle + + +macros.untitledmacro=Macro sans titre +macros.untitledfolder=Dossier sans titre +macros.emptynode=-- Vide -- +macros.addfolder=Ajouter un nouveau dossier +macros.deleteselected=Supprimer les macros s\u00e9lectionn\u00e9es +macros.renamemacro=Renommer la macro s\u00e9lectionn\u00e9e +macros.recordmacro=Enregistrer une macro +macros.initials=Objets initiaux ? +macros.pleaseselect=S\u00e9lectionnez, S.V.P ! +macros.finals=Objets finaux ? +macros.cancel=Annuler ? +macros.popup.run=Lancer la macro +macros.popup.rename=Renommer +macros.popup.delete=Supprimer... +macros.popup.addtolibrary=Ajouter \u00e0 la biblioth\u00e8que +macros.popup.removefromlibrary=Retirer de la biblioth\u00e8que +macros.popup.publish=Inclure dans la figure +macros.popup.notpublish=Ne pas inclure dans la figure +macros.popup.saveas=Enregistrer sous... +macros.popup.properties=Montrer les propri\u00e9t\u00e9s +macros.popup.duplicate=Dupliquer +macros.savedlog.buttonok=Enregistrer le fichier de macro(s) +macros.question.delete=\u00cates-vous s\u00fbr de vouloir vraiment effacer ces macros ? + +rene.zirkel.objects.PointObject=Pt +rene.zirkel.objects.PrimitiveCircleObject=Cer. +rene.zirkel.objects.PrimitiveLineObject=Dte +rene.zirkel.objects.ExpressionObject=Exp +rene.zirkel.objects.FixedAngleObject=Fangle. +rene.zirkel.objects.SegmentObject=Seg. +rene.zirkel.objects.RayObject=DLne +rene.zirkel.objects.TwoPointLineObject=Lne +rene.zirkel.objects.FunctionObject=Fct +rene.zirkel.objects.AreaObject=Area + +mi.pal.name=Inspecteur de macros +mi.name=Nom : +mi.comment=Commentaire : +mi.properties=Propri\u00e9t\u00e9s des objets initiaux : +mi.hideproperties=Propri\u00e9t\u00e9s des objets finaux : +mi.hideduplicates=Cacher les doublons \u00e9ventuels +mi.apply=Appliquer +mi.tab.type=Type +mi.tab.name=Nom +mi.tab.prompt=Invite +mi.tab.fix=Fixe ? +mi.tab.ask=Ask ? +mi.error.initial=Erreur : au moins un objet initial \ndoit \u00eatre libre (ni fix\u00e9, ni demand\u00e9)\n\nAucune modification ne sera\napport\u00e9e \u00e0 cette macro. + +props.help=Pour pouvoir visualiser les propri\u00e9t\u00e9s d'un objet, cliquer-droit sur celui-ci.

Si vous cr\u00e9ez un nouvel objet contenant des points, vous pourrez voir et \u00e9diter les propri\u00e9t\u00e9s de ces points pendant la cr\u00e9ation de l'objet. +props.name=Nom : +props.alias=Alias : +props.unit=Unit\u00e9 : +props.fix=Fixe : +props.expl=Explication : +props.belongto=Calque : +props.conditional=Aspect conditionnel : +props.solid=Opaque : +props.hidden=Cach\u00e9 : +props.normal=Normal : +props.bold=\u00c9pais : +props.thin=Pointill\u00e9s : +props.black=Noir : +props.green=Vert : +props.blue=Bleu : +props.brown=Marron : +props.cyan=Cyan : +props.red=Rouge : +props.showasslider=Curseur +props.error=Il y a une erreur de syntaxe dans cette expression.
Elle va \u00eatre r\u00e9initialis\u00e9e. +props.cartesian=Fonction cart\u00e9sienne +props.parametric=Fonction param\u00e9tr\u00e9e +props.functiontype=Type : +props.killarc=Supp. arc +props.arc=Arc +props.release=D\u00e9tacher +props.bind=Attacher +props.setaway=Loin de +props.setclose=Pr\u00e8s de + +# v1.3 : +props.grid=Incr\u00e9ment : +props.inside=Dans l'objet : +props.pointsonly=Seulement avec des points : +props.step=Pas : +palette.grid=Aspect de la grille +leftpanel.macros=Panneau de gestion des macros +leftpanel.properties=Panneau de propri\u00e9t\u00e9s des objets +leftpanel.history=Panneau d'historique +leftpanel.help=Panneau d'aide +selectpopup.whatobject=quel objet ? +selectpopup.RightClick=S\u00e9lectionner +selectpopup.MoverTool=D\u00e9placer +selectpopup.HiderTool=Cacher/Montrer +selectpopup.DeleteTool=Supprimer +selectpopup.RenamerTool=Renommer +selectpopup.EditTool=\u00c9diter +selectpopup.SetParameterTool=Macro initiaux : +selectpopup.SetTargetsTool=Macro finaux : +selectpopup.JSmacroTool=S\u00e9lectionner +palette.info.locus=Lieu de point+Enveloppe de droite + + +# v1.4 : +menu.special.savezirset=Cr\u00e9er un diaporama +filedialog.openfolder.title=Dialogue de s\u00e9lection du dossier du diaporama +filedialog.openfolder.approve=S\u00e9lectionner le dossier du diaporama +filedialog.openfolder.saveicons=Enregistrer aussi les outils restreints +slideshow.next=suivant +slideshow.previous=pr\u00e9c\u00e9dent +slideshow.download=T\u00e9l\u00e9charger le fichier +slideshow.signature=Diaporama r\u00e9alis\u00e9 avec + +# v1.5 : +menu.language=Langues +menu.help.url3=Traduire CaRMetal +menu.display.smartboard=Mode TNI (Tableau num\u00e9rique interactif) + +# v1.6 : +palette.info.bi_syma=Sym\u00e9trie axiale +palette.info.bi_symc=Sym\u00e9trie centrale +palette.info.bi_trans=Translation +palette.info.bi_med=M\u00e9diatrice +palette.info.bi_biss=Bissectrice +palette.info.bi_circ=Cercle circonscrit +palette.info.bi_arc=Arc passant par trois points +palette.info.bi_t_align=Points align\u00e9s ? +palette.info.bi_t_para=Droites parall\u00e8les ? +palette.info.bi_t_perp=Droites perpendiculaires ? +palette.info.bi_t_equi=Point \u00e9quidistant de deux autres ? +palette.info.bi_t_app=Appartient \u00e0 une droite ? +palette.info.bi_t_conf=Points confondus ? +macro.bi_syma.0=Axe de sym\u00e9trie ? +macro.bi_syma.1=Sym\u00e9trique de quel point ? +macro.bi_symc.0=Centre de sym\u00e9trie ? +macro.bi_symc.1=Sym\u00e9trique de quel point ? +macro.bi_trans.0=Origine du vecteur ? +macro.bi_trans.1=Extr\u00e9mit\u00e9 du vecteur ? +macro.bi_trans.2=Image de quel point ? +macro.bi_med.0=Premi\u00e8re extr\u00e9mit\u00e9 du segment ? +macro.bi_med.1=Seconde extr\u00e9mit\u00e9 du segment ? +macro.bi_biss.0=Premier point ? +macro.bi_biss.1=Sommet de l'angle ? +macro.bi_biss.2=Dernier point ? +macro.bi_circ.0=Premier point ? +macro.bi_circ.1=Second point ? +macro.bi_circ.2=Troisi\u00e8me point ? +macro.bi_t_para.0=Premi\u00e8re droite (ou segment) ? +macro.bi_t_para.1=Deuxi\u00e8me droite (ou segment) ? +macro.bi_t_equi.0=Ce point est-il \u00e9quidistant ... +macro.bi_t_equi.1=De ce point ... +macro.bi_t_equi.2=Et de ce point ? +macro.bi_t_app.0=Quel point ? +macro.bi_t_app.1=Appartient \u00e0 quelle droite (ou segment) ? +macro.bi_t_conf.0=Quel point ? +macro.bi_t_conf.1=Est confondu avec quel point ? +macro.bi_t_align.text0=Les points sont align\u00e9s +macro.bi_t_align.text1=Les points ne sont pas align\u00e9s +macro.bi_t_para.text0=Les objets sont parall\u00e8les +macro.bi_t_para.text1=Les objets ne sont pas parall\u00e8les +macro.bi_t_perp.text0=Les objets sont perpendiculaires +macro.bi_t_perp.text1=Les objets ne sont pas perpendiculaires +macro.bi_t_equi.text0=Les points sont \u00e9quidistants +macro.bi_t_equi.text1=Les points ne sont pas \u00e9quidistants +macro.bi_t_app.text0=Le point est sur l'objet +macro.bi_t_app.text1=Le point n'est pas sur l'objet +macro.bi_t_conf.text0=Les deux points sont confondus +macro.bi_t_conf.text1=Les deux points ne sont pas confondus + +# v1.7 : +filedialog.openfolder.appletsize=Taille de l'applet : +filedialog.openfolder.actualsize=Taille actuelle +filedialog.openfolder.other=Autre... +filedialog.openfolder.selected=Dossier choisi : +filedialog.openfolder.cancel=Annuler +menu.file.exportsvg=Exporter vers SVG +menu.objects.points=Points +menu.objects.lines=Droites +menu.objects.segments=Segments +menu.objects.circles=Cercles et coniques +menu.objects.angles=Angles +menu.objects.tracks=Traces et lieux +menu.objects.functions=Fonctions et expressions +palette.info.function_u=Fonction d\u00e9finie par l'utilisateur +palette.info.function=Tracer une fonction+ou une courbe param\u00e9tr\u00e9e +props.superhidden=Compl\u00e8tement cach\u00e9 : +props.showvalue=Montrer valeur : +props.showname=Montrer nom : +props.background=Arri\u00e8re-plan : +macro.bi_expression.0=Point d'ancrage ? + +# v1.9a : +licence.txt=

Ce programme est un logiciel gratuit sous licence GNU-GPL, ce qui signifie que vous pouvez le redistribuer et/ou le modifier selon les termes de la licence publi\u00e9e par la "Free Software Foundation"
Voir :

+ + +# v2.0 : +menu.special.theme=Themes +menu.special.theme.gray=Metal poli +menu.special.theme.brushed=Metal bross\u00e9 +menu.special.options=Pr\u00e9f\u00e9rences... +menu.special.options.sizes=Tailles +menu.special.options.sizes.minpointsize=Taille des points +menu.special.options.sizes.minlinesize=Epaisseur des lignes +menu.special.options.sizes.arrowsize=Taille des fl\u00e8ches +menu.special.options.sizes.minfontsize=Taille des caract\u00e8res +menu.special.options.sizes.digits.lengths=Pr\u00e9cision des longueurs +menu.special.options.sizes.digits.edit=Pr\u00e9cision des expressions +menu.special.options.sizes.digits.angles=Pr\u00e9cision des angles +menu.special.options.colors=Couleurs +menu.special.options.others=Autres +menu.special.options.others.undock=Possibilit\u00e9 de d\u00e9tacher les palettes + + +# v2.1 : +menu.file.close=Fermer la fen\u00eatre + +# v2.3 : +alert.toomuchwins=Il y a trop de fen\u00eatres ouvertes :
veuillez en fermer quelques-unes
afin de pouvoir en ouvrir d'autres... + +# v2.4 : +menu.file.new3D=Nouvelle figure 3D +palette.info.bi_3Dcoords=Point 3D +macro.bi_3Dcoords.0=choisir un point +palette.info.bi_3Dcube=Cube +macro.bi_3Dcube.0=Centre du cube ? +palette.info.bi_3Darete=Ar\u00eate 3D (gestion des pointill\u00e9s) +macro.bi_3Darete.0=Point gauche ? +macro.bi_3Darete.1=Origine de l'ar\u00eate ? +macro.bi_3Darete.2=Point droit ? +macro.bi_3Darete.3=Extr\u00e9mit\u00e9 de l'ar\u00eate ? +palette.info.bi_3Dtetra=Tetra\u00e8dre r\u00e9gulier +macro.bi_3Dtetra.0=Centre du t\u00e9tra\u00e8dre ? +menu.newdoc=Nouveau + +# v2.5.5 : +palette.aspect.label.text_title=Aspect des +palette.aspect.label.point=points +palette.aspect.label.line=droites +palette.aspect.label.segment=segments +palette.aspect.label.circle=cercles +palette.aspect.label.angle=angles +palette.aspect.label.area=polygones +palette.aspect.label.text=textes +palette.aspect.label.image=images +palette.info.bi_3Ddode=Dod\u00e9ca\u00e8dre r\u00e9gulier +macro.bi_3Ddode.0=Centre du dod\u00e9ca\u00e8dre ? + + +# v2.7 : +palette.aspect.label.pointshape=Forme & nom des points : +palette.aspect.label.locus=lieux +menu.edit.deleteall=Effacer tout + + +# v2.7.1 : +java.old.message=D\u00e9sol\u00e9... Vous ne pouvez demarrer l'application CaRMetal parce que votre version de Java est trop ancienne... +java.old.quit=Quitter +java.old.go=T\u00e9l\u00e9charger une nouvelle version de java +palette.info.boundedpoint=Placer un point sur un plan+ou sur une face de poly\u00e8dre + +#v2.7.2 : +user.foldername=Profil Utilisateur CaRMetal + +#v2.8 +props.fixedray=Rayon : +props.fixedsegment=Longueur : +props.fixedangle=Angle : +props.expl=Commentaire : +props.aspecttab=Aspect +props.numerictab=Num\u00e9rique +props.conditionaltab=Conditionnel +props.popup.special=Caract\u00e8res sp\u00e9ciaux +props.popup.functions=Fonctions pr\u00e9d\u00e9finies +props.popup.latex=Commandes LaTeX + +#v2.8.1 +props.fixedinwindow=Li\u00e9 \u00e0 la fen\u00eatre + +#v2.8.5 +palette.controls=Contr\u00f4les +props.ctrlshowvalue=Montrer la valeur du contr\u00f4le +props.ctrlsnap=Fix\u00e9 aux graduations +props.ctrlshowticks=Montrer les graduations +props.ctrltickspacing=Incr\u00e9ment : +palette.info.ctrl_edit=Editer, d\u00e9placer+ou redimensionner le contr\u00f4le +palette.info.ctrl_chkbox=Ajouter une bo\u00eete \u00e0 cocher +palette.info.ctrl_popup=Ajouter un menu d\u00e9roulant +palette.info.ctrl_slider=Ajouter un curseur + +#v2.8.6 +props.trackdmin=Nombre d'\u00e9tapes : +opendialog.preview=Aper\u00e7u : +pngdialog.options=Options d'exportation : +pngdialog.scale=Echelle : +pngdialog.originsize=Taille d'origine : +pngdialog.scaledsize=Taille \u00e0 l'echelle : + +#v2.8.7 +canvas.3D.floor=Sol +canvas.3D.system=Rep\u00e8re +canvas.3D.rightclic=Utiliser le clic-droit glisser pour faire pivoter + +#v2.8.8 +palette.info.equationxy=Courbe d\u00e9finie par f(x,y)=0 +props.equationxy=Equation : +props.equationxychooser=Pr\u00e9cision : +palette.function=Fonctions & Lieux + +#v2.8.9 +menu.edit.deletealltracks=Effacer les traces +menu.edit.deactivatealltracks=D\u00e9sactiver les traces +props.tracks=Activer la trace +menu.edit.zoom=Zoomer ou d\u00e9placer + +#v2.9.0 +menu.windows=Fen\u00eatre + +#v2.9.1 +contexthelp.seealso=Sujets connexes : + +#v2.9.2 +menu.display.restrictmessage.dontdisplay=Ne plus afficher ce message +props.thick=\u00c9pais : + +#v2.9.6 +props.magnetmessage=Cliquer sur les objets que vous voulez ajouter \u00e0 (ou enlever de) la liste des objets magn\u00e9tiques +props.magnetobj=Objets magn\u00e9tiques +props.magnetpix=Attraction (20 px) : + +#v2.9.7 +palette.info.ctrl_txtfield=Ajouter une boite d'entr\u00e9e num\u00e9rique +palette.info.ctrl_button=Ajouter un bouton + +#v2.9.8.4 +JSerror.title=Erreur de syntaxe +JSerror.line=ligne +JSerror.pointcoords=Erreur de syntaxe dans les coordonn\u00e9es du point +JSerror.interactiveinput=Erreur pendant la d\u00e9signation de l'objet +JSerror.notfound=Objet non trouv\u00e9 +JSerror.notgoodtype=Impossible \u00e0 appliquer \u00e0 ce type d'objet +JScmd.inputmessage=Votre question ? +JScmd.promptmessage=Votre message... +menu.js=Javascript +menu.js.script=Ouvrir un fichier javascript... +menu.js.command=Ouvrir l'\u00e9diteur de script +JSeditor.title=Editeur javascript + + +#v3.0 +JSeditor.save=Enregistrer le script +JSeditor.open=Ouvrir un script +JSeditor.opendlogmsg=Ouvrir le script +JSeditor.savedlogmsg=Enregistrer le script +JSeditor.format=Indenter le script +JSeditor.restore=Annuler les effets du dernier lancement de script +JSeditor.run=Lancer le script +JSeditor.help=Obtenir une aide sur la syntaxe +JSEditor.comment=Commenter/D\u00e9commenter la selection +JSEditor.savequestion=Ce script a chang\u00e9 : voulez-vous l'enregistrer ? + +# v3.1.1 +menu.js.define=Definir le dossier de scripts... +menu.js.dumb=Executer les scripts sans \u00e9diteur +JSeditor.opendfavfolder=Choisir comme dossier de scripts +JSeditor.saveas=Enregistrer le script sous... + +# v3.5 +tab.popup.newfigure=Nouvelle figure +tab.popup.rename=Renommer la figure +tab.popup.duplicate=Dupliquer figure +tab.popup.openworkbook=Ouvrir un classeur... +tab.popup.saveworkbookas=Enregistrer le classeur sous... +tab.popup.saveworkbook=Enregistrer le classeur +tab.newfigurebasename=Figure +workbook.workbookmode=Mode classeur +workbook.savequestion=Ce classeur a \u00e9t\u00e9 modifi\u00e9. Voulez-vous l'enregistrer ? +progressbar.loadmessage=Figure en cours d'ouverture : veuillez patienter... +progressbar.workbookloadmessage=Classeur en cours d'ouverture : veuillez patienter... +progressbar.workbooksavemessage=Classeur en cours de sauvegarde : veuillez patienter... +macro.creationdlog.title=Cr\u00e9ation d'une macro +macros.name=Nom de la macro ? +JSmenu.cancel=Annuler les effets +JSmenu.add=Ajouter un nouveau script +JSmenu.modify=Modifier le script +JSmenu.delete=Supprimer le script +JSeditor.saveinfig.question=Entrer le nom du script : +JSeditor.saveinfig.title=Enregistrer le script dans la figure +JSeditor.saveinfig=Enregistrer le script dans la figure courante +JSeditor.infig=Script inclus dans la figure : +menu.js.newscriptinconstruction=Nouveau script dans la construction... +menu.workbook.saveas=Enregistrer le classeur sous... +media.saveas=Des images ont \u00e9t\u00e9 trouv\u00e9es dans la construction,
vous allez donc enregistrer les fichiers dans un m\u00eame classeur. +menu.display.comment=Montrer/Cacher les commentaires +menu.display.palette=Montrer/Cacher la palette +menu.display.leftpanel=Montrer/Cacher le panneau de gauche +comment.emptycomment= +menu.export.workbook=Exporter le classeur dans une page HTML +menu.assigment=Exercice +JSerror.condition=Erreur dans l'expression de condition +filedialog.workbook=Classeur CaRMetal (.zirs) +filedialog.job=Exercice CaRMetal (.job) +filedialog.js=Scripts CaRMetal (.js) +filedialog.allfiles=Fichiers CaRMetal (.zirs,.zir,.zirz,.mcr,.job,.js) +tab.popup.savefileonly=Enregistrer la figure sous... +animation.run=D\u00e9marrer les animations +animation.stop=Arr\u00eater les animations +animation.speed=Vitesse des animations +animation.removeall=Supprimer toutes les animations +animation.reverse=Inverser le sens des animations +restrict.title=Gestionnaire d'environnement restreint +menu.display.restrictedenvironment=Gestionnaire d'environnement restreint +restrict.ok=Ok +restrict.cancel=Annuler +restrict.activate=Activer l'environnement restreint +restrict.factory=R\u00e9glages d'usine +restrict.comment=Afin de s\u00e9lectionner ou d\u00e9selectionner facilement de multiples outils, vous pouvez effectuer un clic-droit/glisser sur les ic\u00f4nes. +restrict.menubar=Afficher la barre des menus +restrict.librarymacros=Permettre les macros de biblioth\u00e8que +menu.help.opendefaultfolder=Ouvrir le dossier de configuration +monkey.btn.tooltip=Secouer la construction
(Maintenir le bouton de la souris enfonc\u00e9) +job.message.ok=Bravo ! +job.message.failed=Construction non valide... +job.gui.hidebox=Cacher les cibles +job.gui.ok=Message de r\u00e9ussite : +job.gui.failed=Message d'\u00e9chec : +job.gui.targets=Liste des cibles : cliquer ici pour s\u00e9lectionner +job.gui.close=Cr\u00e9er +job.gui.delete=Supprimer +job.gui.valid=V\u00e9rifier la construction +job.gui.restore=Revenir \u00e0 l'\u00e9nonc\u00e9 +job.gui.exercise=Ceci est un exercice : +job.gui.progressmessage=V\u00e9rification de votre construction en cours +job.gui.alignment=mais la construction n'est pas valide dans quelques cas d'alignement +job.gui.title=Editeur d'exercices +restrict.historypanel=Permettre l'affichage du panneau d'historique +restrict.macropanel=Permettre l'affichage du panneau de macros +restrict.helppanel=Permettre l'affichage du panneau d'aide +restrict.failed.percent=Le taux d'echec enregistr\u00e9 \u00e9tait de : +restrict.failed.initial=Echec d\u00e8s la position initiale + +# v3.5.3 +job.gui.staticjob=Exercice statique + +# v3.6 +menu.edit.copyURL=Copier le classeur en tant qu'URL +canvas.copy.message=Rel\u00e2cher la souris pour copier la s\u00e9lection. ESC : Annuler | MAJ : Carr\u00e9 | ALT : Incr\u00e9ment 10 x 10. +menu.file.newDP=Nouveau disque de Poincar\u00e9 +palette.info.DP_line=Droite hyperbolique +palette.info.DP_midpoint=Milieu hyperbolique +palette.info.DP_bi_syma=Sym\u00e9trie axiale hyperbolique +palette.info.DP_bi_symc=Sym\u00e9trie centrale hyperbolique +palette.info.DP_plumb=Perpendiculaire hyperbolique +palette.info.DP_bi_med=M\u00e9diatrice hyperbolique +palette.info.DP_bi_biss=Bissectrice hyperbolique +palette.info.DP_segment=Segment hyperbolique +palette.info.DP_ray=Demi-droite hyperbolique +palette.info.DP_angle=Angle hyperbolique +palette.info.DP_circle=Cercle hyperbolique +palette.info.DP_bi_distance=Distance hyperbolique +palette.info.DP_bi_perp_common=Perpendiculaire commune +palette.info.DP_bi_lineIP=Droite avec points id\u00e9aux +palette.info.DP_bi_horocycle=Horicycles par deux points +palette.info.DP_bi_equidistante=\u00c9quidistante \u00e0 une droite par un point +palette.info.DP_fixedangle=Angle fixe hyperbolique +palette.info.DP_bi_circ=Cercle hyperbolique passant par trois points +macro.DP_line.1=Premier point de la droite hyperbolique +macro.DP_line.2=Second point de la droite hyperbolique +macro.DP_midpoint.1=Premier point +macro.DP_midpoint.2=Second point +macro.DP_bi_syma.1=Droite hyperbolique +macro.DP_bi_syma.2=Point +macro.DP_bi_symc.1=Centre +macro.DP_bi_symc.2=Point +macro.DP_plumb.1=Droite hyperbolique +macro.DP_plumb.2=Point +macro.DP_bi_med.1=Premier point +macro.DP_bi_med.2=Second point +macro.DP_bi_biss.1=Premier point +macro.DP_bi_biss.2=Sommet de l'angle +macro.DP_bi_biss.3=Troisi\u00e8me point +macro.DP_segment.1=Premier point +macro.DP_segment.2=Second point +macro.DP_ray.1=Premier point +macro.DP_ray.2=Second point +macro.DP_angle.1=Premier point +macro.DP_angle.2=Sommet de l'angle +macro.DP_angle.3=Troisi\u00e8me point +macro.DP_circle.1=Centre +macro.DP_circle.2=Second point +macro.DP.distance.1=Premier point +macro.DP_bi_distance.2=Second point +macro.DP_bi_distance.3=Point d'ancrage pour afficher la distance +macro.DP_bi_perp_common.1=Premi\u00e8re droite hyperbolique +macro.DP_bi_perp_common.2=Seconde droite hyperbolique +macro.DP_bi_lineIP.1=Premier point +macro.DP_bi_lineIP.2=Second point +macro.DP_bi_horocycle.1=Premier point +macro.DP_bi_horocycle.2=Second point +macro.DP_bi_equidistante.1=Droite hyperbolique +macro.DP_bi_equidistante.2=Un point sur l'\u00e9quidistante +macro.DP_fixedangle.1=Premier point +macro.DP_fixedangle.2=Sommet de l'angle +macro.DP_fixedangle.3=Valeur de l'angle +macro.DP_bi_circ.1=Premier point +macro.DP_bi_circ.2=Second point +macro.DP_bi_circ.3=Troisi\u00e8me point +canvas.DP.message1=Le cercle est l'horizon du disque de Poincar\u00e9. +canvas.DP.message2=Utiliser la zone de palette "Construction" pour ajouter des objets sur ce plan hyperbolique. +JSmenu.ScriptsManager=Gestionnaire de scripts +JSmenu.up=Monter +JSmenu.down=Descendre +JSmenu.rename=Renommer : +JSmenu.killall=Tuer toutes les t\u00e2ches +JSmenu.stopall=Stopper toutes les t\u00e2ches +JSmenu.restartall=Red\u00e9marrer toutes les t\u00e2ches +palette.construction.euclidian=Outils euclidiens +JSmenu.executeonstart=Le script se lance \u00e0 l'ouverture de la figure +JSmenu.dragaction=Cliquer ou glisser : +palette.sizes.selectionsize=S\u00e9lection +palette.sizes.monkeyspeed=Monkey +JSmenu.dragaction.message=S\u00e9lectionner les points ou les boutons auxquels vous voulez attacher ce script +splash.message=Logiciel de g\u00e9om\u00e9trie dynamique + +#v3.6.2 +palette.sizes.gridopacity=Grille + +#v3.6.3 +menu.file.exportpdf=Exporter vers PDF +menu.edit.copyto=Copier vers +palette.info.select=Zone de s\u00e9lection+pour le copier et l'export +palette.info.DP_bi_pinceau1=Droite pinceau passant+par un point +macro.DP_bi_pinceau1.1=Premi\u00e8re droite +macro.DP_bi_pinceau1.2=Deuxi\u00e8me droite +macro.DP_bi_pinceau1.3=Point +palette.info.DP_bi_pinceau3=Produit de trois droites+en pinceau +macro.DP_bi_pinceau3.1=Premi\u00e8re droite +macro.DP_bi_pinceau3.2=Deuxi\u00e8me droite +macro.DP_bi_pinceau3.3=Troisi\u00e8me droite +palette.info.DP_bi_pinceauinter=Intersection de deux pinceaux +macro.DP_bi_pinceauinter.1=Pinceau 1 - droite 1 +macro.DP_bi_pinceauinter.2=Pinceau 1 - droite 2 +macro.DP_bi_pinceauinter.3=Pinceau 2 - droite 1 +macro.DP_bi_pinceauinter.4=Pinceau 2 - droite 2 +palette.info.DP_bi_pinceauhauteur=Perpendiculaire issue d\u2019un pinceau +macro.DP_bi_pinceauhauteur.1=Droite 1 du pinceau +macro.DP_bi_pinceauhauteur.2=Droite 2 du pinceau +macro.DP_bi_pinceauhauteur.3=Droite orthogonale au pinceau +palette.info.DP_bi_pinceaucycle=Cycle par pinceau et par point +macro.DP_bi_pinceaucycle.1=Droite 1 du pinceau +macro.DP_bi_pinceaucycle.2=Droite 2 du pinceau +macro.DP_bi_pinceaucycle.3=Point +palette.info.DP_bi_pinceaubiss=Bissectrice de droites orient\u00e9es +macro.DP_bi_pinceaubiss.1=Droite 1 +macro.DP_bi_pinceaubiss.2=Pt id\u00e9al 1 de Drte 1 +macro.DP_bi_pinceaubiss.3=Pt id\u00e9al 2 de Drte 1 +macro.DP_bi_pinceaubiss.4=Droite 2 +macro.DP_bi_pinceaubiss.5=Pt id\u00e9al 1 de Drte 2 +macro.DP_bi_pinceaubiss.6=Pt id\u00e9al 2 de Drte 2 + +#v3.7.2 +JSFonctions.Input=Entr\u00e9e +JSFonctions.Print=Affichage +JSFonctions.Println=Affichage 1 ligne +JSFonctions.Alert=Affichage popup +JSFonctions.ifelse=Si... sinon +JSFonctions.switchcase=Test multiple +JSFonctions.for=Faire 20 fois +JSFonctions.while=Tant que +JSFonctions.dowhile=faire{..} tant que() +JSFonctions.function=fonction{...} + +#v3.7.6 +menu.export.embedworkbook=Encapsuler le classeur dans une page HTML +menu.edit.copyapplettag=Copier le tag Applet + +#v3.8 +menu.network=R\u00e9seau +network.menu.launch=Lancer / Arr\u00eater le serveur +network.menu.connect=Connexion au serveur / D\u00e9connexion +network.server.title=Serveur +network.server.ip=IP locale +network.server.launch=D\u00e9marrer +network.server.receive=Recevoir seulement (Global) +network.server.circles=Cercles +network.server.functions=Fonctions +network.server.rtw=Vue en temps r\u00e9el +network.server.send=Envoyer \u00e0 : +network.server.all=Tous +network.client.title=Gestionnaire de connexion +network.client.Name=Nom : +network.client.name= +network.client.ip=IP du serveur : +network.client.connect=Se connecter +network.client.sendwork=Envoyer tout le travail +network.client.share=Partager + + +#v4.0 +JSFonctions.dountil=faire{..} jusqu'\u00e0(); +palette.info.vector3D=Vecteur +palette.info.midpoint3D=Milieu +palette.info.segment3D=Segment 3D +palette.info.line3D=Droite 3D +palette.info.ray3D=Demi-droite 3D +palette.info.area3D=Polygone 3D +props.fixedsegment3D=Longueur3D : +palette.info.bi_3Dtrans=Translation 3D +palette.info.bi_3Dcircle1=Cercle 3D d'axe donn\u00e9 passant par un point +palette.info.bi_3Dcircle2=Cercle 3D axe-direction centre rayon +palette.info.bi_3Dcircle3pts=Cercle 3D passant par trois points +palette.info.bi_3Dplandroite=Intersection d'un plan et d'une droite +palette.info.bi_3Dplanplan=Intersection de deux plans +palette.info.bi_3Dsphererayon=Sph\u00e8re de rayon donn\u00e9 +palette.info.bi_3Dspherepoint=Sph\u00e8re passant par un point +palette.info.bi_3Dspheredroite=Intersection d'une sph\u00e8re et d'une droite +palette.info.bi_3Dsphereplan=Intersection d'une sph\u00e8re et d'un plan +palette.info.bi_3Dspheresphere=Intersection de deux sph\u00e8res +palette.info.bi_3Dsymc=Sym\u00e9trie centrale 3D +palette.info.bi_3Dsymp=Sym\u00e9trie par rapport \u00e0 un plan +palette.info.bi_3Dproj=Projection sur un plan +macro.bi_3Dsymc.0=Centre de sym\u00e9trie ? +macro.bi_3Dsymc.1=Sym\u00e9trique de quel point ? +macro.bi_3Dsymp.0=Plan de sym\u00e9trie : Premier point ? +macro.bi_3Dsymp.1=Plan de sym\u00e9trie : Deuxi\u00e8me point ? +macro.bi_3Dsymp.2=Plan de sym\u00e9trie : Troisi\u00e8me point ? +macro.bi_3Dsymp.3=Sym\u00e9trique de quel point ? +macro.bi_3Dproj.0=Plan de projection : Premier point ? +macro.bi_3Dproj.1=Plan de projection : Deuxi\u00e8me point ? +macro.bi_3Dproj.2=Plan de projection : Troisi\u00e8me point ? +macro.bi_3Dproj.3=Projet\u00e9 de quel point ? +macro.bi_3Dtrans.0=Origine du vecteur ? +macro.bi_3Dtrans.1=Extr\u00e9mit\u00e9 du vecteur ? +macro.bi_3Dtrans.2=Image de quel point ? +macro.bi_3Dcircle1.0=Axe du cercle ? +macro.bi_3Dcircle1.1=Passant par le point ? +macro.bi_3Dcircle2.0=Axe (=direction) du cercle ? +macro.bi_3Dcircle2.1=Centre du cercle ? +macro.bi_3Dcircle2.2=Valeur du rayon ? +macro.bi_3Dcircle3pts.0=Premier point ? +macro.bi_3Dcircle3pts.1=Deuxi\u00e8me point ? +macro.bi_3Dcircle3pts.2=Troisi\u00e8me point ? +macro.bi_3Dplandroite.0=Plan : premier point ? +macro.bi_3Dplandroite.1=Plan : deuxi\u00e8me point ? +macro.bi_3Dplandroite.2=Plan : troisi\u00e8me point ? +macro.bi_3Dplandroite.3=Droite ? +macro.bi_3Dplanplan.0=Plan 1 : premier point ? +macro.bi_3Dplanplan.1=Plan 1 : deuxi\u00e8me point ? +macro.bi_3Dplanplan.2=Plan 1 : troisi\u00e8me point ? +macro.bi_3Dplanplan.3=Plan 2 : premier point ? +macro.bi_3Dplanplan.4=Plan 2 : deuxi\u00e8me point ? +macro.bi_3Dplanplan.5=Plan 2 : troisi\u00e8me point ? +macro.bi_3Dsphererayon.0=Centre de la sph\u00e8re ? +macro.bi_3Dspherepoint.0=Centre de la sph\u00e8re ? +macro.bi_3Dspherepoint.1=Passant par le point ? +macro.bi_3Dspheredroite.0=Sphere ? +macro.bi_3Dspheredroite.1=Droite ? +macro.bi_3Dsphereplan.0=Sphere ? +macro.bi_3Dsphereplan.1=Plan : premier point ? +macro.bi_3Dsphereplan.2=Plan : deuxi\u00e8me point ? +macro.bi_3Dsphereplan.3=Plan : troisi\u00e8me point ? +macro.bi_3Dspheresphere.0=Sph\u00e8re 1 ? +macro.bi_3Dspheresphere.1=Sph\u00e8re 2 ? +palette.info.bi_3Docta=Octa\u00e8dre r\u00e9gulier +macro.bi_3Docta.0=Centre de l'octa\u00e8dre ? +palette.info.bi_3Disoc=Icosa\u00e8dre r\u00e9gulier +macro.bi_3Disoc.0=Centre de l'isoca\u00e8dre ? +palette.info.angle3D=Angle 3D +palette.info.intersection3D=Intersection 3D de lignes +JSeditor.choseGenerator=Interrupteur mode d\u00e9butant (coch\u00e9) / mode normal (pas coch\u00e9) +aerialview=vue d'avion +frontview=vue de face +rightview=vue de droite +backview=retour en vue mobile + +#v4.0.3.2 +JSeditor.tortue=Cr\u00e9er la tortue et/ou l'attacher \u00e0 un point +JSeditor.avancer=Avancer +JSeditor.reculer=Reculer +JSeditor.tournerG=Tourner \u00e0 Gauche +JSeditor.tournerD=Tourner \u00e0 Droite +JSeditor.vitesse=Fixer la vitesse de la tortue +JSeditor.crayonB=Baisser le stylo +JSeditor.crayonH=Lever le stylo +JSeditor.cacher=Cacher la tortue +JSeditor.montrer=Montrer la tortue +JSeditor.orienter=Orienter la tortue +JSeditor.viser=Viser un point +JSeditor.avancer2=Avancer et renvoyer le point d'arriv\u00e9e +JSeditor.avancer3=Avancer et renvoyer le segment parcouru +JSeditor.avancer4=Avancer et renvoyer le point d'arriv\u00e9e et le segment parcouru +JSeditor.reculer2=Reculer et renvoyer le point d'arriv\u00e9e +JSeditor.reculer3=Reculer et renvoyer le segment parcouru +JSeditor.reculer4=Reculer et renvoyer le point d'arriv\u00e9e et le segment parcouru +JSeditor.tournerG3D=Tourner \u00e0 Gauche +JSeditor.tournerD3D=Tourner \u00e0 Droite +JSeditor.pivoterH=Pivoter vers le Haut +JSeditor.pivoterB=Pivoter vers le Bas +JSeditor.pivoterG=Pivoter vers la Gauche +JSeditor.pivoterD=Pivoter vers la Droite + +#v4.2.8 +JSeditor.choseFrench=Interrupteur code en fran\u00e7ais (coch\u00e9) / code en anglais (pas coch\u00e9) \ No newline at end of file diff --git a/eric/docs/JZirkelProperties_gl.properties b/eric/docs/JZirkelProperties_gl.properties new file mode 100644 index 0000000..8fdc422 --- /dev/null +++ b/eric/docs/JZirkelProperties_gl.properties @@ -0,0 +1,213 @@ +# Sample ResourceBundle properties file +menu.file=Archivo +menu.file.new=Novo +menu.file.load=Abrir... +menu.file.save=Registrar +menu.file.saveas=Registrar como... +menu.file.exportpng=Exportar vers PNG +menu.file.exporteps=Exportar vers EPS +menu.file.quit=Sa\u00EDr +menu.edit=Edici\u00F3n +menu.edit.copy=Copiar +menu.edit.move=mover +menu.edit.rename=Renomear +menu.edit.edit=Modificar +menu.edit.hide=Ocultar +menu.edit.delete=Suprimir +menu.display=Mostrar +menu.display.hidden=Mostrar/Ocultar os obxectos invisibles +menu.display.grid=Mostrar/Ocultar a grella +menu.display.finegrid=Eixes soamente +menu.display.leftsnap=Grella magn\u00E9tica +menu.display.manage_macros=Inspeccioar macros +menu.display.history_panel=Hist\u00F3rico +menu.display.help_panel=Panel de axuda +menu.display.properties_panel=Inspeccionar obxectos +menu.display.small= Iconos pequenos +menu.display.medium= Iconos medianos +menu.display.large=Iconos grandes +menu.display.restrictedpalette=Fixar a paleta restrinxida +menu.display.restrictedpaletteedit=Modificar la paleta restrinxida +menu.display.restrictmessage=
Esta utilidade permite visualizar a paleta restrinxida.

Esto solo afecta ao archivo en uso.

Ao gardar, vostede poder\u00E1 elexir a opci\u00F3n de gardar tam\u00E9n a figura restrinxida;.
cr\u00E9anse ent\u00F3n dous arquivos: O primeiro (.zir) abrirase en modo normal, e
o segundo (.r.zir) en modo restrinxido.
+menu.macros=Macros +menu.special=Especial +menu.special.newmacro=Crear macro +menu.special.loadmacros=Abrir un arquivo de macros... +menu.special.definejob=Definir un exercicio +menu.special.loadjob=Abrir un exercicio... +menu.special.jobcomment=Redactar o texto do exercicio +menu.special.testjob=Revisar este exercicio +menu.special.savejob=Gardar el exercicio +menu.special.export=Crear un arquivo HTML e velo con navegador +menu.special.exporttemplate=Exportar a HTML coas plantillas +menu.help=Axuda +menu.help.about=Acerca de CaRMetal... +menu.help.info=Axuda contextual +menu.help.url0=P\u00E1xina de CaRMetal +menu.help.url1=P\u00E1xina de CARzine +menu.help.url2=P\u00E1xina oficial de C.a.R. + +filedialog.options=Opciones de gardado +filedialog.saveas=Gardar construcci\u00F3n +filedialog.alsorestricted=Gardar tam\u00E9n as restrcci\u00F3ns da construcci\u00F3n +filedialog.restrictedmessage=Est\u00E1 a traballar agora nunha sesi\u00F3n restrinxida,
a construcci\u00F3n gardarase en modo restrinxido. +filedialog.filefilter=Arquivo CaR (.zir) +filedialog.compressedfilefilter=Arquivo CaR comprimido (.zirz) +filedialog.macrofilefilter=Arquivo de macros (.mcr) +filedialog.savemessage1=O arquivo :\n +filedialog.savemessage2=\xa existe, \u00BFest\u00E1 seguro de querer reemplazalo ? + +palette.file=Arquivo +palette.edit=Edici\u00F3n +palette.construction=Construci\u00F3n +palette.aspect=Aspecto e color +palette.history=Historico +palette.sizes=Tama\u00F1o +palette.sizes.point=Puntos +palette.sizes.line=Li\u00F1as +palette.sizes.arrow=Flechas +palette.sizes.font=Fontes +palette.prec=Precisi\u00F3n num\u00E9rica +palette.prec.lengths=Lonxitude +palette.prec.edit=Expresi\u00F3ns +palette.prec.angles=\u00C1ngulos +palette.colors=Fondo: cor e imaxe +palette.colors.saturated1=Cores saturados +palette.colors.desaturated1=Cores desaturados +palette.colors.saturated2=Cores saturados 2 +palette.colors.desaturated2=Cores desaturados 2 +palette.colors.constants=Cores Web +palette.image.fileerror=Debe gardar a construci\u00F3n antes de usar esta ferramenta.

Despois, a imaze que elixa debe figurar
na mesma ubicaci\u00F3n que esta figura. + +palette.info.vector=Vector +palette.info.image3=Insertar unha imaxe utilizando 2 ou 3 puntos +palette.info.background=Elexir/borrar unha imaxe de fondo +palette.info.imcenter=Centrar a imaxe de fondo +palette.info.imstretch=Axeitar o tama\u00F1o da imaxe a vent\u00E1 da construcci\u00F3n +palette.info.imtile=Fondo con mosaico de imaxe +palette.info.copy=Copiar a vent\u00E1 de construcci\u00F3n no portapapeis palette.info.exportpng=Exportar a construcci\u00F3n da vent\u00E1 actual ao formato PNG +palette.info.exportpng= Exportar a construcci\u00F3n da vent\u00E1 actual ao formato PNG +palette.info.exporteps= Exportar a construcci\u00F3n da vent\u00E1 actual ao formato EPS +palette.info.newmacro=Crear unha nova macro +palette.info.loadmacros=Abrir un arquivo de macros +palette.info.manage_macros=Mostrar/Ocultar o panel de xestion de macros +palette.info.properties_panel=Mostrar/Ocultar o panel de propiedades dos obxectos +palette.info.history_panel=Mostrar/ Ocultar o panel de hist\u00F3rico da construcci\u00F3n +palette.info.help_panel=Mostrar/ Ocultar el panel de axuda contextual + + +macros.untitledmacro=Macro sen nme +macros.untitledfolder=Cartafol sen nome +macros.emptynode=-- Vac\u00EDo -- +macros.addfolder=Engadir unha nova carpeta +macros.deleteselected=Suprimir as macros seleccioadas +macros.renamemacro=Cambear o nome da macro seleccioada +macros.recordmacro=Gardar unha macro +macros.initials=\u00BFObxectos iniciais? +macros.pleaseselect=!Seleccione, por favor! +macros.finals=\u00BFObxectos finais? +macros.cancel=\u00BFCancelar? +macros.popup.run=Arrancar a macro +macros.popup.rename= Renomear +macros.popup.delete=Borrar +macros.popup.addtolibrary=Engadir \u00E1 biblioteca +macros.popup.removefromlibrary=Quitar da biblioteca +macros.popup.publish=Incluir na figura +macros.popup.notpublish=Non incluir na figura +macros.popup.saveas=Gardar como... +macros.popup.properties=Amosar as propiedades +macros.popup.duplicate=Duplicar +macros.savedlog.buttonok=Gardar no arquivo de macro(s) +macros.question.delete=\u00BFEst\u00E1 seguro de querer borrar estas macros ? + +rene.zirkel.objects.PointObject=Pto. +rene.zirkel.objects.PrimitiveCircleObject=Cir. +rene.zirkel.objects.PrimitiveLineObject=Lin. +rene.zirkel.objects.ExpressionObject=Exp. +rene.zirkel.objects.FixedAngleObject=AngF. +rene.zirkel.objects.SegmentObject=Seg. +rene.zirkel.objects.RayObject=Ray +rene.zirkel.objects.TwoPointLineObject=Rec. +rene.zirkel.objects.FunctionObject=Func. +rene.zirkel.objects.AreaObject=\u00C1rea + +mi.pal.name=Revisar macros +mi.name=Nome : +mi.comment=Comentario : +mi.properties=Propiedades dos obxectos iniciais : +mi.hideproperties=Propiedades dos obxectos finais : +mi.hideduplicates=Buscar duplicados +mi.apply=Aplicar +mi.tab.type=Tipo +mi.tab.name=Nome +mi.tab.prompt=invitaci\u00F3n +mi.tab.fix=\u00BFFixar ? +mi.tab.ask=\u00BFasociar? +mi.error.initial=Error : a lo menos un obxecto inicial\ndebe estar libre (ni fijo, ni dependiente)\n\nNingunha modificaci\u00F3n\nser\u00E1 gardada nesta macro. + +props.help=Para poder visualizar as propiedades dun obxecto clicar eiqu\u00ED co bot\u00F3n dereito.

Si se crea un novo obxecto contendo estes puntos, poder\u00E1 editar as s\u00FAas propiedades durante o proceso. +props.name=Nome : +props.alias=Alias : +props.unit=Unidades : +props.fix=Fixar: +props.expl=Explicaci\u00F3n : +props.belongto=copiar : +props.conditional=Apariencia : +props.solid=Opaco : +props.hidden=Cach\u00E9 : +props.normal=Normal : +props.bold=s\u00F3lido: +props.thin=Punteado : +props.black=Negro : +props.green=Verde : +props.blue=Azul : +props.brown=Marr\u00F3n : +props.cyan=Cyan : +props.red=Roxo : +props.showasslider=Cursor +props.error=Error de sintaxis en esta expresi\u00F3n.
Vaise reiniciar. +props.cartesian=Funci\u00F3n cartesiana +props.parametric= Funci\u00F3n param\u00E9trica +props.functiontype=Tipo : +props.killarc=Arco cortado +props.arc=Arco +props.release=liberar +props.bind=asociar +props.setaway=Lexos de +props.setclose=Cerca de + +# v1.3 : +props.grid=Incremento : +props.inside=Sobre el objeto: +props.pointsonly=Soamente con dous puntos: +props.step=Paso : +palette.grid=Aspecto da grella +leftpanel.macros=Panel de xesti\u00F3n de macros +leftpanel.properties=Panel de propiedades dos obxectos +leftpanel.history=Panel de historico +leftpanel.help=Panel de axuda +selectpopup.whatobject=\u00BFQu\u00E9 obxecto ? +selectpopup.RightClick=Editar +selectpopup.MoverTool=Desplazar +selectpopup.HiderTool=Mostrar/Ocultar +selectpopup.DeleteTool=Suprimir +selectpopup.RenamerTool=Renomear +selectpopup.EditTool=Editar +selectpopup.SetParameterTool=Macro-inciais : +selectpopup.SetTargetsTool=Macro-finais : +palette.info.locus=Lugar do punto+ desenvolvemento da recta + + +# v1.4 : +menu.special.savezirset=Crear un diaporama +filedialog.openfolder.title=Dialogo de selecci\u00F3n do cartafol do diaporama +filedialog.openfolder.approve=Seleccionar o cartafol do diaporama +filedialog.openfolder.saveicons=Gardar tam\u00E9n as restricc\u00F3ns de iconos +slideshow.next=seguinte +slideshow.previous=anterior +slideshow.download=Cargar o arquivo +slideshow.signature=Diaporama realizado con + +# v1.5 : +menu.language=Idiomas +menu.help.url3=Traducir CaRMetal \ No newline at end of file diff --git a/eric/docs/JZirkelProperties_it.properties b/eric/docs/JZirkelProperties_it.properties new file mode 100644 index 0000000..c59724e --- /dev/null +++ b/eric/docs/JZirkelProperties_it.properties @@ -0,0 +1,481 @@ +# Esempio di file di propriet\u00E0 ResourceBundle +menu.file=File +menu.file.new=Nuovo +menu.file.load=Apri... +menu.file.save=Salva +menu.file.saveas=Salva con nome... + +menu.file.exportpng=Esporta in PNG +menu.file.exporteps=Esporta in EPS +menu.file.quit=Esci +menu.edit=Modifica +menu.edit.copy=Copia +menu.edit.move=Sposta +menu.edit.rename=Rinomina +menu.edit.edit=Modifica +menu.edit.hide=Nascondi +menu.edit.delete=Elimina +menu.display=Visualizza +menu.display.hidden=Mostra/Nascondi oggetti +menu.display.grid=Mostra/Nascondi griglia +menu.display.finegrid=Solo assi +menu.display.leftsnap=Blocca con trascinamento pulsante sinistro +menu.display.manage_macros=Ispettore macro +menu.display.history_panel=Cronologia +menu.display.help_panel=Guida +menu.display.properties_panel=Pannello delle propriet\u00E0 dell'oggetto +menu.display.small=Icone piccole +menu.display.medium=Icone medie +menu.display.large=Icone grandi +menu.display.restrictedpalette=Mostra tavolozza limitata +menu.display.restrictedpaletteedit=Modifica tavolozza limitata +menu.display.restrictmessage=
Questa voce consente la visualizzazione della tavolozza limitata.

Si riferisce esclusivamente al file corrente :

quando si salva in modalit\u00E0 'salva con nome' \u00E8 possibile scegliere l'opzione 'salva anche la figura limitata'
verranno creati due file:il primo (.zir) si aprir\u00E0 in modalit\u00E0 'normale', e
il secondo (.r.zir) in modalit\u00E0 limitata
+menu.macros=Macro +menu.special=Speciale +menu.special.newmacro=Nuova macro +menu.special.loadmacros=Apri file macro... +menu.special.definejob=Definisci un Problema +menu.special.loadjob=Carica un Problema ... +menu.special.jobcomment=Imposta il testo del Problema ... +menu.special.testjob=Verifica questo Problema +menu.special.savejob=Salva come Problema ... +menu.special.export=Crea file HTML e anteprima nel browser +menu.special.exporttemplate=Esporta in HTML con modelli +menu.help=Guida +menu.help.about=Informazioni su CaRMetal... +menu.help.info=Guida attiva +menu.help.url0=Vai al sito di CaRMetal +menu.help.url1=Vai al sito di CARzine +menu.help.url2=Vai al sito ufficiale di C.a.R. + +filedialog.saveas=Salva figura +filedialog.alsorestricted=Salva anche la figura limitata +filedialog.options=Opzioni di salvataggio +filedialog.restrictedmessage=Questa \u00E8 una sessione limitata,
quindi la figura verr\u00E0 salvata in modalit\u00E0 limitata +filedialog.filefilter=File CaR (.zir) +filedialog.compressedfilefilter=File CaR compresso (.zirz) +filedialog.macrofilefilter=File macro di CaR (.mcr) +filedialog.savemessage1=File :\n +filedialog.savemessage2=\ngi\u00E0 esistente. Sostituire il file ? + +palette.file=File +palette.edit=Modifica +palette.construction=Costruzione +palette.aspect=Aspetto e colore +palette.history=Cronologia +palette.sizes=Dimensioni +palette.sizes.point=Punto +palette.sizes.line=Retta +palette.sizes.arrow=Freccia +palette.sizes.font=Carattere +palette.prec=Precisione numerica +palette.prec.lengths=Lunghezze +palette.prec.edit=Espressioni +palette.prec.angles=Angoli +palette.colors=Colore e immagine di sfondo +palette.colors.saturated1=Colori saturati +palette.colors.desaturated1=Colori desaturati +palette.colors.saturated2=Colori saturati 2 +palette.colors.desaturated2=Colori desaturati 2 +palette.colors.constants=Costanti Web +palette.image.fileerror=Salvare la figura prima di utilizzate questo strumento

In seguito, la figura da selezionare dovr\u00E0 essere
nella stessa cartella. + +palette.info.vector=Vettore +palette.info.image3=Inserisci immagine+con 2 o 3 punti +palette.info.background=Scegli/elimina l'immagine di sfondo +palette.info.imcenter=Centra l'immagine di sfondo +palette.info.imstretch=Adatta l'immagine di sfondo+alla finestra della costruzione +palette.info.imtile=Affianca l'immagine di sfondo +palette.info.copy=Copia la finestra della costruzione +palette.info.exportpng=Esporta la finestra della+costruzione in formato png +palette.info.exporteps=Esporta la finestra dalla+costruzione in formato eps +palette.info.newmacro=Crea una nuova macro +palette.info.loadmacros=Carica un file macro +palette.info.manage_macros=Mostra/nascondi il pannello delle macro +palette.info.properties_panel=Mostra/nascondi il pannello delle propriet\u00E0+degli oggetti +palette.info.history_panel=Mostra/nascondi il pannello della cronologia+della costruzione +palette.info.help_panel=Mostra/nascondi il pannello della guida attiva + + + +macros.untitledmacro=Macro senza nome +macros.untitledfolder=Cartella senza nome +macros.emptynode=-- Vuoto -- +macros.addfolder=Aggiungi nuova cartella +macros.deleteselected=Elimina macro selezionate +macros.renamemacro=Rinomina macro selezionate +macros.recordmacro=Registra macro +macros.initials=Oggetti iniziali ? +macros.pleaseselect=Scegliere ! +macros.finals=Oggetti finali ? +macros.cancel=Annulla ? +macros.popup.run=Esegui macro +macros.popup.rename=Rinomina +macros.popup.delete=Elimina +macros.popup.addtolibrary=Aggiungi alla libreria +macros.popup.removefromlibrary=Rimuovi dalla libreria +macros.popup.publish=Includi nella figura +macros.popup.notpublish=Non includere nella figura +macros.popup.saveas=Salva con nome... +macros.popup.properties=Mostra propriet\u00E0 +macros.popup.duplicate=Duplicato +macros.savedlog.buttonok=Salva file macro +macros.question.delete=Eliminare le macro ? + +rene.zirkel.objects.PointObject=Pt +rene.zirkel.objects.PrimitiveCircleObject=Cir +rene.zirkel.objects.PrimitiveLineObject=Rt +rene.zirkel.objects.ExpressionObject=Esp. +rene.zirkel.objects.FixedAngleObject=AngF +rene.zirkel.objects.SegmentObject=Seg. +rene.zirkel.objects.RayObject=SemRt +rene.zirkel.objects.TwoPointLineObject=Rt +rene.zirkel.objects.FunctionObject=Fz +rene.zirkel.objects.AreaObject=Area + + +mi.pal.name=Ispettore macro +mi.name=Nome : +mi.comment=Commento : +mi.properties=Propriet\u00E0 parametri : +mi.hideproperties=Propriet\u00E0 destinazioni : +mi.hideduplicates=Nascondi duplicati +mi.apply=Applica +mi.tab.type=Tipo +mi.tab.name=Nome +mi.tab.prompt=Prompt +mi.tab.fix=Fissa ? +mi.tab.ask=Chiedi ? +mi.error.initial=Errore : almeno un parametro \ndeve essere libero (non fissato, non chiedere)\n\nQuesta macro non verr\u00E0 modificata + +props.help=Per visualizzare le propriet\u00E0 fare clic con il pulsante destro del mouse su un oggetto.

Se viene creato un nuovo oggetto mentre questo pannello \u00E8 aperto, \u00E8 possibile modificarne le propriet\u00E0 durante il processo di creazione. +props.name=Nome : +props.alias=Alias : +props.unit=Unit\u00E0 : +props.fix=Fissa : +props.expl=Spiegazione : +props.belongto=Livello : +props.conditional=Aspetto : +props.solid=Solido : +props.hidden=Nascosto : +props.normal=Normale : +props.bold=Spesso : +props.thin=Punteggiato : +props.black=Nero : +props.green=Verde : +props.blue=Blu : +props.brown=Marrone : +props.cyan=Azzurro : +props.red=Rosso : +props.showasslider=Slider : +props.error=Questa espressione contiene un errore di sintassi.
L'espressione verr\u00E0 reinizializzata +props.cartesian=Funzione cartesiana +props.parametric=Funzione parametrica +props.functiontype=Tipo : +props.killarc=No arco +props.arc=Arco +props.release=Rilascia +props.bind=Vincola +props.setaway=Imposta lontano +props.setclose=Imposta vicino + + +# v1.3 : +props.grid=Incremento : +props.inside=Dentro all'oggetto : +props.pointsonly=Solo punti : +props.step=Passo : +palette.grid=Aspetto della griglia +leftpanel.macros=Pannello delle macro +leftpanel.properties=Pannello delle propriet\u00E0 +leftpanel.history=Pannello della cronologia +leftpanel.help=Pannello della Guida +selectpopup.whatobject=quale oggetto ? +selectpopup.RightClick=Seleziona +selectpopup.MoverTool=Sposta +selectpopup.HiderTool=Mostra/nascondi +selectpopup.DeleteTool=Elimina +selectpopup.RenamerTool=Rinomina +selectpopup.EditTool=Modifica +selectpopup.SetParameterTool=Oggetti iniziali della macro: +selectpopup.SetTargetsTool=Oggetti finali della macro: +palette.info.locus=Luogo di punti+curva inviluppo + +# v1.4 : +menu.special.savezirset=Crea presentazione... +filedialog.openfolder.title=Selezione della cartella della presentazione +filedialog.openfolder.approve=Selezionare la cartella della presentazione +filedialog.openfolder.saveicons=Salva anche le icone limitate +slideshow.next=successivo +slideshow.previous=precedente +slideshow.download=Scarica file +slideshow.signature=Presentazione creata con + +# v1.5 : +menu.language=Lingue +menu.language.de=Tedesco +menu.language.en=Inglese +menu.language.fr=Francese +menu.language.es=Spagnolo +menu.language.gl=Galiziano +menu.language.zh_TW=Cinese (Tradizionale) +menu.help.url3=Traduci CaRMetal +menu.display.smartboard=Modalit\u00E0 smartboard + +# v1.6 : +menu.language.no=Norvegese +palette.info.bi_syma=Simmetria assiale +palette.info.bi_symc=Simmetria centrale +palette.info.bi_trans=Traslazione +palette.info.bi_med=Asse di un segmento +palette.info.bi_biss=Bisettrice +palette.info.bi_circ=Circonferenza per 3 punti +palette.info.bi_arc=Arco di circonferenza per 3 punti +palette.info.bi_t_align=Punti allineati ? +palette.info.bi_t_para=Rette parallele ? +palette.info.bi_t_perp=Rette perpendicolari ? +palette.info.bi_t_equi=Equidistante da due punti ? +palette.info.bi_t_app=Appartiene ad una retta ? +palette.info.bi_t_conf=Punti coincidenti ? +macro.bi_syma.0=Asse di simmetria ? +macro.bi_syma.1=Punto da riflettere ? +macro.bi_symc.0=Centro di simmetria ? +macro.bi_symc.1=Punto da riflettere ? +macro.bi_trans.0=Primo punto del vettore ? +macro.bi_trans.1=Secondo punto del vettore ? +macro.bi_trans.2=Punto da traslare ? +macro.bi_med.0=Primo punto del segmento ? +macro.bi_med.1=Secondo punto del segmento ? +macro.bi_biss.0=Primo punto ? +macro.bi_biss.1=Vertice dell'angolo ? +macro.bi_biss.2=Ultimo punto ? +macro.bi_circ.0=Primo punto ? +macro.bi_circ.1=Secondo punto ? +macro.bi_circ.2=Terzo punto ? +macro.bi_t_para.0=Prima retta ? +macro.bi_t_para.1=Seconda retta ? +macro.bi_t_equi.0=Questo punto \u00E8 equidistante ... +macro.bi_t_equi.1=Da questo punto ... +macro.bi_t_equi.2=E questo punto ? +macro.bi_t_app.0=Quale punto ? +macro.bi_t_app.1=Su quale retta (o segmento) giace ? +macro.bi_t_conf.0=Quale punto ? +macro.bi_t_conf.1=Su quale punto ? +macro.bi_t_align.text0=I punti sono allineati +macro.bi_t_align.text1=I punti non sono allineati +macro.bi_t_para.text0=Gli oggetti sono paralleli +macro.bi_t_para.text1=Gli oggetti non sono paralleli +macro.bi_t_perp.text0=Gli oggetti sono perpendicolari +macro.bi_t_perp.text1=Gli oggetti non sono perpendicolari +macro.bi_t_equi.text0=I punti sono equidistanti +macro.bi_t_equi.text1=I punti non sono equidistanti +macro.bi_t_app.text0=Il punto appartiene all'oggetto +macro.bi_t_app.text1=Il punto non appartiene all'oggetto +macro.bi_t_conf.text0=I due punti sono coincidenti +macro.bi_t_conf.text1=I due punti sono distinti +palette.test=Test + +# v1.7 : +filedialog.openfolder.appletsize=Dimensione dell'applet : +filedialog.openfolder.actualsize=Dimensione attuale +filedialog.openfolder.other=Altro... +filedialog.openfolder.selected=Cartella selezionata : +filedialog.openfolder.cancel=Annulla +menu.file.exportsvg=Esporta in SVG +menu.language.sl=Sloveno +menu.language.nl=Olandese +menu.language.pt=Portoghese +props.vars=Variabili : +menu.objects.points=Punti +menu.objects.lines=Rette +menu.objects.segments=Segmenti +menu.objects.circles=Circonferenze e coniche +menu.objects.angles=Angoli +menu.objects.tracks=Tracce e luoghi +menu.objects.functions=Funzioni ed espressioni +palette.info.function_u=Funzione definita dall'utente +palette.info.function=Funzione+o curva parametrica +props.superhidden=Completamente nascosto : +props.showvalue=Mostra valore : +props.showname=Mostra nome : +props.background=Sfondo : +macro.bi_expression.0=Ancora il punto ? + +# v1.9a : +menu.help.licence=Licenza... +licence.txt=

Questo programma \u00E8 un software libero sotto licenza GNU-GPL. Questo significa che \u00E8 possibile ridistribuire il programma e/o modificarlo secondo i termini della licenza pubblicata da Free Software Foundation;
Vedere :

+ + +# v2.0 : +menu.special.theme=Temi +menu.special.theme.gray=Metallo lucidato +menu.special.theme.brushed=Metallo spazzolato +menu.special.options=Preferenze... +menu.special.options.sizes=Dimensioni +menu.special.options.sizes.minpointsize=Dimensione punto +menu.special.options.sizes.minlinesize=Dimensione retta +menu.special.options.sizes.arrowsize=Dimensione freccia +menu.special.options.sizes.minfontsize=Dimensione carattere +menu.special.options.sizes.digits.lengths=Precisione lunghezza +menu.special.options.sizes.digits.edit=Precisione espressione +menu.special.options.sizes.digits.angles=Precisione angolo +menu.special.options.colors=Colori +menu.special.options.others=Altro +menu.special.options.others.undock=\u00C8 possibile sbloccare le tavolozze + +# v2.1 : +menu.file.close=Chiudi finestra + +# v2.3 : +alert.toomuchwins=Ci sono troppe finestre aperte :
chiuderne alcune prima di aprire
una nuova finestra + +# v2.4 : +menu.file.new3D=Nuova figura 3D +palette.3D=3D +palette.info.bi_3Dcoords=coordinate 3D +macro.bi_3Dcoords.0=Ancora il punto ? +palette.info.bi_3Dcube=Cubo +macro.bi_3Dcube.0=Centro del cubo ? +palette.info.bi_3Darete=spigoli 3D +macro.bi_3Darete.0=Primo punto ? +macro.bi_3Darete.1=Secondo punto ? +macro.bi_3Darete.2=Terzo punto ? +macro.bi_3Darete.3=Quarto punto ? +palette.info.bi_3Dtetra=Tetraedro regolare +macro.bi_3Dtetra.0=Centro del tetraedro ? +menu.newdoc=Nuovo +menu.language.it=Italiano + +# v2.5.5 : +palette.aspect.label.text_title=Aspetto di +palette.aspect.label.point=punti +palette.aspect.label.line=rette +palette.aspect.label.segment=segmenti +palette.aspect.label.circle=circonferenze +palette.aspect.label.angle=angoli +palette.aspect.label.area=poligoni +palette.aspect.label.text=testi +palette.info.bi_3Ddode=Dodecaedro regolare +macro.bi_3Ddode.0=Centro del dodecaedro ? + +# v2.7 : +palette.aspect.label.pointshape=Forma e nome dei punti : +palette.aspect.label.locus=luoghi +menu.edit.deleteall=Elimina tutto + + +# v2.7.1 : +java.old.message=Impossibile avviare CaRMetal, la versione disponibile di Java \u00E8 obsoleta +java.old.quit=Esci +java.old.go=Scarica la nuova versione di Java +palette.info.boundedpoint=Posiziona un punto in un piano+o sulla faccia di un poliedro + +#v2.7.2 : +user.foldername=Profilo Utente CarMetal + +#v2.8 +props.fixedray=Semiretta : +props.fixedsegment=Lunghezza : +props.fixedangle=Angolo : +props.expl=Commenti : +props.aspecttab=Aspetto +props.numerictab=Numerico +props.conditionaltab=Condizionale +props.thick=Spessore : +props.popup.special=Caratteri speciali +props.popup.functions=Funzioni predefinite +props.popup.latex=Comandi LaTeX +menu.language.pl=Polacco + +#v2.8.1 +props.fixedinwindow=Collegato alla finestra + +#v2.8.5 +palette.controls=Controlli +props.ctrlshowvalue=Mostra valore +props.ctrlsnap=Blocca sui segni di spunta +props.ctrlshowticks=Mostra segni di spunta +props.ctrltickspacing=Incremento : +palette.info.ctrl_edit=Modifica, muovi o ridimensiona il controllo +palette.info.ctrl_chkbox=Aggiungi casella di controllo +palette.info.ctrl_popup=Aggiungi menu a scomparsa +palette.info.ctrl_slider=Aggiungi cursore + +#v2.8.6 +props.trackdmin=Numero di passi : +opendialog.preview=Anteprima : +pngdialog.options=Opzioni di esportazione : +pngdialog.scale=Scala : +pngdialog.originsize=Dimensioni originali : +pngdialog.scaledsize=Dimensione in scala : + +#v2.8.7 +canvas.3D.floor=Piano +canvas.3D.system=Sistema di coordinate +canvas.3D.rightclic=Utilizzare clic destro e trascinamento per ruotare il sistema di coordinate + + +#v2.8.8 +palette.info.equationxy=Curva implicita +props.equationxy=Equazione : +props.equationxychooser=Precisione : +palette.function=Funzioni e luogo + +#v2.8.9 +menu.edit.deletealltracks=Cancella tracce +menu.edit.deactivatealltracks=Disattiva tracce +props.tracks=Attiva tracce +menu.edit.zoom=Zoom o muovi + +#v2.9.0 +menu.windows=Finestra + +#v2.9.1 +contexthelp.seealso=Vedere anche : + +#v2.9.2 +menu.language.pt_BR=Brasiliano +menu.display.restrictmessage.dontdisplay=Non visualizzare pi\u00F9 questo messaggio + +#v2.9.6 +props.magnetmessage=Fare clic sugli oggetti da aggiungere / rimuovere dalla lista magnetica +props.magnetobj=Oggetti magnetici +props.magnetpix=Attrazione (20 px) : +props.show=Mostra + +#v2.9.7 +palette.info.ctrl_txtfield=Aggiungi casella di immissione numerica +palette.info.ctrl_button=Aggiungi pulsante + +#v2.9.8.4 +JSerror.title=Errore di sintassi +JSerror.line=linea +JSerror.pointcoords=Errore di sintassi nelle coordinate del punto +JSerror.interactiveinput=Errore durante la selezione dell'oggetto +JSerror.notfound=Oggetto non trovato +JSerror.notgoodtype=Impossibile applicare a questo tipo di oggetto +JScmd.inputmessage=Domanda utente ? +JScmd.promptmessage=Messaggio utente... +menu.js=Javascript +menu.js.script=Apri file javascript... +menu.js.command=Apri l'editor degli script +JSeditor.title=Editor Javascript + +#v3.0 +JSeditor.save=Salva script +JSeditor.open=Apri script +JSeditor.opendlogmsg=Apri script +JSeditor.savedlogmsg=Salva script +JSeditor.format=Formato script +JSeditor.restore=Elimina l'ultima esecuzione +JSeditor.run=Esegui script +JSeditor.help=Guida per la sintassi +JSEditor.comment=Selezione Commenta/Non commenta +JSEditor.savequestion=Sono state apportate modifiche allo script : salvare ? +menu.language.ar_TN=Arabo + +# v3.1.1 +menu.js.define=Definisci la cartella degli script ... +menu.js.dumb=Esegui gli script preferiti senza l'editor +JSeditor.opendfavfolder=Seleziona la cartella degli script +JSeditor.saveas=Salva script come... diff --git a/eric/docs/JZirkelProperties_nl.properties b/eric/docs/JZirkelProperties_nl.properties new file mode 100644 index 0000000..8108172 --- /dev/null +++ b/eric/docs/JZirkelProperties_nl.properties @@ -0,0 +1,297 @@ +# Sample ResourceBundle properties file +menu.file=Bestand +menu.file.new=Nieuw +menu.file.load=Open... +menu.file.save=Bewaar +menu.file.saveas=Bewaar als... + +menu.file.exportpng=Exporteer als PNG +menu.file.exporteps=Exporteer als EPS +menu.file.quit=Stop +menu.edit=Wijzig +menu.edit.copy=Kopieer +menu.edit.move=Verplaats +menu.edit.rename=Hernoem +menu.edit.edit=Wijzig +menu.edit.hide=Verberg +menu.edit.delete=Verwijder +menu.display=Toon +menu.display.hidden=Toon/Verberg voorwerpen +menu.display.grid=Toon/Verberg raster +menu.display.finegrid=Enkel as +menu.display.leftsnap=Snap met slepen met linkermuistoets +menu.display.manage_macros=Macro Inspector +menu.display.history_panel=Geschiedenis +menu.display.help_panel=Help +menu.display.properties_panel=Voorwerpeigenschappen venster +menu.display.small=Kleine iconen +menu.display.medium=Medium iconen +menu.display.large=Grote iconen +menu.display.restrictedpalette=Toon beperkt palet +menu.display.restrictedpaletteedit=Wijzig beperkt palet +menu.display.restrictmessage=
Dit item laat je toe om het beperkte palet te tonen.

Het heeft alleen betrekking op het huidige bestand:

als je 'bewaar als' uitvoert, is het mogelijk om te kiezen voor 'bewaar ook de beperkte figuur'.
Er worden dan twee bestanden aangemaakt: het eerste (.zir) zal in 'normale modus' openen, en
het tweede (.r.zir) in 'beperkte modus'
+menu.macros=Macro's +menu.special=Speciaal +menu.special.newmacro=Nieuwe macro +menu.special.loadmacros=Open Macrobestand... +menu.special.definejob=Definieer een opgave +menu.special.loadjob=Laad een opgave ... +menu.special.jobcomment=Geef opgavetekst ... +menu.special.testjob=Test deze opgave +menu.special.savejob=Bewaar als opgave ... +menu.special.export=Maak HTML-bestand en voorvertoning in browser +menu.special.exporttemplate=HTML export met templates +menu.help=Help +menu.help.about=Over CaRMetal... +menu.help.info=Contexthelp +menu.help.url0=Ga naar CaRMetal site +menu.help.url1=Ga naar CARzine site +menu.help.url2=Ga naar offici\u00EBle C.a.R. site + +filedialog.saveas=Bewaar tekening +filedialog.alsorestricted=Bewaar ook beperkte figuur +filedialog.options=Opties bewaren +filedialog.restrictedmessage=Je werkt in een sessie met beperkingen,
dus wordt je figuur bewaard in beperkte modus. +filedialog.filefilter=CaR-bestand (.zir) +filedialog.compressedfilefilter=Gecomprimeerd CaR-bestand (.zirz) +filedialog.macrofilefilter=CaR Macro-bestand (.mcr) +filedialog.savemessage1=Bestand :\n +filedialog.savemessage2=\nbestaat al. Wil je het echt vervangen? + +palette.file=Bestand +palette.edit=Wijzig +palette.construction=Constructie +palette.aspect=Aspectkleur +palette.history=Geschiedenis +palette.sizes=Groottes +palette.sizes.point=Punt +palette.sizes.line=Lijn +palette.sizes.arrow=Pijl +palette.sizes.font=Lettertype +palette.prec=Numerieke nauwkeurigheid +palette.prec.lengths=Lengtes +palette.prec.edit=Uitdrukkingen +palette.prec.angles=Hoeken +palette.colors=Achtergrondkleur afbeelding +palette.colors.saturated1=Gesatureerde kleuren +palette.colors.desaturated1=Gedesatureerde kleuren +palette.colors.saturated2=Gesatureerde kleuren 2 +palette.colors.desaturated2=Gedesatureerde kleuren 2 +palette.colors.constants=Webconstanten +palette.image.fileerror=Voordat je dit werktuig gebruikt moet je deze tekening bewaren.

De figuur die je daarna kiest moet
in dezelfde map zitten. + +palette.info.vector=Vector +palette.info.image3=Voeg afbeelding met 2 of 3 punten in +palette.info.background=Kies/Wis achtergrondafbeelding +palette.info.imcenter=Centreer de achtergrondafbeelding +palette.info.imstretch=Rek de achtergrondafbeelding schermvullend uit +palette.info.imtile=Herhaal de achtergrondafbeelding +palette.info.copy=Kopieer het constructievenster +palette.info.exportpng=Exporteer het constructievenster als png +palette.info.exporteps=Exporteer het constructievenster als eps +palette.info.newmacro=Maak een nieuwe macro +palette.info.loadmacros=Laad een macrobestand +palette.info.manage_macros=Toon/Verberg het macrovenster +palette.info.properties_panel=Toon/Verberg het voorwerpeigenschappen venster +palette.info.history_panel=Toon/Verberg het constructiegeschiedenis venster +palette.info.help_panel=Toon/Verberg het contextuele helpvenster + + + +macros.untitledmacro=Naamoze macro +macros.untitledfolder=Naamloze map +macros.emptynode=-- Leeg -- +macros.addfolder=Voeg nieuwe map toe +macros.deleteselected=Verwijder geselecteerde macro's +macros.renamemacro=Hernoem geselecteerde macro's +macros.recordmacro=Neem macro op +macros.initials=Beginvoorwerpen? +macros.pleaseselect=AUB selecteren! +macros.finals=Eindobjecten? +macros.cancel=Annuleer? +macros.popup.run=Voer macro uit +macros.popup.rename=Hernoem +macros.popup.delete=Verwijder +macros.popup.addtolibrary=Voeg toe aan bibliotheek +macros.popup.removefromlibrary=Verwijder uit bibliotheek +macros.popup.publish=Voeg toe aan de tekening +macros.popup.notpublish=Voeg niet toe aan de tekening +macros.popup.saveas=Bewaar als... +macros.popup.properties=Toon eigenschappen +macros.popup.duplicate=Dupliceer +macros.savedlog.buttonok=Bewaar macrobestand +macros.question.delete=Ben je zeker dat je deze macro's wil verwijderen? + +rene.zirkel.objects.PointObject=Pt +rene.zirkel.objects.PrimitiveCircleObject=Cir +rene.zirkel.objects.PrimitiveLineObject=Lne +rene.zirkel.objects.ExpressionObject=Exp. +rene.zirkel.objects.FixedAngleObject=Vhoek. +rene.zirkel.objects.SegmentObject=Seg. +rene.zirkel.objects.RayObject=Ray +rene.zirkel.objects.TwoPointLineObject=Lne +rene.zirkel.objects.FunctionObject=Fct +rene.zirkel.objects.AreaObject=Opp + + +mi.pal.name=Macro-inspector +mi.name=Naam: +mi.comment=Commentaar: +mi.properties=Parametereigenschappen: +mi.hideproperties=Doeleneigenschappen: +mi.hideduplicates=Verberg duplicaten +mi.apply=Pas toe +mi.tab.type=Type +mi.tab.name=Naam +mi.tab.prompt=Prompt +mi.tab.fix=Maak vast? +mi.tab.ask=Vraag? +mi.error.initial=Fout: ten minste een parameter \nmoet vrij zijn (niet vast, niet gevraagd)\n\nDeze macro zal niet veranderd worden + +props.help=Om de eigenschappen te zien moet je rechtsklikken op een voorwerp.

Als je een nieuw voorwerp aanmaakt met dit venster open, kan je ook bij het aanmaken zelf de eigenschappen veranderen. +props.name=Naam: +props.alias=Alias: +props.unit=Eenheid: +props.fix=Vast: +props.expl=Uitleg: +props.belongto=Laag: +props.conditional=Voorwaardelijk aspect: +props.solid=Solid: +props.hidden=Verborgen: +props.normal=Normaal: +props.bold=Dik: +props.thin=Gepunt: +props.black=Zwart: +props.green=Groen: +props.blue=Blauw: +props.brown=Bruin: +props.cyan=Cyaan: +props.red=Rood: +props.showasslider=Schuifbalk: +props.error=Er is een syntaxisfout in deze uitdrukking.
Ze wordt opnieuw ge\u00EFnitialiseerd. +props.cartesian=Cartesiaanse functie +props.parametric=Parameterfunctie +props.functiontype=Type: +props.killarc=Geen boog +props.arc=Boog +props.release=Laat los +props.bind=Maak vast +props.setaway=Weg van +props.setclose=Dichtbij + + +# v1.3 : +props.grid=Increment : +props.inside=Binnen voorwerp: +props.pointsonly=Enkel met punten: +props.step=Stap: +palette.grid=Rasteraspect +leftpanel.macros=Macrovenster +leftpanel.properties=Eigenschappen venster +leftpanel.history=Geschiedenis venster +leftpanel.help=Help venster +selectpopup.whatobject=Welk voorwerp? +selectpopup.RightClick=Wijzig +selectpopup.MoverTool=Beweeg +selectpopup.HiderTool=Toon/Verberg +selectpopup.DeleteTool=Verwijder +selectpopup.RenamerTool=Hernoem +selectpopup.EditTool=Wijzig +selectpopup.SetParameterTool=Macroparameters: +selectpopup.SetTargetsTool=Macrodoelen: +palette.info.locus=Meetkundige plaats van omhullende + +# v1.4 : +menu.special.savezirset=Maak diavoorstelling... +filedialog.openfolder.title=Diavoorstelling map selectiedialoog +filedialog.openfolder.approve=Selecteer map diavoorstelling +filedialog.openfolder.saveicons=Bewaar ook de beperkte iconen +slideshow.next=volgende +slideshow.previous=vorige +slideshow.download=Download bestand +slideshow.signature=Slideshow gemaakt met + +# v1.5 : +menu.language=Talen +menu.language.de=Deutsch +menu.language.en=English +menu.language.fr=Fran\u00E7ais +menu.language.es=Espa\u00F1ol +menu.language.gl=Galego +menu.language.zh_TW=Chinees (Traditioneel) +menu.help.url3=Vertaal CaRMetal + +# v1.6 : +palette.info.bi_syma=Lijnspiegeling +palette.info.bi_symc=Puntspiegeling +palette.info.bi_trans=Verschuiving +palette.info.bi_med=Middelloodlijn +palette.info.bi_biss=Bissectrice +palette.info.bi_circ=Cirkel door 3 punten +palette.info.bi_arc=Boog door 3 punten +palette.info.bi_t_align=Collineaire punten ? +palette.info.bi_t_para=Evenwijdige rechten ? +palette.info.bi_t_perp=Loodrechte rechten ? +palette.info.bi_t_equi=Even ver van twee punten ? +palette.info.bi_t_app=Ligt op rechte ? +palette.info.bi_t_conf=Samenvallende punten ? +macro.bi_syma.0=Spiegelrechte ? +macro.bi_syma.1=Punt dat gespiegeld wordt ? +macro.bi_symc.0=Spiegelpunt ? +macro.bi_symc.1=Punt dat gespiegeld wordt ? +macro.bi_trans.0=Eerste punt van de vector ? +macro.bi_trans.1=Tweede punt van de vector ? +macro.bi_trans.2=Punt dat verschoven wordt ? +macro.bi_med.0=Eerste punt van het lijnstuk ? +macro.bi_med.1=Tweede punt van het lijnstuk ? +macro.bi_biss.0=Eerste punt ? +macro.bi_biss.1=Hoekpunt ? +macro.bi_biss.2=Laatste punt ? +macro.bi_circ.0=Eerste punt ? +macro.bi_circ.1=Tweede punt ? +macro.bi_circ.2=Derde punt ? +macro.bi_t_para.0=Eerste rechte ? +macro.bi_t_para.1=Tweede rechte ? +macro.bi_t_equi.0=Ligt dit punt even ver ... +macro.bi_t_equi.1=van dit punt ... +macro.bi_t_equi.2=als van dit punt ? +macro.bi_t_app.0=Welk punt ? +macro.bi_t_app.1=Ligt op welke rechte (of lijnstuk) ? +macro.bi_t_conf.0=Welk punt ? +macro.bi_t_conf.1=valt samen met wel punt ? +macro.bi_t_align.text0=Punten liggen op zelfde rechte +macro.bi_t_align.text1=Punten liggen niet op zelfde rechte +macro.bi_t_para.text0=Voorwerpen zijn evenwijdig +macro.bi_t_para.text1=Voorwerpen zijn niet evenwijdig +macro.bi_t_perp.text0=Voorwerpen staan loodrecht op elkaar +macro.bi_t_perp.text1=Voorwerpen staan niet loodrecht op elkaar +macro.bi_t_equi.text0=Punten staan even ver +macro.bi_t_equi.text1=Punten staan niet even ver +macro.bi_t_app.text0=Het punt ligt op het voorwerp +macro.bi_t_app.text1=Het punt ligt niet op het voorwerp +macro.bi_t_conf.text0=De twee punten vallen samen +macro.bi_t_conf.text1=De twee punten vallen niet samen +palette.test=Testen + +# v1.7 : +filedialog.openfolder.appletsize=Grootte applet : +filedialog.openfolder.actualsize=Actuele grootte +filedialog.openfolder.other=Ander... +filedialog.openfolder.selected=Kies map : +filedialog.openfolder.cancel=Annuleer +menu.file.exportsvg=Exporteer als SVG +props.vars=Variabelen : +menu.objects.points=Punten +menu.objects.lines=Rechten +menu.objects.segments=Lijnstukken +menu.objects.circles=Cirkels en kegelsneden +menu.objects.angles=Hoeken +menu.objects.tracks=Meetkundige plaatsen +menu.objects.functions=Functies en uitdrukkingen +palette.info.function_u=Functie gedefinieerd door gebruiker +palette.info.function=Toon functie of parameterkromme +props.superhidden=Volledig verborgen : +props.showvalue=Toon waarde : +props.showname=Toon naam : +props.background=Achtergrond : +macro.bi_expression.0=Ankerpunt ? \ No newline at end of file diff --git a/eric/docs/JZirkelProperties_no.properties b/eric/docs/JZirkelProperties_no.properties new file mode 100644 index 0000000..7f78a9e --- /dev/null +++ b/eric/docs/JZirkelProperties_no.properties @@ -0,0 +1,218 @@ +# Sample ResourceBundle properties file + +menu.file=Fil +menu.file.new=Ny +menu.file.load=\u00C5pne... +menu.file.save=Lagre +menu.file.saveas=Lagre Som... + +menu.file.exportpng=Exporter til PNG +menu.file.exporteps=Exporter til EPS +menu.file.quit=Avslutt +menu.edit=Rediger +menu.edit.copy=Kopier +menu.edit.move=Flytt +menu.edit.rename=Gi Nytt Navn +menu.edit.edit=Endre +menu.edit.hide=Skjul +menu.edit.delete=Slett +menu.display=Vis +menu.display.hidden=Vis/Skjul Objekter +menu.display.grid=Vis/Skjul Rutenett +menu.display.finegrid=Kun Aksene +menu.display.leftsnap=Snap med venstre mustast +menu.display.manage_macros=Makro Utforsker +menu.display.history_panel=Historie +menu.display.help_panel=Hjelp +menu.display.properties_panel=Objekt Egenskaps Panel +menu.display.small=Sm\u00E5 ikoner +menu.display.medium=Medium ikoner +menu.display.large=Store ikoner +menu.display.restrictedpalette=Vis Begrenset Palett +menu.display.restrictedpaletteedit=Endre Begrenset Palett +menu.display.restrictmessage=
Dette gj\u00F8r at du ser den begrensede paletten.

Dette ang\u00E5r kun denne filen :

n\u00E5r du vil: Lagre Som.. , vil ogs\u00E5 'Lagre den begrensede figuren' komme som alternativ
to filer vil bli laget : den f\u00F8rste (.zir) vil \u00E5pne med 'normal' innstillinger, og
den andre (.r.zir) i 'begrenset palett' innstilling
+menu.macros=Makroer +menu.special=Spesial +menu.special.newmacro=Ny Makro +menu.special.loadmacros=\u00C5pne Makro Fil... +menu.special.definejob=Definer Jobb +menu.special.loadjob=Last inn Jobb ... +menu.special.jobcomment=Skriv Jobb Kommentar ... +menu.special.testjob=Test Jobben +menu.special.savejob=Lagre som en Jobb ... +menu.special.export=Opprett HTML Fil og Utforsker Forh\u00E5ndsvisning +menu.special.exporttemplate=HTML Eksport med Maler +menu.help=Hjelp +menu.help.about=Om CaRMetal... +menu.help.info=Kontekst hjelp +menu.help.url0=G\u00E5 til CaRMetal webside +menu.help.url1=G\u00E5 til CARzine webside +menu.help.url2=G\u00E5 til offisiell C.a.R. webside + +filedialog.saveas=Lagre Figur +filedialog.alsorestricted=Lagre Begrenset figur i tillegg +filedialog.options=Preferanser for Lagre +filedialog.restrictedmessage=Du arbeider med 'Begrenset' innstillinger,
figuren vil derfor bli lagret med disse innstillingene +filedialog.filefilter=CaR Fil (.zir) +filedialog.compressedfilefilter=Komprimert CaR Fil (.zirz) +filedialog.macrofilefilter=CaR Makro Fil (.mcr) +filedialog.savemessage1=Fil :\n +filedialog.savemessage2=\nEksisterer allerede. Erstatte ? + +palette.file=Fil +palette.edit=Endre +palette.construction=Konstruksjon +palette.aspect=Forhold Farge +palette.history=Historie +palette.sizes=St\u00F8rrelser +palette.sizes.point=Punkt +palette.sizes.line=Linje +palette.sizes.arrow=Pil +palette.sizes.font=Font +palette.prec=Numerisk presisjon +palette.prec.lengths=Lengder +palette.prec.edit=Uttrykk +palette.prec.angles=Vinkler +palette.colors=Bakgrunn (farge/bilde) +palette.colors.saturated1=Sterke farger +palette.colors.desaturated1=Pastellfarger +palette.colors.saturated2=Sterke farger 2 +palette.colors.desaturated2=Pastellfarger 2 +palette.colors.constants=Webkonstanter +palette.image.fileerror=Du m\u00E5 lagre denne figuren f\u00F8r du bruker dette verkt\u00F8yet

Bildet du velger m\u00E5 befinne seg i
samme mappe. + +palette.info.vector=Vektor +palette.info.image3=Sett inn bilde med 2 eller 3 punkter +palette.info.background=Velg/Fjern bakgrunnsbilde +palette.info.imcenter=Sentrer Bakgrunnsbilde +palette.info.imstretch=Strekk bakgrunnbildet til \u00E5 passe konstruksjonsvinduet +palette.info.imtile=Flislegg med bakgrunnsbilde +palette.info.copy=Kopier konstruksjonsvinduet +palette.info.exportpng=Eksporter konstruksjonsvindu til png format +palette.info.exporteps=Ekporter konstruksjonsvindu til eps format +palette.info.newmacro=Opprett Ny Makro +palette.info.loadmacros=Last inn Makro fil +palette.info.manage_macros=Vis/Skjul Makropanelet +palette.info.properties_panel=Vis/Skjul Panel for Objektegenskaper +palette.info.history_panel=Vis/Skjul Historie for Konstruksjons panelet +palette.info.help_panel=Vis/Skjul Hjelp for Kontekst panelet + + + +macros.untitledmacro=Makro uten navn +macros.untitledfolder=Mappe uten navn +macros.emptynode=-- Tom -- +macros.addfolder=Legg til ny mappe +macros.deleteselected=Slett Valgte Makro +macros.renamemacro=Nytt navn til valgte makro +macros.recordmacro=Opptak av Makro +macros.initials=F\u00F8rste objekter ? +macros.pleaseselect=Vennligst Velg ! +macros.finals=Siste objekter ? +macros.cancel=Avbryt ? +macros.popup.run=Kj\u00F8r makro +macros.popup.rename=Gi nytt navn +macros.popup.delete=Slett +macros.popup.addtolibrary=Legg til i bibliotek +macros.popup.removefromlibrary=Fjern fra bibliotek +macros.popup.publish=Inkluder i figur +macros.popup.notpublish=Ikke inkluder i figur +macros.popup.saveas=Lagre Som... +macros.popup.properties=Vis Egenskaper +macros.popup.duplicate=Dupliser +macros.savedlog.buttonok=Lagre Makrofil +macros.question.delete=Vil du virkelig slette disse makroene ? + +rene.zirkel.objects.PointObject=Pt +rene.zirkel.objects.PrimitiveCircleObject=Sir +rene.zirkel.objects.PrimitiveLineObject=Lne +rene.zirkel.objects.ExpressionObject=Uttr. +rene.zirkel.objects.FixedAngleObject=F.V. +rene.zirkel.objects.SegmentObject=Seg. +rene.zirkel.objects.RayObject=Str\u00E5le +rene.zirkel.objects.TwoPointLineObject=Lne +rene.zirkel.objects.FunctionObject=Funk +rene.zirkel.objects.AreaObject=Areal + + +mi.pal.name=Makro Utforsker +mi.name=Navn : +mi.comment=Kommentar : +mi.properties=Parameter egenskaper : +mi.hideproperties=M\u00E5lets egenskaper : +mi.hideduplicates=Skjul duplikater +mi.apply=Utf\u00F8r +mi.tab.type=Type +mi.tab.name=Navn +mi.tab.prompt=Prompt +mi.tab.fix=Fast ? +mi.tab.ask=Sp\u00F8r ? +mi.error.initial=Feil : minst en parameter \nm\u00E5 v\u00E6re fri (ikke fast eller Sp\u00F8r)\n\nDenne makroen vil ikke bli endret + +props.help=For \u00E5 se Egenskaper m\u00E5 du h\u00F8yreklikke p\u00E5 et objekt.

Hvis du lager et nytt objekt med dette panelet \u00E5pent kan du endre egenskapene under opprettelsen. +props.name=Navn : +props.alias=Alias : +props.unit=Enhet : +props.fix=Fast : +props.expl=Forklaring : +props.belongto=Lag : +props.conditional=Betinget forhold : +props.solid=Fylt : +props.hidden=Skjult : +props.normal=Normal : +props.bold=Tykk : +props.thin=Prikket : +props.black=Sort : +props.green=Gr\u00F8nn : +props.blue=Bl\u00E5 : +props.brown=Brun : +props.cyan=Turkis : +props.red=R\u00F8d : +props.showasslider=Glider : +props.error=Det er en skrivefeil i dette uttrykket.
Uttrykket vil bli resatt +props.cartesian=Kartesisk funksjon +props.parametric=Parametrisk funksjon +props.functiontype=Type : +props.killarc=Fjern bue +props.arc=Bue +props.release=L\u00F8sne +props.bind=Bind +props.setaway=Sett: away +props.setclose=Sett: close + + +# v1.3 : +props.grid=Rutest\u00F8rrelse : +props.inside=Innsideobjekt : +props.pointsonly=Kun med Punkter : +props.step=Steg : +palette.grid=Rutenett forhold +leftpanel.macros=Makro panel +leftpanel.properties=Egenskap panel +leftpanel.history=Historie panel +leftpanel.help=Hjelp panel +selectpopup.whatobject=Hvilket objekt ? +selectpopup.RightClick=Endre +selectpopup.MoverTool=Flytt +selectpopup.HiderTool=Vis/Skjul +selectpopup.DeleteTool=Slett +selectpopup.RenamerTool=Nytt Navn +selectpopup.EditTool=Endre +selectpopup.SetParameterTool=Makro parametere : +selectpopup.SetTargetsTool=Makro m\u00E5l : +palette.info.locus=Lokus for punkt ... Envelope of line + +# v1.4 : +menu.special.savezirset=Lag Lysark... +filedialog.openfolder.title=Lysark egenskaper +filedialog.openfolder.approve=Velg lysark mappe +filedialog.openfolder.saveicons=Lagre og med begrenset palett ikoner +slideshow.next=neste +slideshow.previous=forrige +slideshow.download=Last ned fil +slideshow.signature=Lysark laget med + +# v1.5 : +menu.language=Spr\u00E5k +menu.help.url3=Oversett CaRMetal + diff --git a/eric/docs/JZirkelProperties_pl.properties b/eric/docs/JZirkelProperties_pl.properties new file mode 100644 index 0000000..5a5f976 --- /dev/null +++ b/eric/docs/JZirkelProperties_pl.properties @@ -0,0 +1,329 @@ +# Sample ResourceBundle properties file +menu.file=Plik +menu.file.new=Nowy +menu.file.load=Otw\u00F3rz... +menu.file.save=Zapisz +menu.file.saveas=Zapisz jako... + +menu.file.exportpng=Eksport do PNG +menu.file.exporteps=Eksport do EPS +menu.file.quit=Zako\u0144cz +menu.edit=Edycja +menu.edit.copy=Kopiuj +menu.edit.move=Przesu\u0144 +menu.edit.rename=Zmie\u0144 nazw\u0119 +menu.edit.edit=Edytuj +menu.edit.hide=Ukryj +menu.edit.delete=Usu\u0144 +menu.display=Widok +menu.display.hidden=Poka\u017C/Ukryj obiekty +menu.display.grid=Poka\u017C/Ukryj Siatk\u0119 +menu.display.finegrid=Tylko osie +menu.display.leftsnap=Chwyt z LP myszy +menu.display.manage_macros=Inspektor makr +menu.display.history_panel=Historia +menu.display.help_panel=Pomoc +menu.display.properties_panel=Panel cech obiektu +menu.display.small=Ikony malutkie +menu.display.medium=Ikony \u015Brednie +menu.display.large=Ikony du\u017Ce +menu.display.restrictedpalette=Poka\u017C palet\u0119 ograniczon\u0105 +menu.display.restrictedpaletteedit=Edytuj palet\u0119 ograniczon\u0105 +menu.display.restrictmessage=
Ta opcja pozwala Ci pokaza\u0107 palet\u0119 ograniczon\u0105.

Dtyczy ona tylko aktualnego pliku:

przy zapisie pliku b\u0119dzie mo\u017Cna zaznaczy\u0107 'Zapisz tak\u017Ce figur\u0119 ograniczon\u0105'
i zapisane b\u0119d\u0105 dwa pliki: pierwszy (.zir) w trybie 'normal',
drugi (.r.zir) w trybie ograniczonym
+menu.macros=Makro +menu.special=Specjalne +menu.special.newmacro=Nowe makro +menu.special.loadmacros=Otw\u00F3rz plik makra... +menu.special.definejob=Zdefiniuj zadanie +menu.special.loadjob=\u0141aduj zadanie ... +menu.special.jobcomment=U\u0142\u00F3\u017C tekst zadania... +menu.special.testjob=Testuj to zadanie +menu.special.savejob=Zapisz jako zadanie... +menu.special.export=Utw\u00F3rz plik HTML i obejrzyj +menu.special.exporttemplate=Eksport HTML z szablonami +menu.help=Pomoc +menu.help.about=O CaRMetal... +menu.help.info=Pomoc kontekstowa +menu.help.url0=Do strony CarMetal +menu.help.url1=Do strony CarZine +menu.help.url2=Do oficjalnej strony C.a.R. + +filedialog.saveas=Zapisz figur\u0119 +filedialog.alsorestricted=Zapisz tak\u017Ce figur\u0119 ograniczon\u0105 +filedialog.options=Opcje zapisu +filedialog.restrictedmessage=Pracujesz w sesji ograniczonej,
wi\u0119c Twa figura b\u0119dzie zapisana w trybie ograniczonym +filedialog.filefilter=Plik CaR (.zir) +filedialog.compressedfilefilter=Spakowany plik CaR (.zirz) +filedialog.macrofilefilter=Plik makra (.mcr) +filedialog.savemessage1=Plik :\n +filedialog.savemessage2=\nju\u017C istnieje. Czy zast\u0105pi\u0107 go ? + +palette.file=Plik +palette.edit=Edycja +palette.construction=Konstrukcja +palette.aspect=Wygl\u0105d Kolor +palette.history=Historia +palette.sizes=Rozmiary +palette.sizes.point=Punkt +palette.sizes.line=Linia +palette.sizes.arrow=Strza\u0142ka +palette.sizes.font=Czcionka +palette.prec=Precyzja liczb +palette.prec.lengths=D\u0142ugo\u015Bci +palette.prec.edit=Wyra\u017Cenia +palette.prec.angles=K\u0105ty +palette.colors=Kolor t\u0142a obraz +palette.colors.saturated1=Kolory nasycone +palette.colors.desaturated1=Kolory nienasycone +palette.colors.saturated2=Kolory nasycone 2 +palette.colors.desaturated2=Kolory nienasycone 2 +palette.colors.constants=Kolory WWW +palette.image.fileerror=Najpierw musisz zapisa\u0107 figur\u0119

After, Wybrany obrazek musi by\u0107
w tym samym folderze. + +palette.info.vector=Vektor +palette.info.image3=Wstaw obraz na 2 lub 3 punktach +palette.info.background=Wybierz/czy\u015B\u0107 obraz t\u0142a +palette.info.imcenter=Wy\u015Brodkuj obraz t\u0142a +palette.info.imstretch=Dopasuj obraz t\u0142a do okna konstrukcji +palette.info.imtile=Kafelki z obrazu t\u0142a +palette.info.copy=Kopiuj okno konstrukcji +palette.info.exportpng=Eksport okna konstrukcji do formatu png +palette.info.exporteps=Eksport okna konstrukcji do formatu eps +palette.info.newmacro=Utw\u00F3rz nowe makro +palette.info.loadmacros=\u0141aduj plik makra +palette.info.manage_macros=Poka\u017C/ukryj panel makra +palette.info.properties_panel=Poka\u017C/Ukryj panel cech obiektu +palette.info.history_panel=Poka\u017C/Ukryj panel historii konstrukcji +palette.info.help_panel=Poka\u017C/Ukryj panel pomocy kontekstowej + + + +macros.untitledmacro=Makro bez nazwy +macros.untitledfolder=Folder bez nazwy +macros.emptynode=-- Pusty -- +macros.addfolder=Dodaj nowy folder +macros.deleteselected=Usu\u0144 wybrane makra +macros.renamemacro=Zmie\u0144 nazw\u0119 wybranego makra +macros.recordmacro=Nagraj makro +macros.initials=Obiekty startowe ? +macros.pleaseselect=wybierz prosz\u0119 ! +macros.finals=Obiekty wynikowe ? +macros.cancel=Anulowa\u0107 ? +macros.popup.run=Uruchom makro +macros.popup.rename=Zmie\u0144 naz +macros.popup.delete=Usu\u0144 +macros.popup.addtolibrary=Dodaj do biblioteki +macros.popup.removefromlibrary=Usu\u0144 z biblioteki +macros.popup.publish=W\u0142\u0105cz do figury +macros.popup.notpublish=Nie w\u0142\u0105czaj do figury +macros.popup.saveas=Zapisz jako... +macros.popup.properties=Poka\u017C cechy +macros.popup.duplicate=Powiel +macros.savedlog.buttonok=Zapisz plik makra +macros.question.delete=Czy na pewno usun\u0105\u0107 te makra ? + +rene.zirkel.objects.PointObject=Pkt +rene.zirkel.objects.PrimitiveCircleObject=Okr +rene.zirkel.objects.PrimitiveLineObject=Lin +rene.zirkel.objects.ExpressionObject=Wyr. +rene.zirkel.objects.FixedAngleObject=K\u0105t +rene.zirkel.objects.SegmentObject=Odc. +rene.zirkel.objects.RayObject=Ppr +rene.zirkel.objects.TwoPointLineObject=Lin +rene.zirkel.objects.FunctionObject=Fun +rene.zirkel.objects.AreaObject=Pole + + +mi.pal.name=Inspektor makr +mi.name=Nazwa : +mi.comment=Notka : +mi.properties=Cechy parametr\u00F3w : +mi.hideproperties=Cechy obiekt\u00F3w docelowych : +mi.hideduplicates=Ukryj duplikaty +mi.apply=Zastosuj +mi.tab.type=Typ +mi.tab.name=Nazwa +mi.tab.prompt=Oznacz +mi.tab.fix=Ust. ? +mi.tab.ask=Pyt. ? +mi.error.initial=B\u0142\u0105d : cho\u0107 jeden parametr \nmusi by\u0107 wolny (ani Ust., ani Pyt.)\n\nTo makro nie b\u0119dzie zmienione + +props.help=Aby zobaczy\u0107 cechy, kliknij prawym PM na obiekcie.

Je\u015Bli tworzysz nowy obiekt z tym panelem otwartym, b\u0119dziesz m\u00F3g\u0142 zmienia\u0107 cechy w czasie tworzenia. +props.name=Nazwa : +props.alias=Podpis : +props.unit=Miara : +props.fix=Ust. : +props.expl=Wyja\u015Bnienie : +props.belongto=Warstwa : +props.conditional=Wygl\u0105d warunkowy : +props.solid=Matowy : +props.hidden=Ukryty : +props.normal=Normalny : +props.bold=Gruby : +props.thin=Kropkowy : +props.black=Czarny : +props.green=Zielony : +props.blue=Niebieski : +props.brown=Br\u0105zowy : +props.cyan=Turkus : +props.red=Czerwony : +props.showasslider=Poka\u017C jako suwak : +props.error=W tym wyra\u017Ceniu jest b\u0142\u0105d sk\u0142adniowy.
B\u0119dzie ono ponownie zainicjowane. +props.cartesian=Funkcja XY +props.parametric=Funkcja parametryczna +props.functiontype=Typ : +props.killarc=Usu\u0144 \u0142uk +props.arc=\u0141uk +props.release=Uwolnij +props.bind=Przywi\u0105\u017C +props.setaway=Ustaw daleko +props.setclose=Ustaw blisko + + +# v1.3 : +props.grid=Skok siatki : +props.inside=Wewn\u0105trz obiektu : +props.pointsonly=Tylko z punktami : +props.step=Krok : +palette.grid=Wygl\u0105d siatki +leftpanel.macros=Panel makr +leftpanel.properties=Panel cech +leftpanel.history=Panel historii +leftpanel.help=Panel pomocy +selectpopup.whatobject=kt\u00F3ry obiekt ? +selectpopup.RightClick=Wybierz +selectpopup.MoverTool=Przesu\u0144 +selectpopup.HiderTool=Poka\u017C/Ukryj +selectpopup.DeleteTool=Usu\u0144 +selectpopup.RenamerTool=Zmie\u0144 nazw\u0119 +selectpopup.EditTool=Edytuj +selectpopup.SetParameterTool=Parametry makra : +selectpopup.SetTargetsTool=Cele makra : +palette.info.locus=Locus punktu Obwiednia linii + +# v1.4 : +menu.special.savezirset=Tw\u00F3rz pokaz... +filedialog.openfolder.title=Wyb\u00F3r folderu pokazu +filedialog.openfolder.approve=Wybierz folder pokazu +filedialog.openfolder.saveicons=Zapisz tak\u017Ce ikony ograniczone +slideshow.next=dalej +slideshow.previous=wstecz +slideshow.download=Pobierz plik +slideshow.signature=Pokaz wykreowany w + +# v1.5 : +menu.language=J\u0119zyki +menu.language.de=Niemiecki +menu.language.en=Angielski +menu.language.fr=Francuski +menu.language.es=Hiszpa\u0144ski +menu.language.gl=Galego +menu.language.zh_TW=Chi\u0144ski (Tradycyjny) +menu.help.url3=CarMetal - translacja +menu.display.smartboard=Tryb Smartboard + +# v1.6 : +menu.language.no=Norweski +palette.info.bi_syma=Symetria osiowa +palette.info.bi_symc=Symetria \u015Brodkowa +palette.info.bi_trans=Translacja +palette.info.bi_med=Symetralna odcinka +palette.info.bi_biss=Dwusieczna k\u0105ta +palette.info.bi_circ=Okr\u0105g przez 3 punkty +palette.info.bi_arc=\u0142uk opisany przez 3 punkty +palette.info.bi_t_align=Punkty wsp\u00F3\u0142liniowe ? +palette.info.bi_t_para=Linie r\u00F3wnoleg\u0142e ? +palette.info.bi_t_perp=Linie prostopad\u0142e ? +palette.info.bi_t_equi=Punkt r\u00F3wnoodleg\u0142y ? +palette.info.bi_t_app=Le\u017Cy na linii ? +palette.info.bi_t_conf=Punkty pokrywaj\u0105ce si\u0119 ? +macro.bi_syma.0=O\u015B symetrii ? +macro.bi_syma.1=Punkt do odbicia ? +macro.bi_symc.0=\u015Arodek symetrii ? +macro.bi_symc.1=Punkt do odbicia ? +macro.bi_trans.0=Pocz\u0105tek wektora ? +macro.bi_trans.1=Koniec wektora ? +macro.bi_trans.2=Punkt do translacji ? +macro.bi_med.0=Pierwszy koniec odcinka ? +macro.bi_med.1=Drugi koniec odcinka ? +macro.bi_biss.0=Pierwszy punkt ? +macro.bi_biss.1=Wierzcho\u0142ek k\u0105ta ? +macro.bi_biss.2=Ostatni punkt ? +macro.bi_circ.0=First point ? +macro.bi_circ.1=Drugi punkt ? +macro.bi_circ.2=Trzeci punkt ? +macro.bi_t_para.0=Pierwsza linia ? +macro.bi_t_para.1=Druga linia ? +macro.bi_t_equi.0=Czy punkt jest r\u00F3wnoodleg\u0142y ... +macro.bi_t_equi.1=Od tego punktu ... +macro.bi_t_equi.2=I od tego punktu ? +macro.bi_t_app.0=Kt\u00F3ry punkt ? +macro.bi_t_app.1=Le\u017Cy na kt\u00F3rej prostej (odcinku) ? +macro.bi_t_conf.0=Kt\u00F3ry punkt ? +macro.bi_t_conf.1=Jest na kt\u00F3rym punkcie ? +macro.bi_t_align.text0=Punkty s\u0105 wsp\u00F3\u0142liniowe +macro.bi_t_align.text1=Punkty nie s\u0105 wsp\u00F3\u0142liniowe +macro.bi_t_para.text0=Obiekty s\u0105 r\u00F3wnoleg\u0142e +macro.bi_t_para.text1=Obiekty nie s\u0105 r\u00F3wnoleg\u0142e +macro.bi_t_perp.text0=Obiekty s\u0105 prostopad\u0142e +macro.bi_t_perp.text1=Obiekty nie s\u0105 prostopad\u0142e +macro.bi_t_equi.text0=Punkty s\u0105 r\u00F3wnoodleg\u0142e +macro.bi_t_equi.text1=Punkty nie s\u0105 r\u00F3wnoodleg\u0142e +macro.bi_t_app.text0=Punkt le\u017Cy na obiekcie +macro.bi_t_app.text1=Punkt nie le\u017Cy na obiekcie +macro.bi_t_conf.text0=Dwa punkty pokrywaj\u0105 si\u0119 +macro.bi_t_conf.text1=Dwa punkty nie pokrywaj\u0105 si\u0119 +palette.test=Testy + +# v1.7 : +filedialog.openfolder.appletsize=Rozmiar apletu : +filedialog.openfolder.actualsize=Rozmiar aktualny +filedialog.openfolder.other=Inny... +filedialog.openfolder.selected=Wybrany folder : +filedialog.openfolder.cancel=Anuluj +menu.file.exportsvg=Eksportuj do SVG +menu.language.sl=S\u0142owe\u0144ski +menu.language.nl=Holenderski +menu.language.pt=Portugalski +props.vars=Zmienne : +menu.objects.points=Punkty +menu.objects.lines=Linie +menu.objects.segments=Odcinki +menu.objects.circles=Okr\u0119gi i sto\u017Ckowe +menu.objects.angles=K\u0105ty +menu.objects.tracks=\u015Alady i locus +menu.objects.functions=Funkcje i wyra\u017Cenia +palette.info.function_u=Funkcja u\u017Cytkownika +palette.info.function=Wykres funkcji lub krzywa parametryczna +props.superhidden=Ca\u0142kiem ukryty : +props.showvalue=Poka\u017C warto\u015B\u0107 : +props.showname=Poka\u017C nazw\u0119 : +props.background=T\u0142o : +macro.bi_expression.0=Punkt zaczepienia ? + +# v1.9a : +menu.help.licence=Licencja...licence.txt=

Program ten jest wolnyna licencji GNU-GPL, tzn. mo\u017Ce by\u0107 rozpowszechniany i/lub modifikowany na warunkach licence opublikowanej przez Free Software Foundation;
Patrz :

+ + +# v2.0 : +menu.special.theme=Kostiumy +menu.special.theme.gray=Metal - chrom +menu.special.theme.brushed=Metal - aluminium +menu.special.options=Preferencje... +menu.special.options.sizes=Rozmiary +menu.special.options.sizes.minpointsize=Rozmiar punktu +menu.special.options.sizes.minlinesize=Rozmiar linii +menu.special.options.sizes.arrowsize=Rozmiar strza\u0142ki +menu.special.options.sizes.minfontsize=Rozmiar czcionki +menu.special.options.sizes.digits.lengths=Precyzja d\u0142ugo\u015Bci +menu.special.options.sizes.digits.edit=Precyzja wyra\u017Cenia +menu.special.options.sizes.digits.angles=Precyzja miary k\u0105ta +menu.special.options.colors=Kolory +menu.special.options.others=Inne +menu.special.options.others.undock=Palety mo\u017Cna od\u0142\u0105cza\u0107 + +# v2.1 : +menu.file.close=Zamknij okno + +# v2.3 : +alert.toomuchwins=Zbyt wiele otwartych okien :
zamknij niekt\u00F3re przed otwarciem
nowego okna \ No newline at end of file diff --git a/eric/docs/JZirkelProperties_pt.properties b/eric/docs/JZirkelProperties_pt.properties new file mode 100644 index 0000000..ee98b06 --- /dev/null +++ b/eric/docs/JZirkelProperties_pt.properties @@ -0,0 +1,481 @@ +# Sample ResourceBundle properties file +menu.file=Ficheiro +menu.file.new=Novo +menu.file.load=Abrir\u2026 +menu.file.save=Guardar +menu.file.saveas=Guardar como\u2026 + +menu.file.exportpng=Exportar como PNG +menu.file.exporteps=Exportar como EPS +menu.file.quit=Sair +menu.edit=Editar +menu.edit.copy=Copiar +menu.edit.move=Mover objecto +menu.edit.rename=Mudar o nome +menu.edit.edit=Editar +menu.edit.hide=Ocultar +menu.edit.delete=Eliminar +menu.display=Visualiza\u00e7\u00e3o +menu.display.hidden=Mostrar/Ocultar Objectos +menu.display.grid=Mostrar/Ocultar Grelha +menu.display.finegrid=Apenas os eixos +menu.display.leftsnap=Snap arrastando o rato com o bot\u00e3o esquerdo +menu.display.manage_macros=Gestor de Macros +menu.display.history_panel=Hist\u00f3rico +menu.display.help_panel=Ajuda +menu.display.properties_panel=Painel de Propriedades do Objecto +menu.display.small=\u00cdcones pequenos +menu.display.medium=\u00cdcones m\u00e9dios +menu.display.large=\u00cdcones grandes +menu.display.restrictedpalette=Mostrar paleta restrita +menu.display.restrictedpaletteedit=Editar paleta restrita +menu.display.restrictmessage=
Este item permite-lhe visualizar a paleta restrita,

referindo-se apenas ao ficheiro actual :

Quando o \u2018guardar como', poder\u00e1 seleccionar 'guardar tamb\u00e9m a constru\u00e7\u00e3o em modo restrito'.
Ser\u00e3o criados dois ficheiros : o primeiro (.zir) abrir\u00e1 em modo 'normal', e
o segundo (.r.zir) em modo restrito
+menu.macros=Macros +menu.special=Especial +menu.special.newmacro=Nova Macro +menu.special.loadmacros=Abrir Ficheiro Macro... +menu.special.definejob=Definir um Exerc\u00edcio +menu.special.loadjob=Abrir um Exerc\u00edcio... +menu.special.jobcomment=Redigir o texto de um Exerc\u00edcio ... +menu.special.testjob=Testar este Exerc\u00edcio +menu.special.savejob=Guardar como Exerc\u00edcio... +menu.special.export=Criar um ficheiro HTML e visualizar num Browser +menu.special.exporttemplate=Exportar como HTML com Modelos +menu.help=Ajuda +menu.help.about=Sobre o CaRMetal... +menu.help.info=Ajuda em contexto +menu.help.url0=P\u00e1gina web do CaRMetal +menu.help.url1=P\u00e1gina web da CARzine +menu.help.url2=P\u00e1gina web do C.a.R. + +filedialog.saveas=Guardar a constru\u00e7\u00e3o +filedialog.alsorestricted=Guardar tamb\u00e9m a constru\u00e7\u00e3o em modo restrito +filedialog.options=Guardar como +filedialog.restrictedmessage=Por estar a trabalhar em modo restrito,
a sua constru\u00e7\u00e3o ser\u00e1 guardada em modo restrito. +filedialog.filefilter=Ficheiro CaR (.zir) +filedialog.compressedfilefilter=Ficheiro CaR Comprimido (.zirz) +filedialog.macrofilefilter=Ficheiro Macro do CaR (.mcr) +filedialog.savemessage1=Ficheiro :\n +filedialog.savemessage2=\n j\u00e1 existe. Tem a certeza de que o pretende substituir? + +palette.file=Ficheiro +palette.edit=Editar +palette.construction=Constru\u00e7\u00e3o +palette.aspect=Aspecto & Cores +palette.history=Hist\u00f3rico +palette.sizes=Tamanhos +palette.sizes.point=Ponto +palette.sizes.line=Linha +palette.sizes.arrow=Seta +palette.sizes.font=Tipo de letra +palette.prec=Precis\u00e3o Num\u00e9rica +palette.prec.lengths=Comprimentos +palette.prec.edit=Express\u00f5es +palette.prec.angles=\u00c2ngulos +palette.colors=Cor & imagem do Fundo +palette.colors.saturated1=Cores Saturadas +palette.colors.desaturated1= Cores N\u00e3o-Saturadas +palette.colors.saturated2= Cores Saturadas 2 +palette.colors.desaturated2= Cores N\u00e3o-Saturadas 2 +palette.colors.constants=Constantes Web +palette.image.fileerror=Deve guardar a constru\u00e7\u00e3o antes de utilizar esta ferramenta

A imagem a inserir dever\u00e1 pertencer
ao mesmo direct\u00f3rio. + +palette.info.vector=Vector +palette.info.image3=Inserir imagem+posicionando-a com 2 ou 3 pontos +palette.info.background=Escolher/Limpar a imagem do Fundo +palette.info.imcenter=Centrar a imagem do Fundo +palette.info.imstretch=Estender a imagem do Fundo+para caber na janela de constru\u00e7\u00e3o +palette.info.imtile=Dividir a imagem do Fundo em mosaicos +palette.info.copy=Copiar a janela de constru\u00e7\u00e3o +palette.info.exportpng=Exportar a janela+de constru\u00e7\u00e3o para o formato png +palette.info.exporteps=Exportar a janela+de constru\u00e7\u00e3o para o formato eps +palette.info.newmacro=Criar uma nova macro +palette.info.loadmacros=Abrir um ficheiro de macros +palette.info.manage_macros=Mostrar/Ocultar o painel de macros +palette.info.properties_panel=Mostrar/Ocultar o painel de propriedades do objecto +palette.info.history_panel=Mostrar/Ocultar o hist\u00f3rico da constru\u00e7\u00e3o +palette.info.help_panel=Mostrar/Ocultar o painel de ajuda em contexto + + +macros.untitledmacro=Macro sem t\u00edtulo +macros.untitledfolder=Direct\u00f3rio sem t\u00edtulo +macros.emptynode=-- vazio -- +macros.addfolder=Adicionar novo Direct\u00f3rio +macros.deleteselected=Eliminar macros seleccionadas +macros.renamemacro=Mudar o nome da macro seleccionada +macros.recordmacro=Gravar macro +macros.initials=Objectos Iniciais ? +macros.pleaseselect=Seleccione, por favor ! +macros.finals=Objectos finais ? +macros.cancel=Cancelar ? +macros.popup.run=Correr macro +macros.popup.rename=Mudar o nome +macros.popup.delete=Eliminar +macros.popup.addtolibrary=Adicionar \u00e0 livraria +macros.popup.removefromlibrary=Remover da livraria +macros.popup.publish=Incluir na constru\u00e7\u00e3o +macros.popup.notpublish=N\u00e3o Incluir na constru\u00e7\u00e3o +macros.popup.saveas=Guardar como... +macros.popup.properties=Mostrar propriedades +macros.popup.duplicate=Duplicar +macros.savedlog.buttonok=Guardar o ficheiro da macro +macros.question.delete=Tem a certeza de que pretende eliminar estas macros ? + +rene.zirkel.objects.PointObject=Ponto +rene.zirkel.objects.PrimitiveCircleObject=Circ. +rene.zirkel.objects.PrimitiveLineObject=Linha +rene.zirkel.objects.ExpressionObject=Expr. +rene.zirkel.objects.FixedAngleObject=\u00c2ng.Fixo +rene.zirkel.objects.SegmentObject=Segm. +rene.zirkel.objects.RayObject=S-Recta +rene.zirkel.objects.TwoPointLineObject=Linha +rene.zirkel.objects.FunctionObject=Fun\u00e7\u00e3o +rene.zirkel.objects.AreaObject=\u00c1rea + + +mi.pal.name=Gestor de Macros +mi.name=Nome : +mi.comment=Coment\u00e1rio : +mi.properties=Propriedades do par\u00e2metro: +mi.hideproperties=Propriedades do Alvo: +mi.hideduplicates=Ocultar duplicados +mi.apply=Aplicar +mi.tab.type=Tipo +mi.tab.name=Nome +mi.tab.prompt=Comando +mi.tab.fix=Fixo ? +mi.tab.ask=Pedido ? +mi.error.initial=Erro : pelo menos um dos par\u00e2metros \n dever\u00e1 ser livre (nem fixo, nem pedido)\n\n Esta macro n\u00e3o ser\u00e1 alterada. + +props.help=Para ver as propriedades, dever\u00e1 clicar com o bot\u00e3o direito do rato sobre o objecto.

Se criar um novo objecto com este painel aberto, poder\u00e1 alterar as suas propriedades enquanto o cria. +props.name=Nome : +props.alias=Ali\u00e1s : +props.unit=Unidade : +props.fix=Fixo : +props.expl=Explica\u00e7\u00e3o : +props.belongto=Layer : +props.conditional=Aspecto Conditional : +props.solid=S\u00f3lido : +props.hidden=Oculto : +props.normal=Normal : +props.bold=Tra\u00e7o Expressivo : +props.thin=Tra\u00e7o interrompido : +props.black=Preto : +props.green=Verde : +props.blue=Azul : +props.brown=Castanho : +props.cyan=Ciano : +props.red=Vermelho : +props.showasslider=Cursor +props.error=Existe um erro de sintaxe nesta express\u00e3o.
Ser\u00e1 reiniciada +props.cartesian=Fun\u00e7\u00e3o Cartesiana +props.parametric=Fun\u00e7\u00e3o Param\u00e9trica +props.functiontype=Tipo : +props.killarc=Eliminar arco +props.arc=Arco +props.release=Libertar +props.bind=Juntar +props.setaway=Afastar +props.setclose=Aproximar + + +# v1.3 : +props.grid=Incremento : +props.inside=Inclu\u00eddo no objecto : +props.pointsonly=Apenas com pontos : +props.step=Passo : +palette.grid=Aspecto da Grelha +leftpanel.macros=Painel de Macros +leftpanel.properties=Painel de Propriedades +leftpanel.history=Painel do Hist\u00f3rico +leftpanel.help=Painel da Ajuda +selectpopup.whatobject=Que objecto ? +selectpopup.RightClick=Seleccionar +selectpopup.MoverTool=Mover +selectpopup.HiderTool=Mostrar/Ocultar +selectpopup.DeleteTool=Eliminar +selectpopup.RenamerTool=Mudar o Nome +selectpopup.EditTool=Editar +selectpopup.SetParameterTool=Par\u00e2metros da Macro : +selectpopup.SetTargetsTool=Alvos da Macro : +palette.info.locus=Lugar geom\u00e9trico do ponto+envolvente de uma linha + +# v1.4 : +menu.special.savezirset=Criar um diaporama... +filedialog.openfolder.title=Di\u00e1logo de sele\u00e7\u00e3o do Direct\u00f3rio do diaporama +filedialog.openfolder.approve=Seleccionar o Direct\u00f3rio do diaporama +filedialog.openfolder.saveicons=Guardar tamb\u00e9m os \u00edcones restritos +slideshow.next=Seguinte +slideshow.previous=Anterior +slideshow.download=Descarregar ficheiro +slideshow.signature=Diaporama realizado com + +# v1.5 : +menu.language=Idiomas +menu.language.de=Alem\u00e3o +menu.language.en=Ingl\u00eas +menu.language.fr=Franc\u00eas +menu.language.es=Espanhol +menu.language.gl=Galego +menu.language.zh_TW=Chin\u00eas (Tradicional) +menu.help.url3=Traduzir o CaRMetal +menu.display.smartboard=Modo Avan\u00e7ado + + +# v1.6 : +menu.language.no=Noruegu\u00eas +palette.info.bi_syma=Reflex\u00e3o +palette.info.bi_symc=Simetria +palette.info.bi_trans=Transla\u00e7\u00e3o +palette.info.bi_med=Mediatriz +palette.info.bi_biss=Bissectriz +palette.info.bi_circ=Circunfer\u00eancia por 3 pontos +palette.info.bi_arc=Arco Circuncircular por 3 pontos +palette.info.bi_t_align=Pontos Colineares ? +palette.info.bi_t_para=Linhas Paralelas ? +palette.info.bi_t_perp=Linhas Perpendiculares ? +palette.info.bi_t_equi=equidistante de dois pontos ? +palette.info.bi_t_app=Pertence a uma linha ? +palette.info.bi_t_conf=Pontos coincidentes ? +macro.bi_syma.0=Eixo de simetria de reflex\u00e3o ? +macro.bi_syma.1=Sim\u00e9trico de que Ponto ? +macro.bi_symc.0=Centro de Simetria ? +macro.bi_symc.1=Sim\u00e9trico de que Ponto ? +macro.bi_trans.0=Primeiro ponto do vector ? +macro.bi_trans.1=Segundo ponto do vector ? +macro.bi_trans.2=Por transla\u00e7\u00e3o, obter a imagem de que ponto? +macro.bi_med.0=Primeiro ponto do segmento ? +macro.bi_med.1=Segundo ponto do segmento ? +macro.bi_biss.0=Primeiro ponto ? +macro.bi_biss.1=V\u00e9rtice do \u00c2ngulo ? +macro.bi_biss.2=\u00daltimo ponto ? +macro.bi_circ.0=Primeiro ponto ? +macro.bi_circ.1=Segundo ponto ? +macro.bi_circ.2=Terceiro ponto ? +macro.bi_t_para.0=Primeira linha ? +macro.bi_t_para.1=Segunda linha ? +macro.bi_t_equi.0=Este ponto \u00e9 equidistante de ... +macro.bi_t_equi.1=A partir deste ponto ... +macro.bi_t_equi.2=E este ponto ? +macro.bi_t_app.0=Qual ponto ? +macro.bi_t_app.1=Pertence a que linha (ou segmento) ? +macro.bi_t_conf.0=Qual ponto ? +macro.bi_t_conf.1=Situa-se em que ponto ? +macro.bi_t_align.text0=Os Pontos s\u00e3o colineares +macro.bi_t_align.text1= Os Pontos n\u00e3o s\u00e3o colineares +macro.bi_t_para.text0=Os objectos s\u00e3o paralelos +macro.bi_t_para.text1=Os objectos n\u00e3o s\u00e3o paralelos +macro.bi_t_perp.text0=Os objectos s\u00e3o perpendiculares +macro.bi_t_perp.text1=Os objectos n\u00e3o s\u00e3o perpendiculares +macro.bi_t_equi.text0=Os Pontos s\u00e3o equidistantes +macro.bi_t_equi.text1=Os Pontos n\u00e3o s\u00e3o equidistantes +macro.bi_t_app.text0=O ponto pertence ao objecto +macro.bi_t_app.text1=O ponto n\u00e3o pertence ao objecto +macro.bi_t_conf.text0=Os dois pontos s\u00e3o coincidentes +macro.bi_t_conf.text1= Os dois pontos n\u00e3o s\u00e3o coincidentes +palette.test=Testes + +# v1.7 : +filedialog.openfolder.appletsize=Tamanho da Aplica\u00e7\u00e3o : +filedialog.openfolder.actualsize=Tamanho Real +filedialog.openfolder.other=Outro... +filedialog.openfolder.selected=Direct\u00f3rio seleccionado : +filedialog.openfolder.cancel=Cancelar +menu.file.exportsvg=Exportar para SVG +menu.language.sl=Eslovaco +menu.language.nl=Neerland\u00eas +menu.language.pt=Portugu\u00eas +props.vars=Vari\u00e1veis : +menu.objects.points=Pontos +menu.objects.lines=Linhas +menu.objects.segments=Segmentos +menu.objects.circles=C\u00edrculos e C\u00f3nicas +menu.objects.angles=\u00c2ngulos +menu.objects.tracks=Rastos e lugares geom\u00e9tricos +menu.objects.functions=Fun\u00e7\u00f5es e express\u00f5es +palette.info.function_u=Fun\u00e7\u00e3o definida pelo utilizador +palette.info.function=Visualizar fun\u00e7\u00e3o+ou curva param\u00e9trica +props.superhidden=Completamente oculto : +props.showvalue=Mostrar valor : +props.showname=Mostrar nome : +props.background=Fundo : +macro.bi_expression.0=Ponto \u00c2ncora ? + +# v1.9a : +menu.help.licence=Licen\u00e7a... +licence.txt=

Este software \u00e9 livre, sob licen\u00e7a da GNU-GPL, podendo ser redistribu\u00eddo e/ou modificado de acordo com os termos da licen\u00e7a publicada pela Free Software Foundation;
Ver :

+ + +# v2.0 : +menu.special.theme=Temas +menu.special.theme.gray=Metal Polido +menu.special.theme.brushed=Metal Escovado +menu.special.options=Prefer\u00eancias... +menu.special.options.sizes=Tamanhos +menu.special.options.sizes.minpointsize=Tamanho do ponto +menu.special.options.sizes.minlinesize=Espessura da Linha +menu.special.options.sizes.arrowsize=Tamanho das setas +menu.special.options.sizes.minfontsize=Tamanho do Tipo de letra +menu.special.options.sizes.digits.lengths=Precis\u00e3o do comprimento +menu.special.options.sizes.digits.edit=Precis\u00e3o da Express\u00e3o +menu.special.options.sizes.digits.angles=Precis\u00e3o do \u00c2ngulo +menu.special.options.colors=Cores +menu.special.options.others=Outras +menu.special.options.others.undock=Apto para deslocar as janelas de menu + +# v2.1 : +menu.file.close=Fechar Janela + +# v2.3 : +alert.toomuchwins=Existem demasiadas janelas abertas :
por favor encerre algumas delas antes de abrir
uma nova + +# v2.4 : +menu.file.new3D=Nova constru\u00e7\u00e3o 3D +palette.3D=3D +palette.info.bi_3Dcoords=Coordenadas 3D +macro.bi_3Dcoords.0=Ponto \u00c2ncora ? +palette.info.bi_3Dcube=Cubo +macro.bi_3Dcube.0=Centro do cubo ? +palette.info.bi_3Darete=Arestas 3D +macro.bi_3Darete.0=Primeiro Ponto ? +macro.bi_3Darete.1=Segundo ponto ? +macro.bi_3Darete.2=Terceiro ponto ? +macro.bi_3Darete.3=Quarto ponto ? +palette.info.bi_3Dtetra=Tetraedro regular +macro.bi_3Dtetra.0=Centro do Tetraedro ? +menu.newdoc=Novo +menu.language.it=Italiano + +# v2.5.5 : +palette.aspect.label.text_title=Aspecto de +palette.aspect.label.point=pontos +palette.aspect.label.line=linhas +palette.aspect.label.segment=segmentos +palette.aspect.label.circle=c\u00edrculos +palette.aspect.label.angle=\u00e2ngulos +palette.aspect.label.area=pol\u00edgonos +palette.aspect.label.text=textos +palette.info.bi_3Ddode=Dodecaedro regular +macro.bi_3Ddode.0=Centro do dodecaedro ? + +# v2.7 : +palette.aspect.label.pointshape=Configura\u00e7\u00e3o e nome dos pontos : +palette.aspect.label.locus=lugares geom\u00e9tricos +menu.edit.deleteall=Eliminar tudo + + +# v2.7.1 : +java.old.message=Lamentamos, mas n\u00e3o pode iniciar o software CaRMetal, porque a sua vers\u00e3o do Java est\u00e1 desactualizada ! +java.old.quit=Sair +java.old.go=Descarregar nova vers\u00e3o do java +palette.info.boundedpoint=Posicionar um ponto num plano+ou numa face de um poliedro + +#v2.7.2 : +user.foldername=Perfil do Utilizador do CarMetal + +#v2.8 +props.fixedray=Semi-Recta : +props.fixedsegment=Comprimento : +props.fixedangle=\u00c2ngulo : +props.expl=Linha de coment\u00e1rios : +props.aspecttab=Aspecto +props.numerictab=Num\u00e9rico +props.conditionaltab=Condicional +props.thick=Expressivo : +props.popup.special=Caracteres Especiais +props.popup.functions=Fun\u00e7\u00f5es Pr\u00e9definidas +props.popup.latex=Commandos de LaTeX +menu.language.pl=Polaco + +#v2.8.1 +props.fixedinwindow=Hiperligado a janela + +#v2.8.5 +palette.controls=Comandos +props.ctrlshowvalue=Mostrar valor +props.ctrlsnap=Snap para pontos not\u00e1veis +props.ctrlshowticks=Mostrar pontos not\u00e1veis +props.ctrltickspacing=Incremento : +palette.info.ctrl_edit=Editar, mover ou redimensionar o comando +palette.info.ctrl_chkbox=Adicionar CheckBox +palette.info.ctrl_popup=Adicionar Menu Popup +palette.info.ctrl_slider=Adicionar Cursor + +#v2.8.6 +props.trackdmin=N\u00famero de passos : +opendialog.preview=Pr\u00e9-visualiza\u00e7\u00e3o : +pngdialog.options=Op\u00e7\u00f5es de Exporta\u00e7\u00e3o: +pngdialog.scale=Escala : +pngdialog.originsize=Tamanho Original : +pngdialog.scaledsize=Tamanho redimensionado : + +#v2.8.7 +canvas.3D.floor=Piso +canvas.3D.system=Sistema de Coordenadas +canvas.3D.rightclic=Arraste o bot\u00e3o direito do rato para rodar o sistema de coordenadas + + +#v2.8.8 +palette.info.equationxy=Curva definida por f(x,y)=0 +props.equationxy=Equa\u00e7\u00e3o : +props.equationxychooser=Precis\u00e3o : +palette.function=Fun\u00e7\u00f5es & lugar geom\u00e9trico + +#v2.8.9 +menu.edit.deletealltracks=Limpar rasto +menu.edit.deactivatealltracks=Desactivar rastreio +props.tracks= Activar rastreio +menu.edit.zoom=Fazer Zoom ou Mover + +#v2.9.0 +menu.windows=Janela + +#v2.9.1 +contexthelp.seealso=Ver tamb\u00e9m : + +#v2.9.2 +menu.language.pt_BR=Brasileiro +menu.display.restrictmessage.dontdisplay=N\u00e3o mostrar mais esta mensagem + +#v2.9.6 +props.magnetmessage=Clique nos objectos que pretende adicionar (ou remover da) lista magn\u00e9tica +props.magnetobj=Objectos Magn\u00e9ticos +props.magnetpix=Atra\u00e7\u00e3o (20 px) : +props.show=Mostrar + +#v2.9.7 +palette.info.ctrl_txtfield=Adicionar Caixa de Input Num\u00e9rica +palette.info.ctrl_button=Adicionar Bot\u00e3o + +#v2.9.8.4 +JSerror.title=Erro de s\u00edntaxe +JSerror.line=Linha +JSerror.pointcoords= Erro de s\u00edntaxe nas coordenadas do ponto +JSerror.interactiveinput=Erro na sele\u00e7\u00e3o do objecto +JSerror.notfound=Objecto n\u00e3o encontrado +JSerror.notgoodtype=Imposs\u00edvel aplicar a este tipo de objecto +JScmd.inputmessage=A sua quest\u00e3o ? +JScmd.promptmessage=A sua mensagem... +menu.js=Javascript +menu.js.script=Abrir ficheiro de javascript... +menu.js.command=Abrir o editor de script +JSeditor.title=Editor de Javascript + +#v3.0 +JSeditor.save=Guardar script +JSeditor.open=Abrir script +JSeditor.opendlogmsg=Abrir script +JSeditor.savedlogmsg=Guardar script +JSeditor.format=Formatar script +JSeditor.restore=Cancelar a \u00faltima execu\u00e7\u00e3o +JSeditor.run=Correr script +JSeditor.help=Obter ajuda de s\u00edntaxe +JSEditor.comment=Comentar/N\u00e3o comentar a sele\u00e7\u00e3o +JSEditor.savequestion=Este script foi alterado : pretende guard\u00e1-lo ? +menu.language.ar_TN=\u00c1rabe + +# v3.1.1 +menu.js.define=Definir direct\u00f3rio de scripts... +menu.js.dumb=Executar scripts favoritos sem o editor +JSeditor.opendfavfolder=Seleccionar Direct\u00f3rio de scripts +JSeditor.saveas=Guardar script como... \ No newline at end of file diff --git a/eric/docs/JZirkelProperties_pt_BR.properties b/eric/docs/JZirkelProperties_pt_BR.properties new file mode 100644 index 0000000..088d5e9 --- /dev/null +++ b/eric/docs/JZirkelProperties_pt_BR.properties @@ -0,0 +1,438 @@ +# Sample ResourceBundle properties file +menu.file=Arquivo +menu.file.new=Novo +menu.file.load=Abrir... +menu.file.save=Salvar +menu.file.saveas=Salva Como... + +menu.file.exportpng=Exportar para PNG +menu.file.exporteps=Exportar para EPS +menu.file.quit=Sair +menu.edit=Editar +menu.edit.copy=Copiar +menu.edit.move=Mover Objeto +menu.edit.rename=Renomear +menu.edit.edit=Editar +menu.edit.hide=Esconder +menu.edit.delete=Apagar +menu.display=Display +menu.display.hidden=Exibir/Esconder Objetos +menu.display.grid=Exibir/Esconder Malha +menu.display.finegrid=Eixos apenas +menu.display.leftsnap=Mover para a malha com o bot\u00E3o esquerdo +menu.display.manage_macros=Gerenciador de Macros +menu.display.history_panel=Hist\u00F3ria +menu.display.help_panel=Ajuda +menu.display.properties_panel=Propriedades +menu.display.small=\u00CDcones pequenos +menu.display.medium=\u00CDcones m\u00E9dios +menu.display.large=\u00CDcones grandes +menu.display.restrictedpalette=Exibir Paleta Reduzida +menu.display.restrictedpaletteedit=Editar Paleta Reduzida +menu.display.restrictmessage=
Este item permite que voc\u00EA visualize a paleta reduzida.

Esta op\u00E7\u00E3o afetar\u00E1 apenas para a constru\u00E7\u00E3o atual.

Ao salvar o arquivo ('Salvar Como...'), voc\u00EA poder\u00E1 escolher 'Salvar tamb\u00E9m a figura no modo reduzido'
e, ent\u00E3o, dois arquivos ser\u00E3o criados : o primeiro (.zir) abrir\u00E1 no modo normal e
o segundo (.r.zir) no modo reduzido
+menu.macros=Macros +menu.special=Especial +menu.special.newmacro=Nova Macro +menu.special.loadmacros=Abrir Macro... +menu.special.definejob=Definir um Exerc\u00EDcio +menu.special.loadjob=Abrir um Exerc\u00EDcio ... +menu.special.jobcomment=Configura o Texto do Exerc\u00EDcio ... +menu.special.testjob=Testar este Exerc\u00EDcio +menu.special.savejob=Salvar como Exerc\u00EDcio ... +menu.special.export=Criar Arquivo HTML +menu.special.exporttemplate=Exportar HTML como Modelo +menu.help=Ajuda +menu.help.about=Sobre o CaRMetal... +menu.help.info=Ajuda Contextualizada +menu.help.url0=Ir para a p\u00E1gina WEB do CaRMetal +menu.help.url1=Ir para a p\u00E1gina WEB do CARzine +menu.help.url2=Ir para a p\u00E1gina WEB oficial do C.a.R. + +filedialog.saveas=Salvar Figura +filedialog.alsorestricted=Salvar tamb\u00E9m a figura no modo reduzido +filedialog.options=Salvar Op\u00E7\u00F5es +filedialog.restrictedmessage=Voc\u00EA est\u00E1 trabalhando em uma sess\u00E3o no modo restrito,
assim sua figura ser\u00E1 salva neste modo. +filedialog.filefilter=Arquivo CaR (.zir) +filedialog.compressedfilefilter=Arquivo CaR Compactado (.zirz) +filedialog.macrofilefilter=Arquivo Macro CaR (.mcr) +filedialog.savemessage1=Arquivo :\n +filedialog.savemessage2=\nj\u00E1 existe. Voc\u00EA deseja substitu\u00ED-lo? + +palette.file=Arquivo +palette.edit=Editar +palette.construction=Constru\u00E7\u00E3o +palette.aspect=Aspecto Cor +palette.history=Hist\u00F3ria +palette.sizes=Tamanhos +palette.sizes.point=Ponto +palette.sizes.line=Reta +palette.sizes.arrow=Seta +palette.sizes.font=Fonte +palette.prec=Precis\u00E3o num\u00E9rica +palette.prec.lengths=Comprimentos +palette.prec.edit=Express\u00F5es +palette.prec.angles=\u00C2ngulos +palette.colors=Cor de Fundo imagem +palette.colors.saturated1=Cores saturadas +palette.colors.desaturated1=Cores menos saturadas +palette.colors.saturated2=Cores saturadas 2 +palette.colors.desaturated2=Cores menos saturadas 2 +palette.colors.constants=Constantes WEB +palette.image.fileerror=Voc\u00EA deve salvar esta constru\u00E7\u00E3o antes de usar esta ferramenta.

Depois, the figura que voc\u00EA escolher deve ficar
no sesmo diret\u00F3rio. + +palette.info.vector=Vetor +palette.info.image3=Incluir imagem com 2 ou 3 pontos +palette.info.background=Escolher/Limpar imagem de fundo +palette.info.imcenter=Centralizar imagem de fundo +palette.info.imstretch=Redimensionar a imagem de fundo para preencher a janela da constru\u00E7\u00E3o +palette.info.imtile=Ladrilhar a imagem de fundo +palette.info.copy=Copiar a janela de constru\u00E7\u00E3o +palette.info.exportpng=Exportar a janela de constru\u00E7\u00E3o para o formato PNG +palette.info.exporteps=Exportar a janela de constru\u00E7\u00E3o para o formato EPS +palette.info.newmacro=Criar uma nova macro +palette.info.loadmacros=Abrir um arquivo de macros +palette.info.manage_macros=Exibir/Esconder o painel de macros +palette.info.properties_panel=Exibir/Esconder o painel de propriedades +palette.info.history_panel=Exibir/Esconder o painel da hist\u00F3ria da constru\u00E7\u00E3o +palette.info.help_panel=Exibir/Esconder o painel de ajuda contextualizada + + + +macros.untitledmacro=Macro sem nome +macros.untitledfolder=Arquivo sem nome +macros.emptynode=-- Vazio -- +macros.addfolder=Criar um diret\u00F3rio novo +macros.deleteselected=Apagar macros selecionadas +macros.renamemacro=Renomear macro selecionada +macros.recordmacro=Gravar macros +macros.initials=Objectos iniciais ? +macros.pleaseselect=por favor, selecione! +macros.finals=Objetos finais ? +macros.cancel=Cancelar ? +macros.popup.run=Executar macro +macros.popup.rename=Renomear +macros.popup.delete=Apagar +macros.popup.addtolibrary=Acrescentar \u00E0 biblioteca +macros.popup.removefromlibrary=Remover da biblioteca +macros.popup.publish=Incluir na figura +macros.popup.notpublish=N\u00E3o incluir na figura +macros.popup.saveas=Salvar Como ... +macros.popup.properties=Exibir propriedades +macros.popup.duplicate=Duplicar +macros.savedlog.buttonok=Salvar o arquivo de macros +macros.question.delete=Voc\u00EA tem certeza que quer apagar estas macros ? + +rene.zirkel.objects.PointObject=Ponto +rene.zirkel.objects.PrimitiveCircleObject=Circunfer\u00EAncia +rene.zirkel.objects.PrimitiveLineObject=Reta +rene.zirkel.objects.ExpressionObject=Express\u00E3o. +rene.zirkel.objects.FixedAngleObject=\u00C2nguloFixo +rene.zirkel.objects.SegmentObject=Segmento. +rene.zirkel.objects.RayObject=Semi-reta +rene.zirkel.objects.TwoPointLineObject=Reta +rene.zirkel.objects.FunctionObject=Fun\u00E7\u00E3o +rene.zirkel.objects.AreaObject=\u00C1rea + + +mi.pal.name=Gerenciador de macros +mi.name=Nome : +mi.comment=Coment\u00E1rio : +mi.properties=Propriedades dos objetos iniciais : +mi.hideproperties=Propriedades dos objetos finais : +mi.hideduplicates=Esconder objetos duplicados +mi.apply=Aplicar +mi.tab.type=Tipo +mi.tab.name=Nome +mi.tab.prompt=Entrada de Dados +mi.tab.fix=Fixar ? +mi.tab.ask=Perguntar ? +mi.error.initial=Erro : pelo menos um par\u00E2metro \ntem que ser um objeto livre (nem fixado, nem requerido)\n\nEsta macro n\u00E3o ser\u00E1 modificada. + +props.help=Para ver suas propriedades, voc\u00EA deve clicar no objeto como bot\u00E3o direito do mouse.

Se voc\u00EA criar um objeto com este painel aberto, voc\u00EA poder\u00E1 mudar sua propriedades durante o processo. +props.name=Nome : +props.alias=Apelido : +props.unit=Unidade : +props.fix=Fixar : +props.expl=Explica\u00E7\u00E3o : +props.belongto=Camada : +props.conditional=Aspecto Condicional : +props.solid=S\u00F3lido : +props.hidden=Escondido : +props.normal=Normal : +props.bold=Fino : +props.thin=Pontilhado : +props.black=Preto : +props.green=Verde : +props.blue=Azul : +props.brown=Marrom : +props.cyan=Turquesa : +props.red=Vermelho : +props.showasslider=Seletor +props.error=Existe um erro de sintaxe na express\u00E3o.
Ela ser\u00E1 +reinicializada. +props.cartesian=Fun\u00E7\u00E3o +props.parametric=Fun\u00E7\u00E3o param\u00E9trica +props.functiontype=Tipo : +props.killarc=Apagar arco +props.arc=Arco +props.release=Liberar +props.bind=Prender +props.setaway=Longe de +props.setclose=Perto de + + +# v1.3 : +props.grid=Incremento : +props.inside=No interior do objeto : +props.pointsonly=Apenas para pontos : +props.step=Passo : +palette.grid=Malha +leftpanel.macros=Painel de macros +leftpanel.properties=Painel de propriedades +leftpanel.history=Painel do hist\u00F3rico +leftpanel.help=Painel da ajuda +selectpopup.whatobject=qual objeto ? +selectpopup.RightClick=Selecionar +selectpopup.MoverTool=Mover +selectpopup.HiderTool=Exibir/Esconder +selectpopup.DeleteTool=Apagar +selectpopup.RenamerTool=Renomear +selectpopup.EditTool=Editar +selectpopup.SetParameterTool=Objetos iniciais da macro : +selectpopup.SetTargetsTool=Objetos finais da macro : +palette.info.locus=Lugar geom\u00E9trico + +# v1.4 : +menu.special.savezirset=Criar exibi\u00E7\u00E3o ... +filedialog.openfolder.title=Exibi\u00E7\u00E3o: Janela de Di\u00E1logo +filedialog.openfolder.approve=Escolher diret\u00F3rio +filedialog.openfolder.saveicons=Salvar tamb\u00E9m os \u00EDcones reduzidos +slideshow.next=pr\u00F3ximo +slideshow.previous=anterior +slideshow.download=Baixar arquivo +slideshow.signature=Exibi\u00E7\u00E3o feita com + +# v1.5 : +menu.language=Idiomas +menu.language.de=Deutsch +menu.language.en=English +menu.language.fr=Fran\u00E7ais +menu.language.es=Espa\u00F1ol +menu.language.gl=Galego +menu.language.zh_TW=Chinese (Traditional) +menu.help.url3=Translate CaRMetal +menu.display.smartboard=Modo smartboard + +# v1.6 : +menu.language.no=Norsk +palette.info.bi_syma=Reflex\u00E3o +palette.info.bi_symc=Simetria +palette.info.bi_trans=Transla\u00E7\u00E3o +palette.info.bi_med=Mediatriz +palette.info.bi_biss=Bissetriz +palette.info.bi_circ=Circunfer\u00EAncia por 3 pontos +palette.info.bi_arc=Arco circuncircular por 3 pontos +palette.info.bi_t_align=Pontos colineares ? +palette.info.bi_t_para=Retas paralelas ? +palette.info.bi_t_perp=Retas perpendiculares ? +palette.info.bi_t_equi=Ponto eq\u00FCidistante de outros dois pontos ? +palette.info.bi_t_app=Pertence a uma reta ? +palette.info.bi_t_conf=Pontos coincidentes ? +macro.bi_syma.0=Eixo de simetria ? +macro.bi_syma.1=Ponto sim\u00E9trico a qual ponto ? +macro.bi_symc.0=Centro de simetria ? +macro.bi_symc.1=Ponto sim\u00E9trico a qual ponto ? +macro.bi_trans.0=Extremidade inicial do vetor ? +macro.bi_trans.1=Extremidade final do vetor ? +macro.bi_trans.2=Ponto a ser transladado ? +macro.bi_med.0=Primeira extremidade do segmento ? +macro.bi_med.1=Segunda extremidade do segmento ? +macro.bi_biss.0=Primeiro ponto ? +macro.bi_biss.1=V\u00E9rtice do \u00E2ngulo ? +macro.bi_biss.2=\u00DAltimo ponto ? +macro.bi_circ.0=Primeito ponto ? +macro.bi_circ.1=Segundo ponto ? +macro.bi_circ.2=Terceiro ponto ? +macro.bi_t_para.0=Primeira reta ? +macro.bi_t_para.1=Segunda reta ? +macro.bi_t_equi.0=Este ponto \u00E9 eq\u00FCidistante ... +macro.bi_t_equi.1=deste ponto ... +macro.bi_t_equi.2=e deste ponto ? +macro.bi_t_app.0=Qual ponto ? +macro.bi_t_app.1=Pertence a qual reta (ou segmento) ? +macro.bi_t_conf.0=Qual ponto ? +macro.bi_t_conf.1=Coincide com qual ponto ? +macro.bi_t_align.text0=Pontos s\u00E3o colineares +macro.bi_t_align.text1=Pontos n\u00E3o s\u00E3o colineares +macro.bi_t_para.text0=Objetos s\u00E3o paralelos +macro.bi_t_para.text1=Objetos n\u00E3o s\u00E3o paralelos +macro.bi_t_perp.text0=Objetos s\u00E3o perpendiculares +macro.bi_t_perp.text1=Objetos n\u00E3o s\u00E3o perpendiculares +macro.bi_t_equi.text0=Pontos s\u00E3o eq\u00FCidistantes +macro.bi_t_equi.text1=Pontos n\u00E3o s\u00E3o eq\u00FCidistantes +macro.bi_t_app.text0=O ponto pertence ao objeto +macro.bi_t_app.text1=O ponto n\u00E3o pertence ao objeto +macro.bi_t_conf.text0=Os dois pontos s\u00E3o coincidentes +macro.bi_t_conf.text1=Os dois pontos n\u00E3o s\u00E3o coincidentes +palette.test=Testar + +# v1.7 : +filedialog.openfolder.appletsize=Tamanho do applet : +filedialog.openfolder.actualsize=Tamanho atual +filedialog.openfolder.other=Outro ... +filedialog.openfolder.selected=Selecionar diret\u00F3rio : +filedialog.openfolder.cancel=Cancelar +menu.file.exportsvg=Exportar no formato SVG +menu.language.sl=Slovenski +menu.language.nl=Nederlands +menu.language.pt=Portugu\u00EAs (Portugal) +props.vars=Vari\u00E1veis : +menu.objects.points=Pontos +menu.objects.lines=Retas +menu.objects.segments=Segmentos +menu.objects.circles=Circunfer\u00EAncias e c\u00F4nicas +menu.objects.angles=\u00C2ngulos +menu.objects.tracks=Tra\u00E7os e lugares geom\u00E9tricos +menu.objects.functions=Fun\u00E7\u00F5es e express\u00F5es +palette.info.function_u=Fun\u00E7\u00E3o definida pelo usu\u00E1rio +palette.info.function=Exibir fun\u00E7\u00E3o ou curva param\u00E9trica +props.superhidden=Completamente escondido : +props.showvalue=Exibir valor : +props.showname=Exibir nome : +props.background=Fundo : +macro.bi_expression.0=Ponto \u00E2ncora ? + + +# v1.9a : +menu.help.licence=Licen\u00E7a ... +licence.txt=

Este programa \u00E9 gratuito seguindo a licen\u00E7a GNU-GPL, o que significa que voc\u00EA pode redistribu\u00ED-lo e/ou modific\u00E1-lo seguindo os termos da licen\u00E7a publicada pela Free Software Foundation;
Veja :

+ + +# v2.0 : +menu.special.theme=Temas +menu.special.theme.gray=Metal polido +menu.special.theme.brushed=Metal escovado +menu.special.options=Prefer\u00EAncias ... +menu.special.options.sizes=Tamanhos +menu.special.options.sizes.minpointsize=Tamanho de pontos +menu.special.options.sizes.minlinesize=Espessura de retas +menu.special.options.sizes.arrowsize=Tamanho de setas +menu.special.options.sizes.minfontsize=Tamanho da fonte +menu.special.options.sizes.digits.lengths=Precis\u00E3o em comprimentos +menu.special.options.sizes.digits.edit=Precis\u00E3o em express\u00F5es +menu.special.options.sizes.digits.angles=Precis\u00E3o em \u00E2ngulos +menu.special.options.colors=Cores +menu.special.options.others=Outros +menu.special.options.others.undock=Permitir a separa\u00E7\u00E3o de paletas + +# v2.1 : +menu.file.close=Fechar janela + +# v2.3 : +alert.toomuchwins=Existem muitas janelas abertas :
por favor, +feche algumas delas antes de abrir
uma nova + +# v2.4 : +menu.file.new3D=Nova figura 3D +palette.3D=3D +palette.info.bi_3Dcoords=coordenadas 3D +macro.bi_3Dcoords.0=Ponto \u00E2ncora ? +palette.info.bi_3Dcube=Cubo +macro.bi_3Dcube.0=Centro do cubo ? +palette.info.bi_3Darete=Arestas 3D +macro.bi_3Darete.0=Primeiro ponto ? +macro.bi_3Darete.1=Segundo ponto ? +macro.bi_3Darete.2=Terceiro ponto ? +macro.bi_3Darete.3=Quarto ponto ? +palette.info.bi_3Dtetra=Tetraedro regular +macro.bi_3Dtetra.0=Centro do tetraedro ? +menu.newdoc=Novo +menu.language.it=Italiano + +# v2.5.5 : +palette.aspect.label.text_title=Aspecto de +palette.aspect.label.point=pontos +palette.aspect.label.line=retas +palette.aspect.label.segment=segmentos +palette.aspect.label.circle=circunfer\u00EAncias +palette.aspect.label.angle=\u00E2ngulos +palette.aspect.label.area=pol\u00EDgonos +palette.aspect.label.text=textos +palette.info.bi_3Ddode=Dodecaedro regular +macro.bi_3Ddode.0=Centro do dodecaedro ? + +# v2.7 : +palette.aspect.label.pointshape=Nome & formato de pontos : +palette.aspect.label.locus=Lugar geom\u00E9trico +menu.edit.deleteall=Apagar tudo + + +# v2.7.1 : +java.old.message=Lamento, mas n\u00E3o \u00E9 poss\u00EDvel abrir o CaRMetal porque +sua vers\u00E3o da linguagem JAVA \u00E9 muito antiga ! +java.old.quit=Sair +java.old.go=Baixe uma nova vers\u00E3o da linguagem JAVA +palette.info.boundedpoint=Colocar um ponto em um plano+ou sobre a face de um poliedro + +#v2.7.2 : +user.foldername=Perfil do Usu\u00E1rio + +#v2.8 +props.fixedray=Semi-reta : +props.fixedsegment=Comprimento : +props.fixedangle=\u00E2ngulo : +props.expl=Coment\u00E1rio : +props.aspecttab=Aspecto +props.numerictab=Num\u00E9rico +props.conditionaltab=Condicional +props.thick=Espessura : +props.popup.special=Caracteres Especiais +props.popup.functions=Fun\u00E7\u00F5es pr\u00E9-definidas +props.popup.latex=Comandos LaTeX +menu.language.pl=Polski + +#v2.8.1 +props.fixedinwindow=Atado \u00E0 janela + +#v2.8.5 +palette.controls=Controles +props.ctrlshowvalue=Exibir valor +props.ctrlsnap=Mover para as marcas +props.ctrlshowticks=Exibir marcar +props.ctrltickspacing=Incremento : +palette.info.ctrl_edit=Editar, mover ou redimensionar controle +palette.info.ctrl_chkbox=Acrescentar caixa de controle +palette.info.ctrl_popup=Acrescentar menu popup +palette.info.ctrl_slider=Acrescentar seletor + +#v2.8.6 +props.trackdmin=N\u00FAmero de passos : +opendialog.preview=Visualizar : +pngdialog.options=Op\u00E7\u00F5es : +pngdialog.scale=Escalar : +pngdialog.originsize=Tamanho original : +pngdialog.scaledsize=Tamanho redimensionado : + +#v2.8.7 +canvas.3D.floor=Ch\u00E3o +canvas.3D.system=Sistema de coordenadas +canvas.3D.rightclic=Use o bot\u00E3o direito do mouse para girar o sistema de coordenadas + + +#v2.8.8 +palette.info.equationxy=Curva definida por f(x,y)=0 +props.equationxy=Equa\u00E7\u00E3o : +props.equationxychooser=Precis\u00E3o : +palette.function=Fun\u00E7\u00F5es & lugares geom\u00E9tricos + +#v2.8.9 +menu.edit.deletealltracks=Limpar tra\u00E7os +menu.edit.deactivatealltracks=Desativar tra\u00E7os +props.tracks=Ativar tra\u00E7o +menu.edit.zoom=Zoom ou mover + +#v2.9.0 +menu.windows=Janela + +#v2.9.1 +contexthelp.seealso=Veja tamb\u00E9m : \ No newline at end of file diff --git a/eric/docs/JZirkelProperties_ru_RU.properties b/eric/docs/JZirkelProperties_ru_RU.properties new file mode 100644 index 0000000..7f081bf --- /dev/null +++ b/eric/docs/JZirkelProperties_ru_RU.properties @@ -0,0 +1,481 @@ +# Sample ResourceBundle properties file +menu.file=\u0424\u0430\u0439\u043b +menu.file.new=\u041d\u043e\u0432\u044b\u0439 +menu.file.load=\u041e\u0442\u043a\u0440\u044b\u0442\u044c... +menu.file.save=\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c +menu.file.saveas=\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432... + +menu.file.exportpng=\u042d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 PNG +menu.file.exporteps=\u042d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 EPS +menu.file.quit=\u0417\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c +menu.edit=\u041f\u0440\u0430\u0432\u043a\u0430 +menu.edit.copy=\u0421\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c +menu.edit.move=\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 +menu.edit.rename=\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c +menu.edit.edit=\u041f\u0440\u0430\u0432\u0438\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 +menu.edit.hide=\u0421\u043a\u0440\u044b\u0442\u044c +menu.edit.delete=\u0423\u0434\u0430\u043b\u0438\u0442\u044c +menu.display=\u0412\u0438\u0434 +menu.display.hidden=\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c/\u0441\u043a\u0440\u044b\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u044b +menu.display.grid=\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c/\u0441\u043a\u0440\u044b\u0442\u044c \u0441\u0435\u0442\u043a\u0443 +menu.display.finegrid=\u0422\u043e\u043b\u044c\u043a\u043e \u043e\u0441\u0438 +menu.display.leftsnap=\u00ab\u041f\u0440\u0438\u043b\u0438\u043f\u0430\u0442\u044c\u00bb \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u043d\u0438\u0438 +menu.display.manage_macros=\u0418\u043d\u0441\u043f\u0435\u043a\u0442\u043e\u0440 \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432 +menu.display.history_panel=\u0418\u0441\u0442\u043e\u0440\u0438\u044f +menu.display.help_panel=\u0421\u043f\u0440\u0430\u0432\u043a\u0430 +menu.display.properties_panel=\u041f\u0430\u043d\u0435\u043b\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 +menu.display.small=\u041c\u0435\u043b\u043a\u0438\u0435 \u0437\u043d\u0430\u0447\u043a\u0438 +menu.display.medium=\u0421\u0440\u0435\u0434\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u043a\u0438 +menu.display.large=\u041a\u0440\u0443\u043f\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u043a\u0438 +menu.display.restrictedpalette=\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u0443\u044e \u043f\u0430\u043d\u0435\u043b\u044c +menu.display.restrictedpaletteedit=\u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u0443\u044e \u043f\u0430\u043d\u0435\u043b\u044c +menu.display.restrictmessage=
\u042d\u0442\u043e\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u0443\u044e \u043f\u0430\u043d\u0435\u043b\u044c.

\u041e\u043d\u0430 \u0441\u0432\u044f\u0437\u0430\u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u0442\u0435\u043a\u0443\u0449\u0438\u043c \u0444\u0430\u0439\u043b\u043e\u043c:

\u043f\u0440\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0438 \u043f\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u0435 \u00ab\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432\u00bb \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u00ab\u0422\u0430\u043a\u0436\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0447\u0435\u0440\u0442\u0435\u0436 \u0441 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u043c\u0438\u00bb,
\u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0434\u0432\u0430 \u0444\u0430\u0439\u043b\u0430: \u043f\u0435\u0440\u0432\u044b\u0439 (.zir) \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u00ab\u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u043c\u00bb \u0440\u0435\u0436\u0438\u043c\u0435,
\u0432\u0442\u043e\u0440\u043e\u0439 \u2014 (.r.zir) \u0432 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u043c
+menu.macros=\u041c\u0430\u043a\u0440\u043e\u0441 +menu.special=\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e +menu.special.newmacro=\u041d\u043e\u0432\u044b\u0439 \u043c\u0430\u043a\u0440\u043e\u0441 +menu.special.loadmacros=\u041e\u0442\u043a\u0440\u044b\u0442\u044c \u043c\u0430\u043a\u0440\u043e\u0441... +menu.special.definejob=\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0437\u0430\u0434\u0430\u043d\u0438\u0435 +menu.special.loadjob=\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0437\u0430\u0434\u0430\u043d\u0438\u0435... +menu.special.jobcomment=\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0437\u0430\u0434\u0430\u043d\u0438\u0435... +menu.special.testjob=\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u044d\u0442\u043e \u0437\u0430\u0434\u0430\u043d\u0438\u0435 +menu.special.savejob=\u0421\u043e\u0445\u0430\u0440\u043d\u0438\u0442\u044c \u043a\u0430\u043a \u0437\u0430\u0434\u0430\u043d\u0438\u0435... +menu.special.export=\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0430\u0439\u043b HTML \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 +menu.special.exporttemplate=\u042d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 HTML \u0441 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u043c +menu.help=\u0421\u043f\u0440\u0430\u0432\u043a\u0430 +menu.help.about=\u041e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435 CaRMetal... +menu.help.info=\u041a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u0430\u044f \u0441\u043f\u0440\u0430\u0432\u043a\u0430 +menu.help.url0=\u041d\u0430 \u0441\u0430\u0439\u0442 CaRMetal +menu.help.url1=\u041d\u0430 \u0441\u0430\u0439\u0442 CARzine +menu.help.url2=\u041d\u0430 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0430\u0439\u0442 C.a.R. + +filedialog.saveas=\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0447\u0435\u0440\u0442\u0435\u0436 +filedialog.alsorestricted=\u0422\u0430\u043a\u0436\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0447\u0435\u0440\u0442\u0435\u0436 \u0441 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u043c\u0438 +filedialog.options=\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b +filedialog.restrictedmessage=\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b,
\u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0447\u0435\u0440\u0442\u0435\u0436 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d \u0432 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435 +filedialog.filefilter=\u0424\u0430\u0439\u043b CaR (.zir) +filedialog.compressedfilefilter=\u0421\u0436\u0430\u0442\u044b\u0439 \u0444\u0430\u0439\u043b CaR (.zirz) +filedialog.macrofilefilter=\u0424\u0430\u0439\u043b \u043c\u0430\u043a\u0440\u043e\u0441\u0430 CaR (.mcr) +filedialog.savemessage1=\u0424\u0430\u0439\u043b:\n +filedialog.savemessage2=\n\u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442. \u0425\u043e\u0442\u0438\u0442\u0435 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0435\u0433\u043e? + +palette.file=\u0424\u0430\u0439\u043b +palette.edit=\u041f\u0440\u0430\u0432\u043a\u0430 +palette.construction=\u041f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 +palette.aspect=\u041e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u0435 +palette.history=\u0418\u0441\u0442\u043e\u0440\u0438\u044f +palette.sizes=\u0420\u0430\u0437\u043c\u0435\u0440\u044b +palette.sizes.point=\u0422\u043e\u0447\u043a\u0430 +palette.sizes.line=\u041b\u0438\u043d\u0438\u044f +palette.sizes.arrow=\u0421\u0442\u0440\u0435\u043b\u043a\u0430 +palette.sizes.font=\u0428\u0440\u0438\u0444\u0442 +palette.prec=\u0422\u043e\u0447\u043d\u043e\u0441\u0442\u044c +palette.prec.lengths=\u0420\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044f +palette.prec.edit=\u0412\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f +palette.prec.angles=\u0423\u0433\u043b\u044b +palette.colors=\u0424\u043e\u043d\u043e\u0432\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438 \u0446\u0432\u0435\u0442 +palette.colors.saturated1=\u041d\u0430\u0441\u044b\u0449\u0435\u043d\u043d\u044b\u0435 \u0446\u0432\u0435\u0442\u0430 +palette.colors.desaturated1=\u041d\u0435\u043d\u0430\u0441\u044b\u0449\u0435\u043d\u043d\u044b\u0435 \u0446\u0432\u0435\u0442\u0430 +palette.colors.saturated2=\u041d\u0430\u0441\u044b\u0449\u0435\u043d\u043d\u044b\u0435 \u0446\u0432\u0435\u0442\u0430 2 +palette.colors.desaturated2=\u041d\u0435\u043d\u0430\u0441\u044b\u0449\u0435\u043d\u043d\u044b\u0435 \u0446\u0432\u0435\u0442\u0430 2 +palette.colors.constants=\u0411\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0435 \u0446\u0432\u0435\u0442\u0430 Web +palette.image.fileerror=\u0421\u043b\u0435\u0434\u0443\u0435\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0447\u0435\u0440\u0442\u0435\u0436 \u043f\u0435\u0440\u0435\u0434 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u044d\u0442\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430

\u0414\u0430\u043b\u0435\u0435, \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c,
\u0434\u043e\u043b\u0436\u043d\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0442\u043e\u0439 \u0436\u0435 \u043f\u0430\u043f\u043a\u0435. + +palette.info.vector=\u0412\u0435\u043a\u0442\u043e\u0440 +palette.info.image3=\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435+\u043f\u043e 2 \u0438\u043b\u0438 3 \u0442\u043e\u0447\u043a\u0430\u043c +palette.info.background=\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c/\u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0444\u043e\u043d\u043e\u0432\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 +palette.info.imcenter=\u0426\u0435\u043d\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u043e\u043d\u043e\u0432\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 +palette.info.imstretch=\u0420\u0430\u0441\u0442\u044f\u043d\u0443\u0442\u044c \u0444\u043e\u043d\u043e\u0432\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435+\u043d\u0430 \u0432\u0441\u0451 \u043e\u043a\u043d\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f +palette.info.imtile=\u0417\u0430\u0441\u0442\u0435\u043b\u0438\u0442\u044c \u043f\u043b\u0438\u0442\u043a\u0430\u043c\u0438 +palette.info.copy=\u041a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u043a\u043d\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f +palette.info.exportpng=\u042d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435+\u0432 \u0444\u043e\u0440\u043c\u0430\u0442 png +palette.info.exporteps=\u042d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435+\u0432 \u0444\u043e\u0440\u043c\u0430\u0442 eps +palette.info.newmacro=\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043c\u0430\u043a\u0440\u043e\u0441 +palette.info.loadmacros=\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0444\u0430\u0439\u043b \u043c\u0430\u043a\u0440\u043e\u0441\u0430 +palette.info.manage_macros=\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c/\u0441\u043a\u0440\u044b\u0442\u044c \u043f\u0430\u043d\u0435\u043b\u044c \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432 +palette.info.properties_panel=\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c/\u0441\u043a\u0440\u044b\u0442\u044c \u043f\u0430\u043d\u0435\u043b\u044c+\u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 +palette.info.history_panel=\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c/\u0441\u043a\u0440\u044b\u0442\u044c \u043f\u0430\u043d\u0435\u043b\u044c+\u0438\u0441\u0442\u043e\u0440\u0438\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f +palette.info.help_panel=\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c/\u0441\u043a\u0440\u044b\u0442\u044c \u043f\u0430\u043d\u0435\u043b\u044c+\u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u043e\u0439 \u0441\u043f\u0440\u0430\u0432\u043a\u0438 + + + +macros.untitledmacro=\u0411\u0435\u0437\u044b\u043c\u044f\u043d\u043d\u044b\u0439 \u043c\u0430\u043a\u0440\u043e\u0441 +macros.untitledfolder=\u0411\u0435\u0437\u044b\u043c\u044f\u043d\u043d\u0430\u044f \u043f\u0430\u043f\u043a\u0430 +macros.emptynode=-- \u041f\u0443\u0441\u0442\u043e -- +macros.addfolder=\u041d\u043e\u0432\u0430\u044f \u043f\u0430\u043f\u043a\u0430 +macros.deleteselected=\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u043c\u0430\u043a\u0440\u043e\u0441 +macros.renamemacro=\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u043c\u0430\u043a\u0440\u043e\u0441 +macros.recordmacro=\u0417\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043c\u0430\u043a\u0440\u043e\u0441 +macros.initials=\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b? +macros.pleaseselect=\u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430! +macros.finals=\u041a\u043e\u043d\u0435\u0447\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b? +macros.cancel=\u041e\u0442\u043c\u0435\u043d\u0438\u0442\u044c? +macros.popup.run=\u0418\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043c\u0430\u043a\u0440\u043e\u0441 +macros.popup.rename=\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c +macros.popup.delete=\u0423\u0434\u0430\u043b\u0438\u0442\u044c +macros.popup.addtolibrary=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 +macros.popup.removefromlibrary=\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0438\u0437 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 +macros.popup.publish=\u0412\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432 \u0447\u0435\u0440\u0442\u0435\u0436 +macros.popup.notpublish=\u041d\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0432 \u0447\u0435\u0440\u0442\u0435\u0436 +macros.popup.saveas=\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432... +macros.popup.properties=\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 +macros.popup.duplicate=\u0414\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c +macros.savedlog.buttonok=\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0444\u0430\u0439\u043b \u043c\u0430\u043a\u0440\u043e\u0441\u0430 +macros.question.delete=\u0412\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043c\u0430\u043a\u0440\u043e\u0441? + +rene.zirkel.objects.PointObject=\u0422\u0447 +rene.zirkel.objects.PrimitiveCircleObject=\u041e\u043a\u0440 +rene.zirkel.objects.PrimitiveLineObject=\u041b\u0438\u043d +rene.zirkel.objects.ExpressionObject=\u0412\u044b\u0440\u0430\u0436 +rene.zirkel.objects.FixedAngleObject=\u0424\u0438\u043a\u0441\u0423\u0433 +rene.zirkel.objects.SegmentObject=\u0421\u0435\u0433\u043c +rene.zirkel.objects.RayObject=\u041b\u0443\u0447 +rene.zirkel.objects.TwoPointLineObject=\u041b\u0438\u043d +rene.zirkel.objects.FunctionObject=\u0424\u0443\u043d\u043a +rene.zirkel.objects.AreaObject=\u041e\u0431\u043b + + +mi.pal.name=\u0418\u043d\u0441\u043f\u0435\u043a\u0442\u043e\u0440 \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432 +mi.name=\u0418\u043c\u044f: +mi.comment=\u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439: +mi.properties=\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b: +mi.hideproperties=\u0426\u0435\u043b\u0435\u0432\u044b\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430: +mi.hideduplicates=\u0421\u043a\u0440\u044b\u0442\u044c \u0434\u0443\u0431\u043b\u0438\u043a\u0430\u0442\u044b +mi.apply=\u041f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c +mi.tab.type=\u0422\u0438\u043f +mi.tab.name=\u0418\u043c\u044f +mi.tab.prompt=\u041f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0430 +mi.tab.fix=\u0424\u0438\u043a\u0441.? +mi.tab.ask=\u0417\u0430\u043f\u0440\u043e\u0441? +mi.error.initial=\u041e\u0448\u0438\u0431\u043a\u0430: \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043e\u0434\u0438\u043d \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \n\u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u043c (\u043d\u0435 \u0444\u0438\u043a\u0441., \u043d\u0435 \u0437\u0430\u043f\u0440\u043e\u0441)\n\n\u041c\u0430\u043a\u0440\u043e\u0441 \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d + +props.help=\u0427\u0442\u043e\u0431\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430, \u043d\u0443\u0436\u043d\u043e \u0449\u0435\u043b\u043a\u043d\u0443\u0442\u044c \u043d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u0435 \u043f\u0440\u0430\u0432\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u043e\u0439.

\u0415\u0441\u043b\u0438 \u0432\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0435 \u043d\u043e\u0432\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442, \u043a\u043e\u0433\u0434\u0430 \u044d\u0442\u0430 \u043f\u0430\u043d\u0435\u043b\u044c \u043e\u0442\u043a\u0440\u044b\u0442\u0430, \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0435\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f. +props.name=\u0418\u043c\u044f: +props.alias=\u041f\u0441\u0435\u0432\u0434\u043e\u043d\u0438\u043c: +props.unit=\u0415\u0434\u0438\u043d\u0438\u0446\u044b: +props.fix=\u0424\u0438\u043a\u0441.: +props.expl=\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435: +props.belongto=\u0421\u043b\u043e\u0439: +props.conditional=\u0423\u0441\u043b\u043e\u0432\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e: +props.solid=Solid: +props.hidden=\u0421\u043a\u0440\u044b\u0442\u044b\u0439: +props.normal=\u041d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u0430\u044f: +props.bold=\u0422\u043e\u043b\u0441\u0442\u0430\u044f: +props.thin=\u041f\u0443\u043d\u043a\u0442\u0438\u0440\u043d\u0430\u044f: +props.black=\u0427\u0435\u0440\u043d\u044b\u0439: +props.green=\u0417\u0435\u043b\u0435\u043d\u044b\u0439: +props.blue=\u0421\u0438\u043d\u0438\u0439: +props.brown=\u041a\u043e\u0440\u0438\u0447\u043d\u0435\u0432\u044b\u0439: +props.cyan=\u0413\u043e\u043b\u0443\u0431\u043e\u0439: +props.red=\u041a\u0440\u0430\u0441\u043d\u044b\u0439: +props.showasslider=\u0414\u0432\u0438\u0436\u043e\u043a +props.error=\u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u0432 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0438.
It will be reinitialized +props.cartesian=\u0414\u0435\u043a\u0430\u0440\u0442\u043e\u0432\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f +props.parametric=\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0430\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f +props.functiontype=\u0422\u0438\u043f: +props.killarc=Kill arc +props.arc=\u0414\u0443\u0433\u0430 +props.release=\u041e\u0441\u0432\u043e\u0431\u043e\u0434\u0438\u0442\u044c +props.bind=\u0421\u0432\u044f\u0437\u0430\u0442\u044c +props.setaway=Set away +props.setclose=Set close + + +# v1.3 : +props.grid=\u0418\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442: +props.inside=\u0412\u043d\u0443\u0442\u0440\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430: +props.pointsonly=\u0422\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u0447\u043a\u0438: +props.step=\u0428\u0430\u0433: +palette.grid=\u0412\u0438\u0434 \u0441\u0435\u0442\u043a\u0438 +leftpanel.macros=\u041f\u0430\u043d\u0435\u043b\u044c \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432 +leftpanel.properties=\u041f\u0430\u043d\u0435\u043b\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432 +leftpanel.history=\u041f\u0430\u043d\u0435\u043b\u044c \u0438\u0441\u0442\u043e\u0440\u0438\u0438 +leftpanel.help=\u041f\u0430\u043d\u0435\u043b\u044c \u0441\u043f\u0440\u0430\u0432\u043a\u0438 +selectpopup.whatobject=\u043a\u0430\u043a\u043e\u0439 \u043e\u0431\u044a\u0435\u043a\u0442? +selectpopup.RightClick=\u0412\u044b\u0431\u0440\u0430\u0442\u044c +selectpopup.MoverTool=\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c +selectpopup.HiderTool=\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c/\u0441\u043a\u0440\u044b\u0442\u044c +selectpopup.DeleteTool=\u0423\u0434\u0430\u043b\u0438\u0442\u044c +selectpopup.RenamerTool=\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c +selectpopup.EditTool=\u041f\u0440\u0430\u0432\u0438\u0442\u044c +selectpopup.SetParameterTool=\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043c\u0430\u043a\u0440\u043e: +selectpopup.SetTargetsTool=\u0426\u0435\u043b\u0438 \u043c\u0430\u043a\u0440\u043e: +palette.info.locus=\u041c\u0435\u0441\u0442\u043e \u0442\u043e\u0447\u043a\u0438+\u041e\u0433\u0438\u0431\u0430\u044e\u0449\u0430\u044f \u043b\u0438\u043d\u0438\u0438 + +# v1.4 : +menu.special.savezirset=\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043b\u0430\u0439\u0434-\u0448\u043e\u0443... +filedialog.openfolder.title=\u0414\u0438\u0430\u043b\u043e\u0433 \u0432\u044b\u0431\u043e\u0440\u0430 \u043f\u0430\u043f\u043a\u0438 \u0441\u043b\u0430\u0439\u0434-\u0448\u043e\u0443 +filedialog.openfolder.approve=\u0412\u044b\u0431\u0440\u0430\u0442\u044c \u043f\u0430\u043f\u043a\u0443 \u0441\u043b\u0430\u0439\u0434-\u0448\u043e\u0443 +filedialog.openfolder.saveicons=\u0422\u0430\u043a\u0436\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u043a\u0438 +slideshow.next=\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 +slideshow.previous=\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 +slideshow.download=\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0444\u0430\u0439\u043b +slideshow.signature=\u0421\u043b\u0430\u0439\u0434-\u0448\u043e\u0443 \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u0432 + +# v1.5 : +menu.language=\u042f\u0437\u044b\u043a\u0438 +menu.language.de=Deutsch +menu.language.en=English +menu.language.fr=Fran\u00e7ais +menu.language.es=Espa\u00f1ol +menu.language.gl=Galego +menu.language.zh_TW=Chinese (Traditional) +menu.help.url3=\u041f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 CaRMetal +menu.display.smartboard=\u0420\u0435\u0436\u0438\u043c Smartboard + +# v1.6 : +menu.language.no=Norsk +palette.info.bi_syma=\u041e\u0442\u0440\u0430\u0436\u0435\u043d\u0438\u0435 +palette.info.bi_symc=\u0421\u0438\u043c\u043c\u0435\u0442\u0440\u0438\u044f +palette.info.bi_trans=\u041f\u0435\u0440\u0435\u043d\u043e\u0441 +palette.info.bi_med=\u0421\u0440\u0435\u0434\u0438\u043d\u043d\u044b\u0439 \u043f\u0435\u0440\u043f\u0435\u043d\u0434\u0438\u043a\u0443\u043b\u044f\u0440 +palette.info.bi_biss=\u0411\u0438\u0441\u0441\u0435\u043a\u0442\u0440\u0438\u0441\u0430 +palette.info.bi_circ=\u041e\u043a\u0440\u0443\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e 3 \u0442\u043e\u0447\u043a\u0430\u043c +palette.info.bi_arc=\u0414\u0443\u0433\u0430 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0439 \u043e\u043a\u0440\u0443\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u043e 3 \u0442\u043e\u0447\u043a\u0430\u043c +palette.info.bi_t_align=\u041a\u043e\u043b\u043b\u0438\u043d\u0435\u0430\u0440\u043d\u044b\u0435 \u0442\u043e\u0447\u043a\u0438? +palette.info.bi_t_para=\u041f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u044f\u043c\u044b\u0435? +palette.info.bi_t_perp=\u041f\u0435\u0440\u043f\u0435\u043d\u0434\u0438\u043a\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u043f\u0440\u044f\u043c\u044b\u0435? +palette.info.bi_t_equi=\u042d\u043a\u0432\u0438\u0434\u0438\u0441\u0442\u0430\u043d\u0442\u043d\u043e \u043e\u0442 \u0434\u0432\u0443\u0445 \u0442\u043e\u0447\u0435\u043a? +palette.info.bi_t_app=\u041b\u0435\u0436\u0438\u0442 \u043d\u0430 \u043b\u0438\u043d\u0438\u0438? +palette.info.bi_t_conf=\u0422\u043e\u0447\u043a\u0438 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442? +macro.bi_syma.0=\u041e\u0441\u044c \u0441\u0438\u043c\u043c\u0435\u0442\u0440\u0438\u0438? +macro.bi_syma.1=\u0422\u043e\u0447\u043a\u0430 \u0441\u0438\u043c\u043c\u0435\u0442\u0440\u0438\u0447\u043d\u0430? +macro.bi_symc.0=\u0426\u0435\u043d\u0442\u0440 \u0441\u0438\u043c\u043c\u0435\u0442\u0440\u0438\u0438? +macro.bi_symc.1=\u0422\u043e\u0447\u043a\u0430 \u0441\u0438\u043c\u043c\u0435\u0442\u0440\u0438\u0447\u043d\u0430? +macro.bi_trans.0=\u041d\u0430\u0447\u0430\u043b\u043e \u0432\u0435\u043a\u0442\u043e\u0440\u0430? +macro.bi_trans.1=\u041a\u043e\u043d\u0435\u0446 \u0432\u0435\u043a\u0442\u043e\u0440\u0430? +macro.bi_trans.2=\u0422\u043e\u0447\u043a\u0430 \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0435\u043d\u0430? +macro.bi_med.0=\u041d\u0430\u0447\u0430\u043b\u043e \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0430? +macro.bi_med.1=\u041a\u043e\u043d\u0435\u0446 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0430? +macro.bi_biss.0=\u041d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430? +macro.bi_biss.1=\u0412\u0435\u0440\u0448\u0438\u043d\u0430 \u0443\u0433\u043b\u0430? +macro.bi_biss.2=\u041a\u043e\u043d\u0435\u0447\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430? +macro.bi_circ.0=\u041d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430? +macro.bi_circ.1=\u0412\u0442\u043e\u0440\u0430\u044f \u0442\u043e\u0447\u043a\u0430? +macro.bi_circ.2=\u0422\u0440\u0435\u0442\u044c\u044f \u0442\u043e\u0447\u043a\u0430? +macro.bi_t_para.0=\u041f\u0435\u0440\u0432\u0430\u044f \u043b\u0438\u043d\u0438\u044f? +macro.bi_t_para.1=\u0412\u0442\u043e\u0440\u0430\u044f \u043b\u0438\u043d\u0438\u044f? +macro.bi_t_equi.0=\u042d\u0442\u0430 \u0442\u043e\u0447\u043a\u0430 \u044d\u043a\u0432\u0438\u0434\u0438\u0441\u0442\u0430\u043d\u0442\u043d\u0430... +macro.bi_t_equi.1=\u043e\u0442 \u044d\u0442\u043e\u0439 \u0442\u043e\u0447\u043a\u0438... +macro.bi_t_equi.2=\u0438 \u044d\u0442\u043e\u0439 \u0442\u043e\u0447\u043a\u0438? +macro.bi_t_app.0=\u041a\u0430\u043a\u0430\u044f \u0442\u043e\u0447\u043a\u0430? +macro.bi_t_app.1=\u043b\u0435\u0436\u0438\u0442 \u043d\u0430 \u044d\u0442\u043e\u0439 \u043f\u0440\u044f\u043c\u043e\u0439 (\u0438\u043b\u0438 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0435)? +macro.bi_t_conf.0=\u041a\u0430\u043a\u0430\u044f \u0442\u043e\u0447\u043a\u0430? +macro.bi_t_conf.1=\u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442 \u0441 \u043a\u0430\u043a\u043e\u0439 \u0442\u043e\u0447\u043a\u043e\u0439? +macro.bi_t_align.text0=\u0422\u043e\u0447\u043a\u0438 \u043a\u043e\u043b\u043b\u0438\u043d\u0435\u0430\u0440\u043d\u044b +macro.bi_t_align.text1=\u0422\u043e\u0447\u043a\u0438 \u043d\u0435 \u043a\u043e\u043b\u043b\u0438\u043d\u0435\u0430\u0440\u043d\u044b +macro.bi_t_para.text0=\u041e\u0431\u044a\u0435\u043a\u0442\u044b \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b +macro.bi_t_para.text1=\u041e\u0431\u044a\u0435\u043a\u0442\u044b \u043d\u0435 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b +macro.bi_t_perp.text0=\u041e\u0431\u044a\u0435\u043a\u0442\u044b \u043f\u0435\u0440\u043f\u0435\u043d\u0434\u0438\u043a\u0443\u043b\u044f\u0440\u043d\u044b +macro.bi_t_perp.text1=\u041e\u0431\u044a\u0435\u043a\u0442\u044b \u043d\u0435 \u043f\u0435\u0440\u043f\u0435\u043d\u0434\u0438\u043a\u0443\u043b\u044f\u0440\u043d\u044b +macro.bi_t_equi.text0=\u0422\u043e\u0447\u043a\u0438 \u044d\u043a\u0432\u0438\u0434\u0438\u0441\u0442\u0430\u043d\u0442\u043d\u044b +macro.bi_t_equi.text1=\u0422\u043e\u0447\u043a\u0438 \u043d\u0435 \u044d\u043a\u0432\u0438\u0434\u0438\u0441\u0442\u0430\u043d\u0442\u043d\u044b +macro.bi_t_app.text0=\u0422\u043e\u0447\u043a\u0430 \u043b\u0435\u0436\u0438\u0442 \u043d\u0430 \u0444\u0438\u0433\u0443\u0440\u0435 +macro.bi_t_app.text1=\u0422\u043e\u0447\u043a\u0430 \u043d\u0435 \u043b\u0435\u0436\u0438\u0442 \u043d\u0430 \u0444\u0438\u0433\u0443\u0440\u0435 +macro.bi_t_conf.text0=\u0414\u0432\u0435 \u0442\u043e\u0447\u043a\u0438 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442 +macro.bi_t_conf.text1=\u0414\u0432\u0435 \u0442\u043e\u0447\u043a\u0438 \u043d\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442 +palette.test=\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 + +# v1.7 : +filedialog.openfolder.appletsize=\u0420\u0430\u0437\u043c\u0435\u0440 \u0430\u043f\u043b\u0435\u0442\u0430: +filedialog.openfolder.actualsize=\u0420\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 +filedialog.openfolder.other=\u0414\u0440\u0443\u0433\u043e\u0435... +filedialog.openfolder.selected=\u0412\u044b\u0431\u0440\u0430\u043d\u0430 \u043f\u0430\u043f\u043a\u0430: +filedialog.openfolder.cancel=\u041e\u0442\u043c\u0435\u043d\u0438\u0442\u044c +menu.file.exportsvg=\u042d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 SVG +menu.language.sl=Slovenski +menu.language.nl=Nederlands +menu.language.pt=Portugu\u00eas +props.vars=\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435: +menu.objects.points=\u0422\u043e\u0447\u043a\u0438 +menu.objects.lines=\u041f\u0440\u044f\u043c\u044b\u0435 +menu.objects.segments=\u0421\u0435\u0433\u043c\u0435\u043d\u0442\u044b +menu.objects.circles=\u041e\u043a\u0440\u0443\u0436\u043d\u043e\u0441\u0442\u0438 \u0438 \u043a\u043e\u043d\u0443\u0441\u044b +menu.objects.angles=\u0423\u0433\u043b\u044b +menu.objects.tracks=\u0422\u0440\u0430\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0438 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b +menu.objects.functions=\u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f +palette.info.function_u=\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f +palette.info.function=\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e+\u0438\u043b\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043a\u0440\u0438\u0432\u0443\u044e +props.superhidden=\u041f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043a\u0440\u044b\u0442\u0430: +props.showvalue=\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435: +props.showname=\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0438\u043c\u044f: +props.background=\u0424\u043e\u043d: +macro.bi_expression.0=\u042f\u043a\u043e\u0440\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430? + +# v1.9a : +menu.help.licence=\u041b\u0438\u0446\u0435\u043d\u0437\u0438\u044f... +licence.txt=

\u042d\u0442\u043e \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043f\u043e \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0438 GNU-GPL. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u0432\u044b \u0438\u043c\u0435\u0435\u0442\u0435 \u043f\u0440\u0430\u0432\u043e \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u044f\u0442\u044c \u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0435\u0435 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438 \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0438, \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u043d\u043e\u0439 Free Software Foundation;
\u0421\u043c.:

+ + +# v2.0 : +menu.special.theme=\u0422\u0435\u043c\u044b +menu.special.theme.gray=\u041f\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u0430\u043b\u043b +menu.special.theme.brushed=\u0428\u0435\u0440\u0448\u0430\u0432\u044b\u0439 \u043c\u0435\u0442\u0430\u043b\u043b +menu.special.options=\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438... +menu.special.options.sizes=\u0420\u0430\u0437\u043c\u0435\u0440\u044b +menu.special.options.sizes.minpointsize=\u0420\u0430\u0437\u043c\u0435\u0440 \u0442\u043e\u0447\u043a\u0438 +menu.special.options.sizes.minlinesize=\u0420\u0430\u0437\u043c\u0435\u0440 \u043b\u0438\u043d\u0438\u0438 +menu.special.options.sizes.arrowsize=\u0420\u0430\u0437\u043c\u0435\u0440 \u0441\u0442\u0440\u0435\u043b\u043a\u0438 +menu.special.options.sizes.minfontsize=\u041a\u0435\u0433\u043b\u044c \u0448\u0440\u0438\u0444\u0442\u0430 +menu.special.options.sizes.digits.lengths=\u0422\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0439 +menu.special.options.sizes.digits.edit=\u0422\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 +menu.special.options.sizes.digits.angles=\u0422\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0443\u0433\u043b\u043e\u0432 +menu.special.options.colors=\u0426\u0432\u0435\u0442\u0430 +menu.special.options.others=\u0414\u0440\u0443\u0433\u043e\u0435 +menu.special.options.others.undock=\u00ab\u041e\u0442\u0440\u044b\u0432\u0430\u044e\u0449\u0438\u0435\u0441\u044f\u00bb \u043f\u0430\u043d\u0435\u043b\u0438 + +# v2.1 : +menu.file.close=\u0417\u0430\u043a\u0440\u044b\u0442\u044c \u043e\u043a\u043d\u043e + +# v2.3 : +alert.toomuchwins=\u0421\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0445 \u043e\u043a\u043e\u043d.
\u0417\u0430\u043a\u0440\u043e\u0439\u0442\u0435 \u0447\u0430\u0441\u0442\u044c \u0438\u0437 \u043d\u0438\u0445, \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c
\u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 + +# v2.4 : +menu.file.new3D=\u041d\u043e\u0432\u044b\u0439 \u0447\u0435\u0440\u0442\u0435\u0436 3D +palette.3D=3D +palette.info.bi_3Dcoords=3D-\u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b +macro.bi_3Dcoords.0=\u042f\u043a\u043e\u0440\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430? +palette.info.bi_3Dcube=\u041a\u0443\u0431 +macro.bi_3Dcube.0=\u0426\u0435\u043d\u0442\u0440 \u043a\u0443\u0431\u0430? +palette.info.bi_3Darete=\u0420\u0435\u0431\u0440\u0430 3D +macro.bi_3Darete.0=\u041f\u0435\u0440\u0432\u0430\u044f \u0442\u043e\u0447\u043a\u0430? +macro.bi_3Darete.1=\u0412\u0442\u043e\u0440\u0430\u044f \u0442\u043e\u0447\u043a\u0430? +macro.bi_3Darete.2=\u0422\u0440\u0435\u0442\u044c\u044f \u0442\u043e\u0447\u043a\u0430? +macro.bi_3Darete.3=\u0427\u0435\u0442\u0432\u0435\u0440\u0442\u0430\u044f \u0442\u043e\u0447\u043a\u0430? +palette.info.bi_3Dtetra=\u0422\u0435\u0442\u0440\u0430\u044d\u0434\u0440 +macro.bi_3Dtetra.0=\u0426\u0435\u043d\u0442\u0440 \u0442\u0435\u0442\u0440\u0430\u044d\u0434\u0440\u0430? +menu.newdoc=\u041d\u043e\u0432\u044b\u0439 +menu.language.it=Italiano + +# v2.5.5 : +palette.aspect.label.text=\u0412\u043d\u0435\u0448\u043d\u0438\u0439 \u0432\u0438\u0434 +palette.aspect.label.point=\u0442\u043e\u0447\u043a\u0438 +palette.aspect.label.line=\u043f\u0440\u044f\u043c\u044b\u0435 +palette.aspect.label.segment=\u0441\u0435\u0433\u043c\u0435\u043d\u0442\u044b +palette.aspect.label.circle=\u043e\u043a\u0440\u0443\u0436\u043d\u043e\u0441\u0442\u0438 +palette.aspect.label.angle=\u0443\u0433\u043b\u044b +palette.aspect.label.area=\u043c\u043d\u043e\u0433\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0438 +palette.aspect.label.bi_text=\u0442\u0435\u043a\u0441\u0442 +palette.info.bi_3Ddode=\u0414\u043e\u0434\u0435\u043a\u0430\u044d\u0434\u0440 +macro.bi_3Ddode.0=\u0426\u0435\u043d\u0442\u0440 \u0434\u043e\u0434\u0435\u043a\u0430\u044d\u0434\u0440\u0430? + +# v2.7 : +palette.aspect.label.pointshape=\u041c\u0435\u0442\u043a\u0438 \u0438 \u0438\u043c\u0435\u043d\u0430 \u0442\u043e\u0447\u0435\u043a: +palette.aspect.label.locus=\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 +menu.edit.deleteall=\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0432\u0441\u0435 + + +# v2.7.1 : +java.old.message=\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0432\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c CaRMetal, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f java \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0441\u0442\u0430\u0440\u0430\u044f! +java.old.quit=\u0417\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c +java.old.go=\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e java +palette.info.boundedpoint=\u041f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0442\u043e\u0447\u043a\u0443 \u043d\u0430 \u043f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u044c+\u0438\u043b\u0438 \u043d\u0430 \u0433\u0440\u0430\u043d\u044c \u043c\u043d\u043e\u0433\u043e\u0433\u0440\u0430\u043d\u043d\u0438\u043a\u0430 + +#v2.7.2 : +user.foldername=\u041f\u0440\u043e\u0444\u0438\u043b\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f CarMetal + +#v2.8 +props.fixedray=\u041b\u0443\u0447: +props.fixedsegment=\u0414\u043b\u0438\u043d\u0430: +props.fixedangle=\u0423\u0433\u043e\u043b: +props.expl=\u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439: +props.aspecttab=\u0412\u0438\u0434 +props.numerictab=\u0427\u0438\u0441\u043b\u043e\u0432\u044b\u0435 +props.conditionaltab=\u0423\u0441\u043b\u043e\u0432\u043d\u044b\u0435 +props.thick=\u0422\u043e\u043b\u0441\u0442\u044b\u0439: +props.popup.special=\u0421\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b +props.popup.functions=\u041f\u0440\u0435\u0434\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 +props.popup.latex=\u041a\u043e\u043c\u0430\u043d\u0434\u044b LaTeX +menu.language.pl=Polski + +#v2.8.1 +props.fixedinwindow=\u0421\u0432\u044f\u0437\u0430\u043d \u0441 \u043e\u043a\u043d\u043e\u043c + +#v2.8.5 +palette.controls=\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 +props.ctrlshowvalue=\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 +props.ctrlsnap=\u0412\u044b\u0440\u043e\u0432\u043d\u044f\u0442\u044c \u043f\u043e \u0434\u0435\u043b\u0435\u043d\u0438\u044f\u043c +props.ctrlshowticks=\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0434\u0435\u043b\u0435\u043d\u0438\u044f +props.ctrltickspacing=\u0418\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442: +palette.info.ctrl_edit=\u041f\u0440\u0430\u0432\u0438\u0442\u044c \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 +palette.info.ctrl_chkbox=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0447\u0435\u043a\u0431\u043e\u043a\u0441 +palette.info.ctrl_popup=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043c\u0435\u043d\u044e +palette.info.ctrl_slider=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0434\u0432\u0438\u0436\u043e\u043a + +#v2.8.6 +props.trackdmin=\u0427\u0438\u0441\u043b\u043e \u0448\u0430\u0433\u043e\u0432: +opendialog.preview=\u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440: +pngdialog.options=\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0430: +pngdialog.scale=\u041c\u0430\u0441\u0448\u0442\u0430\u0431: +pngdialog.originsize=\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440: +pngdialog.scaledsize=\u041c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439: + +#v2.8.7 +canvas.3D.floor=\u0413\u043e\u0440\u0438\u0437\u043e\u043d\u0442 +canvas.3D.system=\u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 +canvas.3D.rightclic=\u041f\u0440\u0430\u0432\u044b\u0439 \u0449\u0435\u043b\u0447\u043e\u043a-\u043f\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u0442\u044c \u0434\u043b\u044f \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 + + +#v2.8.8 +palette.info.equationxy=\u041a\u0440\u0438\u0432\u0430\u044f, \u0437\u0430\u0434\u0430\u043d\u043d\u0430\u044f f(x,y)=0 +props.equationxy=\u0424\u043e\u0440\u043c\u0443\u043b\u0430: +props.equationxychooser=\u0422\u043e\u0447\u043d\u043e\u0441\u0442\u044c: +palette.function=\u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u0442\u0440\u0430\u0435\u043a\u0442\u043e\u0440\u0438\u0438 + +#v2.8.9 +menu.edit.deletealltracks=\u0421\u0442\u0435\u0440\u0435\u0442\u044c \u0442\u0440\u0430\u0435\u043a\u0442\u043e\u0440\u0438\u0438 +menu.edit.deactivatealltracks=\u041e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0442\u0440\u0430\u0435\u043a\u0442\u043e\u0440\u0438\u0438 +props.tracks=\u0412\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0442\u0440\u0430\u0435\u043a\u0442\u043e\u0440\u0438\u0438 +menu.edit.zoom=\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 / \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c + +#v2.9.0 +menu.windows=\u041e\u043a\u043d\u043e + +#v2.9.1 +contexthelp.seealso=\u0421\u043c. \u0442\u0430\u043a\u0436\u0435: + +#v2.9.2 +menu.language.pt_BR=Brazilian +menu.display.restrictmessage.dontdisplay=\u0411\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u044d\u0442\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 + +#v2.9.6 +props.magnetmessage=\u0429\u0435\u043b\u043a\u043d\u0438\u0442\u0435 \u043e\u0431\u044a\u0435\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0445\u043e\u0442\u0438\u0442\u0435 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u00ab\u043c\u0430\u0433\u043d\u0438\u0442\u043d\u044b\u0445\u00bb (\u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0438\u0437 \u043d\u0435\u0433\u043e +props.magnetobj=\u041c\u0430\u0433\u043d\u0438\u0442\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b +props.magnetpix=\u0414\u0438\u0441\u0442\u0430\u043d\u0446\u0438\u044f (20 px) : +props.show=\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c + +#v2.9.7 +palette.info.ctrl_txtfield=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u043b\u0435 \u0432\u0432\u043e\u0434\u0430 \u0447\u0438\u0441\u043b\u0430 +palette.info.ctrl_button=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0443 + +#v2.9.8.4 +JSerror.title=\u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 +JSerror.line=\u043b\u0438\u043d\u0438\u044f +JSerror.pointcoords=\u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u0432 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u0445 \u0442\u043e\u0447\u043a\u0438 +JSerror.interactiveinput=\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0432\u044b\u0431\u043e\u0440\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 +JSerror.notfound=\u041e\u0431\u044a\u0435\u043a\u0442 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d +JSerror.notgoodtype=\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043a \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0442\u0438\u043f\u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 +JScmd.inputmessage=\u0412\u0430\u0448 \u0432\u043e\u043f\u0440\u043e\u0441? +JScmd.promptmessage=\u0412\u0430\u0448\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435... +menu.js=Javascript +menu.js.script=\u041e\u0442\u043a\u0440\u044b\u0442\u044c \u0444\u0430\u0439\u043b javascript... +menu.js.command=\u041e\u0442\u043a\u0440\u044b\u0442\u044c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 +JSeditor.title=\u0420\u0435\u0434\u0430\u043a\u0442\u043e\u0440 Javascript + +#v3.0 +JSeditor.save=\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442 +JSeditor.open=\u041e\u0442\u043a\u0440\u044b\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442 +JSeditor.opendlogmsg=\u041e\u0442\u043a\u0440\u044b\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442 +JSeditor.savedlogmsg=\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442 +JSeditor.format=\u0424\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442 +JSeditor.restore=\u041e\u0442\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0437\u0430\u043f\u0443\u0441\u043a +JSeditor.run=\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442 +JSeditor.help=\u0421\u043f\u0440\u0430\u0432\u043a\u0430 \u043f\u043e \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0443 +JSEditor.comment=\u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c/\u0440\u0430\u0441\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0435 +JSEditor.savequestion=\u0421\u043a\u0440\u0438\u043f\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d. \u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0435\u0433\u043e? +menu.language.ar_TN=Arabic + +# v3.1.1 +menu.js.define=\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u0430\u043f\u043a\u0443 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432... +menu.js.dumb=\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0438\u0437\u0431\u0440\u0430\u043d\u043d\u044b\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0431\u0435\u0437 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430 +JSeditor.opendfavfolder=\u0412\u044b\u0431\u0440\u0430\u0442\u044c \u043f\u0430\u043f\u043a\u0443 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 +JSeditor.saveas=\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442 \u0432... \ No newline at end of file diff --git a/eric/docs/JZirkelProperties_sl.properties b/eric/docs/JZirkelProperties_sl.properties new file mode 100644 index 0000000..de8b7df --- /dev/null +++ b/eric/docs/JZirkelProperties_sl.properties @@ -0,0 +1,265 @@ + +filedialog.alsorestricted=Shrani tudi omejeno konstrukcijo +filedialog.compressedfilefilter=Stisnjena Ri\u0160 datoteka (.zirz) +filedialog.filefilter=Ri\u0160 datoteka (.zir) +filedialog.macrofilefilter=Ri\u0160 makro datoteka (.mcr) +filedialog.openfolder.actualsize=Trenutna velikost +# v1.7 : +filedialog.openfolder.appletsize=Velikost apleta : +filedialog.openfolder.approve=Mapa s predstavitvijo +filedialog.openfolder.cancel=Prekini +filedialog.openfolder.other=Ostalo... +filedialog.openfolder.saveicons=Shrani tudi omejene ikone +filedialog.openfolder.selected=Izbrani imenik : +filedialog.openfolder.title=Izbira mape s predstavitvijo +filedialog.options=Mo\u017Enosti shranjevanja +filedialog.restrictedmessage=Dela\u0161 v omejeni seji,
zato bo slika shranjena v omejenem na\u010Dinu +filedialog.saveas=Shrani konstrukcijo +filedialog.savemessage1=Datoteka :\n\ + +filedialog.savemessage2=\n\ + obstaja. Ali jo \u017Eeli\u0161 zamenjati? +leftpanel.help=Okvir s pomo\u010Djo +leftpanel.history=Okvir zgodovine +leftpanel.macros=Okvir z makroji +leftpanel.properties=Okvir z lastnostmi +macro.bi_biss.0=Prva to\u010Dka? +macro.bi_biss.1=Vrh kota? +macro.bi_biss.2=Tretja to\u010Dka? +macro.bi_circ.0=Prva to\u010Dka? +macro.bi_circ.1=Druga to\u010Dka? +macro.bi_circ.2=Tretja to\u010Dka? +macro.bi_med.0=Prva to\u010Dka daljice? +macro.bi_med.1=Druga to\u010Dka daljice? +macro.bi_syma.0=Premica zrclajenja? +macro.bi_syma.1=To\u010Dka, ki jo zrcalimo? +macro.bi_symc.0=Sredi\u0161\u010De simetrije? +macro.bi_symc.1=To\u010Dka zrcaljenja? +macro.bi_t_align.text0=To\u010Dke so kolinearne +macro.bi_t_align.text1=To\u010Dke niso kolinearne +macro.bi_t_app.0=Izberi to\u010Dko +macro.bi_t_app.1=Na kateri premici (daljici) le\u017Ei? +macro.bi_t_app.text0=To\u010Dka le\u017Ei na objektu +macro.bi_t_app.text1=To\u010Dka ne le\u017Ei na objektu +macro.bi_t_conf.0=Izberi to\u010Dko +macro.bi_t_conf.1=Na kateri to\u010Dki? +macro.bi_t_conf.text0=To\u010Dki se pokrivata +macro.bi_t_conf.text1=To\u010Dki se ne pokrivata +macro.bi_t_equi.0=Je ta to\u010Dka enako oddaljena ... +macro.bi_t_equi.1=od te to\u010Dke ... +macro.bi_t_equi.2=In ta to\u010Dka ? +macro.bi_t_equi.text0=To\u010Dki sta enako oddaljeni +macro.bi_t_equi.text1=To\u010Dki nista enako oddaljeni +macro.bi_t_para.0=Prva premica? +macro.bi_t_para.1=Druga premica? +macro.bi_t_para.text0=Premici sta vzporedni +macro.bi_t_para.text1=Premici nista vzporedni +macro.bi_t_perp.text0=Premici sta pravokotni +macro.bi_t_perp.text1=Premici nista pravokotni +macro.bi_trans.0=Prva to\u010Dka vektorja? +macro.bi_trans.1=Druga to\u010Dka vektorja? +macro.bi_trans.2=To\u010Dka, ki jo premikamo? +macros.addfolder=Dodaj novo mapo +macros.cancel=Prekini? +macros.deleteselected=Zbri\u0161i izbrani makro\ +macros.emptynode=-- Prazno-- +macros.finals=Izhodni objekti ? +macros.initials=Vhodni objekti? +macros.pleaseselect=izberi prosim +macros.popup.addtolibrary=Dodaj v knji\u017Enico +macros.popup.delete=Zbri\u0161i +macros.popup.duplicate=Podvoji +macros.popup.notpublish=Ne vklju\u010Di v sliko +macros.popup.properties=Prika\u017Ei lastnosti +macros.popup.publish=Vklju\u010Di v sliko +macros.popup.removefromlibrary=Odstrani iz knji\u017Enice +macros.popup.rename=Preimenuj +macros.popup.run=Za\u017Eeni makro +macros.popup.saveas=Shrani kot... +macros.question.delete=Zares \u017Eeli\u0161 izbrisati ta makro? +macros.recordmacro=Sestavi makro +macros.renamemacro=Preimenuj izbrani makro +macros.savedlog.buttonok=Shrani makro datoteko +macros.untitledfolder=\u0160e neimenovan +macros.untitledmacro=\u0160e neimenovan makro +menu.display=Prikaz +menu.display.finegrid=Le osi +menu.display.grid=Prika\u017Ei/skrij mre\u017Eo +menu.display.help_panel=Pomo\u010D +menu.display.hidden=Prika\u017Ei/skrij objekt +menu.display.history_panel=Zgodovina +menu.display.large=Velike ikone +menu.display.leftsnap=Ujemanje z mre\u017Eo +menu.display.manage_macros=Upravljanje makrojev +menu.display.medium=Srednje ikone +menu.display.properties_panel=Okvir z latnostmi objektov +menu.display.restrictedpalette=Prika\u017Ei omejeno paleto +menu.display.restrictedpaletteedit=Uredi omejeno paleto +menu.display.restrictmessage=
Ta mo\u017Enost omogo\u010Da preklop naomejen nabor orodij.

Nana\u0161a se na trenutno datoteko :

\u010De izbere\u0161 'shrani kot', lahko izbere\u0161 'shrani tudi omejeno sliko'
in shranjeni bosta dve datoteki: prva (.zir) 'normalni' na\u010Din z vsemi mo\u017Enostmi,
in druga (.r.zir) v omejenem na\u010Dinu
+menu.display.small=Majhne ikone +menu.display.smartboard=Na\u010Din z odzivno risalno povr\u0161ino +menu.edit=Uredi +menu.edit.copy=Kopiraj +menu.edit.delete=Bri\u0161i +menu.edit.edit=Uredi +menu.edit.hide=Skrij +menu.edit.move=Premakni +menu.edit.rename=Preimenuj +menu.file=Datoteka +menu.file.exporteps=Izvoz v EPS +menu.file.exportpng=Izvoz v PNG +menu.file.exportsvg=Izvoz v SVG +menu.file.load=Odpri... +menu.file.new=Nova +menu.file.quit=Izhod +menu.file.save=Shrani +menu.file.saveas=Shrani kot... +menu.help=Pomo\u010D +menu.help.about=Program CaRMetal... +menu.help.info=Kontekstualna pomo\u010D +menu.help.url0=Stran CARzine +menu.help.url2=Uradna Ri\u0160 stran +menu.help.url3=Prevodi CaRMetal +# v1.5 : +menu.language=Jeziki + +# v1.6 : +menu.macros=Makroji +menu.special=Posebno +menu.special.definejob=Definiraj nalogo +menu.special.export=Izvoz v HTML +menu.special.exporttemplate=HTML izvoz s predlogo +menu.special.jobcomment=Tekst za nalogo ... +menu.special.loadjob=Odpri nalogo ... +menu.special.loadmacros=Odpri datoteko z makroji... +menu.special.newmacro=Nov makro +menu.special.savejob=Shrani nalogo... +# v1.4 : +menu.special.savezirset=Naredi predstavitev... +menu.special.testjob=Preveri nalogo +mi.apply=Uporabi +mi.comment=Komentar : +mi.error.initial=Napaka: vsaj en parameter mora\n\ + biti prost (nekonstanten, ne z vnosom)\n\ + \n\ + Ta makro ne bo spremenjen +mi.hideduplicates=Skrij prekrite +mi.hideproperties=Lastnosti cilja: +mi.name=Ime: +mi.pal.name=Upravljalnik makrojev +mi.properties=Lastnosti parametrov: +mi.tab.ask=Vpra\u0161aj? +mi.tab.fix=Konstantno? +mi.tab.name=Ime +mi.tab.prompt=Vnos +mi.tab.type=Vrsta +palette.aspect=Pogled Barva +palette.colors=Slika za ozadje +palette.colors.constants=HTML konstante +palette.colors.desaturated1=Neprepletajo\u010De barve +palette.colors.desaturated2=Neprepletajo\u010De barve 2 +palette.colors.saturated1=Prepletajo\u010De barve +palette.colors.saturated2=Prepletajo\u010De barve 2 +palette.construction=Konstrukcija +palette.edit=Uredi +palette.file=Datoteka +palette.grid=Mre\u017Ea +palette.history=Zgodovina +palette.image.fileerror=Najprej mora\u0161 shraniti sliko

Slika, ki jo izbere\u0161,
pa mora biti v isti mapi. +palette.info.background=Izberi/zbri\u0161i sliko za ozadje +palette.info.bi_arc=Kro\u017Eni lok skozi tri to\u010Dke +palette.info.bi_biss=Simetrala kota +palette.info.bi_circ=Kro\u017Enica skozi tri to\u010Dke +palette.info.bi_med=Simetrala daljice +palette.info.bi_syma=Zrcaljenje +palette.info.bi_symc=Simetrija +palette.info.bi_t_align=Kolinearne to\u010Dke? +palette.info.bi_t_app=Le\u017Ei na premici? +palette.info.bi_t_conf=Se to\u010Dke prekrivajo? +palette.info.bi_t_equi=Enako oddaljena od dveh to\u010Dk? +palette.info.bi_t_para=Vzporednici? +palette.info.bi_t_perp=Pravokotnici? +palette.info.bi_trans=Translacija +palette.info.copy=Kopiraj okno s konstrukcijo +palette.info.exporteps=Izvoz konstrukcije v eps format +palette.info.exportpng=Izvoz konstrukcije v png format +palette.info.help_panel=Prika\u017Ei/skrij okvir s pomo\u010Djo +palette.info.history_panel=Prika\u017Ei/skrij okvir z zgodovino\ +palette.info.image3=Vstavi sliko z dvema ali tremi vogali +palette.info.imcenter=Usredini sliko za ozadje +palette.info.imstretch=Raz\u0161iri sliko za ozadje do velikosti okna +palette.info.imtile=Razporedi sliko za ozadje +palette.info.loadmacros=Odpri datoteko z makroji +palette.info.locus=Sled to\u010Dke Ovojnica premice +palette.info.manage_macros=Prika\u017Ei/skrij okvir z makroji +palette.info.newmacro=Izdelaj makro +palette.info.properties_panel=Prika\u017Ei/skrij okvir z lastnostmi objektov +palette.info.vector=Vektor +palette.prec=\u0160tevilo decimalk +palette.prec.angles=Koti +palette.prec.edit=Izrazi +palette.prec.lengths=Dol\u017Eine +palette.sizes=Velikosti +palette.sizes.arrow=Pu\u0161\u010Dica +palette.sizes.font=Pisava +palette.sizes.line=Premica +palette.sizes.point=To\u010Dka +palette.test=Preverjanje +props.alias=Alias : +props.arc=Lok +props.belongto=Plast : +props.bind=Povezava +props.black=\u010Crna : +props.blue=Modra : +props.bold=Debelina : +props.brown=Rjava : +props.cartesian=Eksplicitna funkcija +props.conditional=Pgojno oblikovanje : +props.cyan=Turkizna : +props.error=V tem izrazu je sintakti\u010Dna napaka.
Izraz bo vrnjen na za\u010Detek. +props.expl=Pojasnilo: +props.fix=Konstantno: +props.functiontype=Vrsta : +props.green=Zelena : +# v1.3 : +props.grid=Korak : +props.help=\u010Ce \u017Eeli\u0161 videti lastnosti, klikni z desno tipko na objektu.

\u010Ce je ta okvir odprt med ustvarjanjem novega objekta, mu lahko sproti dolo\u010Da\u0161 lastnosti. +props.hidden=Skrito : +props.inside=Znotraj objekta : +props.killarc=Zbri\u0161i lok +props.name=Ime: +props.normal=Privzeto: +props.parametric=Parametri\u010Dna funkcija +props.pointsonly=Le s to\u010Dkami: +props.red=Rde\u010Da: +props.release=Sprosti +props.setaway=Postavi vstran +props.setclose=Nastavi zaprto +props.showasslider=Drsnik: +props.solid=Mo\u010Dna: +props.step=Korak: +props.thin=To\u010Dkasto: +props.unit=Enota: +rene.zirkel.objects.AreaObject=Plo\u0161\u010Dina +rene.zirkel.objects.ExpressionObject=Izraz +rene.zirkel.objects.FixedAngleObject=Kot z velikostjo. +rene.zirkel.objects.FunctionObject=Funkcija +rene.zirkel.objects.PointObject=To\u010Dka +rene.zirkel.objects.PrimitiveCircleObject=Krog +rene.zirkel.objects.PrimitiveLineObject=Premica +rene.zirkel.objects.RayObject=Poltrak +rene.zirkel.objects.SegmentObject=Daljica +rene.zirkel.objects.TwoPointLineObject=Premica +selectpopup.DeleteTool=Brisanje +selectpopup.EditTool=Urejanje +selectpopup.HiderTool=Prika\u017Ei skrij +selectpopup.MoverTool=Premikanje +selectpopup.RenamerTool=Preimenovanje +selectpopup.RightClick=Izberi +selectpopup.SetParameterTool=Parametri makroja: +selectpopup.SetTargetsTool=Cilj makroja: +selectpopup.whatobject=kateri objekt? +slideshow.download=Prenesi datoteko +slideshow.next=naslednje +slideshow.previous=prej\u0161nje +slideshow.signature=Predstavitev narejena z diff --git a/eric/docs/JZirkelProperties_sv.properties b/eric/docs/JZirkelProperties_sv.properties new file mode 100644 index 0000000..f3caf0d --- /dev/null +++ b/eric/docs/JZirkelProperties_sv.properties @@ -0,0 +1,481 @@ +# Sample ResourceBundle properties file +menu.file=Fil +menu.file.new=Ny +menu.file.load=\u00D6ppna... +menu.file.save=Spara +menu.file.saveas=Spara Som... + +menu.file.exportpng=Exportera till PNG +menu.file.exporteps=Exportera till EPS +menu.file.quit=Avsluta +menu.edit=Redigera +menu.edit.copy=Kopiera +menu.edit.move=Flytta objekt +menu.edit.rename=D\u00F6p om +menu.edit.edit=Redigera +menu.edit.hide=G\u00F6m +menu.edit.delete=Radera +menu.display=Visa +menu.display.hidden=Visa/G\u00F6m Objekt +menu.display.grid=Visa/G\u00F6m Rutn\u00E4t +menu.display.finegrid=Endast axlar +menu.display.leftsnap=F\u00E4st med v\u00E4nster musdragning +menu.display.manage_macros=Makro Inspekt\u00F6r +menu.display.history_panel=Logg +menu.display.help_panel=Hj\u00E4lp +menu.display.properties_panel=Panel f\u00F6r Objektegenskaper +menu.display.small=Sm\u00E5 ikoner +menu.display.medium=Medium ikoner +menu.display.large=Stora ikoner +menu.display.restrictedpalette=Visa Begr\u00E4nsad Palett +menu.display.restrictedpaletteedit=Redigera Begr\u00E4nsad Palett +menu.display.restrictmessage=
Denna punkt till\u00E5ter dig att visualisera den begr\u00E4nsade paletten.

Det g\u00E4ller bara den nuvarande filen :

n\u00E4r du v\u00E4ljer 'spara som', s\u00E5 kommer det vara m\u00F6jligt att \u00E4ven v\u00E4lja 'spara \u00E4ven den begr\u00E4nsade figuren'
tv\u00E5 filer kommer att skapas : den f\u00F6rsta (.zir) kommer att \u00F6ppnas i 'normalt' l\u00E4ge, och
den andra (.r.zir) i begr\u00E4nsat l\u00E4ge
+menu.macros=Makron +menu.special=Special +menu.special.newmacro=Nytt Makro +menu.special.loadmacros=\u00D6ppna Makro Fil... +menu.special.definejob=Definiera en Arbetsuppgift +menu.special.loadjob=Ladda en Arbetsuppgift ... +menu.special.jobcomment=Ange text f\u00F6r Arbetsuppgift ... +menu.special.testjob=Testa denna Arbetsuppgift +menu.special.savejob=Spara som Arbetsuppgift ... +menu.special.export=Skapa HTML Fil och f\u00F6rhandsvisning i webbl\u00E4sare +menu.special.exporttemplate=HTML Export med Exempel +menu.help=Hj\u00E4lp +menu.help.about=Om CaRMetal... +menu.help.info=Sammanhangshj\u00E4lp +menu.help.url0=G\u00E5 till CaRMetal sajten +menu.help.url1=G\u00E5 till CARzine sajten +menu.help.url2=G\u00E5 till den officiella C.a.R. sajten + +filedialog.saveas=Spara Figur +filedialog.alsorestricted=Spara \u00E4ven begr\u00E4nsad figur +filedialog.options=Spara alternativ +filedialog.restrictedmessage=Du arbetar i en begr\u00E4nsad session,
s\u00E5 din figur kommer att sparas i begr\u00E4nsat l\u00E4ge +filedialog.filefilter=CaR Fil (.zir) +filedialog.compressedfilefilter=Komprimerad CaR Fil (.zirz) +filedialog.macrofilefilter=CaR Makro Fil (.mcr) +filedialog.savemessage1=Fil :\n +filedialog.savemessage2=\nfinns redan. Vill du verkligen ers\u00E4tta den ? + +palette.file=Fil +palette.edit=Redigera +palette.construction=Konstruktion +palette.aspect=Aspekt & F\u00E4rg +palette.history=Logg +palette.sizes=Storlekar +palette.sizes.point=Punkt +palette.sizes.line=Linje +palette.sizes.arrow=Pil +palette.sizes.font=Typsnitt +palette.prec=Numerisk precision +palette.prec.lengths=L\u00E4ngder +palette.prec.edit=Uttryck +palette.prec.angles=Vinklar +palette.colors=Bakgrundsf\u00E4rg & bild +palette.colors.saturated1=M\u00E4ttade f\u00E4rger +palette.colors.desaturated1=Om\u00E4ttade f\u00E4rger +palette.colors.saturated2=M\u00E4ttade f\u00E4rger 2 +palette.colors.desaturated2=Om\u00E4ttade f\u00E4rger 2 +palette.colors.constants=Web konstanter +palette.image.fileerror=Du m\u00E5ste spara denna figur innan du anv\u00E4nder detta verktyg

Efter\u00E5t, s\u00E5 m\u00E5sta den bild som du v\u00E4ljer vara
i samma katalog. + +palette.info.vector=Vektor +palette.info.image3=S\u00E4tt in bild+med 2 eller 3 punkter +palette.info.background=Choose/Rensa bakgrundsbild +palette.info.imcenter=Centrera bakgrundsbild +palette.info.imstretch=St\u00E4ck ut bakgrundsbilden+s\u00E5 den passar konstruktionsf\u00F6nstret +palette.info.imtile=\u00D6verlappa bakgrundsbilden +palette.info.copy=Kopiera konstruktionsf\u00F6nstret +palette.info.exportpng=Exportera konstruktions+f\u00F6nstret till png format +palette.info.exporteps=Exportera konstruktions+f\u00F6nstret till eps format +palette.info.newmacro=Skapa ett nytt makro +palette.info.loadmacros=Ladda en makro fil +palette.info.manage_macros=Visa/g\u00F6m makropanelen +palette.info.properties_panel=Visa/g\u00F6m objekt+egenskapspanelen +palette.info.history_panel=Visa/g\u00F6m konstruktions+loggpanelen +palette.info.help_panel=Visa/g\u00F6m sammanhangshj\u00E4lppanelen + + + +macros.untitledmacro=Od\u00F6pt Makro +macros.untitledfolder=Od\u00F6pt mapp +macros.emptynode=-- Tom -- +macros.addfolder=L\u00E4gg till ny mapp +macros.deleteselected=Radera valda makron +macros.renamemacro=D\u00F6p om valt makro +macros.recordmacro=Spela in makro +macros.initials=Inledande objekt ? +macros.pleaseselect=V\u00E4lj ! +macros.finals=Slutliga objekt ? +macros.cancel=Avbryt ? +macros.popup.run=K\u00F6r makro +macros.popup.rename=D\u00F6p om +macros.popup.delete=Radera +macros.popup.addtolibrary=L\u00E4gg till bibliotek +macros.popup.removefromlibrary=Ta bort fr\u00E5n bibliotek +macros.popup.publish=Inkludera i figuren +macros.popup.notpublish=Inkludera inte i figuren +macros.popup.saveas=Spara som... +macros.popup.properties=visa egenskaper +macros.popup.duplicate=Duplicera +macros.savedlog.buttonok=Spara makrofil +macros.question.delete=\u00C4r du s\u00E4ker p\u00E5 att du vill radera dessa makron ? + +rene.zirkel.objects.PointObject=Punkt +rene.zirkel.objects.PrimitiveCircleObject=Cirkel +rene.zirkel.objects.PrimitiveLineObject=Linje +rene.zirkel.objects.ExpressionObject=Uttryck +rene.zirkel.objects.FixedAngleObject=Fast vinkel +rene.zirkel.objects.SegmentObject=Segment +rene.zirkel.objects.RayObject=Str\u00E5le +rene.zirkel.objects.TwoPointLineObject=Linje +rene.zirkel.objects.FunctionObject=Funktion +rene.zirkel.objects.AreaObject=Area + + +mi.pal.name=Macros inspekt\u00F6r +mi.name=Namn : +mi.comment=Kommentar : +mi.properties=Parameteregenskaper : +mi.hideproperties=M\u00E5legenskaper : +mi.hideduplicates=G\u00F6m dubletter +mi.apply=Verkst\u00E4ll +mi.tab.type=Typ +mi.tab.name=Namn +mi.tab.prompt=Prompt +mi.tab.fix=F\u00E4st ? +mi.tab.ask=Fr\u00E5ga ? +mi.error.initial=Fel : minst en parameter \nm\u00E5ste vara fri (ingen f\u00E4st, ingen fr\u00E5ga)\n\nDetta makro kommer inte att \u00E4ndras + +props.help=F\u00F6r att kunna se egenskaper, s\u00E5 m\u00E5sta du h\u00F6gerklicka p\u00E5 ett objekt.

Om du skapar ett nytt objekt n\u00E4r denna panel \u00E4r\u00F6ppen, s\u00E5 kommer du kunna \u00E4ndra dess egenskaper under skapandet. +props.name=Namn : +props.alias=Alias : +props.unit=Enhet : +props.fix=F\u00E4st : +props.expl=F\u00F6rklaring : +props.belongto=Lager : +props.conditional=Villkorligt l\u00E4ge : +props.solid=Solid : +props.hidden=G\u00F6md : +props.normal=Normal : +props.bold=Tjock : +props.thin=Prickad : +props.black=Svart : +props.green=Gr\u00F6n : +props.blue=Bl\u00E5 : +props.brown=Brun : +props.cyan=Cyan : +props.red=R\u00F6d : +props.showasslider=Skjutknapp +props.error=Det finns ett syntaxfel i detta uttryck.
Det kommer att \u00E5terinitieras +props.cartesian=Kartesisk funktion +props.parametric=Parametrisk funktion +props.functiontype=Typ : +props.killarc=ta bort cirkelb\u00E5ge +props.arc=Cirkelb\u00E5ge +props.release=Sl\u00E4pp +props.bind=F\u00E4st +props.setaway=H\u00E5ll borta +props.setclose=h\u00E5ll n\u00E4ra + + +# v1.3 : +props.grid=Inkrement : +props.inside=Inuti objekt : +props.pointsonly=Endast med punkter : +props.step=Steg : +palette.grid=Rutn\u00E4tsutseende +leftpanel.macros=Makro panel +leftpanel.properties=Egenskaper panel +leftpanel.history=Logg panel +leftpanel.help=Hj\u00E4lp panel +selectpopup.whatobject=vilket objekt ? +selectpopup.RightClick=V\u00E4lj +selectpopup.MoverTool=Flytta +selectpopup.HiderTool=Visa/G\u00F6m +selectpopup.DeleteTool=Radera +selectpopup.RenamerTool=D\u00F6p om +selectpopup.EditTool=Redigera +selectpopup.SetParameterTool=Makro parametrar : +selectpopup.SetTargetsTool=Makro m\u00E5l : +palette.info.locus=Punktens ort+Linjens Envelopp + +# v1.4 : +menu.special.savezirset=Skapa bildspel... +filedialog.openfolder.title=Dialog f\u00F6r val av bildspelsmapp +filedialog.openfolder.approve=V\u00E4lj bildspelsmapp +filedialog.openfolder.saveicons=Spara \u00E4ven begr\u00E4nsade ikoner +slideshow.next=n\u00E4sta +slideshow.previous=f\u00F6reg\u00E5ende +slideshow.download=Ladda ned fil +slideshow.signature=Bildspel gjord med + +# v1.5 : +menu.language=Spr\u00E5k +menu.language.de=Deutsch +menu.language.en=English +menu.language.fr=Fran\u00E7ais +menu.language.es=Espa\u00F1ol +menu.language.gl=Galego +menu.language.zh_TW=Chinese (Traditional) +menu.help.url3=\u00D6vers\u00E4tt CaRMetal +menu.display.smartboard=Smartboard l\u00E4ge + +# v1.6 : +menu.language.no=Norsk +palette.info.bi_syma=Spegling +palette.info.bi_symc=Symmetri +palette.info.bi_trans=F\u00F6rflyttning +palette.info.bi_med=Vinkelr\u00E4t bisektris +palette.info.bi_biss=Vinkel bisektris +palette.info.bi_circ=Cirkel genom 3 punkter +palette.info.bi_arc=Cirkelb\u00E5ge genom 3 punkter +palette.info.bi_t_align=Kolinj\u00E4ra punkter ? +palette.info.bi_t_para=Parallella linjer ? +palette.info.bi_t_perp=Vinkelr\u00E4ta linjer ? +palette.info.bi_t_equi=Samma avst\u00E5nd fr\u00E5n tv\u00E5 punkter ? +palette.info.bi_t_app=Ligger p\u00E5 en linje ? +palette.info.bi_t_conf=Punkter p\u00E5 samma plats ? +macro.bi_syma.0=Speglingsaxel ? +macro.bi_syma.1=Punkt att spegla ? +macro.bi_symc.0=Symmetri center ? +macro.bi_symc.1=Punkt att spegla ? +macro.bi_trans.0=Vektorns f\u00F6rsta punkt ? +macro.bi_trans.1=Vektorns andra punkt ? +macro.bi_trans.2=Punkt att f\u00F6rflytta ? +macro.bi_med.0=Segmentets f\u00F6rsta punkt ? +macro.bi_med.1=Segmentets andra punkt ? +macro.bi_biss.0=F\u00F6rsta punkten ? +macro.bi_biss.1=Vinkelh\u00F6rn ? +macro.bi_biss.2=Sista punkten ? +macro.bi_circ.0=F\u00F6rsta punkten ? +macro.bi_circ.1=Andra punkten ? +macro.bi_circ.2=Tredje punkten ? +macro.bi_t_para.0=F\u00F6rsta linjen ? +macro.bi_t_para.1=Andra linjen ? +macro.bi_t_equi.0=Har denna punkt samma avst\u00E5nd ... +macro.bi_t_equi.1=Fr\u00E5n denna punkt ... +macro.bi_t_equi.2=Och denna punkt ? +macro.bi_t_app.0=Vilken punkt ? +macro.bi_t_app.1=Ligger p\u00E5 vilken linje (eller segment) ? +macro.bi_t_conf.0=Vilken punkt ? +macro.bi_t_conf.1=\u00E4r p\u00E5 vilken punkt ? +macro.bi_t_align.text0=Punkterna \u00E4r kolinj\u00E4ra +macro.bi_t_align.text1=Punkterna \u00E4r inte kollinj\u00E4ra +macro.bi_t_para.text0=Objekten \u00E4r parallella +macro.bi_t_para.text1=Objekten \u00E4r inte parallella +macro.bi_t_perp.text0=Objekten \u00E4r vinkelr\u00E4ta +macro.bi_t_perp.text1=Objekten \u00E4r inte vinkelr\u00E4ta +macro.bi_t_equi.text0=Punkterna har samma avst\u00E5nd +macro.bi_t_equi.text1=Punkterna har inte samma avst\u00E5nd +macro.bi_t_app.text0=Punkten ligger p\u00E5 objektet +macro.bi_t_app.text1=Punkten ligger inte p\u00E5 objektet +macro.bi_t_conf.text0=De tv\u00E5 punkterna ligger p\u00E5 samma plats +macro.bi_t_conf.text1=De tv\u00E5 punkterna ligger inte p\u00E5 samma plats +palette.test=Tester + +# v1.7 : +filedialog.openfolder.appletsize=Applet storlek : +filedialog.openfolder.actualsize=Aktuell storlek +filedialog.openfolder.other=Annat... +filedialog.openfolder.selected=Vald mapp : +filedialog.openfolder.cancel=Avbryt +menu.file.exportsvg=Exportera till SVG +menu.language.sl=Slovenski +menu.language.nl=Nederlands +menu.language.pt=Portugu\u00EAs +props.vars=Variabler : +menu.objects.points=Punkter +menu.objects.lines=Linjer +menu.objects.segments=Segment +menu.objects.circles=Cirklar och k\u00E4glor +menu.objects.angles=Vinklar +menu.objects.tracks=Sp\u00E5r och ort +menu.objects.functions=Funktioner och uttryck +palette.info.function_u=Anv\u00E4ndardefinierad funktion +palette.info.function=Visa funktion+eller parametrisk kurva +props.superhidden=Helt g\u00F6md : +props.showvalue=Visa v\u00E4rde : +props.showname=Visa namn : +props.background=Bakgrund : +macro.bi_expression.0=Ankarpunkt ? + +# v1.9a : +menu.help.licence=Licens... +licence.txt=

Detta program \u00E4r fri mjukvara under GNU-GPL licensen, vilket inneb\u00E4r att du kan redistribuera den och/eller f\u00F6r\u00E4ndra den under licensens villkor, som \u00E4r publicerad av the Free Software Foundation;
Se :

+ + +# v2.0 : +menu.special.theme=Teman +menu.special.theme.gray=Polerad metall +menu.special.theme.brushed=Borstad metall +menu.special.options=Alternativ... +menu.special.options.sizes=Storlekar +menu.special.options.sizes.minpointsize=Punktstorlek +menu.special.options.sizes.minlinesize=Linjetjocklek +menu.special.options.sizes.arrowsize=Pilstorlek +menu.special.options.sizes.minfontsize=Typsnittsstorlek +menu.special.options.sizes.digits.lengths=L\u00E4ngdprecision +menu.special.options.sizes.digits.edit=Uttrycksprecision +menu.special.options.sizes.digits.angles=Vinkelprecision +menu.special.options.colors=F\u00E4rger +menu.special.options.others=Annat +menu.special.options.others.undock=M\u00F6jligt att koppla loss paletter + +# v2.1 : +menu.file.close=St\u00E4ng f\u00F6nster + +# v2.3 : +alert.toomuchwins=Det finns f\u00F6r m\u00E5nga \u00F6ppna f\u00F6nster :
st\u00E4ng n\u00E5gra av dem innan du \u00F6ppnar
ett nytt + +# v2.4 : +menu.file.new3D=Ny 3D figur +palette.3D=3D +palette.info.bi_3Dcoords=3D koordinater +macro.bi_3Dcoords.0=Ankarpunkt ? +palette.info.bi_3Dcube=Kub +macro.bi_3Dcube.0=Kubens centrum ? +palette.info.bi_3Darete=3D kanter +macro.bi_3Darete.0=F\u00F6rsta punkten ? +macro.bi_3Darete.1=andra punkten ? +macro.bi_3Darete.2=Tredje punkten ? +macro.bi_3Darete.3=Fj\u00E4rde punkten ? +palette.info.bi_3Dtetra=Liksidig tetrahedon +macro.bi_3Dtetra.0=Tetrahedons centrum ? +menu.newdoc=Ny +menu.language.it=Italiano + +# v2.5.5 : +palette.aspect.label.text_title=Aspekt av +palette.aspect.label.point=punkter +palette.aspect.label.line=linjer +palette.aspect.label.segment=segment +palette.aspect.label.circle=cirklar +palette.aspect.label.angle=vinklar +palette.aspect.label.area=polygoner +palette.aspect.label.text=text +palette.info.bi_3Ddode=Liksidig dodekahedron +macro.bi_3Ddode.0=Dodekahedrons centrum ? + +# v2.7 : +palette.aspect.label.pointshape=Form & namn p\u00E5 punkter : +palette.aspect.label.locus=Ort +menu.edit.deleteall=Radera allt + + +# v2.7.1 : +java.old.message=Beklagar, du kan inte starta CaRMetal programmet, d\u00E4rf\u00F6r att versionen p\u00E5 din java \u00E4r f\u00F6r gammal ! +java.old.quit=Avsluta +java.old.go=Ladda ned ny java version +palette.info.boundedpoint=Placera en punkt i ett plan+eller p\u00E5 en polyhedron yta + +#v2.7.2 : +user.foldername=CarMetal Anv\u00E4ndarprofil + +#v2.8 +props.fixedray=Str\u00E5le : +props.fixedsegment=L\u00E4ngd : +props.fixedangle=Vinkel : +props.expl=Kommentarlinje : +props.aspecttab=L\u00E4ge +props.numerictab=Numerisk +props.conditionaltab=Villkor +props.thick=Tjocklek : +props.popup.special=Specialtecken +props.popup.functions=F\u00F6rdefinierade funktioner +props.popup.latex=LaTeX kommandon +menu.language.pl=Polski + +#v2.8.1 +props.fixedinwindow=L\u00E4nkat till f\u00F6nster + +#v2.8.5 +palette.controls=Kontroller +props.ctrlshowvalue=Visa v\u00E4rde +props.ctrlsnap=Sn\u00E4pp till rutn\u00E4t +props.ctrlshowticks=Visa rutn\u00E4t +props.ctrltickspacing=Inkrement : +palette.info.ctrl_edit=Redigera, flytta eller \u00E4ndra storlek p\u00E5 kontrollen +palette.info.ctrl_chkbox=L\u00E4gg till kryssruta +palette.info.ctrl_popup=L\u00E4gg till popup-meny +palette.info.ctrl_slider=Lagg till skjutkontroll + +#v2.8.6 +props.trackdmin=Antal steg : +opendialog.preview=F\u00F6rhandsvisning : +pngdialog.options=Exportalternativ : +pngdialog.scale=Skala : +pngdialog.originsize=Original storlek : +pngdialog.scaledsize=Skalad storlek : + +#v2.8.7 +canvas.3D.floor=Golv +canvas.3D.system=Koordinatsystem +canvas.3D.rightclic=Anv\u00E4nd h\u00F6gerklick-dra f\u00F6r att rotera koordinatsystemet + + +#v2.8.8 +palette.info.equationxy=Kurva definierad av f(x,y)=0 +props.equationxy=Ekvation : +props.equationxychooser=Precision : +palette.function=Funktioner & ort + +#v2.8.9 +menu.edit.deletealltracks=Rensa sp\u00E5r +menu.edit.deactivatealltracks=Avaktivera sp\u00E5r +props.tracks=Aktivera sp\u00E5r +menu.edit.zoom=Zoom eller flytta + +#v2.9.0 +menu.windows=F\u00F6nster + +#v2.9.1 +contexthelp.seealso=Se \u00E4ven : + +#v2.9.2 +menu.language.pt_BR=Brazilian +menu.display.restrictmessage.dontdisplay=Visa inte detta meddelande mer + +#v2.9.6 +props.magnetmessage=Klicka p\u00E5 de objekt som du vill l\u00E4gga till (eller ta bort fr\u00E5n) den magnetiska listan +props.magnetobj=Magnetiska objekt +props.magnetpix=Attraktion (20 px) : +props.show=Visa + +#v2.9.7 +palette.info.ctrl_txtfield=L\u00E4gg till numerisk inmatningsruta +palette.info.ctrl_button=L\u00E4gg till knapp + +#v2.9.8.4 +JSerror.title=Syntaxfel +JSerror.line=linje +JSerror.pointcoords=Syntaxfel i punktkoordinaterna +JSerror.interactiveinput=Fel under val av objektet +JSerror.notfound=Objekt ej funnet +JSerror.notgoodtype=Om\u00F6jligt att anv\u00E4nda p\u00E5 denna objekttyp +JScmd.inputmessage=Din fr\u00E5ga ? +JScmd.promptmessage=Ditt meddelande... +menu.js=Javascript +menu.js.script=\u00D6ppna javascript fil... +menu.js.command=\u00D6ppna skriptredigeraren +JSeditor.title=Javascript redigerare + +#v3.0 +JSeditor.save=Spara skript +JSeditor.open=\u00D6ppna skript +JSeditor.opendlogmsg=\u00D6ppna skript +JSeditor.savedlogmsg=Spara skript +JSeditor.format=Formattera skript +JSeditor.restore=Avbryt sista k\u00F6rningen +JSeditor.run=K\u00F6r skript +JSeditor.help=H\u00E4mta syntax hj\u00E4lp +JSEditor.comment=Kommentera/Avkommentera valet +JSEditor.savequestion=Detta skript har \u00E4ndrats : vill du spara det ? +menu.language.ar_TN=Arabic + +# v3.1.1 +menu.js.define=Definiera skriptmapp... +menu.js.dumb=K\u00F6r favoritskript utan redigerare +JSeditor.opendfavfolder=V\u00E4lj skriptmapp +JSeditor.saveas=Spara skript som... \ No newline at end of file diff --git a/eric/docs/JZirkelProperties_zh_TW.properties b/eric/docs/JZirkelProperties_zh_TW.properties new file mode 100644 index 0000000..f37c167 --- /dev/null +++ b/eric/docs/JZirkelProperties_zh_TW.properties @@ -0,0 +1,372 @@ +# Sample ResourceBundle properties file +menu.file=\u6A94\u6848 +menu.file.new=\u65B0\u6A94\u6848 +menu.file.load=\u958B\u555F\u820A\u6A94... +menu.file.save=\u5132\u5B58 +menu.file.saveas=\u5132\u5B58\u70BA... + +menu.file.exportpng=\u532F\u51FA PNG \u6A94 +menu.file.exporteps=\u532F\u51FA EPS \u6A94 +menu.file.quit=\u96E2\u958B +menu.edit=\u7DE8\u8F2F +menu.edit.copy=\u8907\u88FD +menu.edit.move=\u79FB\u52D5 +menu.edit.rename=\u6539\u540D +menu.edit.edit=\u7DE8\u8F2F\u5C6C\u6027 +menu.edit.hide=\u96B1\u85CF +menu.edit.delete=\u522A\u9664 +menu.display=\u986F\u793A +menu.display.hidden=(\u4E0D)\u986F\u793A\u5DF2\u96B1\u85CF\u7269\u4EF6 +menu.display.grid=(\u4E0D)\u986F\u793A\u683C\u7DDA +menu.display.finegrid=\u53EA\u986F\u793A\u5EA7\u6A19\u8EF8 +menu.display.leftsnap=\u5438\u9644\u683C\u5B50\u9EDE +menu.display.manage_macros=\u5DE5\u5177\u76EE\u9304 +menu.display.history_panel=\u7269\u4EF6\u76EE\u9304 +menu.display.help_panel=\u64CD\u4F5C\u8AAA\u660E +menu.display.properties_panel= \u7269\u4EF6\u5C6C\u6027 +menu.display.small=\u5C0F\u578B\u6309\u9215 +menu.display.medium=\u4E2D\u578B\u6309\u9215 +menu.display.large=\u5927\u578B\u6309\u9215 +menu.display.restrictedpalette=\u986F\u793A\u7CBE\u7C21\u578B\u9762\u7248 +menu.display.restrictedpaletteedit=\u7DE8\u8F2F\u7CBE\u7C21\u578B\u9762\u7248 +menu.display.restrictmessage=
\u6B64\u529F\u80FD\u6703\u986F\u793A\u300C\u7CBE\u7C21\u578B\u9762\u7248\u300D\uFF0C\u4E5F\u5C31\u662F\u53EA\u986F\u793A\u6709\u7528\u5230\u7684\u5DE5\u5177\u3002

\u5B83\u53EA\u6703\u5F71\u97FF\u76EE\u524D\u7684\u6A94\u6848\uFF0C\u8DDF\u5176\u4ED6\u6A94\u6848\u7121\u95DC\u3002

\u7576\u4F60\u5B58\u6A94\u7684\u6642\u5019\uFF0C\u4F60\u4E5F\u53EF\u4EE5\u9078\u64C7\u5132\u5B58\u300C\u7CBE\u7C21\u578B\u9762\u7248\u300D\uFF0C
\u9019\u6A23\u6703\u7522\u751F\u5169\u500B\u6A94\u6848\uFF1A\u4E00\u500B\u662F\u6B63\u5E38\u7684 .zir \u6A94\uFF0C
\u53E6\u4E00\u500B\u662F\u5177\u6709\u7CBE\u7C21\u578B\u9762\u7248\u7684 .r.zir \u6A94\u3002
+menu.macros=\u5DE5\u5177 +menu.special=\u9032\u968E +menu.special.newmacro=\u65B0\u5DE5\u5177 +menu.special.loadmacros=\u958B\u555F\u5DE5\u5177... +menu.special.definejob=\u8A2D\u8A08\u65B0\u4F5C\u696D +menu.special.loadjob=\u8F09\u5165\u4F5C\u696D... +menu.special.jobcomment=\u8A2D\u5B9A\u4F5C\u696D\u5167\u6587... +menu.special.testjob=\u6E2C\u8A66\u6B64\u4F5C\u696D +menu.special.savejob=\u53E6\u5B58\u4F5C\u696D... +menu.special.export=\u532F\u51FA\u7DB2\u9801\u6A94 +menu.special.exporttemplate=\u7528\u6A21\u7248\u532F\u51FA\u7DB2\u9801\u6A94 +menu.help=\u8AAA\u660E +menu.help.about=\u95DC\u65BC CaRMetal... +menu.help.info=\u64CD\u4F5C\u8AAA\u660E +menu.help.url0=CaRMetal \u7DB2\u7AD9 +menu.help.url1=CARzine \u7DB2\u7AD9 +menu.help.url2=C.a.R. \u7DB2\u7AD9 + +filedialog.saveas=\u5B58\u6A94 +filedialog.alsorestricted=\u5132\u5B58\u300C\u7CBE\u7C21\u578B\u9762\u7248\u300D +filedialog.options=\u5B58\u6A94\u9078\u9805 +filedialog.restrictedmessage=\u76EE\u524D\u7684\u6A94\u6848\u4F7F\u7528\u300C\u7CBE\u7C21\u578B\u9762\u7248\u300D\uFF0C
\u6240\u4EE5\u4E5F\u6703\u7528\u9019\u7A2E\u6A21\u5F0F\u5B58\u6A94\u3002 +filedialog.filefilter=CaR \u6A94 (.zir) +filedialog.compressedfilefilter=CaR \u58D3\u7E2E\u6A94(.zirz) +filedialog.macrofilefilter=CaR \u5DE8\u96C6\u6A94(.mcr) +filedialog.savemessage1=\u6A94\u6848\uFF1A\n +filedialog.savemessage2=\n\u5DF2\u7D93\u5B58\u5728\u3002\u4F60\u8981\u8986\u84CB\u5B83\u55CE\uFF1F + +palette.file=\u6A94\u6848 +palette.edit=\u7DE8\u8F2F +palette.construction=\u4F5C\u5716 +palette.aspect=\u8272\u5F69\u8207\u6A23\u5F0F +palette.history=\u4F5C\u5716\u904E\u7A0B +palette.sizes=\u5927\u5C0F\u5C3A\u5BF8 +palette.sizes.point=\u9EDE +palette.sizes.line=\u7DDA +palette.sizes.arrow=\u7BAD\u982D +palette.sizes.font=\u5B57\u9AD4 +palette.prec=\u6578\u5B57\u7CBE\u78BA\u5EA6 +palette.prec.lengths=\u9577\u5EA6 +palette.prec.edit=\u8A08\u7B97\u5F0F +palette.prec.angles=\u89D2\u5EA6 +palette.colors=\u80CC\u666F\u8A2D\u5B9A +palette.colors.saturated1=\u9BAE\u660E\u8272 +palette.colors.desaturated1=\u6697\u6DE1\u8272 +palette.colors.saturated2=\u9BAE\u660E\u8272 2 +palette.colors.desaturated2=\u6697\u6DE1\u8272 2 +palette.colors.constants=\u7DB2\u9801\u5B89\u5168\u8272 +palette.image.fileerror=\u4F60\u5FC5\u9808\u5148\u5B58\u6A94\u624D\u80FD\u63D2\u5165\u5716\u7247\u3002

\u6CE8\u610F\uFF1A\u4F60\u63D2\u5165\u7684\u5716\u7247\u5FC5\u9808\u548C\u76EE\u524D\u7684\u6A94\u6848
\u5728\u540C\u4E00\u500B\u8CC7\u6599\u593E\u5167\u3002 + +palette.info.vector=\u5411\u91CF +palette.info.image3=\u63D2\u5165\u5716\u7247\uFF08\u9700\u5148\u6307\u5B9A\u4E09\u9802\u9EDE\uFF09 +palette.info.background=\u9078\u64C7/\u6E05\u9664\u80CC\u666F\u5716 +palette.info.imcenter=\u80CC\u666F\u5716\u7F6E\u4E2D +palette.info.imstretch=\u5EF6\u5C55\u80CC\u666F\u5716 +palette.info.imtile=\u80CC\u666F\u5716\u4E26\u6392\u986F\u793A +palette.info.copy=\u8907\u88FD\u76EE\u524D\u7684\u4F5C\u5716\u5230\u526A\u8CBC\u7C3F +palette.info.exportpng=\u5C07\u76EE\u524D\u7684\u4F5C\u5716\u532F\u51FA\u6210 png \u6A94 +palette.info.exporteps=\u5C07\u76EE\u524D\u7684\u4F5C\u5716\u532F\u51FA\u6210 eps \u6A94 +palette.info.newmacro=\u81EA\u88FD\u65B0\u5DE5\u5177 +palette.info.loadmacros=\u8F09\u5165\u5DE5\u5177\u6A94 +palette.info.manage_macros=\u986F\u793A\u6216\u96B1\u85CF\u300C\u81EA\u88FD\u5DE5\u5177\u300D\u9762\u7248 +palette.info.properties_panel=\u986F\u793A\u6216\u96B1\u85CF\u300C\u7269\u4EF6\u5C6C\u6027\u300D\u9762\u7248 +palette.info.history_panel=\u986F\u793A\u6216\u96B1\u85CF\u300C\u7269\u4EF6\u76EE\u9304\u300D\u9762\u7248 +palette.info.help_panel=\u986F\u793A\u6216\u96B1\u85CF\u300C\u64CD\u4F5C\u8AAA\u660E\u300D\u9762\u7248 + + + +macros.untitledmacro=\u65B0\u5DE5\u5177 +macros.untitledfolder=\u65B0\u8CC7\u6599\u593E +macros.emptynode=-- \u7A7A\u7684 -- +macros.addfolder=\u65B0\u589E\u8CC7\u6599\u593E +macros.deleteselected=\u5C07\u9078\u64C7\u7684\u5DE5\u5177\u522A\u9664 +macros.renamemacro=\u5C07\u9078\u64C7\u7684\u5DE5\u5177\u6539\u540D +macros.recordmacro=\u9304\u88FD\u65B0\u5DE5\u5177 +macros.initials=\u8ACB\u6307\u5B9A\u521D\u59CB\u7269\u4EF6 +macros.pleaseselect=\u8ACB\u9078\u64C7\uFF01 +macros.finals=\u8ACB\u6307\u5B9A\u6700\u7D42\u7269\u4EF6 +macros.cancel=\u8981\u53D6\u6D88\uFF1F +macros.popup.run=\u57F7\u884C\u5DE5\u5177 +macros.popup.rename=\u6539\u540D +macros.popup.delete=\u522A\u9664 +macros.popup.addtolibrary=\u65B0\u589E\u81F3\u5DE8\u96C6\u5EAB +macros.popup.removefromlibrary=\u5F9E\u5DE8\u96C6\u5EAB\u79FB\u9664 +macros.popup.publish=\u5F15\u5165\u6B64\u67B6\u69CB +macros.popup.notpublish=\u4E0D\u5F15\u5165\u6B64\u67B6\u69CB +macros.popup.saveas=\u53E6\u5B58\u5DE5\u5177\u6A94... +macros.popup.properties=\u986F\u793A\u5C6C\u6027 +macros.popup.duplicate=\u8907\u88FD +macros.savedlog.buttonok=\u5132\u5B58\u5DE5\u5177\u6A94 +macros.question.delete=\u60A8\u78BA\u5B9A\u8981\u522A\u9664\u9019\u4E9B\u5DE5\u5177\u55CE\uFF1F + +rene.zirkel.objects.PointObject=\u9EDE +rene.zirkel.objects.PrimitiveCircleObject=\u5713 +rene.zirkel.objects.PrimitiveLineObject=\u7DDA +rene.zirkel.objects.ExpressionObject=\u904B\u7B97\u5F0F. +rene.zirkel.objects.FixedAngleObject=\u56FA\u5B9A\u5927\u5C0F\u7684\u593E\u89D2. +rene.zirkel.objects.SegmentObject=\u7DDA\u6BB5 . +rene.zirkel.objects.RayObject=\u5C04\u7DDA +rene.zirkel.objects.TwoPointLineObject=\u76F4\u7DDA +rene.zirkel.objects.FunctionObject=\u51FD\u5F0F +rene.zirkel.objects.AreaObject=\u5340\u57DF + + +mi.pal.name=\u5DE8\u96C6\u89C0\u5BDF\u5668 +mi.name=\u540D\u7A31 : +mi.comment=\u8A3B\u89E3 : +mi.properties=\u53C3\u6578\u7269\u4EF6\u7684\u5C6C\u6027 : +mi.hideproperties=\u76EE\u6A19\u7269\u4EF6\u7684\u5C6C\u6027 : +mi.hideduplicates=\u96B1\u85CF\u8907\u88FD\u7684\u7269\u4EF6 +mi.apply=\u5957\u7528 +mi.tab.type=\u985E\u578B +mi.tab.name=\u540D\u7A31 +mi.tab.prompt=\u63D0\u793A +mi.tab.fix=\u56FA\u5B9A ? +mi.tab.ask=\u8A62\u554F ? +mi.error.initial=\u932F\u8AA4 : \u81F3\u5C11\u8981\u6709\u4E00\u500B\u53C3\u6578 \n \u4E0D\u88AB\u8A2D\u5B9A\u70BA\u88AB\u56FA\u5B9A \n\n \u5DE8\u96C6\u7121\u6CD5\u88AB\u8B8A\u66F4 + +props.help=\u4F60\u8981\u5728\u67D0\u500B\u7269\u4EF6\u4E0A\u6309\u6ED1\u9F20\u53F3\u9375\uFF0C\u5C6C\u6027\u9762\u677F\u624D\u6703\u6253\u958B\u3002

\u5982\u679C\u4F60\u5728\u505A\u4E00\u500B\u65B0\u7684\u7269\u4EF6\u6642\uFF0C\u5C6C\u6027\u9762\u677F\u662F\u6253\u958B\u7684\uFF0C\u90A3\u4F60\u5C31\u53EF\u4EE5\u76F4\u63A5\u4FEE\u6539\u8A72\u7269\u4EF6\u7684\u5C6C\u6027\u3002 +props.name=\u540D\u7A31 : +props.alias=\u5225\u540D : +props.unit=\u55AE\u4F4D : +props.fix=\u56FA\u5B9A : +props.expl=\u8AAA\u660E\u6587\u5B57 : +props.belongto=\u5C64\u6B21 : +props.conditional=\u8A2D\u5B9A\u683C\u5F0F\u5316\u689D\u4EF6 : +props.solid=\u5BE6\u7DDA : +props.hidden=\u96B1\u85CF : +props.normal=\u6B63\u5E38 : +props.bold=\u7C97\u7DDA : +props.thin=\u865B\u7DDA : +props.black=\u9ED1\u8272 : +props.green=\u7DA0\u8272 : +props.blue=\u85CD\u8272 : +props.brown=\u68D5\u8272 : +props.cyan=\u9752\u8272 : +props.red=\u7D05\u8272 : +props.showasslider=\u986F\u793A\u6210\u6ED1\u52D5\u687F : +props.error=\u60A8\u8A2D\u5B9A\u7684\u6578\u5B78\u5F0F\u6709\u9EDE\u554F\u984C\uFF0C
\u8ACB\u91CD\u65B0\u8A2D\u5B9A\u3002 +props.cartesian=\u5EA7\u6A19\u51FD\u6578 +props.parametric=\u53C3\u6578\u5F0F +props.functiontype=\u985E\u578B : +props.killarc=\u522A\u9664\u5713\u5F27 +props.arc=\u5713\u5F27... +props.release=\u812B\u96E2 +props.bind=\u9644\u8457\u65BC... +props.setaway=\u8A2D\u5B9A\u9060\u96E2\u65BC +props.setclose=\u8A2D\u5B9A\u9760\u8FD1\u65BC + + +# v1.3 : +props.grid=\u7DB2\u683C\u905E\u589E\u91CF : +props.inside=\u7269\u4EF6\u5167\u90E8 : +props.pointsonly=\u53EA\u63CF\u9EDE : +props.step=\u9593\u9694 : +palette.grid=\u5EA7\u6A19\u8EF8 +leftpanel.macros=\u5DE5\u5177\u9762\u677F +leftpanel.properties=\u5C6C\u6027\u9762\u677F +leftpanel.history=\u7269\u4EF6\u9762\u677F +leftpanel.help=\u64CD\u4F5C\u8AAA\u660E +selectpopup.whatobject=\u8981\u9078\u54EA\u4E00\u500B\uFF1F +selectpopup.RightClick=\u7DE8\u8F2F +selectpopup.MoverTool=\u79FB\u52D5 +selectpopup.HiderTool=\u986F\u793A/\u96B1\u85CF +selectpopup.DeleteTool=\u522A\u9664 +selectpopup.RenamerTool=\u91CD\u547D\u540D +selectpopup.EditTool=\u7DE8\u8F2F +selectpopup.SetParameterTool=\u8ACB\u9078\u64C7\u521D\u59CB\u7269\u4EF6 : +selectpopup.SetTargetsTool=\u8ACB\u9078\u64C7\u6700\u7D42\u7269\u4EF6 : +palette.info.locus=\u9EDE\u6CBF\u8457\u7DDA\u79FB\u52D5\u7684\u8ECC\u8DE1 + + +# v1.4 : +menu.special.savezirset=\u5EFA\u7ACB\u7C21\u5831... +filedialog.openfolder.title=\u7C21\u5831\u8CC7\u6599\u593E\u9078\u53D6\u4E4B\u5C0D\u8A71\u65B9\u584A +filedialog.openfolder.approve=\u9078\u53D6\u7C21\u5831\u8CC7\u6599\u593E +filedialog.openfolder.saveicons=\u4E26\u5132\u5B58\u5716\u793A +slideshow.next=\u4E0B\u4E00\u5F35 +slideshow.previous=\u524D\u4E00\u5F35 +slideshow.download=\u4E0B\u8F09\u6A94\u6848 +slideshow.signature=\u88FD\u4F5C\u6B64\u7C21\u5831\u7684\u5DE5\u5177 + +# v1.5 : +menu.language=\u8A9E\u8A00 +menu.language.de=Deutsch +menu.language.en=English +menu.language.fr=Fran\u00E7ais +menu.language.es=Espa\u00F1ol +menu.language.gl=Galego +menu.language.zh_TW=\u6B63\u9AD4\u4E2D\u6587 +menu.help.url3=\u7FFB\u8B6F CaRMetal +menu.display.smartboard=Smartboard \u6A21\u5F0F + +# v1.6 : +menu.language.no=Norsk +palette.info.bi_syma=\u93E1\u5C04 +palette.info.bi_symc=\u5C0D\u7A31 +palette.info.bi_trans=\u5E73\u79FB +palette.info.bi_med=\u4E2D\u5782\u7DDA +palette.info.bi_biss=\u5206\u89D2\u7DDA +palette.info.bi_circ=\u904E\u4E09\u9EDE\u7684\u5713 +palette.info.bi_arc=\u904E\u4E09\u9EDE\u7684\u5713\u5F27 +palette.info.bi_t_align=\u5171\u7DDA\u7684\u9EDE ? +palette.info.bi_t_para=\u5E73\u884C\u7DDA ? +palette.info.bi_t_perp=\u5782\u7DDA ? +palette.info.bi_t_equi=\u8207\u5169\u9EDE\u7684\u8DDD\u96E2\u7686\u76F8\u7B49 ? +palette.info.bi_t_app=\u518D\u7DDA\u4E0A ? +palette.info.bi_t_conf=\u76F8\u540C\u4F4D\u7F6E\u7684\u9EDE ? +macro.bi_syma.0=\u93E1\u5C04\u7DDA ? +macro.bi_syma.1=\u93E1\u5C04\u7684\u9EDE ? +macro.bi_symc.0=\u5C0D\u7A31\u4E2D\u5FC3 ? +macro.bi_symc.1=\u93E1\u5C04\u7684\u9EDE ? +macro.bi_trans.0=\u5411\u91CF\u7684\u59CB\u9EDE ? +macro.bi_trans.1=\u5411\u91CF\u7684\u7D42\u9EDE ? +macro.bi_trans.2=\u8981\u88AB\u5E73\u79FB\u7684\u9EDE ? +macro.bi_med.0=\u7DDA\u6BB5\u7684\u7B2C1\u500B\u7AEF\u9EDE ? +macro.bi_med.1=\u7DDA\u6BB5\u7684\u7B2C2\u500B\u7AEF\u9EDE ? +macro.bi_biss.0=\u7B2C\u4E00\u500B\u9EDE ? +macro.bi_biss.1=\u593E\u89D2\u9802\u9EDE ? +macro.bi_biss.2=\u6700\u5F8C\u4E00\u500B\u9EDE ? +macro.bi_circ.0=\u7B2C\u4E00\u500B\u9EDE ? +macro.bi_circ.1=\u7B2C\u4E8C\u500B\u9EDE ? +macro.bi_circ.2=\u7B2C\u4E09\u500B\u9EDE ? +macro.bi_t_para.0=\u7B2C\u4E00\u689D\u7DDA ? +macro.bi_t_para.1=\u7B2C\u4E8C\u689D\u7DDA ? +macro.bi_t_equi.0=\u6B64\u9EDE\u662F\u5426\u7B49\u8DDD ... +macro.bi_t_equi.1=\u5230\u9019\u4E00\u500B\u9EDE ... +macro.bi_t_equi.2=\u4E14\u5230\u9019\u4E00\u500B\u9EDE ? +macro.bi_t_app.0=\u54EA\u4E00\u500B\u9EDE ? +macro.bi_t_app.1=\u4F4D\u5728\u54EA\u4E00\u689D\u76F4\u7DDA\u6216\u7DDA\u6BB5 ? +macro.bi_t_conf.0=\u54EA\u4E00\u500B\u9EDE ? +macro.bi_t_conf.1=\u5728\u54EA\u4E00\u500B\u9EDE\u4E4B\u4E0A ? +macro.bi_t_align.text0=\u9EDE\u5F7C\u6B64\u5171\u7DDA +macro.bi_t_align.text1=\u9EDE\u5F7C\u6B64\u4E0D\u5171\u7DDA +macro.bi_t_para.text0=\u7269\u4EF6\u5F7C\u6B64\u4E92\u76F8\u5E73\u884C +macro.bi_t_para.text1=\u7269\u4EF6\u5F7C\u6B64\u4E26\u4E0D\u4E92\u76F8\u5E73\u884C +macro.bi_t_perp.text0=\u7269\u4EF6\u5F7C\u6B64\u4E92\u76F8\u5782\u76F4 +macro.bi_t_perp.text1=\u7269\u4EF6\u5F7C\u6B64\u4E26\u4E0D\u4E92\u76F8\u5782\u76F4 +macro.bi_t_equi.text0=\u8DDD\u96E2\u76F8\u7B49 +macro.bi_t_equi.text1=\u8DDD\u96E2\u4E26\u4E0D\u76F8\u7B49 +macro.bi_t_app.text0=\u9EDE\u4F4D\u5728\u6B64\u7269\u4EF6\u4E0A +macro.bi_t_app.text1=\u4E0D\u53EF\u5C07\u9EDE\u653E\u5728\u6B64\u7269\u4EF6\u4E0A +macro.bi_t_conf.text0=\u9019\u5169\u500B\u9EDE\u7684\u4F4D\u7F6E\u76F8\u540C +macro.bi_t_conf.text1=\u9019\u5169\u500B\u9EDE\u7684\u4F4D\u7F6E\u4E0D\u76F8\u540C +palette.test=\u6E2C\u8A66 + +# v1.7 : +filedialog.openfolder.appletsize=Applet \u5C3A\u5BF8 : +filedialog.openfolder.actualsize=\u5BE6\u969B\u5C3A\u5BF8 +filedialog.openfolder.other=\u5176\u4ED6... +filedialog.openfolder.selected=\u5DF2\u9078\u53D6\u7684\u8CC7\u6599\u593E : +filedialog.openfolder.cancel=\u53D6\u6D88 +menu.file.exportsvg=\u8F38\u51FA\u6210 SVG \u683C\u5F0F +menu.language.sl=Slovenski +menu.language.nl=Nederlands +menu.language.pt=Portugu\u00EAs +props.vars=\u8B8A\u6578 : +menu.objects.points=\u9EDE +menu.objects.lines=\u7DDA +menu.objects.segments=\u7DDA\u6BB5 +menu.objects.circles=\u5713\u6216\u5713\u9310\u66F2\u7DDA +menu.objects.angles=\u593E\u89D2 +menu.objects.tracks=\u6C42\u8ECC\u8DE1\u8207\u8ECC\u8DE1 +menu.objects.functions=\u51FD\u5F0F\u6216\u7B97\u8853\u904B\u7B97\u5F0F +palette.info.function_u=\u986F\u793A\u5B9A\u7FA9\u7684\u51FD\u5F0F +palette.info.function=\u986F\u793A\u51FD\u5F0F\u6216\u53C3\u6578\u5316\u66F2\u7DDA +props.superhidden=\u5B8C\u5168\u96B1\u85CF : +props.showvalue=\u986F\u793A\u503C : +props.showname=\u986F\u793A\u540D\u7A31 : +props.background=\u80CC\u666F : +macro.bi_expression.0=\u9328\u9EDE ? + +# v1.9a : +menu.help.licence=\u7248\u6B0A... +licence.txt=

This program is \u81EA\u7531\u8EDF\u9AD4\uFF0C\u4F7F\u7528 GNU-GPL \u6388\u6B0A\u65B9\u5F0F, which means you can redistribute it and/or modify it under the terms of the licence published by the Free Software Foundation;
See :

+ + +# v2.0 : +menu.special.theme=\u4F48\u666F\u4E3B\u984C +menu.special.theme.gray=\u78E8\u4EAE\u7684\u91D1\u5C6C\u5916\u89C0 +menu.special.theme.brushed=\u5237\u4EAE\u7684\u91D1\u5C6C\u5916\u89C0 +menu.special.options=\u559C\u597D\u8A2D\u5B9A... +menu.special.options.sizes=\u5C3A\u5BF8 +menu.special.options.sizes.minpointsize=\u9EDE\u7684\u5927\u5C0F +menu.special.options.sizes.minlinesize=\u7DDA\u5BEC +menu.special.options.sizes.arrowsize=\u7BAD\u982D\u5927\u5C0F +menu.special.options.sizes.minfontsize=\u5B57\u578B\u5927\u5C0F +menu.special.options.sizes.digits.lengths=\u9577\u5EA6\u7CBE\u78BA\u5EA6 +menu.special.options.sizes.digits.edit=\u7B97\u8853\u904B\u7B97\u5F0F\u7CBE\u78BA\u5EA6 +menu.special.options.sizes.digits.angles=\u89D2\u5EA6\u7CBE\u78BA\u5EA6 +menu.special.options.colors=\u984F\u8272 +menu.special.options.others=\u5176\u4ED6 +menu.special.options.others.undock=\u5141\u8A31\u81EA\u7531\u653E\u7F6E\u5DE5\u5177\u7BB1\u6216\u8272\u76E4 + +# v2.1 : +menu.file.close=\u95DC\u9589\u8996\u7A97 + +# v2.3 : +alert.toomuchwins=\u958B\u555F\u592A\u591A\u8996\u7A97 :
\u8ACB\u95DC\u9589\u90E8\u4EFD\u8996\u7A97\u5F8C\u518D\u958B\u555F
\u65B0\u8996\u7A97 + +# v2.4 : +menu.file.new3D=\u65B0\u958B\u67093D\u67B6\u69CB\u7684\u8996\u7A97 +palette.3D=3D +palette.info.bi_3Dcoords=3D \u5EA7\u6A19 +macro.bi_3Dcoords.0=\u9328\u9EDE ? +palette.info.bi_3Dcube=\u6B63\u7ACB\u65B9\u9AD4 +macro.bi_3Dcube.0=\u6B63\u7ACB\u65B9\u9AD4\u7684\u4E2D\u5FC3 ? +palette.info.bi_3Darete=3D \u908A +macro.bi_3Darete.0=\u7B2C1\u500B\u9EDE ? +macro.bi_3Darete.1=\u7B2C2\u500B\u9EDE ? +macro.bi_3Darete.2=\u7B2C3\u500B\u9EDE ? +macro.bi_3Darete.3=\u7B2C4\u500B\u9EDE ? +palette.info.bi_3Dtetra=\u6B63\u56DB\u9762\u9AD4 +macro.bi_3Dtetra.0=\u6B63\u56DB\u9762\u9AD4\u7684\u4E2D\u5FC3 ? +menu.newdoc=\u65B0\u6587\u4EF6 +menu.language.it=Italiano + +# v2.5.5 : +palette.aspect.label.text_title=\u4F4D\u7F6E +palette.aspect.label.point=\u9EDE +palette.aspect.label.line=\u7DDA +palette.aspect.label.segment=\u7DDA\u6BB5 +palette.aspect.label.circle=\u5713 +palette.aspect.label.angle=\u593E\u89D2 +palette.aspect.label.area=\u591A\u908A\u5F62 +palette.aspect.label.text=\u6587\u5B57 +palette.info.bi_3Ddode=\u6B63\u5341\u4E8C\u9762\u9AD4 +macro.bi_3Ddode.0=\u6B63\u5341\u4E8C\u9762\u9AD4\u4E2D\u5FC3 ? + +# v2.7 : +palette.aspect.label.pointshape=\u9EDE\u7684\u5916\u89C0\u8207\u540D\u7A31 : +palette.aspect.label.locus=\u8ECC\u8DE1 +menu.edit.deleteall=\u5168\u90E8\u522A\u9664 + + +# v2.7.1 : +java.old.message=\u62B1\u6B49, \u7121\u6CD5\u555F\u52D5 CaRMetal , \u539F\u56E0\u70BA\u4F60\u7684 java \u57F7\u884C\u74B0\u5883\u7248\u672C\u592A\u820A ! +java.old.quit=\u505C\u6B62 +java.old.go=\u4E0B\u8F09\u65B0\u7684 java \u7248\u672C +palette.info.boundedpoint=\u5C07\u9EDE\u653E\u5728\u5E73\u9762\u6216\u591A\u9762\u9AD4\u7684\u9762\u4E0A \ No newline at end of file diff --git a/eric/docs/applet.html b/eric/docs/applet.html new file mode 100644 index 0000000..90be4b0 --- /dev/null +++ b/eric/docs/applet.html @@ -0,0 +1,67 @@ + + + + + +Applet CaRMetal + + + +

@workbook@

+
+ + + + + +
+ + + + diff --git a/eric/docs/applet_ext.html b/eric/docs/applet_ext.html new file mode 100644 index 0000000..64f858a --- /dev/null +++ b/eric/docs/applet_ext.html @@ -0,0 +1,69 @@ + + + + + +Applet CaRMetal + + + + +

Classeur CaRMetal

+
+ + + + + +
+ + + diff --git a/eric/docs/index.html b/eric/docs/index.html new file mode 100644 index 0000000..9c12bea --- /dev/null +++ b/eric/docs/index.html @@ -0,0 +1,127 @@ + + + + + +CaRMetal slideshow + + + + + + + + + + + + + + + + + + +
+

Lien 1

+

+
Figure n° Navigation
télécharger
Activité réalisée avec CaRMetal
+
+ + + +
+ + diff --git a/eric/jobs/AlphaContainer.java b/eric/jobs/AlphaContainer.java new file mode 100644 index 0000000..69308cd --- /dev/null +++ b/eric/jobs/AlphaContainer.java @@ -0,0 +1,45 @@ +package eric.jobs; + +import java.awt.BorderLayout; +import java.awt.Graphics; +import javax.swing.JComponent; + +/** + * A wrapper Container for holding components that use a background Color + * containing an alpha value with some transparency. + * + * A Component that uses a transparent background should really have its + * opaque property set to false so that the area it occupies is first painted + * by its opaque ancestor (to make sure no painting artifacts exist). However, + * if the property is set to false, then most Swing components will not paint + * the background at all, so you lose the transparent background Color. + * + * This components attempts to get around this problem by doing the + * background painting on behalf of its contained Component, using the + * background Color of the Component. + */ +public class AlphaContainer extends JComponent +{ + private JComponent component; + + public AlphaContainer(JComponent component) + { + this.component = component; + setLayout( new BorderLayout() ); + setOpaque( false ); + component.setOpaque( false ); + add( component ); + } + + /** + * Paint the background using the background Color of the + * contained component + */ + @Override + public void paintComponent(Graphics g) + { + g.setColor( component.getBackground() ); + g.fillRect(0, 0, getWidth(), getHeight()); + super.paintComponent(g); + } +} \ No newline at end of file diff --git a/eric/jobs/Base64Coder.java b/eric/jobs/Base64Coder.java new file mode 100644 index 0000000..7f8f9e1 --- /dev/null +++ b/eric/jobs/Base64Coder.java @@ -0,0 +1,225 @@ +// Copyright 2003-2010 Christian d'Heureuse, Inventec Informatik AG, Zurich, Switzerland +// www.source-code.biz, www.inventec.ch/chdh +// +// This module is multi-licensed and may be used under the terms +// of any of the following licenses: +// +// EPL, Eclipse Public License, http://www.eclipse.org/legal +// LGPL, GNU Lesser General Public License, http://www.gnu.org/licenses/lgpl.html +// AL, Apache License, http://www.apache.org/licenses +// BSD, BSD License, http://www.opensource.org/licenses/bsd-license.php +// +// Please contact the author if you need another license. +// This module is provided "as is", without warranties of any kind. + +package eric.jobs; + +/** +* A Base64 encoder/decoder. +* +*

+* This class is used to encode and decode data in Base64 format as described in RFC 1521. +* +*

+* Project home page: www.source-code.biz/base64coder/java
+* Author: Christian d'Heureuse, Inventec Informatik AG, Zurich, Switzerland
+* Multi-licensed: EPL / LGPL / AL / BSD. +*/ +public class Base64Coder { + +// The line separator string of the operating system. +private static final String systemLineSeparator = System.getProperty("line.separator"); + +// Mapping table from 6-bit nibbles to Base64 characters. +private static char[] map1 = new char[64]; + static { + int i=0; + for (char c='A'; c<='Z'; c++) map1[i++] = c; + for (char c='a'; c<='z'; c++) map1[i++] = c; + for (char c='0'; c<='9'; c++) map1[i++] = c; + map1[i++] = '+'; map1[i++] = '/'; } + +// Mapping table from Base64 characters to 6-bit nibbles. +private static byte[] map2 = new byte[128]; + static { + for (int i=0; isun.misc.BASE64Encoder.encodeBuffer(byte[]). +* @param in An array containing the data bytes to be encoded. +* @return A String containing the Base64 encoded data, broken into lines. +*/ +public static String encodeLines (byte[] in) { + return encodeLines(in, 0, in.length, 76, systemLineSeparator); } + +/** +* Encodes a byte array into Base 64 format and breaks the output into lines. +* @param in An array containing the data bytes to be encoded. +* @param iOff Offset of the first byte in in to be processed. +* @param iLen Number of bytes to be processed in in, starting at iOff. +* @param lineLen Line length for the output data. Should be a multiple of 4. +* @param lineSeparator The line separator to be used to separate the output lines. +* @return A String containing the Base64 encoded data, broken into lines. +*/ +public static String encodeLines (byte[] in, int iOff, int iLen, int lineLen, String lineSeparator) { + int blockLen = (lineLen*3) / 4; + if (blockLen <= 0) throw new IllegalArgumentException(); + int lines = (iLen+blockLen-1) / blockLen; + int bufLen = ((iLen+2)/3)*4 + lines*lineSeparator.length(); + StringBuilder buf = new StringBuilder(bufLen); + int ip = 0; + while (ip < iLen) { + int l = Math.min(iLen-ip, blockLen); + buf.append (encode(in, iOff+ip, l)); + buf.append (lineSeparator); + ip += l; } + return buf.toString(); } + +/** +* Encodes a byte array into Base64 format. +* No blanks or line breaks are inserted in the output. +* @param in An array containing the data bytes to be encoded. +* @return A character array containing the Base64 encoded data. +*/ +public static char[] encode (byte[] in) { + return encode(in, 0, in.length); } + +/** +* Encodes a byte array into Base64 format. +* No blanks or line breaks are inserted in the output. +* @param in An array containing the data bytes to be encoded. +* @param iLen Number of bytes to process in in. +* @return A character array containing the Base64 encoded data. +*/ +public static char[] encode (byte[] in, int iLen) { + return encode(in, 0, iLen); } + +/** +* Encodes a byte array into Base64 format. +* No blanks or line breaks are inserted in the output. +* @param in An array containing the data bytes to be encoded. +* @param iOff Offset of the first byte in in to be processed. +* @param iLen Number of bytes to process in in, starting at iOff. +* @return A character array containing the Base64 encoded data. +*/ +public static char[] encode (byte[] in, int iOff, int iLen) { + int oDataLen = (iLen*4+2)/3; // output length without padding + int oLen = ((iLen+2)/3)*4; // output length including padding + char[] out = new char[oLen]; + int ip = iOff; + int iEnd = iOff + iLen; + int op = 0; + while (ip < iEnd) { + int i0 = in[ip++] & 0xff; + int i1 = ip < iEnd ? in[ip++] & 0xff : 0; + int i2 = ip < iEnd ? in[ip++] & 0xff : 0; + int o0 = i0 >>> 2; + int o1 = ((i0 & 3) << 4) | (i1 >>> 4); + int o2 = ((i1 & 0xf) << 2) | (i2 >>> 6); + int o3 = i2 & 0x3F; + out[op++] = map1[o0]; + out[op++] = map1[o1]; + out[op] = op < oDataLen ? map1[o2] : '='; op++; + out[op] = op < oDataLen ? map1[o3] : '='; op++; } + return out; } + +/** +* Decodes a string from Base64 format. +* No blanks or line breaks are allowed within the Base64 encoded input data. +* @param s A Base64 String to be decoded. +* @return A String containing the decoded data. +* @throws IllegalArgumentException If the input is not valid Base64 encoded data. +*/ +public static String decodeString (String s) { + return new String(decode(s)); } + +/** +* Decodes a byte array from Base64 format and ignores line separators, tabs and blanks. +* CR, LF, Tab and Space characters are ignored in the input data. +* This method is compatible with sun.misc.BASE64Decoder.decodeBuffer(String). +* @param s A Base64 String to be decoded. +* @return An array containing the decoded data bytes. +* @throws IllegalArgumentException If the input is not valid Base64 encoded data. +*/ +public static byte[] decodeLines (String s) { + char[] buf = new char[s.length()]; + int p = 0; + for (int ip = 0; ip < s.length(); ip++) { + char c = s.charAt(ip); + if (c != ' ' && c != '\r' && c != '\n' && c != '\t') + buf[p++] = c; } + return decode(buf, 0, p); } + +/** +* Decodes a byte array from Base64 format. +* No blanks or line breaks are allowed within the Base64 encoded input data. +* @param s A Base64 String to be decoded. +* @return An array containing the decoded data bytes. +* @throws IllegalArgumentException If the input is not valid Base64 encoded data. +*/ +public static byte[] decode (String s) { + return decode(s.toCharArray()); } + +/** +* Decodes a byte array from Base64 format. +* No blanks or line breaks are allowed within the Base64 encoded input data. +* @param in A character array containing the Base64 encoded data. +* @return An array containing the decoded data bytes. +* @throws IllegalArgumentException If the input is not valid Base64 encoded data. +*/ +public static byte[] decode (char[] in) { + return decode(in, 0, in.length); } + +/** +* Decodes a byte array from Base64 format. +* No blanks or line breaks are allowed within the Base64 encoded input data. +* @param in A character array containing the Base64 encoded data. +* @param iOff Offset of the first character in in to be processed. +* @param iLen Number of characters to process in in, starting at iOff. +* @return An array containing the decoded data bytes. +* @throws IllegalArgumentException If the input is not valid Base64 encoded data. +*/ +public static byte[] decode (char[] in, int iOff, int iLen) { + if (iLen%4 != 0) throw new IllegalArgumentException ("Length of Base64 encoded input string is not a multiple of 4."); + while (iLen > 0 && in[iOff+iLen-1] == '=') iLen--; + int oLen = (iLen*3) / 4; + byte[] out = new byte[oLen]; + int ip = iOff; + int iEnd = iOff + iLen; + int op = 0; + while (ip < iEnd) { + int i0 = in[ip++]; + int i1 = in[ip++]; + int i2 = ip < iEnd ? in[ip++] : 'A'; + int i3 = ip < iEnd ? in[ip++] : 'A'; + if (i0 > 127 || i1 > 127 || i2 > 127 || i3 > 127) + throw new IllegalArgumentException ("Illegal character in Base64 encoded data."); + int b0 = map2[i0]; + int b1 = map2[i1]; + int b2 = map2[i2]; + int b3 = map2[i3]; + if (b0 < 0 || b1 < 0 || b2 < 0 || b3 < 0) + throw new IllegalArgumentException ("Illegal character in Base64 encoded data."); + int o0 = ( b0 <<2) | (b1>>>4); + int o1 = ((b1 & 0xf)<<4) | (b2>>>2); + int o2 = ((b2 & 3)<<6) | b3; + out[op++] = (byte)o0; + if (op targets=new ArrayList(); + private String backup=null; + private String message_ok=Global.getParameter("job.message.ok", Global.Loc("job.message.ok")); + private String message_failed=Global.getParameter("job.message.failed", Global.Loc("job.message.failed")); + private boolean hidefinals=false; + private boolean staticjob=false; + private JobControlPanel controlPanel=null; + private JobValidPanel validPanel=null; + private boolean printExerciseArguments=true; + private int ctrlX=3,ctrlY=3,ctrlW=374,ctrlH=162; + private int validX,validY,validW=550,validH=36; + + public JobManager(ZirkelCanvas zc) { + ZC=zc; + } + + public void backup() { + try { + printExerciseArguments=false; // protect from recursively get Exercise arguments + String file=FileTools.getCurrentFileSource(); + printExerciseArguments=true; + // Compress the byte representation of the file : + byte[] b=StringCompressionUtils.Compress(file.getBytes()); + // then save it into base64 format : + backup=new String(Base64Coder.encode(b)); + } catch (Exception ex) { + System.out.println("backup error"); + } + } + + public void restore() { + if (backup!=null) { + try { + String targets_backup=getTargetNames(); + // decode the base64 representation of the compressed file : + byte[] b=Base64Coder.decode(backup); + // decompress the file : + byte[] b1=StringCompressionUtils.Decompress(b); + // restore the construction : + FileTools.setCurrentFileSource(new String(b1)); + setTargets(targets_backup); + setTargetsColor(true); + setHiddenToSuperHidden(); + + } catch (Exception ex) { + } + } + } + + public ArrayList getTargets() { + return targets; + } + + public String getTargetNames() { + String names=""; + for (int i=0; i0)&&(printExerciseArguments)) { + xml.startTagStart("Exercise"); + xml.printArg("message_ok", message_ok); + xml.printArg("message_failed", message_failed); + xml.printArg("hidefinals", String.valueOf(hidefinals)); + xml.printArg("staticjob", String.valueOf(staticjob)); + xml.printArg("targets", getTargetNames()); + xml.printArg("backup", backup); + xml.finishTagNewLine(); + } + } + + /******************************* + * GUI PART : + *******************************/ + public void init() { + if (controlPanel!=null) { + controlPanel.init(); + } else if (validPanel!=null) { + validPanel.init(ZC.getSize().width, ZC.getSize().height); + } + } + + public void addControlPanel() { + removeControlPanel(); + controlPanel=new JobControlPanel(this,ctrlX,ctrlY,ctrlW,ctrlH); + ZC.add(controlPanel,0); + ZC.repaint(); + init(); + } + + public void removeControlPanel() { + if (controlPanel!=null) { + ctrlX=controlPanel.getLocation().x; + ctrlY=controlPanel.getLocation().y; + ZC.remove(controlPanel); + controlPanel=null; + ZC.repaint(); + } + } + + public void addValidPanel() { + removeValidPanel(); + if (targets.size()>0) { + validPanel=new JobValidPanel(this,0,0,validW,validH); + ZC.add(validPanel,0); + ZC.repaint(); + init(); + } + } + + public void removeValidPanel() { + if (validPanel!=null) { + ZC.remove(validPanel); + validPanel=null; + ZC.repaint(); + } + } + + public void cancelControlDialog(){ + hideControlDialog(false); + } + + public void hideControlDialog(boolean createJob) { + setTargetSelected(false); + removeControlPanel(); + pipe_tools.getContent().requestFocus(); + if (createJob&&targets.size()>0) { + backup(); + addValidPanel(); + setHiddenToSuperHidden(); + } else { + targets.clear(); + backup=null; + setSuperHiddenToHidden(); + } + setTargetsColor(true); + + PaletteManager.ClicOn("point"); + } + + public void showControlDialog() { + removeValidPanel(); + restore(); + setTargetsColor(false); + setSuperHiddenToHidden(); + addControlPanel(); + setTargetsField(); + setJobTool(); + } + + public void setJobTool() { + setTargetSelected(true); + PaletteManager.deselectgeomgroup(); + ZC.setTool(new DefineJobTool()); + } + + public void setTargetsField() { + if (controlPanel!=null) { + controlPanel.setTargetslist(getTargetNames()); + } + } + + public void validate() { + JobValidation v=new JobValidation(ZC); + v.checkAllsteps(); + } +} diff --git a/eric/jobs/JobMessage.java b/eric/jobs/JobMessage.java new file mode 100644 index 0000000..c656c6b --- /dev/null +++ b/eric/jobs/JobMessage.java @@ -0,0 +1,54 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.jobs; + +import eric.JZirkelCanvas; +import java.awt.Dimension; +import javax.swing.BoxLayout; +import javax.swing.JComponent; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import eric.JEricPanel; +import rene.zirkel.ZirkelCanvas; + +/** + * + * @author erichake + */ +public class JobMessage { + + static private int D_WIDTH=300; + static private int D_HEIGHT=70; + + public static void showMessage(String m) { + showMessage(m, D_WIDTH, D_HEIGHT); + } + + public static void showMessage(String m, int w, int h) { + ZirkelCanvas zc=JZirkelCanvas.getCurrentZC(); + if (zc!=null) { + JOptionPane.showMessageDialog(zc, getPanel(""+m+"", w, h)); + } + } + + + private static JEricPanel getPanel(String m, int w, int h) { + JEricPanel jp=new JEricPanel(); + jp.setLayout(new BoxLayout(jp, BoxLayout.X_AXIS)); + jp.setOpaque(false); + JLabel label=new JLabel(m); + jp.add(label); + fixsize(jp, w, h); + return jp; + } + + private static void fixsize(JComponent jc, int w, int h) { + Dimension d=new Dimension(w, h); + jc.setSize(d); + jc.setMaximumSize(d); + jc.setMinimumSize(d); + jc.setPreferredSize(d); + } +} diff --git a/eric/jobs/JobValidPanel.java b/eric/jobs/JobValidPanel.java new file mode 100644 index 0000000..2481be3 --- /dev/null +++ b/eric/jobs/JobValidPanel.java @@ -0,0 +1,112 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.jobs; + +import eric.GUI.ZDialog.ZButton; +import eric.GUI.ZDialog.ZDialog; +import eric.GUI.ZDialog.ZLabel; +import eric.GUI.ZDialog.ZTools; +import java.awt.Component; +import java.awt.Font; +import java.awt.Graphics; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import javax.swing.JButton; +import javax.swing.JComponent; +import javax.swing.JLabel; +import eric.JEricPanel; +import rene.gui.Global; + +/** + * + * @author erichake + */ +public class JobValidPanel extends ZDialog { + + private JobManager MAN; + private ZButton validBTN, restoreBTN; + private ZLabel label; + protected int BWIDTH=180; // Button width + + + + public JobValidPanel(JobManager man,int x,int y,int w,int h) { + super("", x,y,w,h,false,false); + MAN=man; + setLayout(null); + validBTN=new ZButton(Global.Loc("job.gui.valid")) { + + @Override + public void action() { + MAN.validate(); + } + }; + restoreBTN=new ZButton(Global.Loc("job.gui.restore")) { + + @Override + public void action() { + MAN.restore(); + } + }; + + label=new ZLabel(Global.Loc("job.gui.exercise")); + + + add(label); + add(validBTN); + add(restoreBTN); + increaseFonts(1); + fixComponents(); + } + + public void increaseFonts(int size){ + for (int i=0;i mobiles=new ArrayList(); + private ArrayList mobilesCoords=new ArrayList(); + private ArrayList targets, clones; + + public JobValidation(ZirkelCanvas zc) { + ZC=zc; + C=ZC.getConstruction(); + initMobiles(); + targets=ZC.job_getTargets(); + } + + public void initMobiles() { + mobiles.clear(); + mobilesCoords.clear(); + Enumeration e=C.elements(); + while (e.hasMoreElements()) { + final ConstructionObject c=(ConstructionObject) e.nextElement(); + if (c instanceof PointObject) { + PointObject pt=(PointObject) c; + if (pt.moveable()&&pt.insidewindow()) { + mobiles.add(pt); + double[] tab={pt.getX(), pt.getY()}; + mobilesCoords.add(tab); + } + } + } + } + + /** + * Find every clones of targets object in the whole construction + * @return true if everything is fine. return false in case of + * error. + */ + public boolean initClones() { + clones=new ArrayList(); + for (int i=0; i"; + if (!pipe_tools.Exercise_To_HTML(false, ZC.job_getMessageFailed())) { + JobMessage.showMessage(message); + } + } + + public void constructionOk() { + reset(); + if (!pipe_tools.Exercise_To_HTML(true, ZC.job_getMessageOk())) { + JobMessage.showMessage(ZC.job_getMessageOk()); + } + } + + public void constructionOkExceptAlignment() { + reset(); + String message=""+ZC.job_getMessageOk(); + message+="
("+Global.Loc("job.gui.alignment")+")"; + if (!pipe_tools.Exercise_To_HTML(true, ZC.job_getMessageOk()+" ("+Global.Loc("job.gui.alignment")+")")) { + JobMessage.showMessage(message); + } + } + + public void justSee() { + ZC.paint(ZC.getGraphics()); + try { + Thread.sleep(200); + } catch (InterruptedException ex) { + } + } + + public void checkAllsteps() { + if ((mobiles.size()>0)&&(!ZC.job_isStaticJob())) { + // if it's a dynamic exercise : + int failed=0; + if (!initClones()) { + dynamicConstructionFailed(); + return; + } + int progress=0; + Progress_Bar.create(Global.Loc("job.gui.progressmessage"), 0, MAX-1); + for (int i=0; i0) { + dynamicConstructionFailed(failed); + return; + } + if (!checkHorizontalAligment()) { + constructionOkExceptAlignment(); + return; + } + constructionOk(); + } else { + // if it's a static exercise : + if (!initClones()) { + staticConstructionFailed(); + return; + } + constructionOk(); + } + } +} diff --git a/eric/jobs/StringCompressionUtils.java b/eric/jobs/StringCompressionUtils.java new file mode 100644 index 0000000..25319d0 --- /dev/null +++ b/eric/jobs/StringCompressionUtils.java @@ -0,0 +1,80 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.jobs; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.util.zip.DataFormatException; +import java.util.zip.Deflater; +import java.util.zip.Inflater; + +/** + * + * @author erichake + */ +public class StringCompressionUtils { + + /** + * Compress data. + * @param bytesToCompress is the byte array to compress. + * @return a compressed byte array. + * @throws java.io.IOException + */ + public static byte[] Compress(byte[] bytesToCompress) throws IOException { + // Compressor with highest level of compression. + Deflater compressor=new Deflater(Deflater.BEST_COMPRESSION); + compressor.setInput(bytesToCompress); // Give the compressor the data to compress. + compressor.finish(); + + // Create an expandable byte array to hold the compressed data. + // It is not necessary that the compressed data will be smaller than + // the uncompressed data. + ByteArrayOutputStream bos=new ByteArrayOutputStream(bytesToCompress.length); + + // Compress the data + byte[] buf=new byte[bytesToCompress.length+100]; + while (!compressor.finished()) { + bos.write(buf, 0, compressor.deflate(buf)); + } + + bos.close(); + + // Get the compressed data + return bos.toByteArray(); + } + + /** + * Decompress data. + * @param compressedBytes is the compressed byte array. + * @return decompressed byte array. + * @throws java.io.IOException + * @throws java.util.zip.DataFormatException + */ + public static byte[] Decompress(byte[] compressedBytes) throws IOException, DataFormatException { + // Initialize decompressor. + Inflater decompressor=new Inflater(); + decompressor.setInput(compressedBytes); // Give the decompressor the data to decompress. + decompressor.finished(); + + // Create an expandable byte array to hold the decompressed data. + // It is not necessary that the decompressed data will be larger than + // the compressed data. + ByteArrayOutputStream bos=new ByteArrayOutputStream(compressedBytes.length); + + // Decompress the data + byte[] buf=new byte[compressedBytes.length+100]; + while (!decompressor.finished()) { + bos.write(buf, 0, decompressor.inflate(buf)); + } + + bos.close(); + + // Get the decompressed data. + return bos.toByteArray(); + } + + + +} diff --git a/eric/macros/CTransferableTreePath.java b/eric/macros/CTransferableTreePath.java new file mode 100644 index 0000000..7279785 --- /dev/null +++ b/eric/macros/CTransferableTreePath.java @@ -0,0 +1,68 @@ +/* + +Copyright 2006 Eric Hakenholz + +This file is part of C.a.R. software. + + C.a.R. is a free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 3 of the License. + + C.a.R. is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + */ + + + package eric.macros; + +import java.awt.datatransfer.DataFlavor; +import java.awt.datatransfer.Transferable; +import java.awt.datatransfer.UnsupportedFlavorException; + +import javax.swing.tree.TreePath; + +/** + * This represents a TreePath (a node in a JTree) that can be transferred + * between a drag source and a drop target. + */ +class CTransferableTreePath implements Transferable { + // The type of DnD object being dragged... + public static final DataFlavor TREEPATH_FLAVOR = new DataFlavor( + DataFlavor.javaJVMLocalObjectMimeType, "TreePath"); + + private final TreePath _path; + + private final DataFlavor[] _flavors = { TREEPATH_FLAVOR }; + + /** + * Constructs a transferrable tree path object for the specified path. + */ + public CTransferableTreePath(final TreePath path) { + _path = path; + } + + // Transferable interface methods... + public DataFlavor[] getTransferDataFlavors() { + return _flavors; + } + + public boolean isDataFlavorSupported(final DataFlavor flavor) { + return java.util.Arrays.asList(_flavors).contains(flavor); + } + + public synchronized Object getTransferData(final DataFlavor flavor) + throws UnsupportedFlavorException { + + if (flavor.isMimeTypeEqual(TREEPATH_FLAVOR.getMimeType())) // DataFlavor.javaJVMLocalObjectMimeType)) + return _path; + else + throw new UnsupportedFlavorException(flavor); + } + +} diff --git a/eric/macros/CTree.java b/eric/macros/CTree.java new file mode 100644 index 0000000..5719b4e --- /dev/null +++ b/eric/macros/CTree.java @@ -0,0 +1,663 @@ +/* + +Copyright 2006 Eric Hakenholz + +This file is part of C.a.R. software. + + C.a.R. is a free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 3 of the License. + + C.a.R. is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + */ + + + package eric.macros; + +import java.awt.AlphaComposite; +import java.awt.Color; +import java.awt.GradientPaint; +import java.awt.Graphics2D; +import java.awt.Insets; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.SystemColor; +import java.awt.datatransfer.DataFlavor; +import java.awt.datatransfer.Transferable; +import java.awt.datatransfer.UnsupportedFlavorException; +import java.awt.dnd.Autoscroll; +import java.awt.dnd.DnDConstants; +import java.awt.dnd.DragGestureEvent; +import java.awt.dnd.DragGestureListener; +import java.awt.dnd.DragSource; +import java.awt.dnd.DragSourceDragEvent; +import java.awt.dnd.DragSourceDropEvent; +import java.awt.dnd.DragSourceEvent; +import java.awt.dnd.DragSourceListener; +import java.awt.dnd.DropTarget; +import java.awt.dnd.DropTargetDragEvent; +import java.awt.dnd.DropTargetDropEvent; +import java.awt.dnd.DropTargetEvent; +import java.awt.dnd.DropTargetListener; +import java.awt.dnd.InvalidDnDOperationException; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.geom.AffineTransform; +import java.awt.geom.Rectangle2D; +import java.awt.image.BufferedImage; +import java.io.IOException; + +import javax.swing.Icon; +import javax.swing.JLabel; +import javax.swing.JTree; +import javax.swing.Timer; +import javax.swing.event.TreeSelectionEvent; +import javax.swing.event.TreeSelectionListener; +import javax.swing.tree.DefaultMutableTreeNode; +import javax.swing.tree.DefaultTreeModel; +import javax.swing.tree.MutableTreeNode; +import javax.swing.tree.TreePath; + +public class CTree extends JTree implements DragSourceListener, +DragGestureListener, Autoscroll, TreeSelectionListener, MouseListener { + // Constants... + + /** + * + */ + private static final long serialVersionUID = 1L; + // Fields... + private TreePath _pathSource; // The path being dragged + private BufferedImage _imgGhost; // The 'drag image' + private final Point _ptOffset = new Point(); // Where, in the drag image, + // the mouse was clicked + private boolean dropped = false; + public MacrosList JML; + public NodePopupMenu nodepopup; + + // Constructors... + public CTree(final MacrosList jml) // Use the default JTree constructor so + // that we get a sample TreeModel built + // for us + { + JML = jml; + putClientProperty("JTree.lineStyle", "none"); + + // this.addTreeSelectionListener(this); + // this.getModel().addTreeModelListener(this); + + this.addMouseListener(this); + // Make this JTree a drag source + final DragSource dragSource = DragSource.getDefaultDragSource(); + dragSource.createDefaultDragGestureRecognizer(this, + DnDConstants.ACTION_COPY_OR_MOVE, this); + + // Also, make this JTree a drag target + final DropTarget dropTarget = new DropTarget(this, + new CDropTargetListener()); + dropTarget.setDefaultActions(DnDConstants.ACTION_COPY_OR_MOVE); + + nodepopup = new NodePopupMenu(this); + + } + + + + private DefaultMutableTreeNode cloneAll(final DefaultMutableTreeNode Ndfrom) { + final DefaultMutableTreeNode Ndto = (DefaultMutableTreeNode) Ndfrom + .clone(); + if (!(Ndfrom.isLeaf())) { + for (int i = 0; i < Ndfrom.getChildCount(); i++) { + final DefaultMutableTreeNode mynode = cloneAll((DefaultMutableTreeNode) Ndfrom + .getChildAt(i)); + Ndto.add(mynode); + } + } + return Ndto; + } + + // Interface: DragGestureListener + public void dragGestureRecognized(final DragGestureEvent e) { + + final Point ptDragOrigin = e.getDragOrigin(); + final TreePath path = getPathForLocation(ptDragOrigin.x, ptDragOrigin.y); + if (path == null) + return; + if (isRootPath(path)) + return; // Ignore user trying to drag the root node + + // Work out the offset of the drag point from the TreePath bounding + // rectangle origin + final Rectangle raPath = getPathBounds(path); + _ptOffset.setLocation(ptDragOrigin.x - raPath.x, ptDragOrigin.y + - raPath.y); + + // Get the cell renderer (which is a JLabel) for the path being dragged + final JLabel lbl = (JLabel) getCellRenderer() + .getTreeCellRendererComponent(this, // tree + path.getLastPathComponent(), // value + false, // isSelected (dont want a colored background) + isExpanded(path), // isExpanded + getModel().isLeaf(path.getLastPathComponent()), // isLeaf + 0, // row (not important for rendering) + false // hasFocus (dont want a focus rectangle) + ); + lbl.setSize((int) raPath.getWidth(), (int) raPath.getHeight()); // <-- + // The + // layout + // manager + // would + // normally + // do + // this + + // Get a buffered image of the selection for dragging a ghost image + _imgGhost = new BufferedImage((int) raPath.getWidth(), (int) raPath + .getHeight(), BufferedImage.TYPE_INT_ARGB_PRE); + final Graphics2D g2 = _imgGhost.createGraphics(); + + // Ask the cell renderer to paint itself into the BufferedImage + g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC, 0.5f)); // Make + // the + // image + // ghostlike + lbl.paint(g2); + + // Now paint a gradient UNDER the ghosted JLabel text (but not under the + // icon if any) + // Note: this will need tweaking if your icon is not positioned to the + // left of the text + final Icon icon = lbl.getIcon(); + final int nStartOfText = (icon == null) ? 0 : icon.getIconWidth() + + lbl.getIconTextGap(); + g2.setComposite(AlphaComposite.getInstance(AlphaComposite.DST_OVER, + 0.5f)); // Make the gradient ghostlike + g2.setPaint(new GradientPaint(nStartOfText, 0, + SystemColor.controlShadow, getWidth(), 0, new Color(255, 255, + 255, 0))); + g2.fillRect(nStartOfText, 0, getWidth(), _imgGhost.getHeight()); + + g2.dispose(); + + setSelectionPath(path); // Select this path in the tree + + // System.out.println("DRAGGING: "+path.getLastPathComponent()); + + // DefaultMutableTreeNode + // mynode=(DefaultMutableTreeNode)path.getLastPathComponent(); + // Transferable transferable = (Transferable) mynode.getUserObject(); + // Wrap the path being transferred into a Transferable object + final Transferable transferable = new CTransferableTreePath(path); + + // Remember the path being dragged (because if it is being moved, we + // will have to delete it later) + _pathSource = path; + + // We pass our drag image just in case it IS supported by the platform + + try { + this.setEditable(false); + // e.startDrag(new Cursor(Cursor.HAND_CURSOR),transferable,this); + e.startDrag(null, _imgGhost, new Point(5, 5), transferable, this); + + } catch (final InvalidDnDOperationException dnde) { + // JOptionPane.showMessageDialog(null, "coucou2"); + } + + // e.startDrag(null, _imgGhost, new Point(5,5), transferable, this); + + } + + // Interface: DragSourceListener + public void dragEnter(final DragSourceDragEvent e) { + } + + public void dragOver(final DragSourceDragEvent e) { + } + + public void dragExit(final DragSourceEvent e) { + } + + public void dropActionChanged(final DragSourceDragEvent e) { + } + + public void dragDropEnd(final DragSourceDropEvent e) { + if (e.getDropSuccess()) { + final int nAction = e.getDropAction(); + if (nAction == DnDConstants.ACTION_MOVE) { // The dragged item + // (_pathSource) has + // been inserted at the + // target selected by + // the user. + // Now it is time to delete it from its original location. + // System.out.println("REMOVING: " + + // _pathSource.getLastPathComponent()); + + if (dropped) { + final DefaultTreeModel model = (DefaultTreeModel) getModel(); + final MutableTreeNode node = (MutableTreeNode) _pathSource + .getLastPathComponent(); + MutableTreeNode parent = (MutableTreeNode) node.getParent(); + model.removeNodeFromParent(node); + while (parent.isLeaf()) { + final MutableTreeNode grandparent = (MutableTreeNode) parent + .getParent(); + model.removeNodeFromParent(parent); + parent = grandparent; + } + + dropped = false; + } + + _pathSource = null; + } + } + } + + // DropTargetListener interface object... + class CDropTargetListener implements DropTargetListener { + // Fields... + private TreePath _pathLast = null; + private final Rectangle2D _raCueLine = new Rectangle2D.Float(); + private Rectangle2D _raGhost = new Rectangle2D.Float(); + private final Color _colorCueLine; + private Point _ptLast = new Point(); + private final Timer _timerHover; + private int _nLeftRight = 0; // Cumulative left/right mouse movement + // Constructor... + + public CDropTargetListener() { + _colorCueLine = new Color(SystemColor.controlShadow.getRed(), + SystemColor.controlShadow.getGreen(), + SystemColor.controlShadow.getBlue(), 64); + + // Set up a hover timer, so that a node will be automatically + // expanded or collapsed + // if the user lingers on it for more than a short time + _timerHover = new Timer(1000, new ActionListener() { + public void actionPerformed(final ActionEvent e) { + _nLeftRight = 0; // Reset left/right movement trend + if (isRootPath(_pathLast)) + return; // Do nothing if we are hovering over the root + // node + if (isExpanded(_pathLast)) + collapsePath(_pathLast); + else + expandPath(_pathLast); + } + }); + _timerHover.setRepeats(false); // Set timer to one-shot mode + } + + // DropTargetListener interface + public void dragEnter(final DropTargetDragEvent e) { + if (!isDragAcceptable(e)) + e.rejectDrag(); + else + e.acceptDrag(e.getDropAction()); + } + + public void dragExit(final DropTargetEvent e) { + if (!DragSource.isDragImageSupported()) { + repaint(_raGhost.getBounds()); + } + } + + /** + * This is where the ghost image is drawn + */ + public void dragOver(final DropTargetDragEvent e) { + // Even if the mouse is not moving, this method is still invoked 10 + // times per second + final Point pt = e.getLocation(); + if (pt.equals(_ptLast)) + return; + + // Try to determine whether the user is flicking the cursor right or + // left + final int nDeltaLeftRight = pt.x - _ptLast.x; + if ((_nLeftRight > 0 && nDeltaLeftRight < 0) + || (_nLeftRight < 0 && nDeltaLeftRight > 0)) + _nLeftRight = 0; + _nLeftRight += nDeltaLeftRight; + + _ptLast = pt; + + final Graphics2D g2 = (Graphics2D) getGraphics(); + + // If a drag image is not supported by the platform, then draw my + // own drag image + if (!DragSource.isDragImageSupported()) { + paintImmediately(_raGhost.getBounds()); // Rub out the last + // ghost image and cue + // line + // And remember where we are about to draw the new ghost image + _raGhost.setRect(pt.x - _ptOffset.x, pt.y - _ptOffset.y, + _imgGhost.getWidth(), _imgGhost.getHeight()); + g2.drawImage(_imgGhost, AffineTransform.getTranslateInstance( + _raGhost.getX(), _raGhost.getY()), null); + } else + // Just rub out the last cue line + paintImmediately(_raCueLine.getBounds()); + + final TreePath path = getClosestPathForLocation(pt.x, pt.y); + if (!(path == _pathLast)) { + _nLeftRight = 0; // We've moved up or down, so reset left/right + // movement trend + _pathLast = path; + _timerHover.restart(); + } + + // In any case draw (over the ghost image if necessary) a cue line + // indicating where a drop will occur + final Rectangle raPath = getPathBounds(path); + _raCueLine.setRect(0, raPath.y + (int) raPath.getHeight(), + getWidth(), 2); + + g2.setColor(_colorCueLine); + g2.fill(_raCueLine); + + // Now superimpose the left/right movement indicator if necessary + if (_nLeftRight > 20) { + } else if (_nLeftRight < -20) { + } else { + } + + // And include the cue line in the area to be rubbed out next time + _raGhost = _raGhost.createUnion(_raCueLine); + + /* + * // Do this if you want to prohibit dropping onto the drag source + * if (path.equals(_pathSource)) e.rejectDrag(); else + * e.acceptDrag(e.getDropAction()); + */ + } + + public void dropActionChanged(final DropTargetDragEvent e) { + if (!isDragAcceptable(e)) + e.rejectDrag(); + else + e.acceptDrag(e.getDropAction()); + } + + public void drop(final DropTargetDropEvent e) { + _timerHover.stop(); // Prevent hover timer from doing an unwanted + // expandPath or collapsePath + + if (!isDropAcceptable(e)) { + e.rejectDrop(); + return; + } + + e.acceptDrop(e.getDropAction()); + + final Transferable transferable = e.getTransferable(); + + final DataFlavor[] flavors = transferable.getTransferDataFlavors(); + for (final DataFlavor flavor : flavors) { + if (flavor + .isMimeTypeEqual(DataFlavor.javaJVMLocalObjectMimeType)) { + try { + final Point pt = e.getLocation(); + final TreePath pathTarget = getClosestPathForLocation( + pt.x, pt.y); + final TreePath pathSource = (TreePath) transferable + .getTransferData(flavor); + + // System.out.println("DROPPING: "+pathSource.getLastPathComponent()); + // TreeModel model = getModel(); + + final DefaultTreeModel model = (DefaultTreeModel) getModel(); + final TreePath pathNewChild = null; + + final DefaultMutableTreeNode nodeorg = (DefaultMutableTreeNode) pathSource + .getLastPathComponent(); + DefaultMutableTreeNode nodeto = (DefaultMutableTreeNode) pathTarget + .getLastPathComponent(); + + // avoid a folder to be drag inside its own hierarchy + dropped = true; + if (!(nodeorg.isLeaf())) { + DefaultMutableTreeNode parent = nodeto; + while (parent != null) { + if (parent.equals(nodeorg)) { + dropped = false; + JML.repaint(); + return; + } + parent = (DefaultMutableTreeNode) parent + .getParent(); + } + } + + if (dropped) { + DefaultMutableTreeNode nodeparentto = (nodeto + .isLeaf()) ? (DefaultMutableTreeNode) pathTarget + .getParentPath().getLastPathComponent() + : nodeto; + final TreePath tp = new TreePath(nodeparentto + .getPath()); + if (!(isExpanded(tp))) { + nodeto = nodeparentto; + nodeparentto = (DefaultMutableTreeNode) nodeto + .getParent(); + } + int h = 0; + for (h = 0; h < nodeparentto.getChildCount(); h++) { + if (nodeparentto.getChildAt(h).equals(nodeto)) + break; + } + if (h == nodeparentto.getChildCount()) + h = -1; + model.insertNodeInto(cloneAll(nodeorg), + nodeparentto, h + 1); + } + + // model.insertNodeInto() + // . + // .. Add your code here to ask your TreeModel to copy + // the node and act on the mouse gestures... + // . + + // For example: + + // If pathTarget is an expanded BRANCH, + // then insert source UNDER it (before the first child + // if any) + // If pathTarget is a collapsed BRANCH (or a LEAF), + // then insert source AFTER it + // Note: a leaf node is always marked as collapsed + // You ask the model to do the copying... + // ...and you supply the copyNode method in the model as + // well of course. + // if (_nShift == 0) + // pathNewChild = model.copyNode(pathSource, pathTarget, + // isExpanded(pathTarget)); + // else if (_nShift > 0) // The mouse is being flicked + // to the right (so move the node right) + // pathNewChild = model.copyNodeRight(pathSource, + // pathTarget); + // else // The mouse is being flicked to the left (so + // move the node left) + // pathNewChild = model.copyNodeLeft(pathSource); + + if (pathNewChild != null) + setSelectionPath(pathNewChild); // Mark this as the + // selected path in + // the tree + break; // No need to check remaining flavors + } catch (final UnsupportedFlavorException ufe) { + // System.out.println(ufe); + e.dropComplete(false); + return; + } catch (final IOException ioe) { + // System.out.println(ioe); + e.dropComplete(false); + return; + } + } + } + + e.dropComplete(true); + } + + // Helpers... + public boolean isDragAcceptable(final DropTargetDragEvent e) { + // Only accept COPY or MOVE gestures (ie LINK is not supported) + if ((e.getDropAction() & DnDConstants.ACTION_COPY_OR_MOVE) == 0) + return false; + + // Only accept this particular flavor + if (!e.isDataFlavorSupported(CTransferableTreePath.TREEPATH_FLAVOR)) + return false; + + /* + * // Do this if you want to prohibit dropping onto the drag + * source... Point pt = e.getLocation(); TreePath path = + * getClosestPathForLocation(pt.x, pt.y); if + * (path.equals(_pathSource)) return false; + */ + + /* + * // Do this if you want to select the best flavor on offer... + * DataFlavor[] flavors = e.getCurrentDataFlavors(); for (int i = 0; + * i < flavors.length; i++ ) { DataFlavor flavor = flavors[i]; if + * (flavor.isMimeTypeEqual(DataFlavor.javaJVMLocalObjectMimeType)) + * return true; } + */ + return true; + } + + public boolean isDropAcceptable(final DropTargetDropEvent e) { + // Only accept COPY or MOVE gestures (ie LINK is not supported) + if ((e.getDropAction() & DnDConstants.ACTION_COPY_OR_MOVE) == 0) + return false; + + // Only accept this particular flavor + if (!e.isDataFlavorSupported(CTransferableTreePath.TREEPATH_FLAVOR)) + return false; + + /* + * // Do this if you want to prohibit dropping onto the drag + * source... Point pt = e.getLocation(); TreePath path = + * getClosestPathForLocation(pt.x, pt.y); if + * (path.equals(_pathSource)) return false; + */ + + /* + * // Do this if you want to select the best flavor on offer... + * DataFlavor[] flavors = e.getCurrentDataFlavors(); for (int i = 0; + * i < flavors.length; i++ ) { DataFlavor flavor = flavors[i]; if + * (flavor.isMimeTypeEqual(DataFlavor.javaJVMLocalObjectMimeType)) + * return true; } + */ + return true; + } + + } + + // Autoscroll Interface... + // The following code was borrowed from the book: + // Java Swing + // By Robert Eckstein, Marc Loy & Dave Wood + // Paperback - 1221 pages 1 Ed edition (September 1998) + // O'Reilly & Associates; ISBN: 156592455X + // + // The relevant chapter of which can be found at: + // http://www.oreilly.com/catalog/jswing/chapter/dnd.beta.pdf + + private static final int AUTOSCROLL_MARGIN = 12; + + // Ok, weíve been told to scroll because the mouse cursor is in our + // scroll zone. + public void autoscroll(final Point pt) { + // Figure out which row weíre on. + int nRow = getRowForLocation(pt.x, pt.y); + + // If we are not on a row then ignore this autoscroll request + if (nRow < 0) + return; + + final Rectangle raOuter = getBounds(); + // Now decide if the row is at the top of the screen or at the + // bottom. We do this to make the previous row (or the next + // row) visible as appropriate. If weíre at the absolute top or + // bottom, just return the first or last row respectively. + + nRow = (pt.y + raOuter.y <= AUTOSCROLL_MARGIN) // Is row at top of + // screen? + ? (nRow <= 0 ? 0 : nRow - 1) // Yes, scroll up one row + : (nRow < getRowCount() - 1 ? nRow + 1 : nRow); // No, scroll + // down one row + + scrollRowToVisible(nRow); + } + + // Calculate the insets for the *JTREE*, not the viewport + // the tree is in. This makes it a bit messy. + public Insets getAutoscrollInsets() { + final Rectangle raOuter = getBounds(); + final Rectangle raInner = getParent().getBounds(); + return new Insets(raInner.y - raOuter.y + AUTOSCROLL_MARGIN, raInner.x + - raOuter.x + AUTOSCROLL_MARGIN, raOuter.height + - raInner.height - raInner.y + raOuter.y + AUTOSCROLL_MARGIN, + raOuter.width - raInner.width - raInner.x + raOuter.x + + AUTOSCROLL_MARGIN); + } + + /* + * // Use this method if you want to see the boundaries of the // autoscroll + * active region. Toss it out, otherwise. public void + * paintComponent(Graphics g) { super.paintComponent(g); Rectangle raOuter = + * getBounds(); Rectangle raInner = getParent().getBounds(); + * g.setColor(Color.red); g.drawRect(-raOuter.x + 12, -raOuter.y + 12, + * raInner.width - 24, raInner.height - 24); } + */ + + private boolean isRootPath(final TreePath path) { + return isRootVisible() && getRowForPath(path) == 0; + } + + // Ready to go : execute macro on click + public void valueChanged(final TreeSelectionEvent e) { + // JDefaultMutableTreeNode node = + // (JDefaultMutableTreeNode)this.getLastSelectedPathComponent(); + // if (node.isLeaf()) { + // node.runZmacro(); + // }; + + } + + // MouseListener interface + public void mouseClicked(final MouseEvent e) { + nodepopup.handleMouseClick(e); + } + + public void mousePressed(final MouseEvent e) { + nodepopup.actualiseproperties(); + nodepopup.handlePopup(e); + } + + public void mouseReleased(final MouseEvent e) { + nodepopup.handlePopup(e); + } + + public void mouseEntered(final MouseEvent e) { + // ShowToolTip(e); + } + + public void mouseExited(final MouseEvent e) { + // HideToolTip(); + } + + +} diff --git a/eric/macros/CreateMacroDialog.java b/eric/macros/CreateMacroDialog.java new file mode 100644 index 0000000..77ad837 --- /dev/null +++ b/eric/macros/CreateMacroDialog.java @@ -0,0 +1,154 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.macros; + +import eric.GUI.palette.PaletteManager; +import eric.GUI.pipe_tools; +import eric.GUI.themes; +import eric.JZirkelCanvas; +import java.awt.Point; +import java.awt.Toolkit; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionListener; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import javax.swing.BoxLayout; +import javax.swing.JDialog; +import javax.swing.JMenuItem; +import eric.JEricPanel; +import rene.zirkel.ZirkelCanvas; + +/** + * + * @author erichake + */ +public class CreateMacroDialog extends JDialog implements MouseListener, MouseMotionListener, TopDialog { + + private static CreateMacroDialog MD; + private static int content_height=50, content_width=205; + private static int locmargin=50; + private CreateMacroPanel CMP; + private MacrosList MI; + private MouseEvent pressed; + private Point location; + + public CreateMacroDialog(MacrosList mi) { + MD=this; + MI=mi; + CreateMacroDialogContentPane c=new CreateMacroDialogContentPane(); + setContentPane(c); + c.addMouseListener(this); + c.addMouseMotionListener(this); + + DialogTitleBar title=new DialogTitleBar(this, content_width); + c.add(title); + + CMP=new CreateMacroPanel(this, MI, content_width, content_height); + c.add(CMP); + + + setUndecorated(true); + setSize(content_width, content_height+DialogTitleBar.getTitleHeight()); + + if (!pipe_tools.isApplet()) { + setAlwaysOnTop(true); + } else { + addWindowListener(new WindowAdapter() { + + public void windowDeactivated(WindowEvent e) { + toFront(); + } + }); + } + setResizable(false); + ZirkelCanvas zc=JZirkelCanvas.getCurrentZC(); + if (zc!=null) { + this.setLocation(zc.getLocationOnScreen().x+locmargin, zc.getLocationOnScreen().y+locmargin); + } + + pipe_tools.setMacroPanelKeyInputs(); + + setVisible(true); + } + + public static int getContentWidth() { + return content_width; + } + + public static void quit() { + if (MD!=null) { + MD.exit(); + } + } + + public void exit() { + setVisible(false); + pipe_tools.removeMacroPanelKeyInputs(); + dispose(); + MD=null; + } + + public class CreateMacroDialogContentPane extends JEricPanel { + + @Override + public void paintComponent(final java.awt.Graphics g) { + super.paintComponent(g); + final java.awt.Dimension d=this.getSize(); + g.drawImage(themes.getImage("MCreateDlogBackground.gif"), 0, 0, d.width, + d.height, this); + } + + public CreateMacroDialogContentPane() { + super(); + setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); + } + } + + public class myJMenuItem extends JMenuItem implements ActionListener { + + public void action() { + } + + public myJMenuItem(String s) { + super(s); + addActionListener(this); + setFont(themes.TabMenusFont); + } + + public void actionPerformed(ActionEvent e) { + action(); + } + } + + public void mouseClicked(MouseEvent e) { + } + + public void mouseReleased(MouseEvent e) { + } + + public void mouseEntered(MouseEvent e) { + } + + public void mouseExited(MouseEvent e) { + } + + public void mousePressed(MouseEvent me) { + pressed=me; + } + + public void mouseDragged(MouseEvent me) { + location=getLocation(location); + int x=location.x-pressed.getX()+me.getX(); + int y=location.y-pressed.getY()+me.getY(); + setLocation(x, y); + Toolkit.getDefaultToolkit().sync(); + } + + public void mouseMoved(MouseEvent e) { + } +} diff --git a/eric/macros/CreateMacroPanel.java b/eric/macros/CreateMacroPanel.java new file mode 100644 index 0000000..a3683b5 --- /dev/null +++ b/eric/macros/CreateMacroPanel.java @@ -0,0 +1,326 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.macros; + +import eric.GUI.palette.PaletteManager; +import eric.GUI.pipe_tools; +import eric.GUI.themes; +import eric.JZirkelCanvas; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.util.Vector; +import javax.swing.BorderFactory; +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JLabel; +import eric.JEricPanel; +import javax.swing.JTextArea; +import javax.swing.JTextField; +import javax.swing.SwingConstants; +import javax.swing.SwingUtilities; +import javax.swing.text.JTextComponent; +import javax.swing.tree.DefaultMutableTreeNode; +import javax.swing.tree.DefaultTreeModel; +import javax.swing.tree.TreePath; +import rene.gui.Global; +import rene.zirkel.ZirkelCanvas; +import rene.zirkel.ZirkelFrame; +import rene.zirkel.construction.Construction; +import rene.zirkel.construction.ConstructionException; +import rene.zirkel.macro.Macro; +import rene.zirkel.objects.ConstructionObject; + +/** + * + * @author erichake + */ +/************************************************************************************** + *** N'oublions pas que JMacrosList est un JPanel qui contient d'autres + * JPanels La class Jcreatemacro contient les éléments UI qui gèrent + * l'enregistrement des macros + ***************************************************************************************/ +public class CreateMacroPanel extends JEricPanel { + + private JButton nextbtn; + private static int stepnum; + private boolean visible=false; + private static stepcomments steps; + private static MacrosList ML; + private static CreateMacroDialog CMD; + private static CreateMacroPanel CMP; + + public CreateMacroPanel(CreateMacroDialog md, MacrosList ml, int w, int h) { + CMP=this; + ML=ml; + CMD=md; + final ZirkelFrame zf=JZirkelCanvas.getCurrentZF(); + if (zf!=null) { + this.setLayout(new javax.swing.BoxLayout(this, + javax.swing.BoxLayout.X_AXIS)); + this.setAlignmentX(0F); + setOpaque(false); + setFocusable(false); + stepnum=1; + zf.settool(ZirkelFrame.NParameters); + this.visible=true; + PaletteManager.fixsize(this, w, h); + steps=new stepcomments(); + nextbtn=new JButton(themes.getIcon("Mnext.png")); + nextbtn.setOpaque(false); + nextbtn.setContentAreaFilled(false); + nextbtn.setEnabled(true); + nextbtn.setBorder(BorderFactory.createEmptyBorder()); + nextbtn.setAlignmentY(0.5F); + nextbtn.addMouseListener(new MouseAdapter() { + + @Override + public void mousePressed(final MouseEvent e) { + nextStep(); + } + }); + this.add(margin(10)); + this.add(steps); + this.add(margin(10)); + this.add(nextbtn); + ML.validate(); + ML.repaint(); + } + } + + static public void nextStep() { + ZirkelFrame zf=JZirkelCanvas.getCurrentZF(); + if (zf==null) { + return; + } + // if parameters are selected : + if (zf.ZC.getConstruction().Parameters.size()>0) { + + switch (stepnum) { + case 1: + if ((zf.ZC.isDP())&&(!zf.ZC.isEuclidian())) { + Construction c=zf.ZC.getConstruction(); + ConstructionObject hz=c.getHZ(); + hz.setMainParameter(true); + c.insertParameter(hz, 0); + hz.setSpecialParameter(true); + } + steps.mycomment.setText("2/3 - "+Global.Loc("macros.finals")); + steps.myparams.setText(""); + zf.settool(ZirkelFrame.NTargets); + break; + case 2: + steps.mycomment.setText("3/3 - "+Global.Loc("macros.name")); + steps.myparams.setEditable(true); + steps.myparams.setFocusable(true); + steps.myparams.setHorizontalAlignment(SwingConstants.CENTER); + steps.myparams.setText(Global.Loc("macros.untitledmacro")); + steps.myparams.selectAll(); + steps.myparams.requestFocus(); + pipe_tools.removeMacroPanelKeyInputs(); + break; + case 3: + valid(); + break; + } + stepnum++; + } else { + zf.settool(ZirkelFrame.NParameters); + setParametersComments(); + } + } + + static public void setParametersComments() { + if (CMD!=null) { + ZirkelCanvas zc=JZirkelCanvas.getCurrentZC(); + if (zc!=null) { + String p=""; + Vector v=zc.getConstruction().getParameters(); + for (int i=0; i0), true, s, false); + } catch (final ConstructionException e) { + } + m.hideDuplicates(false); + zc.storeMacro(m, false); + + final JDefaultMutableTreeNode node=new JDefaultMutableTreeNode(JZirkelCanvas.getCurrentZF(), m); + + final TreePath[] paths=ML.getMacrosTree().getSelectionPaths(); + if (((paths)!=null)&&(paths.length>0)) { + root=(JDefaultMutableTreeNode) paths[0].getLastPathComponent(); + + if (root.isLeaf()) { + // if the first selected node is a leaf : + final DefaultMutableTreeNode father=(DefaultMutableTreeNode) root.getParent(); + final int i=father.getIndex(root)+1; + ((DefaultTreeModel) ML.getMacrosTree().getModel()).insertNodeInto( + node, father, i); + + } else { + // if the first selected node is a folder : + ((DefaultTreeModel) ML.getMacrosTree().getModel()).insertNodeInto( + node, root, root.getChildCount()); + } + } else { + // There is no selected node : + ((DefaultTreeModel) ML.getMacrosTree().getModel()).insertNodeInto(node, + ML.getTopNode(), ML.getTopNode().getChildCount()); + } + + final TreePath tp=new TreePath(node.getPath()); + node.ActualisePath(); + return tp; + } + + private class stepcomments extends JEricPanel { + + /** + * + */ + private JLabel mycomment=new JLabel(); + private JTextField myparams=new JTextField(); + + @Override + public void paintComponent(final java.awt.Graphics g) { + super.paintComponent(g); + final java.awt.Dimension d=this.getSize(); + g.drawImage(themes.getImage("Mcomments.png"), 0, 0, d.width, + d.height, this); + + } + + public JLabel getComment() { + return mycomment; + } + + private stepcomments() { + this.setLayout(new javax.swing.BoxLayout(this, + javax.swing.BoxLayout.Y_AXIS)); + this.setAlignmentY(0.5F); + final ImageIcon backIcon=themes.getIcon("Mcomments.png"); + PaletteManager.fixsize(this, backIcon.getIconWidth(), backIcon.getIconHeight()); + this.setOpaque(false); + + mycomment.setText("1/3 - "+Global.Loc("macros.initials")); + mycomment.setFont(new Font("Verdana", 0, 10)); + PaletteManager.fixsize(mycomment, backIcon.getIconWidth(), backIcon.getIconHeight()/2); + mycomment.setHorizontalAlignment(SwingConstants.CENTER); + mycomment.setVerticalAlignment(SwingConstants.CENTER); + mycomment.setAlignmentX(0.5f); + mycomment.setAlignmentY(0.5f); + this.add(mycomment); + + myparams.setText(Global.Loc("macros.pleaseselect")); + myparams.setFont(new Font("Verdana", 0, 10)); + myparams.setForeground(Color.blue); + myparams.setOpaque(false); + myparams.setBorder(null); + myparams.setFocusable(false); + PaletteManager.fixsize(myparams, backIcon.getIconWidth()-10, backIcon.getIconHeight()/2); + myparams.setHorizontalAlignment(SwingConstants.CENTER); +// myparams.setVerticalAlignment(SwingConstants.CENTER); + myparams.setAlignmentX(0.5f); + myparams.setAlignmentY(0.5f); + myparams.addKeyListener(new KeyAdapter() { + + @Override + public void keyPressed(final KeyEvent e) { + if (e.getKeyCode()==KeyEvent.VK_ENTER) { + valid(); + } + } + }); + this.add(myparams); + } + } +} diff --git a/eric/macros/DialogTitleBar.java b/eric/macros/DialogTitleBar.java new file mode 100644 index 0000000..7e77be6 --- /dev/null +++ b/eric/macros/DialogTitleBar.java @@ -0,0 +1,128 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.macros; + +import eric.GUI.palette.PaletteManager; +import eric.GUI.themes; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Image; +import java.awt.Point; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionListener; +import javax.swing.BoxLayout; +import javax.swing.JDialog; +import javax.swing.JLabel; +import eric.JEricPanel; +import javax.swing.SwingConstants; +import rene.gui.Global; + +/** + * + * @author erichake + */ +/** + * Title bar class + */ +public class DialogTitleBar extends JEricPanel { + + private static int title_height=17; + private static int close_width=themes.getIcon("tab_close.png").getIconWidth(); + private static int close_height=themes.getIcon("tab_close.png").getIconHeight(); + private static int close_marginRight=3; + private int title_width; + private Image img=themes.getImage("PaletteTitleBarN.png"); + private JLabel title=new JLabel(); + private TopDialog DLOG; + + public void paintComponent(Graphics g) { + if (DLOG instanceof CreateMacroDialog) { + return; + } + Dimension d=getSize(); + g.drawImage(img, 0, 0, d.width, d.height, this); + } + + public DialogTitleBar(TopDialog d, int w) { + DLOG=d; + title_width=w; + setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); + setAlignmentX(0.0f); + setOpaque(false); + setFocusable(false); + PaletteManager.fixsize(this, title_width, title_height); + title.setText(Global.Loc("macro.creationdlog.title")); + title.setFont(new java.awt.Font(Global.GlobalFont, 0, 11)); + title.setForeground(new Color(100, 100, 100)); + title.setHorizontalAlignment(SwingConstants.LEFT); + PaletteManager.fixsize(title, title_width-close_width-close_marginRight, title_height); + title.setHorizontalAlignment(JLabel.CENTER); + title.setVerticalAlignment(JLabel.CENTER); + title.setAlignmentY(0.5f); + + add(title); + add(new CreateMacroDialogCloseBtn()); + + addMouseListener((MouseListener) DLOG); + addMouseMotionListener((MouseMotionListener) DLOG); + } + + public static int getTitleHeight() { + return title_height; + } + + class CreateMacroDialogCloseBtn extends JEricPanel implements MouseListener { + + private boolean over=false; + + @Override + public void paintComponent(Graphics g) { + Dimension d=getSize(); + if (over) { + g.drawImage(themes.getImage("tab_close_over.png"), 0, 0, d.width, d.height, + this); + } else { + g.drawImage(themes.getImage("tab_close.png"), 0, 0, d.width, d.height, + this); + } + } + + public CreateMacroDialogCloseBtn() { + setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); + setAlignmentY(0.5f); + setOpaque(false); + PaletteManager.fixsize(this, close_width, close_height); + addMouseListener(this); + } + + @Override + public void mousePressed(MouseEvent e) { + over=false; + if (DLOG!=null) { + DLOG.exit(); + } + } + + public void mouseEntered(MouseEvent e) { + over=true; + repaint(); + } + + public void mouseExited(MouseEvent e) { + over=false; + repaint(); + } + + public void mouseClicked(MouseEvent e) { + } + + public void mouseReleased(MouseEvent e) { + } + } +} + + \ No newline at end of file diff --git a/eric/macros/DragDropList.java b/eric/macros/DragDropList.java new file mode 100644 index 0000000..11d5ed0 --- /dev/null +++ b/eric/macros/DragDropList.java @@ -0,0 +1,138 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package eric.macros; + +/** + * + * @author erichake + */ +import java.awt.datatransfer.DataFlavor; +import java.awt.datatransfer.StringSelection; +import java.awt.datatransfer.Transferable; +import java.awt.dnd.DnDConstants; +import java.awt.dnd.DragGestureEvent; +import java.awt.dnd.DragGestureListener; +import java.awt.dnd.DragGestureRecognizer; +import java.awt.dnd.DragSource; +import java.awt.dnd.DragSourceDragEvent; +import java.awt.dnd.DragSourceDropEvent; +import java.awt.dnd.DragSourceEvent; +import java.awt.dnd.DragSourceListener; + +import javax.swing.DefaultListModel; +import javax.swing.DropMode; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JList; +import javax.swing.JScrollPane; +import javax.swing.TransferHandler; + +public class DragDropList extends JList { + DefaultListModel model; + + public DragDropList() { + super(new DefaultListModel()); + model = (DefaultListModel) getModel(); + setDragEnabled(true); + setDropMode(DropMode.INSERT); + + setTransferHandler(new MyListDropHandler(this)); + + new MyDragListener(this); + + model.addElement("a"); + model.addElement("b"); + model.addElement("c"); + model.addElement(new JLabel("coucou")); + } + + public static void main(String[] a){ + JFrame f = new JFrame(); + f.add(new JScrollPane(new DragDropList())); + f.setSize(300,300); + f.setVisible(true); + } +} + +class MyDragListener implements DragSourceListener, DragGestureListener { + DragDropList list; + + DragSource ds = new DragSource(); + + public MyDragListener(DragDropList list) { + this.list = list; + DragGestureRecognizer dgr = ds.createDefaultDragGestureRecognizer(list, + DnDConstants.ACTION_MOVE, this); + + } + + public void dragGestureRecognized(DragGestureEvent dge) { + StringSelection transferable = new StringSelection(Integer.toString(list.getSelectedIndex())); + ds.startDrag(dge, DragSource.DefaultCopyDrop, transferable, this); + } + + public void dragEnter(DragSourceDragEvent dsde) { + } + + public void dragExit(DragSourceEvent dse) { + } + + public void dragOver(DragSourceDragEvent dsde) { + } + + public void dragDropEnd(DragSourceDropEvent dsde) { + if (dsde.getDropSuccess()) { + System.out.println("Succeeded"); + } else { + System.out.println("Failed"); + } + } + + public void dropActionChanged(DragSourceDragEvent dsde) { + } +} + +class MyListDropHandler extends TransferHandler { + DragDropList list; + + public MyListDropHandler(DragDropList list) { + this.list = list; + } + + public boolean canImport(TransferHandler.TransferSupport support) { + if (!support.isDataFlavorSupported(DataFlavor.stringFlavor)) { + return false; + } + JList.DropLocation dl = (JList.DropLocation) support.getDropLocation(); + if (dl.getIndex() == -1) { + return false; + } else { + return true; + } + } + + public boolean importData(TransferHandler.TransferSupport support) { + if (!canImport(support)) { + return false; + } + + Transferable transferable = support.getTransferable(); + String indexString; + try { + indexString = (String) transferable.getTransferData(DataFlavor.stringFlavor); + } catch (Exception e) { + return false; + } + + int index = Integer.parseInt(indexString); + JList.DropLocation dl = (JList.DropLocation) support.getDropLocation(); + int dropTargetIndex = dl.getIndex(); + + System.out.println(dropTargetIndex + " : "); + System.out.println("inserted"); + return true; + } +} diff --git a/eric/macros/JDefaultMutableTreeNode.java b/eric/macros/JDefaultMutableTreeNode.java new file mode 100644 index 0000000..a0dc10d --- /dev/null +++ b/eric/macros/JDefaultMutableTreeNode.java @@ -0,0 +1,106 @@ +/* + +Copyright 2006 Eric Hakenholz + +This file is part of C.a.R. software. + + C.a.R. is a free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 3 of the License. + + C.a.R. is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + */ + + + package eric.macros; + +import eric.GUI.palette.PaletteManager; +import eric.GUI.pipe_tools; +import javax.swing.JMenuItem; +import javax.swing.tree.DefaultMutableTreeNode; +import javax.swing.tree.TreeNode; + +import rene.gui.MyMenuItem; +import rene.zirkel.ZirkelFrame; +import rene.zirkel.macro.Macro; + +public class JDefaultMutableTreeNode extends DefaultMutableTreeNode { + /** + * + */ + + MyMenuItem PMmenuitem; + JMenuItem MainMenuItem; + ZirkelFrame ZF; + String name = ""; + Macro m; + int macrotype;// 0: library macro 2 : file macro + + public JDefaultMutableTreeNode(final String s) { + super(s); + macrotype = MacroTools.FILE_MACRO; + + } + + public JDefaultMutableTreeNode(final ZirkelFrame zf, final Macro mcr) { + super(); + ZF = zf; + macrotype = (mcr.isProtected()) ? MacroTools.LIBRARY_MACRO : MacroTools.FILE_MACRO; + name = mcr.getName(); + m = mcr; + final String[] mytab = mcr.getName().split(("/")); + MainMenuItem = new JMenuItem(mytab[mytab.length - 1]); + MainMenuItem.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(final java.awt.event.ActionEvent evt) { + menuaction(); + } + }); + MainMenuItem.setFont(new java.awt.Font("System", 0, 13)); + PMmenuitem = new MyMenuItem(mytab[mytab.length - 1]); + PMmenuitem.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(final java.awt.event.ActionEvent evt) { + menuaction(); + + } + }); + this.setUserObject(mytab[mytab.length - 1]); + + } + + public void menuaction() { + PaletteManager.deselectgeomgroup(); + pipe_tools.setMacroHelp(m); + ZF.runMacro(m); + } + + public void runZmacro() { + ZF.runMacro(m); + } + + public void setType(final int newtype) { + macrotype=newtype; + m.setProtected(macrotype==MacroTools.LIBRARY_MACRO); + } + + public void ActualisePath() { + if (this.isLeaf()) { + final TreeNode[] mypath = this.getPath(); + name = ""; + for (int i = 1; i < mypath.length - 1; i++) { + name += mypath[i].toString() + "/"; + } + name += mypath[mypath.length - 1].toString(); + ZF.ZC.renameMacro(m, name); + PMmenuitem.setLabel(mypath[mypath.length - 1].toString()); + MainMenuItem.setText(mypath[mypath.length - 1].toString()); + } + } + +} diff --git a/eric/macros/JMacrosFProperties.java b/eric/macros/JMacrosFProperties.java new file mode 100644 index 0000000..a28c3f8 --- /dev/null +++ b/eric/macros/JMacrosFProperties.java @@ -0,0 +1,182 @@ +/* + +Copyright 2006 Eric Hakenholz + +This file is part of C.a.R. software. + + C.a.R. is a free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 3 of the License. + + C.a.R. is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + */ + + + package eric.macros; + +import java.awt.Color; +import java.awt.GridLayout; +import java.awt.event.KeyEvent; + +import javax.swing.JComponent; +import eric.JEricPanel; +import javax.swing.JScrollPane; +import javax.swing.JTable; +import javax.swing.KeyStroke; +import javax.swing.ListSelectionModel; +import javax.swing.ScrollPaneConstants; +import javax.swing.table.DefaultTableModel; +import javax.swing.table.TableCellEditor; +import javax.swing.table.TableCellRenderer; +import rene.gui.Global; + +public class JMacrosFProperties extends JEricPanel { + /** + * + */ + + private final JTable table; + private final DefaultTableModel model; + private final JMacrosInspector JMI; + + public JMacrosFProperties(final JMacrosInspector jmi) { + super(new GridLayout(1, 0)); + JMI = jmi; + this.setFocusable(false); + model = new DefaultTableModel() { + /** + * + */ + private static final long serialVersionUID = 1L; + + @Override + public Class getColumnClass(final int columnIndex) { + if ((columnIndex == 2) || (columnIndex == 3)) { + return Integer.class; + } else { + return super.getColumnClass(columnIndex); + } + } + }; + + table = new JTable(model) { + /** + * + */ + private static final long serialVersionUID = 1L; + + @Override + public boolean isCellEditable(final int row, final int col) { + return false; + } + + @Override + public boolean isCellSelected(final int row, final int col) { + return false; + } + + + @Override + public TableCellRenderer getCellRenderer(final int row, + final int column) { + final Object value = getValueAt(row, column); + if (value != null) { + return getDefaultRenderer(value.getClass()); + } + return getDefaultRenderer(String.class); + } + }; + table.setCellSelectionEnabled(true); + table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); + table.setShowGrid(true); + table.setGridColor(Color.lightGray); + table.setRowHeight(20); + + table.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put( + KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0, false), "none"); + table.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put( + KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0, false), "none"); + + model.addColumn(Global.Loc("mi.tab.type")); + model.addColumn(Global.Loc("mi.tab.name")); + model.addColumn("Construction index"); // Dibs : Construction index -> ExecuteMacro + model.addColumn("Click index"); // Click index -> ExecuteMacroAsBuilt + + + // model.addRow(new Object[]{new String(""),new String(""),new + // String(""),new Boolean(false), new Boolean(false)}); + + table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); + + table.getColumnModel().getColumn(0).setPreferredWidth(45); + table.getColumnModel().getColumn(1).setPreferredWidth(45); + table.getColumnModel().getColumn(2).setPreferredWidth(112); + table.getColumnModel().getColumn(3).setPreferredWidth(80); + + final JScrollPane scrollPane = new JScrollPane(table); + scrollPane + .setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); + add(scrollPane); + } + + public int getRowCount() { + + return model.getRowCount(); + } + + public Object getValueAt(final int i, final int j) { + return model.getValueAt(i, j); + } + + public void stopCellEditing() { + final TableCellEditor editor = table.getCellEditor(); + if (editor != null) { + editor.stopCellEditing(); + } + } + + public String getOType(final int row) { + return (String) model.getValueAt(row, 0); + } + + public String getOName(final int row) { + return (String) model.getValueAt(row, 1); + } + + public String getOFIndex(final int row) { + return (String) model.getValueAt(row, 2); + } + + public String getOFIndex2(final int row) { + return (String) model.getValueAt(row, 3); + } + + + public void setOType(final String what, final int row) { + model.setValueAt(new String(what), row, 0); + } + + public void setOName(final String what, final int row) { + model.setValueAt(new String(what), row, 1); + } + + + public void addRow(final String type, final String name, + final int index, final int index2) { + model.addRow(new Object[] { new String(type), new String(name), + new String(String.valueOf(index)), new String(String.valueOf(index2)) }); + } + + public void removeAllRows() { + while (model.getRowCount() > 0) + model.removeRow(0); + } + +} diff --git a/eric/macros/JMacrosInspector.java b/eric/macros/JMacrosInspector.java new file mode 100644 index 0000000..51d096b --- /dev/null +++ b/eric/macros/JMacrosInspector.java @@ -0,0 +1,653 @@ +/* + +Copyright 2006 Eric Hakenholz + +This file is part of C.a.R. software. + +C.a.R. is a free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 3 of the License. + +C.a.R. is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + + */ +package eric.macros; + +import eric.GUI.pipe_tools; +import eric.GUI.themes; +import eric.JZirkelCanvas; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.Point; +import java.awt.Toolkit; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionListener; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.util.Vector; + +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JComponent; +import javax.swing.JDialog; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import eric.JEricPanel; +import javax.swing.JScrollPane; +import javax.swing.JTextArea; +import javax.swing.ScrollPaneConstants; +import rene.gui.Global; +import rene.zirkel.ZirkelCanvas; + +import rene.zirkel.ZirkelFrame; +import rene.zirkel.macro.Macro; +import rene.zirkel.objects.ConstructionObject; + +/* This class represent the macro properties inspector + */ +public class JMacrosInspector extends JDialog implements MouseListener, MouseMotionListener, TopDialog { + + private static Macro M=null; + private int PW=315; // Palette width + private int PH=516; //395 + private static JDefaultMutableTreeNode node; + private IContent content; + private MouseEvent pressed; + private Point location; + private static JMacrosInspector me; + + public JMacrosInspector(JDefaultMutableTreeNode mymacro) { + setFocusableWindowState(true); + setFocusable(false); + + + this.setSize(PW, PH); + + setUndecorated(true); + + if (!pipe_tools.isApplet()) { + setAlwaysOnTop(true); + } else { + addWindowListener(new WindowAdapter() { + + public void windowDeactivated(WindowEvent e) { + toFront(); + } + }); + } + + // content is a JPanel which represents the content of the palette + content=new IContent(this); + setContentPane(content); + + DialogTitleBar title=new DialogTitleBar(this, PW); + content.add(title, 0); + + ZirkelCanvas zc=JZirkelCanvas.getCurrentZC(); + if (zc!=null) { + Point p=zc.getLocationOnScreen(); + setLocation(p.x+10, p.y+(zc.getSize().height-PH)/2); + } + + setVisible(true); + + + } + + public static boolean isDialogVisible() { + return (me!=null); + } + + public static void openInspector(JDefaultMutableTreeNode mymacro) { + if (me==null) { + me=new JMacrosInspector(mymacro); + } + changemacro(mymacro); + } + + public static void changemacro(JDefaultMutableTreeNode mymacro) { + if (me!=null) { + me.setMacro(mymacro); + } + } + + // set location of the palette (near the right border of the macro panel) : + public void setStandardLocation() { + } + + public void clearPalette() { + if (M!=null) { + content.changemacro(); + } + node=null; + M=null; + content.clearfields(); + } + + // method called each time the user ask properties or select another macro + // in the tree + public void setMacro(final JDefaultMutableTreeNode mynode) { + node=mynode; + M=node.m; + content.fillfields(); + } + + public void mouseClicked(MouseEvent e) { + } + + public void mousePressed(MouseEvent me) { + pressed=me; + } + + public void mouseReleased(MouseEvent e) { + } + + public void mouseEntered(MouseEvent e) { + } + + public void mouseExited(MouseEvent e) { + } + + public void mouseDragged(MouseEvent me) { + location=getLocation(location); + int x=location.x-pressed.getX()+me.getX(); + int y=location.y-pressed.getY()+me.getY(); + setLocation(x, y); + Toolkit.getDefaultToolkit().sync(); + } + + public void mouseMoved(MouseEvent e) { + } + + public static void quit() { + if (me!=null) { + me.exit(); + } + } + + public void exit() { + content.changemacro(); + node=null; + me=null; + dispose(); + } + + public void fixObject(int i, boolean b) { + content.fixObject(i, b); + } + + public void askObject(int i, boolean b) { + content.askObject(i, b); + } + + // this embedded class represents the content of the palette : + public class IContent extends JEricPanel { + + /** + * + */ + JMacrosInspector JMI; + JLabel name; + JTextArea comment; + JMacrosProperties props; + JMacrosFProperties propTs; + JCheckBox hideDuplicates; + + private JEricPanel margin(final int w) { + final JEricPanel mypan=new JEricPanel(); + fixsize(mypan, w, 1); + mypan.setOpaque(false); + return mypan; + } + + public IContent(final JMacrosInspector jmi) { + JMI=jmi; + setLayout(new javax.swing.BoxLayout(this, + javax.swing.BoxLayout.Y_AXIS)); + this.setFocusable(false); + name=new JLabel(); + comment=new JTextArea(); + props=new JMacrosProperties(JMI); + propTs=new JMacrosFProperties(JMI); + hideDuplicates=new JCheckBox(Global.Loc("mi.hideduplicates")); + + newnameline(); + this.add(new mySep(1)); + newcommentline(); + this.add(new mySep(1)); + newproperties(); + this.add(new mySep(1)); + newTproperties(); + this.add(new mySep(1)); + newhideproperties(); + this.add(new mySep(1)); + newcontrolline(); + + fixsize(this, PW, PH); + } + + // set sizes of a palette's JComponent : + private void fixsize(final JComponent cp, final int w, final int h) { + final Dimension d=new Dimension(w, h); + cp.setMaximumSize(d); + cp.setMinimumSize(d); + cp.setPreferredSize(d); + cp.setSize(d); + } + + // add the "name" topic of the palette : + public void newnameline() { + final JEricPanel rub=new myRub(); + final JEricPanel myline1=new ContentLine(25); + fixsize(name, PW-10, 18); + myline1.add(margin(5)); + myline1.add(name); + rub.add(myline1); + this.add(rub); + } + + // add the "comment" topic of the palette : + public void newcommentline() { + final JEricPanel rub=new myRub(); + final JScrollPane jScroll=new JScrollPane(); + final JEricPanel myline1=new ContentLine(22); + final JLabel namelabel=new JLabel(Global.Loc("mi.comment")); + fixsize(namelabel, PW-10, 14); + myline1.add(margin(5)); + myline1.add(namelabel); + final JEricPanel myline2=new ContentLine(100); + + comment.setLineWrap(true); + jScroll.setViewportView(comment); + jScroll.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); + fixsize(jScroll, PW-10, 80); + myline2.add(margin(5)); + myline2.add(jScroll); + rub.add(myline1); + rub.add(myline2); + this.add(rub); + } + + // add the "target properties" topic of the palette : + public void newhideproperties() { + final JEricPanel rub=new myRub(); + rub.setLayout(new javax.swing.BoxLayout(rub, + javax.swing.BoxLayout.Y_AXIS)); + //final JEricPanel myline1=new ContentLine(22); // Dibs : on a ajouté une parie pour les finaux + //final JLabel namelabel=new JLabel(Global.Loc("mi.hideproperties")); + //fixsize(namelabel, PW-10, 14); + //myline1.add(margin(5)); + //myline1.add(namelabel); + final JEricPanel mylineC3=new ContentLine(27); + + hideDuplicates.setOpaque(false); + mylineC3.add(margin(10)); + mylineC3.add(hideDuplicates); + //rub.add(myline1); + rub.add(mylineC3); + this.add(rub); + } + + // add the apply button to the bottom of the palette : + public void newcontrolline() { + final JEricPanel rub=new myRub(); + final JEricPanel myline=new ContentLine(25); + final JButton applybtn=new JButton("Apply"); + applybtn.addMouseListener(new MouseAdapter() { + + @Override + public void mouseClicked(final MouseEvent e) { + changemacro(); + // It's important to refresh the inspector because + // parameters position may have change : + fillfields(); + } + }); + // applybtn.setBorder(BorderFactory.createRaisedBevelBorder()); + // applybtn.setBorder(BorderFactory.createEmptyBorder()); + fixsize(applybtn, 90, 18); + applybtn.setFont(new Font("System", Font.BOLD, 11)); + final JEricPanel sep=new JEricPanel(); + sep.setOpaque(false); + myline.add(sep); + + // JButton jb=new JButton("Aaaa"); + // fixsize(jb,90,18); + + myline.add(applybtn); + myline.add(margin(5)); + rub.add(myline); + this.add(rub); + } + + // add the parameters properties to the palette : + public void newproperties() { + final JEricPanel rub=new myRub(); + final JEricPanel myline1=new ContentLine(22); + final JLabel namelabel=new JLabel(Global.Loc("mi.properties")); + myline1.add(margin(5)); + myline1.add(namelabel); + fixsize(namelabel, PW-10, 14); + final JEricPanel myline2=new ContentLine(130); + fixsize(props, PW-10, 100); + myline2.add(margin(5)); + myline2.add(props); + rub.add(myline1); + rub.add(myline2); + this.add(rub); + } + + public void newTproperties() { + final JEricPanel rub=new myRub(); + final JEricPanel myline1=new ContentLine(22); + final JLabel namelabel=new JLabel(Global.Loc("mi.hideproperties")); + myline1.add(margin(5)); + myline1.add(namelabel); + fixsize(namelabel, PW-10, 14); + final JEricPanel myline2=new ContentLine(120); + fixsize(propTs, PW-10, 100); + myline2.add(margin(5)); + myline2.add(propTs); + rub.add(myline1); + rub.add(myline2); + this.add(rub); + } + + /************************************************* + * this is the tricky method : it reads the inspector changes and then + * store the new values in the macro m. A macro contains two types of + * parameters : 1) normal parameters (the one you shows at the first + * step of macro's creation ). They are inside the m.Params array for + * ConstructionObjects and m.Prompts array for prompts 2) numerical + * input parameters (it's possible to make macros with numerical inputs + * ). Name of Objects are in the PromptFor array and prompts in the + * PromptName array + *************************************************/ + public void changemacro() { + ConstructionObject[] params; + final Vector newparams=new Vector(); + final Vector newprompts=new Vector(); + final Vector newpromptFor=new Vector(); + final Vector newpromptName=new Vector(); + props.stopCellEditing(); + if (M==null) { + return; + } + if (isError()) { + return; + } + M.setComment(comment.getText()); + params=M.getParams(); + + + + // read "normal" parameters and store them in : + // newparams and newprompts if "ask" is not checked (stays "normal") + // newPromptFor and newPromptName if "ask" is not checked (becomes + // "numerical input") + for (int i=0; i. + + */ + + + package eric.macros; + +import java.awt.Color; +import java.awt.GridLayout; +import java.awt.event.KeyEvent; + +import javax.swing.JComponent; +import eric.JEricPanel; +import javax.swing.JScrollPane; +import javax.swing.JTable; +import javax.swing.KeyStroke; +import javax.swing.ListSelectionModel; +import javax.swing.ScrollPaneConstants; +import javax.swing.table.DefaultTableModel; +import javax.swing.table.TableCellEditor; +import javax.swing.table.TableCellRenderer; +import rene.gui.Global; + +public class JMacrosProperties extends JEricPanel { + /** + * + */ + + private final JTable table; + private final DefaultTableModel model; + private final JMacrosInspector JMI; + + public JMacrosProperties(final JMacrosInspector jmi) { + super(new GridLayout(1, 0)); + JMI = jmi; + this.setFocusable(false); + model = new DefaultTableModel() { + /** + * + */ + private static final long serialVersionUID = 1L; + + @Override + public Class getColumnClass(final int columnIndex) { + if ((columnIndex == 3) || (columnIndex == 4)) { + return Boolean.class; + } else { + return super.getColumnClass(columnIndex); + } + } + }; + + table = new JTable(model) { + /** + * + */ + private static final long serialVersionUID = 1L; + + @Override + public boolean isCellEditable(final int row, final int col) { + if (col == 0) + return false; + if ((col == 2) + && (String.valueOf(getValueAt(row, 3)).equals("true"))) + return false; + return (getValueAt(row, col) != null); + } + + @Override + public boolean isCellSelected(final int row, final int col) { + return false; + } + + @Override + public void setValueAt(final Object o, final int row, final int col) { + getModel().setValueAt(o, row, col); + + if (col == 3) + JMI.fixObject(row, String.valueOf( + getModel().getValueAt(row, col)).equals("true")); + if (col == 4) + JMI.askObject(row, String.valueOf( + getModel().getValueAt(row, col)).equals("true")); + + } + + @Override + public TableCellRenderer getCellRenderer(final int row, + final int column) { + final Object value = getValueAt(row, column); + if (value != null) { + return getDefaultRenderer(value.getClass()); + } + return getDefaultRenderer(String.class); + } + }; + table.setCellSelectionEnabled(true); + table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); + table.setShowGrid(true); + table.setGridColor(Color.lightGray); + table.setRowHeight(20); + + table.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put( + KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0, false), "none"); + table.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put( + KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0, false), "none"); + + model.addColumn(Global.Loc("mi.tab.type")); + model.addColumn(Global.Loc("mi.tab.name")); + model.addColumn(Global.Loc("mi.tab.prompt")); + model.addColumn(Global.Loc("mi.tab.fix")); + model.addColumn(Global.Loc("mi.tab.ask")); + + // model.addRow(new Object[]{new String(""),new String(""),new + // String(""),new Boolean(false), new Boolean(false)}); + + table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); + + table.getColumnModel().getColumn(0).setPreferredWidth(45); + table.getColumnModel().getColumn(1).setPreferredWidth(45); + table.getColumnModel().getColumn(2).setPreferredWidth(125); + table.getColumnModel().getColumn(3).setPreferredWidth(37); + table.getColumnModel().getColumn(4).setPreferredWidth(35); + + final JScrollPane scrollPane = new JScrollPane(table); + scrollPane + .setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); + add(scrollPane); + } + + public int getRowCount() { + + return model.getRowCount(); + } + + public Object getValueAt(final int i, final int j) { + return model.getValueAt(i, j); + } + + public void stopCellEditing() { + final TableCellEditor editor = table.getCellEditor(); + if (editor != null) { + editor.stopCellEditing(); + } + } + + public String getOType(final int row) { + return (String) model.getValueAt(row, 0); + } + + public String getOName(final int row) { + return (String) model.getValueAt(row, 1); + } + + public String getOPrompt(final int row) { + return (String) model.getValueAt(row, 2); + } + + public boolean getOFix(final int row) { + return String.valueOf(model.getValueAt(row, 3)).equals("true"); + } + + public boolean getOAsk(final int row) { + if (model.getValueAt(row, 4) == null) + return false; + return String.valueOf(table.getModel().getValueAt(row, 4)).equals( + "true"); + } + + public void setOType(final String what, final int row) { + model.setValueAt(new String(what), row, 0); + } + + public void setOName(final String what, final int row) { + model.setValueAt(new String(what), row, 1); + } + + public void setOPrompt(final String what, final int row) { + model.setValueAt(new String(what), row, 2); + } + + public void setOAsk(final boolean what, final int row) { + if (model.getValueAt(row, 4) != null) + model.setValueAt(new Boolean(what), row, 4); + } + + public void setOFix(final boolean what, final int row) { + model.setValueAt(new Boolean(what), row, 3); + } + + public void addRow(final String type, final String name, + final String prompt, final boolean fix) { + final String newprompt = (fix) ? "" : prompt; + model.addRow(new Object[] { new String(type), new String(name), + new String(newprompt), new Boolean(fix), null }); + + } + + public void addRow(final String type, final String name, + final String prompt, final boolean fix, final boolean ask) { + final String newprompt = (fix) ? "" : prompt; + model.addRow(new Object[] { new String(type), new String(name), + new String(newprompt), new Boolean(fix), new Boolean(ask) }); + } + + public void removeAllRows() { + while (model.getRowCount() > 0) + model.removeRow(0); + } + +} diff --git a/eric/macros/MacroTools.java b/eric/macros/MacroTools.java new file mode 100644 index 0000000..998817f --- /dev/null +++ b/eric/macros/MacroTools.java @@ -0,0 +1,570 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.macros; + +import eric.GUI.pipe_tools; +import eric.GUI.themes; +import eric.GUI.windowComponent; +import eric.JZirkelCanvas; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.Enumeration; +import java.util.Vector; +import rene.gui.Global; +import rene.util.xml.XmlReader; +import rene.util.xml.XmlTag; +import rene.util.xml.XmlTagPI; +import rene.util.xml.XmlTree; +import rene.zirkel.ZirkelCanvas; +import rene.zirkel.ZirkelFrame; +import rene.zirkel.construction.ConstructionException; +import rene.zirkel.construction.Count; +import rene.zirkel.macro.Macro; +import rene.zirkel.macro.MacroItem; +import rene.zirkel.macro.MacroRunner; +import rene.zirkel.objects.ConstructionObject; +import rene.zirkel.objects.TextObject; + +/** + * + * @author erichake + */ +public class MacroTools { + + static public final int LIBRARY_MACRO=0; + static public final int FILE_MACRO=2; + static private Vector librarymacros=new Vector(); + static public Vector builtinmacros=new Vector(); + static public String MacrosLibraryFileName=""; + static public String MacrosBackupLibraryFileName=""; + + public static void createLocalDirectory() { + // Setting (if necessary) home directory name and home library macros + // file name : + + final String mypath=Global.AppPath(); + + // Place the help files in the local directory : + if ((Global.isNewVersion())||(!(new File(Global.getHomeDirectory()+"docs").exists()))) { + try { + Global.copyFiles(new File(mypath+"docs"), new File( + Global.getHomeDirectory()+"docs")); + } catch (final IOException ex) { + System.out.println("bug : createLocalDirectory()"); + } + } + + // Place the javascript files in the local directory : + if ((Global.isNewVersion())||(!(new File(Global.getHomeDirectory()+"scripts").exists()))) { + try { + Global.copyFiles(new File(mypath+"scripts"), new File( + Global.getHomeDirectory()+"scripts")); + } catch (final IOException ex) { + System.out.println("bug : createLocalDirectory()"); + } + } + + String Filename="library.mcr"; + if (new File(mypath+Global.name("language", "")+"library.mcr").exists()) { + Filename=Global.name("language", "")+"library.mcr"; + } else if (new File(Global.getHomeDirectory()+Global.name("language", "")+"library.mcr").exists()) { + Filename=Global.name("language", "")+"library.mcr"; + } + + MacrosLibraryFileName=Global.getHomeDirectory()+Filename; + // is there a library in home folder ? + if (new File(MacrosLibraryFileName).exists()) { + // Is it a new version at this startup ? + if (Global.isNewVersion()) { + MacrosBackupLibraryFileName=Global.getHomeDirectory()+"library_backup.mcr"; + Global.copyFile(MacrosLibraryFileName, MacrosBackupLibraryFileName); + Global.copyFile(mypath+Filename, MacrosLibraryFileName); + } + } else { + new File(Global.getHomeDirectory()).mkdirs(); + Global.copyFile(mypath+Filename, MacrosLibraryFileName); + } + + Global.makeWindowConfigFolderInvisible(); + } + + public static Vector getBuiltinMacros() { + return builtinmacros; + } + + public static Vector getLibraryMacros() { + return librarymacros; + } + + public static void clearLibraryMacros() { + librarymacros.removeAllElements(); + } + + public static void addToLibraryMacros(MacroItem mi) { + librarymacros.add(mi); + } + + public static void updateLibraryMacros() { + ZirkelCanvas zc=JZirkelCanvas.getCurrentZC(); + if ((!(zc==null))) { + librarymacros.clear(); + final Vector V=zc.getMacros(); + for (int i=0; i mc; + Macro m; + TextObject t; + ZirkelFrame ZF=JZirkelCanvas.getCurrentZF(); + if (ZF==null) { + return; + } + mc=builtinmacros; + for (int i=0; i=Macros.size()) { + m.setProtected(true); + final MacroItem mi=new MacroItem(m, null); + Macros.addElement(mi); + + } + } catch (final ConstructionException ex) { + Count.setAllAlternate(false); + throw ex; + } + Count.setAllAlternate(false); + + } else { + throw new ConstructionException("Construction not found"); + } + } + } catch (final Exception e) { + throw e; + } + } + + public static void LoadDefaultMacrosAtStartup() { + // Loading builtin macros (for some icons in palette, like symetry) + try { + final InputStream o=MacroTools.class.getResourceAsStream("/builtin.mcr"); + LoadMacros(o, builtinmacros); + o.close(); + } catch (final Exception e) { + System.out.println("builtinmacros bug"); + } + if ((!themes.isApplet())&&(new File(MacrosLibraryFileName).exists())) { + try { + final InputStream o=new FileInputStream(MacrosLibraryFileName); + LoadMacros(o, librarymacros); + o.close(); + if (!MacrosBackupLibraryFileName.equals("")) { + + final InputStream o2=new FileInputStream( + MacrosBackupLibraryFileName); + LoadMacros(o2, librarymacros); + o2.close(); + final File f=new File(MacrosBackupLibraryFileName); + f.delete(); + } + return; + } catch (final Exception e) { + System.out.println("librarymacros bug"); + } + } + try { + final InputStream o=MacroTools.class.getResourceAsStream("/default.mcr"); + LoadMacros(o, librarymacros); + o.close(); + return; + } catch (final Exception e) { + System.out.println("default macros bug"); + } + } + + public static void saveLibraryToDisk() { + if (JZirkelCanvas.getCurrentZF()!=null) { + ZirkelFrame ZF=new ZirkelFrame(pipe_tools.isApplet()); + ZF.dosave(MacrosLibraryFileName, false, true, true, false, librarymacros); + } + } + + + /* If user changes macro type in the tree (e.g. "add to library") from one figure, + * library macros vector is changed, so we must transmit all changes to + * others figures : + */ + public static void populateMacrosTypeChanges() { + int max=JZirkelCanvas.getZCsSize(); + for (int i=0; i. + + */ +package eric.macros; + +import eric.GUI.themes; +import eric.JGeneralMenuBar; +import eric.JZirkelCanvas; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.util.Vector; + +import javax.swing.BorderFactory; +import javax.swing.DefaultCellEditor; +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JComponent; +import javax.swing.JLabel; +import javax.swing.JMenu; +import eric.JEricPanel; +import javax.swing.JPopupMenu; +import javax.swing.JScrollPane; +import javax.swing.JTable; +import javax.swing.JTextField; +import javax.swing.JTree; +import javax.swing.SwingUtilities; +import javax.swing.event.TreeModelEvent; +import javax.swing.event.TreeModelListener; +import javax.swing.tree.DefaultTreeModel; +import javax.swing.tree.TreeCellRenderer; +import javax.swing.tree.TreeNode; +import javax.swing.tree.TreePath; +import javax.swing.tree.TreeSelectionModel; +import rene.gui.Global; + +import rene.gui.MyMenu; +import rene.zirkel.ZirkelFrame; +import rene.zirkel.macro.Macro; +import rene.zirkel.macro.MacroItem; + +// Toute ce qui touche à l'arbre de macros et à sa gestion : +public class MacrosList extends JEricPanel { + + private final int CONTROLHEIGHT=25; + private final ImageIcon JTreefoldclosed; + private final ImageIcon JTreefoldopened; + private final ImageIcon[] JTreeleaf; + private CTree MacrosTree; + private JDefaultMutableTreeNode MacroTreeTopNode=new JDefaultMutableTreeNode("Macros"); + private ZirkelFrame ZF; + private JScrollPane jscrolls; + private JControls controls; +// private Jcreatemacro createmacropanel; + + public MacrosList(ZirkelFrame zf) { + ZF=zf; + JTreefoldclosed=themes.getIcon("JTreefoldclosed.gif"); + JTreefoldopened=themes.getIcon("JTreefoldopened.gif"); + JTreeleaf=new ImageIcon[4]; + JTreeleaf[0]=themes.getIcon("JTreeleaf_0.gif"); + JTreeleaf[1]=themes.getIcon("JTreeleaf_1.gif"); + JTreeleaf[2]=themes.getIcon("JTreeleaf_2.gif"); + JTreeleaf[3]=themes.getIcon("JTreeleaf_3.gif"); + this.setLayout(new javax.swing.BoxLayout(this, + javax.swing.BoxLayout.Y_AXIS)); + + // uncomment this line to obtain gray conection lines between leaves : + // UIManager.put("Tree.hash",new ColorUIResource(Color.lightGray)); + + MacroTreeTopNode=new JDefaultMutableTreeNode("Macros"); + MacrosTree=new CTree(this) { + + /** + * + */ + @Override + public void paint(final Graphics g) { + final ImageIcon backimage=themes.getIcon("macrospanelback.gif"); + g.drawImage(backimage.getImage(), 0, 0, this.getSize().width, + backimage.getIconHeight(), this); + super.paint(g); + } + }; + MacrosTree.setFocusable(false); + MacrosTree.setModel(new MyTreeModel(MacroTreeTopNode)); + MacrosTree.getSelectionModel().setSelectionMode( + TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION); + final MyCellRenderer renderer=new MyCellRenderer(); + MacrosTree.setCellRenderer(renderer); + MacrosTree.setCellEditor(new MyDefaultCellEditor()); + MacrosTree.setOpaque(false); + MacrosTree.setFont(new Font(Global.GlobalFont, 0, 12)); + MacrosTree.setForeground(new Color(70, 70, 70)); + MacrosTree.setDragEnabled(false); + MacrosTree.setEditable(false); + + jscrolls=new JScrollPane(MacrosTree); + jscrolls.setAlignmentX(0F); + jscrolls.setBorder(BorderFactory.createEmptyBorder()); + this.add(jscrolls); + + controls=new JControls(this); + this.add(controls); +// createmacropanel=new Jcreatemacro(this); +// this.add(createmacropanel); + } + + public JDefaultMutableTreeNode getTopNode() { + return MacroTreeTopNode; + } + + public CTree getMacrosTree() { + return MacrosTree; + } + + // Utilise le Vector de macros pour initialiser l'arbre : + public void initTreeFromZCMacros() { + + Vector mc; +// JMacrosTools.setDefaultMacros(); + MacroTreeTopNode.removeAllChildren(); +// removeAll(); +// MacroTreeTopNode=new JDefaultMutableTreeNode("Macros"); + + mc=ZF.ZC.getMacros(); + for (int i=0; i0) { + JPopupMenu.setDefaultLightWeightPopupEnabled(false); + + ParseMacroTree(pm, jm, MacroTreeTopNode, "root"); + + ZF.ZC.PM.removeAll(); + JGeneralMenuBar.s_InitMacrosMenu(); + + final JMenu jmroot=(JMenu) jm.getItem(0); + final MyMenu pmroot=(MyMenu) pm.getItem(0); + while (pmroot.getItemCount()>0) { + ZF.ZC.PM.add(pmroot.getItem(0)); + JGeneralMenuBar.addMacrosMenu(jmroot.getItem(0)); + + +// if (ZF.ZC.isLibraryMacrosVisible()) { +// ZF.ZC.PM.add(pmroot.getItem(0)); +// JGeneralMenuBar.addMacrosMenu(jmroot.getItem(0)); +// } else { +// pmroot.remove(0); +// jmroot.remove(0); +// +// } + } + + } else { + ZF.ZC.PM.removeAll(); + JGeneralMenuBar.s_InitMacrosMenu(); + } + MacroTools.updateLibraryMacros(); + } + + // Procédure recursive appelée uniquement par ActualiseMacroPopupMenu. + // Parcours de l'arbre de macros : + private void ParseMacroTree(final MyMenu PMmenu, final JMenu JMmenu, + final JDefaultMutableTreeNode node, final String path) { + final String mypath=path; + if (!(node.isLeaf())) { + final MyMenu mymenu=new MyMenu((String) node.getUserObject()); + final JMenu myjmenu=new JMenu((String) node.getUserObject()); + myjmenu.setFont(new java.awt.Font("System", 0, 13)); + for (int i=0; i1) { + ((DefaultTreeModel) MacrosTree.getModel()).removeNodeFromParent(node); + } + } + + } + + } + + // Les noeuds de l'arbre sont considérés comme des JLabels + // Cette classe se charge de leurs look : + class MyCellRenderer extends JLabel implements TreeCellRenderer { + + /** + * + */ + public MyCellRenderer() { + setOpaque(false); + setBackground(null); + } + + public Component getTreeCellRendererComponent(final JTree tree, + final Object value, final boolean sel, final boolean expanded, + final boolean leaf, final int row, final boolean hasFocus) { + final String stringValue=tree.convertValueToText(value, sel, + expanded, leaf, row, hasFocus); + + setText(stringValue); + setEnabled(tree.isEnabled()); + setFont(tree.getFont()); + setForeground(Color.black); + setOpaque(sel); + + // Couleur de sélection : + setBackground(Color.lightGray); + final JDefaultMutableTreeNode mynode=(JDefaultMutableTreeNode) value; + if (leaf) { + setIcon((stringValue.startsWith(("-- ")))?null + :JTreeleaf[mynode.macrotype]); + if (mynode.macrotype==0) { + setForeground(new Color(68, 84, 131)); + } + } else { + setIcon((expanded)?JTreefoldopened:JTreefoldclosed); + } + + + return this; + } + } + + // Le modèle sur lequel est basé l'arbre + // Se charge de l'édition des noeuds et contient les TreeModelListeners : + class MyTreeModel extends DefaultTreeModel implements TreeModelListener { + + /** + * + */ + public MyTreeModel(final TreeNode node) { + super(node); + this.addTreeModelListener(this); + + } + + @Override + public void valueForPathChanged(final TreePath path, + final Object newValue) { + final JDefaultMutableTreeNode tn=(JDefaultMutableTreeNode) path.getLastPathComponent(); + super.valueForPathChanged(path, newValue); + tn.ActualisePath(); + } + + public void treeNodesChanged(final TreeModelEvent e) { + SwingUtilities.invokeLater(new Runnable() { + + public void run() { + ActualiseMacroPopupMenu(); + } + }); + } + + public void treeNodesInserted(final TreeModelEvent e) { + // System.out.println("treeNodesInserted"); + SwingUtilities.invokeLater(new Runnable() { + + public void run() { + ActualiseMacroPopupMenu(); + } + }); + } + + public void treeNodesRemoved(final TreeModelEvent e) { + SwingUtilities.invokeLater(new Runnable() { + + public void run() { + ActualiseMacroPopupMenu(); + } + }); + } + + public void treeStructureChanged(final TreeModelEvent e) { + // System.out.println("treeStructureChanged"); + SwingUtilities.invokeLater(new Runnable() { + + public void run() { + ActualiseMacroPopupMenu(); + } + }); + } + } + + /************************************************************************************** + *** N'oublions pas que JMacrosList est un JPanel qui contient d'autres + * JPanels La class Jcontrols contient les boutons d'édition de l'arbre et + * leurs listeners + ***************************************************************************************/ + class JControls extends JEricPanel { + + /** + * + */ + private JButton addbtn; + private JButton delbtn; + private JButton renbtn; + private JButton createbtn; + private String message=""; + private MacrosList MI; + + @Override + public void paintComponent(final java.awt.Graphics g) { + super.paintComponent(g); + final java.awt.Dimension d=this.getSize(); + g.drawImage(themes.getImage("tab_bottom.gif"), 0, 0, d.width, + d.height, this); + } + + public void setButtonsIcons() { + addbtn.setIcon(themes.getIcon("addmacrofolder.png")); + addbtn.setRolloverIcon(themes.getIcon("addmacrofoldersel.png")); + delbtn.setIcon(themes.getIcon("delmacro.png")); + delbtn.setToolTipText(Global.Loc("macros.deleteselected")); + renbtn.setIcon(themes.getIcon("renamemacro.png")); + renbtn.setRolloverIcon(themes.getIcon("renamemacrosel.png")); + createbtn.setIcon(themes.getIcon("createmacro.png")); + createbtn.setRolloverIcon(themes.getIcon("createmacroover.png")); + + } + + public JControls(MacrosList mi) { + MI=mi; + this.setLayout(new javax.swing.BoxLayout(this, + javax.swing.BoxLayout.X_AXIS)); + this.setAlignmentX(0F); + addbtn=new JButton(); + addbtn.setToolTipText(Global.Loc("macros.addfolder")); + addbtn.setOpaque(false); + addbtn.setContentAreaFilled(false); + addbtn.setBorder(BorderFactory.createEmptyBorder()); + addbtn.addMouseListener(new MouseAdapter() { + + @Override + public void mouseClicked(final MouseEvent e) { + MacrosTree.nodepopup.addfolder(); + } + }); + + delbtn=new JButton(); + delbtn.setOpaque(false); + delbtn.setContentAreaFilled(false); + delbtn.setBorder(BorderFactory.createEmptyBorder()); + delbtn.setRolloverIcon(themes.getIcon("delmacrosel.png")); + delbtn.addMouseListener(new MouseAdapter() { + + @Override + public void mouseClicked(final MouseEvent e) { +// MacrosTree.nodepopup.deletenodes(); + System.out.println("size="+JZirkelCanvas.getCurrentZC().getMacros().size()); + } + }); + + renbtn=new JButton(); + renbtn.setToolTipText(Global.Loc("macros.renamemacro")); + renbtn.setOpaque(false); + renbtn.setContentAreaFilled(false); + renbtn.setBorder(BorderFactory.createEmptyBorder()); + renbtn.addMouseListener(new MouseAdapter() { + + @Override + public void mouseClicked(final MouseEvent e) { + MacrosTree.nodepopup.renamenode(); + } + }); + + createbtn=new JButton(); + createbtn.setToolTipText(Global.Loc("macros.recordmacro")); + createbtn.setSelectedIcon(themes.getIcon("createmacrosel.png")); + createbtn.setBorder(BorderFactory.createEmptyBorder()); + createbtn.setOpaque(false); + createbtn.setContentAreaFilled(false); + createbtn.setSelected(false); + + setButtonsIcons(); + + createbtn.addMouseListener(new MouseAdapter() { + + @Override + public void mouseEntered(final MouseEvent e) { +// if (createbtn.isSelected()) { +// message=createmacropanel.getComment().getText(); +// createmacropanel.getComment().setText(Global.Loc("macros.cancel")); +// } + } + + @Override + public void mouseExited(final MouseEvent e) { +// if (createbtn.isSelected()) { +// if (message!="") { +// createmacropanel.getComment().setText(message); +// } +// } + } + + @Override + public void mousePressed(final MouseEvent e) { + if (createbtn.isSelected()) { + createbtn.setSelected(false); +// createmacropanel.disappeargently(); +// PaletteManager.setSelected("point", true); + } else { + createbtn.setSelected(true); + new CreateMacroDialog(MI); +// createmacropanel.appeargently(); +// PaletteManager.deselectgeomgroup(); + } + + } + }); + + final JEricPanel spacer=new JEricPanel(); + spacer.setOpaque(false); + + this.add(addbtn); + this.add(delbtn); + this.add(renbtn); + this.add(spacer); + this.add(createbtn); + } + } +} diff --git a/eric/macros/NodePopupMenu.java b/eric/macros/NodePopupMenu.java new file mode 100644 index 0000000..df81514 --- /dev/null +++ b/eric/macros/NodePopupMenu.java @@ -0,0 +1,428 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.macros; + +import eric.FileTools; +import eric.GUI.palette.PaletteManager; +import eric.JZirkelCanvas; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseEvent; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.util.Vector; +import javax.swing.JComponent; +import javax.swing.JMenuItem; +import javax.swing.JOptionPane; +import javax.swing.JPopupMenu; +import javax.swing.JSeparator; +import javax.swing.plaf.SeparatorUI; +import javax.swing.tree.DefaultMutableTreeNode; +import javax.swing.tree.DefaultTreeModel; +import javax.swing.tree.TreePath; +import rene.gui.Global; +import rene.zirkel.ZirkelCanvas; +import rene.zirkel.macro.Macro; +import rene.zirkel.macro.MacroItem; + +/** + * + * @author erichake + */ +public class NodePopupMenu extends JPopupMenu { + + private final CTree macrostree; + private JDefaultMutableTreeNode SelectedNode; + private TreePath[] SelectedPath; + private JMenuItem runitem, renitem, delitem, tolibitem, tofileitem, saveitem, updtitem, propitem, dupitem; + + public NodePopupMenu(CTree mytree) { + macrostree=mytree; + dupitem=new JMenuItem(Global.Loc("macros.popup.duplicate")); + dupitem.addActionListener(new ActionListener() { + + public void actionPerformed(final ActionEvent event) { + duplicatenodes(); + } + }); + + propitem=new JMenuItem(Global.Loc("macros.popup.properties")); + propitem.addActionListener(new ActionListener() { + + public void actionPerformed(final ActionEvent event) { + showproperties(); + } + }); + + runitem=new JMenuItem(Global.Loc("macros.popup.run")); + runitem.addActionListener(new ActionListener() { + + public void actionPerformed(final ActionEvent event) { +// runmacro(); + } + }); + + renitem=new JMenuItem(Global.Loc("macros.popup.rename")); + renitem.addActionListener(new ActionListener() { + + public void actionPerformed(final ActionEvent event) { + renamenode(); + } + }); + + delitem=new JMenuItem(Global.Loc("macros.popup.delete")); + delitem.addActionListener(new ActionListener() { + + public void actionPerformed(final ActionEvent event) { + deletenodes(); + } + }); + + tolibitem=new JMenuItem(Global.Loc("macros.popup.addtolibrary")); + tolibitem.addActionListener(new ActionListener() { + + public void actionPerformed(final ActionEvent event) { + changeMacroType(0); + } + }); + + tofileitem=new JMenuItem(Global.Loc("macros.popup.removefromlibrary")); + tofileitem.addActionListener(new ActionListener() { + + public void actionPerformed(final ActionEvent event) { + changeMacroType(2); + } + }); + + + + saveitem=new JMenuItem(Global.Loc("macros.popup.saveas")); + saveitem.addActionListener(new ActionListener() { + + public void actionPerformed(final ActionEvent event) { + saveMacros(); + } + }); + } + + public void handleMouseClick(final MouseEvent e) { + final TreePath path=macrostree.getPathForLocation(e.getX(), e.getY()); + if (path!=null) { + SelectedNode=(JDefaultMutableTreeNode) path.getLastPathComponent(); + SelectedPath=macrostree.getSelectionPaths(); + if ((SelectedPath.length==1)&&(SelectedNode.isLeaf())) { + if (JMacrosInspector.isDialogVisible()) { + JMacrosInspector.changemacro(SelectedNode); + } else { + PaletteManager.deselectgeomgroup(); + SelectedNode.runZmacro(); + } + } + } + } + + void actualiseproperties() { +// throw new UnsupportedOperationException("Not yet implemented"); + } + + private void showproperties() { + JMacrosInspector.openInspector(SelectedNode); +// new JMacrosInspector(SelectedNode); + } + + public void handlePopup(final MouseEvent e) { + if (e.isPopupTrigger()) { + final TreePath path=macrostree.getPathForLocation(e.getX(), e.getY()); + + if (path!=null) { + macrostree.addSelectionPath(path); + SelectedNode=(JDefaultMutableTreeNode) path.getLastPathComponent(); + SelectedPath=macrostree.getSelectionPaths(); + // initSelectedPath(); + + this.removeAll(); + + if (SelectedPath.length>1) { + + this.add(delitem); + if (!JZirkelCanvas.isRestrictedSession()) { + this.add(createSeparator()); + this.add(tolibitem); + this.add(tofileitem); + this.add(createSeparator()); + this.add(saveitem); + } + } else { + if (SelectedNode.isLeaf()) { + this.add(renitem); + if (!JZirkelCanvas.isRestrictedSession()) { + this.add(delitem); + this.add(dupitem); + } + this.add(createSeparator()); + if (!JZirkelCanvas.isRestrictedSession()) { + this.add(tolibitem); + this.add(tofileitem); + this.add(createSeparator()); + this.add(saveitem); + this.add(createSeparator()); + } + this.add(runitem); + this.add(createSeparator()); + this.add(propitem); + } else { + this.add(renitem); + this.add(delitem); + this.add(createSeparator()); + if (!JZirkelCanvas.isRestrictedSession()) { + this.add(tolibitem); + this.add(tofileitem); + this.add(createSeparator()); + this.add(saveitem); + } + } + } + + this.show(e.getComponent(), e.getX(), e.getY()); + } + } + } + + public void addfolder() { + JDefaultMutableTreeNode root; + + final JDefaultMutableTreeNode node=new JDefaultMutableTreeNode(Global.Loc("macros.untitledfolder")); + node.add(new JDefaultMutableTreeNode(Global.Loc("macros.emptynode"))); + + final TreePath[] paths=macrostree.getSelectionPaths(); + if ((paths)!=null) { + root=(JDefaultMutableTreeNode) paths[0].getLastPathComponent(); + + if (root.isLeaf()) { + // if the first selected node is a leaf : + final DefaultMutableTreeNode father=(DefaultMutableTreeNode) root.getParent(); + final int i=father.getIndex(root)+1; + + ((DefaultTreeModel) macrostree.getModel()).insertNodeInto(node, + father, i); + + } else { + // if the first selected node is a folder : + ((DefaultTreeModel) macrostree.getModel()).insertNodeInto(node, + root, root.getChildCount()); + } + } else { + // There is no selected node : + ((DefaultTreeModel) macrostree.getModel()).insertNodeInto(node, + macrostree.JML.getTopNode(), + macrostree.JML.getTopNode().getChildCount()); + } + + // Transformation d'un noeud en TreePath : + final TreePath tp=new TreePath(node.getPath()); + macrostree.setEditable(true); + macrostree.startEditingAtPath(tp); + + } + + private void updateMacrosVector(JDefaultMutableTreeNode node) { + if (node.m==null) { + return; + } + String name=node.m.Name; + if (node.m.isProtected()) { + int ZCsSize=JZirkelCanvas.getZCsSize(); + // delete the macro from all the ZirkelCanvas (in different tabs) : + for (int size=0; size mobiles=new ArrayList(); + private ArrayList mobilesCoords=new ArrayList(); + private boolean inprogress=false; + private static Thread shakeThread=null; + + public monkey(ZirkelCanvas zc) { + ZC=zc; + initMobiles(); + } + + public void initMobiles() { + mobiles.clear(); + mobilesCoords.clear(); + Enumeration e=ZC.getConstruction().elements(); + while (e.hasMoreElements()) { + final ConstructionObject c=(ConstructionObject) e.nextElement(); + if (c instanceof PointObject) { + PointObject pt=(PointObject) c; + if (pt.moveable()&&pt.insidewindow()) { + mobiles.add(pt); + double[] tab={pt.getX(), pt.getY()}; + mobilesCoords.add(tab); + } + } + } + } + + public void reset() { + for (int k=25; k>0; k--) { + long t0=System.currentTimeMillis(); + for (int i=0; i0) { + Thread.sleep(time); + } + } catch (Exception ex) { + } + } + } + + public void move1step() { + for (int i=0; i0) { + Thread.sleep(time); + } + } catch (Exception ex) { + } + } + reset(); + shakeThread=null; + } + }; + shakeThread.setPriority(Thread.MIN_PRIORITY); + shakeThread.start(); + } + + public void stop() { + inprogress=false; + } +} diff --git a/eric/restrict/RestrictContainer.java b/eric/restrict/RestrictContainer.java new file mode 100644 index 0000000..c59ab58 --- /dev/null +++ b/eric/restrict/RestrictContainer.java @@ -0,0 +1,70 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.restrict; + +import java.awt.Color; +import java.util.Vector; +import javax.swing.BorderFactory; +import javax.swing.BoxLayout; +import eric.JEricPanel; +import javax.swing.JScrollPane; +import rene.util.xml.XmlTree; +import rene.zirkel.ZirkelCanvas; + +/** + * + * @author erichake + */ +public class RestrictContainer extends JEricPanel { + + private ZirkelCanvas ZC; + private static int W=500,H=400; + private JScrollPane scroll; + private RestrictPanel panel; + private RestrictContainerTitle title; + + public RestrictContainer(ZirkelCanvas zc) { + ZC=zc; + setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); + setBorder(BorderFactory.createEtchedBorder()); + setBackground(new Color(255,255,255,100)); + title=new RestrictContainerTitle(); + panel=new RestrictPanel(); + scroll=new JScrollPane(panel); + scroll.setBorder(BorderFactory.createEmptyBorder()); + scroll.getVerticalScrollBar().setUnitIncrement(24); + scroll.setOpaque(false); + add(title); + add(scroll); + add(new RestrictContainerControls(panel,ZC)); + } + + public void init() { + int x=(ZC.getSize().width-W)/2; + int y=(ZC.getSize().height-H)/2; + setBounds(x, y, W, H); + } + + public void selectFromZC(){ + + } + + public static int getContainerWidth(){ + return W; + } + + + + public void removeRestrictItem(RestrictPanelIcon si) { + } + + public void removeRestrictItem(String nme) { + } + + public void addRestrictItem(XmlTree tree) { + } + + +} diff --git a/eric/restrict/RestrictContainerControls.java b/eric/restrict/RestrictContainerControls.java new file mode 100644 index 0000000..41e9529 --- /dev/null +++ b/eric/restrict/RestrictContainerControls.java @@ -0,0 +1,115 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.restrict; + +import eric.GUI.palette.PaletteManager; +import eric.GUI.themes; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.Graphics; +import java.awt.Image; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.util.ArrayList; +import javax.swing.BoxLayout; +import javax.swing.JButton; +import javax.swing.JLabel; +import eric.JEricPanel; +import javax.swing.SwingConstants; +import rene.gui.Global; +import rene.zirkel.ZirkelCanvas; + +/** + * + * @author erichake + */ +public class RestrictContainerControls extends JEricPanel { + + ZirkelCanvas ZC; + private static Image offimage=themes.getImage("tab_bottom.gif"); + private ArrayList originalItems; + private RestrictPanel panel; + + @Override + public void paintComponent(Graphics g){ + Dimension d=getSize(); + g.setColor(new Color(230,230,230)); + g.fillRect(0, 0, d.width, d.height); + g.setColor(new Color(130,130,130)); + g.drawLine(0, 0, d.width, 0); + } + + public RestrictContainerControls(RestrictPanel pan,ZirkelCanvas zc) { + ZC=zc; + panel=pan; + // backup of restricted hidden items : + originalItems=new ArrayList(); + ArrayList items=ZC.getHiddenItems(); + for (int i=0;i hiddenItems=new ArrayList(); + public static final String DISK="z_disk"; + public static final String EDIT="z_edit"; + public static final String GEOM="z_geom"; + public static final String ASPECT="z_aspect"; + public static final String FUNC="z_func"; + public static final String TEST="z_test"; + public static final String CTRL="z_ctrl"; + public static final String GRID="z_grid"; + public static final String HIST="z_hist"; + public static final String BACK="z_back"; + public static final String SIZE="z_size"; + public static final String PREC="z_prec"; + public static final String MENU="x_menu"; // for menu bar + public static final String MCRP="x_macr"; // for macro panel + public static final String HISTP="x_hist"; // for history panel + public static final String HLPP="x_help"; // for help panel + public static final String LMCR="x_lmcr"; // for library macros + public static String[] geom_icns, disk_icns, edit_icns, func_icns, test_icns, control_icns, + grid_icns, history_icns, back_icns, size_icns, prec_icns; + public static String standardRestrictedHiddenItems="save,copy,exportpng,exporteps,exportsvg,exportpdf,edit,animate,grid,z_disk,new,load,bi_trans,intersection,fixedsegment,vector,quadric,image3,z_func,tracker,objecttracker,locus,bi_function_u,function,equationxy,z_test,bi_t_align,bi_t_para,bi_t_perp,bi_t_equi,bi_t_app,bi_t_conf,z_ctrl,ctrl_edit,ctrl_slider,ctrl_popup,ctrl_chkbox,ctrl_txtfield,ctrl_button,z_grid,z_hist,z_back,z_size,z_prec"; + + public RestrictItems(ZirkelCanvas zc) { + ZC=zc; + } + + public boolean isRestricted() { + return (hiddenItems.size()>0); + } + + public boolean isHidden(String s) { + for (int i=0; i get() { + return hiddenItems; + } + + public void set(String items) { + hiddenItems=new ArrayList(Arrays.asList(items.split(","))); + } + + public void set(ArrayList items) { + hiddenItems.clear(); + for (int i=0; i0) { + hiddenItems=new ArrayList(Arrays.asList(standardRestrictedHiddenItems.split(","))); + } + } + + public void initRestrictedHiddenItems() { + if (hiddenItems.size()==0) { + String items=Global.getParameter("standardRestrictedHiddenItems", standardRestrictedHiddenItems); + if ("".equals(items)) { + hiddenItems=new ArrayList(); + } else { + hiddenItems=new ArrayList(Arrays.asList(items.split(","))); + } + } + } + + public void setStandardRestrictedItems() { + if (hiddenItems.size()>0) { + Global.setParameter("standardRestrictedHiddenItems", getHiddenItems()); + } + } + + public String getHiddenItems() { + // join hiddenItems ArrayList in a string with comma separator. + // A shame there is no such a method in java ! + String items=hiddenItems.toString(); + items=items.replace(" ", ""); + items=items.replace("[", ""); + items=items.replace("]", ""); + return items; + } + + public void printArgs(final XmlWriter xml) { + if (hiddenItems.size()>0) { + xml.startTagStart("RestrictedSession"); + xml.printArg("HiddenIcons", getHiddenItems()); + xml.finishTagNewLine(); + } + } + + /************************************************************ + * Initialisation of static parameters from PaletteManager : + * **********************************************************/ + public static void init_disk_icns(String icns[]) { + disk_icns=icns; + } + + public static void init_edit_icns(String icns[]) { + edit_icns=icns; + } + + public static void init_geom_icns(String icns[]) { + geom_icns=icns; + } + + public static void init_func_icns(String icns[]) { + func_icns=icns; + } + + public static void init_test_icns(String icns[]) { + test_icns=icns; + } + + public static void init_control_icns(String icns[]) { + control_icns=icns; + } + + public static void init_grid_icns(String icns[]) { + grid_icns=icns; + } + + public static void init_history_icns(String icns[]) { + history_icns=icns; + } + + public static void init_back_icns(String icns[]) { + back_icns=icns; + } + + public static void init_size_icns(String icns[]) { + size_icns=icns; + } + + public static void init_prec_icns(String icns[]) { + prec_icns=icns; + } + /******************** + * End Initialisation + * ******************/ +} diff --git a/eric/restrict/RestrictNonPalettePreference.java b/eric/restrict/RestrictNonPalettePreference.java new file mode 100644 index 0000000..0e8c453 --- /dev/null +++ b/eric/restrict/RestrictNonPalettePreference.java @@ -0,0 +1,44 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.restrict; + +import eric.GUI.palette.PaletteManager; +import eric.GUI.window.MenuBar; +import eric.JZirkelCanvas; +import rene.zirkel.ZirkelCanvas; + +/** + * + * @author erichake + */ +public class RestrictNonPalettePreference extends RestrictPanelLine { + + String name; + + public RestrictNonPalettePreference(String nme, String label) { + super(label); + name=nme; + initState(); + } + + public void initState() { + ZirkelCanvas zc=JZirkelCanvas.getCurrentZC(); + if (zc!=null) { + setSelected(!zc.isHiddenItem(name)); + } + } + + public void action() { + ZirkelCanvas zc=JZirkelCanvas.getCurrentZC(); + if (zc!=null) { + if (isSelected()) { + zc.removeHiddenItem(name); + } else { + zc.addHiddenItem(name); + } + } + PaletteManager.init(); + } +} diff --git a/eric/restrict/RestrictPanel.java b/eric/restrict/RestrictPanel.java new file mode 100644 index 0000000..9ca2c8c --- /dev/null +++ b/eric/restrict/RestrictPanel.java @@ -0,0 +1,222 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package eric.restrict; + +import eric.GUI.palette.PaletteManager; +import java.util.ArrayList; +import javax.swing.BorderFactory; +import javax.swing.BoxLayout; +import eric.JEricPanel; +import javax.swing.JSeparator; +import rene.gui.Global; + +/** + * + * @author erichake + */ +public class RestrictPanel extends JEricPanel{ + private static int W=400,H=1200,MARGINH=20,SMALLMARGINH=10; + private ArrayList iconslines=new ArrayList(); + + private RestrictNonPalettePreference menu,macr,hist,help,lib_macros; + +public RestrictPanel(){ + setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); + setBorder(BorderFactory.createEmptyBorder()); + setOpaque(false); + PaletteManager.fixsize(this, W,H ); + + add(marginH(MARGINH)); + add(new RestrictPanelActiveLine(this, Global.Loc("restrict.activate"))); + add(marginH(MARGINH)); + add(new RestrictSeparator(SMALLMARGINH)); + add(new RestrictPanelComment()); + + + init_Disk_zone(); + init_Edit_zone(); + init_Construction_zone(); + init_Func_zone(); + init_Test_zone(); + init_Control_zone(); + init_Aspect_zone(); + init_Grid_zone(); + init_History_zone(); + init_Back_zone(); + init_Size_zone(); + init_Prec_zone(); + add(marginH(MARGINH)); + add(new RestrictSeparator(SMALLMARGINH)); + add(marginH(MARGINH)); + add(menu=new RestrictNonPalettePreference(RestrictItems.MENU,Global.Loc("restrict.menubar"))); + add(marginH(MARGINH)); + add(macr=new RestrictNonPalettePreference(RestrictItems.MCRP,Global.Loc("restrict.macropanel"))); + add(marginH(MARGINH)); + add(hist=new RestrictNonPalettePreference(RestrictItems.HISTP,Global.Loc("restrict.historypanel"))); + add(marginH(MARGINH)); + add(help=new RestrictNonPalettePreference(RestrictItems.HLPP,Global.Loc("restrict.helppanel"))); + add(marginH(MARGINH)); + add(lib_macros=new RestrictNonPalettePreference(RestrictItems.LMCR, Global.Loc("restrict.librarymacros"))); +} + +public static int getPanelWidth(){ + return W; +} + +public void setSelectAll(boolean b){ + for (int i=0;i

"+Global.Loc("restrict.comment")+"
"); + setFont(new Font(Global.GlobalFont,0,12)); + setForeground(Color.darkGray); + PaletteManager.fixsize(this, RestrictContainer.getContainerWidth(), 60); + setHorizontalTextPosition(SwingUtilities.CENTER); + setHorizontalAlignment(SwingUtilities.CENTER); + setVerticalAlignment(SwingUtilities.CENTER); + } +} diff --git a/eric/restrict/RestrictPanelFlowIcons.java b/eric/restrict/RestrictPanelFlowIcons.java new file mode 100644 index 0000000..466fe29 --- /dev/null +++ b/eric/restrict/RestrictPanelFlowIcons.java @@ -0,0 +1,55 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package eric.restrict; + +import eric.GUI.palette.PaletteManager; +import eric.GUI.themes; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Graphics; +import java.awt.Graphics2D; +import javax.swing.BorderFactory; +import eric.JEricPanel; + +/** + * + * @author erichake + */ +public class RestrictPanelFlowIcons extends JEricPanel { + + public RestrictPanelFlowIcons() { + setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0)); +// setBorder(BorderFactory.createEmptyBorder()); +// setOpaque(false); + setBackground(new Color(218,228,242)); + setBorder(BorderFactory.createEtchedBorder()); + setAlignmentX(0.0f); + setAlignmentY(0.0f); + } + + public void addIcons(RestrictPanelIconsLineTitle title,String[] icns) { + for (int i=0; i icons=new ArrayList(); + + public RestrictPanelIconsLineTitle(String nme, String label) { + super(label); + name=nme; + addMouseListener(new MouseAdapter() { + + @Override + public void mouseClicked(MouseEvent e) { + setSelectedIcons(isSelected()); + } + }); + initState(); + } + + public void initState() { + ZirkelCanvas zc=JZirkelCanvas.getCurrentZC(); + if (zc!=null) { + setSelected(!zc.isHiddenItem(name)); + if (!isSelected()) { + setSelectedIcons(false); + } + } + } + + public void initIconsState() { + for (int i=0; i. + + */ + + + package eric.textfieldpopup; + +import javax.swing.JButton; +import javax.swing.JComponent; +import eric.JEricPanel; +import javax.swing.JPopupMenu; +import javax.swing.JSeparator; +import javax.swing.text.JTextComponent; + +/** + * + * @author erichake + */ +public class JFunctionsPanel extends JMenuPanel { + + /** + * + */ + private static final long serialVersionUID = 1L; + int Linemax = 3; + String funcs = "&& || ! < > <= >= == ~= $ " + + "x() y() d(,) if(,,) a(,,) inside(,) $ " + + "sqrt() exp() log() round() ceil() floor() abs() sign() random() min(,) max(,) $ " + + "sin() cos() tan() rsin() rcos() rtan() " + + "arcsin() arccos() arctan() rarcsin() rarccos() rarctan() " + + "deg() rad() sinhyp() coshyp() angle180() angle360() " + + "Argsinh() Argcosh() Argtanh() tanhyp() atan2(,) ratan2(,) $ " + + "integrate(,,) zero(,,) diff(,) min(,,) max(,,) length() $ " + + "windoww windowh windowcx windowcy pixel $ " + + "div(,) mod(,) gcd(,) lcm(,)"; + + public JFunctionsPanel(final JPopupMenu men, final JComponent jtf) { + super(men); + JTF = jtf; + iconwidth = 75; + iconheight = 20; + final String[] f = funcs.split(" "); + JEricPanel line = null; + int j = 0; + for (final String element : f) { + if ((j % Linemax) == 0) { + add(line = getnewline()); + } + if (element.equals("$")) { + add(new JSeparator()); + j = 0; + } else { + line.add(getJButton(element)); + j++; + } + } + } + + @Override + public void doAction(final JButton mybtn) { + final String s = mybtn.getText(); + mybtn.setOpaque(false); + mybtn.setContentAreaFilled(false); + if (JTF != null) { + final JTextComponent jt = (JTextComponent) JTF; + if ((s.endsWith(")")) && (jt.getSelectedText() != null)) { + String mytxt = jt.getText() + .substring(0, jt.getSelectionStart()); + mytxt += s.substring(0, s.length() - 1); + mytxt += jt.getSelectedText() + ")"; + final int car = mytxt.length(); + mytxt += jt.getText().substring(jt.getSelectionEnd()); + jt.setText(mytxt); + jt.setCaretPosition(car); + } else { + String mytxt = jt.getText() + .substring(0, jt.getSelectionStart()); + mytxt += (s.endsWith(")")) ? s.substring(0, s.length() - 1) : s; + final int car = mytxt.length(); + mytxt += jt.getText().substring(jt.getSelectionEnd()); + jt.setText(mytxt); + jt.setCaretPosition(car); + + } + MEN.setVisible(false); + } + } +} diff --git a/eric/textfieldpopup/JMenuPanel.java b/eric/textfieldpopup/JMenuPanel.java new file mode 100644 index 0000000..aa4e42e --- /dev/null +++ b/eric/textfieldpopup/JMenuPanel.java @@ -0,0 +1,152 @@ +/* + +Copyright 2006 Eric Hakenholz + +This file is part of C.a.R. software. + + C.a.R. is a free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 3 of the License. + + C.a.R. is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + */ + + + package eric.textfieldpopup; + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; + +import javax.swing.BorderFactory; +import javax.swing.BoxLayout; +import javax.swing.JButton; +import javax.swing.JComponent; +import eric.JEricPanel; +import javax.swing.JPopupMenu; +import javax.swing.text.JTextComponent; + +import rene.gui.Global; + +/** + * + * @author erichake + */ +public class JMenuPanel extends JEricPanel implements MouseListener { + /** + * + */ + private static final long serialVersionUID = 1L; + JPopupMenu MEN = null; + int iconwidth = 20; + int iconheight = 20; + JComponent JTF; + + public JMenuPanel(final JPopupMenu men) { + MEN = men; + setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); + setAlignmentY(0f); + setOpaque(true); + setFocusable(false); + setBackground(new Color(250, 250, 250)); + } + + static void fixsize(final JComponent cp, final int w, final int h) { + final Dimension d = new Dimension(w, h); + cp.setMaximumSize(d); + cp.setMinimumSize(d); + cp.setPreferredSize(d); + cp.setSize(d); + } + + public JButton getJButton(final String s) { + final JButton mybtn = new JButton(s); + mybtn.setBorder(BorderFactory.createEmptyBorder()); + mybtn.setBorderPainted(false); + mybtn.setFocusPainted(false); + mybtn.setFocusable(false); + mybtn.setBackground(new Color(228, 222, 255)); + mybtn.setOpaque(false); + mybtn.setContentAreaFilled(false); + mybtn.addMouseListener(this); + mybtn.setFont(new java.awt.Font(Global.GlobalFont, 1, 11)); + mybtn.setForeground(new Color(20, 20, 20)); + fixsize(mybtn, iconwidth, iconheight); + return mybtn; + } + + JEricPanel getnewline() { + final JEricPanel line = new JEricPanel(); + line.setLayout(new BoxLayout(line, BoxLayout.X_AXIS)); + line.setAlignmentX(0f); + line.setOpaque(false); + return line; + } + + JEricPanel getnewcol() { + final JEricPanel col = new JEricPanel(); + col.setLayout(new BoxLayout(col, BoxLayout.Y_AXIS)); + col.setAlignmentY(0f); + col.setOpaque(true); + col.setBackground(new Color(250, 250, 250)); + return col; + } + + public void doAction(final JButton mybtn) { + final String s = mybtn.getText(); + + mybtn.setOpaque(false); + mybtn.setContentAreaFilled(false); + if (JTF != null) { + final JTextComponent jt = (JTextComponent) JTF; + String mytxt = jt.getText().substring(0, jt.getSelectionStart()); + mytxt += s; + final int car = mytxt.length(); + mytxt += jt.getText().substring(jt.getSelectionEnd()); + jt.setText(mytxt); + jt.setCaretPosition(car); + MEN.setVisible(false); + } + } + + public void mouseClicked(final MouseEvent e) { + final JButton mybtn = (JButton) e.getComponent(); + doAction(mybtn); + } + + public void mousePressed(final MouseEvent e) { + + } + + public void mouseReleased(final MouseEvent e) { + + } + + public void mouseEntered(final MouseEvent e) { + if (e.getSource() != null) { + final JButton btn = (JButton) e.getSource(); + btn.setBackground(new Color(171, 191, 231)); + btn.setOpaque(true); + btn.setContentAreaFilled(true); + } + + } + + public void mouseExited(final MouseEvent e) { + if (e.getSource() != null) { + final JButton btn = (JButton) e.getSource(); + btn.setOpaque(false); + btn.setContentAreaFilled(false); + } + + } + +} diff --git a/eric/textfieldpopup/JSpecialCarsPanel.java b/eric/textfieldpopup/JSpecialCarsPanel.java new file mode 100644 index 0000000..be59ac4 --- /dev/null +++ b/eric/textfieldpopup/JSpecialCarsPanel.java @@ -0,0 +1,66 @@ +/* + +Copyright 2006 Eric Hakenholz + +This file is part of C.a.R. software. + + C.a.R. is a free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 3 of the License. + + C.a.R. is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + */ + + + package eric.textfieldpopup; + +import javax.swing.JComponent; +import eric.JEricPanel; +import javax.swing.JPopupMenu; +import javax.swing.JSeparator; + +/** + * + * @author erichake + */ +public class JSpecialCarsPanel extends JMenuPanel { + /** + * + */ + private static final long serialVersionUID = 1L; + + int Linemax = 10; + + private final String greekmajLettersSet = "\u0391\u0392\u0393\u0394\u0395\u0396" + + "\u0397\u0398\u0399\u039A\u039B\u039C\u039D\u039E\u039F\u03A0\u03A1\u03A3" + + "\u03A4\u03A5\u03A6\u03A7\u03A8\u03A9"; + private final String greekminLettersSet = "\u03B1\u03B2\u03B3\u03B4\u03B5\u03B6\u03B7\u03B8\u03B9" + + "\u03BA\u03BB\u03BC\u03BD\u03BE\u03BF\u03C0\u03C1\u03C3\u03C4\u03C5\u03C6" + + "\u03C7\u03C8\u03C9"; + + public JSpecialCarsPanel(final JPopupMenu men, final JComponent jtf) { + super(men); + JTF = jtf; + JEricPanel line = null; + for (int i = 0; i < greekminLettersSet.length(); i++) { + if ((i % Linemax) == 0) { + add(line = getnewline()); + } + line.add(getJButton(greekminLettersSet.substring(i, i + 1))); + } + add(new JSeparator()); + for (int i = 0; i < greekmajLettersSet.length(); i++) { + if ((i % Linemax) == 0) { + add(line = getnewline()); + } + line.add(getJButton(greekmajLettersSet.substring(i, i + 1))); + } + } +} diff --git a/eric/textfieldpopup/JTexPanel.java b/eric/textfieldpopup/JTexPanel.java new file mode 100644 index 0000000..dc02316 --- /dev/null +++ b/eric/textfieldpopup/JTexPanel.java @@ -0,0 +1,145 @@ +/* + +Copyright 2006 Eric Hakenholz + +This file is part of C.a.R. software. + + C.a.R. is a free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 3 of the License. + + C.a.R. is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + */ + + + package eric.textfieldpopup; + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import javax.swing.BorderFactory; +import javax.swing.JButton; +import javax.swing.JComponent; +import eric.JEricPanel; +import javax.swing.JPopupMenu; +import javax.swing.text.JTextComponent; + +import atp.sHotEqn; +import java.awt.Graphics2D; +import rene.gui.Global; + +/** + * + * @author erichake + */ +public class JTexPanel extends JMenuPanel { + + /** + * + */ + private static final long serialVersionUID = 1L; + int Linemax = 4; + String funcs = "\\frac{a}{b} \\sqrt{a} \\sqrt[n]{a} \\vec{u} \\widehat{ABC} \\hat{a} a_1 a^2 " + + "\\sum_{i=0}^{n} \\prod_{i=0}^{n} \\int_{a}^{b} \\oint_{a}^{b} \\bar{z} \\fbox{box}"; + + // +"\\left|\\begin{array}{cc}a_{11}&a_{12}\\\\\\\\a_{21}&a_{22}\\end{array}\\right| " + // + + // "\\left(\\begin{array}{cc}a_{11}&a_{12}\\\\\\\\a_{21}&a_{22}\\end{array}\\right) "; + + public JTexPanel(final JPopupMenu men, final JComponent jtf) { + super(men); + JTF = jtf; + iconwidth = 50; + iconheight = 50; + final String[] f = funcs.split(" "); + JEricPanel line = null; + for (int i = 0; i < f.length; i++) { + if ((i % Linemax) == 0) { + add(line = getnewline()); + } + line.add(getJButton(f[i])); + } + } + + @Override + public void doAction(final JButton mybtn) { + String s = ((myJButton) mybtn).EQ; + final JTextComponent jt = (JTextComponent) JTF; + mybtn.setOpaque(false); + mybtn.setContentAreaFilled(false); + String mytxt = jt.getText().substring(0, jt.getSelectionStart()); + final int nbDollars = mytxt.split("\\$").length - 1; + if (nbDollars % 2 == 0) { + s = "$" + s + "$"; + } + if (jt.getSelectedText() != null) { + final Pattern p = Pattern.compile("\\{([^\\}]*)\\}", + Pattern.CASE_INSENSITIVE); + final Matcher m = p.matcher(s); + if (m.find()) { + s = m.replaceFirst("{" + jt.getSelectedText() + "}"); + } + } + mytxt += s; + final int car = mytxt.length(); + mytxt += jt.getText().substring(jt.getSelectionEnd()); + jt.setText(mytxt); + jt.setCaretPosition(car); + MEN.setVisible(false); + + } + + @Override + public JButton getJButton(final String s) { + final myJButton mybtn = new myJButton(s); + mybtn.setBorder(BorderFactory.createEmptyBorder()); + mybtn.setBorderPainted(false); + mybtn.setFocusPainted(false); + mybtn.setFocusable(false); + mybtn.setBackground(new Color(228, 222, 255)); + mybtn.setOpaque(false); + mybtn.setContentAreaFilled(false); + mybtn.addMouseListener(this); + mybtn.setFont(new java.awt.Font(Global.GlobalFont, 1, 14)); + mybtn.setForeground(new Color(20, 20, 20)); + fixsize(mybtn, iconwidth, iconheight); + return mybtn; + } + + class myJButton extends JButton { + /** + * + */ + private static final long serialVersionUID = 1L; + String EQ = null; + sHotEqn HE = null; + + @Override + public void paintComponent(final Graphics g) { + super.paintComponent(g); + Graphics2D g2d=(Graphics2D) g; + final Dimension d = this.getSize(); + final Dimension eq = HE.getSizeof(EQ, g2d); + HE.paint((d.width - eq.width) / 2, (d.height - eq.height) / 2, g2d); + } + + public myJButton(final String s) { + super(); + EQ = s; + HE = new sHotEqn(this); + HE.setHAlign("center"); + HE.setEquation(s); + + } + } +} diff --git a/eric/textfieldpopup/JTextFieldPopup.java b/eric/textfieldpopup/JTextFieldPopup.java new file mode 100644 index 0000000..7bc618a --- /dev/null +++ b/eric/textfieldpopup/JTextFieldPopup.java @@ -0,0 +1,90 @@ +/* + +Copyright 2006 Eric Hakenholz + +This file is part of C.a.R. software. + + C.a.R. is a free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 3 of the License. + + C.a.R. is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + */ + + + package eric.textfieldpopup; + +import java.awt.event.MouseEvent; + +import javax.swing.JComponent; +import javax.swing.JMenu; +import javax.swing.JPopupMenu; + +import rene.gui.Global; + +/** + * + * @author erichake + */ +public class JTextFieldPopup extends JPopupMenu { + + /** + * + */ + private static final long serialVersionUID = 1L; + JComponent JTF; + // Numéro du menu : + static public int SPECIALCARMENU = 0, FUNCTIONMENU = 1, LATEXMENU = 2; + myJMenuItem m1, m2, m3; + + public JTextFieldPopup(final JComponent jtf) { + JTF = jtf; + this.setFocusable(false); + + m1 = new myJMenuItem(Global.Loc("props.popup.special"), + new JSpecialCarsPanel(this, JTF)); + m2 = new myJMenuItem(Global.Loc("props.popup.functions"), + new JFunctionsPanel(this, JTF)); + m3 = new myJMenuItem(Global.Loc("props.popup.latex"), new JTexPanel( + this, JTF)); + this.add(m1); + this.add(m2); + this.add(m3); + } + + public void setDisabled(final String dis) { + if (dis.contains("," + SPECIALCARMENU + ",")) + this.getComponent(SPECIALCARMENU).setEnabled(false); + if (dis.contains("," + FUNCTIONMENU + ",")) + this.getComponent(FUNCTIONMENU).setEnabled(false); + if (dis.contains("," + LATEXMENU + ",")) + this.getComponent(LATEXMENU).setEnabled(false); + } + + public void openMenu(final MouseEvent e) { + this.show(e.getComponent(), e.getX(), e.getY()); + } + + class myJMenuItem extends JMenu { + /** + * + */ + private static final long serialVersionUID = 1L; + JPopupMenu jp; + + public myJMenuItem(final String name, final JMenuPanel jmp) { + super(name); + this.setFocusable(false); + this.add(jmp); + } + + } + +} diff --git a/java.policy.applet b/java.policy.applet new file mode 100644 index 0000000..35527af --- /dev/null +++ b/java.policy.applet @@ -0,0 +1,7 @@ +/* AUTOMATICALLY GENERATED ON Tue Apr 16 17:20:59 EDT 2002*/ +/* DO NOT EDIT */ + +grant { + permission java.security.AllPermission; +}; + diff --git a/makejar-source.jardesc b/makejar-source.jardesc new file mode 100644 index 0000000..862777d --- /dev/null +++ b/makejar-source.jardesc @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/net/java/dev/colorchooser/Bundle.properties b/net/java/dev/colorchooser/Bundle.properties new file mode 100644 index 0000000..d51379c --- /dev/null +++ b/net/java/dev/colorchooser/Bundle.properties @@ -0,0 +1,337 @@ +# Sun Public License Notice +# +# The contents of this file are subject to the Sun Public License +# Version 1.0 (the "License"). You may not use this file except in +# compliance with the License. A copy of the License is available at +# http://www.sun.com/ +# +# The Original Code is NetBeans. The Initial Developer of the Original +# Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun +# Microsystems, Inc. All Rights Reserved. + +#Palette names +basic=Primary colors +svg=SVG/X11 color constants +swing=Swing constants +system=System colors +recent=Recent colors +tip=Click and hold combinations of Ctrl/Shift/Alt to switch palettes +tip.mac=Click and hold combinations of Command/Shift/Alt to switch palettes + +#SVG/X11 Color constants +# 240,248,255 +aliceblue=Alice blue +# 250,235,215 +antiquewhite=Antique white +# 0,255,255 +aqua=Aqua +# 127,255,212 +aquamarine=Aquamarine +# 240,255,255 +azure=Azure +# 245,245,220 +beige=Beige +# 255,228,196 +bisque=Bisque +# 0,0,0 +black=Black +# 255,235,205 +blanchedalmond=Blanched almond +# 0,0,255 +blue=Blue +# 138,43,226 +blueviolet=Blue violet +# 165,42,42 +brown=Brown +# 222,184,135 +burlywood=Burly wood +# 95,158,160 +cadetblue=Cadet blue +# 127,255,0 +chartreuse=Chartreuse +# 210,105,30 +chocolate=Chocolate +# 255,127,80 +coral=Coral +# 100,149,237 +cornflowerblue=Cornflower blue +# 255,248,220 +cornsilk=Corn silk +# 220,20,60 +crimson=Crimson +# 0,255,255 +cyan=Cyan +# 0,0,139 +darkblue=Dark blue +# 0,139,139 +darkcyan=Dark cyan +# 184,134,11 +darkgoldenrod=Dark goldenrod +# 169,169,169 +darkgray=Dark gray +# 0,100,0 +darkgreen=Dark green +# 169,169,169 +darkgrey=Dark grey +# 189,183,107 +darkkhaki=Dark khaki +# 139,0,139 +darkmagenta=Dark magenta +# 85,107,47 +darkolivegreen=Dark olive green +# 255,140,0 +darkorange=Dark orange +# 153,50,204 +darkorchid=Dark orchid +# 139,0,0 +darkred=Dark red +# 233,150,122 +darksalmon=Dark salmon +# 143,188,143 +darkseagreen=Dark sea green +# 72,61,139 +darkslateblue=Dark slate blue +# 47,79,79 +darkslategray=Dark slate gray +# 47,79,79 +darkslategrey=Dark slate grey +# 0,206,209 +darkturquoise=Dark turquoise +# 148,0,211 +darkviolet=Dark violet +# 255,20,147 +deeppink=Deep pink +# 0,191,255 +deepskyblue=Deep sky blue +# 105,105,105 +dimgray=Dim gray +# 105,105,105 +dimgrey=Dim grey +# 30,144,255 +dodgerblue=Dodger blue +# 178,34,34 +firebrick=Fire brick +# 255,250,240 +floralwhite=Floral white +# 34,139,34 +forestgreen=Forest green +# 255,0,255 +fuchsia=Fuchsia +# 220,220,220 +gainsboro=Gainsboro +# 248,248,255 +ghostwhite=Ghost white +# 255,215,0 +gold=Gold +# 218,165,32 +goldenrod=Goldenrod +# 128,128,128 +gray=Gray +# 128,128,128 +grey=Grey +# 0,128,0 +green=Green +# 173,255,47 +greenyellow=Green yellow +# 240,255,240 +honeydew=Honeydew +# 255,105,180 +hotpink=Hot pink +# 205,92,92 +indianred=Indian red +# 75,0,130 +indigo=Indigo +# 255,255,240 +ivory=Ivory +# 240,230,140 +khaki=Khaki +# 230,230,250 +lavender=Lavender +# 255,240,245 +lavenderblush=Lavender blush +# 124,252,0 +lawngreen=Lawn green +# 255,250,205 +lemonchiffon=Lemon chiffon +# 173,216,230 +lightblue=Light blue +# 240,128,128 +lightcoral=Light coral +# 224,255,255 +lightcyan=Light cyan +# 250,250,210 +lightgoldenrodyellow=Light goldenrod yellow +# 211,211,211 +lightgray=Light gray +# 144,238,144 +lightgreen=Light green +# 211,211,211 +lightgrey=Light grey +# 255,182,193 +lightpink=Light pink +# 255,160,122 +lightsalmon=Light salmon +# 32,178,170 +lightseagreen=Light sea green +# 135,206,250 +lightskyblue=Light sky blue +# 119,136,153 +lightslategray=Light slate gray +# 119,136,153 +lightslategrey=Light slate grey +# 176,196,222 +lightsteelblue=Light steel blue +# 255,255,224 +lightyellow=Light yellow +# 0,255,0 +lime=Lime +# 50,205,50 +limegreen=Lime green +# 250,240,230 +linen=Linen +# 255,0,255 +magenta=Magenta +# 128,0,0 +maroon=Maroon +# 102,205,170 +mediumaquamarine=Medium aquamarine +# 0,0,205 +mediumblue=Medium blue +# 186,85,211 +mediumorchid=Medium orchid +# 147,112,219 +mediumpurple=Medium purple +# 60,179,113 +mediumseagreen=Medium sea green +# 123,104,238 +mediumslateblue=Medium slate blue +# 0,250,154 +mediumspringgreen=Medium spring green +# 72,209,204 +mediumturquoise=Medium turquoise +# 199,21,133 +mediumvioletred=Medium violet red +# 25,25,112 +midnightblue=Midnight blue +# 245,255,250 +mintcream=Mint cream +# 255,228,225 +mistyrose=Misty rose +# 255,228,181 +moccasin=Moccasin +# 255,222,173 +navajowhite=Navajo white +# 0,0,128 +navy=Navy +# 253,245,230 +oldlace=Old lace +# 128,128,0 +olive=Olive +# 107,142,35 +olivedrab=Olivedrab +# 255,165,0 +orange=Orange +# 255,69,0 +orangered=Orange red +# 218,112,214 +orchid=Orchid +# 238,232,170 +palegoldenrod=Pale goldenrod +# 152,251,152 +palegreen=Pale green +# 175,238,238 +paleturquoise=Pale turquoise +# 219,112,147 +palevioletred=Pale violet red +# 255,239,213 +papayawhip=Papaya whip +# 255,218,185 +peachpuff=Peach puff +# 205,133,63 +peru=Peru +# 255,192,203 +pink=Pink +# 221,160,221 +plum=Plum +# 176,224,230 +powderblue=Powder blue +# 128,0,128 +purple=Purple +# 255,0,0 +red=Red +# 188,143,143 +rosybrown=Rosy brown +# 65,105,225 +royalblue=Royal blue +# 139,69,19 +saddlebrown=Saddle brown +# 250,128,114 +salmon=Salmon +# 244,164,96 +sandybrown=Sandy brown +# 46,139,87 +seagreen=Sea green +# 255,245,238 +seashell=Seashell +# 160,82,45 +sienna=Sienna +# 192,192,192 +silver=Silver +# 135,206,235 +skyblue=Sky blue +# 106,90,205 +slateblue=Slate blue +# 112,128,144 +slategray=Slate gray +# 112,128,144 +slategrey=Slate grey +# 255,250,250 +snow=Snow +# 0,255,127 +springgreen=Spring green +# 70,130,180 +steelblue=Steel blue +# 210,180,140 +tan=Tan +# 0,128,128 +teal=Teal +# 216,191,216 +thistle=Thistle +# 255,99,71 +tomato=Tomato +# 64,224,208 +turquoise=Turquoise +# 238,130,238 +violet=Violet +# 245,222,179 +wheat=Wheat +# 255,255,255 +white=White +# 245,245,245 +whitesmoke=White smoke +# 255,255,0 +yellow=Yellow +# 154,205,50 +yellowgreen=Yellow green + + +# Continuous palette names +satSmall=Saturated colors +#SMALL_SPEC_WIDTH, SMALL_SPEC_HEIGHT, 1f, false), +unsatSmall=Desaturated colors +#SMALL_SPEC_WIDTH, SMALL_SPEC_HEIGHT, 0.4f, false), +satSmallHoriz=Saturated colors +#SMALL_SPEC_WIDTH, SMALL_SPEC_HEIGHT, 1f, true), +unsatSmallHoriz=Desaturated colors +#SMALL_SPEC_WIDTH, SMALL_SPEC_HEIGHT, 0.4f, true), +satLarge=Saturated colors +#LARGE_SPEC_WIDTH, LARGE_SPEC_HEIGHT, 1f, false), +unsatLarge=Desaturated colors +#LARGE_SPEC_WIDTH, LARGE_SPEC_HEIGHT, 0.4f, false), +satLargeHoriz=Saturated colors +#LARGE_SPEC_WIDTH, LARGE_SPEC_HEIGHT, 1f, true), +unsatLargeHoriz=Desaturated colors +#LARGE_SPEC_WIDTH, LARGE_SPEC_HEIGHT, 0.4f, true) + +chooseColor="Choose a Color" + diff --git a/net/java/dev/colorchooser/Bundle_en_US.properties b/net/java/dev/colorchooser/Bundle_en_US.properties new file mode 100644 index 0000000..ede7ced --- /dev/null +++ b/net/java/dev/colorchooser/Bundle_en_US.properties @@ -0,0 +1,333 @@ +# Sun Public License Notice +# +# The contents of this file are subject to the Sun Public License +# Version 1.0 (the "License"). You may not use this file except in +# compliance with the License. A copy of the License is available at +# http://www.sun.com/ +# +# The Original Code is NetBeans. The Initial Developer of the Original +# Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun +# Microsystems, Inc. All Rights Reserved. + +#Palette names +basic=Primary colors +svg=SVG/X11 color constants +swing=Swing constants +system=System colors +recent=Recent colors + +#SVG/X11 Color constants +# 240,248,255 +aliceblue=Alice blue +# 250,235,215 +antiquewhite=Antique white +# 0,255,255 +aqua=Aqua +# 127,255,212 +aquamarine=Aquamarine +# 240,255,255 +azure=Azure +# 245,245,220 +beige=Beige +# 255,228,196 +bisque=Bisque +# 0,0,0 +black=Black +# 255,235,205 +blanchedalmond=Blanched almond +# 0,0,255 +blue=Blue +# 138,43,226 +blueviolet=Blue violet +# 165,42,42 +brown=Brown +# 222,184,135 +burlywood=Burly wood +# 95,158,160 +cadetblue=Cadet blue +# 127,255,0 +chartreuse=Chartreuse +# 210,105,30 +chocolate=Chocolate +# 255,127,80 +coral=Coral +# 100,149,237 +cornflowerblue=Cornflower blue +# 255,248,220 +cornsilk=Corn silk +# 220,20,60 +crimson=Crimson +# 0,255,255 +cyan=Cyan +# 0,0,139 +darkblue=Dark blue +# 0,139,139 +darkcyan=Dark cyan +# 184,134,11 +darkgoldenrod=Dark goldenrod +# 169,169,169 +darkgray=Dark gray +# 0,100,0 +darkgreen=Dark green +# 169,169,169 +darkgrey=Dark grey +# 189,183,107 +darkkhaki=Dark khaki +# 139,0,139 +darkmagenta=Dark magenta +# 85,107,47 +darkolivegreen=Dark olive green +# 255,140,0 +darkorange=Dark orange +# 153,50,204 +darkorchid=Dark orchid +# 139,0,0 +darkred=Dark red +# 233,150,122 +darksalmon=Dark salmon +# 143,188,143 +darkseagreen=Dark sea green +# 72,61,139 +darkslateblue=Dark slate blue +# 47,79,79 +darkslategray=Dark slate gray +# 47,79,79 +darkslategrey=Dark slate grey +# 0,206,209 +darkturquoise=Dark turquoise +# 148,0,211 +darkviolet=Dark violet +# 255,20,147 +deeppink=Deep pink +# 0,191,255 +deepskyblue=Deep sky blue +# 105,105,105 +dimgray=Dim gray +# 105,105,105 +dimgrey=Dim grey +# 30,144,255 +dodgerblue=Dodger blue +# 178,34,34 +firebrick=Fire brick +# 255,250,240 +floralwhite=Floral white +# 34,139,34 +forestgreen=Forest green +# 255,0,255 +fuchsia=Fuchsia +# 220,220,220 +gainsboro=Gainsboro +# 248,248,255 +ghostwhite=Ghost white +# 255,215,0 +gold=Gold +# 218,165,32 +goldenrod=Goldenrod +# 128,128,128 +gray=Gray +# 128,128,128 +grey=Grey +# 0,128,0 +green=Green +# 173,255,47 +greenyellow=Green yellow +# 240,255,240 +honeydew=Honeydew +# 255,105,180 +hotpink=Hot pink +# 205,92,92 +indianred=Indian red +# 75,0,130 +indigo=Indigo +# 255,255,240 +ivory=Ivory +# 240,230,140 +khaki=Khaki +# 230,230,250 +lavender=Lavender +# 255,240,245 +lavenderblush=Lavender blush +# 124,252,0 +lawngreen=Lawn green +# 255,250,205 +lemonchiffon=Lemon chiffon +# 173,216,230 +lightblue=Light blue +# 240,128,128 +lightcoral=Light coral +# 224,255,255 +lightcyan=Light cyan +# 250,250,210 +lightgoldenrodyellow=Light goldenrod yellow +# 211,211,211 +lightgray=Light gray +# 144,238,144 +lightgreen=Light green +# 211,211,211 +lightgrey=Light grey +# 255,182,193 +lightpink=Light pink +# 255,160,122 +lightsalmon=Light salmon +# 32,178,170 +lightseagreen=Light sea green +# 135,206,250 +lightskyblue=Light sky blue +# 119,136,153 +lightslategray=Light slate gray +# 119,136,153 +lightslategrey=Light slate grey +# 176,196,222 +lightsteelblue=Light steel blue +# 255,255,224 +lightyellow=Light yellow +# 0,255,0 +lime=Lime +# 50,205,50 +limegreen=Lime green +# 250,240,230 +linen=Linen +# 255,0,255 +magenta=Magenta +# 128,0,0 +maroon=Maroon +# 102,205,170 +mediumaquamarine=Medium aquamarine +# 0,0,205 +mediumblue=Medium blue +# 186,85,211 +mediumorchid=Medium orchid +# 147,112,219 +mediumpurple=Medium purple +# 60,179,113 +mediumseagreen=Medium sea green +# 123,104,238 +mediumslateblue=Medium slate blue +# 0,250,154 +mediumspringgreen=Medium spring green +# 72,209,204 +mediumturquoise=Medium turquoise +# 199,21,133 +mediumvioletred=Medium violet red +# 25,25,112 +midnightblue=Midnight blue +# 245,255,250 +mintcream=Mint cream +# 255,228,225 +mistyrose=Misty rose +# 255,228,181 +moccasin=Moccasin +# 255,222,173 +navajowhite=Navajo white +# 0,0,128 +navy=Navy +# 253,245,230 +oldlace=Old lace +# 128,128,0 +olive=Olive +# 107,142,35 +olivedrab=Olivedrab +# 255,165,0 +orange=Orange +# 255,69,0 +orangered=Orange red +# 218,112,214 +orchid=Orchid +# 238,232,170 +palegoldenrod=Pale goldenrod +# 152,251,152 +palegreen=Pale green +# 175,238,238 +paleturquoise=Pale turquoise +# 219,112,147 +palevioletred=Pale violet red +# 255,239,213 +papayawhip=Papaya whip +# 255,218,185 +peachpuff=Peach puff +# 205,133,63 +peru=Peru +# 255,192,203 +pink=Pink +# 221,160,221 +plum=Plum +# 176,224,230 +powderblue=Powder blue +# 128,0,128 +purple=Purple +# 255,0,0 +red=Red +# 188,143,143 +rosybrown=Rosy brown +# 65,105,225 +royalblue=Royal blue +# 139,69,19 +saddlebrown=Saddle brown +# 250,128,114 +salmon=Salmon +# 244,164,96 +sandybrown=Sandy brown +# 46,139,87 +seagreen=Sea green +# 255,245,238 +seashell=Seashell +# 160,82,45 +sienna=Sienna +# 192,192,192 +silver=Silver +# 135,206,235 +skyblue=Sky blue +# 106,90,205 +slateblue=Slate blue +# 112,128,144 +slategray=Slate gray +# 112,128,144 +slategrey=Slate grey +# 255,250,250 +snow=Snow +# 0,255,127 +springgreen=Spring green +# 70,130,180 +steelblue=Steel blue +# 210,180,140 +tan=Tan +# 0,128,128 +teal=Teal +# 216,191,216 +thistle=Thistle +# 255,99,71 +tomato=Tomato +# 64,224,208 +turquoise=Turquoise +# 238,130,238 +violet=Violet +# 245,222,179 +wheat=Wheat +# 255,255,255 +white=White +# 245,245,245 +whitesmoke=White smoke +# 255,255,0 +yellow=Yellow +# 154,205,50 +yellowgreen=Yellow green + + +# Continuous palette names +satSmall=Saturated colors +#SMALL_SPEC_WIDTH, SMALL_SPEC_HEIGHT, 1f, false), +unsatSmall=Desaturated colors +#SMALL_SPEC_WIDTH, SMALL_SPEC_HEIGHT, 0.4f, false), +satSmallHoriz=Saturated colors +#SMALL_SPEC_WIDTH, SMALL_SPEC_HEIGHT, 1f, true), +unsatSmallHoriz=Desaturated colors +#SMALL_SPEC_WIDTH, SMALL_SPEC_HEIGHT, 0.4f, true), +satLarge=Saturated colors - large +#LARGE_SPEC_WIDTH, LARGE_SPEC_HEIGHT, 1f, false), +unsatLarge=Desaturated colors - large +#LARGE_SPEC_WIDTH, LARGE_SPEC_HEIGHT, 0.4f, false), +satLargeHoriz=Saturated colors - large +#LARGE_SPEC_WIDTH, LARGE_SPEC_HEIGHT, 1f, true), +unsatLargeHoriz=Desaturated colors - large +#LARGE_SPEC_WIDTH, LARGE_SPEC_HEIGHT, 0.4f, true) + diff --git a/net/java/dev/colorchooser/Bundle_fr.properties b/net/java/dev/colorchooser/Bundle_fr.properties new file mode 100644 index 0000000..bf49b26 --- /dev/null +++ b/net/java/dev/colorchooser/Bundle_fr.properties @@ -0,0 +1,42 @@ +# Sun Public License Notice +# +# The contents of this file are subject to the Sun Public License +# Version 1.0 (the "License"). You may not use this file except in +# compliance with the License. A copy of the License is available at +# http://www.sun.com/ +# +# The Original Code is NetBeans. The Initial Developer of the Original +# Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun +# Microsystems, Inc. All Rights Reserved. + +#Palette names +basic=Primary colors +svg=Constantes SVG/X11 +swing=Constantes +system=System colors +recent=Recent colors +tip=Click and hold combinations of Ctrl/Shift/Alt to switch palettes +tip.mac=Click and hold combinations of Command/Shift/Alt to switch palettes + + + +# Continuous palette names +satSmall=Couleurs satur\u00E9es +#SMALL_SPEC_WIDTH, SMALL_SPEC_HEIGHT, 1f, false), +unsatSmall=Couleurs d\u00E9satur\u00E9es +#SMALL_SPEC_WIDTH, SMALL_SPEC_HEIGHT, 0.4f, false), +satSmallHoriz=Couleurs satur\u00E9es +#SMALL_SPEC_WIDTH, SMALL_SPEC_HEIGHT, 1f, true), +unsatSmallHoriz=Couleurs d\u00E9satur\u00E9es +#SMALL_SPEC_WIDTH, SMALL_SPEC_HEIGHT, 0.4f, true), +satLarge=Couleurs satur\u00E9es +#LARGE_SPEC_WIDTH, LARGE_SPEC_HEIGHT, 1f, false), +unsatLarge=Couleurs d\u00E9satur\u00E9es +#LARGE_SPEC_WIDTH, LARGE_SPEC_HEIGHT, 0.4f, false), +satLargeHoriz=Couleurs satur\u00E9es +#LARGE_SPEC_WIDTH, LARGE_SPEC_HEIGHT, 1f, true), +unsatLargeHoriz=Couleurs d\u00E9satur\u00E9es +#LARGE_SPEC_WIDTH, LARGE_SPEC_HEIGHT, 0.4f, true) + +chooseColor="Choisir une couleur" + diff --git a/net/java/dev/colorchooser/CCBorder.java b/net/java/dev/colorchooser/CCBorder.java new file mode 100644 index 0000000..e09b64c --- /dev/null +++ b/net/java/dev/colorchooser/CCBorder.java @@ -0,0 +1,112 @@ +/*DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 2006-2008. Tim Boudreau. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. This particular file is designated + * as subject to the "Classpath" exception as provided + * in the GPL Version 2 section of the License file that + * accompanied this code. + */ + +package net.java.dev.colorchooser; + +import java.awt.Color; +import java.awt.Component; +import java.awt.Graphics; +import java.awt.Insets; + +import javax.swing.UIManager; +import javax.swing.border.Border; +import javax.swing.plaf.metal.MetalLookAndFeel; + +/** + * Default border for the color chooser, which uses bevels that lighten/darken + * the selected color, and includes slightly different painting logic for Metal + * LAF. + * + * @author Tim Boudreau + */ +class CCBorder implements Border { + public Insets getBorderInsets(final Component c) { + Insets result; + if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { + result = new Insets(2, 2, 1, 1); + } else { + result = new Insets(1, 1, 1, 1); + } + return result; + } + + public boolean isBorderOpaque() { + return true; + } + + public void paintBorder(final Component c, final Graphics g, final int x, + final int y, final int w, final int h) { + final ColorChooser cc = (ColorChooser) c; + + if (!cc.isEnabled()) { + g.setColor(cc.getColor()); + g.fillRect(x, y, w, h); + return; + } + Color col = cc.transientColor() == null ? cc.getColor() : cc + .transientColor(); + + if (cc == null) { + col = c.getBackground(); + if (col == null) { + col = Color.BLACK; + } + } + if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel) { + g.setColor(darken(col)); + g.drawLine(x, y, x + w - 1, y); + g.drawLine(x, y, x, y + h - 1); + g.drawLine(x + w - 1, y + h - 1, x, y + h - 1); + g.drawLine(x + w - 1, y + h - 1, x + w - 1, y); + g.setColor(brighten(col)); + g.drawLine(x + w - 2, y + h - 2, x + 1, y + h - 2); + g.drawLine(x + w - 2, y + h - 2, x + w - 2, y + 1); + } else { + g.setColor(darken(col)); + g.drawLine(x + w - 1, y + h - 1, x, y + h - 1); + g.drawLine(x + w - 1, y + h - 1, x + w - 1, y); + g.setColor(brighten(col)); + g.drawLine(x, y, x + w - 1, y); + g.drawLine(x, y, x, y + h - 1); + } + } + + /** Slightly more subtle than Color.darker() */ + private static final Color darken(final Color c) { + final int amount = 30; + final int r = normalizeToByte(c.getRed() - amount); + final int g = normalizeToByte(c.getGreen() - amount); + final int b = normalizeToByte(c.getGreen() - amount); + return new Color(r, g, b); + } + + /** Slightly more subtle than Color.brighter() */ + private static final Color brighten(final Color c) { + final int amount = 30; + final int r = normalizeToByte(c.getRed() + amount); + final int g = normalizeToByte(c.getGreen() + amount); + final int b = normalizeToByte(c.getGreen() + amount); + return new Color(r, g, b); + } + + /** Ensure an int is within the possible range for a byte */ + private static final int normalizeToByte(final int i) { + return Math.min(255, Math.max(0, i)); + } +} \ No newline at end of file diff --git a/net/java/dev/colorchooser/CDDL_GPLv2_licence.txt b/net/java/dev/colorchooser/CDDL_GPLv2_licence.txt new file mode 100644 index 0000000..2a64dfb --- /dev/null +++ b/net/java/dev/colorchooser/CDDL_GPLv2_licence.txt @@ -0,0 +1,156 @@ +******************************************************* +* Colorchooser Dual License Header and License Notice * +******************************************************* + + + + + +Colorchooser is dual licensed with Common Development and Distribution License (CDDL) and the GNU General Public License (GPL) with Classpath exception. + + + + +******************************************************* +COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 + +1. Definitions. +1.1. ÒContributorÓ means each individual or entity that creates or contributes to the creation of Modifications. +1.2. ÒContributor VersionÓ means the combination of the Original Software, prior Modifications used by a Contributor (if any), and the Modifications made by that particular Contributor. +1.3. ÒCovered SoftwareÓ means (a) the Original Software, or (b) Modifications, or (c) the combination of files containing Original Software with files containing Modifications, in each case including portions thereof. +1.4. ÒExecutableÓ means the Covered Software in any form other than Source Code. +1.5. ÒInitial DeveloperÓ means the individual or entity that first makes Original Software available under this License. +1.6. ÒLarger WorkÓ means a work which combines Covered Software or portions thereof with code not governed by the terms of this License. +1.7. ÒLicenseÓ means this document. +1.8. ÒLicensableÓ means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein. +1.9 ÒModificationsÓ means the Source Code and Executable form of any of the following: +A. Any file that results from an addition to, deletion from or modification of the contents of a file containing Original Software or previous Modifications; +B. Any new file that contains any part of the Original Software or previous Modification; or +C. Any new file that is contributed or otherwise made available under the terms of this License. +1.10. ÒOriginal SoftwareÓ means the Source Code and Executable form of computer software code that is originally released under this License. +1.11. ÒPatent ClaimsÓ means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor. +1.12. ÒSource CodeÓ means (a) the common form of computer software code in which modifications are made and (b) associated documentation included in or with such code. +1.13. ÒYouÓ (or ÒYourÓ) means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, ÒYouÓ includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, ÒcontrolÓ means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. +2. License Grants. +2.1. The Initial Developer Grant. +Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, the Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license: +(a) under intellectual property rights (other than patent or trademark) Licensable by Initial Developer, to use, reproduce, modify, display, perform, sublicense and distribute the Original Software (or portions thereof), with or without Modifications, and/or as part of a Larger Work; and +(b) under Patent Claims infringed by the making, using or selling of Original Software, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Software (or portions thereof). +(c) The licenses granted in Sections 2.1(a) and (b) are effective on the date Initial Developer first distributes or otherwise makes the Original Software available to a third party under the terms of this License. +(d) Notwithstanding Section 2.1(b) above, no patent license is granted: (1) for code that You delete from the Original Software, or (2) for infringements caused by: (i) the modification of the Original Software, or (ii) the combination of the Original Software with other software or devices. +2.2. Contributor Grant. +Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license: +(a) under intellectual property rights (other than patent or trademark) Licensable by Contributor to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof), either on an unmodified basis, with other Modifications, as Covered Software and/or as part of a Larger Work; and +(b) under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: (1) Modifications made by that Contributor (or portions thereof); and (2) the combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination). +(c) The licenses granted in Sections 2.2(a) and 2.2(b) are effective on the date Contributor first distributes or otherwise makes the Modifications available to a third party. +(d) Notwithstanding Section 2.2(b) above, no patent license is granted: (1) for any code that Contributor has deleted from the Contributor Version; (2) for infringements caused by: (i) third party modifications of Contributor Version, or (ii) the combination of Modifications made by that Contributor with other software (except as part of the Contributor Version) or other devices; or (3) under Patent Claims infringed by Covered Software in the absence of Modifications made by that Contributor. +3. Distribution Obligations. +3.1. Availability of Source Code. +Any Covered Software that You distribute or otherwise make available in Executable form must also be made available in Source Code form and that Source Code form must be distributed only under the terms of this License. You must include a copy of this License with every copy of the Source Code form of the Covered Software You distribute or otherwise make available. You must inform recipients of any such Covered Software in Executable form as to how they can obtain such Covered Software in Source Code form in a reasonable manner on or through a medium customarily used for software exchange. +3.2. Modifications. +The Modifications that You create or to which You contribute are governed by the terms of this License. You represent that You believe Your Modifications are Your original creation(s) and/or You have sufficient rights to grant the rights conveyed by this License. +3.3. Required Notices. +You must include a notice in each of Your Modifications that identifies You as the Contributor of the Modification. You may not remove or alter any copyright, patent or trademark notices contained within the Covered Software, or any notices of licensing or any descriptive text giving attribution to any Contributor or the Initial Developer. +3.4. Application of Additional Terms. +You may not offer or impose any terms on any Covered Software in Source Code form that alters or restricts the applicable version of this License or the recipientsÕ rights hereunder. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, you may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear that any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer. +3.5. Distribution of Executable Versions. +You may distribute the Executable form of the Covered Software under the terms of this License or under the terms of a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable form does not attempt to limit or alter the recipientÕs rights in the Source Code form from the rights set forth in this License. If You distribute the Covered Software in Executable form under a different license, You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer. +3.6. Larger Works. +You may create a Larger Work by combining Covered Software with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Software. +4. Versions of the License. +4.1. New Versions. +Sun Microsystems, Inc. is the initial license steward and may publish revised and/or new versions of this License from time to time. Each version will be given a distinguishing version number. Except as provided in Section 4.3, no one other than the license steward has the right to modify this License. +4.2. Effect of New Versions. +You may always continue to use, distribute or otherwise make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. If the Initial Developer includes a notice in the Original Software prohibiting it from being distributed or otherwise made available under any subsequent version of the License, You must distribute and make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. Otherwise, You may also choose to use, distribute or otherwise make the Covered Software available under the terms of any subsequent version of the License published by the license steward. +4.3. Modified Versions. +When You are an Initial Developer and You want to create a new license for Your Original Software, You may create and use a modified version of this License if You: (a) rename the license and remove any references to the name of the license steward (except to note that the license differs from this License); and (b) otherwise make it clear that the license contains terms which differ from this License. +5. DISCLAIMER OF WARRANTY. +COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN ÒAS ISÓ BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. +6. TERMINATION. +6.1. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive. +6.2. If You assert a patent infringement claim (excluding declaratory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You assert such claim is referred to as ÒParticipantÓ) alleging that the Participant Software (meaning the Contributor Version where the Participant is a Contributor or the Original Software where the Participant is the Initial Developer) directly or indirectly infringes any patent, then any and all rights granted directly or indirectly to You by such Participant, the Initial Developer (if the Initial Developer is not the Participant) and all Contributors under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively and automatically at the expiration of such 60 day notice period, unless if within such 60 day period You withdraw Your claim with respect to the Participant Software against such Participant either unilaterally or pursuant to a written agreement with Participant. +6.3. In the event of termination under Sections 6.1 or 6.2 above, all end user licenses that have been validly granted by You or any distributor hereunder prior to termination (excluding licenses granted to You by any distributor) shall survive termination. +7. LIMITATION OF LIABILITY. +UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTYÕS NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. +8. U.S. GOVERNMENT END USERS. +The Covered Software is a Òcommercial item,Ó as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of Òcommercial computer softwareÓ (as that term is defined at 48 C.F.R. ¤252.227-7014(a)(1)) and Òcommercial computer software documentationÓ as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Software with only those rights set forth herein. This U.S. Government Rights clause is in lieu of, and supersedes, any other FAR, DFAR, or other clause or provision that addresses Government rights in computer software under this License. +9. MISCELLANEOUS. +This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by the law of the jurisdiction specified in a notice contained within the Original Software (except to the extent applicable law, if any, provides otherwise), excluding such jurisdictionÕs conflict-of-law provisions. Any litigation relating to this License shall be subject to the jurisdiction of the courts located in the jurisdiction and venue specified in a notice contained within the Original Software, with the losing party responsible for costs, including, without limitation, court costs and reasonable attorneysÕ fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License. You agree that You alone are responsible for compliance with the United States export administration regulations (and the export control laws and regulation of any other countries) when You use, distribute or otherwise make available any Covered Software. +10. RESPONSIBILITY FOR CLAIMS. +As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability. +NOTICE PURSUANT TO SECTION 9 OF THE COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) +The code released under the CDDL shall be governed by the laws of the State of California (excluding conflict-of-law provisions). Any litigation relating to this License shall be subject to the jurisdiction of the Federal Courts of the Northern District of California and the state courts of the State of California, with venue lying in Santa Clara County, California. + + + + +******************************************************* +The GNU General Public License (GPL) Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. +Preamble +The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. +When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. +To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. +For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. +We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. +Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. +Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. +The precise terms and conditions for copying, distribution and modification follow. +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION +0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". +Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. +1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. +You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. +2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: +a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. +b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. +c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) +These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. +Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. +In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. +3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: +a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, +b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, +c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) +The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. +If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. +4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. +5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. +6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. +7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. +If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. +It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. +This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. +8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. +9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. +Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. +10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. +NO WARRANTY +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. +END OF TERMS AND CONDITIONS +How to Apply These Terms to Your New Programs +If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. +To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. +One line to give the program's name and a brief idea of what it does. +Copyright (C) +This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +Also add information on how to contact you by electronic and paper mail. +If the program is interactive, make it output a short notice like this when it starts in an interactive mode: +Gnomovision version 69, Copyright (C) year name of author +Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. +The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. +You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: +Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. +signature of Ty Coon, 1 April 1989 +Ty Coon, President of Vice +This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. +"CLASSPATH" EXCEPTION TO THE GPL VERSION 2 +Certain source files distributed by Sun Microsystems, Inc. are subject to the following clarification and special exception to the GPL Version 2, but only where Sun has expressly included in the particular source file's header the words: +"Sun designates this particular file as subject to the "Classpath" exception as provided by Sun in the License file that accompanied this code." +Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License Version 2 cover the whole combination. +As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. \ No newline at end of file diff --git a/net/java/dev/colorchooser/ColorChooser.java b/net/java/dev/colorchooser/ColorChooser.java new file mode 100644 index 0000000..620a333 --- /dev/null +++ b/net/java/dev/colorchooser/ColorChooser.java @@ -0,0 +1,398 @@ +/*DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 2006-2008. Tim Boudreau. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. This particular file is designated + * as subject to the "Classpath" exception as provided + * in the GPL Version 2 section of the License file that + * accompanied this code. + */ +package net.java.dev.colorchooser; + +import java.awt.Color; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.util.ArrayList; +import java.util.List; +import java.util.MissingResourceException; +import java.util.ResourceBundle; + +import javax.swing.JComponent; +import javax.swing.UIManager; + +/** + * A color chooser which can pop up a pluggable set of palettes. The palette + * displayed is controlled by combinations of the alt and shift and ctrl + * (command on macintosh) keys. Will fire an action event when a color is + * selected. For accessibility, it will show a standard Swing color chooser if + * focused and either space or enter are pressed. + *

+ * By default, supports two sets of palettes - a set of 4 continuous palettes + * and a set of 4 tiled, fixed palettes (the SVG/X palette, Swing/AWT palettes + * and a history of recently selected colors). Whether the tiled or continuous + * palettes are given precedence depends on the property + * continuousPalettePreferred. + *

+ * Palettes are pluggable, so it is possible to provide your own + * implementation(s) of Palette to be displayed when the component is clicked. + *

+ * Typical usage: Attach an ActionListener; it will be notified when the user + * selects a color. + *

+ * To catch colors as the user selects, listen for PROP_TRANSIENT_COLOR. The + * component will fire changes in PROP_COLOR along with actin events, when the + * user selects a color. PROP_COLOR changes are fired both in response to use + * actions and programmatic changes to the color property. + *

+ * + * @author Tim Boudreau + */ +public class ColorChooser extends JComponent { + + /** + * + */ + private static final long serialVersionUID=1L; + /** + * UI Class ID under which the UI delegate class is stored in UIManager (see + * UIManager.getUI()). The string value is + * "nbColorChooserUI" + */ + public static final String UI_CLASS_ID="nbColorChooserUI"; // NOI18N + private transient Palette[] palettes=null; + private Color color=Color.BLUE; + private transient Color transientColor=null; + private transient ArrayList actionListenerList; + /** + * Property name for property fired when the color property changes. + */ + public static final String PROP_COLOR="color"; // NOI18N + /** + * Property name for property fired when the transient color property (the + * color while the user is selecting) changes. + */ + public static final String PROP_TRANSIENT_COLOR="transientColor"; // NOI18N + /** + * Fired when the value of the continuous palette changes. + */ + public static final String PROP_CONTINUOUS_PALETTE="continuousPalette"; // NOI18N + /** + * Property indicating the visibility of the popup palette. Code that tracks + * PROP_TRANSIENT_COLOR can listen for this property with a value of false + * to do a final update using the value from getColor() to ensure the set + * color is in sync with the actual value of the color picker - in the case + * that the mouse was released off the palette, the color may be restored to + * its previous value. + */ + public static final String PROP_PICKER_VISIBLE="pickerVisible"; + private boolean continuousPalette=true; + + /** Create a color chooser */ + public ColorChooser() { + this((Color) null); + } + + /** + * Create a color chooser initialized to the passed color, defaulted to show + * a continuous palette on initial click. + * + * @param initialColor + */ + public ColorChooser(final Color initialColor) { + this(null, initialColor); + } + + /** + * Create a color chooser with the passed array of 8 palettes and + * initialized with the passed color. + * + * @param palettes + * @param initialColor + */ + public ColorChooser(final Palette[] palettes, final Color initialColor) { + setPalettes(palettes); + if (initialColor!=null) { + color=initialColor; + } + updateUI(); + } + + /** + * Create a color chooser with the passed array of 8 or fewer palettes. + * + * @param palettes + */ + public ColorChooser(final Palette[] palettes) { + this(palettes, null); + } + + /** + * Overridden to return UI_CLASS_ID + * + * @return + */ + public String getUIClassId() { + return UI_CLASS_ID; + } + + /** + * + */ + @Override + public void updateUI() { + if (UIManager.get(UI_CLASS_ID)!=null) { + setUI((ColorChooserUI) UIManager.getUI(this)); + } else { + setUI(DefaultColorChooserUI.createUI(this)); + } + } + + /** + * Get the color currently represented by this component. If the user is in + * the process of selecting (the palette or color chooser is open), this + * will be the last known value, until such time as the user selects a color + * and an action event is fired. + * + * @return + */ + public Color getColor() { + return color; + } + + /** + * Set the color this color chooser currently represents. Note this will + * fire a change in PROP_COLOR but will not trigger an action + * event to be fired. + * + * @param c + */ + public void setColor(Color c) { + if (c.getClass()!=Color.class) { + c=new Color(c.getRed(), c.getGreen(), c.getBlue()); + } + if ((color!=null&&!color.equals(c))||(color==null&&c!=null)) { + final Color old=color; + color=c; + repaint(); + firePropertyChange(PROP_COLOR, old, c); // NOI18N + } + } + + void setTransientColor(final Color c) { + final Color old=transientColor; + transientColor=c; + if ((c!=null&&!color.equals(old))||(old==null&&c!=null)) { + firePropertyChange(PROP_TRANSIENT_COLOR, old, getTransientColor()); + repaint(); + } else if (c==null) { + firePropertyChange(PROP_TRANSIENT_COLOR, old, getColor()); + repaint(); + } + } + + /** + * Returns the currently displayed color which may not be the same as the + * value of getColor() but is the color currently displayed as + * the user moves the mouse to select the color. + * + * @see #PROP_TRANSIENT_COLOR + * @see #setTransientColor + * @return the color currently being displayed (not necessarily the one + * returned by getColor()). + */ + public Color getTransientColor() { + return transientColor==null?null:new Color(transientColor.getRed(), transientColor.getGreen(), transientColor.getBlue()); + } + + /** + * Get a string representation of a color, if possible returning a named, + * localized constant if the passed color matches one of the SVG constants; + * else returning a String representing RGB values. + * + * @param c + * @return + */ + public static String colorToString(final Color c) { + RecentColors.getDefault(); + final NamedColor named=RecentColors.findNamedColor(c); + if (named==null) { + final StringBuffer sb=new StringBuffer(); + sb.append(c.getRed()); + sb.append(','); + sb.append(c.getGreen()); + sb.append(','); + sb.append(c.getBlue()); + return sb.toString(); + } else { + return named.getDisplayName(); + } + } + + Color transientColor() { + return transientColor; + } + + /** + * Returns the SVG or Swing constant name for the passed color, if the color + * exactly matches a color in the Swing UIManager constants or the + * SVG/X-Windows constants. + * + * @param color + * @return + */ + public static String getColorName(final Color color) { + return PredefinedPalette.getColorName(color); + } + + /** + * Set whether the initial palette shown when clicked with no keys pressed + * is one showing a continuous (rainbow) palette or a set of tiles with + * different colors. + * + * @param val + * The value, true to show a continuous palette by default + */ + public void setContinuousPalettePreferred(final boolean val) { + if (val!=continuousPalette) { + continuousPalette=val; + setPalettes(null); + firePropertyChange(PROP_CONTINUOUS_PALETTE, !val, val); + } + } + + /** + * Determine whether the initial palette shown when clicked with no keys + * pressed is one showing a continuous (rainbow) palette or a set of tiles + * with different colors. The default is TRUE. + * + * @return whether or not to default to a continuous palette + */ + public boolean isContinuousPalettePreferred() { + return continuousPalette; + } + + /** + * Set the Palette objects this color chooser will display. Can be null to + * reset to defaults. The passed array length must less than or equal to 8. + *

+ * Which palette is shown to the user depends on what if any control keys + * are being held when the user initially clicks or presses while dragging + * the mouse to select. The mapping between key combinations and palette + * entries is: + *

    + *
  • No keys held: 0
  • + *
  • Shift: 1
  • + *
  • Ctrl (Command on macintosh): 2
  • + *
  • Shift-Ctrl(Command): 3
  • + *
  • Alt: 4
  • + *
  • Alt-Shift: 5
  • + *
  • Alt-Ctrl(Command): 6
  • + *
  • Alt-Ctrl(Command)-Shift: 7
  • + *
+ * + * @param palettes + */ + public void setPalettes(Palette[] palettes) { + if (palettes!=null&&palettes.length>8) { + throw new IllegalArgumentException("Must be <= 8 palettes"); // NOI18N + } + final Palette[] old=this.palettes; + if (palettes==null) { + palettes=Palette.getDefaultPalettes(continuousPalette); + } + this.palettes=palettes; + firePropertyChange("palettes", old, palettes.clone()); // NOI18N + } + + /** + * Get the array of palettes that will be displayed when the user clicks + * this color chooser component and holds down various keys. + * + * @return + */ + public Palette[] getPalettes() { + final Palette[] result=new Palette[palettes.length]; + System.arraycopy(palettes, 0, result, 0, palettes.length); + return result; + } + + static String getString(final String key) { + if (key==null) { + return null; + } + final String BUNDLE="net.java.dev.colorchooser.Bundle"; // NOI18N + try { + return ResourceBundle.getBundle(BUNDLE).getString(key); + } catch (final MissingResourceException mre) { + // mre.printStackTrace(); + return key; + } + } + + // ****************** Action listener support ************************** + /** + * Registers ActionListener to receive events. Action events are fired when + * the user selects a color, either by click-drag-releasing the mouse over + * the popup palette, or by pressing space or enter and selecting a color + * from the popup JColorChooser. + * + * @param listener + * The listener to register. + */ + public synchronized void addActionListener( + final java.awt.event.ActionListener listener) { + if (actionListenerList==null) { + actionListenerList=new ArrayList(); + } + actionListenerList.add(listener); + } + + /** + * Removes ActionListener from the list of listeners. Action events are + * fired when the user selects a color, either by click-drag-releasing the + * mouse over the popup palette, or by pressing space or enter and selecting + * a color from the popup JColorChooser (note they are + * not fired if you call setColor()). + * + * @param listener + * The listener to remove. + */ + public synchronized void removeActionListener( + final java.awt.event.ActionListener listener) { + if (actionListenerList!=null) { + actionListenerList.remove(listener); + } + } + + /** + * Notifies all registered listeners about the event. + * + * @param event + * The event to be fired + */ + void fireActionPerformed(final ActionEvent event) { + List list; + synchronized (this) { + if (actionListenerList==null) { + return; + } + list=(List) ((ArrayList) actionListenerList).clone(); + } + for (int i=0; iBeanDescriptors. + * + * @return BeanDescriptor describing the editable properties of this bean. + * May return null if the information should be obtained by + * automatic analysis. + */ + @Override + public BeanDescriptor getBeanDescriptor() { + return getBdescriptor(); + } + + /** + * Gets the bean's PropertyDescriptors. + * + * @return An array of PropertyDescriptors describing the editable + * properties supported by this bean. May return null if the + * information should be obtained by automatic analysis. + *

+ * If a property is indexed, then its entry in the result array will + * belong to the IndexedPropertyDescriptor subclass of + * PropertyDescriptor. A client of getPropertyDescriptors can use + * "instanceof" to check if a given PropertyDescriptor is an + * IndexedPropertyDescriptor. + */ + @Override + public PropertyDescriptor[] getPropertyDescriptors() { + return getPdescriptor(); + } + + /** + * Gets the bean's EventSetDescriptors. + * + * @return An array of EventSetDescriptors describing the kinds of events + * fired by this bean. May return null if the information should be + * obtained by automatic analysis. + */ + @Override + public EventSetDescriptor[] getEventSetDescriptors() { + return getEdescriptor(); + } + + /** + * Gets the bean's MethodDescriptors. + * + * @return An array of MethodDescriptors describing the methods implemented + * by this bean. May return null if the information should be + * obtained by automatic analysis. + */ + @Override + public MethodDescriptor[] getMethodDescriptors() { + return getMdescriptor(); + } + + /** + * A bean may have a "default" property that is the property that will + * mostly commonly be initially chosen for update by human's who are + * customizing the bean. + * + * @return Index of default property in the PropertyDescriptor array + * returned by getPropertyDescriptors. + *

+ * Returns -1 if there is no default property. + */ + @Override + public int getDefaultPropertyIndex() { + return defaultPropertyIndex; + } + + /** + * A bean may have a "default" event that is the event that will mostly + * commonly be used by human's when using the bean. + * + * @return Index of default event in the EventSetDescriptor array returned + * by getEventSetDescriptors. + *

+ * Returns -1 if there is no default event. + */ + @Override + public int getDefaultEventIndex() { + return defaultEventIndex; + } + + /** + * This method returns an image object that can be used to represent the + * bean in toolboxes, toolbars, etc. Icon images will typically be GIFs, but + * may in future include other formats. + *

+ * Beans aren't required to provide icons and may return null from this + * method. + *

+ * There are four possible flavors of icons (16x16 color, 32x32 color, 16x16 + * mono, 32x32 mono). If a bean choses to only support a single icon we + * recommend supporting 16x16 color. + *

+ * We recommend that icons have a "transparent" background so they can be + * rendered onto an existing background. + * + * @param iconKind + * The kind of icon requested. This should be one of the constant + * values ICON_COLOR_16x16, ICON_COLOR_32x32, ICON_MONO_16x16, or + * ICON_MONO_32x32. + * @return An image object representing the requested icon. May return null + * if no suitable icon is available. + */ + @Override + public java.awt.Image getIcon(final int iconKind) { + switch (iconKind) { + case ICON_COLOR_16x16: + if (iconNameC16 == null) + return null; + else { + if (iconColor16 == null) + iconColor16 = loadImage(iconNameC16); + return iconColor16; + } + case ICON_COLOR_32x32: + if (iconNameC32 == null) + return null; + else { + if (iconColor32 == null) + iconColor32 = loadImage(iconNameC32); + return iconColor32; + } + case ICON_MONO_16x16: + if (iconNameM16 == null) + return null; + else { + if (iconMono16 == null) + iconMono16 = loadImage(iconNameM16); + return iconMono16; + } + case ICON_MONO_32x32: + if (iconNameM32 == null) + return null; + else { + if (iconMono32 == null) + iconMono32 = loadImage(iconNameM32); + return iconMono32; + } + default: + return null; + } + } + +} diff --git a/net/java/dev/colorchooser/ColorChooserUI.java b/net/java/dev/colorchooser/ColorChooserUI.java new file mode 100644 index 0000000..cded542 --- /dev/null +++ b/net/java/dev/colorchooser/ColorChooserUI.java @@ -0,0 +1,366 @@ +/*DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 2006-2008. Tim Boudreau. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. This particular file is designated + * as subject to the "Classpath" exception as provided + * in the GPL Version 2 section of the License file that + * accompanied this code. + */ + +package net.java.dev.colorchooser; + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Event; +import java.awt.Point; +import java.awt.Toolkit; +import java.awt.event.ActionEvent; +import java.awt.event.FocusEvent; +import java.awt.event.FocusListener; +import java.awt.event.InputEvent; +import java.awt.event.KeyEvent; +import java.awt.event.KeyListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +import javax.swing.JColorChooser; +import javax.swing.JComponent; +import javax.swing.plaf.ComponentUI; + +/** + * Parent class of UI delegates for color choosers. This class handles popping + * up palettes and selection/setting transient color and firing events. + * Generally, subclasses will simply want to override the painting logic. + *

+ * To completely override all behavior, override installListeners() + * and uninstallListeners() and do not have them call super. + * + * @author Tim Boudreau + */ +public abstract class ColorChooserUI extends ComponentUI { + /** Creates a new instance of ColorChooserUI */ + protected ColorChooserUI() { + } + + @Override + public final void installUI(final JComponent jc) { + installListeners((ColorChooser) jc); + init((ColorChooser) jc); + } + + @Override + public final void uninstallUI(final JComponent jc) { + uninstallListeners((ColorChooser) jc); + uninit((ColorChooser) jc); + } + + /** Optional initialization method called from installUI() */ + protected void init(final ColorChooser c) { + + } + + /** Optional initialization method called from uninstallUI() */ + protected void uninit(final ColorChooser c) { + + } + + /** Begin listening for mouse events on the passed component */ + protected void installListeners(final ColorChooser c) { + final L l = new L(); + c.addMouseListener(l); + c.addFocusListener(l); + c.addKeyListener(l); + c.putClientProperty("uiListener", l); // NOI18N + } + + /** Stop listening for mouse events on the passed component */ + protected void uninstallListeners(final ColorChooser c) { + final Object o = c.getClientProperty("uiListener"); // NOI18N + if (o instanceof L) { + final L l = (L) o; + c.removeMouseListener(l); + c.removeFocusListener(l); + c.removeKeyListener(l); + } + } + + /** Running on macintosh? */ + static final boolean MAC = System.getProperty("mrj.version") // NOI18N + != null; + + /** + * + * Map a key event to an integer used to index into the array of available + * palettes, used to change which palette is displayed on the fly. Note this + * method reads the key code, not the modifiers, of the key event. + *

+ * If you override this method, also override + * paletteIndexFromModifiers. + *

+ * The palette actually used is as follows: + *

    + *
  • No keys held: 0
  • + *
  • Shift: 1
  • + *
  • Ctrl (Command on macintosh): 2
  • + *
  • Shift-Ctrl(Command): 3
  • + *
  • Alt: 4
  • + *
  • Alt-Shift: 5
  • + *
  • Alt-Ctrl(Command): 6
  • + *
  • Alt-Ctrl(Command)-Shift: 7
  • + *
+ */ + protected int paletteIndexFromKeyCode(final KeyEvent ke) { + final int keyCode = ke.getKeyCode(); + int result = (keyCode == KeyEvent.VK_SHIFT) ? 1 : 0; + if (MAC) { + result += (keyCode == KeyEvent.VK_META) ? 2 : 0; + } else { + result += (keyCode == KeyEvent.VK_CONTROL) ? 2 : 0; + } + result += (keyCode == KeyEvent.VK_ALT) ? 4 : 0; + return result; + } + + /** + * + * Map the modifiers on an input event to an integer used to index into the + * array of available palettes, used to change which palette is displayed on + * the fly. Note this method uses the value of from the event's + * getModifiersEx() method. + *

+ * If you override this method, also override + * paletteIndexFromKeyCode. + *

+ * The palette actually used is as follows: + *

    + *
  • No keys held: 0
  • + *
  • Shift: 1
  • + *
  • Ctrl (Command on macintosh): 2
  • + *
  • Shift-Ctrl(Command): 3
  • + *
  • Alt: 4
  • + *
  • Alt-Shift: 5
  • + *
  • Alt-Ctrl(Command): 6
  • + *
  • Alt-Ctrl(Command)-Shift: 7
  • + *
+ */ + protected int paletteIndexFromModifiers(final InputEvent me) { + final int mods = me.getModifiersEx(); + int result = ((mods & InputEvent.SHIFT_DOWN_MASK) != 0) ? 1 : 0; + result += ((mods & InputEvent.CTRL_DOWN_MASK) != 0) ? 2 : 0; + result += ((mods & InputEvent.ALT_DOWN_MASK) != 0) ? 4 : 0; + return result; + } + + private JColorChooser jchooser = null; + + /** + * Called when the color chooser is invoked from the keyboard (user pressed + * space or enter). + */ + protected void keyboardInvoke(final ColorChooser colorChooser) { + if (!colorChooser.isEnabled()) { + Toolkit.getDefaultToolkit().beep(); + return; + } + if (jchooser == null) { + jchooser = new JColorChooser(); + } else { + return; + } + jchooser.setColor(colorChooser.getColor()); + final Color nue = JColorChooser.showDialog(colorChooser, ColorChooser + .getString("chooseColor"), // NOI18N + colorChooser.getColor()); + + if (nue != null) { + colorChooser.setColor(nue); + fireColorChanged(colorChooser); + } + jchooser = null; + } + + /** + * Cause the passed color chooser to fire an action event to its listeners + * notifying them that the color has changed. + */ + protected void fireColorChanged(final ColorChooser chooser) { + chooser.fireActionPerformed(new ActionEvent(chooser, + ActionEvent.ACTION_PERFORMED, "color")); // NOI18N + } + + @Override + public Dimension getMaximumSize(final JComponent c) { + if (!c.isMaximumSizeSet()) { + return getPreferredSize(c); + } else { + return super.getMaximumSize(c); + } + } + + @Override + public Dimension getMinimumSize(final JComponent c) { + if (!c.isMinimumSizeSet()) { + return getPreferredSize(c); + } else { + return super.getMinimumSize(c); + } + } + + @Override + public Dimension getPreferredSize(final JComponent c) { + if (!c.isPreferredSizeSet()) { + return new Dimension(24, 24); + } else { + return super.getPreferredSize(c); + } + } + + private class L extends MouseAdapter implements FocusListener, KeyListener { + private int paletteIndex = 0; + private transient Point nextFocusPopupLocation = null; + + int getPaletteIndex() { + return paletteIndex; + } + + void initPaletteIndex(final ColorChooser c, final MouseEvent me) { + paletteIndex = paletteIndexFromModifiers(me); + checkRange(c); + } + + private void checkRange(final ColorChooser chooser) { + final Palette[] p = chooser.getPalettes(); + if (paletteIndex >= p.length) { + paletteIndex = p.length - 1; + } + } + + private void updatePaletteIndex(final ColorChooser chooser, + final int value, final boolean pressed) { + final int oldIndex = paletteIndex; + int result = paletteIndex; + if (pressed) { + result |= value; + } else { + result ^= value; + } + if (oldIndex != result + && PalettePopup.getDefault().isPopupVisible(chooser)) { + paletteIndex = result; + checkRange(chooser); + PalettePopup.getDefault().setPalette( + chooser.getPalettes()[paletteIndex]); + } + } + + @Override + public void mousePressed(final MouseEvent me) { + // boolean rightclic=me.isPopupTrigger(); + + final boolean rightclic = (me.getModifiers() == Event.META_MASK); + + final ColorChooser chooser = (ColorChooser) me.getSource(); + if (!chooser.isEnabled()) { + Toolkit.getDefaultToolkit().beep(); + return; + } + // Point p = me.getPoint(); + final Point p = chooser.getLocationOnScreen(); + p.translate(chooser.getWidth(), chooser.getHeight()); + // SwingUtilities.convertPointToScreen(p, chooser); + initPaletteIndex(chooser, me); + + if (rightclic) { + PalettePopup.getDefault().setPalette(chooser.getPalettes()[7]); + + } else { + PalettePopup.getDefault().setPalette( + chooser.getPalettes()[getPaletteIndex()]); + } + + if (chooser.hasFocus()) { + PalettePopup.getDefault().showPopup(chooser, p); + } else { + nextFocusPopupLocation = p; + chooser.requestFocus(); + return; + } + + me.consume(); + nextFocusPopupLocation = null; + } + + @Override + public void mouseReleased(final MouseEvent me) { + // if (me.isPopupTrigger()) return; + final ColorChooser chooser = (ColorChooser) me.getSource(); + if (!chooser.isEnabled()) { + Toolkit.getDefaultToolkit().beep(); + return; + } + nextFocusPopupLocation = null; + if (PalettePopup.getDefault().isPopupVisible(chooser)) { + PalettePopup.getDefault().hidePopup(chooser); + final Color transientColor = chooser.transientColor(); + if (transientColor != null) { + RecentColors.getDefault().add(transientColor); + final Color old = new Color(transientColor.getRed(), + transientColor.getGreen(), transientColor.getBlue()); + chooser.setTransientColor(null); + chooser.setColor(old); + fireColorChanged(chooser); + me.consume(); + } + } + } + + public void focusGained(final FocusEvent e) { + final ColorChooser chooser = (ColorChooser) e.getSource(); + if (nextFocusPopupLocation != null && chooser.isEnabled()) { + PalettePopup.getDefault().showPopup(chooser, + nextFocusPopupLocation); + } + nextFocusPopupLocation = null; + chooser.repaint(); + } + + public void focusLost(final FocusEvent e) { + final ColorChooser chooser = (ColorChooser) e.getSource(); + chooser.repaint(); + } + + public void keyTyped(final KeyEvent e) { + } + + public void keyPressed(final KeyEvent e) { + processKeyEvent(e, true); + } + + public void keyReleased(final KeyEvent e) { + processKeyEvent(e, false); + } + + protected void processKeyEvent(final KeyEvent ke, final boolean pressed) { + final ColorChooser chooser = (ColorChooser) ke.getSource(); + updatePaletteIndex(chooser, paletteIndexFromKeyCode(ke), pressed); + if (ke.getKeyCode() == KeyEvent.VK_ALT + || ke.getKeyCode() == KeyEvent.VK_CONTROL + || ke.getKeyCode() == KeyEvent.VK_SHIFT) { + ke.consume(); + } else if ((ke.getKeyCode() == KeyEvent.VK_SPACE || ke.getKeyCode() == KeyEvent.VK_ENTER) + && ke.getID() == KeyEvent.KEY_RELEASED) { + keyboardInvoke(chooser); + } + } + } +} diff --git a/net/java/dev/colorchooser/ContinuousPalette.java b/net/java/dev/colorchooser/ContinuousPalette.java new file mode 100644 index 0000000..f5844e9 --- /dev/null +++ b/net/java/dev/colorchooser/ContinuousPalette.java @@ -0,0 +1,343 @@ +/*DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 2006-2008. Tim Boudreau. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. This particular file is designated + * as subject to the "Classpath" exception as provided + * in the GPL Version 2 section of the License file that + * accompanied this code. + */ + +package net.java.dev.colorchooser; + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics2D; +import java.awt.Point; +import java.awt.geom.AffineTransform; +import java.awt.image.BufferedImage; + +/* + * SpectrumImageImage.java + * + * Created on January 10, 2000, 4:54 PM + */ +/** + * This class is palette that uses an offscreen bitmap which contains a spectrum + * of color and hue. The direction of gradients and saturation are settable by + * arguments to the constructor. + * + * @author Tim Boudreau + */ +final class ContinuousPalette extends Palette { + public static final int SMALL_SPEC_WIDTH = 128; + public static final int SMALL_SPEC_HEIGHT = 64; + public static final int LARGE_SPEC_WIDTH = 200; + public static final int LARGE_SPEC_HEIGHT = 100; + public static final int SPEC_IMAGE_COUNT = 8; + + private BufferedImage img = null; + + /** + * Set true when the bitmap has been built. Bitmap is built on the first + * call to paintTo(), or the first call to PaintTo() subsequent to a + * property being changed that affects the contents of the bitmap. + */ + private boolean initialized = false; + + /** + * Holds value of property saturation. Determines the maximum saturation + * level present in the bitmap + */ + private float saturation = 1f; + /** + * Holds value of property verticalHue. When set true, hue rotation is + * vertical + */ + private boolean verticalHue = true; + /** Default value for gray strip on horizontal hue gradients */ + private float grayStripSize = 0.05f; + private String name; + + /** + * Creates a ContinuousPalette object with user specifiable size and + * saturation and the default horizontal hue gradient direction. + */ + ContinuousPalette(final String name, final int width, final int height, + final float saturation) { + img = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); + this.setSaturation(saturation); + this.name = name; + } + + /** + * Creates a ContinuousPalette object with user specifiable size, saturation + * and hue gradient direction. + * + * @param width + * The width of the image to be created + * @param height + * The height of the image to be created + * @param saturation + * The saturation of the image to be created + * @param vHue + * Sets vertical or horizontal hue gradient + */ + private ContinuousPalette(final String name, final int width, + final int height, final float saturation, final boolean vHue) { + img = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); + this.setSaturation(saturation); + this.verticalHue = vHue; + this.name = name; + } + + /** + * Builds the spectrum bitmap in memory by iterating through all of the + * pixels and calling getColorAt for each. + */ + protected void initImage() { + int currColor; + for (int x = 0; x < img.getWidth(); x++) { + for (int y = 0; y < img.getHeight(); y++) { + currColor = getColorAt(x, y).getRGB(); + img.setRGB(x, y, currColor); + } + } + } + + /** + * Public implementation of InitImage() - tests whether spectrum image has + * already been built and only builds it if needed. + */ + public final void initializeImage() { + if (!initialized) + initImage(); + } + + /** + * Paints the image at Coordinates 0,0 on the graphics context passed to it. + * + * @param g + * A graphics context to be painted into + */ + @Override + public void paintTo(final java.awt.Graphics g) { + if (g != null) { + initializeImage(); + ((Graphics2D) g).drawRenderedImage(img, AffineTransform + .getTranslateInstance(0, 0)); + initialized = true; + } + } + + /** + * Returns the color a pixel at a given point should be as an RGB int. Color + * is calculated as follows - Saturation is constant up to the halfway point + * in the brightness gradient direction, and brightness rises. At 100% + * brightness, you have a fully saturated color. From this point on, + * Brightness is constant at 1.0 and saturation drops linearly from the + * saturation property value down to 0. + * + * @param x + * The X coordinate for which a color value is desired + * @param y + * The Y coordinate for which a color value is desired + */ + @Override + public java.awt.Color getColorAt(final int x, final int y) { + float hue; + float brightness; + float workingSaturation; + final boolean inGrayStrip = ((float) y) / img.getHeight() > (1 - grayStripSize); + if (verticalHue) { + hue = ((float) y) / img.getHeight(); // Hue value from 0-1 based on + // y position + brightness = ((float) x) / img.getWidth(); // base brightness value + // 0-1 based on x + // location + } else { + if (inGrayStrip) + return grayValueFromX(x); + hue = 1 - (((float) x) / img.getWidth()); // subtract from 1 so + // lightest color are at + // top + brightness = 1 - ((float) y) / img.getHeight(); + } + brightness = brightness * 2; // brightness increases to the halfway + // point along the brightening axis. + if (brightness > 1) { // beyond that point, saturation goes down so + // color moves toward white + workingSaturation = saturation - ((brightness - 1) * saturation); // if + // we're + // past + // the + // halfway + // point, + brightness = 1; // we're decrementing saturation + } else { + workingSaturation = saturation; + } + final java.awt.Color newColor = java.awt.Color.getHSBColor(hue, + workingSaturation, brightness); + return newColor; + } + + public java.awt.Color colorFromPoint(final Point p) { + final int x = new Double(p.getX()).intValue(); + final int y = new Double(p.getY()).intValue(); + return getColorAt(x, y); + } + + /** + * Called by InitImage() to draw the grayscale strip at the bottom of + * horizontal-hue spectrum images. Returns a grayscale value based on the + * width of the image, when called with a horizontal coordinate. + * + * @param x + * The x coordinate for which a grayscale value is desired + * @return The grayscale value (expressed as an RGB integer value) + */ + protected java.awt.Color grayValueFromX(final int x) { + final java.awt.Color newColor = java.awt.Color.getHSBColor(0, 0, + ((float) x) / img.getWidth()); + return newColor; + } + + /** + * Getter for property saturation. Saturation defines the base saturation + * for all colors in the image. Setting it to less that 1 causes the colors + * to be more desaturated in the resulting bufferedImage. + * + * @return Returns the maximum saturation value for any colors to be + * generated in the bufferedImage. + */ + public float getSaturation() { + return saturation; + } + + /** + * Sets the maximum saturation for any colors in the image. Constrained from + * 0-1. Changing this property will cause the image to be regenerated the + * next time it is needed, or the next time initializeImage() is called. + * + * @param saturation + * New value of property saturation. + */ + public void setSaturation(final float saturation) { + if (this.saturation != saturation) { + this.saturation = saturation; + doChange(); + } + } + + /** + * Getter for property verticalHue. + * + * @return Value of property verticalHue. + */ + public boolean isVerticalHue() { + return verticalHue; + } + + /** + * Setter for property verticalHue. + * + * @param verticalHue + * New value of property verticalHue. + */ + public void setVerticalHue(final boolean verticalHue) { + if (this.verticalHue != verticalHue) { + this.verticalHue = verticalHue; + doChange(); + } + } + + /** + * Called when a parameter is changed that requires that the spectrum image + * be rebuilt, so that the next time the image is asked for, it will be. + */ + protected void doChange() { + initialized = false; + } + + /** + * Setter for the grayStripSize property, which determines the percentage + * (expressed as a float between 0 and 1) of the image height taken up by + * the grayscale strip. + */ + public void setGrayStripSize(final float grayStripSize) { + float workingGrayStripSize = grayStripSize; + if (workingGrayStripSize > 1) + workingGrayStripSize = 1; // handle screwy > 1 values just in case + if (workingGrayStripSize != grayStripSize) { + this.grayStripSize = grayStripSize; + doChange(); + } + } + + /** + * Getter for the GrayStripSize property, which returns the percentage + * (expressed as a float between 0 and 1) of the height of the image taken + * up by the gray scale strip for selecting non-colored pixels. + */ + public float getGrayStripSize() { + return this.grayStripSize; + } + + /** + * Returns the size of the image as a java.awt.Dimension object. + */ + @Override + public Dimension getSize() { + return new Dimension(img.getWidth(), img.getHeight()); + } + + @Override + public String getNameAt(final int x, final int y) { + final Color c = getColorAt(x, y); + final StringBuffer sb = new StringBuffer(); + sb.append(c.getRed()); + sb.append(','); // NOI18N + sb.append(c.getGreen()); + sb.append(','); // NOI18N + sb.append(c.getBlue()); + return sb.toString(); + } + + private static Palette[] defaultPalettes = null; + + /** Create a default set of continuous palettes to use */ + public static Palette[] createDefaultPalettes() { + if (defaultPalettes == null) { + defaultPalettes = new Palette[] { + new ContinuousPalette("satLarge", LARGE_SPEC_WIDTH, + LARGE_SPEC_HEIGHT, 1f, false), // NOI18N + new ContinuousPalette("unsatLarge", LARGE_SPEC_WIDTH, + LARGE_SPEC_HEIGHT, 0.4f, false), // NOI18N + new ContinuousPalette("satLargeHoriz", LARGE_SPEC_WIDTH, + LARGE_SPEC_HEIGHT, 1f, true), // NOI18N + new ContinuousPalette("unsatLargeHoriz", LARGE_SPEC_WIDTH, + LARGE_SPEC_HEIGHT, 0.4f, true) // NOI18N + }; + } + return defaultPalettes; + } + + @Override + public String getDisplayName() { + return ColorChooser.getString(name); + } + + @Override + public void setSize(final int w, final int h) { + } +} diff --git a/net/java/dev/colorchooser/DefaultColorChooserUI.java b/net/java/dev/colorchooser/DefaultColorChooserUI.java new file mode 100644 index 0000000..23e786b --- /dev/null +++ b/net/java/dev/colorchooser/DefaultColorChooserUI.java @@ -0,0 +1,106 @@ +/* + * The contents of this file are subject to the terms of the Common Development + * and Distribution License (the License). You may not use this file except in + * compliance with the License. + * + * You can obtain a copy of the License at http://www.netbeans.org/cddl.html + * or http://www.netbeans.org/cddl.txt. + * + * When distributing Covered Code, include this CDDL Header Notice in each file + * and include the License file at http://www.netbeans.org/cddl.txt. + * If applicable, add the following below the CDDL Header, with the fields + * enclosed by brackets [] replaced by your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + */ +package net.java.dev.colorchooser; + +import java.awt.Color; +import java.awt.Graphics; + +import javax.swing.JComponent; +import javax.swing.plaf.ComponentUI; + +/** + * Default UI delegate for color choosers. CCBorder handles minor per-look and + * feel differences so we can use one delegate. Note this delegate is stateless + * - there is one instance system-wide. State is kept by the listener - see + * inner class L. + * + * @author Tim Boudreau + */ +final class DefaultColorChooserUI extends ColorChooserUI { + DefaultColorChooserUI() { + } + + private static DefaultColorChooserUI INSTANCE = null; + + public static ComponentUI createUI(final JComponent jc) { + // assert jc instanceof ColorChooser; + return getDefault(); + } + + static DefaultColorChooserUI getDefault() { + if (INSTANCE == null) { + INSTANCE = new DefaultColorChooserUI(); + } + return INSTANCE; + } + + @Override + protected void init(final ColorChooser c) { + c.setToolTipText(getDefaultTooltip()); + c.setBorder(new CCBorder()); + } + + @Override + protected void uninit(final ColorChooser c) { + if (c.getBorder() instanceof CCBorder) { + c.setBorder(null); + } + if (getDefaultTooltip().equals(c.getToolTipText())) { + c.setToolTipText(null); + } + } + + private static String getDefaultTooltip() { + return MAC ? ColorChooser.getString("tip.mac") : // NOI18N + ColorChooser.getString("tip"); // NOI18N + } + + @Override + public void paint(final Graphics g, final JComponent c) { + final ColorChooser chooser = (ColorChooser) c; + final Color col = chooser.transientColor() != null ? chooser + .transientColor() : chooser.getColor(); + + g.setColor(col); + g.fillRect(0, 0, chooser.getWidth() - 1, chooser.getHeight() - 1); + if (chooser.hasFocus()) { + g.setColor(invertColor(col)); + g.drawRect(4, 4, chooser.getWidth() - 8, chooser.getHeight() - 8); + } + } + + // *****************Some utility methods for manipulating colors*********** + /** Finds a color that will visually contrast with the selected color */ + private static final Color invertColor(final Color c) { + final int r = checkRange(255 - c.getRed()); + final int g = checkRange(255 - c.getGreen()); + final int b = checkRange(255 - c.getBlue()); + return new Color(r, g, b); + } + + /** + * Checks to make sure the color component passed is not too close to + * middle-of-the-road, and if so, returns its difference with 128. Used by + * invertColor to make sure that it doesn't, for example, return 129,129,129 + * as a color to contrast with 127,127,127. + */ + private static final int checkRange(final int i) { + int result = i; + if (Math.abs(128 - i) < 24) { + result = Math.abs(128 - i); + } + return result; + } +} diff --git a/net/java/dev/colorchooser/NamedColor.java b/net/java/dev/colorchooser/NamedColor.java new file mode 100644 index 0000000..70f06ef --- /dev/null +++ b/net/java/dev/colorchooser/NamedColor.java @@ -0,0 +1,126 @@ +/*DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 2006-2008. Tim Boudreau. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. This particular file is designated + * as subject to the "Classpath" exception as provided + * in the GPL Version 2 section of the License file that + * accompanied this code. + */ + +package net.java.dev.colorchooser; + +import java.awt.Color; + +/** + * An abstract class representing a color which has a name and may provide + * custom code for instantiation. Implements comparable in order to appear in an + * ordered way in palettes. Note that this class is internal to the color + * chooser. It is not acceptable for the color chooser to provide instances of + * NamedColor from its getColor method, since they may be serialized and will + * not be deserializable if their implementation is not on the classpath. + * + * @author Tim Boudreau + */ +abstract class NamedColor extends Color implements Comparable { + /** + * + */ + private static final long serialVersionUID = 1L; + + /** + * Creates a new instance of NamedColor + * + * @param name + * @param r + * red + * @param g + * green + * @param b + * blue + */ + protected NamedColor(final String name, final int r, final int g, + final int b) { + super(r, g, b); + } + + /** + * Get a localized display name for this color if possible. For some colors, + * such as named system colors, a localized variant is not a reasonable + * option. + * + * @return the localized (or not) display name + */ + public abstract String getDisplayName(); + + /** + * Get the programmatic name, if any, for this color, such as a Swing + * UIDefaults key or an SVG constant name. + */ + public abstract String getName(); + + /** + * Fetch a java code snippet for instantiating this color. For cases such as + * named defaults from the Swing UIManager, this method might return + * something such as UIManager.getColor("control"). + * Useful when implementing a property editor. + * + * @return a string that could be pasted into Java code to instantiate a + * color with these rgb values + */ + public String getInstantiationCode() { + return toString(); + } + + static NamedColor create(final Color c, final String name) { + return new DefaultNamedColor(c, name); + } + + private static final class DefaultNamedColor extends NamedColor { + /** + * + */ + private static final long serialVersionUID = 1L; + private final String name; + + public DefaultNamedColor(final Color c, final String name) { + super(name, c.getRed(), c.getGreen(), c.getBlue()); + this.name = name; + } + + @Override + public String getDisplayName() { + return name; + } + + @Override + public String getName() { + return name; + } + + public int compareTo(final Object o) { + if (o instanceof NamedColor) { + final NamedColor nc = (NamedColor) o; + final String nm = nc.getDisplayName(); + if (nm == null && getDisplayName() == null) { + return 0; + } else { + return nm != null && getDisplayName() != null ? getDisplayName() + .compareTo(nm) + : -1; + } + } else { + return -1; + } + } + } +} diff --git a/net/java/dev/colorchooser/Palette.java b/net/java/dev/colorchooser/Palette.java new file mode 100644 index 0000000..3184ef9 --- /dev/null +++ b/net/java/dev/colorchooser/Palette.java @@ -0,0 +1,132 @@ +/*DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 2006-2008. Tim Boudreau. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. This particular file is designated + * as subject to the "Classpath" exception as provided + * in the GPL Version 2 section of the License file that + * accompanied this code. + */ + +package net.java.dev.colorchooser; + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics; + +/** + * Model for a palette that can be painted, and from which colors may be + * selected. An array of palettes to use may be supplied to a ColorChooser via + * the setPalettes method. + * + * @author Tim Boudreau + */ +public abstract class Palette { + + /** + * Returns the color at the specified point, or null if the point is beyond + * the bounds of the palette or in an area that does not indicate a color + * + * @param x + * - an horizontal coordinate in the coordinate space of the + * palette + * @param y + * - a vertical coordinate in the coordinate space of the palette + * @return - a color or null + */ + public abstract Color getColorAt(int x, int y); + + /** + * Returns a string description of the color at the point. May be a name or + * a set of RGB values, but should not be longer than 30 characters. Returns + * null if the position is outside the bounds of the palette or has no + * description associated with it. Generally getNameAt() should return null + * from the same coordinates that getColorAt() would. + * + * @param x + * an horizontal coordinate in the coordinate space of the + * palette + * @param y + * a vertical coordinate in the coordinate space of the palette + * @return a string describing the color at this coordinate or null + * @see #getColorAt + */ + public abstract String getNameAt(int x, int y); + + /** + * Paint this palette to a graphics context. + * + * @param g + * - a graphics context to paint into + */ + public abstract void paintTo(Graphics g); + + /** + * Get the on-screen size of this palette + * + * @return the size of this palette - corresponding to the screen space + * required to display it and defining the coordinate space of this + * palette. + */ + public abstract Dimension getSize(); + + /** + * Get a localized name for this palette or null if a display name is not + * warranted + * + * @return the display name + */ + + public abstract void setSize(int w, int h); + + public abstract String getDisplayName(); + + /** + * Get the default set of 8 palettes used by the color chooser. If + * continuousFirst is true, the first four will be continuous palettes and + * the second four swatches with named colors, system colors, etc. + */ + public static final Palette[] getDefaultPalettes( + final boolean continuousFirst) { + Palette[] result = new Palette[8]; + final Palette[] first = continuousFirst ? ContinuousPalette + .createDefaultPalettes() : PredefinedPalette + .createDefaultPalettes(); + final Palette[] second = !continuousFirst ? ContinuousPalette + .createDefaultPalettes() : PredefinedPalette + .createDefaultPalettes(); + + result = new Palette[second.length + first.length]; + System.arraycopy(first, 0, result, 0, 4); + System.arraycopy(second, 0, result, 4, 4); + return result; + } + + public static final Palette createContinuousPalette(final String name, + final Dimension size, final float saturation) { + if (size.width <= 0) + throw new IllegalArgumentException("width less than or equal 0"); + if (size.height <= 0) + throw new IllegalArgumentException("height less than or equal 0"); + return new ContinuousPalette(name, size.width, size.height, saturation); + } + + public static final Palette createPredefinedPalette(final String name, + final Color[] colors, final String[] names) { + final NamedColor[] cc = new NamedColor[colors.length]; + for (int i = 0; i < colors.length; i++) { + cc[i] = NamedColor.create(colors[i], names[i]); + } + return new PredefinedPalette(name, cc); + } + +} diff --git a/net/java/dev/colorchooser/PalettePopup.java b/net/java/dev/colorchooser/PalettePopup.java new file mode 100644 index 0000000..94b4337 --- /dev/null +++ b/net/java/dev/colorchooser/PalettePopup.java @@ -0,0 +1,376 @@ +/*DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 2006-2008. Tim Boudreau. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. This particular file is designated + * as subject to the "Classpath" exception as provided + * in the GPL Version 2 section of the License file that + * accompanied this code. + */ + +package net.java.dev.colorchooser; + +import java.awt.Dimension; +import java.awt.Font; +import java.awt.GradientPaint; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.GraphicsEnvironment; +import java.awt.KeyboardFocusManager; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseMotionListener; +import java.awt.image.BufferedImage; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.lang.ref.Reference; +import java.lang.ref.SoftReference; + +import javax.swing.JComponent; +import javax.swing.Popup; +import javax.swing.PopupFactory; +import javax.swing.SwingUtilities; +import javax.swing.UIManager; + +/** + * Encapsulates the logic of a popup palette which can callback a color chooser + * to set its transient color or its final color if the mouse is released over + * the palette. + * + * @author Tim Boudreau + */ +class PalettePopup extends MouseAdapter implements MouseMotionListener, +PropertyChangeListener { + private Popup pop = null; + private PalettePanel panel = null; + private Palette pal = null; + private static Reference defaultInstance = null; + + /** Creates a new instance of PalettePopup */ + private PalettePopup() { + } + + public static PalettePopup getDefault() { + PalettePopup result = null; + if (defaultInstance != null) { + result = (PalettePopup) defaultInstance.get(); + } + + if (result == null) { + result = new PalettePopup(); + defaultInstance = new SoftReference(result); + } + return result; + } + + private PalettePanel getPalettePanel() { + if (panel == null) { + panel = new PalettePanel(); + } + return panel; + } + + public void setPalette(final Palette pal) { + if (pal != this.pal) { + if (isPopupVisible()) { + final Dimension newSize = pal.getSize(); + final Dimension oldSize = this.pal.getSize(); + if (newSize.equals(oldSize)) { + panel.setPalette(pal); + panel.repaint(); + } else { + synchronized (lastOwner.getTreeLock()) { + pop.hide(); + panel.setPalette(pal); + pop = PopupFactory.getSharedInstance().getPopup( + lastOwner, getPalettePanel(), lastCoords.x, + lastCoords.y); + pop.show(); + } + } + } + this.pal = pal; + } + } + + private Palette getPalette() { + return pal; + } + + private ColorChooser lastOwner; + private Point lastCoords; + + public void showPopup(final ColorChooser owner, final Point coords) { + if (pal == null) { + throw new IllegalStateException("No palette specified"); + } + setPopupOwner(owner); + lastCoords = coords; + if (pop != null) { + pop.hide(); + pop = null; + } + final PalettePanel pp = getPalettePanel(); + pp.setPalette(getPalette()); + final Dimension sz = pp.getPreferredSize(); + final Rectangle r = owner.getGraphicsConfiguration().getDevice() + .getDefaultConfiguration().getBounds(); + final Rectangle test = new Rectangle(coords, sz); + if (!r.contains(test)) { + final int offy = Math.max(0, (test.y + test.height) + - (r.y + r.height)); + final int offx = Math.max(0, (test.x + test.width) + - (r.x + r.width)); + coords.x -= offx; + coords.y -= offy; + } + + pop = PopupFactory.getSharedInstance().getPopup(owner, pp, coords.x, + coords.y); + pop.show(); + owner.firePickerVisible(true); + KeyboardFocusManager.getCurrentKeyboardFocusManager() + .addPropertyChangeListener(this); + } + + private void setPopupOwner(final ColorChooser owner) { + if (lastOwner == owner) { + return; + } + if (lastOwner != null) { + detachFromOwner(); + lastOwner.firePickerVisible(false); + } + attachToOwner(owner); + } + + private void detachFromOwner() { + if (lastOwner != null) { + lastOwner.removeMouseMotionListener(this); + lastOwner.removeMouseListener(this); + } + lastOwner = null; + } + + private void attachToOwner(final ColorChooser owner) { + lastOwner = owner; + owner.addMouseListener(this); + owner.addMouseMotionListener(this); + } + + public void hidePopup(final ColorChooser owner) { + if (owner != lastOwner) { + return; + } + hidePopup(); + } + + private void hidePopup() { + if (pop != null) { + pop.hide(); + pop = null; + detachFromOwner(); + KeyboardFocusManager.getCurrentKeyboardFocusManager() + .removePropertyChangeListener(this); + } + } + + private boolean isPopupVisible() { + return pop != null; + } + + public boolean isPopupVisible(final ColorChooser chooser) { + return lastOwner == chooser && isPopupVisible(); + } + + public void mouseDragged(final java.awt.event.MouseEvent e) { + final Point p = e.getPoint(); + SwingUtilities.convertPointToScreen(p, lastOwner); + convertPointToPalette(p); + final Dimension d = panel.getOffset(); + if (d != null) { + p.x -= d.width; + p.y -= d.height; + } + if (p.x >= 0 && p.y >= 0 && p.x <= pal.getSize().width + && p.y < pal.getSize().height) { + lastOwner.setTransientColor(pal.getColorAt(p.x, p.y)); + panel.setDisplayTitle(pal.getNameAt(p.x, p.y)); + } else { + lastOwner.setTransientColor(null); + panel.setDisplayTitle(null); + } + } + + public void mouseMoved(final java.awt.event.MouseEvent e) { + } + + private void convertPointToPalette(final Point p) { + p.x -= lastCoords.x; + p.y -= lastCoords.y; + } + + public void propertyChange(final PropertyChangeEvent evt) { + if ("focusOwner".equals(evt.getPropertyName())) { + final Object o = evt.getNewValue(); + if (o != panel && o != lastOwner) { + hidePopup(); + } + } + } + + private class PalettePanel extends JComponent { + /** + * + */ + private static final long serialVersionUID = 1L; + private Palette pal = null; + + private PalettePanel() { + } + + private String title = null; + + public void setPalette(final Palette pal) { + Dimension oldSize = null; + if (pal != null && isShowing()) { + oldSize = pal.getSize(); + } + this.pal = pal; + if (oldSize != null && pal != null + && !pal.getSize().equals(oldSize)) { + firePropertyChange("preferredSize", oldSize, pal.getSize()); // NOI18N + } + } + + public Dimension getOffset() { + if (pal == null || pal.getDisplayName() == null) { + return null; + } + return new Dimension(0, + ((getPreferredSize().height - pal.getSize().height) / 2)); + } + + @Override + public void paintComponent(final Graphics g) { + final Dimension d = pal.getSize(); + final int y = getHeight() - d.height; + if (pal.getDisplayName() != null) { + final GradientPaint gp = new GradientPaint(0, 0, UIManager + .getColor("controlHighlight"), 0, y / 2, UIManager + .getColor("controlShadow")); + ((Graphics2D) g).setPaint(gp); + g.fillRect(0, 0, getWidth(), y / 2); + + final String s = pal.getDisplayName(); + g.setFont(getFont().deriveFont(Font.BOLD, + getFont().getSize() - 2)); + final int ht = g.getFontMetrics(g.getFont()).getHeight(); + final int wid = g.getFontMetrics(g.getFont()).stringWidth(s); + final int xpos = (getWidth() / 2) - (wid / 2); + + g.setColor(UIManager.getColor("controlShadow")); + g.drawLine(0, 0, getWidth() - 1, 0); + g.drawLine(0, 0, 0, (y / 2) - 1); + g.drawLine(getWidth() - 1, 0, getWidth() - 1, (y / 2) - 1); + + g.setColor(UIManager.getColor("textText")); + g.drawString(s, xpos, ht - 3); + g.translate(0, y / 2); + } + pal.paintTo(g); + + final int top = pal.getDisplayName() == null ? y : y / 2; + final int bottom = pal.getDisplayName() == null ? getHeight() + : getHeight() - top; + + final GradientPaint gp = new GradientPaint(0, getHeight() - y, + UIManager.getColor("controlHighlight"), 0, bottom, + UIManager.getColor("controlShadow")); // NOI18N + + ((Graphics2D) g).setPaint(gp); + g.fillRect(0, getHeight() - y, getWidth(), top); + if (title != null) { + g.setColor(UIManager.getColor("textText")); // NOI18N + g.setFont(getFont().deriveFont(Font.PLAIN, + getFont().getSize() - 2)); + final int xp = (getWidth() - g.getFontMetrics(g.getFont()) + .stringWidth(title)) - 3; + g.drawString(title, xp, getHeight() + - (pal.getDisplayName() == null ? 4 : (y / 2) + 4)); + } + g.setColor(UIManager.getColor("controlShadow")); // NOI18N + g.drawLine(0, getHeight() - y, 0, getHeight()); + g.drawLine(0, getHeight() - (top + 1), getWidth() - 1, getHeight() + - (top + 1)); + g.drawLine(getWidth() - 1, getHeight() - (top + 1), getWidth() - 1, + getHeight() - y); + } + + public void setDisplayTitle(final String s) { + if (s != title + && ((s != null) != (title != null) || ((s != null && !s + .equals(title))))) { + title = s; + repaint(); + } + if (s == null && title != null) { + title = null; + repaint(); + } + } + + @Override + public Dimension getPreferredSize() { + if (pal != null) { + final Dimension result = new Dimension(pal.getSize()); + int spacing = 14; + if (lastOwner != null) { + Graphics g = lastOwner.getGraphics(); + if (g == null) { + try { + g = GraphicsEnvironment + .getLocalGraphicsEnvironment() + .getDefaultScreenDevice() + .getDefaultConfiguration() + .createCompatibleImage(1, 1) + .createGraphics(); + } catch (final SecurityException e) { + g = new BufferedImage(1, 1, + BufferedImage.TYPE_INT_ARGB) + .createGraphics(); + } + } + if (g != null) { + Font f = getFont() == null ? UIManager + .getFont("controlFont") : getFont(); + if (f == null) { + f = new Font("Serif", Font.PLAIN, 12); + } + spacing = g.getFontMetrics( + f.deriveFont(Font.PLAIN, f.getSize() - 2)) + .getHeight(); + } + g.dispose(); + } + if (pal.getDisplayName() != null) { + spacing *= 2; + } + result.height += spacing; + return result; + } else { + return new Dimension(10, 10); + } + } + } +} diff --git a/net/java/dev/colorchooser/PredefinedPalette.java b/net/java/dev/colorchooser/PredefinedPalette.java new file mode 100644 index 0000000..2705f68 --- /dev/null +++ b/net/java/dev/colorchooser/PredefinedPalette.java @@ -0,0 +1,680 @@ +/*DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 2006-2008. Tim Boudreau. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. This particular file is designated + * as subject to the "Classpath" exception as provided + * in the GPL Version 2 section of the License file that + * accompanied this code. + */ + +package net.java.dev.colorchooser; + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Rectangle; +import java.awt.SystemColor; +import java.util.Arrays; + +import javax.swing.UIManager; + +/** + * A palette of swatches with predefined colors + * + * @author Tim Boudreau + */ +class PredefinedPalette extends Palette { + NamedColor[] colors; + private int swatchSize = 11; + private final int gap = 1; + private static final Rectangle scratch = new Rectangle(); + private final String name; + + /** Creates a new instance of PredefinedPalette */ + public PredefinedPalette(final String name, final NamedColor[] colors) { + this.colors = colors; + this.name = name; + Arrays.sort(colors); + if (colors.length < 14) { + swatchSize = 24; + } else if (colors.length < 40) { + swatchSize = 16; + } + + } + + @Override + public java.awt.Color getColorAt(final int x, final int y) { + Color result = null; + final int idx = indexForPoint(x, y); + if (idx != -1 && idx < colors.length) { + result = colors[idx]; + } + return result; + } + + @Override + public void paintTo(final java.awt.Graphics g) { + g.setColor(Color.BLACK); + final Dimension size = getSize(); + g.fillRect(0, 0, size.width, size.height); + for (int i = 0; i < colors.length; i++) { + final Color c = colors[i]; + rectForIndex(i, scratch); + g.setColor(c); + g.fillRect(scratch.x, scratch.y, scratch.width, scratch.height); + if (Color.BLACK.equals(c)) { + g.setColor(Color.GRAY); + } else { + g.setColor(c.brighter()); + } + g.drawLine(scratch.x, scratch.y, scratch.x + scratch.width - 1, + scratch.y); + g.drawLine(scratch.x, scratch.y, scratch.x, scratch.y + + scratch.height - 1); + if (Color.BLACK.equals(c)) { + g.setColor(Color.GRAY.darker()); + } else { + g.setColor(c.darker()); + } + g.drawLine(scratch.x + scratch.width - 1, scratch.y + + scratch.height - 1, scratch.width + scratch.x - 1, + scratch.y + 1); + g.drawLine(scratch.x + scratch.width - 1, scratch.y + + scratch.height - 1, scratch.x, scratch.y + scratch.height + - 1); + } + } + + @Override + public String getNameAt(final int x, final int y) { + final NamedColor nc = (NamedColor) getColorAt(x, y); + if (nc != null) { + return nc.getDisplayName(); + } else { + return null; + } + } + + protected int getCount() { + return colors.length; + } + + Dimension calcSize() { + final int count = colors.length; + final int perRow = (int) Math.round(Math.sqrt(count)); + final int perCol = (perRow * perRow >= count) ? perRow : perRow + 1; + final int width = perCol * (swatchSize + gap) + gap; + final int height = perRow * (swatchSize + gap) + gap; + final Dimension result = new Dimension(width, height); + return result; + } + + private Dimension size = null; + + @Override + public Dimension getSize() { + if (size == null) { + size = calcSize(); + } + return size; + } + + @Override + public void setSize(final int w, final int h) { + size = new Dimension(w, h); + } + + private int indexForPoint(final int x, final int y) { + final Dimension d = getSize(); + if (y > d.height || x > d.width || y < 0 || x < 0) { + return -1; + } + final int perRow = d.width / (swatchSize + gap); + + final int col = x / (swatchSize + gap); + final int row = y / (swatchSize + gap); + return (row * perRow) + col; + } + + private void rectForIndex(final int idx, final Rectangle r) { + final Dimension d = getSize(); + final int rectsPerRow = d.width / (swatchSize + gap); + r.x = gap + ((swatchSize + gap) * (idx % rectsPerRow)); + r.y = gap + ((swatchSize + gap) * (idx / rectsPerRow)); + r.width = swatchSize; + r.height = swatchSize; + } + + private static Palette[] predefined = null; + + public static Palette[] createDefaultPalettes() { + if (predefined == null) { + predefined = makePal(); + } + return predefined; + } + + private static final Palette[] makePal() { + final Palette[] result = new Palette[] { + new PredefinedPalette("svg", SVGColors), + new PredefinedPalette("system", getSystemColors()), + RecentColors.getDefault(), + new PredefinedPalette("swing", getSwingColors()) }; + return result; + } + + static class BasicNamedColor extends NamedColor implements Comparable { + /** + * + */ + private static final long serialVersionUID = 1L; + private final String name; + + public BasicNamedColor(final String name, final int r, final int g, + final int b) { + super(name, r, g, b); + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public String getDisplayName() { + return ColorChooser.getString(getName()); + } + + @Override + public String toString() { + return "new java.awt.Color(" + getRed() + "," + getGreen() + "," + + getBlue() + ")"; + } + + public int compareTo(final Object o) { + final Color c = (Color) o; + // maybe average rgb & compare? + final int result = avgColor(c) - avgColor(this); + return result; + } + + @Override + public String getInstantiationCode() { + return toString(); + } + + } + + private static int avgColor(final Color c) { + return (c.getRed() + c.getGreen() + c.getBlue()) / 3; + } + + @Override + public String getDisplayName() { + return ColorChooser.getString(name); + } + + static String getColorName(final Color c) { + for (final SwingColor swingColor : swingColors) { + if (equals(swingColor, c)) { + return swingColor.getDisplayName(); + } + } + for (final NamedColor color : SVGColors) { + if (equals(color, c)) { + return color.getDisplayName(); + } + } + return null; + } + + static boolean equals(final Color a, final Color b) { + return a.getRGB() == b.getRGB(); + } + + private static final NamedColor[] SVGColors = new BasicNamedColor[] { + new BasicNamedColor("aliceblue", 240, 248, 255), + new BasicNamedColor("antiquewhite", 250, 235, 215), + new BasicNamedColor("aqua", 0, 255, 255), + new BasicNamedColor("aquamarine", 127, 255, 212), + new BasicNamedColor("azure", 240, 255, 255), + new BasicNamedColor("beige", 245, 245, 220), + new BasicNamedColor("bisque", 255, 228, 196), + new BasicNamedColor("black", 0, 0, 0), + new BasicNamedColor("blanchedalmond", 255, 235, 205), + new BasicNamedColor("blue", 0, 0, 255), + new BasicNamedColor("blueviolet", 138, 43, 226), + new BasicNamedColor("brown", 165, 42, 42), + new BasicNamedColor("burlywood", 222, 184, 135), + new BasicNamedColor("cadetblue", 95, 158, 160), + new BasicNamedColor("chartreuse", 127, 255, 0), + new BasicNamedColor("chocolate", 210, 105, 30), + new BasicNamedColor("coral", 255, 127, 80), + new BasicNamedColor("cornflowerblue", 100, 149, 237), + new BasicNamedColor("cornsilk", 255, 248, 220), + new BasicNamedColor("crimson", 220, 20, 60), + new BasicNamedColor("cyan", 0, 255, 255), + new BasicNamedColor("darkblue", 0, 0, 139), + new BasicNamedColor("darkcyan", 0, 139, 139), + new BasicNamedColor("darkgoldenrod", 184, 134, 11), + new BasicNamedColor("darkgray", 169, 169, 169), + new BasicNamedColor("darkgreen", 0, 100, 0), + new BasicNamedColor("darkgrey", 169, 169, 169), + new BasicNamedColor("darkkhaki", 189, 183, 107), + new BasicNamedColor("darkmagenta", 139, 0, 139), + new BasicNamedColor("darkolivegreen", 85, 107, 47), + new BasicNamedColor("darkorange", 255, 140, 0), + new BasicNamedColor("darkorchid", 153, 50, 204), + new BasicNamedColor("darkred", 139, 0, 0), + new BasicNamedColor("darksalmon", 233, 150, 122), + new BasicNamedColor("darkseagreen", 143, 188, 143), + new BasicNamedColor("darkslateblue", 72, 61, 139), + new BasicNamedColor("darkslategray", 47, 79, 79), + new BasicNamedColor("darkslategrey", 47, 79, 79), + new BasicNamedColor("darkturquoise", 0, 206, 209), + new BasicNamedColor("darkviolet", 148, 0, 211), + new BasicNamedColor("deeppink", 255, 20, 147), + new BasicNamedColor("deepskyblue", 0, 191, 255), + new BasicNamedColor("dimgray", 105, 105, 105), + new BasicNamedColor("dimgrey", 105, 105, 105), + new BasicNamedColor("dodgerblue", 30, 144, 255), + new BasicNamedColor("firebrick", 178, 34, 34), + new BasicNamedColor("floralwhite", 255, 250, 240), + new BasicNamedColor("forestgreen", 34, 139, 34), + new BasicNamedColor("fuchsia", 255, 0, 255), + new BasicNamedColor("gainsboro", 220, 220, 220), + new BasicNamedColor("ghostwhite", 248, 248, 255), + new BasicNamedColor("gold", 255, 215, 0), + new BasicNamedColor("goldenrod", 218, 165, 32), + new BasicNamedColor("gray", 128, 128, 128), + new BasicNamedColor("grey", 128, 128, 128), + new BasicNamedColor("green", 0, 128, 0), + new BasicNamedColor("greenyellow", 173, 255, 47), + new BasicNamedColor("honeydew", 240, 255, 240), + new BasicNamedColor("hotpink", 255, 105, 180), + new BasicNamedColor("indianred", 205, 92, 92), + new BasicNamedColor("indigo", 75, 0, 130), + new BasicNamedColor("ivory", 255, 255, 240), + new BasicNamedColor("khaki", 240, 230, 140), + new BasicNamedColor("lavender", 230, 230, 250), + new BasicNamedColor("lavenderblush", 255, 240, 245), + new BasicNamedColor("lawngreen", 124, 252, 0), + new BasicNamedColor("lemonchiffon", 255, 250, 205), + new BasicNamedColor("lightblue", 173, 216, 230), + new BasicNamedColor("lightcoral", 240, 128, 128), + new BasicNamedColor("lightcyan", 224, 255, 255), + new BasicNamedColor("lightgoldenrodyellow", 250, 250, 210), + new BasicNamedColor("lightgray", 211, 211, 211), + new BasicNamedColor("lightgreen", 144, 238, 144), + new BasicNamedColor("lightgrey", 211, 211, 211), + new BasicNamedColor("lightpink", 255, 182, 193), + new BasicNamedColor("lightsalmon", 255, 160, 122), + new BasicNamedColor("lightseagreen", 32, 178, 170), + new BasicNamedColor("lightskyblue", 135, 206, 250), + new BasicNamedColor("lightslategray", 119, 136, 153), + new BasicNamedColor("lightslategrey", 119, 136, 153), + new BasicNamedColor("lightsteelblue", 176, 196, 222), + new BasicNamedColor("lightyellow", 255, 255, 224), + new BasicNamedColor("lime", 0, 255, 0), + new BasicNamedColor("limegreen", 50, 205, 50), + new BasicNamedColor("linen", 250, 240, 230), + new BasicNamedColor("magenta", 255, 0, 255), + new BasicNamedColor("maroon", 128, 0, 0), + new BasicNamedColor("mediumaquamarine", 102, 205, 170), + new BasicNamedColor("mediumblue", 0, 0, 205), + new BasicNamedColor("mediumorchid", 186, 85, 211), + new BasicNamedColor("mediumpurple", 147, 112, 219), + new BasicNamedColor("mediumseagreen", 60, 179, 113), + new BasicNamedColor("mediumslateblue", 123, 104, 238), + new BasicNamedColor("mediumspringgreen", 0, 250, 154), + new BasicNamedColor("mediumturquoise", 72, 209, 204), + new BasicNamedColor("mediumvioletred", 199, 21, 133), + new BasicNamedColor("midnightblue", 25, 25, 112), + new BasicNamedColor("mintcream", 245, 255, 250), + new BasicNamedColor("mistyrose", 255, 228, 225), + new BasicNamedColor("moccasin", 255, 228, 181), + new BasicNamedColor("navajowhite", 255, 222, 173), + new BasicNamedColor("navy", 0, 0, 128), + new BasicNamedColor("oldlace", 253, 245, 230), + new BasicNamedColor("olive", 128, 128, 0), + new BasicNamedColor("olivedrab", 107, 142, 35), + new BasicNamedColor("orange", 255, 165, 0), + new BasicNamedColor("orangered", 255, 69, 0), + new BasicNamedColor("orchid", 218, 112, 214), + new BasicNamedColor("palegoldenrod", 238, 232, 170), + new BasicNamedColor("palegreen", 152, 251, 152), + new BasicNamedColor("paleturquoise", 175, 238, 238), + new BasicNamedColor("palevioletred", 219, 112, 147), + new BasicNamedColor("papayawhip", 255, 239, 213), + new BasicNamedColor("peachpuff", 255, 218, 185), + new BasicNamedColor("peru", 205, 133, 63), + new BasicNamedColor("pink", 255, 192, 203), + new BasicNamedColor("plum", 221, 160, 221), + new BasicNamedColor("powderblue", 176, 224, 230), + new BasicNamedColor("purple", 128, 0, 128), + new BasicNamedColor("red", 255, 0, 0), + new BasicNamedColor("rosybrown", 188, 143, 143), + new BasicNamedColor("royalblue", 65, 105, 225), + new BasicNamedColor("saddlebrown", 139, 69, 19), + new BasicNamedColor("salmon", 250, 128, 114), + new BasicNamedColor("sandybrown", 244, 164, 96), + new BasicNamedColor("seagreen", 46, 139, 87), + new BasicNamedColor("seashell", 255, 245, 238), + new BasicNamedColor("sienna", 160, 82, 45), + new BasicNamedColor("silver", 192, 192, 192), + new BasicNamedColor("skyblue", 135, 206, 235), + new BasicNamedColor("slateblue", 106, 90, 205), + new BasicNamedColor("slategray", 112, 128, 144), + new BasicNamedColor("slategrey", 112, 128, 144), + new BasicNamedColor("snow", 255, 250, 250), + new BasicNamedColor("springgreen", 0, 255, 127), + new BasicNamedColor("steelblue", 70, 130, 180), + new BasicNamedColor("tan", 210, 180, 140), + new BasicNamedColor("teal", 0, 128, 128), + new BasicNamedColor("thistle", 216, 191, 216), + new BasicNamedColor("tomato", 255, 99, 71), + new BasicNamedColor("turquoise", 64, 224, 208), + new BasicNamedColor("violet", 238, 130, 238), + new BasicNamedColor("wheat", 245, 222, 179), + new BasicNamedColor("white", 255, 255, 255), + new BasicNamedColor("whitesmoke", 245, 245, 245), + new BasicNamedColor("yellow", 255, 255, 0), + new BasicNamedColor("yellowgreen", 154, 205, 50) }; // NOI18N + + static class SwingColor extends BasicNamedColor { + /** + * + */ + private static final long serialVersionUID = 1L; + + public SwingColor(final String name, final int r, final int g, + final int b) { + super(name, r, g, b); + } + + @Override + public String toString() { + return "UIManager.getColor(" + getName() + ")"; + } + + @Override + public String getDisplayName() { + return getName(); + } + + @Override + public String getInstantiationCode() { + return toString(); + } + } + + private static SwingColor[] swingColors = null; + + private static SwingColor[] getSwingColors() { + if (swingColors != null) { + return swingColors; + } + final java.util.List l = new java.util.ArrayList(); + Color c; + c = UIManager.getColor("windowText"); + if (c != null) { + l.add(new SwingColor("windowText", c.getRed(), c.getGreen(), c + .getBlue())); + } + c = UIManager.getColor("activeCaptionBorder"); + if (c != null) { + l.add(new SwingColor("activeCaptionBorder", c.getRed(), c + .getGreen(), c.getBlue())); + } + c = UIManager.getColor("inactiveCaptionText"); + if (c != null) { + l.add(new SwingColor("inactiveCaptionText", c.getRed(), c + .getGreen(), c.getBlue())); + } + c = UIManager.getColor("controlLtHighlight"); + if (c != null) { + l.add(new SwingColor("controlLtHighlight", c.getRed(), + c.getGreen(), c.getBlue())); + } + c = UIManager.getColor("inactiveCaptionBorder"); + if (c != null) { + l.add(new SwingColor("inactiveCaptionBorder", c.getRed(), c + .getGreen(), c.getBlue())); + } + c = UIManager.getColor("textInactiveText"); + if (c != null) { + l.add(new SwingColor("textInactiveText", c.getRed(), c.getGreen(), + c.getBlue())); + } + c = UIManager.getColor("control"); + if (c != null) { + l.add(new SwingColor("control", c.getRed(), c.getGreen(), c + .getBlue())); + } + c = UIManager.getColor("textText"); + if (c != null) { + l.add(new SwingColor("textText", c.getRed(), c.getGreen(), c + .getBlue())); + } + c = UIManager.getColor("menu"); + if (c != null) { + l + .add(new SwingColor("menu", c.getRed(), c.getGreen(), c + .getBlue())); + } + c = UIManager.getColor("windowBorder"); + if (c != null) { + l.add(new SwingColor("windowBorder", c.getRed(), c.getGreen(), c + .getBlue())); + } + c = UIManager.getColor("infoText"); + if (c != null) { + l.add(new SwingColor("infoText", c.getRed(), c.getGreen(), c + .getBlue())); + } + c = UIManager.getColor("menuText"); + if (c != null) { + l.add(new SwingColor("menuText", c.getRed(), c.getGreen(), c + .getBlue())); + } + c = UIManager.getColor("textHighlightText"); + if (c != null) { + l.add(new SwingColor("textHighlightText", c.getRed(), c.getGreen(), + c.getBlue())); + } + c = UIManager.getColor("activeCaptionText"); + if (c != null) { + l.add(new SwingColor("activeCaptionText", c.getRed(), c.getGreen(), + c.getBlue())); + } + c = UIManager.getColor("textHighlight"); + if (c != null) { + l.add(new SwingColor("textHighlight", c.getRed(), c.getGreen(), c + .getBlue())); + } + c = UIManager.getColor("controlShadow"); + if (c != null) { + l.add(new SwingColor("controlShadow", c.getRed(), c.getGreen(), c + .getBlue())); + } + c = UIManager.getColor("controlText"); + if (c != null) { + l.add(new SwingColor("controlText", c.getRed(), c.getGreen(), c + .getBlue())); + } + c = UIManager.getColor("menuPressedItemF"); + if (c != null) { + l.add(new SwingColor("menuPressedItemF", c.getRed(), c.getGreen(), + c.getBlue())); + } + c = UIManager.getColor("menuPressedItemB"); + if (c != null) { + l.add(new SwingColor("menuPressedItemB", c.getRed(), c.getGreen(), + c.getBlue())); + } + c = UIManager.getColor("info"); + if (c != null) { + l + .add(new SwingColor("info", c.getRed(), c.getGreen(), c + .getBlue())); + } + c = UIManager.getColor("controlHighlight"); + if (c != null) { + l.add(new SwingColor("controlHighlight", c.getRed(), c.getGreen(), + c.getBlue())); + } + c = UIManager.getColor("scrollbar"); + if (c != null) { + l.add(new SwingColor("scrollbar", c.getRed(), c.getGreen(), c + .getBlue())); + } + c = UIManager.getColor("window"); + if (c != null) { + l.add(new SwingColor("window", c.getRed(), c.getGreen(), c + .getBlue())); + } + c = UIManager.getColor("inactiveCaption"); + if (c != null) { + l.add(new SwingColor("inactiveCaption", c.getRed(), c.getGreen(), c + .getBlue())); + } + c = UIManager.getColor("controlDkShadow"); + if (c != null) { + l.add(new SwingColor("controlDkShadow", c.getRed(), c.getGreen(), c + .getBlue())); + } + c = UIManager.getColor("activeCaption"); + if (c != null) { + l.add(new SwingColor("activeCaption", c.getRed(), c.getGreen(), c + .getBlue())); + } + c = UIManager.getColor("text"); + if (c != null) { + l + .add(new SwingColor("text", c.getRed(), c.getGreen(), c + .getBlue())); + } + c = UIManager.getColor("desktop"); + if (c != null) { + l.add(new SwingColor("desktop", c.getRed(), c.getGreen(), c + .getBlue())); + } + swingColors = (SwingColor[]) l.toArray(new SwingColor[0]); + return swingColors; + } + + /** + * Names of system colors. Note: not localizable, those names + * corresponds to programatical names. + */ + private static final String systemGenerate[] = { "activeCaption", + "activeCaptionBorder", // NOI18N + "activeCaptionText", "control", "controlDkShadow", // NOI18N + "controlHighlight", "controlLtHighlight", // NOI18N + "controlShadow", "controlText", "desktop", // NOI18N + "inactiveCaption", "inactiveCaptionBorder", // NOI18N + "inactiveCaptionText", "info", "infoText", "menu", // NOI18N + "menuText", "scrollbar", "text", "textHighlight", // NOI18N + "textHighlightText", "textInactiveText", "textText", // NOI18N + "window", "windowBorder", "windowText" }; // NOI18N + + /** System colors used in System Palette. */ + private static final Color sColors[] = { SystemColor.activeCaption, + SystemColor.activeCaptionBorder, SystemColor.activeCaptionText, + SystemColor.control, SystemColor.controlDkShadow, + SystemColor.controlHighlight, SystemColor.controlLtHighlight, + SystemColor.controlShadow, SystemColor.controlText, + SystemColor.desktop, SystemColor.inactiveCaption, + SystemColor.inactiveCaptionBorder, SystemColor.inactiveCaptionText, + SystemColor.info, SystemColor.infoText, SystemColor.menu, + SystemColor.menuText, SystemColor.scrollbar, SystemColor.text, + SystemColor.textHighlight, SystemColor.textHighlightText, + SystemColor.textInactiveText, SystemColor.textText, + SystemColor.window, SystemColor.windowBorder, + SystemColor.windowText }; + + private static class SysColor extends BasicNamedColor { + /** + * + */ + private static final long serialVersionUID = 1L; + + public SysColor(final String name, final Color scolor) { + super(name, scolor.getRed(), scolor.getGreen(), scolor.getBlue()); + } + + @Override + public String toString() { + return "SystemColor." + getName(); + } + + @Override + public String getDisplayName() { + return getName(); + } + } + + private static NamedColor[] systemColors = null; + + private static NamedColor[] getSystemColors() { + if (systemColors == null) { + systemColors = new BasicNamedColor[sColors.length]; + for (int i = 0; i < sColors.length; i++) { + systemColors[i] = new SysColor(systemGenerate[i], sColors[i]); + } + } + return systemColors; + } + + /* + * //A cheap and cheesy way to quickly make an English-localized bundle for + * //an array of NamedColor. public static void main(String args[]) { for + * (int i=0; i < SVGColors.length; i++) { System.out.println("# " + + * SVGColors[i].getRed() + "," + SVGColors[i].getGreen() + "," + + * SVGColors[i].getBlue()); String name = SVGColors[i].getName(); + * StringBuffer sb = new StringBuffer(name); sb.replace (0, 1, new + * String(new char[]{Character.toUpperCase(name.charAt(0))})); String + * dispName = sb.toString(); + * + * for (int k=0; k < tros.length; k++) { String lookFor = tros[k]; + * StringBuffer sb2 = new StringBuffer(lookFor); sb.replace (0, 1, new + * String(new char[]{Character.toUpperCase(lookFor.charAt(0))})); String + * replaceWith = " " + sb2.toString(); dispName = + * org.openide.util.Utilities.replaceString( dispName, tros[k], + * replaceWith); } + * + * System.out.println(SVGColors[i].getName() + "=" + dispName); } } + * + * private static String[] tros = new String[] { "brown", "blue", "red", + * "violet", "orchid", "green", "yellow", "orange", "black", "gray", "grey", + * "white", "maroon", "goldenrod", "cream", "spring", "purple", "sea", + * "magenta", "steel", "slate","pink", "cyan", "chiffon", "coral", "wheat", + * "blush", "brick","olive","khaki", "silk","crimson","wood","almond", + * "smoke", "puff", "whip", "peach", "lace", + * "rose","turquoise","aquamarine","salmon", "sky" }; + */ + /** + * //some boilerplate to make a list of swing colors public static void main + * (String[] args) { javax.swing.LookAndFeel lf = new + * javax.swing.plaf.metal.MetalLookAndFeel(); javax.swing.UIDefaults def = + * javax.swing.UIManager.getLookAndFeel().getDefaults(); java.util.Iterator + * i = new java.util.ArrayList(def.keySet()).iterator(); while (i.hasNext()) + * { Object o = i.next(); // System.err.println(o); Object result = + * def.get(o); if (result instanceof Color) { String s = o.toString(); if + * (s.indexOf(".") == -1) { System.err.println("c = UIManager.getColor(\"" + + * s +"\");\nif (c != null) {\n l.add(new SwingColor(\"" + s + + * "\", c.getRed(), c.getGreen(), c.getBlue()));\n}"); } } } + * System.err.println("Done"); } + */ +} diff --git a/net/java/dev/colorchooser/RecentColors.java b/net/java/dev/colorchooser/RecentColors.java new file mode 100644 index 0000000..9e4ec7f --- /dev/null +++ b/net/java/dev/colorchooser/RecentColors.java @@ -0,0 +1,331 @@ +/*DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 2006-2008. Tim Boudreau. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. This particular file is designated + * as subject to the "Classpath" exception as provided + * in the GPL Version 2 section of the License file that + * accompanied this code. + */ +package net.java.dev.colorchooser; + +import java.awt.Color; +import java.awt.Dimension; +import java.security.AccessControlException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import java.util.MissingResourceException; +import java.util.ResourceBundle; +import java.util.Stack; +import java.util.StringTokenizer; +import java.util.prefs.Preferences; + +/** + * Palette implementation that can have recent colors added to it. + * + * @author Tim Boudreau + */ +class RecentColors extends Palette { + + private Palette palette; + private boolean changed=true; + + /** Creates a new instance of RecentColors */ + private RecentColors() { + } + + private Palette getWrapped() { + if (changed||palette==null) { + palette=createPalette(); + changed=false; + } + return palette; + } + + @Override + public java.awt.Color getColorAt(final int x, final int y) { + return getWrapped().getColorAt(x, y); + } + + @Override + public String getDisplayName() { + try { + return ResourceBundle.getBundle( + "org.netbeans.swing.colorchooser.Bundle").getString( + "recent"); // NOI18N + } catch (final MissingResourceException mre) { + // mre.printStackTrace(); + return "Recent colors"; + } + } + + @Override + public Dimension getSize() { + final Dimension result=((PredefinedPalette) getWrapped()).calcSize(); + return result; + } + + @Override + public void paintTo(final java.awt.Graphics g) { + getWrapped().paintTo(g); + } + + @Override + public String getNameAt(final int x, final int y) { + return getWrapped().getNameAt(x, y); + } + Stack stack=new Stack(); + + void add(final Color c) { + if (c instanceof RecentColor) { + return; + } + if (stack.indexOf(c)==-1) { + final String name=c instanceof PredefinedPalette.BasicNamedColor?((PredefinedPalette.BasicNamedColor) c).getDisplayName() + :null; + final String toString=c instanceof PredefinedPalette.BasicNamedColor?((PredefinedPalette.BasicNamedColor) c).toString() + :null; + final Color col=new RecentColor(name, c.getRed(), c.getGreen(), c.getBlue(), toString); + stack.push(col); + changed=true; + palette=null; + if (c instanceof NamedColor) { + addToNameCache((NamedColor) c); + } + saveToPrefs(); + } + } + public static final String INNER_DELIMITER="^$"; + public static final String OUTER_DELIMITER="!*"; + + public void saveToPrefs() { + final Preferences prefs=getPreferences(); + if (prefs==null) { + return; + } + int count=0; + final StringBuffer sb=new StringBuffer(); + final Stack stack=new Stack(); + stack.addAll(this.stack); + while (!stack.isEmpty()&&count<64) { + count++; + final Color c=(Color) stack.pop(); + if (c instanceof DummyColor) { + break; + } + String name="null"; + if (c instanceof PredefinedPalette.BasicNamedColor) { + final PredefinedPalette.BasicNamedColor nc=(PredefinedPalette.BasicNamedColor) c; + name=nc.getDisplayName(); + } + if (name=="null") { // NOI18N + name=null; + } + sb.append(name); + sb.append(INNER_DELIMITER); + sb.append(c.getRed()); + sb.append(INNER_DELIMITER); + sb.append(c.getGreen()); + sb.append(INNER_DELIMITER); + sb.append(c.getBlue()); + sb.append(INNER_DELIMITER); + if (c instanceof PredefinedPalette.BasicNamedColor) { + sb.append(c.toString()); + } else { + sb.append('x'); + } + sb.append(OUTER_DELIMITER); // NOI18N + } + prefs.put("recentColors", sb.toString()); // NOI18N + } + static Map namedMap=null; + + static NamedColor findNamedColor(final Color color) { + if (namedMap==null) { + return null; + } + final NamedColor result=(NamedColor) namedMap.get(new Integer(color.getRGB())); + return result; + } + + static void addToNameCache(final NamedColor color) { + if (namedMap==null) { + namedMap=new HashMap(40); + } + namedMap.put(new Integer(color.getRGB()), color); + } + + private Preferences getPreferences() { + try { + final Preferences base=Preferences.userNodeForPackage(getClass()); + return base.node("1.5"); // NOI18N + } catch (final Exception ace) { + return null; + } + } + + public void loadFromPrefs() { + final Preferences prefs=getPreferences(); + if (prefs==null) { + return; + } + final String s=prefs.get("recentColors", null); // NOI18N + stack=new Stack(); + final Color[] col=new Color[64]; + Arrays.fill(col, new DummyColor()); + int count=63; + try { + if (s!=null) { + // a weird but highly unlikely delimiter + final StringTokenizer tok=new StringTokenizer(s, + OUTER_DELIMITER); // NOI18N + while (tok.hasMoreTokens()&&count>=0) { + final String curr=tok.nextToken(); + // another weird but highly unlikely delimiter + final StringTokenizer tk2=new StringTokenizer(curr, + INNER_DELIMITER); // NOI18N + while (tk2.hasMoreTokens()) { + String name=tk2.nextToken(); + if ("null".equals(name)) { + name=null; + } + final int r=Integer.parseInt(tk2.nextToken()); + final int g=Integer.parseInt(tk2.nextToken()); + final int b=Integer.parseInt(tk2.nextToken()); + final String toString=tk2.nextToken(); + if ("x".equals(toString)) { // NOI18N + col[count]=new RecentColor(name, r, g, b); + } else { + col[count]=new RecentColor(name, r, g, b, + toString); + } + addToNameCache((NamedColor) col[count]); + } + count--; + } + } + stack.addAll(Arrays.asList(col)); + } catch (final Exception e) { + System.err.println("Error loading color preferences"); // NOI18N + e.printStackTrace(); + } + } + + private Palette createPalette() { + final PredefinedPalette.BasicNamedColor[] nc=(PredefinedPalette.BasicNamedColor[]) stack.toArray(new PredefinedPalette.BasicNamedColor[0]); + return new PredefinedPalette("", nc); // NOI18N + } + + private class RecentColor extends PredefinedPalette.BasicNamedColor { + + /** + * + */ + private static final long serialVersionUID=1L; + String displayName; + String toString=null; + + public RecentColor(final String name, final int r, final int g, + final int b) { + super(name, r, g, b); + displayName=name; + } + + public RecentColor(final String name, final int r, final int g, + final int b, final String toString) { + this(name, r, g, b); + displayName=name; + this.toString=toString; + } + + @Override + public int compareTo(final Object o) { + return stack.indexOf(o)-stack.indexOf(this); + } + + @Override + public String getDisplayName() { + return displayName; + } + + @Override + public boolean equals(final Object o) { + if (o instanceof Color) { + final Color c=(Color) o; + return c.getRGB()==getRGB(); + } + return false; + } + + @Override + public int hashCode() { + return getRGB(); + } + + @Override + public String toString() { + if (toString!=null) { + return toString; + } else { + return "new java.awt.Color("+getRed()+","+getGreen() + +","+getBlue()+")"; // NOI18N + } + } + } + private static RecentColors defaultInstance=null; + + public static final RecentColors getDefault() { + if (defaultInstance==null) { + defaultInstance=new RecentColors(); + ((RecentColors) defaultInstance).loadFromPrefs(); + } + return defaultInstance; + } + + /** + * A stand in for colors to fill up the array of recent colors until we + * really have something to put there. + */ + private class DummyColor extends RecentColor { + + /** + * + */ + private static final long serialVersionUID=1L; + + public DummyColor() { + super(null, 0, 0, 0); + } + + @Override + public String getDisplayName() { + return null; + } + + // Ensure that no color will match this, so black swing colors can + // be put into the recent colors array + @Override + public boolean equals(final Object o) { + return o==this; + } + + @Override + public int hashCode() { + return System.identityHashCode(this); + } + } + + @Override + public void setSize(final int w, final int h) { + } +} diff --git a/net/java/dev/colorchooser/chooserIcon.gif b/net/java/dev/colorchooser/chooserIcon.gif new file mode 100644 index 0000000000000000000000000000000000000000..393e7bf1246e53fe6ccb4c1c5836f38aad694b65 GIT binary patch literal 233 zcmVr4! zl3Q_9Kuj}~uy9dcHM7rk2M7be)@G``RS60N7#a-E-%=|r4aLhb;OIXG2Lk5Zlb@Mp z=8G&vkNyAv0RR90A^8La0018VEC2ui01yBW06+z1;3tk`DQes1b-_RwiSksK_i0?N zZ)WMa1;oNJ@mMZ4oG!=fDLv4r6iQkN2!#cMA)(nu({NHlE^B(XB@?Y&Hcd~~H7JWz jz9Q?Oa9}j-HC1y$4ira$V0#D(S`ZmVcqRY{B_RMizqVVk literal 0 HcmV?d00001 diff --git a/net/java/dev/colorchooser/chooserIcon32.gif b/net/java/dev/colorchooser/chooserIcon32.gif new file mode 100644 index 0000000000000000000000000000000000000000..5b13353527766767dc8e772c40c49c02d7b1ed31 GIT binary patch literal 560 zcmZ?wbhEHbRA5kGxXQq=dD*IUi`K20w`u9DZ40OGm^*pT%>DyYdya5&vR*ux^5<#J z=X=FEno?%Qs;{qA9p04s_(DT;n1hf2=dBYRrMZ5Oju$xFYVKN9y13ix$+7$^hx*R% zn{;Z|v?E(*-(KKxxy$(3Y`cq1TKhIEc-Exwu3hPEm)f%q^%vb*&$@M9*GcYJwd~rp zYumSPZ*Fd8U|{(F|38o<2`K(#VPs&?XV3xZ0{Mx7?f-%41s*z5{U??bajr};n!4gk zq^C~5D1XN3w^at=$!t@kW}bf*!Xcy9=e}%*jo+^gw-0e~^u7A+uUb~&Tvbz7+tAdk z->TN$(O6#5+pp0%DR)Z$^zNSOzS$G!=Bufz>#bP1YW13xPRW`os;YYI+t}IISXr2v z7#XybWM!nKgarin^eW{P<3zKexr-+@C%jvePa<-{rR;K9Xhm-p^Jc=+h?lXu-8 z?_zy+{jkif6MWpK-(A}M>BY_0JDxfV@yh8lUf+;AL!jW`f!e2Q{swR7z0bt@t7pfF ztNu!6Y~oB&M?4H3S+ Z#XJcfr1^`PO>I(n> literal 0 HcmV?d00001 diff --git a/netscape/javascript/JSObject.java b/netscape/javascript/JSObject.java new file mode 100644 index 0000000..9c48c09 --- /dev/null +++ b/netscape/javascript/JSObject.java @@ -0,0 +1,178 @@ +/* -*- Mode: Java; tab-width: 8; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is Mozilla Communicator client code, released + * March 31, 1998. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU Public License (the "GPL"), in which case the + * provisions of the GPL are applicable instead of those above. + * If you wish to allow use of your version of this file only + * under the terms of the GPL and not to allow others to use your + * version of this file under the NPL, indicate your decision by + * deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete + * the provisions above, a recipient may use your version of this + * file under either the NPL or the GPL. + */ + +/* more doc todo: + * threads + * gc + * + * + */ + +package netscape.javascript; + +import java.applet.Applet; + +/** + * JSObject allows Java to manipulate objects that are + * defined in JavaScript. + * Values passed from Java to JavaScript are converted as + * follows:
    + *
  • JSObject is converted to the original JavaScript object + *
  • Any other Java object is converted to a JavaScript wrapper, + * which can be used to access methods and fields of the java object. + * Converting this wrapper to a string will call the toString method + * on the original object, converting to a number will call the + * doubleValue method if possible and fail otherwise. Converting + * to a boolean will try to call the booleanValue method in the + * same way. + *
  • Java arrays are wrapped with a JavaScript object that understands + * array.length and array[index] + *
  • A Java boolean is converted to a JavaScript boolean + *
  • Java byte, char, short, int, long, float, and double are converted + * to JavaScript numbers + *
+ * Values passed from JavaScript to Java are converted as follows:
    + *
  • objects which are wrappers around java objects are unwrapped + *
  • other objects are wrapped with a JSObject + *
  • strings, numbers and booleans are converted to String, Double, + * and Boolean objects respectively + *
+ * This means that all JavaScript values show up as some kind + * of java.lang.Object in Java. In order to make much use of them, + * you will have to cast them to the appropriate subclass of Object, + * e.g. (String) window.getMember("name"); or + * (JSObject) window.getMember("document");. + */ +public final class JSObject { + /* the internal object data */ + private int internal; + private long long_internal; + + /** + * initialize + */ + private static native void initClass(); + static { + // On MRJ, this property won't exist, because the library is preloaded. + String liveConnectLibrary = System.getProperty("netscape.jsj.dll", null); + if (liveConnectLibrary != null) { + System.loadLibrary(liveConnectLibrary); + initClass(); + } + } + + /** + * it is illegal to construct a JSObject manually + */ + private JSObject(int jsobj_addr) { + internal = jsobj_addr; + } + + private JSObject(long jsobj_addr) { + long_internal = jsobj_addr; + } + + /** + * Retrieves a named member of a JavaScript object. + * Equivalent to "this.name" in JavaScript. + */ + public native Object getMember(String name); + + /** + * Retrieves an indexed member of a JavaScript object. + * Equivalent to "this[index]" in JavaScript. + */ +// public Object getMember(int index) { return getSlot(index); } + public native Object getSlot(int index); + + /** + * Sets a named member of a JavaScript object. + * Equivalent to "this.name = value" in JavaScript. + */ + public native void setMember(String name, Object value); + + /** + * Sets an indexed member of a JavaScript object. + * Equivalent to "this[index] = value" in JavaScript. + */ +// public void setMember(int index, Object value) { +// setSlot(index, value); +// } + public native void setSlot(int index, Object value); + + /** + * Removes a named member of a JavaScript object. + */ + public native void removeMember(String name); + + /** + * Calls a JavaScript method. + * Equivalent to "this.methodName(args[0], args[1], ...)" in JavaScript. + */ + public native Object call(String methodName, Object args[]); + + /** + * Evaluates a JavaScript expression. The expression is a string + * of JavaScript source code which will be evaluated in the context + * given by "this". + */ + public native Object eval(String s); + + /** + * Converts a JSObject to a String. + */ + public native String toString(); + + // should use some sort of identifier rather than String + // is "property" the right word? + // native String[] listProperties(); + + + /** + * get a JSObject for the window containing the given applet + */ + public static native JSObject getWindow(Applet applet); + + /** + * Finalization decrements the reference count on the corresponding + * JavaScript object. + */ + protected native void finalize(); + + /** + * Override java.lang.Object.equals() because identity is not preserved + * with instances of JSObject. + */ + public native boolean equals(Object obj); +} \ No newline at end of file diff --git a/org/mozilla/classfile/ByteCode.java b/org/mozilla/classfile/ByteCode.java new file mode 100644 index 0000000..fa4713e --- /dev/null +++ b/org/mozilla/classfile/ByteCode.java @@ -0,0 +1,274 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-1999 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Roger Lawrence + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +package org.mozilla.classfile; + +/** + * This class provides opcode values expected by the JVM in Java class files. + * + * It also provides tables for internal use by the ClassFileWriter. + * + * @author Roger Lawrence + */ +public class ByteCode { + + /** + * The byte opcodes defined by the Java Virtual Machine. + */ + public static final int + NOP = 0x00, + ACONST_NULL = 0x01, + ICONST_M1 = 0x02, + ICONST_0 = 0x03, + ICONST_1 = 0x04, + ICONST_2 = 0x05, + ICONST_3 = 0x06, + ICONST_4 = 0x07, + ICONST_5 = 0x08, + LCONST_0 = 0x09, + LCONST_1 = 0x0A, + FCONST_0 = 0x0B, + FCONST_1 = 0x0C, + FCONST_2 = 0x0D, + DCONST_0 = 0x0E, + DCONST_1 = 0x0F, + BIPUSH = 0x10, + SIPUSH = 0x11, + LDC = 0x12, + LDC_W = 0x13, + LDC2_W = 0x14, + ILOAD = 0x15, + LLOAD = 0x16, + FLOAD = 0x17, + DLOAD = 0x18, + ALOAD = 0x19, + ILOAD_0 = 0x1A, + ILOAD_1 = 0x1B, + ILOAD_2 = 0x1C, + ILOAD_3 = 0x1D, + LLOAD_0 = 0x1E, + LLOAD_1 = 0x1F, + LLOAD_2 = 0x20, + LLOAD_3 = 0x21, + FLOAD_0 = 0x22, + FLOAD_1 = 0x23, + FLOAD_2 = 0x24, + FLOAD_3 = 0x25, + DLOAD_0 = 0x26, + DLOAD_1 = 0x27, + DLOAD_2 = 0x28, + DLOAD_3 = 0x29, + ALOAD_0 = 0x2A, + ALOAD_1 = 0x2B, + ALOAD_2 = 0x2C, + ALOAD_3 = 0x2D, + IALOAD = 0x2E, + LALOAD = 0x2F, + FALOAD = 0x30, + DALOAD = 0x31, + AALOAD = 0x32, + BALOAD = 0x33, + CALOAD = 0x34, + SALOAD = 0x35, + ISTORE = 0x36, + LSTORE = 0x37, + FSTORE = 0x38, + DSTORE = 0x39, + ASTORE = 0x3A, + ISTORE_0 = 0x3B, + ISTORE_1 = 0x3C, + ISTORE_2 = 0x3D, + ISTORE_3 = 0x3E, + LSTORE_0 = 0x3F, + LSTORE_1 = 0x40, + LSTORE_2 = 0x41, + LSTORE_3 = 0x42, + FSTORE_0 = 0x43, + FSTORE_1 = 0x44, + FSTORE_2 = 0x45, + FSTORE_3 = 0x46, + DSTORE_0 = 0x47, + DSTORE_1 = 0x48, + DSTORE_2 = 0x49, + DSTORE_3 = 0x4A, + ASTORE_0 = 0x4B, + ASTORE_1 = 0x4C, + ASTORE_2 = 0x4D, + ASTORE_3 = 0x4E, + IASTORE = 0x4F, + LASTORE = 0x50, + FASTORE = 0x51, + DASTORE = 0x52, + AASTORE = 0x53, + BASTORE = 0x54, + CASTORE = 0x55, + SASTORE = 0x56, + POP = 0x57, + POP2 = 0x58, + DUP = 0x59, + DUP_X1 = 0x5A, + DUP_X2 = 0x5B, + DUP2 = 0x5C, + DUP2_X1 = 0x5D, + DUP2_X2 = 0x5E, + SWAP = 0x5F, + IADD = 0x60, + LADD = 0x61, + FADD = 0x62, + DADD = 0x63, + ISUB = 0x64, + LSUB = 0x65, + FSUB = 0x66, + DSUB = 0x67, + IMUL = 0x68, + LMUL = 0x69, + FMUL = 0x6A, + DMUL = 0x6B, + IDIV = 0x6C, + LDIV = 0x6D, + FDIV = 0x6E, + DDIV = 0x6F, + IREM = 0x70, + LREM = 0x71, + FREM = 0x72, + DREM = 0x73, + INEG = 0x74, + LNEG = 0x75, + FNEG = 0x76, + DNEG = 0x77, + ISHL = 0x78, + LSHL = 0x79, + ISHR = 0x7A, + LSHR = 0x7B, + IUSHR = 0x7C, + LUSHR = 0x7D, + IAND = 0x7E, + LAND = 0x7F, + IOR = 0x80, + LOR = 0x81, + IXOR = 0x82, + LXOR = 0x83, + IINC = 0x84, + I2L = 0x85, + I2F = 0x86, + I2D = 0x87, + L2I = 0x88, + L2F = 0x89, + L2D = 0x8A, + F2I = 0x8B, + F2L = 0x8C, + F2D = 0x8D, + D2I = 0x8E, + D2L = 0x8F, + D2F = 0x90, + I2B = 0x91, + I2C = 0x92, + I2S = 0x93, + LCMP = 0x94, + FCMPL = 0x95, + FCMPG = 0x96, + DCMPL = 0x97, + DCMPG = 0x98, + IFEQ = 0x99, + IFNE = 0x9A, + IFLT = 0x9B, + IFGE = 0x9C, + IFGT = 0x9D, + IFLE = 0x9E, + IF_ICMPEQ = 0x9F, + IF_ICMPNE = 0xA0, + IF_ICMPLT = 0xA1, + IF_ICMPGE = 0xA2, + IF_ICMPGT = 0xA3, + IF_ICMPLE = 0xA4, + IF_ACMPEQ = 0xA5, + IF_ACMPNE = 0xA6, + GOTO = 0xA7, + JSR = 0xA8, + RET = 0xA9, + TABLESWITCH = 0xAA, + LOOKUPSWITCH = 0xAB, + IRETURN = 0xAC, + LRETURN = 0xAD, + FRETURN = 0xAE, + DRETURN = 0xAF, + ARETURN = 0xB0, + RETURN = 0xB1, + GETSTATIC = 0xB2, + PUTSTATIC = 0xB3, + GETFIELD = 0xB4, + PUTFIELD = 0xB5, + INVOKEVIRTUAL = 0xB6, + INVOKESPECIAL = 0xB7, + INVOKESTATIC = 0xB8, + INVOKEINTERFACE = 0xB9, + NEW = 0xBB, + NEWARRAY = 0xBC, + ANEWARRAY = 0xBD, + ARRAYLENGTH = 0xBE, + ATHROW = 0xBF, + CHECKCAST = 0xC0, + INSTANCEOF = 0xC1, + MONITORENTER = 0xC2, + MONITOREXIT = 0xC3, + WIDE = 0xC4, + MULTIANEWARRAY = 0xC5, + IFNULL = 0xC6, + IFNONNULL = 0xC7, + GOTO_W = 0xC8, + JSR_W = 0xC9, + BREAKPOINT = 0xCA, + + IMPDEP1 = 0xFE, + IMPDEP2 = 0xFF; + + /** + * Types for the NEWARRAY opcode. + */ + public static final byte + T_BOOLEAN = 4, + T_CHAR = 5, + T_FLOAT = 6, + T_DOUBLE = 7, + T_BYTE = 8, + T_SHORT = 9, + T_INT = 10, + T_LONG = 11; + + +} diff --git a/org/mozilla/classfile/ClassFileWriter.java b/org/mozilla/classfile/ClassFileWriter.java new file mode 100644 index 0000000..f2d76cb --- /dev/null +++ b/org/mozilla/classfile/ClassFileWriter.java @@ -0,0 +1,3043 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-1999 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Roger Lawrence + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +package org.mozilla.classfile; + +import org.mozilla.javascript.ObjToIntMap; +import org.mozilla.javascript.ObjArray; +import org.mozilla.javascript.UintMap; + +import java.io.*; + +/** + * ClassFileWriter + * + * A ClassFileWriter is used to write a Java class file. Methods are + * provided to create fields and methods, and within methods to write + * Java bytecodes. + * + * @author Roger Lawrence + */ +public class ClassFileWriter { + + /** + * Thrown for cases where the error in generating the class file is + * due to a program size constraints rather than a likely bug in the + * compiler. + */ + public static class ClassFileFormatException extends RuntimeException { + + private static final long serialVersionUID = 1263998431033790599L; + + ClassFileFormatException(String message) { + super(message); + } + } + + /** + * Construct a ClassFileWriter for a class. + * + * @param className the name of the class to write, including + * full package qualification. + * @param superClassName the name of the superclass of the class + * to write, including full package qualification. + * @param sourceFileName the name of the source file to use for + * producing debug information, or null if debug information + * is not desired + */ + public ClassFileWriter(String className, String superClassName, + String sourceFileName) + { + generatedClassName = className; + itsConstantPool = new ConstantPool(this); + itsThisClassIndex = itsConstantPool.addClass(className); + itsSuperClassIndex = itsConstantPool.addClass(superClassName); + if (sourceFileName != null) + itsSourceFileNameIndex = itsConstantPool.addUtf8(sourceFileName); + itsFlags = ACC_PUBLIC; + } + + public final String getClassName() + { + return generatedClassName; + } + + /** + * Add an interface implemented by this class. + * + * This method may be called multiple times for classes that + * implement multiple interfaces. + * + * @param interfaceName a name of an interface implemented + * by the class being written, including full package + * qualification. + */ + public void addInterface(String interfaceName) { + short interfaceIndex = itsConstantPool.addClass(interfaceName); + itsInterfaces.add(new Short(interfaceIndex)); + } + + public static final short + ACC_PUBLIC = 0x0001, + ACC_PRIVATE = 0x0002, + ACC_PROTECTED = 0x0004, + ACC_STATIC = 0x0008, + ACC_FINAL = 0x0010, + ACC_SYNCHRONIZED = 0x0020, + ACC_VOLATILE = 0x0040, + ACC_TRANSIENT = 0x0080, + ACC_NATIVE = 0x0100, + ACC_ABSTRACT = 0x0400; + + /** + * Set the class's flags. + * + * Flags must be a set of the following flags, bitwise or'd + * together: + * ACC_PUBLIC + * ACC_PRIVATE + * ACC_PROTECTED + * ACC_FINAL + * ACC_ABSTRACT + * TODO: check that this is the appropriate set + * @param flags the set of class flags to set + */ + public void setFlags(short flags) { + itsFlags = flags; + } + + static String getSlashedForm(String name) + { + return name.replace('.', '/'); + } + + /** + * Convert Java class name in dot notation into + * "Lname-with-dots-replaced-by-slashes;" form suitable for use as + * JVM type signatures. + */ + public static String classNameToSignature(String name) + { + int nameLength = name.length(); + int colonPos = 1 + nameLength; + char[] buf = new char[colonPos + 1]; + buf[0] = 'L'; + buf[colonPos] = ';'; + name.getChars(0, nameLength, buf, 1); + for (int i = 1; i != colonPos; ++i) { + if (buf[i] == '.') { + buf[i] = '/'; + } + } + return new String(buf, 0, colonPos + 1); + } + + /** + * Add a field to the class. + * + * @param fieldName the name of the field + * @param type the type of the field using ... + * @param flags the attributes of the field, such as ACC_PUBLIC, etc. + * bitwise or'd together + */ + public void addField(String fieldName, String type, short flags) { + short fieldNameIndex = itsConstantPool.addUtf8(fieldName); + short typeIndex = itsConstantPool.addUtf8(type); + itsFields.add(new ClassFileField(fieldNameIndex, typeIndex, flags)); + } + + /** + * Add a field to the class. + * + * @param fieldName the name of the field + * @param type the type of the field using ... + * @param flags the attributes of the field, such as ACC_PUBLIC, etc. + * bitwise or'd together + * @param value an initial integral value + */ + public void addField(String fieldName, String type, short flags, + int value) + { + short fieldNameIndex = itsConstantPool.addUtf8(fieldName); + short typeIndex = itsConstantPool.addUtf8(type); + ClassFileField field = new ClassFileField(fieldNameIndex, typeIndex, + flags); + field.setAttributes(itsConstantPool.addUtf8("ConstantValue"), + (short)0, + (short)0, + itsConstantPool.addConstant(value)); + itsFields.add(field); + } + + /** + * Add a field to the class. + * + * @param fieldName the name of the field + * @param type the type of the field using ... + * @param flags the attributes of the field, such as ACC_PUBLIC, etc. + * bitwise or'd together + * @param value an initial long value + */ + public void addField(String fieldName, String type, short flags, + long value) + { + short fieldNameIndex = itsConstantPool.addUtf8(fieldName); + short typeIndex = itsConstantPool.addUtf8(type); + ClassFileField field = new ClassFileField(fieldNameIndex, typeIndex, + flags); + field.setAttributes(itsConstantPool.addUtf8("ConstantValue"), + (short)0, + (short)2, + itsConstantPool.addConstant(value)); + itsFields.add(field); + } + + /** + * Add a field to the class. + * + * @param fieldName the name of the field + * @param type the type of the field using ... + * @param flags the attributes of the field, such as ACC_PUBLIC, etc. + * bitwise or'd together + * @param value an initial double value + */ + public void addField(String fieldName, String type, short flags, + double value) + { + short fieldNameIndex = itsConstantPool.addUtf8(fieldName); + short typeIndex = itsConstantPool.addUtf8(type); + ClassFileField field = new ClassFileField(fieldNameIndex, typeIndex, + flags); + field.setAttributes(itsConstantPool.addUtf8("ConstantValue"), + (short)0, + (short)2, + itsConstantPool.addConstant(value)); + itsFields.add(field); + } + + /** + * Add Information about java variable to use when generating the local + * variable table. + * + * @param name variable name. + * @param type variable type as bytecode descriptor string. + * @param startPC the starting bytecode PC where this variable is live, + * or -1 if it does not have a Java register. + * @param register the Java register number of variable + * or -1 if it does not have a Java register. + */ + public void addVariableDescriptor(String name, String type, int startPC, int register) + { + int nameIndex = itsConstantPool.addUtf8(name); + int descriptorIndex = itsConstantPool.addUtf8(type); + int [] chunk = { nameIndex, descriptorIndex, startPC, register }; + if (itsVarDescriptors == null) { + itsVarDescriptors = new ObjArray(); + } + itsVarDescriptors.add(chunk); + } + + /** + * Add a method and begin adding code. + * + * This method must be called before other methods for adding code, + * exception tables, etc. can be invoked. + * + * @param methodName the name of the method + * @param type a string representing the type + * @param flags the attributes of the field, such as ACC_PUBLIC, etc. + * bitwise or'd together + */ + public void startMethod(String methodName, String type, short flags) { + short methodNameIndex = itsConstantPool.addUtf8(methodName); + short typeIndex = itsConstantPool.addUtf8(type); + itsCurrentMethod = new ClassFileMethod(methodNameIndex, typeIndex, + flags); + itsMethods.add(itsCurrentMethod); + } + + /** + * Complete generation of the method. + * + * After this method is called, no more code can be added to the + * method begun with startMethod. + * + * @param maxLocals the maximum number of local variable slots + * (a.k.a. Java registers) used by the method + */ + public void stopMethod(short maxLocals) { + if (itsCurrentMethod == null) + throw new IllegalStateException("No method to stop"); + + fixLabelGotos(); + + itsMaxLocals = maxLocals; + + int lineNumberTableLength = 0; + if (itsLineNumberTable != null) { + // 6 bytes for the attribute header + // 2 bytes for the line number count + // 4 bytes for each entry + lineNumberTableLength = 6 + 2 + (itsLineNumberTableTop * 4); + } + + int variableTableLength = 0; + if (itsVarDescriptors != null) { + // 6 bytes for the attribute header + // 2 bytes for the variable count + // 10 bytes for each entry + variableTableLength = 6 + 2 + (itsVarDescriptors.size() * 10); + } + + int attrLength = 2 + // attribute_name_index + 4 + // attribute_length + 2 + // max_stack + 2 + // max_locals + 4 + // code_length + itsCodeBufferTop + + 2 + // exception_table_length + (itsExceptionTableTop * 8) + + 2 + // attributes_count + lineNumberTableLength + + variableTableLength; + + if (attrLength > 65536) { + // See http://java.sun.com/docs/books/jvms/second_edition/html/ClassFile.doc.html, + // section 4.10, "The amount of code per non-native, non-abstract + // method is limited to 65536 bytes... + throw new ClassFileFormatException( + "generated bytecode for method exceeds 64K limit."); + } + byte[] codeAttribute = new byte[attrLength]; + int index = 0; + int codeAttrIndex = itsConstantPool.addUtf8("Code"); + index = putInt16(codeAttrIndex, codeAttribute, index); + attrLength -= 6; // discount the attribute header + index = putInt32(attrLength, codeAttribute, index); + index = putInt16(itsMaxStack, codeAttribute, index); + index = putInt16(itsMaxLocals, codeAttribute, index); + index = putInt32(itsCodeBufferTop, codeAttribute, index); + System.arraycopy(itsCodeBuffer, 0, codeAttribute, index, + itsCodeBufferTop); + index += itsCodeBufferTop; + + if (itsExceptionTableTop > 0) { + index = putInt16(itsExceptionTableTop, codeAttribute, index); + for (int i = 0; i < itsExceptionTableTop; i++) { + ExceptionTableEntry ete = itsExceptionTable[i]; + short startPC = (short)getLabelPC(ete.itsStartLabel); + short endPC = (short)getLabelPC(ete.itsEndLabel); + short handlerPC = (short)getLabelPC(ete.itsHandlerLabel); + short catchType = ete.itsCatchType; + if (startPC == -1) + throw new IllegalStateException("start label not defined"); + if (endPC == -1) + throw new IllegalStateException("end label not defined"); + if (handlerPC == -1) + throw new IllegalStateException( + "handler label not defined"); + + index = putInt16(startPC, codeAttribute, index); + index = putInt16(endPC, codeAttribute, index); + index = putInt16(handlerPC, codeAttribute, index); + index = putInt16(catchType, codeAttribute, index); + } + } + else { + // write 0 as exception table length + index = putInt16(0, codeAttribute, index); + } + + int attributeCount = 0; + if (itsLineNumberTable != null) + attributeCount++; + if (itsVarDescriptors != null) + attributeCount++; + index = putInt16(attributeCount, codeAttribute, index); + + if (itsLineNumberTable != null) { + int lineNumberTableAttrIndex + = itsConstantPool.addUtf8("LineNumberTable"); + index = putInt16(lineNumberTableAttrIndex, codeAttribute, index); + int tableAttrLength = 2 + (itsLineNumberTableTop * 4); + index = putInt32(tableAttrLength, codeAttribute, index); + index = putInt16(itsLineNumberTableTop, codeAttribute, index); + for (int i = 0; i < itsLineNumberTableTop; i++) { + index = putInt32(itsLineNumberTable[i], codeAttribute, index); + } + } + + if (itsVarDescriptors != null) { + int variableTableAttrIndex + = itsConstantPool.addUtf8("LocalVariableTable"); + index = putInt16(variableTableAttrIndex, codeAttribute, index); + int varCount = itsVarDescriptors.size(); + int tableAttrLength = 2 + (varCount * 10); + index = putInt32(tableAttrLength, codeAttribute, index); + index = putInt16(varCount, codeAttribute, index); + for (int i = 0; i < varCount; i++) { + int[] chunk = (int[])itsVarDescriptors.get(i); + int nameIndex = chunk[0]; + int descriptorIndex = chunk[1]; + int startPC = chunk[2]; + int register = chunk[3]; + int length = itsCodeBufferTop - startPC; + + index = putInt16(startPC, codeAttribute, index); + index = putInt16(length, codeAttribute, index); + index = putInt16(nameIndex, codeAttribute, index); + index = putInt16(descriptorIndex, codeAttribute, index); + index = putInt16(register, codeAttribute, index); + } + } + + itsCurrentMethod.setCodeAttribute(codeAttribute); + + itsExceptionTable = null; + itsExceptionTableTop = 0; + itsLineNumberTableTop = 0; + itsCodeBufferTop = 0; + itsCurrentMethod = null; + itsMaxStack = 0; + itsStackTop = 0; + itsLabelTableTop = 0; + itsFixupTableTop = 0; + itsVarDescriptors = null; + } + + /** + * Add the single-byte opcode to the current method. + * + * @param theOpCode the opcode of the bytecode + */ + public void add(int theOpCode) { + if (opcodeCount(theOpCode) != 0) + throw new IllegalArgumentException("Unexpected operands"); + int newStack = itsStackTop + stackChange(theOpCode); + if (newStack < 0 || Short.MAX_VALUE < newStack) badStack(newStack); + if (DEBUGCODE) + System.out.println("Add " + bytecodeStr(theOpCode)); + addToCodeBuffer(theOpCode); + itsStackTop = (short)newStack; + if (newStack > itsMaxStack) itsMaxStack = (short)newStack; + if (DEBUGSTACK) { + System.out.println("After "+bytecodeStr(theOpCode) + +" stack = "+itsStackTop); + } + } + + /** + * Add a single-operand opcode to the current method. + * + * @param theOpCode the opcode of the bytecode + * @param theOperand the operand of the bytecode + */ + public void add(int theOpCode, int theOperand) { + if (DEBUGCODE) { + System.out.println("Add "+bytecodeStr(theOpCode) + +", "+Integer.toHexString(theOperand)); + } + int newStack = itsStackTop + stackChange(theOpCode); + if (newStack < 0 || Short.MAX_VALUE < newStack) badStack(newStack); + + switch (theOpCode) { + case ByteCode.GOTO : + // fallthru... + case ByteCode.IFEQ : + case ByteCode.IFNE : + case ByteCode.IFLT : + case ByteCode.IFGE : + case ByteCode.IFGT : + case ByteCode.IFLE : + case ByteCode.IF_ICMPEQ : + case ByteCode.IF_ICMPNE : + case ByteCode.IF_ICMPLT : + case ByteCode.IF_ICMPGE : + case ByteCode.IF_ICMPGT : + case ByteCode.IF_ICMPLE : + case ByteCode.IF_ACMPEQ : + case ByteCode.IF_ACMPNE : + case ByteCode.JSR : + case ByteCode.IFNULL : + case ByteCode.IFNONNULL : { + if ((theOperand & 0x80000000) != 0x80000000) { + if ((theOperand < 0) || (theOperand > 65535)) + throw new IllegalArgumentException( + "Bad label for branch"); + } + int branchPC = itsCodeBufferTop; + addToCodeBuffer(theOpCode); + if ((theOperand & 0x80000000) != 0x80000000) { + // hard displacement + addToCodeInt16(theOperand); + } + else { // a label + int targetPC = getLabelPC(theOperand); + if (DEBUGLABELS) { + int theLabel = theOperand & 0x7FFFFFFF; + System.out.println("Fixing branch to " + + theLabel + " at " + targetPC + + " from " + branchPC); + } + if (targetPC != -1) { + int offset = targetPC - branchPC; + addToCodeInt16(offset); + } + else { + addLabelFixup(theOperand, branchPC + 1); + addToCodeInt16(0); + } + } + } + break; + + case ByteCode.BIPUSH : + if ((byte)theOperand != theOperand) + throw new IllegalArgumentException("out of range byte"); + addToCodeBuffer(theOpCode); + addToCodeBuffer((byte)theOperand); + break; + + case ByteCode.SIPUSH : + if ((short)theOperand != theOperand) + throw new IllegalArgumentException("out of range short"); + addToCodeBuffer(theOpCode); + addToCodeInt16(theOperand); + break; + + case ByteCode.NEWARRAY : + if (!(0 <= theOperand && theOperand < 256)) + throw new IllegalArgumentException("out of range index"); + addToCodeBuffer(theOpCode); + addToCodeBuffer(theOperand); + break; + + case ByteCode.GETFIELD : + case ByteCode.PUTFIELD : + if (!(0 <= theOperand && theOperand < 65536)) + throw new IllegalArgumentException("out of range field"); + addToCodeBuffer(theOpCode); + addToCodeInt16(theOperand); + break; + + case ByteCode.LDC : + case ByteCode.LDC_W : + case ByteCode.LDC2_W : + if (!(0 <= theOperand && theOperand < 65536)) + throw new IllegalArgumentException("out of range index"); + if (theOperand >= 256 + || theOpCode == ByteCode.LDC_W + || theOpCode == ByteCode.LDC2_W) + { + if (theOpCode == ByteCode.LDC) { + addToCodeBuffer(ByteCode.LDC_W); + } else { + addToCodeBuffer(theOpCode); + } + addToCodeInt16(theOperand); + } else { + addToCodeBuffer(theOpCode); + addToCodeBuffer(theOperand); + } + break; + + case ByteCode.RET : + case ByteCode.ILOAD : + case ByteCode.LLOAD : + case ByteCode.FLOAD : + case ByteCode.DLOAD : + case ByteCode.ALOAD : + case ByteCode.ISTORE : + case ByteCode.LSTORE : + case ByteCode.FSTORE : + case ByteCode.DSTORE : + case ByteCode.ASTORE : + if (!(0 <= theOperand && theOperand < 65536)) + throw new ClassFileFormatException("out of range variable"); + if (theOperand >= 256) { + addToCodeBuffer(ByteCode.WIDE); + addToCodeBuffer(theOpCode); + addToCodeInt16(theOperand); + } + else { + addToCodeBuffer(theOpCode); + addToCodeBuffer(theOperand); + } + break; + + default : + throw new IllegalArgumentException( + "Unexpected opcode for 1 operand"); + } + + itsStackTop = (short)newStack; + if (newStack > itsMaxStack) itsMaxStack = (short)newStack; + if (DEBUGSTACK) { + System.out.println("After "+bytecodeStr(theOpCode) + +" stack = "+itsStackTop); + } + } + + /** + * Generate the load constant bytecode for the given integer. + * + * @param k the constant + */ + public void addLoadConstant(int k) { + switch (k) { + case 0: add(ByteCode.ICONST_0); break; + case 1: add(ByteCode.ICONST_1); break; + case 2: add(ByteCode.ICONST_2); break; + case 3: add(ByteCode.ICONST_3); break; + case 4: add(ByteCode.ICONST_4); break; + case 5: add(ByteCode.ICONST_5); break; + default: + add(ByteCode.LDC, itsConstantPool.addConstant(k)); + break; + } + } + + /** + * Generate the load constant bytecode for the given long. + * + * @param k the constant + */ + public void addLoadConstant(long k) { + add(ByteCode.LDC2_W, itsConstantPool.addConstant(k)); + } + + /** + * Generate the load constant bytecode for the given float. + * + * @param k the constant + */ + public void addLoadConstant(float k) { + add(ByteCode.LDC, itsConstantPool.addConstant(k)); + } + + /** + * Generate the load constant bytecode for the given double. + * + * @param k the constant + */ + public void addLoadConstant(double k) { + add(ByteCode.LDC2_W, itsConstantPool.addConstant(k)); + } + + /** + * Generate the load constant bytecode for the given string. + * + * @param k the constant + */ + public void addLoadConstant(String k) { + add(ByteCode.LDC, itsConstantPool.addConstant(k)); + } + + /** + * Add the given two-operand bytecode to the current method. + * + * @param theOpCode the opcode of the bytecode + * @param theOperand1 the first operand of the bytecode + * @param theOperand2 the second operand of the bytecode + */ + public void add(int theOpCode, int theOperand1, int theOperand2) { + if (DEBUGCODE) { + System.out.println("Add "+bytecodeStr(theOpCode) + +", "+Integer.toHexString(theOperand1) + +", "+Integer.toHexString(theOperand2)); + } + int newStack = itsStackTop + stackChange(theOpCode); + if (newStack < 0 || Short.MAX_VALUE < newStack) badStack(newStack); + + if (theOpCode == ByteCode.IINC) { + if (!(0 <= theOperand1 && theOperand1 < 65536)) + throw new ClassFileFormatException("out of range variable"); + if (!(0 <= theOperand2 && theOperand2 < 65536)) + throw new ClassFileFormatException("out of range increment"); + + if (theOperand1 > 255 || theOperand2 < -128 || theOperand2 > 127) { + addToCodeBuffer(ByteCode.WIDE); + addToCodeBuffer(ByteCode.IINC); + addToCodeInt16(theOperand1); + addToCodeInt16(theOperand2); + } + else { + addToCodeBuffer(ByteCode.WIDE); + addToCodeBuffer(ByteCode.IINC); + addToCodeBuffer(theOperand1); + addToCodeBuffer(theOperand2); + } + } + else if (theOpCode == ByteCode.MULTIANEWARRAY) { + if (!(0 <= theOperand1 && theOperand1 < 65536)) + throw new IllegalArgumentException("out of range index"); + if (!(0 <= theOperand2 && theOperand2 < 256)) + throw new IllegalArgumentException("out of range dimensions"); + + addToCodeBuffer(ByteCode.MULTIANEWARRAY); + addToCodeInt16(theOperand1); + addToCodeBuffer(theOperand2); + } + else { + throw new IllegalArgumentException( + "Unexpected opcode for 2 operands"); + } + itsStackTop = (short)newStack; + if (newStack > itsMaxStack) itsMaxStack = (short)newStack; + if (DEBUGSTACK) { + System.out.println("After "+bytecodeStr(theOpCode) + +" stack = "+itsStackTop); + } + + } + + public void add(int theOpCode, String className) { + if (DEBUGCODE) { + System.out.println("Add "+bytecodeStr(theOpCode) + +", "+className); + } + int newStack = itsStackTop + stackChange(theOpCode); + if (newStack < 0 || Short.MAX_VALUE < newStack) badStack(newStack); + switch (theOpCode) { + case ByteCode.NEW : + case ByteCode.ANEWARRAY : + case ByteCode.CHECKCAST : + case ByteCode.INSTANCEOF : { + short classIndex = itsConstantPool.addClass(className); + addToCodeBuffer(theOpCode); + addToCodeInt16(classIndex); + } + break; + + default : + throw new IllegalArgumentException( + "bad opcode for class reference"); + } + itsStackTop = (short)newStack; + if (newStack > itsMaxStack) itsMaxStack = (short)newStack; + if (DEBUGSTACK) { + System.out.println("After "+bytecodeStr(theOpCode) + +" stack = "+itsStackTop); + } + } + + + public void add(int theOpCode, String className, String fieldName, + String fieldType) + { + if (DEBUGCODE) { + System.out.println("Add "+bytecodeStr(theOpCode) + +", "+className+", "+fieldName+", "+fieldType); + } + int newStack = itsStackTop + stackChange(theOpCode); + char fieldTypeChar = fieldType.charAt(0); + int fieldSize = (fieldTypeChar == 'J' || fieldTypeChar == 'D') + ? 2 : 1; + switch (theOpCode) { + case ByteCode.GETFIELD : + case ByteCode.GETSTATIC : + newStack += fieldSize; + break; + case ByteCode.PUTSTATIC : + case ByteCode.PUTFIELD : + newStack -= fieldSize; + break; + default : + throw new IllegalArgumentException( + "bad opcode for field reference"); + } + if (newStack < 0 || Short.MAX_VALUE < newStack) badStack(newStack); + short fieldRefIndex = itsConstantPool.addFieldRef(className, + fieldName, fieldType); + addToCodeBuffer(theOpCode); + addToCodeInt16(fieldRefIndex); + + itsStackTop = (short)newStack; + if (newStack > itsMaxStack) itsMaxStack = (short)newStack; + if (DEBUGSTACK) { + System.out.println("After "+bytecodeStr(theOpCode) + +" stack = "+itsStackTop); + } + } + + public void addInvoke(int theOpCode, String className, String methodName, + String methodType) + { + if (DEBUGCODE) { + System.out.println("Add "+bytecodeStr(theOpCode) + +", "+className+", "+methodName+", " + +methodType); + } + int parameterInfo = sizeOfParameters(methodType); + int parameterCount = parameterInfo >>> 16; + int stackDiff = (short)parameterInfo; + + int newStack = itsStackTop + stackDiff; + newStack += stackChange(theOpCode); // adjusts for 'this' + if (newStack < 0 || Short.MAX_VALUE < newStack) badStack(newStack); + + switch (theOpCode) { + case ByteCode.INVOKEVIRTUAL : + case ByteCode.INVOKESPECIAL : + case ByteCode.INVOKESTATIC : + case ByteCode.INVOKEINTERFACE : { + addToCodeBuffer(theOpCode); + if (theOpCode == ByteCode.INVOKEINTERFACE) { + short ifMethodRefIndex + = itsConstantPool.addInterfaceMethodRef( + className, methodName, + methodType); + addToCodeInt16(ifMethodRefIndex); + addToCodeBuffer(parameterCount + 1); + addToCodeBuffer(0); + } + else { + short methodRefIndex = itsConstantPool.addMethodRef( + className, methodName, + methodType); + addToCodeInt16(methodRefIndex); + } + } + break; + + default : + throw new IllegalArgumentException( + "bad opcode for method reference"); + } + itsStackTop = (short)newStack; + if (newStack > itsMaxStack) itsMaxStack = (short)newStack; + if (DEBUGSTACK) { + System.out.println("After "+bytecodeStr(theOpCode) + +" stack = "+itsStackTop); + } + } + + /** + * Generate code to load the given integer on stack. + * + * @param k the constant + */ + public void addPush(int k) + { + if ((byte)k == k) { + if (k == -1) { + add(ByteCode.ICONST_M1); + } else if (0 <= k && k <= 5) { + add((byte)(ByteCode.ICONST_0 + k)); + } else { + add(ByteCode.BIPUSH, (byte)k); + } + } else if ((short)k == k) { + add(ByteCode.SIPUSH, (short)k); + } else { + addLoadConstant(k); + } + } + + public void addPush(boolean k) + { + add(k ? ByteCode.ICONST_1 : ByteCode.ICONST_0); + } + + /** + * Generate code to load the given long on stack. + * + * @param k the constant + */ + public void addPush(long k) + { + int ik = (int)k; + if (ik == k) { + addPush(ik); + add(ByteCode.I2L); + } else { + addLoadConstant(k); + } + } + + /** + * Generate code to load the given double on stack. + * + * @param k the constant + */ + public void addPush(double k) + { + if (k == 0.0) { + // zero + add(ByteCode.DCONST_0); + if (1.0 / k < 0) { + // Negative zero + add(ByteCode.DNEG); + } + } else if (k == 1.0 || k == -1.0) { + add(ByteCode.DCONST_1); + if (k < 0) { + add(ByteCode.DNEG); + } + } else { + addLoadConstant(k); + } + } + + /** + * Generate the code to leave on stack the given string even if the + * string encoding exeeds the class file limit for single string constant + * + * @param k the constant + */ + public void addPush(String k) { + int length = k.length(); + int limit = itsConstantPool.getUtfEncodingLimit(k, 0, length); + if (limit == length) { + addLoadConstant(k); + return; + } + // Split string into picies fitting the UTF limit and generate code for + // StringBuffer sb = new StringBuffer(length); + // sb.append(loadConstant(piece_1)); + // ... + // sb.append(loadConstant(piece_N)); + // sb.toString(); + final String SB = "java/lang/StringBuffer"; + add(ByteCode.NEW, SB); + add(ByteCode.DUP); + addPush(length); + addInvoke(ByteCode.INVOKESPECIAL, SB, "", "(I)V"); + int cursor = 0; + for (;;) { + add(ByteCode.DUP); + String s = k.substring(cursor, limit); + addLoadConstant(s); + addInvoke(ByteCode.INVOKEVIRTUAL, SB, "append", + "(Ljava/lang/String;)Ljava/lang/StringBuffer;"); + add(ByteCode.POP); + if (limit == length) { + break; + } + cursor = limit; + limit = itsConstantPool.getUtfEncodingLimit(k, limit, length); + } + addInvoke(ByteCode.INVOKEVIRTUAL, SB, "toString", + "()Ljava/lang/String;"); + } + + /** + * Check if k fits limit on string constant size imposed by class file + * format. + * + * @param k the string constant + */ + public boolean isUnderStringSizeLimit(String k) + { + return itsConstantPool.isUnderUtfEncodingLimit(k); + } + + /** + * Store integer from stack top into the given local. + * + * @param local number of local register + */ + public void addIStore(int local) + { + xop(ByteCode.ISTORE_0, ByteCode.ISTORE, local); + } + + /** + * Store long from stack top into the given local. + * + * @param local number of local register + */ + public void addLStore(int local) + { + xop(ByteCode.LSTORE_0, ByteCode.LSTORE, local); + } + + /** + * Store float from stack top into the given local. + * + * @param local number of local register + */ + public void addFStore(int local) + { + xop(ByteCode.FSTORE_0, ByteCode.FSTORE, local); + } + + /** + * Store double from stack top into the given local. + * + * @param local number of local register + */ + public void addDStore(int local) + { + xop(ByteCode.DSTORE_0, ByteCode.DSTORE, local); + } + + /** + * Store object from stack top into the given local. + * + * @param local number of local register + */ + public void addAStore(int local) + { + xop(ByteCode.ASTORE_0, ByteCode.ASTORE, local); + } + + /** + * Load integer from the given local into stack. + * + * @param local number of local register + */ + public void addILoad(int local) + { + xop(ByteCode.ILOAD_0, ByteCode.ILOAD, local); + } + + /** + * Load long from the given local into stack. + * + * @param local number of local register + */ + public void addLLoad(int local) + { + xop(ByteCode.LLOAD_0, ByteCode.LLOAD, local); + } + + /** + * Load float from the given local into stack. + * + * @param local number of local register + */ + public void addFLoad(int local) + { + xop(ByteCode.FLOAD_0, ByteCode.FLOAD, local); + } + + /** + * Load double from the given local into stack. + * + * @param local number of local register + */ + public void addDLoad(int local) + { + xop(ByteCode.DLOAD_0, ByteCode.DLOAD, local); + } + + /** + * Load object from the given local into stack. + * + * @param local number of local register + */ + public void addALoad(int local) + { + xop(ByteCode.ALOAD_0, ByteCode.ALOAD, local); + } + + /** + * Load "this" into stack. + */ + public void addLoadThis() + { + add(ByteCode.ALOAD_0); + } + + private void xop(int shortOp, int op, int local) + { + switch (local) { + case 0: + add(shortOp); + break; + case 1: + add(shortOp + 1); + break; + case 2: + add(shortOp + 2); + break; + case 3: + add(shortOp + 3); + break; + default: + add(op, local); + } + } + + public int addTableSwitch(int low, int high) + { + if (DEBUGCODE) { + System.out.println("Add "+bytecodeStr(ByteCode.TABLESWITCH) + +" "+low+" "+high); + } + if (low > high) + throw new ClassFileFormatException("Bad bounds: "+low+' '+ high); + + int newStack = itsStackTop + stackChange(ByteCode.TABLESWITCH); + if (newStack < 0 || Short.MAX_VALUE < newStack) badStack(newStack); + + int entryCount = high - low + 1; + int padSize = 3 & ~itsCodeBufferTop; // == 3 - itsCodeBufferTop % 4 + + int N = addReservedCodeSpace(1 + padSize + 4 * (1 + 2 + entryCount)); + int switchStart = N; + itsCodeBuffer[N++] = (byte)ByteCode.TABLESWITCH; + while (padSize != 0) { + itsCodeBuffer[N++] = 0; + --padSize; + } + N += 4; // skip default offset + N = putInt32(low, itsCodeBuffer, N); + putInt32(high, itsCodeBuffer, N); + + itsStackTop = (short)newStack; + if (newStack > itsMaxStack) itsMaxStack = (short)newStack; + if (DEBUGSTACK) { + System.out.println("After "+bytecodeStr(ByteCode.TABLESWITCH) + +" stack = "+itsStackTop); + } + + return switchStart; + } + + public final void markTableSwitchDefault(int switchStart) + { + setTableSwitchJump(switchStart, -1, itsCodeBufferTop); + } + + public final void markTableSwitchCase(int switchStart, int caseIndex) + { + setTableSwitchJump(switchStart, caseIndex, itsCodeBufferTop); + } + + public final void markTableSwitchCase(int switchStart, int caseIndex, + int stackTop) + { + if (!(0 <= stackTop && stackTop <= itsMaxStack)) + throw new IllegalArgumentException("Bad stack index: "+stackTop); + itsStackTop = (short)stackTop; + setTableSwitchJump(switchStart, caseIndex, itsCodeBufferTop); + } + + public void setTableSwitchJump(int switchStart, int caseIndex, + int jumpTarget) + { + if (!(0 <= jumpTarget && jumpTarget <= itsCodeBufferTop)) + throw new IllegalArgumentException("Bad jump target: "+jumpTarget); + if (!(caseIndex >= -1)) + throw new IllegalArgumentException("Bad case index: "+caseIndex); + + int padSize = 3 & ~switchStart; // == 3 - switchStart % 4 + int caseOffset; + if (caseIndex < 0) { + // default label + caseOffset = switchStart + 1 + padSize; + } else { + caseOffset = switchStart + 1 + padSize + 4 * (3 + caseIndex); + } + if (!(0 <= switchStart + && switchStart <= itsCodeBufferTop - 4 * 4 - padSize - 1)) + { + throw new IllegalArgumentException( + switchStart+" is outside a possible range of tableswitch" + +" in already generated code"); + } + if ((0xFF & itsCodeBuffer[switchStart]) != ByteCode.TABLESWITCH) { + throw new IllegalArgumentException( + switchStart+" is not offset of tableswitch statement"); + } + if (!(0 <= caseOffset && caseOffset + 4 <= itsCodeBufferTop)) { + // caseIndex >= -1 does not guarantee that caseOffset >= 0 due + // to a possible overflow. + throw new ClassFileFormatException( + "Too big case index: "+caseIndex); + } + // ALERT: perhaps check against case bounds? + putInt32(jumpTarget - switchStart, itsCodeBuffer, caseOffset); + } + + public int acquireLabel() + { + int top = itsLabelTableTop; + if (itsLabelTable == null || top == itsLabelTable.length) { + if (itsLabelTable == null) { + itsLabelTable = new int[MIN_LABEL_TABLE_SIZE]; + }else { + int[] tmp = new int[itsLabelTable.length * 2]; + System.arraycopy(itsLabelTable, 0, tmp, 0, top); + itsLabelTable = tmp; + } + } + itsLabelTableTop = top + 1; + itsLabelTable[top] = -1; + return top | 0x80000000; + } + + public void markLabel(int label) + { + if (!(label < 0)) + throw new IllegalArgumentException("Bad label, no biscuit"); + + label &= 0x7FFFFFFF; + if (label > itsLabelTableTop) + throw new IllegalArgumentException("Bad label"); + + if (itsLabelTable[label] != -1) { + throw new IllegalStateException("Can only mark label once"); + } + + itsLabelTable[label] = itsCodeBufferTop; + } + + public void markLabel(int label, short stackTop) + { + markLabel(label); + itsStackTop = stackTop; + } + + public void markHandler(int theLabel) { + itsStackTop = 1; + markLabel(theLabel); + } + + private int getLabelPC(int label) + { + if (!(label < 0)) + throw new IllegalArgumentException("Bad label, no biscuit"); + label &= 0x7FFFFFFF; + if (!(label < itsLabelTableTop)) + throw new IllegalArgumentException("Bad label"); + return itsLabelTable[label]; + } + + private void addLabelFixup(int label, int fixupSite) + { + if (!(label < 0)) + throw new IllegalArgumentException("Bad label, no biscuit"); + label &= 0x7FFFFFFF; + if (!(label < itsLabelTableTop)) + throw new IllegalArgumentException("Bad label"); + int top = itsFixupTableTop; + if (itsFixupTable == null || top == itsFixupTable.length) { + if (itsFixupTable == null) { + itsFixupTable = new long[MIN_FIXUP_TABLE_SIZE]; + }else { + long[] tmp = new long[itsFixupTable.length * 2]; + System.arraycopy(itsFixupTable, 0, tmp, 0, top); + itsFixupTable = tmp; + } + } + itsFixupTableTop = top + 1; + itsFixupTable[top] = ((long)label << 32) | fixupSite; + } + + private void fixLabelGotos() + { + byte[] codeBuffer = itsCodeBuffer; + for (int i = 0; i < itsFixupTableTop; i++) { + long fixup = itsFixupTable[i]; + int label = (int)(fixup >> 32); + int fixupSite = (int)fixup; + int pc = itsLabelTable[label]; + if (pc == -1) { + // Unlocated label + throw new RuntimeException(); + } + // -1 to get delta from instruction start + int offset = pc - (fixupSite - 1); + if ((short)offset != offset) { + throw new ClassFileFormatException + ("Program too complex: too big jump offset"); + } + codeBuffer[fixupSite] = (byte)(offset >> 8); + codeBuffer[fixupSite + 1] = (byte)offset; + } + itsFixupTableTop = 0; + } + + /** + * Get the current offset into the code of the current method. + * + * @return an integer representing the offset + */ + public int getCurrentCodeOffset() { + return itsCodeBufferTop; + } + + public short getStackTop() { + return itsStackTop; + } + + public void setStackTop(short n) { + itsStackTop = n; + } + + public void adjustStackTop(int delta) { + int newStack = itsStackTop + delta; + if (newStack < 0 || Short.MAX_VALUE < newStack) badStack(newStack); + itsStackTop = (short)newStack; + if (newStack > itsMaxStack) itsMaxStack = (short)newStack; + if (DEBUGSTACK) { + System.out.println("After "+"adjustStackTop("+delta+")" + +" stack = "+itsStackTop); + } + } + + private void addToCodeBuffer(int b) + { + int N = addReservedCodeSpace(1); + itsCodeBuffer[N] = (byte)b; + } + + private void addToCodeInt16(int value) + { + int N = addReservedCodeSpace(2); + putInt16(value, itsCodeBuffer, N); + } + + private int addReservedCodeSpace(int size) + { + if (itsCurrentMethod == null) + throw new IllegalArgumentException("No method to add to"); + int oldTop = itsCodeBufferTop; + int newTop = oldTop + size; + if (newTop > itsCodeBuffer.length) { + int newSize = itsCodeBuffer.length * 2; + if (newTop > newSize) { newSize = newTop; } + byte[] tmp = new byte[newSize]; + System.arraycopy(itsCodeBuffer, 0, tmp, 0, oldTop); + itsCodeBuffer = tmp; + } + itsCodeBufferTop = newTop; + return oldTop; + } + + public void addExceptionHandler(int startLabel, int endLabel, + int handlerLabel, String catchClassName) + { + if ((startLabel & 0x80000000) != 0x80000000) + throw new IllegalArgumentException("Bad startLabel"); + if ((endLabel & 0x80000000) != 0x80000000) + throw new IllegalArgumentException("Bad endLabel"); + if ((handlerLabel & 0x80000000) != 0x80000000) + throw new IllegalArgumentException("Bad handlerLabel"); + + /* + * If catchClassName is null, use 0 for the catch_type_index; which + * means catch everything. (Even when the verifier has let you throw + * something other than a Throwable.) + */ + short catch_type_index = (catchClassName == null) + ? 0 + : itsConstantPool.addClass(catchClassName); + ExceptionTableEntry newEntry = new ExceptionTableEntry( + startLabel, + endLabel, + handlerLabel, + catch_type_index); + int N = itsExceptionTableTop; + if (N == 0) { + itsExceptionTable = new ExceptionTableEntry[ExceptionTableSize]; + } else if (N == itsExceptionTable.length) { + ExceptionTableEntry[] tmp = new ExceptionTableEntry[N * 2]; + System.arraycopy(itsExceptionTable, 0, tmp, 0, N); + itsExceptionTable = tmp; + } + itsExceptionTable[N] = newEntry; + itsExceptionTableTop = N + 1; + + } + + public void addLineNumberEntry(short lineNumber) { + if (itsCurrentMethod == null) + throw new IllegalArgumentException("No method to stop"); + int N = itsLineNumberTableTop; + if (N == 0) { + itsLineNumberTable = new int[LineNumberTableSize]; + } else if (N == itsLineNumberTable.length) { + int[] tmp = new int[N * 2]; + System.arraycopy(itsLineNumberTable, 0, tmp, 0, N); + itsLineNumberTable = tmp; + } + itsLineNumberTable[N] = (itsCodeBufferTop << 16) + lineNumber; + itsLineNumberTableTop = N + 1; + } + + /** + * Write the class file to the OutputStream. + * + * @param oStream the stream to write to + * @throws IOException if writing to the stream produces an exception + */ + public void write(OutputStream oStream) + throws IOException + { + byte[] array = toByteArray(); + oStream.write(array); + } + + private int getWriteSize() + { + int size = 0; + + if (itsSourceFileNameIndex != 0) { + itsConstantPool.addUtf8("SourceFile"); + } + + size += 8; //writeLong(FileHeaderConstant); + size += itsConstantPool.getWriteSize(); + size += 2; //writeShort(itsFlags); + size += 2; //writeShort(itsThisClassIndex); + size += 2; //writeShort(itsSuperClassIndex); + size += 2; //writeShort(itsInterfaces.size()); + size += 2 * itsInterfaces.size(); + + size += 2; //writeShort(itsFields.size()); + for (int i = 0; i < itsFields.size(); i++) { + size += ((ClassFileField)(itsFields.get(i))).getWriteSize(); + } + + size += 2; //writeShort(itsMethods.size()); + for (int i = 0; i < itsMethods.size(); i++) { + size += ((ClassFileMethod)(itsMethods.get(i))).getWriteSize(); + } + + if (itsSourceFileNameIndex != 0) { + size += 2; //writeShort(1); attributes count + size += 2; //writeShort(sourceFileAttributeNameIndex); + size += 4; //writeInt(2); + size += 2; //writeShort(itsSourceFileNameIndex); + }else { + size += 2; //out.writeShort(0); no attributes + } + + return size; + } + + /** + * Get the class file as array of bytesto the OutputStream. + */ + public byte[] toByteArray() + { + int dataSize = getWriteSize(); + byte[] data = new byte[dataSize]; + int offset = 0; + + short sourceFileAttributeNameIndex = 0; + if (itsSourceFileNameIndex != 0) { + sourceFileAttributeNameIndex = itsConstantPool.addUtf8( + "SourceFile"); + } + + offset = putInt64(FileHeaderConstant, data, offset); + offset = itsConstantPool.write(data, offset); + offset = putInt16(itsFlags, data, offset); + offset = putInt16(itsThisClassIndex, data, offset); + offset = putInt16(itsSuperClassIndex, data, offset); + offset = putInt16(itsInterfaces.size(), data, offset); + for (int i = 0; i < itsInterfaces.size(); i++) { + int interfaceIndex = ((Short)(itsInterfaces.get(i))).shortValue(); + offset = putInt16(interfaceIndex, data, offset); + } + offset = putInt16(itsFields.size(), data, offset); + for (int i = 0; i < itsFields.size(); i++) { + ClassFileField field = (ClassFileField)itsFields.get(i); + offset = field.write(data, offset); + } + offset = putInt16(itsMethods.size(), data, offset); + for (int i = 0; i < itsMethods.size(); i++) { + ClassFileMethod method = (ClassFileMethod)itsMethods.get(i); + offset = method.write(data, offset); + } + if (itsSourceFileNameIndex != 0) { + offset = putInt16(1, data, offset); // attributes count + offset = putInt16(sourceFileAttributeNameIndex, data, offset); + offset = putInt32(2, data, offset); + offset = putInt16(itsSourceFileNameIndex, data, offset); + } else { + offset = putInt16(0, data, offset); // no attributes + } + + if (offset != dataSize) { + // Check getWriteSize is consistent with write! + throw new RuntimeException(); + } + + return data; + } + + static int putInt64(long value, byte[] array, int offset) + { + offset = putInt32((int)(value >>> 32), array, offset); + return putInt32((int)value, array, offset); + } + + private static void badStack(int value) + { + String s; + if (value < 0) { s = "Stack underflow: "+value; } + else { s = "Too big stack: "+value; } + throw new IllegalStateException(s); + } + + /* + Really weird. Returns an int with # parameters in hi 16 bits, and + stack difference removal of parameters from stack and pushing the + result (it does not take into account removal of this in case of + non-static methods). + If Java really supported references we wouldn't have to be this + perverted. + */ + private static int sizeOfParameters(String pString) + { + int length = pString.length(); + int rightParenthesis = pString.lastIndexOf(')'); + if (3 <= length /* minimal signature takes at least 3 chars: ()V */ + && pString.charAt(0) == '(' + && 1 <= rightParenthesis && rightParenthesis + 1 < length) + { + boolean ok = true; + int index = 1; + int stackDiff = 0; + int count = 0; + stringLoop: + while (index != rightParenthesis) { + switch (pString.charAt(index)) { + default: + ok = false; + break stringLoop; + case 'J' : + case 'D' : + --stackDiff; + // fall thru + case 'B' : + case 'S' : + case 'C' : + case 'I' : + case 'Z' : + case 'F' : + --stackDiff; + ++count; + ++index; + continue; + case '[' : + ++index; + int c = pString.charAt(index); + while (c == '[') { + ++index; + c = pString.charAt(index); + } + switch (c) { + default: + ok = false; + break stringLoop; + case 'J' : + case 'D' : + case 'B' : + case 'S' : + case 'C' : + case 'I' : + case 'Z' : + case 'F' : + --stackDiff; + ++count; + ++index; + continue; + case 'L': + // fall thru + } + // fall thru + case 'L' : { + --stackDiff; + ++count; + ++index; + int semicolon = pString.indexOf(';', index); + if (!(index + 1 <= semicolon + && semicolon < rightParenthesis)) + { + ok = false; + break stringLoop; + } + index = semicolon + 1; + continue; + } + } + } + if (ok) { + switch (pString.charAt(rightParenthesis + 1)) { + default: + ok = false; + break; + case 'J' : + case 'D' : + ++stackDiff; + // fall thru + case 'B' : + case 'S' : + case 'C' : + case 'I' : + case 'Z' : + case 'F' : + case 'L' : + case '[' : + ++stackDiff; + // fall thru + case 'V' : + break; + } + if (ok) { + return ((count << 16) | (0xFFFF & stackDiff)); + } + } + } + throw new IllegalArgumentException( + "Bad parameter signature: "+pString); + } + + static int putInt16(int value, byte[] array, int offset) + { + array[offset + 0] = (byte)(value >>> 8); + array[offset + 1] = (byte)value; + return offset + 2; + } + + static int putInt32(int value, byte[] array, int offset) + { + array[offset + 0] = (byte)(value >>> 24); + array[offset + 1] = (byte)(value >>> 16); + array[offset + 2] = (byte)(value >>> 8); + array[offset + 3] = (byte)value; + return offset + 4; + } + + /** + * Number of operands accompanying the opcode. + */ + static int opcodeCount(int opcode) + { + switch (opcode) { + case ByteCode.AALOAD: + case ByteCode.AASTORE: + case ByteCode.ACONST_NULL: + case ByteCode.ALOAD_0: + case ByteCode.ALOAD_1: + case ByteCode.ALOAD_2: + case ByteCode.ALOAD_3: + case ByteCode.ARETURN: + case ByteCode.ARRAYLENGTH: + case ByteCode.ASTORE_0: + case ByteCode.ASTORE_1: + case ByteCode.ASTORE_2: + case ByteCode.ASTORE_3: + case ByteCode.ATHROW: + case ByteCode.BALOAD: + case ByteCode.BASTORE: + case ByteCode.BREAKPOINT: + case ByteCode.CALOAD: + case ByteCode.CASTORE: + case ByteCode.D2F: + case ByteCode.D2I: + case ByteCode.D2L: + case ByteCode.DADD: + case ByteCode.DALOAD: + case ByteCode.DASTORE: + case ByteCode.DCMPG: + case ByteCode.DCMPL: + case ByteCode.DCONST_0: + case ByteCode.DCONST_1: + case ByteCode.DDIV: + case ByteCode.DLOAD_0: + case ByteCode.DLOAD_1: + case ByteCode.DLOAD_2: + case ByteCode.DLOAD_3: + case ByteCode.DMUL: + case ByteCode.DNEG: + case ByteCode.DREM: + case ByteCode.DRETURN: + case ByteCode.DSTORE_0: + case ByteCode.DSTORE_1: + case ByteCode.DSTORE_2: + case ByteCode.DSTORE_3: + case ByteCode.DSUB: + case ByteCode.DUP: + case ByteCode.DUP2: + case ByteCode.DUP2_X1: + case ByteCode.DUP2_X2: + case ByteCode.DUP_X1: + case ByteCode.DUP_X2: + case ByteCode.F2D: + case ByteCode.F2I: + case ByteCode.F2L: + case ByteCode.FADD: + case ByteCode.FALOAD: + case ByteCode.FASTORE: + case ByteCode.FCMPG: + case ByteCode.FCMPL: + case ByteCode.FCONST_0: + case ByteCode.FCONST_1: + case ByteCode.FCONST_2: + case ByteCode.FDIV: + case ByteCode.FLOAD_0: + case ByteCode.FLOAD_1: + case ByteCode.FLOAD_2: + case ByteCode.FLOAD_3: + case ByteCode.FMUL: + case ByteCode.FNEG: + case ByteCode.FREM: + case ByteCode.FRETURN: + case ByteCode.FSTORE_0: + case ByteCode.FSTORE_1: + case ByteCode.FSTORE_2: + case ByteCode.FSTORE_3: + case ByteCode.FSUB: + case ByteCode.I2B: + case ByteCode.I2C: + case ByteCode.I2D: + case ByteCode.I2F: + case ByteCode.I2L: + case ByteCode.I2S: + case ByteCode.IADD: + case ByteCode.IALOAD: + case ByteCode.IAND: + case ByteCode.IASTORE: + case ByteCode.ICONST_0: + case ByteCode.ICONST_1: + case ByteCode.ICONST_2: + case ByteCode.ICONST_3: + case ByteCode.ICONST_4: + case ByteCode.ICONST_5: + case ByteCode.ICONST_M1: + case ByteCode.IDIV: + case ByteCode.ILOAD_0: + case ByteCode.ILOAD_1: + case ByteCode.ILOAD_2: + case ByteCode.ILOAD_3: + case ByteCode.IMPDEP1: + case ByteCode.IMPDEP2: + case ByteCode.IMUL: + case ByteCode.INEG: + case ByteCode.IOR: + case ByteCode.IREM: + case ByteCode.IRETURN: + case ByteCode.ISHL: + case ByteCode.ISHR: + case ByteCode.ISTORE_0: + case ByteCode.ISTORE_1: + case ByteCode.ISTORE_2: + case ByteCode.ISTORE_3: + case ByteCode.ISUB: + case ByteCode.IUSHR: + case ByteCode.IXOR: + case ByteCode.L2D: + case ByteCode.L2F: + case ByteCode.L2I: + case ByteCode.LADD: + case ByteCode.LALOAD: + case ByteCode.LAND: + case ByteCode.LASTORE: + case ByteCode.LCMP: + case ByteCode.LCONST_0: + case ByteCode.LCONST_1: + case ByteCode.LDIV: + case ByteCode.LLOAD_0: + case ByteCode.LLOAD_1: + case ByteCode.LLOAD_2: + case ByteCode.LLOAD_3: + case ByteCode.LMUL: + case ByteCode.LNEG: + case ByteCode.LOR: + case ByteCode.LREM: + case ByteCode.LRETURN: + case ByteCode.LSHL: + case ByteCode.LSHR: + case ByteCode.LSTORE_0: + case ByteCode.LSTORE_1: + case ByteCode.LSTORE_2: + case ByteCode.LSTORE_3: + case ByteCode.LSUB: + case ByteCode.LUSHR: + case ByteCode.LXOR: + case ByteCode.MONITORENTER: + case ByteCode.MONITOREXIT: + case ByteCode.NOP: + case ByteCode.POP: + case ByteCode.POP2: + case ByteCode.RETURN: + case ByteCode.SALOAD: + case ByteCode.SASTORE: + case ByteCode.SWAP: + case ByteCode.WIDE: + return 0; + case ByteCode.ALOAD: + case ByteCode.ANEWARRAY: + case ByteCode.ASTORE: + case ByteCode.BIPUSH: + case ByteCode.CHECKCAST: + case ByteCode.DLOAD: + case ByteCode.DSTORE: + case ByteCode.FLOAD: + case ByteCode.FSTORE: + case ByteCode.GETFIELD: + case ByteCode.GETSTATIC: + case ByteCode.GOTO: + case ByteCode.GOTO_W: + case ByteCode.IFEQ: + case ByteCode.IFGE: + case ByteCode.IFGT: + case ByteCode.IFLE: + case ByteCode.IFLT: + case ByteCode.IFNE: + case ByteCode.IFNONNULL: + case ByteCode.IFNULL: + case ByteCode.IF_ACMPEQ: + case ByteCode.IF_ACMPNE: + case ByteCode.IF_ICMPEQ: + case ByteCode.IF_ICMPGE: + case ByteCode.IF_ICMPGT: + case ByteCode.IF_ICMPLE: + case ByteCode.IF_ICMPLT: + case ByteCode.IF_ICMPNE: + case ByteCode.ILOAD: + case ByteCode.INSTANCEOF: + case ByteCode.INVOKEINTERFACE: + case ByteCode.INVOKESPECIAL: + case ByteCode.INVOKESTATIC: + case ByteCode.INVOKEVIRTUAL: + case ByteCode.ISTORE: + case ByteCode.JSR: + case ByteCode.JSR_W: + case ByteCode.LDC: + case ByteCode.LDC2_W: + case ByteCode.LDC_W: + case ByteCode.LLOAD: + case ByteCode.LSTORE: + case ByteCode.NEW: + case ByteCode.NEWARRAY: + case ByteCode.PUTFIELD: + case ByteCode.PUTSTATIC: + case ByteCode.RET: + case ByteCode.SIPUSH: + return 1; + + case ByteCode.IINC: + case ByteCode.MULTIANEWARRAY: + return 2; + + case ByteCode.LOOKUPSWITCH: + case ByteCode.TABLESWITCH: + return -1; + } + throw new IllegalArgumentException("Bad opcode: "+opcode); + } + + /** + * The effect on the operand stack of a given opcode. + */ + static int stackChange(int opcode) + { + // For INVOKE... accounts only for popping this (unless static), + // ignoring parameters and return type + switch (opcode) { + case ByteCode.DASTORE: + case ByteCode.LASTORE: + return -4; + + case ByteCode.AASTORE: + case ByteCode.BASTORE: + case ByteCode.CASTORE: + case ByteCode.DCMPG: + case ByteCode.DCMPL: + case ByteCode.FASTORE: + case ByteCode.IASTORE: + case ByteCode.LCMP: + case ByteCode.SASTORE: + return -3; + + case ByteCode.DADD: + case ByteCode.DDIV: + case ByteCode.DMUL: + case ByteCode.DREM: + case ByteCode.DRETURN: + case ByteCode.DSTORE: + case ByteCode.DSTORE_0: + case ByteCode.DSTORE_1: + case ByteCode.DSTORE_2: + case ByteCode.DSTORE_3: + case ByteCode.DSUB: + case ByteCode.IF_ACMPEQ: + case ByteCode.IF_ACMPNE: + case ByteCode.IF_ICMPEQ: + case ByteCode.IF_ICMPGE: + case ByteCode.IF_ICMPGT: + case ByteCode.IF_ICMPLE: + case ByteCode.IF_ICMPLT: + case ByteCode.IF_ICMPNE: + case ByteCode.LADD: + case ByteCode.LAND: + case ByteCode.LDIV: + case ByteCode.LMUL: + case ByteCode.LOR: + case ByteCode.LREM: + case ByteCode.LRETURN: + case ByteCode.LSTORE: + case ByteCode.LSTORE_0: + case ByteCode.LSTORE_1: + case ByteCode.LSTORE_2: + case ByteCode.LSTORE_3: + case ByteCode.LSUB: + case ByteCode.LXOR: + case ByteCode.POP2: + return -2; + + case ByteCode.AALOAD: + case ByteCode.ARETURN: + case ByteCode.ASTORE: + case ByteCode.ASTORE_0: + case ByteCode.ASTORE_1: + case ByteCode.ASTORE_2: + case ByteCode.ASTORE_3: + case ByteCode.ATHROW: + case ByteCode.BALOAD: + case ByteCode.CALOAD: + case ByteCode.D2F: + case ByteCode.D2I: + case ByteCode.FADD: + case ByteCode.FALOAD: + case ByteCode.FCMPG: + case ByteCode.FCMPL: + case ByteCode.FDIV: + case ByteCode.FMUL: + case ByteCode.FREM: + case ByteCode.FRETURN: + case ByteCode.FSTORE: + case ByteCode.FSTORE_0: + case ByteCode.FSTORE_1: + case ByteCode.FSTORE_2: + case ByteCode.FSTORE_3: + case ByteCode.FSUB: + case ByteCode.GETFIELD: + case ByteCode.IADD: + case ByteCode.IALOAD: + case ByteCode.IAND: + case ByteCode.IDIV: + case ByteCode.IFEQ: + case ByteCode.IFGE: + case ByteCode.IFGT: + case ByteCode.IFLE: + case ByteCode.IFLT: + case ByteCode.IFNE: + case ByteCode.IFNONNULL: + case ByteCode.IFNULL: + case ByteCode.IMUL: + case ByteCode.INVOKEINTERFACE: // + case ByteCode.INVOKESPECIAL: // but needs to account for + case ByteCode.INVOKEVIRTUAL: // pops 'this' (unless static) + case ByteCode.IOR: + case ByteCode.IREM: + case ByteCode.IRETURN: + case ByteCode.ISHL: + case ByteCode.ISHR: + case ByteCode.ISTORE: + case ByteCode.ISTORE_0: + case ByteCode.ISTORE_1: + case ByteCode.ISTORE_2: + case ByteCode.ISTORE_3: + case ByteCode.ISUB: + case ByteCode.IUSHR: + case ByteCode.IXOR: + case ByteCode.L2F: + case ByteCode.L2I: + case ByteCode.LOOKUPSWITCH: + case ByteCode.LSHL: + case ByteCode.LSHR: + case ByteCode.LUSHR: + case ByteCode.MONITORENTER: + case ByteCode.MONITOREXIT: + case ByteCode.POP: + case ByteCode.PUTFIELD: + case ByteCode.SALOAD: + case ByteCode.TABLESWITCH: + return -1; + + case ByteCode.ANEWARRAY: + case ByteCode.ARRAYLENGTH: + case ByteCode.BREAKPOINT: + case ByteCode.CHECKCAST: + case ByteCode.D2L: + case ByteCode.DALOAD: + case ByteCode.DNEG: + case ByteCode.F2I: + case ByteCode.FNEG: + case ByteCode.GETSTATIC: + case ByteCode.GOTO: + case ByteCode.GOTO_W: + case ByteCode.I2B: + case ByteCode.I2C: + case ByteCode.I2F: + case ByteCode.I2S: + case ByteCode.IINC: + case ByteCode.IMPDEP1: + case ByteCode.IMPDEP2: + case ByteCode.INEG: + case ByteCode.INSTANCEOF: + case ByteCode.INVOKESTATIC: + case ByteCode.L2D: + case ByteCode.LALOAD: + case ByteCode.LNEG: + case ByteCode.NEWARRAY: + case ByteCode.NOP: + case ByteCode.PUTSTATIC: + case ByteCode.RET: + case ByteCode.RETURN: + case ByteCode.SWAP: + case ByteCode.WIDE: + return 0; + + case ByteCode.ACONST_NULL: + case ByteCode.ALOAD: + case ByteCode.ALOAD_0: + case ByteCode.ALOAD_1: + case ByteCode.ALOAD_2: + case ByteCode.ALOAD_3: + case ByteCode.BIPUSH: + case ByteCode.DUP: + case ByteCode.DUP_X1: + case ByteCode.DUP_X2: + case ByteCode.F2D: + case ByteCode.F2L: + case ByteCode.FCONST_0: + case ByteCode.FCONST_1: + case ByteCode.FCONST_2: + case ByteCode.FLOAD: + case ByteCode.FLOAD_0: + case ByteCode.FLOAD_1: + case ByteCode.FLOAD_2: + case ByteCode.FLOAD_3: + case ByteCode.I2D: + case ByteCode.I2L: + case ByteCode.ICONST_0: + case ByteCode.ICONST_1: + case ByteCode.ICONST_2: + case ByteCode.ICONST_3: + case ByteCode.ICONST_4: + case ByteCode.ICONST_5: + case ByteCode.ICONST_M1: + case ByteCode.ILOAD: + case ByteCode.ILOAD_0: + case ByteCode.ILOAD_1: + case ByteCode.ILOAD_2: + case ByteCode.ILOAD_3: + case ByteCode.JSR: + case ByteCode.JSR_W: + case ByteCode.LDC: + case ByteCode.LDC_W: + case ByteCode.MULTIANEWARRAY: + case ByteCode.NEW: + case ByteCode.SIPUSH: + return 1; + + case ByteCode.DCONST_0: + case ByteCode.DCONST_1: + case ByteCode.DLOAD: + case ByteCode.DLOAD_0: + case ByteCode.DLOAD_1: + case ByteCode.DLOAD_2: + case ByteCode.DLOAD_3: + case ByteCode.DUP2: + case ByteCode.DUP2_X1: + case ByteCode.DUP2_X2: + case ByteCode.LCONST_0: + case ByteCode.LCONST_1: + case ByteCode.LDC2_W: + case ByteCode.LLOAD: + case ByteCode.LLOAD_0: + case ByteCode.LLOAD_1: + case ByteCode.LLOAD_2: + case ByteCode.LLOAD_3: + return 2; + } + throw new IllegalArgumentException("Bad opcode: "+opcode); + } + + /* + * Number of bytes of operands generated after the opcode. + * Not in use currently. + */ +/* + int extra(int opcode) + { + switch (opcode) { + case ByteCode.AALOAD: + case ByteCode.AASTORE: + case ByteCode.ACONST_NULL: + case ByteCode.ALOAD_0: + case ByteCode.ALOAD_1: + case ByteCode.ALOAD_2: + case ByteCode.ALOAD_3: + case ByteCode.ARETURN: + case ByteCode.ARRAYLENGTH: + case ByteCode.ASTORE_0: + case ByteCode.ASTORE_1: + case ByteCode.ASTORE_2: + case ByteCode.ASTORE_3: + case ByteCode.ATHROW: + case ByteCode.BALOAD: + case ByteCode.BASTORE: + case ByteCode.BREAKPOINT: + case ByteCode.CALOAD: + case ByteCode.CASTORE: + case ByteCode.D2F: + case ByteCode.D2I: + case ByteCode.D2L: + case ByteCode.DADD: + case ByteCode.DALOAD: + case ByteCode.DASTORE: + case ByteCode.DCMPG: + case ByteCode.DCMPL: + case ByteCode.DCONST_0: + case ByteCode.DCONST_1: + case ByteCode.DDIV: + case ByteCode.DLOAD_0: + case ByteCode.DLOAD_1: + case ByteCode.DLOAD_2: + case ByteCode.DLOAD_3: + case ByteCode.DMUL: + case ByteCode.DNEG: + case ByteCode.DREM: + case ByteCode.DRETURN: + case ByteCode.DSTORE_0: + case ByteCode.DSTORE_1: + case ByteCode.DSTORE_2: + case ByteCode.DSTORE_3: + case ByteCode.DSUB: + case ByteCode.DUP2: + case ByteCode.DUP2_X1: + case ByteCode.DUP2_X2: + case ByteCode.DUP: + case ByteCode.DUP_X1: + case ByteCode.DUP_X2: + case ByteCode.F2D: + case ByteCode.F2I: + case ByteCode.F2L: + case ByteCode.FADD: + case ByteCode.FALOAD: + case ByteCode.FASTORE: + case ByteCode.FCMPG: + case ByteCode.FCMPL: + case ByteCode.FCONST_0: + case ByteCode.FCONST_1: + case ByteCode.FCONST_2: + case ByteCode.FDIV: + case ByteCode.FLOAD_0: + case ByteCode.FLOAD_1: + case ByteCode.FLOAD_2: + case ByteCode.FLOAD_3: + case ByteCode.FMUL: + case ByteCode.FNEG: + case ByteCode.FREM: + case ByteCode.FRETURN: + case ByteCode.FSTORE_0: + case ByteCode.FSTORE_1: + case ByteCode.FSTORE_2: + case ByteCode.FSTORE_3: + case ByteCode.FSUB: + case ByteCode.I2B: + case ByteCode.I2C: + case ByteCode.I2D: + case ByteCode.I2F: + case ByteCode.I2L: + case ByteCode.I2S: + case ByteCode.IADD: + case ByteCode.IALOAD: + case ByteCode.IAND: + case ByteCode.IASTORE: + case ByteCode.ICONST_0: + case ByteCode.ICONST_1: + case ByteCode.ICONST_2: + case ByteCode.ICONST_3: + case ByteCode.ICONST_4: + case ByteCode.ICONST_5: + case ByteCode.ICONST_M1: + case ByteCode.IDIV: + case ByteCode.ILOAD_0: + case ByteCode.ILOAD_1: + case ByteCode.ILOAD_2: + case ByteCode.ILOAD_3: + case ByteCode.IMPDEP1: + case ByteCode.IMPDEP2: + case ByteCode.IMUL: + case ByteCode.INEG: + case ByteCode.IOR: + case ByteCode.IREM: + case ByteCode.IRETURN: + case ByteCode.ISHL: + case ByteCode.ISHR: + case ByteCode.ISTORE_0: + case ByteCode.ISTORE_1: + case ByteCode.ISTORE_2: + case ByteCode.ISTORE_3: + case ByteCode.ISUB: + case ByteCode.IUSHR: + case ByteCode.IXOR: + case ByteCode.L2D: + case ByteCode.L2F: + case ByteCode.L2I: + case ByteCode.LADD: + case ByteCode.LALOAD: + case ByteCode.LAND: + case ByteCode.LASTORE: + case ByteCode.LCMP: + case ByteCode.LCONST_0: + case ByteCode.LCONST_1: + case ByteCode.LDIV: + case ByteCode.LLOAD_0: + case ByteCode.LLOAD_1: + case ByteCode.LLOAD_2: + case ByteCode.LLOAD_3: + case ByteCode.LMUL: + case ByteCode.LNEG: + case ByteCode.LOR: + case ByteCode.LREM: + case ByteCode.LRETURN: + case ByteCode.LSHL: + case ByteCode.LSHR: + case ByteCode.LSTORE_0: + case ByteCode.LSTORE_1: + case ByteCode.LSTORE_2: + case ByteCode.LSTORE_3: + case ByteCode.LSUB: + case ByteCode.LUSHR: + case ByteCode.LXOR: + case ByteCode.MONITORENTER: + case ByteCode.MONITOREXIT: + case ByteCode.NOP: + case ByteCode.POP2: + case ByteCode.POP: + case ByteCode.RETURN: + case ByteCode.SALOAD: + case ByteCode.SASTORE: + case ByteCode.SWAP: + case ByteCode.WIDE: + return 0; + + case ByteCode.ALOAD: + case ByteCode.ASTORE: + case ByteCode.BIPUSH: + case ByteCode.DLOAD: + case ByteCode.DSTORE: + case ByteCode.FLOAD: + case ByteCode.FSTORE: + case ByteCode.ILOAD: + case ByteCode.ISTORE: + case ByteCode.LDC: + case ByteCode.LLOAD: + case ByteCode.LSTORE: + case ByteCode.NEWARRAY: + case ByteCode.RET: + return 1; + + case ByteCode.ANEWARRAY: + case ByteCode.CHECKCAST: + case ByteCode.GETFIELD: + case ByteCode.GETSTATIC: + case ByteCode.GOTO: + case ByteCode.IFEQ: + case ByteCode.IFGE: + case ByteCode.IFGT: + case ByteCode.IFLE: + case ByteCode.IFLT: + case ByteCode.IFNE: + case ByteCode.IFNONNULL: + case ByteCode.IFNULL: + case ByteCode.IF_ACMPEQ: + case ByteCode.IF_ACMPNE: + case ByteCode.IF_ICMPEQ: + case ByteCode.IF_ICMPGE: + case ByteCode.IF_ICMPGT: + case ByteCode.IF_ICMPLE: + case ByteCode.IF_ICMPLT: + case ByteCode.IF_ICMPNE: + case ByteCode.IINC: + case ByteCode.INSTANCEOF: + case ByteCode.INVOKEINTERFACE: + case ByteCode.INVOKESPECIAL: + case ByteCode.INVOKESTATIC: + case ByteCode.INVOKEVIRTUAL: + case ByteCode.JSR: + case ByteCode.LDC2_W: + case ByteCode.LDC_W: + case ByteCode.NEW: + case ByteCode.PUTFIELD: + case ByteCode.PUTSTATIC: + case ByteCode.SIPUSH: + return 2; + + case ByteCode.MULTIANEWARRAY: + return 3; + + case ByteCode.GOTO_W: + case ByteCode.JSR_W: + return 4; + + case ByteCode.LOOKUPSWITCH: // depends on alignment + case ByteCode.TABLESWITCH: // depends on alignment + return -1; + } + throw new IllegalArgumentException("Bad opcode: "+opcode); + } +*/ + private static String bytecodeStr(int code) + { + if (DEBUGSTACK || DEBUGCODE) { + switch (code) { + case ByteCode.NOP: return "nop"; + case ByteCode.ACONST_NULL: return "aconst_null"; + case ByteCode.ICONST_M1: return "iconst_m1"; + case ByteCode.ICONST_0: return "iconst_0"; + case ByteCode.ICONST_1: return "iconst_1"; + case ByteCode.ICONST_2: return "iconst_2"; + case ByteCode.ICONST_3: return "iconst_3"; + case ByteCode.ICONST_4: return "iconst_4"; + case ByteCode.ICONST_5: return "iconst_5"; + case ByteCode.LCONST_0: return "lconst_0"; + case ByteCode.LCONST_1: return "lconst_1"; + case ByteCode.FCONST_0: return "fconst_0"; + case ByteCode.FCONST_1: return "fconst_1"; + case ByteCode.FCONST_2: return "fconst_2"; + case ByteCode.DCONST_0: return "dconst_0"; + case ByteCode.DCONST_1: return "dconst_1"; + case ByteCode.BIPUSH: return "bipush"; + case ByteCode.SIPUSH: return "sipush"; + case ByteCode.LDC: return "ldc"; + case ByteCode.LDC_W: return "ldc_w"; + case ByteCode.LDC2_W: return "ldc2_w"; + case ByteCode.ILOAD: return "iload"; + case ByteCode.LLOAD: return "lload"; + case ByteCode.FLOAD: return "fload"; + case ByteCode.DLOAD: return "dload"; + case ByteCode.ALOAD: return "aload"; + case ByteCode.ILOAD_0: return "iload_0"; + case ByteCode.ILOAD_1: return "iload_1"; + case ByteCode.ILOAD_2: return "iload_2"; + case ByteCode.ILOAD_3: return "iload_3"; + case ByteCode.LLOAD_0: return "lload_0"; + case ByteCode.LLOAD_1: return "lload_1"; + case ByteCode.LLOAD_2: return "lload_2"; + case ByteCode.LLOAD_3: return "lload_3"; + case ByteCode.FLOAD_0: return "fload_0"; + case ByteCode.FLOAD_1: return "fload_1"; + case ByteCode.FLOAD_2: return "fload_2"; + case ByteCode.FLOAD_3: return "fload_3"; + case ByteCode.DLOAD_0: return "dload_0"; + case ByteCode.DLOAD_1: return "dload_1"; + case ByteCode.DLOAD_2: return "dload_2"; + case ByteCode.DLOAD_3: return "dload_3"; + case ByteCode.ALOAD_0: return "aload_0"; + case ByteCode.ALOAD_1: return "aload_1"; + case ByteCode.ALOAD_2: return "aload_2"; + case ByteCode.ALOAD_3: return "aload_3"; + case ByteCode.IALOAD: return "iaload"; + case ByteCode.LALOAD: return "laload"; + case ByteCode.FALOAD: return "faload"; + case ByteCode.DALOAD: return "daload"; + case ByteCode.AALOAD: return "aaload"; + case ByteCode.BALOAD: return "baload"; + case ByteCode.CALOAD: return "caload"; + case ByteCode.SALOAD: return "saload"; + case ByteCode.ISTORE: return "istore"; + case ByteCode.LSTORE: return "lstore"; + case ByteCode.FSTORE: return "fstore"; + case ByteCode.DSTORE: return "dstore"; + case ByteCode.ASTORE: return "astore"; + case ByteCode.ISTORE_0: return "istore_0"; + case ByteCode.ISTORE_1: return "istore_1"; + case ByteCode.ISTORE_2: return "istore_2"; + case ByteCode.ISTORE_3: return "istore_3"; + case ByteCode.LSTORE_0: return "lstore_0"; + case ByteCode.LSTORE_1: return "lstore_1"; + case ByteCode.LSTORE_2: return "lstore_2"; + case ByteCode.LSTORE_3: return "lstore_3"; + case ByteCode.FSTORE_0: return "fstore_0"; + case ByteCode.FSTORE_1: return "fstore_1"; + case ByteCode.FSTORE_2: return "fstore_2"; + case ByteCode.FSTORE_3: return "fstore_3"; + case ByteCode.DSTORE_0: return "dstore_0"; + case ByteCode.DSTORE_1: return "dstore_1"; + case ByteCode.DSTORE_2: return "dstore_2"; + case ByteCode.DSTORE_3: return "dstore_3"; + case ByteCode.ASTORE_0: return "astore_0"; + case ByteCode.ASTORE_1: return "astore_1"; + case ByteCode.ASTORE_2: return "astore_2"; + case ByteCode.ASTORE_3: return "astore_3"; + case ByteCode.IASTORE: return "iastore"; + case ByteCode.LASTORE: return "lastore"; + case ByteCode.FASTORE: return "fastore"; + case ByteCode.DASTORE: return "dastore"; + case ByteCode.AASTORE: return "aastore"; + case ByteCode.BASTORE: return "bastore"; + case ByteCode.CASTORE: return "castore"; + case ByteCode.SASTORE: return "sastore"; + case ByteCode.POP: return "pop"; + case ByteCode.POP2: return "pop2"; + case ByteCode.DUP: return "dup"; + case ByteCode.DUP_X1: return "dup_x1"; + case ByteCode.DUP_X2: return "dup_x2"; + case ByteCode.DUP2: return "dup2"; + case ByteCode.DUP2_X1: return "dup2_x1"; + case ByteCode.DUP2_X2: return "dup2_x2"; + case ByteCode.SWAP: return "swap"; + case ByteCode.IADD: return "iadd"; + case ByteCode.LADD: return "ladd"; + case ByteCode.FADD: return "fadd"; + case ByteCode.DADD: return "dadd"; + case ByteCode.ISUB: return "isub"; + case ByteCode.LSUB: return "lsub"; + case ByteCode.FSUB: return "fsub"; + case ByteCode.DSUB: return "dsub"; + case ByteCode.IMUL: return "imul"; + case ByteCode.LMUL: return "lmul"; + case ByteCode.FMUL: return "fmul"; + case ByteCode.DMUL: return "dmul"; + case ByteCode.IDIV: return "idiv"; + case ByteCode.LDIV: return "ldiv"; + case ByteCode.FDIV: return "fdiv"; + case ByteCode.DDIV: return "ddiv"; + case ByteCode.IREM: return "irem"; + case ByteCode.LREM: return "lrem"; + case ByteCode.FREM: return "frem"; + case ByteCode.DREM: return "drem"; + case ByteCode.INEG: return "ineg"; + case ByteCode.LNEG: return "lneg"; + case ByteCode.FNEG: return "fneg"; + case ByteCode.DNEG: return "dneg"; + case ByteCode.ISHL: return "ishl"; + case ByteCode.LSHL: return "lshl"; + case ByteCode.ISHR: return "ishr"; + case ByteCode.LSHR: return "lshr"; + case ByteCode.IUSHR: return "iushr"; + case ByteCode.LUSHR: return "lushr"; + case ByteCode.IAND: return "iand"; + case ByteCode.LAND: return "land"; + case ByteCode.IOR: return "ior"; + case ByteCode.LOR: return "lor"; + case ByteCode.IXOR: return "ixor"; + case ByteCode.LXOR: return "lxor"; + case ByteCode.IINC: return "iinc"; + case ByteCode.I2L: return "i2l"; + case ByteCode.I2F: return "i2f"; + case ByteCode.I2D: return "i2d"; + case ByteCode.L2I: return "l2i"; + case ByteCode.L2F: return "l2f"; + case ByteCode.L2D: return "l2d"; + case ByteCode.F2I: return "f2i"; + case ByteCode.F2L: return "f2l"; + case ByteCode.F2D: return "f2d"; + case ByteCode.D2I: return "d2i"; + case ByteCode.D2L: return "d2l"; + case ByteCode.D2F: return "d2f"; + case ByteCode.I2B: return "i2b"; + case ByteCode.I2C: return "i2c"; + case ByteCode.I2S: return "i2s"; + case ByteCode.LCMP: return "lcmp"; + case ByteCode.FCMPL: return "fcmpl"; + case ByteCode.FCMPG: return "fcmpg"; + case ByteCode.DCMPL: return "dcmpl"; + case ByteCode.DCMPG: return "dcmpg"; + case ByteCode.IFEQ: return "ifeq"; + case ByteCode.IFNE: return "ifne"; + case ByteCode.IFLT: return "iflt"; + case ByteCode.IFGE: return "ifge"; + case ByteCode.IFGT: return "ifgt"; + case ByteCode.IFLE: return "ifle"; + case ByteCode.IF_ICMPEQ: return "if_icmpeq"; + case ByteCode.IF_ICMPNE: return "if_icmpne"; + case ByteCode.IF_ICMPLT: return "if_icmplt"; + case ByteCode.IF_ICMPGE: return "if_icmpge"; + case ByteCode.IF_ICMPGT: return "if_icmpgt"; + case ByteCode.IF_ICMPLE: return "if_icmple"; + case ByteCode.IF_ACMPEQ: return "if_acmpeq"; + case ByteCode.IF_ACMPNE: return "if_acmpne"; + case ByteCode.GOTO: return "goto"; + case ByteCode.JSR: return "jsr"; + case ByteCode.RET: return "ret"; + case ByteCode.TABLESWITCH: return "tableswitch"; + case ByteCode.LOOKUPSWITCH: return "lookupswitch"; + case ByteCode.IRETURN: return "ireturn"; + case ByteCode.LRETURN: return "lreturn"; + case ByteCode.FRETURN: return "freturn"; + case ByteCode.DRETURN: return "dreturn"; + case ByteCode.ARETURN: return "areturn"; + case ByteCode.RETURN: return "return"; + case ByteCode.GETSTATIC: return "getstatic"; + case ByteCode.PUTSTATIC: return "putstatic"; + case ByteCode.GETFIELD: return "getfield"; + case ByteCode.PUTFIELD: return "putfield"; + case ByteCode.INVOKEVIRTUAL: return "invokevirtual"; + case ByteCode.INVOKESPECIAL: return "invokespecial"; + case ByteCode.INVOKESTATIC: return "invokestatic"; + case ByteCode.INVOKEINTERFACE: return "invokeinterface"; + case ByteCode.NEW: return "new"; + case ByteCode.NEWARRAY: return "newarray"; + case ByteCode.ANEWARRAY: return "anewarray"; + case ByteCode.ARRAYLENGTH: return "arraylength"; + case ByteCode.ATHROW: return "athrow"; + case ByteCode.CHECKCAST: return "checkcast"; + case ByteCode.INSTANCEOF: return "instanceof"; + case ByteCode.MONITORENTER: return "monitorenter"; + case ByteCode.MONITOREXIT: return "monitorexit"; + case ByteCode.WIDE: return "wide"; + case ByteCode.MULTIANEWARRAY: return "multianewarray"; + case ByteCode.IFNULL: return "ifnull"; + case ByteCode.IFNONNULL: return "ifnonnull"; + case ByteCode.GOTO_W: return "goto_w"; + case ByteCode.JSR_W: return "jsr_w"; + case ByteCode.BREAKPOINT: return "breakpoint"; + + case ByteCode.IMPDEP1: return "impdep1"; + case ByteCode.IMPDEP2: return "impdep2"; + } + } + return ""; + } + + final char[] getCharBuffer(int minimalSize) + { + if (minimalSize > tmpCharBuffer.length) { + int newSize = tmpCharBuffer.length * 2; + if (minimalSize > newSize) { newSize = minimalSize; } + tmpCharBuffer = new char[newSize]; + } + return tmpCharBuffer; + } + + private static final int LineNumberTableSize = 16; + private static final int ExceptionTableSize = 4; + + private final static long FileHeaderConstant = 0xCAFEBABE0003002DL; + // Set DEBUG flags to true to get better checking and progress info. + private static final boolean DEBUGSTACK = false; + private static final boolean DEBUGLABELS = false; + private static final boolean DEBUGCODE = false; + + private String generatedClassName; + + private ExceptionTableEntry itsExceptionTable[]; + private int itsExceptionTableTop; + + private int itsLineNumberTable[]; // pack start_pc & line_number together + private int itsLineNumberTableTop; + + private byte[] itsCodeBuffer = new byte[256]; + private int itsCodeBufferTop; + + private ConstantPool itsConstantPool; + + private ClassFileMethod itsCurrentMethod; + private short itsStackTop; + + private short itsMaxStack; + private short itsMaxLocals; + + private ObjArray itsMethods = new ObjArray(); + private ObjArray itsFields = new ObjArray(); + private ObjArray itsInterfaces = new ObjArray(); + + private short itsFlags; + private short itsThisClassIndex; + private short itsSuperClassIndex; + private short itsSourceFileNameIndex; + + private static final int MIN_LABEL_TABLE_SIZE = 32; + private int[] itsLabelTable; + private int itsLabelTableTop; + +// itsFixupTable[i] = (label_index << 32) | fixup_site + private static final int MIN_FIXUP_TABLE_SIZE = 40; + private long[] itsFixupTable; + private int itsFixupTableTop; + private ObjArray itsVarDescriptors; + + private char[] tmpCharBuffer = new char[64]; +} + +final class ExceptionTableEntry +{ + + ExceptionTableEntry(int startLabel, int endLabel, + int handlerLabel, short catchType) + { + itsStartLabel = startLabel; + itsEndLabel = endLabel; + itsHandlerLabel = handlerLabel; + itsCatchType = catchType; + } + + int itsStartLabel; + int itsEndLabel; + int itsHandlerLabel; + short itsCatchType; +} + +final class ClassFileField +{ + + ClassFileField(short nameIndex, short typeIndex, short flags) + { + itsNameIndex = nameIndex; + itsTypeIndex = typeIndex; + itsFlags = flags; + itsHasAttributes = false; + } + + void setAttributes(short attr1, short attr2, short attr3, int index) + { + itsHasAttributes = true; + itsAttr1 = attr1; + itsAttr2 = attr2; + itsAttr3 = attr3; + itsIndex = index; + } + + int write(byte[] data, int offset) + { + offset = ClassFileWriter.putInt16(itsFlags, data, offset); + offset = ClassFileWriter.putInt16(itsNameIndex, data, offset); + offset = ClassFileWriter.putInt16(itsTypeIndex, data, offset); + if (!itsHasAttributes) { + // write 0 attributes + offset = ClassFileWriter.putInt16(0, data, offset); + } else { + offset = ClassFileWriter.putInt16(1, data, offset); + offset = ClassFileWriter.putInt16(itsAttr1, data, offset); + offset = ClassFileWriter.putInt16(itsAttr2, data, offset); + offset = ClassFileWriter.putInt16(itsAttr3, data, offset); + offset = ClassFileWriter.putInt16(itsIndex, data, offset); + } + return offset; + } + + int getWriteSize() + { + int size = 2 * 3; + if (!itsHasAttributes) { + size += 2; + } else { + size += 2 + 2 * 4; + } + return size; + } + + private short itsNameIndex; + private short itsTypeIndex; + private short itsFlags; + private boolean itsHasAttributes; + private short itsAttr1, itsAttr2, itsAttr3; + private int itsIndex; +} + +final class ClassFileMethod +{ + + ClassFileMethod(short nameIndex, short typeIndex, short flags) + { + itsNameIndex = nameIndex; + itsTypeIndex = typeIndex; + itsFlags = flags; + } + + void setCodeAttribute(byte codeAttribute[]) + { + itsCodeAttribute = codeAttribute; + } + + int write(byte[] data, int offset) + { + offset = ClassFileWriter.putInt16(itsFlags, data, offset); + offset = ClassFileWriter.putInt16(itsNameIndex, data, offset); + offset = ClassFileWriter.putInt16(itsTypeIndex, data, offset); + // Code attribute only + offset = ClassFileWriter.putInt16(1, data, offset); + System.arraycopy(itsCodeAttribute, 0, data, offset, + itsCodeAttribute.length); + offset += itsCodeAttribute.length; + return offset; + } + + int getWriteSize() + { + return 2 * 4 + itsCodeAttribute.length; + } + + private short itsNameIndex; + private short itsTypeIndex; + private short itsFlags; + private byte[] itsCodeAttribute; + +} + +final class ConstantPool +{ + + ConstantPool(ClassFileWriter cfw) + { + this.cfw = cfw; + itsTopIndex = 1; // the zero'th entry is reserved + itsPool = new byte[ConstantPoolSize]; + itsTop = 0; + } + + private static final int ConstantPoolSize = 256; + private static final byte + CONSTANT_Class = 7, + CONSTANT_Fieldref = 9, + CONSTANT_Methodref = 10, + CONSTANT_InterfaceMethodref = 11, + CONSTANT_String = 8, + CONSTANT_Integer = 3, + CONSTANT_Float = 4, + CONSTANT_Long = 5, + CONSTANT_Double = 6, + CONSTANT_NameAndType = 12, + CONSTANT_Utf8 = 1; + + int write(byte[] data, int offset) + { + offset = ClassFileWriter.putInt16((short)itsTopIndex, data, offset); + System.arraycopy(itsPool, 0, data, offset, itsTop); + offset += itsTop; + return offset; + } + + int getWriteSize() + { + return 2 + itsTop; + } + + int addConstant(int k) + { + ensure(5); + itsPool[itsTop++] = CONSTANT_Integer; + itsTop = ClassFileWriter.putInt32(k, itsPool, itsTop); + return (short)(itsTopIndex++); + } + + int addConstant(long k) + { + ensure(9); + itsPool[itsTop++] = CONSTANT_Long; + itsTop = ClassFileWriter.putInt64(k, itsPool, itsTop); + int index = itsTopIndex; + itsTopIndex += 2; + return index; + } + + int addConstant(float k) + { + ensure(5); + itsPool[itsTop++] = CONSTANT_Float; + int bits = Float.floatToIntBits(k); + itsTop = ClassFileWriter.putInt32(bits, itsPool, itsTop); + return itsTopIndex++; + } + + int addConstant(double k) + { + ensure(9); + itsPool[itsTop++] = CONSTANT_Double; + long bits = Double.doubleToLongBits(k); + itsTop = ClassFileWriter.putInt64(bits, itsPool, itsTop); + int index = itsTopIndex; + itsTopIndex += 2; + return index; + } + + int addConstant(String k) + { + int utf8Index = 0xFFFF & addUtf8(k); + int theIndex = itsStringConstHash.getInt(utf8Index, -1); + if (theIndex == -1) { + theIndex = itsTopIndex++; + ensure(3); + itsPool[itsTop++] = CONSTANT_String; + itsTop = ClassFileWriter.putInt16(utf8Index, itsPool, itsTop); + itsStringConstHash.put(utf8Index, theIndex); + } + return theIndex; + } + + boolean isUnderUtfEncodingLimit(String s) + { + int strLen = s.length(); + if (strLen * 3 <= MAX_UTF_ENCODING_SIZE) { + return true; + } else if (strLen > MAX_UTF_ENCODING_SIZE) { + return false; + } + return strLen == getUtfEncodingLimit(s, 0, strLen); + } + + /** + * Get maximum i such that start <= i <= end and + * s.substring(start, i) fits JVM UTF string encoding limit. + */ + int getUtfEncodingLimit(String s, int start, int end) + { + if ((end - start) * 3 <= MAX_UTF_ENCODING_SIZE) { + return end; + } + int limit = MAX_UTF_ENCODING_SIZE; + for (int i = start; i != end; i++) { + int c = s.charAt(i); + if (0 != c && c <= 0x7F) { + --limit; + } else if (c < 0x7FF) { + limit -= 2; + } else { + limit -= 3; + } + if (limit < 0) { + return i; + } + } + return end; + } + + short addUtf8(String k) + { + int theIndex = itsUtf8Hash.get(k, -1); + if (theIndex == -1) { + int strLen = k.length(); + boolean tooBigString; + if (strLen > MAX_UTF_ENCODING_SIZE) { + tooBigString = true; + } else { + tooBigString = false; + // Ask for worst case scenario buffer when each char takes 3 + // bytes + ensure(1 + 2 + strLen * 3); + int top = itsTop; + + itsPool[top++] = CONSTANT_Utf8; + top += 2; // skip length + + char[] chars = cfw.getCharBuffer(strLen); + k.getChars(0, strLen, chars, 0); + + for (int i = 0; i != strLen; i++) { + int c = chars[i]; + if (c != 0 && c <= 0x7F) { + itsPool[top++] = (byte)c; + } else if (c > 0x7FF) { + itsPool[top++] = (byte)(0xE0 | (c >> 12)); + itsPool[top++] = (byte)(0x80 | ((c >> 6) & 0x3F)); + itsPool[top++] = (byte)(0x80 | (c & 0x3F)); + } else { + itsPool[top++] = (byte)(0xC0 | (c >> 6)); + itsPool[top++] = (byte)(0x80 | (c & 0x3F)); + } + } + + int utfLen = top - (itsTop + 1 + 2); + if (utfLen > MAX_UTF_ENCODING_SIZE) { + tooBigString = true; + } else { + // Write back length + itsPool[itsTop + 1] = (byte)(utfLen >>> 8); + itsPool[itsTop + 2] = (byte)utfLen; + + itsTop = top; + theIndex = itsTopIndex++; + itsUtf8Hash.put(k, theIndex); + } + } + if (tooBigString) { + throw new IllegalArgumentException("Too big string"); + } + } + return (short)theIndex; + } + + private short addNameAndType(String name, String type) + { + short nameIndex = addUtf8(name); + short typeIndex = addUtf8(type); + ensure(5); + itsPool[itsTop++] = CONSTANT_NameAndType; + itsTop = ClassFileWriter.putInt16(nameIndex, itsPool, itsTop); + itsTop = ClassFileWriter.putInt16(typeIndex, itsPool, itsTop); + return (short)(itsTopIndex++); + } + + short addClass(String className) + { + int theIndex = itsClassHash.get(className, -1); + if (theIndex == -1) { + String slashed = className; + if (className.indexOf('.') > 0) { + slashed = ClassFileWriter.getSlashedForm(className); + theIndex = itsClassHash.get(slashed, -1); + if (theIndex != -1) { + itsClassHash.put(className, theIndex); + } + } + if (theIndex == -1) { + int utf8Index = addUtf8(slashed); + ensure(3); + itsPool[itsTop++] = CONSTANT_Class; + itsTop = ClassFileWriter.putInt16(utf8Index, itsPool, itsTop); + theIndex = itsTopIndex++; + itsClassHash.put(slashed, theIndex); + if (className != slashed) { + itsClassHash.put(className, theIndex); + } + } + } + return (short)theIndex; + } + + short addFieldRef(String className, String fieldName, String fieldType) + { + FieldOrMethodRef ref = new FieldOrMethodRef(className, fieldName, + fieldType); + + int theIndex = itsFieldRefHash.get(ref, -1); + if (theIndex == -1) { + short ntIndex = addNameAndType(fieldName, fieldType); + short classIndex = addClass(className); + ensure(5); + itsPool[itsTop++] = CONSTANT_Fieldref; + itsTop = ClassFileWriter.putInt16(classIndex, itsPool, itsTop); + itsTop = ClassFileWriter.putInt16(ntIndex, itsPool, itsTop); + theIndex = itsTopIndex++; + itsFieldRefHash.put(ref, theIndex); + } + return (short)theIndex; + } + + short addMethodRef(String className, String methodName, + String methodType) + { + FieldOrMethodRef ref = new FieldOrMethodRef(className, methodName, + methodType); + + int theIndex = itsMethodRefHash.get(ref, -1); + if (theIndex == -1) { + short ntIndex = addNameAndType(methodName, methodType); + short classIndex = addClass(className); + ensure(5); + itsPool[itsTop++] = CONSTANT_Methodref; + itsTop = ClassFileWriter.putInt16(classIndex, itsPool, itsTop); + itsTop = ClassFileWriter.putInt16(ntIndex, itsPool, itsTop); + theIndex = itsTopIndex++; + itsMethodRefHash.put(ref, theIndex); + } + return (short)theIndex; + } + + short addInterfaceMethodRef(String className, + String methodName, String methodType) + { + short ntIndex = addNameAndType(methodName, methodType); + short classIndex = addClass(className); + ensure(5); + itsPool[itsTop++] = CONSTANT_InterfaceMethodref; + itsTop = ClassFileWriter.putInt16(classIndex, itsPool, itsTop); + itsTop = ClassFileWriter.putInt16(ntIndex, itsPool, itsTop); + return (short)(itsTopIndex++); + } + + void ensure(int howMuch) + { + if (itsTop + howMuch > itsPool.length) { + int newCapacity = itsPool.length * 2; + if (itsTop + howMuch > newCapacity) { + newCapacity = itsTop + howMuch; + } + byte[] tmp = new byte[newCapacity]; + System.arraycopy(itsPool, 0, tmp, 0, itsTop); + itsPool = tmp; + } + } + + private ClassFileWriter cfw; + + private static final int MAX_UTF_ENCODING_SIZE = 65535; + + private UintMap itsStringConstHash = new UintMap(); + private ObjToIntMap itsUtf8Hash = new ObjToIntMap(); + private ObjToIntMap itsFieldRefHash = new ObjToIntMap(); + private ObjToIntMap itsMethodRefHash = new ObjToIntMap(); + private ObjToIntMap itsClassHash = new ObjToIntMap(); + + private int itsTop; + private int itsTopIndex; + private byte itsPool[]; +} + +final class FieldOrMethodRef +{ + FieldOrMethodRef(String className, String name, String type) + { + this.className = className; + this.name = name; + this.type = type; + } + + @Override + public boolean equals(Object obj) + { + if (!(obj instanceof FieldOrMethodRef)) { return false; } + FieldOrMethodRef x = (FieldOrMethodRef)obj; + return className.equals(x.className) + && name.equals(x.name) + && type.equals(x.type); + } + + @Override + public int hashCode() + { + if (hashCode == -1) { + int h1 = className.hashCode(); + int h2 = name.hashCode(); + int h3 = type.hashCode(); + hashCode = h1 ^ h2 ^ h3; + } + return hashCode; + } + + private String className; + private String name; + private String type; + private int hashCode = -1; +} diff --git a/org/mozilla/javascript/Arguments.java b/org/mozilla/javascript/Arguments.java new file mode 100644 index 0000000..d914294 --- /dev/null +++ b/org/mozilla/javascript/Arguments.java @@ -0,0 +1,322 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-1999 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Norris Boyd + * Igor Bukanov + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +package org.mozilla.javascript; + +/** + * This class implements the "arguments" object. + * + * See ECMA 10.1.8 + * + * @see org.mozilla.javascript.NativeCall + * @author Norris Boyd + */ +final class Arguments extends IdScriptableObject +{ + static final long serialVersionUID = 4275508002492040609L; + + public Arguments(NativeCall activation) + { + this.activation = activation; + + Scriptable parent = activation.getParentScope(); + setParentScope(parent); + setPrototype(ScriptableObject.getObjectPrototype(parent)); + + args = activation.originalArgs; + lengthObj = new Integer(args.length); + + NativeFunction f = activation.function; + calleeObj = f; + + int version = f.getLanguageVersion(); + if (version <= Context.VERSION_1_3 + && version != Context.VERSION_DEFAULT) + { + callerObj = null; + } else { + callerObj = NOT_FOUND; + } + } + + @Override + public String getClassName() + { + return "Object"; + } + + @Override + public boolean has(int index, Scriptable start) + { + if (0 <= index && index < args.length) { + if (args[index] != NOT_FOUND) { + return true; + } + } + return super.has(index, start); + } + + @Override + public Object get(int index, Scriptable start) + { + if (0 <= index && index < args.length) { + Object value = args[index]; + if (value != NOT_FOUND) { + if (sharedWithActivation(index)) { + NativeFunction f = activation.function; + String argName = f.getParamOrVarName(index); + value = activation.get(argName, activation); + if (value == NOT_FOUND) Kit.codeBug(); + } + return value; + } + } + return super.get(index, start); + } + + private boolean sharedWithActivation(int index) + { + NativeFunction f = activation.function; + int definedCount = f.getParamCount(); + if (index < definedCount) { + // Check if argument is not hidden by later argument with the same + // name as hidden arguments are not shared with activation + if (index < definedCount - 1) { + String argName = f.getParamOrVarName(index); + for (int i = index + 1; i < definedCount; i++) { + if (argName.equals(f.getParamOrVarName(i))) { + return false; + } + } + } + return true; + } + return false; + } + + @Override + public void put(int index, Scriptable start, Object value) + { + if (0 <= index && index < args.length) { + if (args[index] != NOT_FOUND) { + if (sharedWithActivation(index)) { + String argName; + argName = activation.function.getParamOrVarName(index); + activation.put(argName, activation, value); + return; + } + synchronized (this) { + if (args[index] != NOT_FOUND) { + if (args == activation.originalArgs) { + args = args.clone(); + } + args[index] = value; + return; + } + } + } + } + super.put(index, start, value); + } + + @Override + public void delete(int index) + { + if (0 <= index && index < args.length) { + synchronized (this) { + if (args[index] != NOT_FOUND) { + if (args == activation.originalArgs) { + args = args.clone(); + } + args[index] = NOT_FOUND; + return; + } + } + } + super.delete(index); + } + +// #string_id_map# + + private static final int + Id_callee = 1, + Id_length = 2, + Id_caller = 3, + + MAX_INSTANCE_ID = 3; + + @Override + protected int getMaxInstanceId() + { + return MAX_INSTANCE_ID; + } + + @Override + protected int findInstanceIdInfo(String s) + { + int id; +// #generated# Last update: 2007-05-09 08:15:04 EDT + L0: { id = 0; String X = null; int c; + if (s.length()==6) { + c=s.charAt(5); + if (c=='e') { X="callee";id=Id_callee; } + else if (c=='h') { X="length";id=Id_length; } + else if (c=='r') { X="caller";id=Id_caller; } + } + if (X!=null && X!=s && !X.equals(s)) id = 0; + break L0; + } +// #/generated# + + if (id == 0) return super.findInstanceIdInfo(s); + + int attr; + switch (id) { + case Id_callee: + case Id_caller: + case Id_length: + attr = DONTENUM; + break; + default: throw new IllegalStateException(); + } + return instanceIdInfo(attr, id); + } + +// #/string_id_map# + + @Override + protected String getInstanceIdName(int id) + { + switch (id) { + case Id_callee: return "callee"; + case Id_length: return "length"; + case Id_caller: return "caller"; + } + return null; + } + + @Override + protected Object getInstanceIdValue(int id) + { + switch (id) { + case Id_callee: return calleeObj; + case Id_length: return lengthObj; + case Id_caller: { + Object value = callerObj; + if (value == UniqueTag.NULL_VALUE) { value = null; } + else if (value == null) { + NativeCall caller = activation.parentActivationCall; + if (caller != null) { + value = caller.get("arguments", caller); + } + } + return value; + } + } + return super.getInstanceIdValue(id); + } + + @Override + protected void setInstanceIdValue(int id, Object value) + { + switch (id) { + case Id_callee: calleeObj = value; return; + case Id_length: lengthObj = value; return; + case Id_caller: + callerObj = (value != null) ? value : UniqueTag.NULL_VALUE; + return; + } + super.setInstanceIdValue(id, value); + } + + @Override + Object[] getIds(boolean getAll) + { + Object[] ids = super.getIds(getAll); + if (getAll && args.length != 0) { + boolean[] present = null; + int extraCount = args.length; + for (int i = 0; i != ids.length; ++i) { + Object id = ids[i]; + if (id instanceof Integer) { + int index = ((Integer)id).intValue(); + if (0 <= index && index < args.length) { + if (present == null) { + present = new boolean[args.length]; + } + if (!present[index]) { + present[index] = true; + extraCount--; + } + } + } + } + if (extraCount != 0) { + Object[] tmp = new Object[extraCount + ids.length]; + System.arraycopy(ids, 0, tmp, extraCount, ids.length); + ids = tmp; + int offset = 0; + for (int i = 0; i != args.length; ++i) { + if (present == null || !present[i]) { + ids[offset] = new Integer(i); + ++offset; + } + } + if (offset != extraCount) Kit.codeBug(); + } + } + return ids; + } + +// Fields to hold caller, callee and length properties, +// where NOT_FOUND value tags deleted properties. +// In addition if callerObj == NULL_VALUE, it tags null for scripts, as +// initial callerObj == null means access to caller arguments available +// only in JS <= 1.3 scripts + private Object callerObj; + private Object calleeObj; + private Object lengthObj; + + private NativeCall activation; + +// Initially args holds activation.getOriginalArgs(), but any modification +// of its elements triggers creation of a copy. If its element holds NOT_FOUND, +// it indicates deleted index, in which case super class is queried. + private Object[] args; +} diff --git a/org/mozilla/javascript/BaseFunction.java b/org/mozilla/javascript/BaseFunction.java new file mode 100644 index 0000000..ffec329 --- /dev/null +++ b/org/mozilla/javascript/BaseFunction.java @@ -0,0 +1,564 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-1999 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Norris Boyd + * Igor Bukanov + * Roger Lawrence + * Mike McCabe + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +package org.mozilla.javascript; + +/** + * The base class for Function objects + * See ECMA 15.3. + * @author Norris Boyd + */ +public class BaseFunction extends IdScriptableObject implements Function +{ + + static final long serialVersionUID = 5311394446546053859L; + + private static final Object FUNCTION_TAG = "Function"; + + static void init(Scriptable scope, boolean sealed) + { + BaseFunction obj = new BaseFunction(); + // Function.prototype attributes: see ECMA 15.3.3.1 + obj.prototypePropertyAttributes = DONTENUM | READONLY | PERMANENT; + obj.exportAsJSClass(MAX_PROTOTYPE_ID, scope, sealed); + } + + public BaseFunction() + { + } + + public BaseFunction(Scriptable scope, Scriptable prototype) + { + super(scope, prototype); + } + + @Override + public String getClassName() { + return "Function"; + } + + /** + * Implements the instanceof operator for JavaScript Function objects. + *

+ * + * foo = new Foo();
+ * foo instanceof Foo; // true
+ *
+ * + * @param instance The value that appeared on the LHS of the instanceof + * operator + * @return true if the "prototype" property of "this" appears in + * value's prototype chain + * + */ + @Override + public boolean hasInstance(Scriptable instance) + { + Object protoProp = ScriptableObject.getProperty(this, "prototype"); + if (protoProp instanceof Scriptable) { + return ScriptRuntime.jsDelegatesTo(instance, (Scriptable)protoProp); + } + throw ScriptRuntime.typeError1("msg.instanceof.bad.prototype", + getFunctionName()); + } + +// #string_id_map# + + private static final int + Id_length = 1, + Id_arity = 2, + Id_name = 3, + Id_prototype = 4, + Id_arguments = 5, + + MAX_INSTANCE_ID = 5; + + @Override + protected int getMaxInstanceId() + { + return MAX_INSTANCE_ID; + } + + @Override + protected int findInstanceIdInfo(String s) + { + int id; +// #generated# Last update: 2007-05-09 08:15:15 EDT + L0: { id = 0; String X = null; int c; + L: switch (s.length()) { + case 4: X="name";id=Id_name; break L; + case 5: X="arity";id=Id_arity; break L; + case 6: X="length";id=Id_length; break L; + case 9: c=s.charAt(0); + if (c=='a') { X="arguments";id=Id_arguments; } + else if (c=='p') { X="prototype";id=Id_prototype; } + break L; + } + if (X!=null && X!=s && !X.equals(s)) id = 0; + break L0; + } +// #/generated# +// #/string_id_map# + + if (id == 0) return super.findInstanceIdInfo(s); + + int attr; + switch (id) { + case Id_length: + case Id_arity: + case Id_name: + attr = DONTENUM | READONLY | PERMANENT; + break; + case Id_prototype: + attr = prototypePropertyAttributes; + break; + case Id_arguments: + attr = DONTENUM | PERMANENT; + break; + default: throw new IllegalStateException(); + } + return instanceIdInfo(attr, id); + } + + @Override + protected String getInstanceIdName(int id) + { + switch (id) { + case Id_length: return "length"; + case Id_arity: return "arity"; + case Id_name: return "name"; + case Id_prototype: return "prototype"; + case Id_arguments: return "arguments"; + } + return super.getInstanceIdName(id); + } + + @Override + protected Object getInstanceIdValue(int id) + { + switch (id) { + case Id_length: return ScriptRuntime.wrapInt(getLength()); + case Id_arity: return ScriptRuntime.wrapInt(getArity()); + case Id_name: return getFunctionName(); + case Id_prototype: return getPrototypeProperty(); + case Id_arguments: return getArguments(); + } + return super.getInstanceIdValue(id); + } + + @Override + protected void setInstanceIdValue(int id, Object value) + { + if (id == Id_prototype) { + if ((prototypePropertyAttributes & READONLY) == 0) { + prototypeProperty = (value != null) + ? value : UniqueTag.NULL_VALUE; + } + return; + } else if (id == Id_arguments) { + if (value == NOT_FOUND) { + // This should not be called since "arguments" is PERMANENT + Kit.codeBug(); + } + defaultPut("arguments", value); + } + super.setInstanceIdValue(id, value); + } + + @Override + protected void fillConstructorProperties(IdFunctionObject ctor) + { + // Fix up bootstrapping problem: getPrototype of the IdFunctionObject + // can not return Function.prototype because Function object is not + // yet defined. + ctor.setPrototype(this); + super.fillConstructorProperties(ctor); + } + + @Override + protected void initPrototypeId(int id) + { + String s; + int arity; + switch (id) { + case Id_constructor: arity=1; s="constructor"; break; + case Id_toString: arity=1; s="toString"; break; + case Id_toSource: arity=1; s="toSource"; break; + case Id_apply: arity=2; s="apply"; break; + case Id_call: arity=1; s="call"; break; + default: throw new IllegalArgumentException(String.valueOf(id)); + } + initPrototypeMethod(FUNCTION_TAG, id, s, arity); + } + + static boolean isApply(IdFunctionObject f) { + return f.hasTag(FUNCTION_TAG) && f.methodId() == Id_apply; + } + + static boolean isApplyOrCall(IdFunctionObject f) { + if(f.hasTag(FUNCTION_TAG)) { + switch(f.methodId()) { + case Id_apply: + case Id_call: + return true; + } + } + return false; + } + + @Override + public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope, + Scriptable thisObj, Object[] args) + { + if (!f.hasTag(FUNCTION_TAG)) { + return super.execIdCall(f, cx, scope, thisObj, args); + } + int id = f.methodId(); + switch (id) { + case Id_constructor: + return jsConstructor(cx, scope, args); + + case Id_toString: { + BaseFunction realf = realFunction(thisObj, f); + int indent = ScriptRuntime.toInt32(args, 0); + return realf.decompile(indent, 0); + } + + case Id_toSource: { + BaseFunction realf = realFunction(thisObj, f); + int indent = 0; + int flags = Decompiler.TO_SOURCE_FLAG; + if (args.length != 0) { + indent = ScriptRuntime.toInt32(args[0]); + if (indent >= 0) { + flags = 0; + } else { + indent = 0; + } + } + return realf.decompile(indent, flags); + } + + case Id_apply: + case Id_call: + return ScriptRuntime.applyOrCall(id == Id_apply, + cx, scope, thisObj, args); + } + throw new IllegalArgumentException(String.valueOf(id)); + } + + private BaseFunction realFunction(Scriptable thisObj, IdFunctionObject f) + { + Object x = thisObj.getDefaultValue(ScriptRuntime.FunctionClass); + if (x instanceof BaseFunction) { + return (BaseFunction)x; + } + throw ScriptRuntime.typeError1("msg.incompat.call", + f.getFunctionName()); + } + + /** + * Make value as DontEnum, DontDelete, ReadOnly + * prototype property of this Function object + */ + public void setImmunePrototypeProperty(Object value) + { + if ((prototypePropertyAttributes & READONLY) != 0) { + throw new IllegalStateException(); + } + prototypeProperty = (value != null) ? value : UniqueTag.NULL_VALUE; + prototypePropertyAttributes = DONTENUM | PERMANENT | READONLY; + } + + protected Scriptable getClassPrototype() + { + Object protoVal = getPrototypeProperty(); + if (protoVal instanceof Scriptable) { + return (Scriptable) protoVal; + } + return getClassPrototype(this, "Object"); + } + + /** + * Should be overridden. + */ + public Object call(Context cx, Scriptable scope, Scriptable thisObj, + Object[] args) + { + return Undefined.instance; + } + + public Scriptable construct(Context cx, Scriptable scope, Object[] args) + { + Scriptable result = createObject(cx, scope); + if (result != null) { + Object val = call(cx, scope, result, args); + if (val instanceof Scriptable) { + result = (Scriptable)val; + } + } else { + Object val = call(cx, scope, null, args); + if (!(val instanceof Scriptable)) { + // It is program error not to return Scriptable from + // the call method if createObject returns null. + throw new IllegalStateException( + "Bad implementaion of call as constructor, name=" + +getFunctionName()+" in "+getClass().getName()); + } + result = (Scriptable)val; + if (result.getPrototype() == null) { + result.setPrototype(getClassPrototype()); + } + if (result.getParentScope() == null) { + Scriptable parent = getParentScope(); + if (result != parent) { + result.setParentScope(parent); + } + } + } + return result; + } + + /** + * Creates new script object. + * The default implementation of {@link #construct} uses the method to + * to get the value for thisObj argument when invoking + * {@link #call}. + * The methos is allowed to return null to indicate that + * {@link #call} will create a new object itself. In this case + * {@link #construct} will set scope and prototype on the result + * {@link #call} unless they are already set. + */ + public Scriptable createObject(Context cx, Scriptable scope) + { + Scriptable newInstance = new NativeObject(); + newInstance.setPrototype(getClassPrototype()); + newInstance.setParentScope(getParentScope()); + return newInstance; + } + + /** + * Decompile the source information associated with this js + * function/script back into a string. + * + * @param indent How much to indent the decompiled result. + * + * @param flags Flags specifying format of decompilation output. + */ + String decompile(int indent, int flags) + { + StringBuffer sb = new StringBuffer(); + boolean justbody = (0 != (flags & Decompiler.ONLY_BODY_FLAG)); + if (!justbody) { + sb.append("function "); + sb.append(getFunctionName()); + sb.append("() {\n\t"); + } + sb.append("[native code, arity="); + sb.append(getArity()); + sb.append("]\n"); + if (!justbody) { + sb.append("}\n"); + } + return sb.toString(); + } + + public int getArity() { return 0; } + + public int getLength() { return 0; } + + public String getFunctionName() + { + return ""; + } + + final Object getPrototypeProperty() { + Object result = prototypeProperty; + if (result == null) { + synchronized (this) { + result = prototypeProperty; + if (result == null) { + setupDefaultPrototype(); + result = prototypeProperty; + } + } + } + else if (result == UniqueTag.NULL_VALUE) { result = null; } + return result; + } + + private void setupDefaultPrototype() + { + NativeObject obj = new NativeObject(); + final int attr = ScriptableObject.DONTENUM; + obj.defineProperty("constructor", this, attr); + // put the prototype property into the object now, then in the + // wacky case of a user defining a function Object(), we don't + // get an infinite loop trying to find the prototype. + prototypeProperty = obj; + Scriptable proto = getObjectPrototype(this); + if (proto != obj) { + // not the one we just made, it must remain grounded + obj.setPrototype(proto); + } + } + + private Object getArguments() + { + // .arguments is deprecated, so we use a slow + // way of getting it that doesn't add to the invocation cost. + // TODO: add warning, error based on version + Object value = defaultGet("arguments"); + if (value != NOT_FOUND) { + // Should after changing .arguments its + // activation still be available during Function call? + // This code assumes it should not: + // defaultGet("arguments") != NOT_FOUND + // means assigned arguments + return value; + } + Context cx = Context.getContext(); + NativeCall activation = ScriptRuntime.findFunctionActivation(cx, this); + return (activation == null) + ? null + : activation.get("arguments", activation); + } + + private static Object jsConstructor(Context cx, Scriptable scope, + Object[] args) + { + int arglen = args.length; + StringBuffer sourceBuf = new StringBuffer(); + + sourceBuf.append("function "); + /* version != 1.2 Function constructor behavior - + * print 'anonymous' as the function name if the + * version (under which the function was compiled) is + * less than 1.2... or if it's greater than 1.2, because + * we need to be closer to ECMA. + */ + if (cx.getLanguageVersion() != Context.VERSION_1_2) { + sourceBuf.append("anonymous"); + } + sourceBuf.append('('); + + // Append arguments as coma separated strings + for (int i = 0; i < arglen - 1; i++) { + if (i > 0) { + sourceBuf.append(','); + } + sourceBuf.append(ScriptRuntime.toString(args[i])); + } + sourceBuf.append(") {"); + if (arglen != 0) { + // append function body + String funBody = ScriptRuntime.toString(args[arglen - 1]); + sourceBuf.append(funBody); + } + sourceBuf.append('}'); + String source = sourceBuf.toString(); + + int[] linep = new int[1]; + String filename = Context.getSourcePositionFromStack(linep); + if (filename == null) { + filename = ""; + linep[0] = 1; + } + + String sourceURI = ScriptRuntime. + makeUrlForGeneratedScript(false, filename, linep[0]); + + Scriptable global = ScriptableObject.getTopLevelScope(scope); + + ErrorReporter reporter; + reporter = DefaultErrorReporter.forEval(cx.getErrorReporter()); + + Evaluator evaluator = Context.createInterpreter(); + if (evaluator == null) { + throw new JavaScriptException("Interpreter not present", + filename, linep[0]); + } + + // Compile with explicit interpreter instance to force interpreter + // mode. + return cx.compileFunction(global, source, evaluator, reporter, + sourceURI, 1, null); + } + + @Override + protected int findPrototypeId(String s) + { + int id; +// #string_id_map# +// #generated# Last update: 2007-05-09 08:15:15 EDT + L0: { id = 0; String X = null; int c; + L: switch (s.length()) { + case 4: X="call";id=Id_call; break L; + case 5: X="apply";id=Id_apply; break L; + case 8: c=s.charAt(3); + if (c=='o') { X="toSource";id=Id_toSource; } + else if (c=='t') { X="toString";id=Id_toString; } + break L; + case 11: X="constructor";id=Id_constructor; break L; + } + if (X!=null && X!=s && !X.equals(s)) id = 0; + break L0; + } +// #/generated# + return id; + } + + private static final int + Id_constructor = 1, + Id_toString = 2, + Id_toSource = 3, + Id_apply = 4, + Id_call = 5, + + MAX_PROTOTYPE_ID = 5; + +// #/string_id_map# + + private Object prototypeProperty; + // For function object instances, attribute is PERMANENT; see ECMA 15.3.5.2 + private int prototypePropertyAttributes = PERMANENT; +} + diff --git a/org/mozilla/javascript/Callable.java b/org/mozilla/javascript/Callable.java new file mode 100644 index 0000000..03e0fce --- /dev/null +++ b/org/mozilla/javascript/Callable.java @@ -0,0 +1,59 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-1999 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Igor Bukanov, igor@fastmail.fm + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +package org.mozilla.javascript; + +/** + * Generic notion of callable object that can execute some script-related code + * upon request with specified values for script scope and this objects. + */ +public interface Callable +{ + /** + * Perform the call. + * + * @param cx the current Context for this thread + * @param scope the scope to use to resolve properties. + * @param thisObj the JavaScript this object + * @param args the array of arguments + * @return the result of the call + */ + public Object call(Context cx, Scriptable scope, Scriptable thisObj, + Object[] args); +} + diff --git a/org/mozilla/javascript/ClassCache.java b/org/mozilla/javascript/ClassCache.java new file mode 100644 index 0000000..e1c97d4 --- /dev/null +++ b/org/mozilla/javascript/ClassCache.java @@ -0,0 +1,223 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-1999 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Igor Bukanov, igor@fastmail.fm + * Norris Boyd + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +package org.mozilla.javascript; + +import java.util.Map; +import java.util.HashMap; +import java.io.Serializable; + +/** + * Cache of generated classes and data structures to access Java runtime + * from JavaScript. + * + * @author Igor Bukanov + * + * @since Rhino 1.5 Release 5 + */ +public class ClassCache implements Serializable +{ + private static final long serialVersionUID = -8866246036237312215L; + private static final Object AKEY = "ClassCache"; + private volatile boolean cachingIsEnabled = true; + private transient HashMap,JavaMembers> classTable; + private transient HashMap> classAdapterCache; + private transient HashMap,Object> interfaceAdapterCache; + private int generatedClassSerial; + + /** + * Search for ClassCache object in the given scope. + * The method first calls + * {@link ScriptableObject#getTopLevelScope(Scriptable scope)} + * to get the top most scope and then tries to locate associated + * ClassCache object in the prototype chain of the top scope. + * + * @param scope scope to search for ClassCache object. + * @return previously associated ClassCache object or a new instance of + * ClassCache if no ClassCache object was found. + * + * @see #associate(ScriptableObject topScope) + */ + public static ClassCache get(Scriptable scope) + { + ClassCache cache = (ClassCache) + ScriptableObject.getTopScopeValue(scope, AKEY); + if (cache == null) { + throw new RuntimeException("Can't find top level scope for " + + "ClassCache.get"); + } + return cache; + } + + /** + * Associate ClassCache object with the given top-level scope. + * The ClassCache object can only be associated with the given scope once. + * + * @param topScope scope to associate this ClassCache object with. + * @return true if no previous ClassCache objects were embedded into + * the scope and this ClassCache were successfully associated + * or false otherwise. + * + * @see #get(Scriptable scope) + */ + public boolean associate(ScriptableObject topScope) + { + if (topScope.getParentScope() != null) { + // Can only associate cache with top level scope + throw new IllegalArgumentException(); + } + if (this == topScope.associateValue(AKEY, this)) { + return true; + } + return false; + } + + /** + * Empty caches of generated Java classes and Java reflection information. + */ + public synchronized void clearCaches() + { + classTable = null; + classAdapterCache = null; + interfaceAdapterCache = null; + } + + /** + * Check if generated Java classes and Java reflection information + * is cached. + */ + public final boolean isCachingEnabled() + { + return cachingIsEnabled; + } + + /** + * Set whether to cache some values. + *

+ * By default, the engine will cache the results of + * Class.getMethods() and similar calls. + * This can speed execution dramatically, but increases the memory + * footprint. Also, with caching enabled, references may be held to + * objects past the lifetime of any real usage. + *

+ * If caching is enabled and this method is called with a + * false argument, the caches will be emptied. + *

+ * Caching is enabled by default. + * + * @param enabled if true, caching is enabled + * + * @see #clearCaches() + */ + public synchronized void setCachingEnabled(boolean enabled) + { + if (enabled == cachingIsEnabled) + return; + if (!enabled) + clearCaches(); + cachingIsEnabled = enabled; + } + + /** + * @return a map from classes to associated JavaMembers objects + */ + Map,JavaMembers> getClassCacheMap() { + if (classTable == null) { + classTable = new HashMap,JavaMembers>(); + } + return classTable; + } + + Map> getInterfaceAdapterCacheMap() + { + if (classAdapterCache == null) { + classAdapterCache = new HashMap>(); + } + return classAdapterCache; + } + + /** + * @deprecated + * The method always returns false. + * @see #setInvokerOptimizationEnabled(boolean enabled) + */ + public boolean isInvokerOptimizationEnabled() + { + return false; + } + + /** + * @deprecated + * The method does nothing. + * Invoker optimization is no longer used by Rhino. + * On modern JDK like 1.4 or 1.5 the disadvantages of the optimization + * like increased memory usage or longer initialization time overweight + * small speed increase that can be gained using generated proxy class + * to replace reflection. + */ + public synchronized void setInvokerOptimizationEnabled(boolean enabled) + { + } + + /** + * Internal engine method to return serial number for generated classes + * to ensure name uniqueness. + */ + public final synchronized int newClassSerialNumber() + { + return ++generatedClassSerial; + } + + Object getInterfaceAdapter(Class cl) + { + return interfaceAdapterCache == null + ? null + : interfaceAdapterCache.get(cl); + } + + synchronized void cacheInterfaceAdapter(Class cl, Object iadapter) + { + if (cachingIsEnabled) { + if (interfaceAdapterCache == null) { + interfaceAdapterCache = new HashMap,Object>(); + } + interfaceAdapterCache.put(cl, iadapter); + } + } +} diff --git a/org/mozilla/javascript/ClassShutter.java b/org/mozilla/javascript/ClassShutter.java new file mode 100644 index 0000000..d5f4cd6 --- /dev/null +++ b/org/mozilla/javascript/ClassShutter.java @@ -0,0 +1,89 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-1999 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Norris Boyd + * Igor Bukanov + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +// API class + +package org.mozilla.javascript; + +/** +Embeddings that wish to filter Java classes that are visible to scripts +through the LiveConnect, should implement this interface. + +@see Context#setClassShutter(ClassShutter) +@since 1.5 Release 4 +@author Norris Boyd +*/ + + public interface ClassShutter { + + /** + * Return true iff the Java class with the given name should be exposed + * to scripts. + *

+ * An embedding may filter which Java classes are exposed through + * LiveConnect to JavaScript scripts. + *

+ * Due to the fact that there is no package reflection in Java, + * this method will also be called with package names. There + * is no way for Rhino to tell if "Packages.a.b" is a package name + * or a class that doesn't exist. What Rhino does is attempt + * to load each segment of "Packages.a.b.c": It first attempts to + * load class "a", then attempts to load class "a.b", then + * finally attempts to load class "a.b.c". On a Rhino installation + * without any ClassShutter set, and without any of the + * above classes, the expression "Packages.a.b.c" will result in + * a [JavaPackage a.b.c] and not an error. + *

+ * With ClassShutter supplied, Rhino will first call + * visibleToScripts before attempting to look up the class name. If + * visibleToScripts returns false, the class name lookup is not + * performed and subsequent Rhino execution assumes the class is + * not present. So for "java.lang.System.out.println" the lookup + * of "java.lang.System" is skipped and thus Rhino assumes that + * "java.lang.System" doesn't exist. So then for "java.lang.System.out", + * Rhino attempts to load the class "java.lang.System.out" because + * it assumes that "java.lang.System" is a package name. + *

+ * @param fullClassName the full name of the class (including the package + * name, with '.' as a delimiter). For example the + * standard string class is "java.lang.String" + * @return whether or not to reveal this class to scripts + */ + public boolean visibleToScripts(String fullClassName); +} diff --git a/org/mozilla/javascript/CompilerEnvirons.java b/org/mozilla/javascript/CompilerEnvirons.java new file mode 100644 index 0000000..92f31dc --- /dev/null +++ b/org/mozilla/javascript/CompilerEnvirons.java @@ -0,0 +1,233 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-1999 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Igor Bukanov, igor@fastmail.fm + * Bob Jervis + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +package org.mozilla.javascript; + +import java.util.Set; + +public class CompilerEnvirons +{ + public CompilerEnvirons() + { + errorReporter = DefaultErrorReporter.instance; + languageVersion = Context.VERSION_DEFAULT; + generateDebugInfo = true; + useDynamicScope = false; + reservedKeywordAsIdentifier = false; + allowMemberExprAsFunctionName = false; + xmlAvailable = true; + optimizationLevel = 0; + generatingSource = true; + strictMode = false; + warningAsError = false; + generateObserverCount = false; + } + + public void initFromContext(Context cx) + { + setErrorReporter(cx.getErrorReporter()); + this.languageVersion = cx.getLanguageVersion(); + useDynamicScope = cx.compileFunctionsWithDynamicScopeFlag; + generateDebugInfo = (!cx.isGeneratingDebugChanged() + || cx.isGeneratingDebug()); + reservedKeywordAsIdentifier + = cx.hasFeature(Context.FEATURE_RESERVED_KEYWORD_AS_IDENTIFIER); + allowMemberExprAsFunctionName + = cx.hasFeature(Context.FEATURE_MEMBER_EXPR_AS_FUNCTION_NAME); + strictMode + = cx.hasFeature(Context.FEATURE_STRICT_MODE); + warningAsError = cx.hasFeature(Context.FEATURE_WARNING_AS_ERROR); + xmlAvailable + = cx.hasFeature(Context.FEATURE_E4X); + + optimizationLevel = cx.getOptimizationLevel(); + + generatingSource = cx.isGeneratingSource(); + activationNames = cx.activationNames; + + // Observer code generation in compiled code : + generateObserverCount = cx.generateObserverCount; + } + + public final ErrorReporter getErrorReporter() + { + return errorReporter; + } + + public void setErrorReporter(ErrorReporter errorReporter) + { + if (errorReporter == null) throw new IllegalArgumentException(); + this.errorReporter = errorReporter; + } + + public final int getLanguageVersion() + { + return languageVersion; + } + + public void setLanguageVersion(int languageVersion) + { + Context.checkLanguageVersion(languageVersion); + this.languageVersion = languageVersion; + } + + public final boolean isGenerateDebugInfo() + { + return generateDebugInfo; + } + + public void setGenerateDebugInfo(boolean flag) + { + this.generateDebugInfo = flag; + } + + public final boolean isUseDynamicScope() + { + return useDynamicScope; + } + + public final boolean isReservedKeywordAsIdentifier() + { + return reservedKeywordAsIdentifier; + } + + public void setReservedKeywordAsIdentifier(boolean flag) + { + reservedKeywordAsIdentifier = flag; + } + + public final boolean isAllowMemberExprAsFunctionName() + { + return allowMemberExprAsFunctionName; + } + + public void setAllowMemberExprAsFunctionName(boolean flag) + { + allowMemberExprAsFunctionName = flag; + } + + public final boolean isXmlAvailable() + { + return xmlAvailable; + } + + public void setXmlAvailable(boolean flag) + { + xmlAvailable = flag; + } + + public final int getOptimizationLevel() + { + return optimizationLevel; + } + + public void setOptimizationLevel(int level) + { + Context.checkOptimizationLevel(level); + this.optimizationLevel = level; + } + + public final boolean isGeneratingSource() + { + return generatingSource; + } + + public final boolean isStrictMode() + { + return strictMode; + } + + public final boolean reportWarningAsError() + { + return warningAsError; + } + + /** + * Specify whether or not source information should be generated. + *

+ * Without source information, evaluating the "toString" method + * on JavaScript functions produces only "[native code]" for + * the body of the function. + * Note that code generated without source is not fully ECMA + * conformant. + */ + public void setGeneratingSource(boolean generatingSource) + { + this.generatingSource = generatingSource; + } + + /** + * @return true iff code will be generated with callbacks to enable + * instruction thresholds + */ + public boolean isGenerateObserverCount() { + return generateObserverCount; + } + + /** + * Turn on or off generation of code with callbacks to + * track the count of executed instructions. + * Currently only affects JVM byte code generation: this slows down the + * generated code, but code generated without the callbacks will not + * be counted toward instruction thresholds. Rhino's interpretive + * mode does instruction counting without inserting callbacks, so + * there is no requirement to compile code differently. + * @param generateObserverCount if true, generated code will contain + * calls to accumulate an estimate of the instructions executed. + */ + public void setGenerateObserverCount(boolean generateObserverCount) { + this.generateObserverCount = generateObserverCount; + } + + private ErrorReporter errorReporter; + + private int languageVersion; + private boolean generateDebugInfo; + private boolean useDynamicScope; + private boolean reservedKeywordAsIdentifier; + private boolean allowMemberExprAsFunctionName; + private boolean xmlAvailable; + private int optimizationLevel; + private boolean generatingSource; + private boolean strictMode; + private boolean warningAsError; + private boolean generateObserverCount; + Set activationNames; +} + diff --git a/org/mozilla/javascript/ConstProperties.java b/org/mozilla/javascript/ConstProperties.java new file mode 100644 index 0000000..860db79 --- /dev/null +++ b/org/mozilla/javascript/ConstProperties.java @@ -0,0 +1,109 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-1999 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Bob Jervis + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +// API class + +package org.mozilla.javascript; + +public interface ConstProperties { + /** + * Sets a named const property in this object. + *

+ * The property is specified by a string name + * as defined for Scriptable.get. + *

+ * The possible values that may be passed in are as defined for + * Scriptable.get. A class that implements this method may choose + * to ignore calls to set certain properties, in which case those + * properties are effectively read-only.

+ * For properties defined in a prototype chain, + * use putProperty in ScriptableObject.

+ * Note that if a property a is defined in the prototype p + * of an object o, then evaluating o.a = 23 will cause + * set to be called on the prototype p with + * o as the start parameter. + * To preserve JavaScript semantics, it is the Scriptable + * object's responsibility to modify o.

+ * This design allows properties to be defined in prototypes and implemented + * in terms of getters and setters of Java values without consuming slots + * in each instance.

+ *

+ * The values that may be set are limited to the following: + *

    + *
  • java.lang.Boolean objects
  • + *
  • java.lang.String objects
  • + *
  • java.lang.Number objects
  • + *
  • org.mozilla.javascript.Scriptable objects
  • + *
  • null
  • + *
  • The value returned by Context.getUndefinedValue()
  • + *

+ * Arbitrary Java objects may be wrapped in a Scriptable by first calling + * Context.toObject. This allows the property of a JavaScript + * object to contain an arbitrary Java object as a value.

+ * Note that has will be called by the runtime first before + * set is called to determine in which object the + * property is defined. + * Note that this method is not expected to traverse the prototype chain, + * which is different from the ECMA [[Put]] operation. + * @param name the name of the property + * @param start the object whose property is being set + * @param value value to set the property to + * @see org.mozilla.javascript.Scriptable#has(String, Scriptable) + * @see org.mozilla.javascript.Scriptable#get(String, Scriptable) + * @see org.mozilla.javascript.ScriptableObject#putProperty(Scriptable, String, Object) + * @see org.mozilla.javascript.Context#toObject(Object, Scriptable) + */ + public void putConst(String name, Scriptable start, Object value); + + /** + * Reserves a definition spot for a const. This will set up a definition + * of the const property, but set its value to undefined. The semantics of + * the start parameter is the same as for putConst. + * @param name The name of the property. + * @param start The object whose property is being reserved. + */ + public void defineConst(String name, Scriptable start); + + /** + * Returns true if the named property is defined as a const on this object. + * @param name + * @return true if the named property is defined as a const, false + * otherwise. + */ + public boolean isConst(String name); +} diff --git a/org/mozilla/javascript/Context.java b/org/mozilla/javascript/Context.java new file mode 100644 index 0000000..5cafe51 --- /dev/null +++ b/org/mozilla/javascript/Context.java @@ -0,0 +1,2649 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-2000 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Bob Jervis + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +// API class + +package org.mozilla.javascript; + +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.io.CharArrayWriter; +import java.io.IOException; +import java.io.PrintWriter; +import java.io.Reader; +import java.io.StringWriter; +import java.io.Writer; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.Map; +import java.util.HashMap; +import java.util.Set; +import java.util.HashSet; +import java.util.Locale; + +import org.mozilla.javascript.debug.DebuggableScript; +import org.mozilla.javascript.debug.Debugger; +import org.mozilla.javascript.xml.XMLLib; + +/** + * This class represents the runtime context of an executing script. + * + * Before executing a script, an instance of Context must be created + * and associated with the thread that will be executing the script. + * The Context will be used to store information about the executing + * of the script such as the call stack. Contexts are associated with + * the current thread using the {@link #call(ContextAction)} + * or {@link #enter()} methods.

+ * + * Different forms of script execution are supported. Scripts may be + * evaluated from the source directly, or first compiled and then later + * executed. Interactive execution is also supported.

+ * + * Some aspects of script execution, such as type conversions and + * object creation, may be accessed directly through methods of + * Context. + * + * @see Scriptable + * @author Norris Boyd + * @author Brendan Eich + */ + +public class Context +{ + /** + * Language versions. + * + * All integral values are reserved for future version numbers. + */ + + /** + * The unknown version. + */ + public static final int VERSION_UNKNOWN = -1; + + /** + * The default version. + */ + public static final int VERSION_DEFAULT = 0; + + /** + * JavaScript 1.0 + */ + public static final int VERSION_1_0 = 100; + + /** + * JavaScript 1.1 + */ + public static final int VERSION_1_1 = 110; + + /** + * JavaScript 1.2 + */ + public static final int VERSION_1_2 = 120; + + /** + * JavaScript 1.3 + */ + public static final int VERSION_1_3 = 130; + + /** + * JavaScript 1.4 + */ + public static final int VERSION_1_4 = 140; + + /** + * JavaScript 1.5 + */ + public static final int VERSION_1_5 = 150; + + /** + * JavaScript 1.6 + */ + public static final int VERSION_1_6 = 160; + + /** + * JavaScript 1.7 + */ + public static final int VERSION_1_7 = 170; + + /** + * Controls behaviour of Date.prototype.getYear(). + * If hasFeature(FEATURE_NON_ECMA_GET_YEAR) returns true, + * Date.prototype.getYear subtructs 1900 only if 1900 <= date < 2000. + * The default behavior of {@link #hasFeature(int)} is always to subtruct + * 1900 as rquired by ECMAScript B.2.4. + */ + public static final int FEATURE_NON_ECMA_GET_YEAR = 1; + + /** + * Control if member expression as function name extension is available. + * If hasFeature(FEATURE_MEMBER_EXPR_AS_FUNCTION_NAME) returns + * true, allow function memberExpression(args) { body } to be + * syntax sugar for memberExpression = function(args) { body }, + * when memberExpression is not a simple identifier. + * See ECMAScript-262, section 11.2 for definition of memberExpression. + * By default {@link #hasFeature(int)} returns false. + */ + public static final int FEATURE_MEMBER_EXPR_AS_FUNCTION_NAME = 2; + + /** + * Control if reserved keywords are treated as identifiers. + * If hasFeature(RESERVED_KEYWORD_AS_IDENTIFIER) returns true, + * treat future reserved keyword (see Ecma-262, section 7.5.3) as ordinary + * identifiers but warn about this usage. + * + * By default {@link #hasFeature(int)} returns false. + */ + public static final int FEATURE_RESERVED_KEYWORD_AS_IDENTIFIER = 3; + + /** + * Control if toString() should returns the same result + * as toSource() when applied to objects and arrays. + * If hasFeature(FEATURE_TO_STRING_AS_SOURCE) returns true, + * calling toString() on JS objects gives the same result as + * calling toSource(). That is it returns JS source with code + * to create an object with all enumeratable fields of the original object + * instead of printing [object result of + * {@link Scriptable#getClassName()}]. + *

+ * By default {@link #hasFeature(int)} returns true only if + * the current JS version is set to {@link #VERSION_1_2}. + */ + public static final int FEATURE_TO_STRING_AS_SOURCE = 4; + + /** + * Control if properties __proto__ and __parent__ + * are treated specially. + * If hasFeature(FEATURE_PARENT_PROTO_PROPERTIES) returns true, + * treat __parent__ and __proto__ as special properties. + *

+ * The properties allow to query and set scope and prototype chains for the + * objects. The special meaning of the properties is available + * only when they are used as the right hand side of the dot operator. + * For example, while x.__proto__ = y changes the prototype + * chain of the object x to point to y, + * x["__proto__"] = y simply assigns a new value to the property + * __proto__ in x even when the feature is on. + * + * By default {@link #hasFeature(int)} returns true. + */ + public static final int FEATURE_PARENT_PROTO_PROPERTIES = 5; + + /** + * @deprecated In previous releases, this name was given to + * FEATURE_PARENT_PROTO_PROPERTIES. + */ + public static final int FEATURE_PARENT_PROTO_PROPRTIES = 5; + + /** + * Control if support for E4X(ECMAScript for XML) extension is available. + * If hasFeature(FEATURE_E4X) returns true, the XML syntax is available. + *

+ * By default {@link #hasFeature(int)} returns true if + * the current JS version is set to {@link #VERSION_DEFAULT} + * or is at least {@link #VERSION_1_6}. + * @since 1.6 Release 1 + */ + public static final int FEATURE_E4X = 6; + + /** + * Control if dynamic scope should be used for name access. + * If hasFeature(FEATURE_DYNAMIC_SCOPE) returns true, then the name lookup + * during name resolution will use the top scope of the script or function + * which is at the top of JS execution stack instead of the top scope of the + * script or function from the current stack frame if the top scope of + * the top stack frame contains the top scope of the current stack frame + * on its prototype chain. + *

+ * This is useful to define shared scope containing functions that can + * be called from scripts and functions using private scopes. + *

+ * By default {@link #hasFeature(int)} returns false. + * @since 1.6 Release 1 + */ + public static final int FEATURE_DYNAMIC_SCOPE = 7; + + /** + * Control if strict variable mode is enabled. + * When the feature is on Rhino reports runtime errors if assignment + * to a global variable that does not exist is executed. When the feature + * is off such assignments create a new variable in the global scope as + * required by ECMA 262. + *

+ * By default {@link #hasFeature(int)} returns false. + * @since 1.6 Release 1 + */ + public static final int FEATURE_STRICT_VARS = 8; + + /** + * Control if strict eval mode is enabled. + * When the feature is on Rhino reports runtime errors if non-string + * argument is passed to the eval function. When the feature is off + * eval simply return non-string argument as is without performing any + * evaluation as required by ECMA 262. + *

+ * By default {@link #hasFeature(int)} returns false. + * @since 1.6 Release 1 + */ + public static final int FEATURE_STRICT_EVAL = 9; + + /** + * When the feature is on Rhino will add a "fileName" and "lineNumber" + * properties to Error objects automatically. When the feature is off, you + * have to explicitly pass them as the second and third argument to the + * Error constructor. Note that neither behavior is fully ECMA 262 + * compliant (as 262 doesn't specify a three-arg constructor), but keeping + * the feature off results in Error objects that don't have + * additional non-ECMA properties when constructed using the ECMA-defined + * single-arg constructor and is thus desirable if a stricter ECMA + * compliance is desired, specifically adherence to the point 15.11.5. of + * the standard. + *

+ * By default {@link #hasFeature(int)} returns false. + * @since 1.6 Release 6 + */ + public static final int FEATURE_LOCATION_INFORMATION_IN_ERROR = 10; + + /** + * Controls whether JS 1.5 'strict mode' is enabled. + * When the feature is on, Rhino reports more than a dozen different + * warnings. When the feature is off, these warnings are not generated. + * FEATURE_STRICT_MODE implies FEATURE_STRICT_VARS and FEATURE_STRICT_EVAL. + *

+ * By default {@link #hasFeature(int)} returns false. + * @since 1.6 Release 6 + */ + public static final int FEATURE_STRICT_MODE = 11; + + /** + * Controls whether a warning should be treated as an error. + * @since 1.6 Release 6 + */ + public static final int FEATURE_WARNING_AS_ERROR = 12; + + /** + * Enables enhanced access to Java. + * Specifically, controls whether private and protected members can be + * accessed, and whether scripts can catch all Java exceptions. + *

+ * Note that this feature should only be enabled for trusted scripts. + *

+ * By default {@link #hasFeature(int)} returns false. + * @since 1.7 Release 1 + */ + public static final int FEATURE_ENHANCED_JAVA_ACCESS = 13; + + + public static final String languageVersionProperty = "language version"; + public static final String errorReporterProperty = "error reporter"; + + /** + * Convenient value to use as zero-length array of objects. + */ + public static final Object[] emptyArgs = ScriptRuntime.emptyArgs; + + /** + * Creates a new Context. The context will be associated with the {@link + * ContextFactory#getGlobal() global context factory}. + * + * Note that the Context must be associated with a thread before + * it can be used to execute a script. + * @deprecated this constructor is deprecated because it creates a + * dependency on a static singleton context factory. Use + * {@link ContextFactory#enter()} or + * {@link ContextFactory#call(ContextAction)} instead. If you subclass + * this class, consider using {@link #Context(ContextFactory)} constructor + * instead in the subclasses' constructors. + */ + public Context() + { + this(ContextFactory.getGlobal()); + } + + /** + * Creates a new context. Provided as a preferred super constructor for + * subclasses in place of the deprecated default public constructor. + * @param factory the context factory associated with this context (most + * likely, the one that created the context). Can not be null. The context + * features are inherited from the factory, and the context will also + * otherwise use its factory's services. + * @throws IllegalArgumentException if factory parameter is null. + */ + protected Context(ContextFactory factory) + { + if(factory == null) { + throw new IllegalArgumentException("factory == null"); + } + this.factory = factory; + setLanguageVersion(VERSION_DEFAULT); + optimizationLevel = codegenClass != null ? 0 : -1; + maximumInterpreterStackDepth = Integer.MAX_VALUE; + } + + /** + * Get the current Context. + * + * The current Context is per-thread; this method looks up + * the Context associated with the current thread.

+ * + * @return the Context associated with the current thread, or + * null if no context is associated with the current + * thread. + * @see ContextFactory#enterContext() + * @see ContextFactory#call(ContextAction) + */ + public static Context getCurrentContext() + { + Object helper = VMBridge.instance.getThreadContextHelper(); + return VMBridge.instance.getContext(helper); + } + + /** + * Same as calling {@link ContextFactory#enterContext()} on the global + * ContextFactory instance. + * @return a Context associated with the current thread + * @see #getCurrentContext() + * @see #exit() + * @see #call(ContextAction) + */ + public static Context enter() + { + return enter(null); + } + + /** + * Get a Context associated with the current thread, using + * the given Context if need be. + *

+ * The same as enter() except that cx + * is associated with the current thread and returned if + * the current thread has no associated context and cx + * is not associated with any other thread. + * @param cx a Context to associate with the thread if possible + * @return a Context associated with the current thread + * @deprecated use {@link ContextFactory#enterContext(Context)} instead as + * this method relies on usage of a static singleton "global" ContextFactory. + * @see ContextFactory#enterContext(Context) + * @see ContextFactory#call(ContextAction) + */ + public static Context enter(Context cx) + { + return enter(cx, ContextFactory.getGlobal()); + } + + static final Context enter(Context cx, ContextFactory factory) + { + Object helper = VMBridge.instance.getThreadContextHelper(); + Context old = VMBridge.instance.getContext(helper); + if (old != null) { + cx = old; + } else { + if (cx == null) { + cx = factory.makeContext(); + if (cx.enterCount != 0) { + throw new IllegalStateException("factory.makeContext() returned Context instance already associated with some thread"); + } + factory.onContextCreated(cx); + if (factory.isSealed() && !cx.isSealed()) { + cx.seal(null); + } + } else { + if (cx.enterCount != 0) { + throw new IllegalStateException("can not use Context instance already associated with some thread"); + } + } + VMBridge.instance.setContext(helper, cx); + } + ++cx.enterCount; + return cx; + } + + /** + * Exit a block of code requiring a Context. + * + * Calling exit() will remove the association between + * the current thread and a Context if the prior call to + * {@link ContextFactory#enterContext()} on this thread newly associated a + * Context with this thread. Once the current thread no longer has an + * associated Context, it cannot be used to execute JavaScript until it is + * again associated with a Context. + * @see ContextFactory#enterContext() + */ + public static void exit() + { + Object helper = VMBridge.instance.getThreadContextHelper(); + Context cx = VMBridge.instance.getContext(helper); + if (cx == null) { + throw new IllegalStateException( + "Calling Context.exit without previous Context.enter"); + } + if (cx.enterCount < 1) Kit.codeBug(); + if (--cx.enterCount == 0) { + VMBridge.instance.setContext(helper, null); + cx.factory.onContextReleased(cx); + } + } + + /** + * Call {@link ContextAction#run(Context cx)} + * using the Context instance associated with the current thread. + * If no Context is associated with the thread, then + * ContextFactory.getGlobal().makeContext() will be called to + * construct new Context instance. The instance will be temporary + * associated with the thread during call to + * {@link ContextAction#run(Context)}. + * @deprecated use {@link ContextFactory#call(ContextAction)} instead as + * this method relies on usage of a static singleton "global" + * ContextFactory. + * @return The result of {@link ContextAction#run(Context)}. + */ + public static Object call(ContextAction action) + { + return call(ContextFactory.getGlobal(), action); + } + + /** + * Call {@link + * Callable#call(Context cx, Scriptable scope, Scriptable thisObj, + * Object[] args)} + * using the Context instance associated with the current thread. + * If no Context is associated with the thread, then + * {@link ContextFactory#makeContext()} will be called to construct + * new Context instance. The instance will be temporary associated + * with the thread during call to {@link ContextAction#run(Context)}. + *

+ * It is allowed but not advisable to use null for factory + * argument in which case the global static singleton ContextFactory + * instance will be used to create new context instances. + * @see ContextFactory#call(ContextAction) + */ + public static Object call(ContextFactory factory, final Callable callable, + final Scriptable scope, final Scriptable thisObj, + final Object[] args) + { + if(factory == null) { + factory = ContextFactory.getGlobal(); + } + return call(factory, new ContextAction() { + public Object run(Context cx) { + return callable.call(cx, scope, thisObj, args); + } + }); + } + + /** + * The method implements {@link ContextFactory#call(ContextAction)} logic. + */ + static Object call(ContextFactory factory, ContextAction action) { + Context cx = enter(null, factory); + try { + return action.run(cx); + } + finally { + exit(); + } + } + + /** + * @deprecated + * @see ContextFactory#addListener(ContextFactory.Listener) + * @see ContextFactory#getGlobal() + */ + public static void addContextListener(ContextListener listener) + { + // Special workaround for the debugger + String DBG = "org.mozilla.javascript.tools.debugger.Main"; + if (DBG.equals(listener.getClass().getName())) { + Class cl = listener.getClass(); + Class factoryClass = Kit.classOrNull( + "org.mozilla.javascript.ContextFactory"); + Class[] sig = { factoryClass }; + Object[] args = { ContextFactory.getGlobal() }; + try { + Method m = cl.getMethod("attachTo", sig); + m.invoke(listener, args); + } catch (Exception ex) { + RuntimeException rex = new RuntimeException(); + Kit.initCause(rex, ex); + throw rex; + } + return; + } + + ContextFactory.getGlobal().addListener(listener); + } + + /** + * @deprecated + * @see ContextFactory#removeListener(ContextFactory.Listener) + * @see ContextFactory#getGlobal() + */ + public static void removeContextListener(ContextListener listener) + { + ContextFactory.getGlobal().addListener(listener); + } + + /** + * Return {@link ContextFactory} instance used to create this Context. + */ + public final ContextFactory getFactory() + { + return factory; + } + + /** + * Checks if this is a sealed Context. A sealed Context instance does not + * allow to modify any of its properties and will throw an exception + * on any such attempt. + * @see #seal(Object sealKey) + */ + public final boolean isSealed() + { + return sealed; + } + + /** + * Seal this Context object so any attempt to modify any of its properties + * including calling {@link #enter()} and {@link #exit()} methods will + * throw an exception. + *

+ * If sealKey is not null, calling + * {@link #unseal(Object sealKey)} with the same key unseals + * the object. If sealKey is null, unsealing is no longer possible. + * + * @see #isSealed() + * @see #unseal(Object) + */ + public final void seal(Object sealKey) + { + if (sealed) onSealedMutation(); + sealed = true; + this.sealKey = sealKey; + } + + /** + * Unseal previously sealed Context object. + * The sealKey argument should not be null and should match + * sealKey suplied with the last call to + * {@link #seal(Object)} or an exception will be thrown. + * + * @see #isSealed() + * @see #seal(Object sealKey) + */ + public final void unseal(Object sealKey) + { + if (sealKey == null) throw new IllegalArgumentException(); + if (this.sealKey != sealKey) throw new IllegalArgumentException(); + if (!sealed) throw new IllegalStateException(); + sealed = false; + this.sealKey = null; + } + + static void onSealedMutation() + { + throw new IllegalStateException(); + } + + /** + * Get the current language version. + *

+ * The language version number affects JavaScript semantics as detailed + * in the overview documentation. + * + * @return an integer that is one of VERSION_1_0, VERSION_1_1, etc. + */ + public final int getLanguageVersion() + { + return version; + } + + /** + * Set the language version. + * + *

+ * Setting the language version will affect functions and scripts compiled + * subsequently. See the overview documentation for version-specific + * behavior. + * + * @param version the version as specified by VERSION_1_0, VERSION_1_1, etc. + */ + public void setLanguageVersion(int version) + { + if (sealed) onSealedMutation(); + checkLanguageVersion(version); + Object listeners = propertyListeners; + if (listeners != null && version != this.version) { + firePropertyChangeImpl(listeners, languageVersionProperty, + new Integer(this.version), + new Integer(version)); + } + this.version = version; + } + + public static boolean isValidLanguageVersion(int version) + { + switch (version) { + case VERSION_DEFAULT: + case VERSION_1_0: + case VERSION_1_1: + case VERSION_1_2: + case VERSION_1_3: + case VERSION_1_4: + case VERSION_1_5: + case VERSION_1_6: + case VERSION_1_7: + return true; + } + return false; + } + + public static void checkLanguageVersion(int version) + { + if (isValidLanguageVersion(version)) { + return; + } + throw new IllegalArgumentException("Bad language version: "+version); + } + + /** + * Get the implementation version. + * + *

+ * The implementation version is of the form + *

+     *    "name langVer release relNum date"
+     * 
+ * where name is the name of the product, langVer is + * the language version, relNum is the release number, and + * date is the release date for that specific + * release in the form "yyyy mm dd". + * + * @return a string that encodes the product, language version, release + * number, and date. + */ + public final String getImplementationVersion() + { + // XXX Probably it would be better to embed this directly into source + // with special build preprocessing but that would require some ant + // tweaking and then replacing token in resource files was simpler + if (implementationVersion == null) { + implementationVersion + = ScriptRuntime.getMessage0("implementation.version"); + } + return implementationVersion; + } + + /** + * Get the current error reporter. + * + * @see org.mozilla.javascript.ErrorReporter + */ + public final ErrorReporter getErrorReporter() + { + if (errorReporter == null) { + return DefaultErrorReporter.instance; + } + return errorReporter; + } + + /** + * Change the current error reporter. + * + * @return the previous error reporter + * @see org.mozilla.javascript.ErrorReporter + */ + public final ErrorReporter setErrorReporter(ErrorReporter reporter) + { + if (sealed) onSealedMutation(); + if (reporter == null) throw new IllegalArgumentException(); + ErrorReporter old = getErrorReporter(); + if (reporter == old) { + return old; + } + Object listeners = propertyListeners; + if (listeners != null) { + firePropertyChangeImpl(listeners, errorReporterProperty, + old, reporter); + } + this.errorReporter = reporter; + return old; + } + + /** + * Get the current locale. Returns the default locale if none has + * been set. + * + * @see java.util.Locale + */ + + public final Locale getLocale() + { + if (locale == null) + locale = Locale.getDefault(); + return locale; + } + + /** + * Set the current locale. + * + * @see java.util.Locale + */ + public final Locale setLocale(Locale loc) + { + if (sealed) onSealedMutation(); + Locale result = locale; + locale = loc; + return result; + } + + /** + * Register an object to receive notifications when a bound property + * has changed + * @see java.beans.PropertyChangeEvent + * @see #removePropertyChangeListener(java.beans.PropertyChangeListener) + * @param l the listener + */ + public final void addPropertyChangeListener(PropertyChangeListener l) + { + if (sealed) onSealedMutation(); + propertyListeners = Kit.addListener(propertyListeners, l); + } + + /** + * Remove an object from the list of objects registered to receive + * notification of changes to a bounded property + * @see java.beans.PropertyChangeEvent + * @see #addPropertyChangeListener(java.beans.PropertyChangeListener) + * @param l the listener + */ + public final void removePropertyChangeListener(PropertyChangeListener l) + { + if (sealed) onSealedMutation(); + propertyListeners = Kit.removeListener(propertyListeners, l); + } + + /** + * Notify any registered listeners that a bounded property has changed + * @see #addPropertyChangeListener(java.beans.PropertyChangeListener) + * @see #removePropertyChangeListener(java.beans.PropertyChangeListener) + * @see java.beans.PropertyChangeListener + * @see java.beans.PropertyChangeEvent + * @param property the bound property + * @param oldValue the old value + * @param newValue the new value + */ + final void firePropertyChange(String property, Object oldValue, + Object newValue) + { + Object listeners = propertyListeners; + if (listeners != null) { + firePropertyChangeImpl(listeners, property, oldValue, newValue); + } + } + + private void firePropertyChangeImpl(Object listeners, String property, + Object oldValue, Object newValue) + { + for (int i = 0; ; ++i) { + Object l = Kit.getListener(listeners, i); + if (l == null) + break; + if (l instanceof PropertyChangeListener) { + PropertyChangeListener pcl = (PropertyChangeListener)l; + pcl.propertyChange(new PropertyChangeEvent( + this, property, oldValue, newValue)); + } + } + } + + /** + * Report a warning using the error reporter for the current thread. + * + * @param message the warning message to report + * @param sourceName a string describing the source, such as a filename + * @param lineno the starting line number + * @param lineSource the text of the line (may be null) + * @param lineOffset the offset into lineSource where problem was detected + * @see org.mozilla.javascript.ErrorReporter + */ + public static void reportWarning(String message, String sourceName, + int lineno, String lineSource, + int lineOffset) + { + Context cx = Context.getContext(); + if (cx.hasFeature(FEATURE_WARNING_AS_ERROR)) + reportError(message, sourceName, lineno, lineSource, lineOffset); + else + cx.getErrorReporter().warning(message, sourceName, lineno, + lineSource, lineOffset); + } + + /** + * Report a warning using the error reporter for the current thread. + * + * @param message the warning message to report + * @see org.mozilla.javascript.ErrorReporter + */ + public static void reportWarning(String message) + { + int[] linep = { 0 }; + String filename = getSourcePositionFromStack(linep); + Context.reportWarning(message, filename, linep[0], null, 0); + } + + public static void reportWarning(String message, Throwable t) + { + int[] linep = { 0 }; + String filename = getSourcePositionFromStack(linep); + Writer sw = new StringWriter(); + PrintWriter pw = new PrintWriter(sw); + pw.println(message); + t.printStackTrace(pw); + pw.flush(); + Context.reportWarning(sw.toString(), filename, linep[0], null, 0); + } + + /** + * Report an error using the error reporter for the current thread. + * + * @param message the error message to report + * @param sourceName a string describing the source, such as a filename + * @param lineno the starting line number + * @param lineSource the text of the line (may be null) + * @param lineOffset the offset into lineSource where problem was detected + * @see org.mozilla.javascript.ErrorReporter + */ + public static void reportError(String message, String sourceName, + int lineno, String lineSource, + int lineOffset) + { + Context cx = getCurrentContext(); + if (cx != null) { + cx.getErrorReporter().error(message, sourceName, lineno, + lineSource, lineOffset); + } else { + throw new EvaluatorException(message, sourceName, lineno, + lineSource, lineOffset); + } + } + + /** + * Report an error using the error reporter for the current thread. + * + * @param message the error message to report + * @see org.mozilla.javascript.ErrorReporter + */ + public static void reportError(String message) + { + int[] linep = { 0 }; + String filename = getSourcePositionFromStack(linep); + Context.reportError(message, filename, linep[0], null, 0); + } + + /** + * Report a runtime error using the error reporter for the current thread. + * + * @param message the error message to report + * @param sourceName a string describing the source, such as a filename + * @param lineno the starting line number + * @param lineSource the text of the line (may be null) + * @param lineOffset the offset into lineSource where problem was detected + * @return a runtime exception that will be thrown to terminate the + * execution of the script + * @see org.mozilla.javascript.ErrorReporter + */ + public static EvaluatorException reportRuntimeError(String message, + String sourceName, + int lineno, + String lineSource, + int lineOffset) + { + Context cx = getCurrentContext(); + if (cx != null) { + return cx.getErrorReporter(). + runtimeError(message, sourceName, lineno, + lineSource, lineOffset); + } else { + throw new EvaluatorException(message, sourceName, lineno, + lineSource, lineOffset); + } + } + + static EvaluatorException reportRuntimeError0(String messageId) + { + String msg = ScriptRuntime.getMessage0(messageId); + return reportRuntimeError(msg); + } + + static EvaluatorException reportRuntimeError1(String messageId, + Object arg1) + { + String msg = ScriptRuntime.getMessage1(messageId, arg1); + return reportRuntimeError(msg); + } + + static EvaluatorException reportRuntimeError2(String messageId, + Object arg1, Object arg2) + { + String msg = ScriptRuntime.getMessage2(messageId, arg1, arg2); + return reportRuntimeError(msg); + } + + static EvaluatorException reportRuntimeError3(String messageId, + Object arg1, Object arg2, + Object arg3) + { + String msg = ScriptRuntime.getMessage3(messageId, arg1, arg2, arg3); + return reportRuntimeError(msg); + } + + static EvaluatorException reportRuntimeError4(String messageId, + Object arg1, Object arg2, + Object arg3, Object arg4) + { + String msg + = ScriptRuntime.getMessage4(messageId, arg1, arg2, arg3, arg4); + return reportRuntimeError(msg); + } + + /** + * Report a runtime error using the error reporter for the current thread. + * + * @param message the error message to report + * @see org.mozilla.javascript.ErrorReporter + */ + public static EvaluatorException reportRuntimeError(String message) + { + int[] linep = { 0 }; + String filename = getSourcePositionFromStack(linep); + return Context.reportRuntimeError(message, filename, linep[0], null, 0); + } + + /** + * Initialize the standard objects. + * + * Creates instances of the standard objects and their constructors + * (Object, String, Number, Date, etc.), setting up 'scope' to act + * as a global object as in ECMA 15.1.

+ * + * This method must be called to initialize a scope before scripts + * can be evaluated in that scope.

+ * + * This method does not affect the Context it is called upon. + * + * @return the initialized scope + */ + public final ScriptableObject initStandardObjects() + { + return initStandardObjects(null, false); + } + + /** + * Initialize the standard objects. + * + * Creates instances of the standard objects and their constructors + * (Object, String, Number, Date, etc.), setting up 'scope' to act + * as a global object as in ECMA 15.1.

+ * + * This method must be called to initialize a scope before scripts + * can be evaluated in that scope.

+ * + * This method does not affect the Context it is called upon. + * + * @param scope the scope to initialize, or null, in which case a new + * object will be created to serve as the scope + * @return the initialized scope. The method returns the value of the scope + * argument if it is not null or newly allocated scope object which + * is an instance {@link ScriptableObject}. + */ + public final Scriptable initStandardObjects(ScriptableObject scope) + { + return initStandardObjects(scope, false); + } + + /** + * Initialize the standard objects. + * + * Creates instances of the standard objects and their constructors + * (Object, String, Number, Date, etc.), setting up 'scope' to act + * as a global object as in ECMA 15.1.

+ * + * This method must be called to initialize a scope before scripts + * can be evaluated in that scope.

+ * + * This method does not affect the Context it is called upon.

+ * + * This form of the method also allows for creating "sealed" standard + * objects. An object that is sealed cannot have properties added, changed, + * or removed. This is useful to create a "superglobal" that can be shared + * among several top-level objects. Note that sealing is not allowed in + * the current ECMA/ISO language specification, but is likely for + * the next version. + * + * @param scope the scope to initialize, or null, in which case a new + * object will be created to serve as the scope + * @param sealed whether or not to create sealed standard objects that + * cannot be modified. + * @return the initialized scope. The method returns the value of the scope + * argument if it is not null or newly allocated scope object. + * @since 1.4R3 + */ + public ScriptableObject initStandardObjects(ScriptableObject scope, + boolean sealed) + { + return ScriptRuntime.initStandardObjects(this, scope, sealed); + } + + /** + * Get the singleton object that represents the JavaScript Undefined value. + */ + public static Object getUndefinedValue() + { + return Undefined.instance; + } + + /** + * Evaluate a JavaScript source string. + * + * The provided source name and line number are used for error messages + * and for producing debug information. + * + * @param scope the scope to execute in + * @param source the JavaScript source + * @param sourceName a string describing the source, such as a filename + * @param lineno the starting line number + * @param securityDomain an arbitrary object that specifies security + * information about the origin or owner of the script. For + * implementations that don't care about security, this value + * may be null. + * @return the result of evaluating the string + * @see org.mozilla.javascript.SecurityController + */ + public final Object evaluateString(Scriptable scope, String source, + String sourceName, int lineno, + Object securityDomain) + { + Script script = compileString(source, sourceName, lineno, + securityDomain); + if (script != null) { + return script.exec(this, scope); + } else { + return null; + } + } + + /** + * Evaluate a reader as JavaScript source. + * + * All characters of the reader are consumed. + * + * @param scope the scope to execute in + * @param in the Reader to get JavaScript source from + * @param sourceName a string describing the source, such as a filename + * @param lineno the starting line number + * @param securityDomain an arbitrary object that specifies security + * information about the origin or owner of the script. For + * implementations that don't care about security, this value + * may be null. + * @return the result of evaluating the source + * + * @exception IOException if an IOException was generated by the Reader + */ + public final Object evaluateReader(Scriptable scope, Reader in, + String sourceName, int lineno, + Object securityDomain) + throws IOException + { + Script script = compileReader(scope, in, sourceName, lineno, + securityDomain); + if (script != null) { + return script.exec(this, scope); + } else { + return null; + } + } + + /** + * Execute script that may pause execution by capturing a continuation. + * Caller must be prepared to catch a ContinuationPending exception + * and resume execution by calling + * {@link #resumeContinuation(Object, Scriptable, Object)}. + * @param script The script to execute. Script must have been compiled + * with interpreted mode (optimization level -1) + * @param scope The scope to execute the script against + * @throws ContinuationPending if the script calls a function that results + * in a call to {@link #captureContinuation()} + * @since 1.7 Release 2 + */ + public Object executeScriptWithContinuations(Script script, + Scriptable scope) + throws ContinuationPending + { + if (!(script instanceof InterpretedFunction) || + !((InterpretedFunction)script).isScript()) + { + // Can only be applied to scripts + throw new IllegalArgumentException("Script argument was not" + + " a script or was not created by interpreted mode "); + } + return callFunctionWithContinuations((InterpretedFunction) script, + scope, ScriptRuntime.emptyArgs); + } + + /** + * Call function that may pause execution by capturing a continuation. + * Caller must be prepared to catch a ContinuationPending exception + * and resume execution by calling + * {@link #resumeContinuation(Object, Scriptable, Object)}. + * @param function The function to call. The function must have been + * compiled with interpreted mode (optimization level -1) + * @param scope The scope to execute the script against + * @param args The arguments for the function + * @throws ContinuationPending if the script calls a function that results + * in a call to {@link #captureContinuation()} + * @since 1.7 Release 2 + */ + public Object callFunctionWithContinuations(Callable function, + Scriptable scope, Object[] args) + throws ContinuationPending + { + if (!(function instanceof InterpretedFunction)) { + // Can only be applied to scripts + throw new IllegalArgumentException("Function argument was not" + + " created by interpreted mode "); + } + if (ScriptRuntime.hasTopCall(this)) { + throw new IllegalStateException("Cannot have any pending top " + + "calls when executing a script with continuations"); + } + // Annotate so we can check later to ensure no java code in + // intervening frames + isContinuationsTopCall = true; + return ScriptRuntime.doTopCall(function, this, scope, scope, args); + } + + /** + * Capture a continuation from the current execution. The execution must + * have been started via a call to + * {@link #executeScriptWithContinuations(Script, Scriptable)} or + * {@link #callFunctionWithContinuations(Callable, Scriptable, Object[])}. + * This implies that the code calling + * this method must have been called as a function from the + * JavaScript script. Also, there cannot be any non-JavaScript code + * between the JavaScript frames (e.g., a call to eval()). The + * ContinuationPending exception returned must be thrown. + * @return A ContinuationPending exception that must be thrown + * @since 1.7 Release 2 + */ + public ContinuationPending captureContinuation() { + return new ContinuationPending( + Interpreter.captureContinuation(this)); + } + + /** + * Restarts execution of the JavaScript suspended at the call + * to {@link #captureContinuation()}. Execution of the code will resume + * with the functionResult as the result of the call that captured the + * continuation. + * Execution of the script will either conclude normally and the + * result returned, another continuation will be captured and + * thrown, or the script will terminate abnormally and throw an exception. + * @param continuation The value returned by + * {@link ContinuationPending#getContinuation()} + * @param functionResult This value will appear to the code being resumed + * as the result of the function that captured the continuation + * @throws ContinuationPending if another continuation is captured before + * the code terminates + * @since 1.7 Release 2 + */ + public Object resumeContinuation(Object continuation, + Scriptable scope, Object functionResult) + throws ContinuationPending + { + Object[] args = { functionResult }; + return Interpreter.restartContinuation( + (org.mozilla.javascript.NativeContinuation) continuation, + this, scope, args); + } + + /** + * Check whether a string is ready to be compiled. + *

+ * stringIsCompilableUnit is intended to support interactive compilation of + * JavaScript. If compiling the string would result in an error + * that might be fixed by appending more source, this method + * returns false. In every other case, it returns true. + *

+ * Interactive shells may accumulate source lines, using this + * method after each new line is appended to check whether the + * statement being entered is complete. + * + * @param source the source buffer to check + * @return whether the source is ready for compilation + * @since 1.4 Release 2 + */ + public final boolean stringIsCompilableUnit(String source) + { + boolean errorseen = false; + CompilerEnvirons compilerEnv = new CompilerEnvirons(); + compilerEnv.initFromContext(this); + // no source name or source text manager, because we're just + // going to throw away the result. + compilerEnv.setGeneratingSource(false); + Parser p = new Parser(compilerEnv, DefaultErrorReporter.instance); + try { + p.parse(source, null, 1); + } catch (EvaluatorException ee) { + errorseen = true; + } + // Return false only if an error occurred as a result of reading past + // the end of the file, i.e. if the source could be fixed by + // appending more source. + if (errorseen && p.eof()) + return false; + else + return true; + } + + /** + * @deprecated + * @see #compileReader(Reader in, String sourceName, int lineno, + * Object securityDomain) + */ + public final Script compileReader(Scriptable scope, Reader in, + String sourceName, int lineno, + Object securityDomain) + throws IOException + { + return compileReader(in, sourceName, lineno, securityDomain); + } + + /** + * Compiles the source in the given reader. + *

+ * Returns a script that may later be executed. + * Will consume all the source in the reader. + * + * @param in the input reader + * @param sourceName a string describing the source, such as a filename + * @param lineno the starting line number for reporting errors + * @param securityDomain an arbitrary object that specifies security + * information about the origin or owner of the script. For + * implementations that don't care about security, this value + * may be null. + * @return a script that may later be executed + * @exception IOException if an IOException was generated by the Reader + * @see org.mozilla.javascript.Script + */ + public final Script compileReader(Reader in, String sourceName, + int lineno, Object securityDomain) + throws IOException + { + if (lineno < 0) { + // For compatibility IllegalArgumentException can not be thrown here + lineno = 0; + } + return (Script) compileImpl(null, in, null, sourceName, lineno, + securityDomain, false, null, null); + } + + /** + * Compiles the source in the given string. + *

+ * Returns a script that may later be executed. + * + * @param source the source string + * @param sourceName a string describing the source, such as a filename + * @param lineno the starting line number for reporting errors + * @param securityDomain an arbitrary object that specifies security + * information about the origin or owner of the script. For + * implementations that don't care about security, this value + * may be null. + * @return a script that may later be executed + * @see org.mozilla.javascript.Script + */ + public final Script compileString(String source, + String sourceName, int lineno, + Object securityDomain) + { + if (lineno < 0) { + // For compatibility IllegalArgumentException can not be thrown here + lineno = 0; + } + return compileString(source, null, null, sourceName, lineno, + securityDomain); + } + + final Script compileString(String source, + Evaluator compiler, + ErrorReporter compilationErrorReporter, + String sourceName, int lineno, + Object securityDomain) + { + try { + return (Script) compileImpl(null, null, source, sourceName, lineno, + securityDomain, false, + compiler, compilationErrorReporter); + } catch (IOException ex) { + // Should not happen when dealing with source as string + throw new RuntimeException(); + } + } + + /** + * Compile a JavaScript function. + *

+ * The function source must be a function definition as defined by + * ECMA (e.g., "function f(a) { return a; }"). + * + * @param scope the scope to compile relative to + * @param source the function definition source + * @param sourceName a string describing the source, such as a filename + * @param lineno the starting line number + * @param securityDomain an arbitrary object that specifies security + * information about the origin or owner of the script. For + * implementations that don't care about security, this value + * may be null. + * @return a Function that may later be called + * @see org.mozilla.javascript.Function + */ + public final Function compileFunction(Scriptable scope, String source, + String sourceName, int lineno, + Object securityDomain) + { + return compileFunction(scope, source, null, null, sourceName, lineno, + securityDomain); + } + + final Function compileFunction(Scriptable scope, String source, + Evaluator compiler, + ErrorReporter compilationErrorReporter, + String sourceName, int lineno, + Object securityDomain) + { + try { + return (Function) compileImpl(scope, null, source, sourceName, + lineno, securityDomain, true, + compiler, compilationErrorReporter); + } + catch (IOException ioe) { + // Should never happen because we just made the reader + // from a String + throw new RuntimeException(); + } + } + + /** + * Decompile the script. + *

+ * The canonical source of the script is returned. + * + * @param script the script to decompile + * @param indent the number of spaces to indent the result + * @return a string representing the script source + */ + public final String decompileScript(Script script, int indent) + { + NativeFunction scriptImpl = (NativeFunction) script; + return scriptImpl.decompile(indent, 0); + } + + /** + * Decompile a JavaScript Function. + *

+ * Decompiles a previously compiled JavaScript function object to + * canonical source. + *

+ * Returns function body of '[native code]' if no decompilation + * information is available. + * + * @param fun the JavaScript function to decompile + * @param indent the number of spaces to indent the result + * @return a string representing the function source + */ + public final String decompileFunction(Function fun, int indent) + { + if (fun instanceof BaseFunction) + return ((BaseFunction)fun).decompile(indent, 0); + else + return "function " + fun.getClassName() + + "() {\n\t[native code]\n}\n"; + } + + /** + * Decompile the body of a JavaScript Function. + *

+ * Decompiles the body a previously compiled JavaScript Function + * object to canonical source, omitting the function header and + * trailing brace. + * + * Returns '[native code]' if no decompilation information is available. + * + * @param fun the JavaScript function to decompile + * @param indent the number of spaces to indent the result + * @return a string representing the function body source. + */ + public final String decompileFunctionBody(Function fun, int indent) + { + if (fun instanceof BaseFunction) { + BaseFunction bf = (BaseFunction)fun; + return bf.decompile(indent, Decompiler.ONLY_BODY_FLAG); + } + // ALERT: not sure what the right response here is. + return "[native code]\n"; + } + + /** + * Create a new JavaScript object. + * + * Equivalent to evaluating "new Object()". + * @param scope the scope to search for the constructor and to evaluate + * against + * @return the new object + */ + public final Scriptable newObject(Scriptable scope) + { + return newObject(scope, "Object", ScriptRuntime.emptyArgs); + } + + /** + * Create a new JavaScript object by executing the named constructor. + * + * The call newObject(scope, "Foo") is equivalent to + * evaluating "new Foo()". + * + * @param scope the scope to search for the constructor and to evaluate against + * @param constructorName the name of the constructor to call + * @return the new object + */ + public final Scriptable newObject(Scriptable scope, String constructorName) + { + return newObject(scope, constructorName, ScriptRuntime.emptyArgs); + } + + /** + * Creates a new JavaScript object by executing the named constructor. + * + * Searches scope for the named constructor, calls it with + * the given arguments, and returns the result.

+ * + * The code + *

+     * Object[] args = { "a", "b" };
+     * newObject(scope, "Foo", args)
+ * is equivalent to evaluating "new Foo('a', 'b')", assuming that the Foo + * constructor has been defined in scope. + * + * @param scope The scope to search for the constructor and to evaluate + * against + * @param constructorName the name of the constructor to call + * @param args the array of arguments for the constructor + * @return the new object + */ + public final Scriptable newObject(Scriptable scope, String constructorName, + Object[] args) + { + scope = ScriptableObject.getTopLevelScope(scope); + Function ctor = ScriptRuntime.getExistingCtor(this, scope, + constructorName); + if (args == null) { args = ScriptRuntime.emptyArgs; } + return ctor.construct(this, scope, args); + } + + /** + * Create an array with a specified initial length. + *

+ * @param scope the scope to create the object in + * @param length the initial length (JavaScript arrays may have + * additional properties added dynamically). + * @return the new array object + */ + public final Scriptable newArray(Scriptable scope, int length) + { + NativeArray result = new NativeArray(length); + ScriptRuntime.setObjectProtoAndParent(result, scope); + return result; + } + + /** + * Create an array with a set of initial elements. + * + * @param scope the scope to create the object in. + * @param elements the initial elements. Each object in this array + * must be an acceptable JavaScript type and type + * of array should be exactly Object[], not + * SomeObjectSubclass[]. + * @return the new array object. + */ + public final Scriptable newArray(Scriptable scope, Object[] elements) + { + if (elements.getClass().getComponentType() != ScriptRuntime.ObjectClass) + throw new IllegalArgumentException(); + NativeArray result = new NativeArray(elements); + ScriptRuntime.setObjectProtoAndParent(result, scope); + return result; + } + + /** + * Get the elements of a JavaScript array. + *

+ * If the object defines a length property convertible to double number, + * then the number is converted Uint32 value as defined in Ecma 9.6 + * and Java array of that size is allocated. + * The array is initialized with the values obtained by + * calling get() on object for each value of i in [0,length-1]. If + * there is not a defined value for a property the Undefined value + * is used to initialize the corresponding element in the array. The + * Java array is then returned. + * If the object doesn't define a length property or it is not a number, + * empty array is returned. + * @param object the JavaScript array or array-like object + * @return a Java array of objects + * @since 1.4 release 2 + */ + public final Object[] getElements(Scriptable object) + { + return ScriptRuntime.getArrayElements(object); + } + + /** + * Convert the value to a JavaScript boolean value. + *

+ * See ECMA 9.2. + * + * @param value a JavaScript value + * @return the corresponding boolean value converted using + * the ECMA rules + */ + public static boolean toBoolean(Object value) + { + return ScriptRuntime.toBoolean(value); + } + + /** + * Convert the value to a JavaScript Number value. + *

+ * Returns a Java double for the JavaScript Number. + *

+ * See ECMA 9.3. + * + * @param value a JavaScript value + * @return the corresponding double value converted using + * the ECMA rules + */ + public static double toNumber(Object value) + { + return ScriptRuntime.toNumber(value); + } + + /** + * Convert the value to a JavaScript String value. + *

+ * See ECMA 9.8. + *

+ * @param value a JavaScript value + * @return the corresponding String value converted using + * the ECMA rules + */ + public static String toString(Object value) + { + return ScriptRuntime.toString(value); + } + + /** + * Convert the value to an JavaScript object value. + *

+ * Note that a scope must be provided to look up the constructors + * for Number, Boolean, and String. + *

+ * See ECMA 9.9. + *

+ * Additionally, arbitrary Java objects and classes will be + * wrapped in a Scriptable object with its Java fields and methods + * reflected as JavaScript properties of the object. + * + * @param value any Java object + * @param scope global scope containing constructors for Number, + * Boolean, and String + * @return new JavaScript object + */ + public static Scriptable toObject(Object value, Scriptable scope) + { + return ScriptRuntime.toObject(scope, value); + } + + /** + * @deprecated + * @see #toObject(Object, Scriptable) + */ + public static Scriptable toObject(Object value, Scriptable scope, + Class staticType) + { + return ScriptRuntime.toObject(scope, value); + } + + /** + * Convenient method to convert java value to its closest representation + * in JavaScript. + *

+ * If value is an instance of String, Number, Boolean, Function or + * Scriptable, it is returned as it and will be treated as the corresponding + * JavaScript type of string, number, boolean, function and object. + *

+ * Note that for Number instances during any arithmetic operation in + * JavaScript the engine will always use the result of + * Number.doubleValue() resulting in a precision loss if + * the number can not fit into double. + *

+ * If value is an instance of Character, it will be converted to string of + * length 1 and its JavaScript type will be string. + *

+ * The rest of values will be wrapped as LiveConnect objects + * by calling {@link WrapFactory#wrap(Context cx, Scriptable scope, + * Object obj, Class staticType)} as in: + *

+     *    Context cx = Context.getCurrentContext();
+     *    return cx.getWrapFactory().wrap(cx, scope, value, null);
+     * 
+ * + * @param value any Java object + * @param scope top scope object + * @return value suitable to pass to any API that takes JavaScript values. + */ + public static Object javaToJS(Object value, Scriptable scope) + { + if (value instanceof String || value instanceof Number + || value instanceof Boolean || value instanceof Scriptable) + { + return value; + } else if (value instanceof Character) { + return String.valueOf(((Character)value).charValue()); + } else { + Context cx = Context.getContext(); + return cx.getWrapFactory().wrap(cx, scope, value, null); + } + } + + /** + * Convert a JavaScript value into the desired type. + * Uses the semantics defined with LiveConnect3 and throws an + * Illegal argument exception if the conversion cannot be performed. + * @param value the JavaScript value to convert + * @param desiredType the Java type to convert to. Primitive Java + * types are represented using the TYPE fields in the corresponding + * wrapper class in java.lang. + * @return the converted value + * @throws EvaluatorException if the conversion cannot be performed + */ + public static Object jsToJava(Object value, Class desiredType) + throws EvaluatorException + { + return NativeJavaObject.coerceTypeImpl(desiredType, value); + } + + /** + * @deprecated + * @see #jsToJava(Object, Class) + * @throws IllegalArgumentException if the conversion cannot be performed. + * Note that {@link #jsToJava(Object, Class)} throws + * {@link EvaluatorException} instead. + */ + public static Object toType(Object value, Class desiredType) + throws IllegalArgumentException + { + try { + return jsToJava(value, desiredType); + } catch (EvaluatorException ex) { + IllegalArgumentException + ex2 = new IllegalArgumentException(ex.getMessage()); + Kit.initCause(ex2, ex); + throw ex2; + } + } + + /** + * Rethrow the exception wrapping it as the script runtime exception. + * Unless the exception is instance of {@link EcmaError} or + * {@link EvaluatorException} it will be wrapped as + * {@link WrappedException}, a subclass of {@link EvaluatorException}. + * The resulting exception object always contains + * source name and line number of script that triggered exception. + *

+ * This method always throws an exception, its return value is provided + * only for convenience to allow a usage like: + *

+     * throw Context.throwAsScriptRuntimeEx(ex);
+     * 
+ * to indicate that code after the method is unreachable. + * @throws EvaluatorException + * @throws EcmaError + */ + public static RuntimeException throwAsScriptRuntimeEx(Throwable e) + { + while ((e instanceof InvocationTargetException)) { + e = ((InvocationTargetException) e).getTargetException(); + } + // special handling of Error so scripts would not catch them + if (e instanceof Error) { + Context cx = getContext(); + if (cx == null || + !cx.hasFeature(Context.FEATURE_ENHANCED_JAVA_ACCESS)) + { + throw (Error)e; + } + } + if (e instanceof RhinoException) { + throw (RhinoException)e; + } + throw new WrappedException(e); + } + + /** + * Tell whether debug information is being generated. + * @since 1.3 + */ + public final boolean isGeneratingDebug() + { + return generatingDebug; + } + + /** + * Specify whether or not debug information should be generated. + *

+ * Setting the generation of debug information on will set the + * optimization level to zero. + * @since 1.3 + */ + public final void setGeneratingDebug(boolean generatingDebug) + { + if (sealed) onSealedMutation(); + generatingDebugChanged = true; + if (generatingDebug && getOptimizationLevel() > 0) + setOptimizationLevel(0); + this.generatingDebug = generatingDebug; + } + + /** + * Tell whether source information is being generated. + * @since 1.3 + */ + public final boolean isGeneratingSource() + { + return generatingSource; + } + + /** + * Specify whether or not source information should be generated. + *

+ * Without source information, evaluating the "toString" method + * on JavaScript functions produces only "[native code]" for + * the body of the function. + * Note that code generated without source is not fully ECMA + * conformant. + * @since 1.3 + */ + public final void setGeneratingSource(boolean generatingSource) + { + if (sealed) onSealedMutation(); + this.generatingSource = generatingSource; + } + + /** + * Get the current optimization level. + *

+ * The optimization level is expressed as an integer between -1 and + * 9. + * @since 1.3 + * + */ + public final int getOptimizationLevel() + { + return optimizationLevel; + } + + /** + * Set the current optimization level. + *

+ * The optimization level is expected to be an integer between -1 and + * 9. Any negative values will be interpreted as -1, and any values + * greater than 9 will be interpreted as 9. + * An optimization level of -1 indicates that interpretive mode will + * always be used. Levels 0 through 9 indicate that class files may + * be generated. Higher optimization levels trade off compile time + * performance for runtime performance. + * The optimizer level can't be set greater than -1 if the optimizer + * package doesn't exist at run time. + * @param optimizationLevel an integer indicating the level of + * optimization to perform + * @since 1.3 + * + */ + public final void setOptimizationLevel(int optimizationLevel) + { + if (sealed) onSealedMutation(); + if (optimizationLevel == -2) { + // To be compatible with Cocoon fork + optimizationLevel = -1; + } + checkOptimizationLevel(optimizationLevel); + if (codegenClass == null) + optimizationLevel = -1; + this.optimizationLevel = optimizationLevel; + } + + public static boolean isValidOptimizationLevel(int optimizationLevel) + { + return -1 <= optimizationLevel && optimizationLevel <= 9; + } + + public static void checkOptimizationLevel(int optimizationLevel) + { + if (isValidOptimizationLevel(optimizationLevel)) { + return; + } + throw new IllegalArgumentException( + "Optimization level outside [-1..9]: "+optimizationLevel); + } + + /** + * Returns the maximum stack depth (in terms of number of call frames) + * allowed in a single invocation of interpreter. If the set depth would be + * exceeded, the interpreter will throw an EvaluatorException in the script. + * Defaults to Integer.MAX_VALUE. The setting only has effect for + * interpreted functions (those compiled with optimization level set to -1). + * As the interpreter doesn't use the Java stack but rather manages its own + * stack in the heap memory, a runaway recursion in interpreted code would + * eventually consume all available memory and cause OutOfMemoryError + * instead of a StackOverflowError limited to only a single thread. This + * setting helps prevent such situations. + * + * @return The current maximum interpreter stack depth. + */ + public final int getMaximumInterpreterStackDepth() + { + return maximumInterpreterStackDepth; + } + + /** + * Sets the maximum stack depth (in terms of number of call frames) + * allowed in a single invocation of interpreter. If the set depth would be + * exceeded, the interpreter will throw an EvaluatorException in the script. + * Defaults to Integer.MAX_VALUE. The setting only has effect for + * interpreted functions (those compiled with optimization level set to -1). + * As the interpreter doesn't use the Java stack but rather manages its own + * stack in the heap memory, a runaway recursion in interpreted code would + * eventually consume all available memory and cause OutOfMemoryError + * instead of a StackOverflowError limited to only a single thread. This + * setting helps prevent such situations. + * + * @param max the new maximum interpreter stack depth + * @throws IllegalStateException if this context's optimization level is not + * -1 + * @throws IllegalArgumentException if the new depth is not at least 1 + */ + public final void setMaximumInterpreterStackDepth(int max) + { + if(sealed) onSealedMutation(); + if(optimizationLevel != -1) { + throw new IllegalStateException("Cannot set maximumInterpreterStackDepth when optimizationLevel != -1"); + } + if(max < 1) { + throw new IllegalArgumentException("Cannot set maximumInterpreterStackDepth to less than 1"); + } + maximumInterpreterStackDepth = max; + } + + /** + * Set the security controller for this context. + *

SecurityController may only be set if it is currently null + * and {@link SecurityController#hasGlobal()} is false. + * Otherwise a SecurityException is thrown. + * @param controller a SecurityController object + * @throws SecurityException if there is already a SecurityController + * object for this Context or globally installed. + * @see SecurityController#initGlobal(SecurityController controller) + * @see SecurityController#hasGlobal() + */ + public final void setSecurityController(SecurityController controller) + { + if (sealed) onSealedMutation(); + if (controller == null) throw new IllegalArgumentException(); + if (securityController != null) { + throw new SecurityException("Can not overwrite existing SecurityController object"); + } + if (SecurityController.hasGlobal()) { + throw new SecurityException("Can not overwrite existing global SecurityController object"); + } + securityController = controller; + } + + /** + * Set the LiveConnect access filter for this context. + *

{@link ClassShutter} may only be set if it is currently null. + * Otherwise a SecurityException is thrown. + * @param shutter a ClassShutter object + * @throws SecurityException if there is already a ClassShutter + * object for this Context + */ + public final void setClassShutter(ClassShutter shutter) + { + if (sealed) onSealedMutation(); + if (shutter == null) throw new IllegalArgumentException(); + if (classShutter != null) { + throw new SecurityException("Cannot overwrite existing " + + "ClassShutter object"); + } + classShutter = shutter; + } + + final ClassShutter getClassShutter() + { + return classShutter; + } + + /** + * Get a value corresponding to a key. + *

+ * Since the Context is associated with a thread it can be + * used to maintain values that can be later retrieved using + * the current thread. + *

+ * Note that the values are maintained with the Context, so + * if the Context is disassociated from the thread the values + * cannot be retrieved. Also, if private data is to be maintained + * in this manner the key should be a java.lang.Object + * whose reference is not divulged to untrusted code. + * @param key the key used to lookup the value + * @return a value previously stored using putThreadLocal. + */ + public final Object getThreadLocal(Object key) + { + if (threadLocalMap == null) + return null; + return threadLocalMap.get(key); + } + + /** + * Put a value that can later be retrieved using a given key. + *

+ * @param key the key used to index the value + * @param value the value to save + */ + public synchronized final void putThreadLocal(Object key, Object value) + { + if (sealed) onSealedMutation(); + if (threadLocalMap == null) + threadLocalMap = new HashMap(); + threadLocalMap.put(key, value); + } + + /** + * Remove values from thread-local storage. + * @param key the key for the entry to remove. + * @since 1.5 release 2 + */ + public final void removeThreadLocal(Object key) + { + if (sealed) onSealedMutation(); + if (threadLocalMap == null) + return; + threadLocalMap.remove(key); + } + + /** + * @deprecated + * @see #FEATURE_DYNAMIC_SCOPE + * @see #hasFeature(int) + */ + public final boolean hasCompileFunctionsWithDynamicScope() + { + return compileFunctionsWithDynamicScopeFlag; + } + + /** + * @deprecated + * @see #FEATURE_DYNAMIC_SCOPE + * @see #hasFeature(int) + */ + public final void setCompileFunctionsWithDynamicScope(boolean flag) + { + if (sealed) onSealedMutation(); + compileFunctionsWithDynamicScopeFlag = flag; + } + + /** + * @deprecated + * @see ClassCache#get(Scriptable) + * @see ClassCache#setCachingEnabled(boolean) + */ + public static void setCachingEnabled(boolean cachingEnabled) + { + } + + /** + * Set a WrapFactory for this Context. + *

+ * The WrapFactory allows custom object wrapping behavior for + * Java object manipulated with JavaScript. + * @see WrapFactory + * @since 1.5 Release 4 + */ + public final void setWrapFactory(WrapFactory wrapFactory) + { + if (sealed) onSealedMutation(); + if (wrapFactory == null) throw new IllegalArgumentException(); + this.wrapFactory = wrapFactory; + } + + /** + * Return the current WrapFactory, or null if none is defined. + * @see WrapFactory + * @since 1.5 Release 4 + */ + public final WrapFactory getWrapFactory() + { + if (wrapFactory == null) { + wrapFactory = new WrapFactory(); + } + return wrapFactory; + } + + /** + * Return the current debugger. + * @return the debugger, or null if none is attached. + */ + public final Debugger getDebugger() + { + return debugger; + } + + /** + * Return the debugger context data associated with current context. + * @return the debugger data, or null if debugger is not attached + */ + public final Object getDebuggerContextData() + { + return debuggerData; + } + + /** + * Set the associated debugger. + * @param debugger the debugger to be used on callbacks from + * the engine. + * @param contextData arbitrary object that debugger can use to store + * per Context data. + */ + public final void setDebugger(Debugger debugger, Object contextData) + { + if (sealed) onSealedMutation(); + this.debugger = debugger; + debuggerData = contextData; + } + + /** + * Return DebuggableScript instance if any associated with the script. + * If callable supports DebuggableScript implementation, the method + * returns it. Otherwise null is returned. + */ + public static DebuggableScript getDebuggableView(Script script) + { + if (script instanceof NativeFunction) { + return ((NativeFunction)script).getDebuggableView(); + } + return null; + } + + /** + * Controls certain aspects of script semantics. + * Should be overwritten to alter default behavior. + *

+ * The default implementation calls + * {@link ContextFactory#hasFeature(Context cx, int featureIndex)} + * that allows to customize Context behavior without introducing + * Context subclasses. {@link ContextFactory} documentation gives + * an example of hasFeature implementation. + * + * @param featureIndex feature index to check + * @return true if the featureIndex feature is turned on + * @see #FEATURE_NON_ECMA_GET_YEAR + * @see #FEATURE_MEMBER_EXPR_AS_FUNCTION_NAME + * @see #FEATURE_RESERVED_KEYWORD_AS_IDENTIFIER + * @see #FEATURE_TO_STRING_AS_SOURCE + * @see #FEATURE_PARENT_PROTO_PROPRTIES + * @see #FEATURE_E4X + * @see #FEATURE_DYNAMIC_SCOPE + * @see #FEATURE_STRICT_VARS + * @see #FEATURE_STRICT_EVAL + * @see #FEATURE_LOCATION_INFORMATION_IN_ERROR + * @see #FEATURE_STRICT_MODE + * @see #FEATURE_WARNING_AS_ERROR + * @see #FEATURE_ENHANCED_JAVA_ACCESS + */ + public boolean hasFeature(int featureIndex) + { + ContextFactory f = getFactory(); + return f.hasFeature(this, featureIndex); + } + + /** + Returns an object which specifies an E4X implementation to use within + this Context. Note + that the XMLLib.Factory interface should be considered experimental. + + The default implementation uses the implementation provided by this + Context's {@link ContextFactory}. + + @return An XMLLib.Factory. Should not return null if + {@link #FEATURE_E4X} is enabled. See {@link #hasFeature}. + */ + public XMLLib.Factory getE4xImplementationFactory() { + return getFactory().getE4xImplementationFactory(); + } + + /** + * Get threshold of executed instructions counter that triggers call to + * observeInstructionCount(). + * When the threshold is zero, instruction counting is disabled, + * otherwise each time the run-time executes at least the threshold value + * of script instructions, observeInstructionCount() will + * be called. + */ + public final int getInstructionObserverThreshold() + { + return instructionThreshold; + } + + /** + * Set threshold of executed instructions counter that triggers call to + * observeInstructionCount(). + * When the threshold is zero, instruction counting is disabled, + * otherwise each time the run-time executes at least the threshold value + * of script instructions, observeInstructionCount() will + * be called.

+ * Note that the meaning of "instruction" is not guaranteed to be + * consistent between compiled and interpretive modes: executing a given + * script or function in the different modes will result in different + * instruction counts against the threshold. + * {@link #setGenerateObserverCount} is called with true if + * threshold is greater than zero, false otherwise. + * @param threshold The instruction threshold + */ + public final void setInstructionObserverThreshold(int threshold) + { + if (sealed) onSealedMutation(); + if (threshold < 0) throw new IllegalArgumentException(); + instructionThreshold = threshold; + setGenerateObserverCount(threshold > 0); + } + + /** + * Turn on or off generation of code with callbacks to + * track the count of executed instructions. + * Currently only affects JVM byte code generation: this slows down the + * generated code, but code generated without the callbacks will not + * be counted toward instruction thresholds. Rhino's interpretive + * mode does instruction counting without inserting callbacks, so + * there is no requirement to compile code differently. + * @param generateObserverCount if true, generated code will contain + * calls to accumulate an estimate of the instructions executed. + */ + public void setGenerateObserverCount(boolean generateObserverCount) { + this.generateObserverCount = generateObserverCount; + } + + /** + * Allow application to monitor counter of executed script instructions + * in Context subclasses. + * Run-time calls this when instruction counting is enabled and the counter + * reaches limit set by setInstructionObserverThreshold(). + * The method is useful to observe long running scripts and if necessary + * to terminate them. + *

+ * The default implementation calls + * {@link ContextFactory#observeInstructionCount(Context cx, + * int instructionCount)} + * that allows to customize Context behavior without introducing + * Context subclasses. + * + * @param instructionCount amount of script instruction executed since + * last call to observeInstructionCount + * @throws Error to terminate the script + * @see #setOptimizationLevel(int) + */ + protected void observeInstructionCount(int instructionCount) + { + ContextFactory f = getFactory(); + f.observeInstructionCount(this, instructionCount); + } + + /** + * Create class loader for generated classes. + * The method calls {@link ContextFactory#createClassLoader(ClassLoader)} + * using the result of {@link #getFactory()}. + */ + public GeneratedClassLoader createClassLoader(ClassLoader parent) + { + ContextFactory f = getFactory(); + return f.createClassLoader(parent); + } + + public final ClassLoader getApplicationClassLoader() + { + if (applicationClassLoader == null) { + ContextFactory f = getFactory(); + ClassLoader loader = f.getApplicationClassLoader(); + if (loader == null) { + ClassLoader threadLoader + = VMBridge.instance.getCurrentThreadClassLoader(); + if (threadLoader != null + && Kit.testIfCanLoadRhinoClasses(threadLoader)) + { + // Thread.getContextClassLoader is not cached since + // its caching prevents it from GC which may lead to + // a memory leak and hides updates to + // Thread.getContextClassLoader + return threadLoader; + } + // Thread.getContextClassLoader can not load Rhino classes, + // try to use the loader of ContextFactory or Context + // subclasses. + Class fClass = f.getClass(); + if (fClass != ScriptRuntime.ContextFactoryClass) { + loader = fClass.getClassLoader(); + } else { + loader = getClass().getClassLoader(); + } + } + applicationClassLoader = loader; + } + return applicationClassLoader; + } + + public final void setApplicationClassLoader(ClassLoader loader) + { + if (sealed) onSealedMutation(); + if (loader == null) { + // restore default behaviour + applicationClassLoader = null; + return; + } + if (!Kit.testIfCanLoadRhinoClasses(loader)) { + throw new IllegalArgumentException( + "Loader can not resolve Rhino classes"); + } + applicationClassLoader = loader; + } + + /********** end of API **********/ + + /** + * Internal method that reports an error for missing calls to + * enter(). + */ + static Context getContext() + { + Context cx = getCurrentContext(); + if (cx == null) { + throw new RuntimeException( + "No Context associated with current Thread"); + } + return cx; + } + + private Object compileImpl(Scriptable scope, + Reader sourceReader, String sourceString, + String sourceName, int lineno, + Object securityDomain, boolean returnFunction, + Evaluator compiler, + ErrorReporter compilationErrorReporter) + throws IOException + { + if(sourceName == null) { + sourceName = "unnamed script"; + } + if (securityDomain != null && getSecurityController() == null) { + throw new IllegalArgumentException( + "securityDomain should be null if setSecurityController() was never called"); + } + + // One of sourceReader or sourceString has to be null + if (!(sourceReader == null ^ sourceString == null)) Kit.codeBug(); + // scope should be given if and only if compiling function + if (!(scope == null ^ returnFunction)) Kit.codeBug(); + + CompilerEnvirons compilerEnv = new CompilerEnvirons(); + compilerEnv.initFromContext(this); + if (compilationErrorReporter == null) { + compilationErrorReporter = compilerEnv.getErrorReporter(); + } + + if (debugger != null) { + if (sourceReader != null) { + sourceString = Kit.readReader(sourceReader); + sourceReader = null; + } + } + + Parser p = new Parser(compilerEnv, compilationErrorReporter); + if (returnFunction) { + p.calledByCompileFunction = true; + } + ScriptOrFnNode tree; + if (sourceString != null) { + tree = p.parse(sourceString, sourceName, lineno); + } else { + tree = p.parse(sourceReader, sourceName, lineno); + } + if (returnFunction) { + if (!(tree.getFunctionCount() == 1 + && tree.getFirstChild() != null + && tree.getFirstChild().getType() == Token.FUNCTION)) + { + // XXX: the check just look for the first child + // and allows for more nodes after it for compatibility + // with sources like function() {};;; + throw new IllegalArgumentException( + "compileFunction only accepts source with single JS function: "+sourceString); + } + } + + if (compiler == null) { + compiler = createCompiler(); + } + + String encodedSource = p.getEncodedSource(); + + Object bytecode = compiler.compile(compilerEnv, + tree, encodedSource, + returnFunction); + + if (debugger != null) { + if (sourceString == null) Kit.codeBug(); + if (bytecode instanceof DebuggableScript) { + DebuggableScript dscript = (DebuggableScript)bytecode; + notifyDebugger_r(this, dscript, sourceString); + } else { + throw new RuntimeException("NOT SUPPORTED"); + } + } + + Object result; + if (returnFunction) { + result = compiler.createFunctionObject(this, scope, bytecode, securityDomain); + } else { + result = compiler.createScriptObject(bytecode, securityDomain); + } + + return result; + } + + private static void notifyDebugger_r(Context cx, DebuggableScript dscript, + String debugSource) + { + cx.debugger.handleCompilationDone(cx, dscript, debugSource); + for (int i = 0; i != dscript.getFunctionCount(); ++i) { + notifyDebugger_r(cx, dscript.getFunction(i), debugSource); + } + } + + private static Class codegenClass = Kit.classOrNull( + "org.mozilla.javascript.optimizer.Codegen"); + private static Class interpreterClass = Kit.classOrNull( + "org.mozilla.javascript.Interpreter"); + + private Evaluator createCompiler() + { + Evaluator result = null; + if (optimizationLevel >= 0 && codegenClass != null) { + result = (Evaluator)Kit.newInstanceOrNull(codegenClass); + } + if (result == null) { + result = createInterpreter(); + } + return result; + } + + static Evaluator createInterpreter() + { + return (Evaluator)Kit.newInstanceOrNull(interpreterClass); + } + + static String getSourcePositionFromStack(int[] linep) + { + Context cx = getCurrentContext(); + if (cx == null) + return null; + if (cx.lastInterpreterFrame != null) { + Evaluator evaluator = createInterpreter(); + if (evaluator != null) + return evaluator.getSourcePositionFromStack(cx, linep); + } + /** + * A bit of a hack, but the only way to get filename and line + * number from an enclosing frame. + */ + CharArrayWriter writer = new CharArrayWriter(); + RuntimeException re = new RuntimeException(); + re.printStackTrace(new PrintWriter(writer)); + String s = writer.toString(); + int open = -1; + int close = -1; + int colon = -1; + for (int i=0; i < s.length(); i++) { + char c = s.charAt(i); + if (c == ':') + colon = i; + else if (c == '(') + open = i; + else if (c == ')') + close = i; + else if (c == '\n' && open != -1 && close != -1 && colon != -1 && + open < colon && colon < close) + { + String fileStr = s.substring(open + 1, colon); + if (!fileStr.endsWith(".java")) { + String lineStr = s.substring(colon + 1, close); + try { + linep[0] = Integer.parseInt(lineStr); + if (linep[0] < 0) { + linep[0] = 0; + } + return fileStr; + } + catch (NumberFormatException e) { + // fall through + } + } + open = close = colon = -1; + } + } + + return null; + } + + RegExpProxy getRegExpProxy() + { + if (regExpProxy == null) { + Class cl = Kit.classOrNull( + "org.mozilla.javascript.regexp.RegExpImpl"); + if (cl != null) { + regExpProxy = (RegExpProxy)Kit.newInstanceOrNull(cl); + } + } + return regExpProxy; + } + + final boolean isVersionECMA1() + { + return version == VERSION_DEFAULT || version >= VERSION_1_3; + } + +// The method must NOT be public or protected + SecurityController getSecurityController() + { + SecurityController global = SecurityController.global(); + if (global != null) { + return global; + } + return securityController; + } + + public final boolean isGeneratingDebugChanged() + { + return generatingDebugChanged; + } + + /** + * Add a name to the list of names forcing the creation of real + * activation objects for functions. + * + * @param name the name of the object to add to the list + */ + public void addActivationName(String name) + { + if (sealed) onSealedMutation(); + if (activationNames == null) + activationNames = new HashSet(); + activationNames.add(name); + } + + /** + * Check whether the name is in the list of names of objects + * forcing the creation of activation objects. + * + * @param name the name of the object to test + * + * @return true if an function activation object is needed. + */ + public final boolean isActivationNeeded(String name) + { + return activationNames != null && activationNames.contains(name); + } + + /** + * Remove a name from the list of names forcing the creation of real + * activation objects for functions. + * + * @param name the name of the object to remove from the list + */ + public void removeActivationName(String name) + { + if (sealed) onSealedMutation(); + if (activationNames != null) + activationNames.remove(name); + } + + private static String implementationVersion; + + private final ContextFactory factory; + private boolean sealed; + private Object sealKey; + + Scriptable topCallScope; + boolean isContinuationsTopCall; + NativeCall currentActivationCall; + XMLLib cachedXMLLib; + + // for Objects, Arrays to tag themselves as being printed out, + // so they don't print themselves out recursively. + // Use ObjToIntMap instead of java.util.HashSet for JDK 1.1 compatibility + ObjToIntMap iterating; + + Object interpreterSecurityDomain; + + int version; + + private SecurityController securityController; + private ClassShutter classShutter; + private ErrorReporter errorReporter; + RegExpProxy regExpProxy; + private Locale locale; + private boolean generatingDebug; + private boolean generatingDebugChanged; + private boolean generatingSource=true; + boolean compileFunctionsWithDynamicScopeFlag; + boolean useDynamicScope; + private int optimizationLevel; + private int maximumInterpreterStackDepth; + private WrapFactory wrapFactory; + Debugger debugger; + private Object debuggerData; + private int enterCount; + private Object propertyListeners; + private Map threadLocalMap; + private ClassLoader applicationClassLoader; + + /** + * This is the list of names of objects forcing the creation of + * function activation records. + */ + Set activationNames; + + // For the interpreter to store the last frame for error reports etc. + Object lastInterpreterFrame; + + // For the interpreter to store information about previous invocations + // interpreter invocations + ObjArray previousInterpreterInvocations; + + // For instruction counting (interpreter only) + int instructionCount; + int instructionThreshold; + + // It can be used to return the second index-like result from function + int scratchIndex; + + // It can be used to return the second uint32 result from function + long scratchUint32; + + // It can be used to return the second Scriptable result from function + Scriptable scratchScriptable; + + // Generate an observer count on compiled code + public boolean generateObserverCount = false; + + private boolean actionScript=false; + + public void setActionScript(boolean actionScript) { + this.actionScript=actionScript; + } + + public boolean isActionScript() { + return actionScript; + } +} diff --git a/org/mozilla/javascript/ContextAction.java b/org/mozilla/javascript/ContextAction.java new file mode 100644 index 0000000..6dc8d0d --- /dev/null +++ b/org/mozilla/javascript/ContextAction.java @@ -0,0 +1,58 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-1999 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Igor Bukanov, igor@fastmail.fm + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +// API class + +package org.mozilla.javascript; + +/** + * Interface to represent arbitrary action that requires to have Context + * object associated with the current thread for its execution. + */ +public interface ContextAction +{ + /** + * Execute action using the supplied Context instance. + * When Rhino runtime calls the method, cx will be associated + * with the current thread as active context. + * + * @see ContextFactory#call(ContextAction) + */ + public Object run(Context cx); +} + diff --git a/org/mozilla/javascript/ContextFactory.java b/org/mozilla/javascript/ContextFactory.java new file mode 100644 index 0000000..0e834e6 --- /dev/null +++ b/org/mozilla/javascript/ContextFactory.java @@ -0,0 +1,590 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-1999 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Igor Bukanov, igor@fastmail.fm + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +// API class + +package org.mozilla.javascript; + +/** + * Factory class that Rhino runtime uses to create new {@link Context} + * instances. A ContextFactory can also notify listeners + * about context creation and release. + *

+ * When the Rhino runtime needs to create new {@link Context} instance during + * execution of {@link Context#enter()} or {@link Context}, it will call + * {@link #makeContext()} of the current global ContextFactory. + * See {@link #getGlobal()} and {@link #initGlobal(ContextFactory)}. + *

+ * It is also possible to use explicit ContextFactory instances for Context + * creation. This is useful to have a set of independent Rhino runtime + * instances under single JVM. See {@link #call(ContextAction)}. + *

+ * The following example demonstrates Context customization to terminate + * scripts running more then 10 seconds and to provide better compatibility + * with JavaScript code using MSIE-specific features. + *

+ * import org.mozilla.javascript.*;
+ *
+ * class MyFactory extends ContextFactory
+ * {
+ *
+ *     // Custom {@link Context} to store execution time.
+ *     private static class MyContext extends Context
+ *     {
+ *         long startTime;
+ *     }
+ *
+ *     static {
+ *         // Initialize GlobalFactory with custom factory
+ *         ContextFactory.initGlobal(new MyFactory());
+ *     }
+ *
+ *     // Override {@link #makeContext()}
+ *     protected Context makeContext()
+ *     {
+ *         MyContext cx = new MyContext();
+ *         // Make Rhino runtime to call observeInstructionCount
+ *         // each 10000 bytecode instructions
+ *         cx.setInstructionObserverThreshold(10000);
+ *         return cx;
+ *     }
+ *
+ *     // Override {@link #hasFeature(Context, int)}
+ *     public boolean hasFeature(Context cx, int featureIndex)
+ *     {
+ *         // Turn on maximum compatibility with MSIE scripts
+ *         switch (featureIndex) {
+ *             case {@link Context#FEATURE_NON_ECMA_GET_YEAR}:
+ *                 return true;
+ *
+ *             case {@link Context#FEATURE_MEMBER_EXPR_AS_FUNCTION_NAME}:
+ *                 return true;
+ *
+ *             case {@link Context#FEATURE_RESERVED_KEYWORD_AS_IDENTIFIER}:
+ *                 return true;
+ *
+ *             case {@link Context#FEATURE_PARENT_PROTO_PROPERTIES}:
+ *                 return false;
+ *         }
+ *         return super.hasFeature(cx, featureIndex);
+ *     }
+ *
+ *     // Override {@link #observeInstructionCount(Context, int)}
+ *     protected void observeInstructionCount(Context cx, int instructionCount)
+ *     {
+ *         MyContext mcx = (MyContext)cx;
+ *         long currentTime = System.currentTimeMillis();
+ *         if (currentTime - mcx.startTime > 10*1000) {
+ *             // More then 10 seconds from Context creation time:
+ *             // it is time to stop the script.
+ *             // Throw Error instance to ensure that script will never
+ *             // get control back through catch or finally.
+ *             throw new Error();
+ *         }
+ *     }
+ *
+ *     // Override {@link #doTopCall(Callable,
+                               Context, Scriptable,
+                               Scriptable, Object[])}
+ *     protected Object doTopCall(Callable callable,
+ *                                Context cx, Scriptable scope,
+ *                                Scriptable thisObj, Object[] args)
+ *     {
+ *         MyContext mcx = (MyContext)cx;
+ *         mcx.startTime = System.currentTimeMillis();
+ *
+ *         return super.doTopCall(callable, cx, scope, thisObj, args);
+ *     }
+ *
+ * }
+ *
+ * 
+ */ + +public class ContextFactory +{ + private static volatile boolean hasCustomGlobal; + private static ContextFactory global = new ContextFactory(); + + private volatile boolean sealed; + + private final Object listenersLock = new Object(); + private volatile Object listeners; + private boolean disabledListening; + private ClassLoader applicationClassLoader; + + /** + * Listener of {@link Context} creation and release events. + */ + public interface Listener + { + /** + * Notify about newly created {@link Context} object. + */ + public void contextCreated(Context cx); + + /** + * Notify that the specified {@link Context} instance is no longer + * associated with the current thread. + */ + public void contextReleased(Context cx); + } + + /** + * Get global ContextFactory. + * + * @see #hasExplicitGlobal() + * @see #initGlobal(ContextFactory) + */ + public static ContextFactory getGlobal() + { + return global; + } + + /** + * Check if global factory was set. + * Return true to indicate that {@link #initGlobal(ContextFactory)} was + * already called and false to indicate that the global factory was not + * explicitly set. + * + * @see #getGlobal() + * @see #initGlobal(ContextFactory) + */ + public static boolean hasExplicitGlobal() + { + return hasCustomGlobal; + } + + /** + * Set global ContextFactory. + * The method can only be called once. + * + * @see #getGlobal() + * @see #hasExplicitGlobal() + */ + public synchronized static void initGlobal(ContextFactory factory) + { + if (factory == null) { + throw new IllegalArgumentException(); + } + if (hasCustomGlobal) { + throw new IllegalStateException(); + } + hasCustomGlobal = true; + global = factory; + } + + /** + * Create new {@link Context} instance to be associated with the current + * thread. + * This is a callback method used by Rhino to create {@link Context} + * instance when it is necessary to associate one with the current + * execution thread. makeContext() is allowed to call + * {@link Context#seal(Object)} on the result to prevent + * {@link Context} changes by hostile scripts or applets. + */ + protected Context makeContext() + { + return new Context(this); + } + + /** + * Implementation of {@link Context#hasFeature(int featureIndex)}. + * This can be used to customize {@link Context} without introducing + * additional subclasses. + */ + protected boolean hasFeature(Context cx, int featureIndex) + { + int version; + switch (featureIndex) { + case Context.FEATURE_NON_ECMA_GET_YEAR: + /* + * During the great date rewrite of 1.3, we tried to track the + * evolving ECMA standard, which then had a definition of + * getYear which always subtracted 1900. Which we + * implemented, not realizing that it was incompatible with + * the old behavior... now, rather than thrash the behavior + * yet again, we've decided to leave it with the - 1900 + * behavior and point people to the getFullYear method. But + * we try to protect existing scripts that have specified a + * version... + */ + version = cx.getLanguageVersion(); + return (version == Context.VERSION_1_0 + || version == Context.VERSION_1_1 + || version == Context.VERSION_1_2); + + case Context.FEATURE_MEMBER_EXPR_AS_FUNCTION_NAME: + return false; + + case Context.FEATURE_RESERVED_KEYWORD_AS_IDENTIFIER: + return false; + + case Context.FEATURE_TO_STRING_AS_SOURCE: + version = cx.getLanguageVersion(); + return version == Context.VERSION_1_2; + + case Context.FEATURE_PARENT_PROTO_PROPERTIES: + return true; + + case Context.FEATURE_E4X: + version = cx.getLanguageVersion(); + return (version == Context.VERSION_DEFAULT + || version >= Context.VERSION_1_6); + + case Context.FEATURE_DYNAMIC_SCOPE: + return false; + + case Context.FEATURE_STRICT_VARS: + return false; + + case Context.FEATURE_STRICT_EVAL: + return false; + + case Context.FEATURE_LOCATION_INFORMATION_IN_ERROR: + return false; + + case Context.FEATURE_STRICT_MODE: + return false; + + case Context.FEATURE_WARNING_AS_ERROR: + return false; + + case Context.FEATURE_ENHANCED_JAVA_ACCESS: + return false; + } + // It is a bug to call the method with unknown featureIndex + throw new IllegalArgumentException(String.valueOf(featureIndex)); + } + + private boolean isDom3Present() { + Class nodeClass = Kit.classOrNull("org.w3c.dom.Node"); + if (nodeClass == null) return false; + // Check to see whether DOM3 is present; use a new method defined in + // DOM3 that is vital to our implementation + try { + nodeClass.getMethod("getUserData", new Class[] { String.class }); + return true; + } catch (NoSuchMethodException e) { + return false; + } + } + + /** + * Provides a default + * {@link org.mozilla.javascript.xml.XMLLib.Factory XMLLib.Factory} + * to be used by the Context instances produced by this + * factory. See {@link Context#getE4xImplementationFactory} for details. + * + * May return null, in which case E4X functionality is not supported in + * Rhino. + * + * The default implementation now prefers the DOM3 E4X implementation. + */ + protected org.mozilla.javascript.xml.XMLLib.Factory + getE4xImplementationFactory() + { + // Must provide default implementation, rather than abstract method, + // so that past implementors of ContextFactory do not fail at runtime + // upon invocation of this method. + // Note that the default implementation returns null if we + // neither have XMLBeans nor a DOM3 implementation present. + + if (isDom3Present()) { + return org.mozilla.javascript.xml.XMLLib.Factory.create( + "org.mozilla.javascript.xmlimpl.XMLLibImpl" + ); + } else if (Kit.classOrNull("org.apache.xmlbeans.XmlCursor") != null) { + return org.mozilla.javascript.xml.XMLLib.Factory.create( + "org.mozilla.javascript.xml.impl.xmlbeans.XMLLibImpl" + ); + } else { + return null; + } + } + + + /** + * Create class loader for generated classes. + * This method creates an instance of the default implementation + * of {@link GeneratedClassLoader}. Rhino uses this interface to load + * generated JVM classes when no {@link SecurityController} + * is installed. + * Application can override the method to provide custom class loading. + */ + protected GeneratedClassLoader createClassLoader(ClassLoader parent) + { + return new DefiningClassLoader(parent); + } + + /** + * Get ClassLoader to use when searching for Java classes. + * Unless it was explicitly initialized with + * {@link #initApplicationClassLoader(ClassLoader)} the method returns + * null to indicate that Thread.getContextClassLoader() should be used. + */ + public final ClassLoader getApplicationClassLoader() + { + return applicationClassLoader; + } + + /** + * Set explicit class loader to use when searching for Java classes. + * + * @see #getApplicationClassLoader() + */ + public final void initApplicationClassLoader(ClassLoader loader) + { + if (loader == null) + throw new IllegalArgumentException("loader is null"); + if (!Kit.testIfCanLoadRhinoClasses(loader)) + throw new IllegalArgumentException( + "Loader can not resolve Rhino classes"); + + if (this.applicationClassLoader != null) + throw new IllegalStateException( + "applicationClassLoader can only be set once"); + checkNotSealed(); + + this.applicationClassLoader = loader; + } + + /** + * Execute top call to script or function. + * When the runtime is about to execute a script or function that will + * create the first stack frame with scriptable code, it calls this method + * to perform the real call. In this way execution of any script + * happens inside this function. + */ + protected Object doTopCall(Callable callable, + Context cx, Scriptable scope, + Scriptable thisObj, Object[] args) + { + return callable.call(cx, scope, thisObj, args); + } + + /** + * Implementation of + * {@link Context#observeInstructionCount(int instructionCount)}. + * This can be used to customize {@link Context} without introducing + * additional subclasses. + */ + protected void observeInstructionCount(Context cx, int instructionCount) { + } + + protected void onContextCreated(Context cx) + { + Object listeners = this.listeners; + for (int i = 0; ; ++i) { + Listener l = (Listener)Kit.getListener(listeners, i); + if (l == null) + break; + l.contextCreated(cx); + } + } + + protected void onContextReleased(Context cx) + { + Object listeners = this.listeners; + for (int i = 0; ; ++i) { + Listener l = (Listener)Kit.getListener(listeners, i); + if (l == null) + break; + l.contextReleased(cx); + } + } + + public final void addListener(Listener listener) + { + checkNotSealed(); + synchronized (listenersLock) { + if (disabledListening) { + throw new IllegalStateException(); + } + listeners = Kit.addListener(listeners, listener); + } + } + + public final void removeListener(Listener listener) + { + checkNotSealed(); + synchronized (listenersLock) { + if (disabledListening) { + throw new IllegalStateException(); + } + listeners = Kit.removeListener(listeners, listener); + } + } + + /** + * The method is used only to implement + * Context.disableStaticContextListening() + */ + final void disableContextListening() + { + checkNotSealed(); + synchronized (listenersLock) { + disabledListening = true; + listeners = null; + } + } + + /** + * Checks if this is a sealed ContextFactory. + * @see #seal() + */ + public final boolean isSealed() + { + return sealed; + } + + /** + * Seal this ContextFactory so any attempt to modify it like to add or + * remove its listeners will throw an exception. + * @see #isSealed() + */ + public final void seal() + { + checkNotSealed(); + sealed = true; + } + + protected final void checkNotSealed() + { + if (sealed) throw new IllegalStateException(); + } + + /** + * Call {@link ContextAction#run(Context cx)} + * using the {@link Context} instance associated with the current thread. + * If no Context is associated with the thread, then + * {@link #makeContext()} will be called to construct + * new Context instance. The instance will be temporary associated + * with the thread during call to {@link ContextAction#run(Context)}. + * + * @see ContextFactory#call(ContextAction) + * @see Context#call(ContextFactory factory, Callable callable, + * Scriptable scope, Scriptable thisObj, + * Object[] args) + */ + public final Object call(ContextAction action) + { + return Context.call(this, action); + } + + /** + * Get a context associated with the current thread, creating one if need + * be. The Context stores the execution state of the JavaScript engine, so + * it is required that the context be entered before execution may begin. + * Once a thread has entered a Context, then getCurrentContext() may be + * called to find the context that is associated with the current thread. + *

+ * Calling enterContext() will return either the Context + * currently associated with the thread, or will create a new context and + * associate it with the current thread. Each call to + * enterContext() must have a matching call to + * {@link Context#exit()}. + *

+     *      Context cx = contextFactory.enterContext();
+     *      try {
+     *          ...
+     *          cx.evaluateString(...);
+     *      } finally {
+     *          Context.exit();
+     *      }
+     * 
+ * Instead of using enterContext(), exit() pair consider + * using {@link #call(ContextAction)} which guarantees proper association + * of Context instances with the current thread. + * With this method the above example becomes: + *
+     *      ContextFactory.call(new ContextAction() {
+     *          public Object run(Context cx) {
+     *              ...
+     *              cx.evaluateString(...);
+     *              return null;
+     *          }
+     *      });
+     * 
+ * @return a Context associated with the current thread + * @see Context#getCurrentContext() + * @see Context#exit() + * @see #call(ContextAction) + */ + public Context enterContext() + { + return enterContext(null); + } + + /** + * @deprecated use {@link #enterContext()} instead + * @return a Context associated with the current thread + */ + public final Context enter() + { + return enterContext(null); + } + + /** + * @deprecated Use {@link Context#exit()} instead. + */ + public final void exit() + { + Context.exit(); + } + + /** + * Get a Context associated with the current thread, using the given + * Context if need be. + *

+ * The same as enterContext() except that cx + * is associated with the current thread and returned if the current thread + * has no associated context and cx is not associated with any + * other thread. + * @param cx a Context to associate with the thread if possible + * @return a Context associated with the current thread + * @see #enterContext() + * @see #call(ContextAction) + * @throws IllegalStateException if cx is already associated + * with a different thread + */ + public final Context enterContext(Context cx) + { + return Context.enter(cx, this); + } +} \ No newline at end of file diff --git a/org/mozilla/javascript/ContextListener.java b/org/mozilla/javascript/ContextListener.java new file mode 100644 index 0000000..5e17145 --- /dev/null +++ b/org/mozilla/javascript/ContextListener.java @@ -0,0 +1,60 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-2000 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Norris Boyd + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +// API class + +package org.mozilla.javascript; + +/** + * @deprecated Embeddings that wish to customize newly created + * {@link Context} instances should implement + * {@link ContextFactory.Listener}. + */ +public interface ContextListener extends ContextFactory.Listener +{ + + /** + * @deprecated Rhino runtime never calls the method. + */ + public void contextEntered(Context cx); + + /** + * @deprecated Rhino runtime never calls the method. + */ + public void contextExited(Context cx); +} diff --git a/org/mozilla/javascript/ContinuationPending.java b/org/mozilla/javascript/ContinuationPending.java new file mode 100644 index 0000000..deff4f6 --- /dev/null +++ b/org/mozilla/javascript/ContinuationPending.java @@ -0,0 +1,99 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-1999 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Norris Boyd + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +package org.mozilla.javascript; + +/** + * Exception thrown by + * {@link org.mozilla.javascript.Context#executeScriptWithContinuations(Script, Scriptable)} + * and {@link org.mozilla.javascript.Context#callFunctionWithContinuations(Callable, Scriptable, Object[])} + * when execution encounters a continuation captured by + * {@link org.mozilla.javascript.Context#captureContinuation()}. + * Exception will contain the captured state needed to restart the continuation + * with {@link org.mozilla.javascript.Context#resumeContinuation(Object, Scriptable, Object)}. + * @author Norris Boyd + */ +public class ContinuationPending extends RuntimeException { + private static final long serialVersionUID = 4956008116771118856L; + private NativeContinuation continuationState; + private Object applicationState; + + /** + * Construct a ContinuationPending exception. Internal call only; + * users of the API should get continuations created on their behalf by + * calling {@link org.mozilla.javascript.Context#executeScriptWithContinuations(Script, Scriptable)} + * and {@link org.mozilla.javascript.Context#callFunctionWithContinuations(Callable, Scriptable, Object[])} + * @param continuationState Internal Continuation object + */ + ContinuationPending(NativeContinuation continuationState) { + this.continuationState = continuationState; + } + + /** + * Get continuation object. The only + * use for this object is to be passed to + * {@link org.mozilla.javascript.Context#resumeContinuation(Object, Scriptable, Object)}. + * @return continuation object + */ + public Object getContinuation() { + return continuationState; + } + + /** + * @return internal continuation state + */ + NativeContinuation getContinuationState() { + return continuationState; + } + + /** + * Store an arbitrary object that applications can use to associate + * their state with the continuation. + * @param applicationState arbitrary application state + */ + public void setApplicationState(Object applicationState) { + this.applicationState = applicationState; + } + + /** + * @return arbitrary application state + */ + public Object getApplicationState() { + return applicationState; + } +} diff --git a/org/mozilla/javascript/DToA.java b/org/mozilla/javascript/DToA.java new file mode 100644 index 0000000..ad2a68a --- /dev/null +++ b/org/mozilla/javascript/DToA.java @@ -0,0 +1,1271 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-1999 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Waldemar Horwat + * Roger Lawrence + * Attila Szegedi + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +/**************************************************************** + * + * The author of this software is David M. Gay. + * + * Copyright (c) 1991, 2000, 2001 by Lucent Technologies. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose without fee is hereby granted, provided that this entire notice + * is included in all copies of any software which is or includes a copy + * or modification of this software and in all copies of the supporting + * documentation for such software. + * + * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED + * WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR LUCENT MAKES ANY + * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY + * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. + * + ***************************************************************/ + +package org.mozilla.javascript; + +import java.math.BigInteger; + +class DToA { + + +/* "-0.0000...(1073 zeros after decimal point)...0001\0" is the longest string that we could produce, + * which occurs when printing -5e-324 in binary. We could compute a better estimate of the size of + * the output string and malloc fewer bytes depending on d and base, but why bother? */ + + private static final int DTOBASESTR_BUFFER_SIZE = 1078; + + private static char BASEDIGIT(int digit) { + return (char)((digit >= 10) ? 'a' - 10 + digit : '0' + digit); + } + + static final int + DTOSTR_STANDARD = 0, /* Either fixed or exponential format; round-trip */ + DTOSTR_STANDARD_EXPONENTIAL = 1, /* Always exponential format; round-trip */ + DTOSTR_FIXED = 2, /* Round to digits after the decimal point; exponential if number is large */ + DTOSTR_EXPONENTIAL = 3, /* Always exponential format; significant digits */ + DTOSTR_PRECISION = 4; /* Either fixed or exponential format; significant digits */ + + + private static final int Frac_mask = 0xfffff; + private static final int Exp_shift = 20; + private static final int Exp_msk1 = 0x100000; + + private static final long Frac_maskL = 0xfffffffffffffL; + private static final int Exp_shiftL = 52; + private static final long Exp_msk1L = 0x10000000000000L; + + private static final int Bias = 1023; + private static final int P = 53; + + private static final int Exp_shift1 = 20; + private static final int Exp_mask = 0x7ff00000; + private static final int Exp_mask_shifted = 0x7ff; + private static final int Bndry_mask = 0xfffff; + private static final int Log2P = 1; + + private static final int Sign_bit = 0x80000000; + private static final int Exp_11 = 0x3ff00000; + private static final int Ten_pmax = 22; + private static final int Quick_max = 14; + private static final int Bletch = 0x10; + private static final int Frac_mask1 = 0xfffff; + private static final int Int_max = 14; + private static final int n_bigtens = 5; + + + private static final double tens[] = { + 1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, + 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19, + 1e20, 1e21, 1e22 + }; + + private static final double bigtens[] = { 1e16, 1e32, 1e64, 1e128, 1e256 }; + + private static int lo0bits(int y) + { + int k; + int x = y; + + if ((x & 7) != 0) { + if ((x & 1) != 0) + return 0; + if ((x & 2) != 0) { + return 1; + } + return 2; + } + k = 0; + if ((x & 0xffff) == 0) { + k = 16; + x >>>= 16; + } + if ((x & 0xff) == 0) { + k += 8; + x >>>= 8; + } + if ((x & 0xf) == 0) { + k += 4; + x >>>= 4; + } + if ((x & 0x3) == 0) { + k += 2; + x >>>= 2; + } + if ((x & 1) == 0) { + k++; + x >>>= 1; + if ((x & 1) == 0) + return 32; + } + return k; + } + + /* Return the number (0 through 32) of most significant zero bits in x. */ + private static int hi0bits(int x) + { + int k = 0; + + if ((x & 0xffff0000) == 0) { + k = 16; + x <<= 16; + } + if ((x & 0xff000000) == 0) { + k += 8; + x <<= 8; + } + if ((x & 0xf0000000) == 0) { + k += 4; + x <<= 4; + } + if ((x & 0xc0000000) == 0) { + k += 2; + x <<= 2; + } + if ((x & 0x80000000) == 0) { + k++; + if ((x & 0x40000000) == 0) + return 32; + } + return k; + } + + private static void stuffBits(byte bits[], int offset, int val) + { + bits[offset] = (byte)(val >> 24); + bits[offset + 1] = (byte)(val >> 16); + bits[offset + 2] = (byte)(val >> 8); + bits[offset + 3] = (byte)(val); + } + + /* Convert d into the form b*2^e, where b is an odd integer. b is the returned + * Bigint and e is the returned binary exponent. Return the number of significant + * bits in b in bits. d must be finite and nonzero. */ + private static BigInteger d2b(double d, int[] e, int[] bits) + { + byte dbl_bits[]; + int i, k, y, z, de; + long dBits = Double.doubleToLongBits(d); + int d0 = (int)(dBits >>> 32); + int d1 = (int)(dBits); + + z = d0 & Frac_mask; + d0 &= 0x7fffffff; /* clear sign bit, which we ignore */ + + if ((de = (d0 >>> Exp_shift)) != 0) + z |= Exp_msk1; + + if ((y = d1) != 0) { + dbl_bits = new byte[8]; + k = lo0bits(y); + y >>>= k; + if (k != 0) { + stuffBits(dbl_bits, 4, y | z << (32 - k)); + z >>= k; + } + else + stuffBits(dbl_bits, 4, y); + stuffBits(dbl_bits, 0, z); + i = (z != 0) ? 2 : 1; + } + else { + // JS_ASSERT(z); + dbl_bits = new byte[4]; + k = lo0bits(z); + z >>>= k; + stuffBits(dbl_bits, 0, z); + k += 32; + i = 1; + } + if (de != 0) { + e[0] = de - Bias - (P-1) + k; + bits[0] = P - k; + } + else { + e[0] = de - Bias - (P-1) + 1 + k; + bits[0] = 32*i - hi0bits(z); + } + return new BigInteger(dbl_bits); + } + + static String JS_dtobasestr(int base, double d) + { + if (!(2 <= base && base <= 36)) + throw new IllegalArgumentException("Bad base: "+base); + + /* Check for Infinity and NaN */ + if (Double.isNaN(d)) { + return "NaN"; + } else if (Double.isInfinite(d)) { + return (d > 0.0) ? "Infinity" : "-Infinity"; + } else if (d == 0) { + // ALERT: should it distinguish -0.0 from +0.0 ? + return "0"; + } + + boolean negative; + if (d >= 0.0) { + negative = false; + } else { + negative = true; + d = -d; + } + + /* Get the integer part of d including '-' sign. */ + String intDigits; + + double dfloor = Math.floor(d); + long lfloor = (long)dfloor; + if (lfloor == dfloor) { + // int part fits long + intDigits = Long.toString((negative) ? -lfloor : lfloor, base); + } else { + // BigInteger should be used + long floorBits = Double.doubleToLongBits(dfloor); + int exp = (int)(floorBits >> Exp_shiftL) & Exp_mask_shifted; + long mantissa; + if (exp == 0) { + mantissa = (floorBits & Frac_maskL) << 1; + } else { + mantissa = (floorBits & Frac_maskL) | Exp_msk1L; + } + if (negative) { + mantissa = -mantissa; + } + exp -= 1075; + BigInteger x = BigInteger.valueOf(mantissa); + if (exp > 0) { + x = x.shiftLeft(exp); + } else if (exp < 0) { + x = x.shiftRight(-exp); + } + intDigits = x.toString(base); + } + + if (d == dfloor) { + // No fraction part + return intDigits; + } else { + /* We have a fraction. */ + + char[] buffer; /* The output string */ + int p; /* index to current position in the buffer */ + int digit; + double df; /* The fractional part of d */ + BigInteger b; + + buffer = new char[DTOBASESTR_BUFFER_SIZE]; + p = 0; + df = d - dfloor; + + long dBits = Double.doubleToLongBits(d); + int word0 = (int)(dBits >> 32); + int word1 = (int)(dBits); + + int[] e = new int[1]; + int[] bbits = new int[1]; + + b = d2b(df, e, bbits); +// JS_ASSERT(e < 0); + /* At this point df = b * 2^e. e must be less than zero because 0 < df < 1. */ + + int s2 = -(word0 >>> Exp_shift1 & Exp_mask >> Exp_shift1); + if (s2 == 0) + s2 = -1; + s2 += Bias + P; + /* 1/2^s2 = (nextDouble(d) - d)/2 */ +// JS_ASSERT(-s2 < e); + BigInteger mlo = BigInteger.valueOf(1); + BigInteger mhi = mlo; + if ((word1 == 0) && ((word0 & Bndry_mask) == 0) + && ((word0 & (Exp_mask & Exp_mask << 1)) != 0)) { + /* The special case. Here we want to be within a quarter of the last input + significant digit instead of one half of it when the output string's value is less than d. */ + s2 += Log2P; + mhi = BigInteger.valueOf(1< df = b/2^s2 > 0; + * (d - prevDouble(d))/2 = mlo/2^s2; + * (nextDouble(d) - d)/2 = mhi/2^s2. */ + BigInteger bigBase = BigInteger.valueOf(base); + + boolean done = false; + do { + b = b.multiply(bigBase); + BigInteger[] divResult = b.divideAndRemainder(s); + b = divResult[1]; + digit = (char)(divResult[0].intValue()); + if (mlo == mhi) + mlo = mhi = mlo.multiply(bigBase); + else { + mlo = mlo.multiply(bigBase); + mhi = mhi.multiply(bigBase); + } + + /* Do we yet have the shortest string that will round to d? */ + int j = b.compareTo(mlo); + /* j is b/2^s2 compared with mlo/2^s2. */ + BigInteger delta = s.subtract(mhi); + int j1 = (delta.signum() <= 0) ? 1 : b.compareTo(delta); + /* j1 is b/2^s2 compared with 1 - mhi/2^s2. */ + if (j1 == 0 && ((word1 & 1) == 0)) { + if (j > 0) + digit++; + done = true; + } else + if (j < 0 || (j == 0 && ((word1 & 1) == 0))) { + if (j1 > 0) { + /* Either dig or dig+1 would work here as the least significant digit. + Use whichever would produce an output value closer to d. */ + b = b.shiftLeft(1); + j1 = b.compareTo(s); + if (j1 > 0) /* The even test (|| (j1 == 0 && (digit & 1))) is not here because it messes up odd base output + * such as 3.5 in base 3. */ + digit++; + } + done = true; + } else if (j1 > 0) { + digit++; + done = true; + } +// JS_ASSERT(digit < (uint32)base); + buffer[p++] = BASEDIGIT(digit); + } while (!done); + + StringBuffer sb = new StringBuffer(intDigits.length() + 1 + p); + sb.append(intDigits); + sb.append('.'); + sb.append(buffer, 0, p); + return sb.toString(); + } + + } + + /* dtoa for IEEE arithmetic (dmg): convert double to ASCII string. + * + * Inspired by "How to Print Floating-Point Numbers Accurately" by + * Guy L. Steele, Jr. and Jon L. White [Proc. ACM SIGPLAN '90, pp. 92-101]. + * + * Modifications: + * 1. Rather than iterating, we use a simple numeric overestimate + * to determine k = floor(log10(d)). We scale relevant + * quantities using O(log2(k)) rather than O(k) multiplications. + * 2. For some modes > 2 (corresponding to ecvt and fcvt), we don't + * try to generate digits strictly left to right. Instead, we + * compute with fewer bits and propagate the carry if necessary + * when rounding the final digit up. This is often faster. + * 3. Under the assumption that input will be rounded nearest, + * mode 0 renders 1e23 as 1e23 rather than 9.999999999999999e22. + * That is, we allow equality in stopping tests when the + * round-nearest rule will give the same floating-point value + * as would satisfaction of the stopping test with strict + * inequality. + * 4. We remove common factors of powers of 2 from relevant + * quantities. + * 5. When converting floating-point integers less than 1e16, + * we use floating-point arithmetic rather than resorting + * to multiple-precision integers. + * 6. When asked to produce fewer than 15 digits, we first try + * to get by with floating-point arithmetic; we resort to + * multiple-precision integer arithmetic only if we cannot + * guarantee that the floating-point calculation has given + * the correctly rounded result. For k requested digits and + * "uniformly" distributed input, the probability is + * something like 10^(k-15) that we must resort to the Long + * calculation. + */ + + static int word0(double d) + { + long dBits = Double.doubleToLongBits(d); + return (int)(dBits >> 32); + } + + static double setWord0(double d, int i) + { + long dBits = Double.doubleToLongBits(d); + dBits = ((long)i << 32) | (dBits & 0x0FFFFFFFFL); + return Double.longBitsToDouble(dBits); + } + + static int word1(double d) + { + long dBits = Double.doubleToLongBits(d); + return (int)(dBits); + } + + /* Return b * 5^k. k must be nonnegative. */ + // XXXX the C version built a cache of these + static BigInteger pow5mult(BigInteger b, int k) + { + return b.multiply(BigInteger.valueOf(5).pow(k)); + } + + static boolean roundOff(StringBuffer buf) + { + int i = buf.length(); + while (i != 0) { + --i; + char c = buf.charAt(i); + if (c != '9') { + buf.setCharAt(i, (char)(c + 1)); + buf.setLength(i + 1); + return false; + } + } + buf.setLength(0); + return true; + } + + /* Always emits at least one digit. */ + /* If biasUp is set, then rounding in modes 2 and 3 will round away from zero + * when the number is exactly halfway between two representable values. For example, + * rounding 2.5 to zero digits after the decimal point will return 3 and not 2. + * 2.49 will still round to 2, and 2.51 will still round to 3. */ + /* bufsize should be at least 20 for modes 0 and 1. For the other modes, + * bufsize should be two greater than the maximum number of output characters expected. */ + static int + JS_dtoa(double d, int mode, boolean biasUp, int ndigits, + boolean[] sign, StringBuffer buf) + { + /* Arguments ndigits, decpt, sign are similar to those + of ecvt and fcvt; trailing zeros are suppressed from + the returned string. If not null, *rve is set to point + to the end of the return value. If d is +-Infinity or NaN, + then *decpt is set to 9999. + + mode: + 0 ==> shortest string that yields d when read in + and rounded to nearest. + 1 ==> like 0, but with Steele & White stopping rule; + e.g. with IEEE P754 arithmetic , mode 0 gives + 1e23 whereas mode 1 gives 9.999999999999999e22. + 2 ==> max(1,ndigits) significant digits. This gives a + return value similar to that of ecvt, except + that trailing zeros are suppressed. + 3 ==> through ndigits past the decimal point. This + gives a return value similar to that from fcvt, + except that trailing zeros are suppressed, and + ndigits can be negative. + 4-9 should give the same return values as 2-3, i.e., + 4 <= mode <= 9 ==> same return as mode + 2 + (mode & 1). These modes are mainly for + debugging; often they run slower but sometimes + faster than modes 2-3. + 4,5,8,9 ==> left-to-right digit generation. + 6-9 ==> don't try fast floating-point estimate + (if applicable). + + Values of mode other than 0-9 are treated as mode 0. + + Sufficient space is allocated to the return value + to hold the suppressed trailing zeros. + */ + + int b2, b5, i, ieps, ilim, ilim0, ilim1, + j, j1, k, k0, m2, m5, s2, s5; + char dig; + long L; + long x; + BigInteger b, b1, delta, mlo, mhi, S; + int[] be = new int[1]; + int[] bbits = new int[1]; + double d2, ds, eps; + boolean spec_case, denorm, k_check, try_quick, leftright; + + if ((word0(d) & Sign_bit) != 0) { + /* set sign for everything, including 0's and NaNs */ + sign[0] = true; + // word0(d) &= ~Sign_bit; /* clear sign bit */ + d = setWord0(d, word0(d) & ~Sign_bit); + } + else + sign[0] = false; + + if ((word0(d) & Exp_mask) == Exp_mask) { + /* Infinity or NaN */ + buf.append(((word1(d) == 0) && ((word0(d) & Frac_mask) == 0)) ? "Infinity" : "NaN"); + return 9999; + } + if (d == 0) { +// no_digits: + buf.setLength(0); + buf.append('0'); /* copy "0" to buffer */ + return 1; + } + + b = d2b(d, be, bbits); + if ((i = (word0(d) >>> Exp_shift1 & (Exp_mask>>Exp_shift1))) != 0) { + d2 = setWord0(d, (word0(d) & Frac_mask1) | Exp_11); + /* log(x) ~=~ log(1.5) + (x-1.5)/1.5 + * log10(x) = log(x) / log(10) + * ~=~ log(1.5)/log(10) + (x-1.5)/(1.5*log(10)) + * log10(d) = (i-Bias)*log(2)/log(10) + log10(d2) + * + * This suggests computing an approximation k to log10(d) by + * + * k = (i - Bias)*0.301029995663981 + * + ( (d2-1.5)*0.289529654602168 + 0.176091259055681 ); + * + * We want k to be too large rather than too small. + * The error in the first-order Taylor series approximation + * is in our favor, so we just round up the constant enough + * to compensate for any error in the multiplication of + * (i - Bias) by 0.301029995663981; since |i - Bias| <= 1077, + * and 1077 * 0.30103 * 2^-52 ~=~ 7.2e-14, + * adding 1e-13 to the constant term more than suffices. + * Hence we adjust the constant term to 0.1760912590558. + * (We could get a more accurate k by invoking log10, + * but this is probably not worthwhile.) + */ + i -= Bias; + denorm = false; + } + else { + /* d is denormalized */ + i = bbits[0] + be[0] + (Bias + (P-1) - 1); + x = (i > 32) ? word0(d) << (64 - i) | word1(d) >>> (i - 32) : word1(d) << (32 - i); +// d2 = x; +// word0(d2) -= 31*Exp_msk1; /* adjust exponent */ + d2 = setWord0(x, word0(x) - 31*Exp_msk1); + i -= (Bias + (P-1) - 1) + 1; + denorm = true; + } + /* At this point d = f*2^i, where 1 <= f < 2. d2 is an approximation of f. */ + ds = (d2-1.5)*0.289529654602168 + 0.1760912590558 + i*0.301029995663981; + k = (int)ds; + if (ds < 0.0 && ds != k) + k--; /* want k = floor(ds) */ + k_check = true; + if (k >= 0 && k <= Ten_pmax) { + if (d < tens[k]) + k--; + k_check = false; + } + /* At this point floor(log10(d)) <= k <= floor(log10(d))+1. + If k_check is zero, we're guaranteed that k = floor(log10(d)). */ + j = bbits[0] - i - 1; + /* At this point d = b/2^j, where b is an odd integer. */ + if (j >= 0) { + b2 = 0; + s2 = j; + } + else { + b2 = -j; + s2 = 0; + } + if (k >= 0) { + b5 = 0; + s5 = k; + s2 += k; + } + else { + b2 -= k; + b5 = -k; + s5 = 0; + } + /* At this point d/10^k = (b * 2^b2 * 5^b5) / (2^s2 * 5^s5), where b is an odd integer, + b2 >= 0, b5 >= 0, s2 >= 0, and s5 >= 0. */ + if (mode < 0 || mode > 9) + mode = 0; + try_quick = true; + if (mode > 5) { + mode -= 4; + try_quick = false; + } + leftright = true; + ilim = ilim1 = 0; + switch(mode) { + case 0: + case 1: + ilim = ilim1 = -1; + i = 18; + ndigits = 0; + break; + case 2: + leftright = false; + /* no break */ + case 4: + if (ndigits <= 0) + ndigits = 1; + ilim = ilim1 = i = ndigits; + break; + case 3: + leftright = false; + /* no break */ + case 5: + i = ndigits + k + 1; + ilim = i; + ilim1 = i - 1; + if (i <= 0) + i = 1; + } + /* ilim is the maximum number of significant digits we want, based on k and ndigits. */ + /* ilim1 is the maximum number of significant digits we want, based on k and ndigits, + when it turns out that k was computed too high by one. */ + + boolean fast_failed = false; + if (ilim >= 0 && ilim <= Quick_max && try_quick) { + + /* Try to get by with floating-point arithmetic. */ + + i = 0; + d2 = d; + k0 = k; + ilim0 = ilim; + ieps = 2; /* conservative */ + /* Divide d by 10^k, keeping track of the roundoff error and avoiding overflows. */ + if (k > 0) { + ds = tens[k&0xf]; + j = k >> 4; + if ((j & Bletch) != 0) { + /* prevent overflows */ + j &= Bletch - 1; + d /= bigtens[n_bigtens-1]; + ieps++; + } + for(; (j != 0); j >>= 1, i++) + if ((j & 1) != 0) { + ieps++; + ds *= bigtens[i]; + } + d /= ds; + } + else if ((j1 = -k) != 0) { + d *= tens[j1 & 0xf]; + for(j = j1 >> 4; (j != 0); j >>= 1, i++) + if ((j & 1) != 0) { + ieps++; + d *= bigtens[i]; + } + } + /* Check that k was computed correctly. */ + if (k_check && d < 1.0 && ilim > 0) { + if (ilim1 <= 0) + fast_failed = true; + else { + ilim = ilim1; + k--; + d *= 10.; + ieps++; + } + } + /* eps bounds the cumulative error. */ +// eps = ieps*d + 7.0; +// word0(eps) -= (P-1)*Exp_msk1; + eps = ieps*d + 7.0; + eps = setWord0(eps, word0(eps) - (P-1)*Exp_msk1); + if (ilim == 0) { + S = mhi = null; + d -= 5.0; + if (d > eps) { + buf.append('1'); + k++; + return k + 1; + } + if (d < -eps) { + buf.setLength(0); + buf.append('0'); /* copy "0" to buffer */ + return 1; + } + fast_failed = true; + } + if (!fast_failed) { + fast_failed = true; + if (leftright) { + /* Use Steele & White method of only + * generating digits needed. + */ + eps = 0.5/tens[ilim-1] - eps; + for(i = 0;;) { + L = (long)d; + d -= L; + buf.append((char)('0' + L)); + if (d < eps) { + return k + 1; + } + if (1.0 - d < eps) { +// goto bump_up; + char lastCh; + while (true) { + lastCh = buf.charAt(buf.length() - 1); + buf.setLength(buf.length() - 1); + if (lastCh != '9') break; + if (buf.length() == 0) { + k++; + lastCh = '0'; + break; + } + } + buf.append((char)(lastCh + 1)); + return k + 1; + } + if (++i >= ilim) + break; + eps *= 10.0; + d *= 10.0; + } + } + else { + /* Generate ilim digits, then fix them up. */ + eps *= tens[ilim-1]; + for(i = 1;; i++, d *= 10.0) { + L = (long)d; + d -= L; + buf.append((char)('0' + L)); + if (i == ilim) { + if (d > 0.5 + eps) { +// goto bump_up; + char lastCh; + while (true) { + lastCh = buf.charAt(buf.length() - 1); + buf.setLength(buf.length() - 1); + if (lastCh != '9') break; + if (buf.length() == 0) { + k++; + lastCh = '0'; + break; + } + } + buf.append((char)(lastCh + 1)); + return k + 1; + } + else + if (d < 0.5 - eps) { + stripTrailingZeroes(buf); +// while(*--s == '0') ; +// s++; + return k + 1; + } + break; + } + } + } + } + if (fast_failed) { + buf.setLength(0); + d = d2; + k = k0; + ilim = ilim0; + } + } + + /* Do we have a "small" integer? */ + + if (be[0] >= 0 && k <= Int_max) { + /* Yes. */ + ds = tens[k]; + if (ndigits < 0 && ilim <= 0) { + S = mhi = null; + if (ilim < 0 || d < 5*ds || (!biasUp && d == 5*ds)) { + buf.setLength(0); + buf.append('0'); /* copy "0" to buffer */ + return 1; + } + buf.append('1'); + k++; + return k + 1; + } + for(i = 1;; i++) { + L = (long) (d / ds); + d -= L*ds; + buf.append((char)('0' + L)); + if (i == ilim) { + d += d; + if ((d > ds) || (d == ds && (((L & 1) != 0) || biasUp))) { +// bump_up: +// while(*--s == '9') +// if (s == buf) { +// k++; +// *s = '0'; +// break; +// } +// ++*s++; + char lastCh; + while (true) { + lastCh = buf.charAt(buf.length() - 1); + buf.setLength(buf.length() - 1); + if (lastCh != '9') break; + if (buf.length() == 0) { + k++; + lastCh = '0'; + break; + } + } + buf.append((char)(lastCh + 1)); + } + break; + } + d *= 10.0; + if (d == 0) + break; + } + return k + 1; + } + + m2 = b2; + m5 = b5; + mhi = mlo = null; + if (leftright) { + if (mode < 2) { + i = (denorm) ? be[0] + (Bias + (P-1) - 1 + 1) : 1 + P - bbits[0]; + /* i is 1 plus the number of trailing zero bits in d's significand. Thus, + (2^m2 * 5^m5) / (2^(s2+i) * 5^s5) = (1/2 lsb of d)/10^k. */ + } + else { + j = ilim - 1; + if (m5 >= j) + m5 -= j; + else { + s5 += j -= m5; + b5 += j; + m5 = 0; + } + if ((i = ilim) < 0) { + m2 -= i; + i = 0; + } + /* (2^m2 * 5^m5) / (2^(s2+i) * 5^s5) = (1/2 * 10^(1-ilim))/10^k. */ + } + b2 += i; + s2 += i; + mhi = BigInteger.valueOf(1); + /* (mhi * 2^m2 * 5^m5) / (2^s2 * 5^s5) = one-half of last printed (when mode >= 2) or + input (when mode < 2) significant digit, divided by 10^k. */ + } + /* We still have d/10^k = (b * 2^b2 * 5^b5) / (2^s2 * 5^s5). Reduce common factors in + b2, m2, and s2 without changing the equalities. */ + if (m2 > 0 && s2 > 0) { + i = (m2 < s2) ? m2 : s2; + b2 -= i; + m2 -= i; + s2 -= i; + } + + /* Fold b5 into b and m5 into mhi. */ + if (b5 > 0) { + if (leftright) { + if (m5 > 0) { + mhi = pow5mult(mhi, m5); + b1 = mhi.multiply(b); + b = b1; + } + if ((j = b5 - m5) != 0) + b = pow5mult(b, j); + } + else + b = pow5mult(b, b5); + } + /* Now we have d/10^k = (b * 2^b2) / (2^s2 * 5^s5) and + (mhi * 2^m2) / (2^s2 * 5^s5) = one-half of last printed or input significant digit, divided by 10^k. */ + + S = BigInteger.valueOf(1); + if (s5 > 0) + S = pow5mult(S, s5); + /* Now we have d/10^k = (b * 2^b2) / (S * 2^s2) and + (mhi * 2^m2) / (S * 2^s2) = one-half of last printed or input significant digit, divided by 10^k. */ + + /* Check for special case that d is a normalized power of 2. */ + spec_case = false; + if (mode < 2) { + if ( (word1(d) == 0) && ((word0(d) & Bndry_mask) == 0) + && ((word0(d) & (Exp_mask & Exp_mask << 1)) != 0) + ) { + /* The special case. Here we want to be within a quarter of the last input + significant digit instead of one half of it when the decimal output string's value is less than d. */ + b2 += Log2P; + s2 += Log2P; + spec_case = true; + } + } + + /* Arrange for convenient computation of quotients: + * shift left if necessary so divisor has 4 leading 0 bits. + * + * Perhaps we should just compute leading 28 bits of S once + * and for all and pass them and a shift to quorem, so it + * can do shifts and ors to compute the numerator for q. + */ + byte [] S_bytes = S.toByteArray(); + int S_hiWord = 0; + for (int idx = 0; idx < 4; idx++) { + S_hiWord = (S_hiWord << 8); + if (idx < S_bytes.length) + S_hiWord |= (S_bytes[idx] & 0xFF); + } + if ((i = (((s5 != 0) ? 32 - hi0bits(S_hiWord) : 1) + s2) & 0x1f) != 0) + i = 32 - i; + /* i is the number of leading zero bits in the most significant word of S*2^s2. */ + if (i > 4) { + i -= 4; + b2 += i; + m2 += i; + s2 += i; + } + else if (i < 4) { + i += 28; + b2 += i; + m2 += i; + s2 += i; + } + /* Now S*2^s2 has exactly four leading zero bits in its most significant word. */ + if (b2 > 0) + b = b.shiftLeft(b2); + if (s2 > 0) + S = S.shiftLeft(s2); + /* Now we have d/10^k = b/S and + (mhi * 2^m2) / S = maximum acceptable error, divided by 10^k. */ + if (k_check) { + if (b.compareTo(S) < 0) { + k--; + b = b.multiply(BigInteger.valueOf(10)); /* we botched the k estimate */ + if (leftright) + mhi = mhi.multiply(BigInteger.valueOf(10)); + ilim = ilim1; + } + } + /* At this point 1 <= d/10^k = b/S < 10. */ + + if (ilim <= 0 && mode > 2) { + /* We're doing fixed-mode output and d is less than the minimum nonzero output in this mode. + Output either zero or the minimum nonzero output depending on which is closer to d. */ + if ((ilim < 0 ) + || ((i = b.compareTo(S = S.multiply(BigInteger.valueOf(5)))) < 0) + || ((i == 0 && !biasUp))) { + /* Always emit at least one digit. If the number appears to be zero + using the current mode, then emit one '0' digit and set decpt to 1. */ + /*no_digits: + k = -1 - ndigits; + goto ret; */ + buf.setLength(0); + buf.append('0'); /* copy "0" to buffer */ + return 1; +// goto no_digits; + } +// one_digit: + buf.append('1'); + k++; + return k + 1; + } + if (leftright) { + if (m2 > 0) + mhi = mhi.shiftLeft(m2); + + /* Compute mlo -- check for special case + * that d is a normalized power of 2. + */ + + mlo = mhi; + if (spec_case) { + mhi = mlo; + mhi = mhi.shiftLeft(Log2P); + } + /* mlo/S = maximum acceptable error, divided by 10^k, if the output is less than d. */ + /* mhi/S = maximum acceptable error, divided by 10^k, if the output is greater than d. */ + + for(i = 1;;i++) { + BigInteger[] divResult = b.divideAndRemainder(S); + b = divResult[1]; + dig = (char)(divResult[0].intValue() + '0'); + /* Do we yet have the shortest decimal string + * that will round to d? + */ + j = b.compareTo(mlo); + /* j is b/S compared with mlo/S. */ + delta = S.subtract(mhi); + j1 = (delta.signum() <= 0) ? 1 : b.compareTo(delta); + /* j1 is b/S compared with 1 - mhi/S. */ + if ((j1 == 0) && (mode == 0) && ((word1(d) & 1) == 0)) { + if (dig == '9') { + buf.append('9'); + if (roundOff(buf)) { + k++; + buf.append('1'); + } + return k + 1; +// goto round_9_up; + } + if (j > 0) + dig++; + buf.append(dig); + return k + 1; + } + if ((j < 0) + || ((j == 0) + && (mode == 0) + && ((word1(d) & 1) == 0) + )) { + if (j1 > 0) { + /* Either dig or dig+1 would work here as the least significant decimal digit. + Use whichever would produce a decimal value closer to d. */ + b = b.shiftLeft(1); + j1 = b.compareTo(S); + if (((j1 > 0) || (j1 == 0 && (((dig & 1) == 1) || biasUp))) + && (dig++ == '9')) { + buf.append('9'); + if (roundOff(buf)) { + k++; + buf.append('1'); + } + return k + 1; +// goto round_9_up; + } + } + buf.append(dig); + return k + 1; + } + if (j1 > 0) { + if (dig == '9') { /* possible if i == 1 */ +// round_9_up: +// *s++ = '9'; +// goto roundoff; + buf.append('9'); + if (roundOff(buf)) { + k++; + buf.append('1'); + } + return k + 1; + } + buf.append((char)(dig + 1)); + return k + 1; + } + buf.append(dig); + if (i == ilim) + break; + b = b.multiply(BigInteger.valueOf(10)); + if (mlo == mhi) + mlo = mhi = mhi.multiply(BigInteger.valueOf(10)); + else { + mlo = mlo.multiply(BigInteger.valueOf(10)); + mhi = mhi.multiply(BigInteger.valueOf(10)); + } + } + } + else + for(i = 1;; i++) { +// (char)(dig = quorem(b,S) + '0'); + BigInteger[] divResult = b.divideAndRemainder(S); + b = divResult[1]; + dig = (char)(divResult[0].intValue() + '0'); + buf.append(dig); + if (i >= ilim) + break; + b = b.multiply(BigInteger.valueOf(10)); + } + + /* Round off last digit */ + + b = b.shiftLeft(1); + j = b.compareTo(S); + if ((j > 0) || (j == 0 && (((dig & 1) == 1) || biasUp))) { +// roundoff: +// while(*--s == '9') +// if (s == buf) { +// k++; +// *s++ = '1'; +// goto ret; +// } +// ++*s++; + if (roundOff(buf)) { + k++; + buf.append('1'); + return k + 1; + } + } + else { + stripTrailingZeroes(buf); +// while(*--s == '0') ; +// s++; + } +// ret: +// Bfree(S); +// if (mhi) { +// if (mlo && mlo != mhi) +// Bfree(mlo); +// Bfree(mhi); +// } +// ret1: +// Bfree(b); +// JS_ASSERT(s < buf + bufsize); + return k + 1; + } + + private static void + stripTrailingZeroes(StringBuffer buf) + { +// while(*--s == '0') ; +// s++; + int bl = buf.length(); + while(bl-->0 && buf.charAt(bl) == '0') { + // empty + } + buf.setLength(bl + 1); + } + + /* Mapping of JSDToStrMode -> JS_dtoa mode */ + private static final int dtoaModes[] = { + 0, /* DTOSTR_STANDARD */ + 0, /* DTOSTR_STANDARD_EXPONENTIAL, */ + 3, /* DTOSTR_FIXED, */ + 2, /* DTOSTR_EXPONENTIAL, */ + 2}; /* DTOSTR_PRECISION */ + + static void + JS_dtostr(StringBuffer buffer, int mode, int precision, double d) + { + int decPt; /* Position of decimal point relative to first digit returned by JS_dtoa */ + boolean[] sign = new boolean[1]; /* true if the sign bit was set in d */ + int nDigits; /* Number of significand digits returned by JS_dtoa */ + +// JS_ASSERT(bufferSize >= (size_t)(mode <= DTOSTR_STANDARD_EXPONENTIAL ? DTOSTR_STANDARD_BUFFER_SIZE : +// DTOSTR_VARIABLE_BUFFER_SIZE(precision))); + + if (mode == DTOSTR_FIXED && (d >= 1e21 || d <= -1e21)) + mode = DTOSTR_STANDARD; /* Change mode here rather than below because the buffer may not be large enough to hold a large integer. */ + + decPt = JS_dtoa(d, dtoaModes[mode], mode >= DTOSTR_FIXED, precision, sign, buffer); + nDigits = buffer.length(); + + /* If Infinity, -Infinity, or NaN, return the string regardless of the mode. */ + if (decPt != 9999) { + boolean exponentialNotation = false; + int minNDigits = 0; /* Minimum number of significand digits required by mode and precision */ + int p; + + switch (mode) { + case DTOSTR_STANDARD: + if (decPt < -5 || decPt > 21) + exponentialNotation = true; + else + minNDigits = decPt; + break; + + case DTOSTR_FIXED: + if (precision >= 0) + minNDigits = decPt + precision; + else + minNDigits = decPt; + break; + + case DTOSTR_EXPONENTIAL: +// JS_ASSERT(precision > 0); + minNDigits = precision; + /* Fall through */ + case DTOSTR_STANDARD_EXPONENTIAL: + exponentialNotation = true; + break; + + case DTOSTR_PRECISION: +// JS_ASSERT(precision > 0); + minNDigits = precision; + if (decPt < -5 || decPt > precision) + exponentialNotation = true; + break; + } + + /* If the number has fewer than minNDigits, pad it with zeros at the end */ + if (nDigits < minNDigits) { + p = minNDigits; + nDigits = minNDigits; + do { + buffer.append('0'); + } while (buffer.length() != p); + } + + if (exponentialNotation) { + /* Insert a decimal point if more than one significand digit */ + if (nDigits != 1) { + buffer.insert(1, '.'); + } + buffer.append('e'); + if ((decPt - 1) >= 0) + buffer.append('+'); + buffer.append(decPt - 1); +// JS_snprintf(numEnd, bufferSize - (numEnd - buffer), "e%+d", decPt-1); + } else if (decPt != nDigits) { + /* Some kind of a fraction in fixed notation */ +// JS_ASSERT(decPt <= nDigits); + if (decPt > 0) { + /* dd...dd . dd...dd */ + buffer.insert(decPt, '.'); + } else { + /* 0 . 00...00dd...dd */ + for (int i = 0; i < 1 - decPt; i++) + buffer.insert(0, '0'); + buffer.insert(1, '.'); + } + } + } + + /* If negative and neither -0.0 nor NaN, output a leading '-'. */ + if (sign[0] && + !(word0(d) == Sign_bit && word1(d) == 0) && + !((word0(d) & Exp_mask) == Exp_mask && + ((word1(d) != 0) || ((word0(d) & Frac_mask) != 0)))) { + buffer.insert(0, '-'); + } + } + +} + diff --git a/org/mozilla/javascript/Decompiler.java b/org/mozilla/javascript/Decompiler.java new file mode 100644 index 0000000..8547d37 --- /dev/null +++ b/org/mozilla/javascript/Decompiler.java @@ -0,0 +1,918 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-1999 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Mike Ang + * Igor Bukanov + * Bob Jervis + * Mike McCabe + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +package org.mozilla.javascript; + +/** + * The following class save decompilation information about the source. + * Source information is returned from the parser as a String + * associated with function nodes and with the toplevel script. When + * saved in the constant pool of a class, this string will be UTF-8 + * encoded, and token values will occupy a single byte. + + * Source is saved (mostly) as token numbers. The tokens saved pretty + * much correspond to the token stream of a 'canonical' representation + * of the input program, as directed by the parser. (There were a few + * cases where tokens could have been left out where decompiler could + * easily reconstruct them, but I left them in for clarity). (I also + * looked adding source collection to TokenStream instead, where I + * could have limited the changes to a few lines in getToken... but + * this wouldn't have saved any space in the resulting source + * representation, and would have meant that I'd have to duplicate + * parser logic in the decompiler to disambiguate situations where + * newlines are important.) The function decompile expands the + * tokens back into their string representations, using simple + * lookahead to correct spacing and indentation. + * + * Assignments are saved as two-token pairs (Token.ASSIGN, op). Number tokens + * are stored inline, as a NUMBER token, a character representing the type, and + * either 1 or 4 characters representing the bit-encoding of the number. String + * types NAME, STRING and OBJECT are currently stored as a token type, + * followed by a character giving the length of the string (assumed to + * be less than 2^16), followed by the characters of the string + * inlined into the source string. Changing this to some reference to + * to the string in the compiled class' constant pool would probably + * save a lot of space... but would require some method of deriving + * the final constant pool entry from information available at parse + * time. + */ +public class Decompiler +{ + /** + * Flag to indicate that the decompilation should omit the + * function header and trailing brace. + */ + public static final int ONLY_BODY_FLAG = 1 << 0; + + /** + * Flag to indicate that the decompilation generates toSource result. + */ + public static final int TO_SOURCE_FLAG = 1 << 1; + + /** + * Decompilation property to specify initial ident value. + */ + public static final int INITIAL_INDENT_PROP = 1; + + /** + * Decompilation property to specify default identation offset. + */ + public static final int INDENT_GAP_PROP = 2; + + /** + * Decompilation property to specify identation offset for case labels. + */ + public static final int CASE_GAP_PROP = 3; + + // Marker to denote the last RC of function so it can be distinguished from + // the last RC of object literals in case of function expressions + private static final int FUNCTION_END = Token.LAST_TOKEN + 1; + + String getEncodedSource() + { + return sourceToString(0); + } + + int getCurrentOffset() + { + return sourceTop; + } + + int markFunctionStart(int functionType) + { + int savedOffset = getCurrentOffset(); + addToken(Token.FUNCTION); + append((char)functionType); + return savedOffset; + } + + int markFunctionEnd(int functionStart) + { + int offset = getCurrentOffset(); + append((char)FUNCTION_END); + return offset; + } + + void addToken(int token) + { + if (!(0 <= token && token <= Token.LAST_TOKEN)) + throw new IllegalArgumentException(); + + append((char)token); + } + + void addEOL(int token) + { + if (!(0 <= token && token <= Token.LAST_TOKEN)) + throw new IllegalArgumentException(); + + append((char)token); + append((char)Token.EOL); + } + + void addName(String str) + { + addToken(Token.NAME); + appendString(str); + } + + void addString(String str) + { + addToken(Token.STRING); + appendString(str); + } + + void addRegexp(String regexp, String flags) + { + addToken(Token.REGEXP); + appendString('/' + regexp + '/' + flags); + } + + void addNumber(double n) + { + addToken(Token.NUMBER); + + /* encode the number in the source stream. + * Save as NUMBER type (char | char char char char) + * where type is + * 'D' - double, 'S' - short, 'J' - long. + + * We need to retain float vs. integer type info to keep the + * behavior of liveconnect type-guessing the same after + * decompilation. (Liveconnect tries to present 1.0 to Java + * as a float/double) + * OPT: This is no longer true. We could compress the format. + + * This may not be the most space-efficient encoding; + * the chars created below may take up to 3 bytes in + * constant pool UTF-8 encoding, so a Double could take + * up to 12 bytes. + */ + + long lbits = (long)n; + if (lbits != n) { + // if it's floating point, save as a Double bit pattern. + // (12/15/97 our scanner only returns Double for f.p.) + lbits = Double.doubleToLongBits(n); + append('D'); + append((char)(lbits >> 48)); + append((char)(lbits >> 32)); + append((char)(lbits >> 16)); + append((char)lbits); + } + else { + // we can ignore negative values, bc they're already prefixed + // by NEG + if (lbits < 0) Kit.codeBug(); + + // will it fit in a char? + // this gives a short encoding for integer values up to 2^16. + if (lbits <= Character.MAX_VALUE) { + append('S'); + append((char)lbits); + } + else { // Integral, but won't fit in a char. Store as a long. + append('J'); + append((char)(lbits >> 48)); + append((char)(lbits >> 32)); + append((char)(lbits >> 16)); + append((char)lbits); + } + } + } + + private void appendString(String str) + { + int L = str.length(); + int lengthEncodingSize = 1; + if (L >= 0x8000) { + lengthEncodingSize = 2; + } + int nextTop = sourceTop + lengthEncodingSize + L; + if (nextTop > sourceBuffer.length) { + increaseSourceCapacity(nextTop); + } + if (L >= 0x8000) { + // Use 2 chars to encode strings exceeding 32K, were the highest + // bit in the first char indicates presence of the next byte + sourceBuffer[sourceTop] = (char)(0x8000 | (L >>> 16)); + ++sourceTop; + } + sourceBuffer[sourceTop] = (char)L; + ++sourceTop; + str.getChars(0, L, sourceBuffer, sourceTop); + sourceTop = nextTop; + } + + private void append(char c) + { + if (sourceTop == sourceBuffer.length) { + increaseSourceCapacity(sourceTop + 1); + } + sourceBuffer[sourceTop] = c; + ++sourceTop; + } + + private void increaseSourceCapacity(int minimalCapacity) + { + // Call this only when capacity increase is must + if (minimalCapacity <= sourceBuffer.length) Kit.codeBug(); + int newCapacity = sourceBuffer.length * 2; + if (newCapacity < minimalCapacity) { + newCapacity = minimalCapacity; + } + char[] tmp = new char[newCapacity]; + System.arraycopy(sourceBuffer, 0, tmp, 0, sourceTop); + sourceBuffer = tmp; + } + + private String sourceToString(int offset) + { + if (offset < 0 || sourceTop < offset) Kit.codeBug(); + return new String(sourceBuffer, offset, sourceTop - offset); + } + + /** + * Decompile the source information associated with this js + * function/script back into a string. For the most part, this + * just means translating tokens back to their string + * representations; there's a little bit of lookahead logic to + * decide the proper spacing/indentation. Most of the work in + * mapping the original source to the prettyprinted decompiled + * version is done by the parser. + * + * @param source encoded source tree presentation + * + * @param flags flags to select output format + * + * @param properties indentation properties + * + */ + public static String decompile(String source, int flags, + UintMap properties) + { + int length = source.length(); + if (length == 0) { return ""; } + + int indent = properties.getInt(INITIAL_INDENT_PROP, 0); + if (indent < 0) throw new IllegalArgumentException(); + int indentGap = properties.getInt(INDENT_GAP_PROP, 4); + if (indentGap < 0) throw new IllegalArgumentException(); + int caseGap = properties.getInt(CASE_GAP_PROP, 2); + if (caseGap < 0) throw new IllegalArgumentException(); + + StringBuffer result = new StringBuffer(); + boolean justFunctionBody = (0 != (flags & Decompiler.ONLY_BODY_FLAG)); + boolean toSource = (0 != (flags & Decompiler.TO_SOURCE_FLAG)); + + // Spew tokens in source, for debugging. + // as TYPE number char + if (printSource) { + System.err.println("length:" + length); + for (int i = 0; i < length; ++i) { + // Note that tokenToName will fail unless Context.printTrees + // is true. + String tokenname = null; + if (Token.printNames) { + tokenname = Token.name(source.charAt(i)); + } + if (tokenname == null) { + tokenname = "---"; + } + String pad = tokenname.length() > 7 + ? "\t" + : "\t\t"; + System.err.println + (tokenname + + pad + (int)source.charAt(i) + + "\t'" + ScriptRuntime.escapeString + (source.substring(i, i+1)) + + "'"); + } + System.err.println(); + } + + int braceNesting = 0; + boolean afterFirstEOL = false; + int i = 0; + int topFunctionType; + if (source.charAt(i) == Token.SCRIPT) { + ++i; + topFunctionType = -1; + } else { + topFunctionType = source.charAt(i + 1); + } + + if (!toSource) { + // add an initial newline to exactly match js. + result.append('\n'); + for (int j = 0; j < indent; j++) + result.append(' '); + } else { + if (topFunctionType == FunctionNode.FUNCTION_EXPRESSION) { + result.append('('); + } + } + + while (i < length) { + switch(source.charAt(i)) { + case Token.GET: + case Token.SET: + result.append(source.charAt(i) == Token.GET ? "get " : "set "); + ++i; + i = printSourceString(source, i + 1, false, result); + // Now increment one more to get past the FUNCTION token + ++i; + break; + + case Token.NAME: + case Token.REGEXP: // re-wrapped in '/'s in parser... + i = printSourceString(source, i + 1, false, result); + continue; + + case Token.STRING: + i = printSourceString(source, i + 1, true, result); + continue; + + case Token.NUMBER: + i = printSourceNumber(source, i + 1, result); + continue; + + case Token.TRUE: + result.append("true"); + break; + + case Token.FALSE: + result.append("false"); + break; + + case Token.NULL: + result.append("null"); + break; + + case Token.THIS: + result.append("this"); + break; + + case Token.FUNCTION: + ++i; // skip function type + result.append("function "); + break; + + case FUNCTION_END: + // Do nothing + break; + + case Token.COMMA: + result.append(", "); + break; + + case Token.LC: + ++braceNesting; + if (Token.EOL == getNext(source, length, i)) + indent += indentGap; + result.append('{'); + break; + + case Token.RC: { + --braceNesting; + /* don't print the closing RC if it closes the + * toplevel function and we're called from + * decompileFunctionBody. + */ + if (justFunctionBody && braceNesting == 0) + break; + + result.append('}'); + switch (getNext(source, length, i)) { + case Token.EOL: + case FUNCTION_END: + indent -= indentGap; + break; + case Token.WHILE: + case Token.ELSE: + indent -= indentGap; + result.append(' '); + break; + } + break; + } + case Token.LP: + result.append('('); + break; + + case Token.RP: + result.append(')'); + if (Token.LC == getNext(source, length, i)) + result.append(' '); + break; + + case Token.LB: + result.append('['); + break; + + case Token.RB: + result.append(']'); + break; + + case Token.EOL: { + if (toSource) break; + boolean newLine = true; + if (!afterFirstEOL) { + afterFirstEOL = true; + if (justFunctionBody) { + /* throw away just added 'function name(...) {' + * and restore the original indent + */ + result.setLength(0); + indent -= indentGap; + newLine = false; + } + } + if (newLine) { + result.append('\n'); + } + + /* add indent if any tokens remain, + * less setback if next token is + * a label, case or default. + */ + if (i + 1 < length) { + int less = 0; + int nextToken = source.charAt(i + 1); + if (nextToken == Token.CASE + || nextToken == Token.DEFAULT) + { + less = indentGap - caseGap; + } else if (nextToken == Token.RC) { + less = indentGap; + } + + /* elaborate check against label... skip past a + * following inlined NAME and look for a COLON. + */ + else if (nextToken == Token.NAME) { + int afterName = getSourceStringEnd(source, i + 2); + if (source.charAt(afterName) == Token.COLON) + less = indentGap; + } + + for (; less < indent; less++) + result.append(' '); + } + break; + } + case Token.DOT: + result.append('.'); + break; + + case Token.NEW: + result.append("new "); + break; + + case Token.DELPROP: + result.append("delete "); + break; + + case Token.IF: + result.append("if "); + break; + + case Token.ELSE: + result.append("else "); + break; + + case Token.FOR: + result.append("for "); + break; + + case Token.IN: + result.append(" in "); + break; + + case Token.WITH: + result.append("with "); + break; + + case Token.WHILE: + result.append("while "); + break; + + case Token.DO: + result.append("do "); + break; + + case Token.TRY: + result.append("try "); + break; + + case Token.CATCH: + result.append("catch "); + break; + + case Token.FINALLY: + result.append("finally "); + break; + + case Token.THROW: + result.append("throw "); + break; + + case Token.SWITCH: + result.append("switch "); + break; + + case Token.BREAK: + result.append("break"); + if (Token.NAME == getNext(source, length, i)) + result.append(' '); + break; + + case Token.CONTINUE: + result.append("continue"); + if (Token.NAME == getNext(source, length, i)) + result.append(' '); + break; + + case Token.CASE: + result.append("case "); + break; + + case Token.DEFAULT: + result.append("default"); + break; + + case Token.RETURN: + result.append("return"); + if (Token.SEMI != getNext(source, length, i)) + result.append(' '); + break; + + case Token.VAR: + result.append("var "); + break; + + case Token.LET: + result.append("let "); + break; + + case Token.SEMI: + result.append(';'); + if (Token.EOL != getNext(source, length, i)) { + // separators in FOR + result.append(' '); + } + break; + + case Token.ASSIGN: + result.append(" = "); + break; + + case Token.ASSIGN_ADD: + result.append(" += "); + break; + + case Token.ASSIGN_SUB: + result.append(" -= "); + break; + + case Token.ASSIGN_MUL: + result.append(" *= "); + break; + + case Token.ASSIGN_DIV: + result.append(" /= "); + break; + + case Token.ASSIGN_MOD: + result.append(" %= "); + break; + + case Token.ASSIGN_BITOR: + result.append(" |= "); + break; + + case Token.ASSIGN_BITXOR: + result.append(" ^= "); + break; + + case Token.ASSIGN_BITAND: + result.append(" &= "); + break; + + case Token.ASSIGN_LSH: + result.append(" <<= "); + break; + + case Token.ASSIGN_RSH: + result.append(" >>= "); + break; + + case Token.ASSIGN_URSH: + result.append(" >>>= "); + break; + + case Token.HOOK: + result.append(" ? "); + break; + + case Token.OBJECTLIT: + // pun OBJECTLIT to mean colon in objlit property + // initialization. + // This needs to be distinct from COLON in the general case + // to distinguish from the colon in a ternary... which needs + // different spacing. + result.append(':'); + break; + + case Token.COLON: + if (Token.EOL == getNext(source, length, i)) + // it's the end of a label + result.append(':'); + else + // it's the middle part of a ternary + result.append(" : "); + break; + + case Token.OR: + result.append(" || "); + break; + + case Token.AND: + result.append(" && "); + break; + + case Token.BITOR: + result.append(" | "); + break; + + case Token.BITXOR: + result.append(" ^ "); + break; + + case Token.BITAND: + result.append(" & "); + break; + + case Token.SHEQ: + result.append(" === "); + break; + + case Token.SHNE: + result.append(" !== "); + break; + + case Token.EQ: + result.append(" == "); + break; + + case Token.NE: + result.append(" != "); + break; + + case Token.LE: + result.append(" <= "); + break; + + case Token.LT: + result.append(" < "); + break; + + case Token.GE: + result.append(" >= "); + break; + + case Token.GT: + result.append(" > "); + break; + + case Token.INSTANCEOF: + result.append(" instanceof "); + break; + + case Token.LSH: + result.append(" << "); + break; + + case Token.RSH: + result.append(" >> "); + break; + + case Token.URSH: + result.append(" >>> "); + break; + + case Token.TYPEOF: + result.append("typeof "); + break; + + case Token.VOID: + result.append("void "); + break; + + case Token.CONST: + result.append("const "); + break; + + case Token.YIELD: + result.append("yield "); + break; + + case Token.NOT: + result.append('!'); + break; + + case Token.BITNOT: + result.append('~'); + break; + + case Token.POS: + result.append('+'); + break; + + case Token.NEG: + result.append('-'); + break; + + case Token.INC: + result.append("++"); + break; + + case Token.DEC: + result.append("--"); + break; + + case Token.ADD: + result.append(" + "); + break; + + case Token.SUB: + result.append(" - "); + break; + + case Token.MUL: + result.append(" * "); + break; + + case Token.DIV: + result.append(" / "); + break; + + case Token.MOD: + result.append(" % "); + break; + + case Token.COLONCOLON: + result.append("::"); + break; + + case Token.DOTDOT: + result.append(".."); + break; + + case Token.DOTQUERY: + result.append(".("); + break; + + case Token.XMLATTR: + result.append('@'); + break; + + default: + // If we don't know how to decompile it, raise an exception. + throw new RuntimeException("Token: " + + Token.name(source.charAt(i))); + } + ++i; + } + + if (!toSource) { + // add that trailing newline if it's an outermost function. + if (!justFunctionBody) + result.append('\n'); + } else { + if (topFunctionType == FunctionNode.FUNCTION_EXPRESSION) { + result.append(')'); + } + } + + return result.toString(); + } + + private static int getNext(String source, int length, int i) + { + return (i + 1 < length) ? source.charAt(i + 1) : Token.EOF; + } + + private static int getSourceStringEnd(String source, int offset) + { + return printSourceString(source, offset, false, null); + } + + private static int printSourceString(String source, int offset, + boolean asQuotedString, + StringBuffer sb) + { + int length = source.charAt(offset); + ++offset; + if ((0x8000 & length) != 0) { + length = ((0x7FFF & length) << 16) | source.charAt(offset); + ++offset; + } + if (sb != null) { + String str = source.substring(offset, offset + length); + if (!asQuotedString) { + sb.append(str); + } else { + sb.append('"'); + sb.append(ScriptRuntime.escapeString(str)); + sb.append('"'); + } + } + return offset + length; + } + + private static int printSourceNumber(String source, int offset, + StringBuffer sb) + { + double number = 0.0; + char type = source.charAt(offset); + ++offset; + if (type == 'S') { + if (sb != null) { + int ival = source.charAt(offset); + number = ival; + } + ++offset; + } else if (type == 'J' || type == 'D') { + if (sb != null) { + long lbits; + lbits = (long)source.charAt(offset) << 48; + lbits |= (long)source.charAt(offset + 1) << 32; + lbits |= (long)source.charAt(offset + 2) << 16; + lbits |= source.charAt(offset + 3); + if (type == 'J') { + number = lbits; + } else { + number = Double.longBitsToDouble(lbits); + } + } + offset += 4; + } else { + // Bad source + throw new RuntimeException(); + } + if (sb != null) { + sb.append(ScriptRuntime.numberToString(number, 10)); + } + return offset; + } + + private char[] sourceBuffer = new char[128]; + +// Per script/function source buffer top: parent source does not include a +// nested functions source and uses function index as a reference instead. + private int sourceTop; + +// whether to do a debug print of the source information, when decompiling. + private static final boolean printSource = false; + +} diff --git a/org/mozilla/javascript/DefaultErrorReporter.java b/org/mozilla/javascript/DefaultErrorReporter.java new file mode 100644 index 0000000..c7d93d4 --- /dev/null +++ b/org/mozilla/javascript/DefaultErrorReporter.java @@ -0,0 +1,113 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-1999 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Norris Boyd + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +package org.mozilla.javascript; + +/** + * This is the default error reporter for JavaScript. + * + * @author Norris Boyd + */ +class DefaultErrorReporter implements ErrorReporter +{ + static final DefaultErrorReporter instance = new DefaultErrorReporter(); + + private boolean forEval; + private ErrorReporter chainedReporter; + + private DefaultErrorReporter() { } + + static ErrorReporter forEval(ErrorReporter reporter) + { + DefaultErrorReporter r = new DefaultErrorReporter(); + r.forEval = true; + r.chainedReporter = reporter; + return r; + } + + public void warning(String message, String sourceURI, int line, + String lineText, int lineOffset) + { + if (chainedReporter != null) { + chainedReporter.warning( + message, sourceURI, line, lineText, lineOffset); + } else { + // Do nothing + } + } + + public void error(String message, String sourceURI, int line, + String lineText, int lineOffset) + { + if (forEval) { + // Assume error message strings that start with "TypeError: " + // should become TypeError exceptions. A bit of a hack, but we + // don't want to change the ErrorReporter interface. + String error = "SyntaxError"; + final String TYPE_ERROR_NAME = "TypeError"; + final String DELIMETER = ": "; + final String prefix = TYPE_ERROR_NAME + DELIMETER; + if (message.startsWith(prefix)) { + error = TYPE_ERROR_NAME; + message = message.substring(prefix.length()); + } + throw ScriptRuntime.constructError(error, message, sourceURI, + line, lineText, lineOffset); + } + if (chainedReporter != null) { + chainedReporter.error( + message, sourceURI, line, lineText, lineOffset); + } else { + throw runtimeError( + message, sourceURI, line, lineText, lineOffset); + } + } + + public EvaluatorException runtimeError(String message, String sourceURI, + int line, String lineText, + int lineOffset) + { + if (chainedReporter != null) { + return chainedReporter.runtimeError( + message, sourceURI, line, lineText, lineOffset); + } else { + return new EvaluatorException( + message, sourceURI, line, lineText, lineOffset); + } + } +} diff --git a/org/mozilla/javascript/DefiningClassLoader.java b/org/mozilla/javascript/DefiningClassLoader.java new file mode 100644 index 0000000..9723d9c --- /dev/null +++ b/org/mozilla/javascript/DefiningClassLoader.java @@ -0,0 +1,89 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-1999 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Norris Boyd + * Roger Lawrence + * Patrick Beard + * Igor Bukanov + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +package org.mozilla.javascript; + +/** + * Load generated classes. + * + * @author Norris Boyd + */ +public class DefiningClassLoader extends ClassLoader + implements GeneratedClassLoader +{ + public DefiningClassLoader() { + this.parentLoader = getClass().getClassLoader(); + } + + public DefiningClassLoader(ClassLoader parentLoader) { + this.parentLoader = parentLoader; + } + + public Class defineClass(String name, byte[] data) { + // Use our own protection domain for the generated classes. + // TODO: we might want to use a separate protection domain for classes + // compiled from scripts, based on where the script was loaded from. + return super.defineClass(name, data, 0, data.length, + SecurityUtilities.getProtectionDomain(getClass())); + } + + public void linkClass(Class cl) { + resolveClass(cl); + } + + @Override + public Class loadClass(String name, boolean resolve) + throws ClassNotFoundException + { + Class cl = findLoadedClass(name); + if (cl == null) { + if (parentLoader != null) { + cl = parentLoader.loadClass(name); + } else { + cl = findSystemClass(name); + } + } + if (resolve) { + resolveClass(cl); + } + return cl; + } + + private final ClassLoader parentLoader; +} diff --git a/org/mozilla/javascript/Delegator.java b/org/mozilla/javascript/Delegator.java new file mode 100644 index 0000000..0056f8c --- /dev/null +++ b/org/mozilla/javascript/Delegator.java @@ -0,0 +1,266 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Delegator.java, released + * Sep 27, 2000. + * + * The Initial Developer of the Original Code is + * Matthias Radestock. . + * Portions created by the Initial Developer are Copyright (C) 2000 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +// API class + +package org.mozilla.javascript; + +/** + * This is a helper class for implementing wrappers around Scriptable + * objects. It implements the Function interface and delegates all + * invocations to a delegee Scriptable object. The normal use of this + * class involves creating a sub-class and overriding one or more of + * the methods. + * + * A useful application is the implementation of interceptors, + * pre/post conditions, debugging. + * + * @see Function + * @see Scriptable + * @author Matthias Radestock + */ + +public class Delegator implements Function { + + protected Scriptable obj = null; + + /** + * Create a Delegator prototype. + * + * This constructor should only be used for creating prototype + * objects of Delegator. + * + * @see org.mozilla.javascript.Delegator#construct + */ + public Delegator() { + } + + /** + * Create a new Delegator that forwards requests to a delegee + * Scriptable object. + * + * @param obj the delegee + * @see org.mozilla.javascript.Scriptable + */ + public Delegator(Scriptable obj) { + this.obj = obj; + } + + /** + * Crete new Delegator instance. + * The default implementation calls this.getClass().newInstance(). + * + * @see #construct(Context cx, Scriptable scope, Object[] args) + */ + protected Delegator newInstance() + { + try { + return this.getClass().newInstance(); + } catch (Exception ex) { + throw Context.throwAsScriptRuntimeEx(ex); + } + } + + /** + * Retrieve the delegee. + * + * @return the delegee + */ + public Scriptable getDelegee() { + return obj; + } + /** + * Set the delegee. + * + * @param obj the delegee + * @see org.mozilla.javascript.Scriptable + */ + public void setDelegee(Scriptable obj) { + this.obj = obj; + } + /** + * @see org.mozilla.javascript.Scriptable#getClassName + */ + public String getClassName() { + return obj.getClassName(); + } + /** + * @see org.mozilla.javascript.Scriptable#get(String, Scriptable) + */ + public Object get(String name, Scriptable start) { + return obj.get(name,start); + } + /** + * @see org.mozilla.javascript.Scriptable#get(int, Scriptable) + */ + public Object get(int index, Scriptable start) { + return obj.get(index,start); + } + /** + * @see org.mozilla.javascript.Scriptable#has(String, Scriptable) + */ + public boolean has(String name, Scriptable start) { + return obj.has(name,start); + } + /** + * @see org.mozilla.javascript.Scriptable#has(int, Scriptable) + */ + public boolean has(int index, Scriptable start) { + return obj.has(index,start); + } + /** + * @see org.mozilla.javascript.Scriptable#put(String, Scriptable, Object) + */ + public void put(String name, Scriptable start, Object value) { + obj.put(name,start,value); + } + /** + * @see org.mozilla.javascript.Scriptable#put(int, Scriptable, Object) + */ + public void put(int index, Scriptable start, Object value) { + obj.put(index,start,value); + } + /** + * @see org.mozilla.javascript.Scriptable#delete(String) + */ + public void delete(String name) { + obj.delete(name); + } + /** + * @see org.mozilla.javascript.Scriptable#delete(int) + */ + public void delete(int index) { + obj.delete(index); + } + /** + * @see org.mozilla.javascript.Scriptable#getPrototype + */ + public Scriptable getPrototype() { + return obj.getPrototype(); + } + /** + * @see org.mozilla.javascript.Scriptable#setPrototype + */ + public void setPrototype(Scriptable prototype) { + obj.setPrototype(prototype); + } + /** + * @see org.mozilla.javascript.Scriptable#getParentScope + */ + public Scriptable getParentScope() { + return obj.getParentScope(); + } + /** + * @see org.mozilla.javascript.Scriptable#setParentScope + */ + public void setParentScope(Scriptable parent) { + obj.setParentScope(parent); + } + /** + * @see org.mozilla.javascript.Scriptable#getIds + */ + public Object[] getIds() { + return obj.getIds(); + } + /** + * Note that this method does not get forwarded to the delegee if + * the hint parameter is null, + * ScriptRuntime.ScriptableClass or + * ScriptRuntime.FunctionClass. Instead the object + * itself is returned. + * + * @param hint the type hint + * @return the default value + * + * @see org.mozilla.javascript.Scriptable#getDefaultValue + */ + public Object getDefaultValue(Class hint) { + return (hint == null || + hint == ScriptRuntime.ScriptableClass || + hint == ScriptRuntime.FunctionClass) ? + this : obj.getDefaultValue(hint); + } + /** + * @see org.mozilla.javascript.Scriptable#hasInstance + */ + public boolean hasInstance(Scriptable instance) { + return obj.hasInstance(instance); + } + /** + * @see org.mozilla.javascript.Function#call + */ + public Object call(Context cx, Scriptable scope, Scriptable thisObj, + Object[] args) + { + return ((Function)obj).call(cx,scope,thisObj,args); + } + + /** + * Note that if the delegee is null, + * this method creates a new instance of the Delegator itself + * rathert than forwarding the call to the + * delegee. This permits the use of Delegator + * prototypes. + * + * @param cx the current Context for this thread + * @param scope an enclosing scope of the caller except + * when the function is called from a closure. + * @param args the array of arguments + * @return the allocated object + * + * @see Function#construct(Context, Scriptable, Object[]) + */ + public Scriptable construct(Context cx, Scriptable scope, Object[] args) + { + if (obj == null) { + //this little trick allows us to declare prototype objects for + //Delegators + Delegator n = newInstance(); + Scriptable delegee; + if (args.length == 0) { + delegee = new NativeObject(); + } else { + delegee = ScriptRuntime.toObject(cx, scope, args[0]); + } + n.setDelegee(delegee); + return n; + } + else { + return ((Function)obj).construct(cx,scope,args); + } + } +} diff --git a/org/mozilla/javascript/EcmaError.java b/org/mozilla/javascript/EcmaError.java new file mode 100644 index 0000000..b8ac416 --- /dev/null +++ b/org/mozilla/javascript/EcmaError.java @@ -0,0 +1,161 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-1999 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Roger Lawrence + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +// API class + +package org.mozilla.javascript; + +/** + * The class of exceptions raised by the engine as described in + * ECMA edition 3. See section 15.11.6 in particular. + */ +public class EcmaError extends RhinoException +{ + static final long serialVersionUID = -6261226256957286699L; + + private String errorName; + private String errorMessage; + + /** + * Create an exception with the specified detail message. + * + * Errors internal to the JavaScript engine will simply throw a + * RuntimeException. + * + * @param sourceName the name of the source responsible for the error + * @param lineNumber the line number of the source + * @param columnNumber the columnNumber of the source (may be zero if + * unknown) + * @param lineSource the source of the line containing the error (may be + * null if unknown) + */ + EcmaError(String errorName, String errorMessage, + String sourceName, int lineNumber, + String lineSource, int columnNumber) + { + recordErrorOrigin(sourceName, lineNumber, lineSource, columnNumber); + this.errorName = errorName; + this.errorMessage = errorMessage; + } + + /** + * @deprecated EcmaError error instances should not be constructed + * explicitly since they are generated by the engine. + */ + public EcmaError(Scriptable nativeError, String sourceName, + int lineNumber, int columnNumber, String lineSource) + { + this("InternalError", ScriptRuntime.toString(nativeError), + sourceName, lineNumber, lineSource, columnNumber); + } + + @Override + public String details() + { + return errorName+": "+errorMessage; + } + + /** + * Gets the name of the error. + * + * ECMA edition 3 defines the following + * errors: EvalError, RangeError, ReferenceError, + * SyntaxError, TypeError, and URIError. Additional error names + * may be added in the future. + * + * See ECMA edition 3, 15.11.7.9. + * + * @return the name of the error. + */ + public String getName() + { + return errorName; + } + + /** + * Gets the message corresponding to the error. + * + * See ECMA edition 3, 15.11.7.10. + * + * @return an implementation-defined string describing the error. + */ + public String getErrorMessage() + { + return errorMessage; + } + + /** + * @deprecated Use {@link RhinoException#sourceName()} from the super class. + */ + public String getSourceName() + { + return sourceName(); + } + + /** + * @deprecated Use {@link RhinoException#lineNumber()} from the super class. + */ + public int getLineNumber() + { + return lineNumber(); + } + + /** + * @deprecated + * Use {@link RhinoException#columnNumber()} from the super class. + */ + public int getColumnNumber() { + return columnNumber(); + } + + /** + * @deprecated Use {@link RhinoException#lineSource()} from the super class. + */ + public String getLineSource() { + return lineSource(); + } + + /** + * @deprecated + * Always returns null. + */ + public Scriptable getErrorObject() + { + return null; + } +} diff --git a/org/mozilla/javascript/ErrorReporter.java b/org/mozilla/javascript/ErrorReporter.java new file mode 100644 index 0000000..4649370 --- /dev/null +++ b/org/mozilla/javascript/ErrorReporter.java @@ -0,0 +1,106 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-1999 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Norris Boyd + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +// API class + +package org.mozilla.javascript; + +/** + * This is interface defines a protocol for the reporting of + * errors during JavaScript translation or execution. + * + * @author Norris Boyd + */ + +public interface ErrorReporter { + + /** + * Report a warning. + * + * The implementing class may choose to ignore the warning + * if it desires. + * + * @param message a String describing the warning + * @param sourceName a String describing the JavaScript source + * where the warning occured; typically a filename or URL + * @param line the line number associated with the warning + * @param lineSource the text of the line (may be null) + * @param lineOffset the offset into lineSource where problem was detected + */ + void warning(String message, String sourceName, int line, + String lineSource, int lineOffset); + + /** + * Report an error. + * + * The implementing class is free to throw an exception if + * it desires. + * + * If execution has not yet begun, the JavaScript engine is + * free to find additional errors rather than terminating + * the translation. It will not execute a script that had + * errors, however. + * + * @param message a String describing the error + * @param sourceName a String describing the JavaScript source + * where the error occured; typically a filename or URL + * @param line the line number associated with the error + * @param lineSource the text of the line (may be null) + * @param lineOffset the offset into lineSource where problem was detected + */ + void error(String message, String sourceName, int line, + String lineSource, int lineOffset); + + /** + * Creates an EvaluatorException that may be thrown. + * + * runtimeErrors, unlike errors, will always terminate the + * current script. + * + * @param message a String describing the error + * @param sourceName a String describing the JavaScript source + * where the error occured; typically a filename or URL + * @param line the line number associated with the error + * @param lineSource the text of the line (may be null) + * @param lineOffset the offset into lineSource where problem was detected + * @return an EvaluatorException that will be thrown. + */ + EvaluatorException runtimeError(String message, String sourceName, + int line, String lineSource, + int lineOffset); +} diff --git a/org/mozilla/javascript/Evaluator.java b/org/mozilla/javascript/Evaluator.java new file mode 100644 index 0000000..09a6881 --- /dev/null +++ b/org/mozilla/javascript/Evaluator.java @@ -0,0 +1,118 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Contributor(s): + * Norris Boyd + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +package org.mozilla.javascript; + +import java.util.List; + +/** + * Abstraction of evaluation, which can be implemented either by an + * interpreter or compiler. + */ +public interface Evaluator { + + /** + * Compile the script or function from intermediate representation + * tree into an executable form. + * + * @param compilerEnv Compiler environment + * @param tree intermediate representation + * @param encodedSource encoding of the source code for decompilation + * @param returnFunction if true, compiling a function + * @return an opaque object that can be passed to either + * createFunctionObject or createScriptObject, depending on the + * value of returnFunction + */ + public Object compile(CompilerEnvirons compilerEnv, + ScriptOrFnNode tree, + String encodedSource, + boolean returnFunction); + + /** + * Create a function object. + * + * @param cx Current context + * @param scope scope of the function + * @param bytecode opaque object returned by compile + * @param staticSecurityDomain security domain + * @return Function object that can be called + */ + public Function createFunctionObject(Context cx, Scriptable scope, + Object bytecode, Object staticSecurityDomain); + + /** + * Create a script object. + * + * @param bytecode opaque object returned by compile + * @param staticSecurityDomain security domain + * @return Script object that can be evaluated + */ + public Script createScriptObject(Object bytecode, + Object staticSecurityDomain); + + /** + * Capture stack information from the given exception. + * @param ex an exception thrown during execution + */ + public void captureStackInfo(RhinoException ex); + + /** + * Get the source position information by examining the stack. + * @param cx Context + * @param linep Array object of length >= 1; getSourcePositionFromStack + * will assign the line number to linep[0]. + * @return the name of the file or other source container + */ + public String getSourcePositionFromStack(Context cx, int[] linep); + + /** + * Given a native stack trace, patch it with script-specific source + * and line information + * @param ex exception + * @param nativeStackTrace the native stack trace + * @return patched stack trace + */ + public String getPatchedStack(RhinoException ex, + String nativeStackTrace); + + /** + * Get the script stack for the given exception + * @param ex exception from execution + * @return list of strings for the stack trace + */ + public List getScriptStack(RhinoException ex); + + /** + * Mark the given script to indicate it was created by a call to + * eval() or to a Function constructor. + * @param script script to mark as from eval + */ + public void setEvalScriptFlag(Script script); +} diff --git a/org/mozilla/javascript/EvaluatorException.java b/org/mozilla/javascript/EvaluatorException.java new file mode 100644 index 0000000..7b4e7cc --- /dev/null +++ b/org/mozilla/javascript/EvaluatorException.java @@ -0,0 +1,123 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-1999 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Norris Boyd + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + + +package org.mozilla.javascript; + +/** + * The class of exceptions thrown by the JavaScript engine. + */ +public class EvaluatorException extends RhinoException +{ + static final long serialVersionUID = -8743165779676009808L; + + public EvaluatorException(String detail) + { + super(detail); + } + + /** + * Create an exception with the specified detail message. + * + * Errors internal to the JavaScript engine will simply throw a + * RuntimeException. + * + * @param detail the error message + * @param sourceName the name of the source reponsible for the error + * @param lineNumber the line number of the source + */ + public EvaluatorException(String detail, String sourceName, + int lineNumber) + { + this(detail, sourceName, lineNumber, null, 0); + } + + /** + * Create an exception with the specified detail message. + * + * Errors internal to the JavaScript engine will simply throw a + * RuntimeException. + * + * @param detail the error message + * @param sourceName the name of the source responsible for the error + * @param lineNumber the line number of the source + * @param columnNumber the columnNumber of the source (may be zero if + * unknown) + * @param lineSource the source of the line containing the error (may be + * null if unknown) + */ + public EvaluatorException(String detail, String sourceName, int lineNumber, + String lineSource, int columnNumber) + { + super(detail); + recordErrorOrigin(sourceName, lineNumber, lineSource, columnNumber); + } + + /** + * @deprecated Use {@link RhinoException#sourceName()} from the super class. + */ + public String getSourceName() + { + return sourceName(); + } + + /** + * @deprecated Use {@link RhinoException#lineNumber()} from the super class. + */ + public int getLineNumber() + { + return lineNumber(); + } + + /** + * @deprecated Use {@link RhinoException#columnNumber()} from the super class. + */ + public int getColumnNumber() + { + return columnNumber(); + } + + /** + * @deprecated Use {@link RhinoException#lineSource()} from the super class. + */ + public String getLineSource() + { + return lineSource(); + } + +} diff --git a/org/mozilla/javascript/Function.java b/org/mozilla/javascript/Function.java new file mode 100644 index 0000000..a4377e6 --- /dev/null +++ b/org/mozilla/javascript/Function.java @@ -0,0 +1,84 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-1999 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Norris Boyd + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +// API class + +package org.mozilla.javascript; + +/** + * This is interface that all functions in JavaScript must implement. + * The interface provides for calling functions and constructors. + * + * @see org.mozilla.javascript.Scriptable + * @author Norris Boyd + */ + +public interface Function extends Scriptable, Callable +{ + /** + * Call the function. + * + * Note that the array of arguments is not guaranteed to have + * length greater than 0. + * + * @param cx the current Context for this thread + * @param scope the scope to execute the function relative to. This is + * set to the value returned by getParentScope() except + * when the function is called from a closure. + * @param thisObj the JavaScript this object + * @param args the array of arguments + * @return the result of the call + */ + public Object call(Context cx, Scriptable scope, Scriptable thisObj, + Object[] args); + + /** + * Call the function as a constructor. + * + * This method is invoked by the runtime in order to satisfy a use + * of the JavaScript new operator. This method is + * expected to create a new object and return it. + * + * @param cx the current Context for this thread + * @param scope an enclosing scope of the caller except + * when the function is called from a closure. + * @param args the array of arguments + * @return the allocated object + */ + public Scriptable construct(Context cx, Scriptable scope, Object[] args); +} diff --git a/org/mozilla/javascript/FunctionNode.java b/org/mozilla/javascript/FunctionNode.java new file mode 100644 index 0000000..2790953 --- /dev/null +++ b/org/mozilla/javascript/FunctionNode.java @@ -0,0 +1,117 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-1999 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Norris Boyd + * Roger Lawrence + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +package org.mozilla.javascript; +import java.util.ArrayList; +import java.util.HashMap; + +public class FunctionNode extends ScriptOrFnNode { + + public FunctionNode(String name) { + super(Token.FUNCTION); + functionName = name; + } + + public String getFunctionName() { + return functionName; + } + + public boolean requiresActivation() { + return itsNeedsActivation; + } + + public boolean getIgnoreDynamicScope() { + return itsIgnoreDynamicScope; + } + + public boolean isGenerator() { + return itsIsGenerator; + } + + public void addResumptionPoint(Node target) { + if (generatorResumePoints == null) + generatorResumePoints = new ArrayList(); + generatorResumePoints.add(target); + } + + public ArrayList getResumptionPoints() { + return generatorResumePoints; + } + + public HashMap getLiveLocals() { + return liveLocals; + } + + public void addLiveLocals(Node node, int[] locals) { + if (liveLocals == null) + liveLocals = new HashMap(); + liveLocals.put(node, locals); + } + + /** + * There are three types of functions that can be defined. The first + * is a function statement. This is a function appearing as a top-level + * statement (i.e., not nested inside some other statement) in either a + * script or a function. + * + * The second is a function expression, which is a function appearing in + * an expression except for the third type, which is... + * + * The third type is a function expression where the expression is the + * top-level expression in an expression statement. + * + * The three types of functions have different treatment and must be + * distinguished. + */ + public static final int FUNCTION_STATEMENT = 1; + public static final int FUNCTION_EXPRESSION = 2; + public static final int FUNCTION_EXPRESSION_STATEMENT = 3; + + public int getFunctionType() { + return itsFunctionType; + } + + String functionName; + int itsFunctionType; + boolean itsNeedsActivation; + boolean itsIgnoreDynamicScope; + boolean itsIsGenerator; + ArrayList generatorResumePoints; + HashMap liveLocals; +} diff --git a/org/mozilla/javascript/FunctionObject.java b/org/mozilla/javascript/FunctionObject.java new file mode 100644 index 0000000..1d6c752 --- /dev/null +++ b/org/mozilla/javascript/FunctionObject.java @@ -0,0 +1,572 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-2000 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Norris Boyd + * Igor Bukanov + * David C. Navas + * Ted Neward + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +// API class + +package org.mozilla.javascript; + +import java.lang.reflect.*; +import java.io.*; + +public class FunctionObject extends BaseFunction +{ + static final long serialVersionUID = -5332312783643935019L; + + /** + * Create a JavaScript function object from a Java method. + * + *

The member argument must be either a java.lang.reflect.Method + * or a java.lang.reflect.Constructor and must match one of two forms.

+ * + * The first form is a member with zero or more parameters + * of the following types: Object, String, boolean, Scriptable, + * int, or double. The Long type is not supported + * because the double representation of a long (which is the + * EMCA-mandated storage type for Numbers) may lose precision. + * If the member is a Method, the return value must be void or one + * of the types allowed for parameters.

+ * + * The runtime will perform appropriate conversions based + * upon the type of the parameter. A parameter type of + * Object specifies that no conversions are to be done. A parameter + * of type String will use Context.toString to convert arguments. + * Similarly, parameters of type double, boolean, and Scriptable + * will cause Context.toNumber, Context.toBoolean, and + * Context.toObject, respectively, to be called.

+ * + * If the method is not static, the Java 'this' value will + * correspond to the JavaScript 'this' value. Any attempt + * to call the function with a 'this' value that is not + * of the right Java type will result in an error.

+ * + * The second form is the variable arguments (or "varargs") + * form. If the FunctionObject will be used as a constructor, + * the member must have the following parameters + *

+     *      (Context cx, Object[] args, Function ctorObj,
+     *       boolean inNewExpr)
+ * and if it is a Method, be static and return an Object result.

+ * + * Otherwise, if the FunctionObject will not be used to define a + * constructor, the member must be a static Method with parameters + * (Context cx, Scriptable thisObj, Object[] args, + * Function funObj) + *

+     * and an Object result.

+ * + * When the function varargs form is called as part of a function call, + * the args parameter contains the + * arguments, with thisObj + * set to the JavaScript 'this' value. funObj + * is the function object for the invoked function.

+ * + * When the constructor varargs form is called or invoked while evaluating + * a new expression, args contains the + * arguments, ctorObj refers to this FunctionObject, and + * inNewExpr is true if and only if a new + * expression caused the call. This supports defining a function that + * has different behavior when called as a constructor than when + * invoked as a normal function call. (For example, the Boolean + * constructor, when called as a function, + * will convert to boolean rather than creating a new object.)

+ * + * @param name the name of the function + * @param methodOrConstructor a java.lang.reflect.Method or a java.lang.reflect.Constructor + * that defines the object + * @param scope enclosing scope of function + * @see org.mozilla.javascript.Scriptable + */ + public FunctionObject(String name, Member methodOrConstructor, + Scriptable scope) + { + if (methodOrConstructor instanceof Constructor) { + member = new MemberBox((Constructor) methodOrConstructor); + isStatic = true; // well, doesn't take a 'this' + } else { + member = new MemberBox((Method) methodOrConstructor); + isStatic = member.isStatic(); + } + String methodName = member.getName(); + this.functionName = name; + Class[] types = member.argTypes; + int arity = types.length; + if (arity == 4 && (types[1].isArray() || types[2].isArray())) { + // Either variable args or an error. + if (types[1].isArray()) { + if (!isStatic || + types[0] != ScriptRuntime.ContextClass || + types[1].getComponentType() != ScriptRuntime.ObjectClass || + types[2] != ScriptRuntime.FunctionClass || + types[3] != Boolean.TYPE) + { + throw Context.reportRuntimeError1( + "msg.varargs.ctor", methodName); + } + parmsLength = VARARGS_CTOR; + } else { + if (!isStatic || + types[0] != ScriptRuntime.ContextClass || + types[1] != ScriptRuntime.ScriptableClass || + types[2].getComponentType() != ScriptRuntime.ObjectClass || + types[3] != ScriptRuntime.FunctionClass) + { + throw Context.reportRuntimeError1( + "msg.varargs.fun", methodName); + } + parmsLength = VARARGS_METHOD; + } + } else { + parmsLength = arity; + if (arity > 0) { + typeTags = new byte[arity]; + for (int i = 0; i != arity; ++i) { + int tag = getTypeTag(types[i]); + if (tag == JAVA_UNSUPPORTED_TYPE) { + throw Context.reportRuntimeError2( + "msg.bad.parms", types[i].getName(), methodName); + } + typeTags[i] = (byte)tag; + } + } + } + + if (member.isMethod()) { + Method method = member.method(); + Class returnType = method.getReturnType(); + if (returnType == Void.TYPE) { + hasVoidReturn = true; + } else { + returnTypeTag = getTypeTag(returnType); + } + } else { + Class ctorType = member.getDeclaringClass(); + if (!ScriptRuntime.ScriptableClass.isAssignableFrom(ctorType)) { + throw Context.reportRuntimeError1( + "msg.bad.ctor.return", ctorType.getName()); + } + } + + ScriptRuntime.setFunctionProtoAndParent(this, scope); + } + + /** + * @return One of JAVA_*_TYPE constants to indicate desired type + * or {@link #JAVA_UNSUPPORTED_TYPE} if the convertion is not + * possible + */ + public static int getTypeTag(Class type) + { + if (type == ScriptRuntime.StringClass) + return JAVA_STRING_TYPE; + if (type == ScriptRuntime.IntegerClass || type == Integer.TYPE) + return JAVA_INT_TYPE; + if (type == ScriptRuntime.BooleanClass || type == Boolean.TYPE) + return JAVA_BOOLEAN_TYPE; + if (type == ScriptRuntime.DoubleClass || type == Double.TYPE) + return JAVA_DOUBLE_TYPE; + if (ScriptRuntime.ScriptableClass.isAssignableFrom(type)) + return JAVA_SCRIPTABLE_TYPE; + if (type == ScriptRuntime.ObjectClass) + return JAVA_OBJECT_TYPE; + + // Note that the long type is not supported; see the javadoc for + // the constructor for this class + + return JAVA_UNSUPPORTED_TYPE; + } + + public static Object convertArg(Context cx, Scriptable scope, + Object arg, int typeTag) + { + switch (typeTag) { + case JAVA_STRING_TYPE: + if (arg instanceof String) + return arg; + return ScriptRuntime.toString(arg); + case JAVA_INT_TYPE: + if (arg instanceof Integer) + return arg; + return new Integer(ScriptRuntime.toInt32(arg)); + case JAVA_BOOLEAN_TYPE: + if (arg instanceof Boolean) + return arg; + return ScriptRuntime.toBoolean(arg) ? Boolean.TRUE + : Boolean.FALSE; + case JAVA_DOUBLE_TYPE: + if (arg instanceof Double) + return arg; + return new Double(ScriptRuntime.toNumber(arg)); + case JAVA_SCRIPTABLE_TYPE: + return ScriptRuntime.toObjectOrNull(cx, arg, scope); + case JAVA_OBJECT_TYPE: + return arg; + default: + throw new IllegalArgumentException(); + } + } + + /** + * Return the value defined by the method used to construct the object + * (number of parameters of the method, or 1 if the method is a "varargs" + * form). + */ + @Override + public int getArity() { + return parmsLength < 0 ? 1 : parmsLength; + } + + /** + * Return the same value as {@link #getArity()}. + */ + @Override + public int getLength() { + return getArity(); + } + + @Override + public String getFunctionName() + { + return (functionName == null) ? "" : functionName; + } + + /** + * Get Java method or constructor this function represent. + */ + public Member getMethodOrConstructor() + { + if (member.isMethod()) { + return member.method(); + } else { + return member.ctor(); + } + } + + static Method findSingleMethod(Method[] methods, String name) + { + Method found = null; + for (int i = 0, N = methods.length; i != N; ++i) { + Method method = methods[i]; + if (method != null && name.equals(method.getName())) { + if (found != null) { + throw Context.reportRuntimeError2( + "msg.no.overload", name, + method.getDeclaringClass().getName()); + } + found = method; + } + } + return found; + } + + /** + * Returns all public methods declared by the specified class. This excludes + * inherited methods. + * + * @param clazz the class from which to pull public declared methods + * @return the public methods declared in the specified class + * @see Class#getDeclaredMethods() + */ + static Method[] getMethodList(Class clazz) { + Method[] methods = null; + try { + // getDeclaredMethods may be rejected by the security manager + // but getMethods is more expensive + if (!sawSecurityException) + methods = clazz.getDeclaredMethods(); + } catch (SecurityException e) { + // If we get an exception once, give up on getDeclaredMethods + sawSecurityException = true; + } + if (methods == null) { + methods = clazz.getMethods(); + } + int count = 0; + for (int i=0; i < methods.length; i++) { + if (sawSecurityException + ? methods[i].getDeclaringClass() != clazz + : !Modifier.isPublic(methods[i].getModifiers())) + { + methods[i] = null; + } else { + count++; + } + } + Method[] result = new Method[count]; + int j=0; + for (int i=0; i < methods.length; i++) { + if (methods[i] != null) + result[j++] = methods[i]; + } + return result; + } + + /** + * Define this function as a JavaScript constructor. + *

+ * Sets up the "prototype" and "constructor" properties. Also + * calls setParent and setPrototype with appropriate values. + * Then adds the function object as a property of the given scope, using + * prototype.getClassName() + * as the name of the property. + * + * @param scope the scope in which to define the constructor (typically + * the global object) + * @param prototype the prototype object + * @see org.mozilla.javascript.Scriptable#setParentScope + * @see org.mozilla.javascript.Scriptable#setPrototype + * @see org.mozilla.javascript.Scriptable#getClassName + */ + public void addAsConstructor(Scriptable scope, Scriptable prototype) + { + initAsConstructor(scope, prototype); + defineProperty(scope, prototype.getClassName(), + this, ScriptableObject.DONTENUM); + } + + void initAsConstructor(Scriptable scope, Scriptable prototype) + { + ScriptRuntime.setFunctionProtoAndParent(this, scope); + setImmunePrototypeProperty(prototype); + + prototype.setParentScope(this); + + defineProperty(prototype, "constructor", this, + ScriptableObject.DONTENUM | + ScriptableObject.PERMANENT | + ScriptableObject.READONLY); + setParentScope(scope); + } + + /** + * @deprecated Use {@link #getTypeTag(Class)} + * and {@link #convertArg(Context, Scriptable, Object, int)} + * for type conversion. + */ + public static Object convertArg(Context cx, Scriptable scope, + Object arg, Class desired) + { + int tag = getTypeTag(desired); + if (tag == JAVA_UNSUPPORTED_TYPE) { + throw Context.reportRuntimeError1 + ("msg.cant.convert", desired.getName()); + } + return convertArg(cx, scope, arg, tag); + } + + /** + * Performs conversions on argument types if needed and + * invokes the underlying Java method or constructor. + *

+ * Implements Function.call. + * + * @see org.mozilla.javascript.Function#call( + * Context, Scriptable, Scriptable, Object[]) + */ + @Override + public Object call(Context cx, Scriptable scope, Scriptable thisObj, + Object[] args) + { + Object result; + boolean checkMethodResult = false; + + if (parmsLength < 0) { + if (parmsLength == VARARGS_METHOD) { + Object[] invokeArgs = { cx, thisObj, args, this }; + result = member.invoke(null, invokeArgs); + checkMethodResult = true; + } else { + boolean inNewExpr = (thisObj == null); + Boolean b = inNewExpr ? Boolean.TRUE : Boolean.FALSE; + Object[] invokeArgs = { cx, args, this, b }; + result = (member.isCtor()) + ? member.newInstance(invokeArgs) + : member.invoke(null, invokeArgs); + } + + } else { + if (!isStatic) { + Class clazz = member.getDeclaringClass(); + if (!clazz.isInstance(thisObj)) { + boolean compatible = false; + if (thisObj == scope) { + Scriptable parentScope = getParentScope(); + if (scope != parentScope) { + // Call with dynamic scope for standalone function, + // use parentScope as thisObj + compatible = clazz.isInstance(parentScope); + if (compatible) { + thisObj = parentScope; + } + } + } + if (!compatible) { + // Couldn't find an object to call this on. + throw ScriptRuntime.typeError1("msg.incompat.call", + functionName); + } + } + } + + Object[] invokeArgs; + if (parmsLength == args.length) { + // Do not allocate new argument array if java arguments are + // the same as the original js ones. + invokeArgs = args; + for (int i = 0; i != parmsLength; ++i) { + Object arg = args[i]; + Object converted = convertArg(cx, scope, arg, typeTags[i]); + if (arg != converted) { + if (invokeArgs == args) { + invokeArgs = args.clone(); + } + invokeArgs[i] = converted; + } + } + } else if (parmsLength == 0) { + invokeArgs = ScriptRuntime.emptyArgs; + } else { + invokeArgs = new Object[parmsLength]; + for (int i = 0; i != parmsLength; ++i) { + Object arg = (i < args.length) + ? args[i] + : Undefined.instance; + invokeArgs[i] = convertArg(cx, scope, arg, typeTags[i]); + } + } + + if (member.isMethod()) { + result = member.invoke(thisObj, invokeArgs); + checkMethodResult = true; + } else { + result = member.newInstance(invokeArgs); + } + + } + + if (checkMethodResult) { + if (hasVoidReturn) { + result = Undefined.instance; + } else if (returnTypeTag == JAVA_UNSUPPORTED_TYPE) { + result = cx.getWrapFactory().wrap(cx, scope, result, null); + } + // XXX: the code assumes that if returnTypeTag == JAVA_OBJECT_TYPE + // then the Java method did a proper job of converting the + // result to JS primitive or Scriptable to avoid + // potentially costly Context.javaToJS call. + } + + return result; + } + + /** + * Return new {@link Scriptable} instance using the default + * constructor for the class of the underlying Java method. + * Return null to indicate that the call method should be used to create + * new objects. + */ + @Override + public Scriptable createObject(Context cx, Scriptable scope) { + if (member.isCtor() || parmsLength == VARARGS_CTOR) { + return null; + } + Scriptable result; + try { + result = (Scriptable) member.getDeclaringClass().newInstance(); + } catch (Exception ex) { + throw Context.throwAsScriptRuntimeEx(ex); + } + + result.setPrototype(getClassPrototype()); + result.setParentScope(getParentScope()); + return result; + } + + boolean isVarArgsMethod() { + return parmsLength == VARARGS_METHOD; + } + + boolean isVarArgsConstructor() { + return parmsLength == VARARGS_CTOR; + } + + private void readObject(ObjectInputStream in) + throws IOException, ClassNotFoundException + { + in.defaultReadObject(); + if (parmsLength > 0) { + Class[] types = member.argTypes; + typeTags = new byte[parmsLength]; + for (int i = 0; i != parmsLength; ++i) { + typeTags[i] = (byte)getTypeTag(types[i]); + } + } + if (member.isMethod()) { + Method method = member.method(); + Class returnType = method.getReturnType(); + if (returnType == Void.TYPE) { + hasVoidReturn = true; + } else { + returnTypeTag = getTypeTag(returnType); + } + } + } + + private static final short VARARGS_METHOD = -1; + private static final short VARARGS_CTOR = -2; + + private static boolean sawSecurityException; + + public static final int JAVA_UNSUPPORTED_TYPE = 0; + public static final int JAVA_STRING_TYPE = 1; + public static final int JAVA_INT_TYPE = 2; + public static final int JAVA_BOOLEAN_TYPE = 3; + public static final int JAVA_DOUBLE_TYPE = 4; + public static final int JAVA_SCRIPTABLE_TYPE = 5; + public static final int JAVA_OBJECT_TYPE = 6; + + MemberBox member; + private String functionName; + private transient byte[] typeTags; + private int parmsLength; + private transient boolean hasVoidReturn; + private transient int returnTypeTag; + private boolean isStatic; +} diff --git a/org/mozilla/javascript/GeneratedClassLoader.java b/org/mozilla/javascript/GeneratedClassLoader.java new file mode 100644 index 0000000..fb5ecf6 --- /dev/null +++ b/org/mozilla/javascript/GeneratedClassLoader.java @@ -0,0 +1,66 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-1999 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +// API class + +package org.mozilla.javascript; + +/** + * Interface to define classes from generated byte code. + */ +public interface GeneratedClassLoader { + + /** + * Define a new Java class. + * Classes created via this method should have the same class loader. + * + * @param name fully qualified class name + * @param data class byte code + * @return new class object + */ + public Class defineClass(String name, byte[] data); + + /** + * Link the given class. + * + * @param cl Class instance returned from the previous call to + * {@link #defineClass(String, byte[])} + * @see java.lang.ClassLoader + */ + public void linkClass(Class cl); +} diff --git a/org/mozilla/javascript/IRFactory.java b/org/mozilla/javascript/IRFactory.java new file mode 100644 index 0000000..401c911 --- /dev/null +++ b/org/mozilla/javascript/IRFactory.java @@ -0,0 +1,1607 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-1999 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Norris Boyd + * Igor Bukanov + * Ethan Hugg + * Bob Jervis + * Terry Lucas + * Milen Nankov + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +package org.mozilla.javascript; + +import java.util.List; +import java.util.ArrayList; + +/** + * This class allows the creation of nodes, and follows the Factory pattern. + * + * @see Node + * @author Mike McCabe + * @author Norris Boyd + */ +final class IRFactory +{ + IRFactory(Parser parser) + { + this.parser = parser; + } + + ScriptOrFnNode createScript() + { + return new ScriptOrFnNode(Token.SCRIPT); + } + + /** + * Script (for associating file/url names with toplevel scripts.) + */ + void initScript(ScriptOrFnNode scriptNode, Node body) + { + Node children = body.getFirstChild(); + if (children != null) { scriptNode.addChildrenToBack(children); } + } + + /** + * Leaf + */ + Node createLeaf(int nodeType) + { + return new Node(nodeType); + } + + /** + * Statement leaf nodes. + */ + + Node createSwitch(Node expr, int lineno) + { + // + // The switch will be rewritten from: + // + // switch (expr) { + // case test1: statements1; + // ... + // default: statementsDefault; + // ... + // case testN: statementsN; + // } + // + // to: + // + // { + // switch (expr) { + // case test1: goto label1; + // ... + // case testN: goto labelN; + // } + // goto labelDefault; + // label1: + // statements1; + // ... + // labelDefault: + // statementsDefault; + // ... + // labelN: + // statementsN; + // breakLabel: + // } + // + // where inside switch each "break;" without label will be replaced + // by "goto breakLabel". + // + // If the original switch does not have the default label, then + // the transformed code would contain after the switch instead of + // goto labelDefault; + // the following goto: + // goto breakLabel; + // + + Node.Jump switchNode = new Node.Jump(Token.SWITCH, expr, lineno); + Node block = new Node(Token.BLOCK, switchNode); + return block; + } + + /** + * If caseExpression argument is null it indicate default label. + */ + void addSwitchCase(Node switchBlock, Node caseExpression, Node statements) + { + if (switchBlock.getType() != Token.BLOCK) throw Kit.codeBug(); + Node.Jump switchNode = (Node.Jump)switchBlock.getFirstChild(); + if (switchNode.getType() != Token.SWITCH) throw Kit.codeBug(); + + Node gotoTarget = Node.newTarget(); + if (caseExpression != null) { + Node.Jump caseNode = new Node.Jump(Token.CASE, caseExpression); + caseNode.target = gotoTarget; + switchNode.addChildToBack(caseNode); + } else { + switchNode.setDefault(gotoTarget); + } + switchBlock.addChildToBack(gotoTarget); + switchBlock.addChildToBack(statements); + } + + void closeSwitch(Node switchBlock) + { + if (switchBlock.getType() != Token.BLOCK) throw Kit.codeBug(); + Node.Jump switchNode = (Node.Jump)switchBlock.getFirstChild(); + if (switchNode.getType() != Token.SWITCH) throw Kit.codeBug(); + + Node switchBreakTarget = Node.newTarget(); + // switchNode.target is only used by NodeTransformer + // to detect switch end + switchNode.target = switchBreakTarget; + + Node defaultTarget = switchNode.getDefault(); + if (defaultTarget == null) { + defaultTarget = switchBreakTarget; + } + + switchBlock.addChildAfter(makeJump(Token.GOTO, defaultTarget), + switchNode); + switchBlock.addChildToBack(switchBreakTarget); + } + + Node createVariables(int token, int lineno) + { + return new Node(token, lineno); + } + + Node createExprStatement(Node expr, int lineno) + { + int type; + if (parser.insideFunction()) { + type = Token.EXPR_VOID; + } else { + type = Token.EXPR_RESULT; + } + return new Node(type, expr, lineno); + } + + Node createExprStatementNoReturn(Node expr, int lineno) + { + return new Node(Token.EXPR_VOID, expr, lineno); + } + + Node createDefaultNamespace(Node expr, int lineno) + { + // default xml namespace requires activation + setRequiresActivation(); + Node n = createUnary(Token.DEFAULTNAMESPACE, expr); + Node result = createExprStatement(n, lineno); + return result; + } + + /** + * Name + */ + Node createName(String name) + { + checkActivationName(name, Token.NAME); + return Node.newString(Token.NAME, name); + } + + private Node createName(int type, String name, Node child) + { + Node result = createName(name); + result.setType(type); + if (child != null) + result.addChildToBack(child); + return result; + } + + /** + * String (for literals) + */ + Node createString(String string) + { + return Node.newString(string); + } + + /** + * Number (for literals) + */ + Node createNumber(double number) + { + return Node.newNumber(number); + } + + /** + * Catch clause of try/catch/finally + * @param varName the name of the variable to bind to the exception + * @param catchCond the condition under which to catch the exception. + * May be null if no condition is given. + * @param stmts the statements in the catch clause + * @param lineno the starting line number of the catch clause + */ + Node createCatch(String varName, Node catchCond, Node stmts, int lineno) + { + if (catchCond == null) { + catchCond = new Node(Token.EMPTY); + } + return new Node(Token.CATCH, createName(varName), + catchCond, stmts, lineno); + } + + /** + * Throw + */ + Node createThrow(Node expr, int lineno) + { + return new Node(Token.THROW, expr, lineno); + } + + /** + * Return + */ + Node createReturn(Node expr, int lineno) + { + return expr == null + ? new Node(Token.RETURN, lineno) + : new Node(Token.RETURN, expr, lineno); + } + + /** + * Debugger + */ + Node createDebugger(int lineno) + { + return new Node(Token.DEBUGGER, lineno); + } + + /** + * Label + */ + Node createLabel(int lineno) + { + return new Node.Jump(Token.LABEL, lineno); + } + + Node getLabelLoop(Node label) + { + return ((Node.Jump)label).getLoop(); + } + + /** + * Label + */ + Node createLabeledStatement(Node labelArg, Node statement) + { + Node.Jump label = (Node.Jump)labelArg; + + // Make a target and put it _after_ the statement + // node. And in the LABEL node, so breaks get the + // right target. + + Node breakTarget = Node.newTarget(); + Node block = new Node(Token.BLOCK, label, statement, breakTarget); + label.target = breakTarget; + + return block; + } + + /** + * Break (possibly labeled) + */ + Node createBreak(Node breakStatement, int lineno) + { + Node.Jump n = new Node.Jump(Token.BREAK, lineno); + Node.Jump jumpStatement; + int t = breakStatement.getType(); + if (t == Token.LOOP || t == Token.LABEL) { + jumpStatement = (Node.Jump)breakStatement; + } else if (t == Token.BLOCK + && breakStatement.getFirstChild().getType() == Token.SWITCH) + { + jumpStatement = (Node.Jump)breakStatement.getFirstChild(); + } else { + throw Kit.codeBug(); + } + n.setJumpStatement(jumpStatement); + return n; + } + + /** + * Continue (possibly labeled) + */ + Node createContinue(Node loop, int lineno) + { + if (loop.getType() != Token.LOOP) Kit.codeBug(); + Node.Jump n = new Node.Jump(Token.CONTINUE, lineno); + n.setJumpStatement((Node.Jump)loop); + return n; + } + + /** + * Statement block + * Creates the empty statement block + * Must make subsequent calls to add statements to the node + */ + Node createBlock(int lineno) + { + return new Node(Token.BLOCK, lineno); + } + + FunctionNode createFunction(String name) + { + return new FunctionNode(name); + } + + Node initFunction(FunctionNode fnNode, int functionIndex, + Node statements, int functionType) + { + fnNode.itsFunctionType = functionType; + fnNode.addChildToBack(statements); + + int functionCount = fnNode.getFunctionCount(); + if (functionCount != 0) { + // Functions containing other functions require activation objects + fnNode.itsNeedsActivation = true; + } + + if (functionType == FunctionNode.FUNCTION_EXPRESSION) { + String name = fnNode.getFunctionName(); + if (name != null && name.length() != 0) { + // A function expression needs to have its name as a + // variable (if it isn't already allocated as a variable). + // See ECMA Ch. 13. We add code to the beginning of the + // function to initialize a local variable of the + // function's name to the function value. + Node setFn = new Node(Token.EXPR_VOID, + new Node(Token.SETNAME, + Node.newString(Token.BINDNAME, name), + new Node(Token.THISFN))); + statements.addChildrenToFront(setFn); + } + } + + // Add return to end if needed. + Node lastStmt = statements.getLastChild(); + if (lastStmt == null || lastStmt.getType() != Token.RETURN) { + statements.addChildToBack(new Node(Token.RETURN)); + } + + Node result = Node.newString(Token.FUNCTION, + fnNode.getFunctionName()); + result.putIntProp(Node.FUNCTION_PROP, functionIndex); + return result; + } + + /** + * Add a child to the back of the given node. This function + * breaks the Factory abstraction, but it removes a requirement + * from implementors of Node. + */ + void addChildToBack(Node parent, Node child) + { + parent.addChildToBack(child); + } + + /** + * Create a node that can be used to hold lexically scoped variable + * definitions (via let declarations). + * + * @param token the token of the node to create + * @param lineno line number of source + * @return the created node + */ + Node createScopeNode(int token, int lineno) { + return new Node.Scope(token, lineno); + } + + /** + * Create loop node. The parser will later call + * createWhile|createDoWhile|createFor|createForIn + * to finish loop generation. + */ + Node createLoopNode(Node loopLabel, int lineno) + { + Node.Jump result = new Node.Scope(Token.LOOP, lineno); + if (loopLabel != null) { + ((Node.Jump)loopLabel).setLoop(result); + } + return result; + } + + /** + * While + */ + Node createWhile(Node loop, Node cond, Node body) + { + return createLoop((Node.Jump)loop, LOOP_WHILE, body, cond, + null, null); + } + + /** + * DoWhile + */ + Node createDoWhile(Node loop, Node body, Node cond) + { + return createLoop((Node.Jump)loop, LOOP_DO_WHILE, body, cond, + null, null); + } + + /** + * For + */ + Node createFor(Node loop, Node init, Node test, Node incr, Node body) + { + if (init.getType() == Token.LET) { + // rewrite "for (let i=s; i < N; i++)..." as + // "let (i=s) { for (; i < N; i++)..." so that "s" is evaluated + // outside the scope of the for. + Node.Scope let = Node.Scope.splitScope((Node.Scope)loop); + let.setType(Token.LET); + let.addChildrenToBack(init); + let.addChildToBack(createLoop((Node.Jump)loop, LOOP_FOR, body, test, + new Node(Token.EMPTY), incr)); + return let; + } + return createLoop((Node.Jump)loop, LOOP_FOR, body, test, init, incr); + } + + private Node createLoop(Node.Jump loop, int loopType, Node body, Node cond, + Node init, Node incr) + { + Node bodyTarget = Node.newTarget(); + Node condTarget = Node.newTarget(); + if (loopType == LOOP_FOR && cond.getType() == Token.EMPTY) { + cond = new Node(Token.TRUE); + } + Node.Jump IFEQ = new Node.Jump(Token.IFEQ, cond); + IFEQ.target = bodyTarget; + Node breakTarget = Node.newTarget(); + + loop.addChildToBack(bodyTarget); + loop.addChildrenToBack(body); + if (loopType == LOOP_WHILE || loopType == LOOP_FOR) { + // propagate lineno to condition + loop.addChildrenToBack(new Node(Token.EMPTY, loop.getLineno())); + } + loop.addChildToBack(condTarget); + loop.addChildToBack(IFEQ); + loop.addChildToBack(breakTarget); + + loop.target = breakTarget; + Node continueTarget = condTarget; + + if (loopType == LOOP_WHILE || loopType == LOOP_FOR) { + // Just add a GOTO to the condition in the do..while + loop.addChildToFront(makeJump(Token.GOTO, condTarget)); + + if (loopType == LOOP_FOR) { + int initType = init.getType(); + if (initType != Token.EMPTY) { + if (initType != Token.VAR && initType != Token.LET) { + init = new Node(Token.EXPR_VOID, init); + } + loop.addChildToFront(init); + } + Node incrTarget = Node.newTarget(); + loop.addChildAfter(incrTarget, body); + if (incr.getType() != Token.EMPTY) { + incr = new Node(Token.EXPR_VOID, incr); + loop.addChildAfter(incr, incrTarget); + } + continueTarget = incrTarget; + } + } + + loop.setContinue(continueTarget); + + return loop; + } + + /** + * For .. In + * + */ + Node createForIn(int declType, Node loop, Node lhs, Node obj, Node body, + boolean isForEach) + { + int destructuring = -1; + int destructuringLen = 0; + Node lvalue; + int type = lhs.getType(); + if (type == Token.VAR || type == Token.LET) { + Node lastChild = lhs.getLastChild(); + if (lhs.getFirstChild() != lastChild) { + /* + * check that there was only one variable given. + * we can't do this in the parser, because then the + * parser would have to know something about the + * 'init' node of the for-in loop. + */ + parser.reportError("msg.mult.index"); + } + if (lastChild.getType() == Token.ARRAYLIT || + lastChild.getType() == Token.OBJECTLIT) + { + type = destructuring = lastChild.getType(); + lvalue = lastChild; + destructuringLen = lastChild.getIntProp( + Node.DESTRUCTURING_ARRAY_LENGTH, 0); + } else if (lastChild.getType() == Token.NAME) { + lvalue = Node.newString(Token.NAME, lastChild.getString()); + } else { + parser.reportError("msg.bad.for.in.lhs"); + return obj; + } + } else if (type == Token.ARRAYLIT || type == Token.OBJECTLIT) { + destructuring = type; + lvalue = lhs; + destructuringLen = lhs.getIntProp(Node.DESTRUCTURING_ARRAY_LENGTH, 0); + } else { + lvalue = makeReference(lhs); + if (lvalue == null) { + parser.reportError("msg.bad.for.in.lhs"); + return obj; + } + } + + Node localBlock = new Node(Token.LOCAL_BLOCK); + int initType = (isForEach) ? Token.ENUM_INIT_VALUES : + (destructuring != -1) ? Token.ENUM_INIT_ARRAY : + Token.ENUM_INIT_KEYS; + Node init = new Node(initType, obj); + init.putProp(Node.LOCAL_BLOCK_PROP, localBlock); + Node cond = new Node(Token.ENUM_NEXT); + cond.putProp(Node.LOCAL_BLOCK_PROP, localBlock); + Node id = new Node(Token.ENUM_ID); + id.putProp(Node.LOCAL_BLOCK_PROP, localBlock); + + Node newBody = new Node(Token.BLOCK); + Node assign; + if (destructuring != -1) { + assign = createDestructuringAssignment(declType, lvalue, id); + if (!isForEach && (destructuring == Token.OBJECTLIT || + destructuringLen != 2)) + { + // destructuring assignment is only allowed in for..each or + // with an array type of length 2 (to hold key and value) + parser.reportError("msg.bad.for.in.destruct"); + } + } else { + assign = simpleAssignment(lvalue, id); + } + newBody.addChildToBack(new Node(Token.EXPR_VOID, assign)); + newBody.addChildToBack(body); + + loop = createWhile(loop, cond, newBody); + loop.addChildToFront(init); + if (type == Token.VAR || type == Token.LET) + loop.addChildToFront(lhs); + localBlock.addChildToBack(loop); + + return localBlock; + } + + /** + * Try/Catch/Finally + * + * The IRFactory tries to express as much as possible in the tree; + * the responsibilities remaining for Codegen are to add the Java + * handlers: (Either (but not both) of TARGET and FINALLY might not + * be defined) + + * - a catch handler for javascript exceptions that unwraps the + * exception onto the stack and GOTOes to the catch target + + * - a finally handler + + * ... and a goto to GOTO around these handlers. + */ + Node createTryCatchFinally(Node tryBlock, Node catchBlocks, + Node finallyBlock, int lineno) + { + boolean hasFinally = (finallyBlock != null) + && (finallyBlock.getType() != Token.BLOCK + || finallyBlock.hasChildren()); + + // short circuit + if (tryBlock.getType() == Token.BLOCK && !tryBlock.hasChildren() + && !hasFinally) + { + return tryBlock; + } + + boolean hasCatch = catchBlocks.hasChildren(); + + // short circuit + if (!hasFinally && !hasCatch) { + // bc finally might be an empty block... + return tryBlock; + } + + + Node handlerBlock = new Node(Token.LOCAL_BLOCK); + Node.Jump pn = new Node.Jump(Token.TRY, tryBlock, lineno); + pn.putProp(Node.LOCAL_BLOCK_PROP, handlerBlock); + + if (hasCatch) { + // jump around catch code + Node endCatch = Node.newTarget(); + pn.addChildToBack(makeJump(Token.GOTO, endCatch)); + + // make a TARGET for the catch that the tcf node knows about + Node catchTarget = Node.newTarget(); + pn.target = catchTarget; + // mark it + pn.addChildToBack(catchTarget); + + // + // Given + // + // try { + // tryBlock; + // } catch (e if condition1) { + // something1; + // ... + // + // } catch (e if conditionN) { + // somethingN; + // } catch (e) { + // somethingDefault; + // } + // + // rewrite as + // + // try { + // tryBlock; + // goto after_catch: + // } catch (x) { + // with (newCatchScope(e, x)) { + // if (condition1) { + // something1; + // goto after_catch; + // } + // } + // ... + // with (newCatchScope(e, x)) { + // if (conditionN) { + // somethingN; + // goto after_catch; + // } + // } + // with (newCatchScope(e, x)) { + // somethingDefault; + // goto after_catch; + // } + // } + // after_catch: + // + // If there is no default catch, then the last with block + // arround "somethingDefault;" is replaced by "rethrow;" + + // It is assumed that catch handler generation will store + // exeception object in handlerBlock register + + // Block with local for exception scope objects + Node catchScopeBlock = new Node(Token.LOCAL_BLOCK); + + // expects catchblocks children to be (cond block) pairs. + Node cb = catchBlocks.getFirstChild(); + boolean hasDefault = false; + int scopeIndex = 0; + while (cb != null) { + int catchLineNo = cb.getLineno(); + + Node name = cb.getFirstChild(); + Node cond = name.getNext(); + Node catchStatement = cond.getNext(); + cb.removeChild(name); + cb.removeChild(cond); + cb.removeChild(catchStatement); + + // Add goto to the catch statement to jump out of catch + // but prefix it with LEAVEWITH since try..catch produces + // "with"code in order to limit the scope of the exception + // object. + catchStatement.addChildToBack(new Node(Token.LEAVEWITH)); + catchStatement.addChildToBack(makeJump(Token.GOTO, endCatch)); + + // Create condition "if" when present + Node condStmt; + if (cond.getType() == Token.EMPTY) { + condStmt = catchStatement; + hasDefault = true; + } else { + condStmt = createIf(cond, catchStatement, null, + catchLineNo); + } + + // Generate code to create the scope object and store + // it in catchScopeBlock register + Node catchScope = new Node(Token.CATCH_SCOPE, name, + createUseLocal(handlerBlock)); + catchScope.putProp(Node.LOCAL_BLOCK_PROP, catchScopeBlock); + catchScope.putIntProp(Node.CATCH_SCOPE_PROP, scopeIndex); + catchScopeBlock.addChildToBack(catchScope); + + // Add with statement based on catch scope object + catchScopeBlock.addChildToBack( + createWith(createUseLocal(catchScopeBlock), condStmt, + catchLineNo)); + + // move to next cb + cb = cb.getNext(); + ++scopeIndex; + } + pn.addChildToBack(catchScopeBlock); + if (!hasDefault) { + // Generate code to rethrow if no catch clause was executed + Node rethrow = new Node(Token.RETHROW); + rethrow.putProp(Node.LOCAL_BLOCK_PROP, handlerBlock); + pn.addChildToBack(rethrow); + } + + pn.addChildToBack(endCatch); + } + + if (hasFinally) { + Node finallyTarget = Node.newTarget(); + pn.setFinally(finallyTarget); + + // add jsr finally to the try block + pn.addChildToBack(makeJump(Token.JSR, finallyTarget)); + + // jump around finally code + Node finallyEnd = Node.newTarget(); + pn.addChildToBack(makeJump(Token.GOTO, finallyEnd)); + + pn.addChildToBack(finallyTarget); + Node fBlock = new Node(Token.FINALLY, finallyBlock); + fBlock.putProp(Node.LOCAL_BLOCK_PROP, handlerBlock); + pn.addChildToBack(fBlock); + + pn.addChildToBack(finallyEnd); + } + handlerBlock.addChildToBack(pn); + return handlerBlock; + } + + /** + * Throw, Return, Label, Break and Continue are defined in ASTFactory. + */ + + /** + * With + */ + Node createWith(Node obj, Node body, int lineno) + { + setRequiresActivation(); + Node result = new Node(Token.BLOCK, lineno); + result.addChildToBack(new Node(Token.ENTERWITH, obj)); + Node bodyNode = new Node(Token.WITH, body, lineno); + result.addChildrenToBack(bodyNode); + result.addChildToBack(new Node(Token.LEAVEWITH)); + return result; + } + + /** + * DOTQUERY + */ + public Node createDotQuery (Node obj, Node body, int lineno) + { + setRequiresActivation(); + Node result = new Node(Token.DOTQUERY, obj, body, lineno); + return result; + } + + Node createArrayLiteral(ObjArray elems, int skipCount, int destructuringLen) + { + int length = elems.size(); + int[] skipIndexes = null; + if (skipCount != 0) { + skipIndexes = new int[skipCount]; + } + Node array = new Node(Token.ARRAYLIT); + for (int i = 0, j = 0; i != length; ++i) { + Node elem = (Node)elems.get(i); + if (elem != null) { + array.addChildToBack(elem); + } else { + skipIndexes[j] = i; + ++j; + } + } + if (skipCount != 0) { + array.putProp(Node.SKIP_INDEXES_PROP, skipIndexes); + } + array.putIntProp(Node.DESTRUCTURING_ARRAY_LENGTH, destructuringLen); + return array; + } + + /** + * Object Literals + *
createObjectLiteral rewrites its argument as object + * creation plus object property entries, so later compiler + * stages don't need to know about object literals. + */ + Node createObjectLiteral(ObjArray elems) + { + int size = elems.size() / 2; + Node object = new Node(Token.OBJECTLIT); + Object[] properties; + if (size == 0) { + properties = ScriptRuntime.emptyArgs; + } else { + properties = new Object[size]; + for (int i = 0; i != size; ++i) { + properties[i] = elems.get(2 * i); + Node value = (Node)elems.get(2 * i + 1); + object.addChildToBack(value); + } + } + object.putProp(Node.OBJECT_IDS_PROP, properties); + return object; + } + + /** + * Regular expressions + */ + Node createRegExp(int regexpIndex) + { + Node n = new Node(Token.REGEXP); + n.putIntProp(Node.REGEXP_PROP, regexpIndex); + return n; + } + + /** + * If statement + */ + Node createIf(Node cond, Node ifTrue, Node ifFalse, int lineno) + { + int condStatus = isAlwaysDefinedBoolean(cond); + if (condStatus == ALWAYS_TRUE_BOOLEAN) { + return ifTrue; + } else if (condStatus == ALWAYS_FALSE_BOOLEAN) { + if (ifFalse != null) { + return ifFalse; + } + // Replace if (false) xxx by empty block + return new Node(Token.BLOCK, lineno); + } + + Node result = new Node(Token.BLOCK, lineno); + Node ifNotTarget = Node.newTarget(); + Node.Jump IFNE = new Node.Jump(Token.IFNE, cond); + IFNE.target = ifNotTarget; + + result.addChildToBack(IFNE); + result.addChildrenToBack(ifTrue); + + if (ifFalse != null) { + Node endTarget = Node.newTarget(); + result.addChildToBack(makeJump(Token.GOTO, endTarget)); + result.addChildToBack(ifNotTarget); + result.addChildrenToBack(ifFalse); + result.addChildToBack(endTarget); + } else { + result.addChildToBack(ifNotTarget); + } + + return result; + } + + Node createCondExpr(Node cond, Node ifTrue, Node ifFalse) + { + int condStatus = isAlwaysDefinedBoolean(cond); + if (condStatus == ALWAYS_TRUE_BOOLEAN) { + return ifTrue; + } else if (condStatus == ALWAYS_FALSE_BOOLEAN) { + return ifFalse; + } + return new Node(Token.HOOK, cond, ifTrue, ifFalse); + } + + /** + * Unary + */ + Node createUnary(int nodeType, Node child) + { + int childType = child.getType(); + switch (nodeType) { + case Token.DELPROP: { + Node n; + if (childType == Token.NAME) { + // Transform Delete(Name "a") + // to Delete(Bind("a"), String("a")) + child.setType(Token.BINDNAME); + Node left = child; + Node right = Node.newString(child.getString()); + n = new Node(nodeType, left, right); + } else if (childType == Token.GETPROP || + childType == Token.GETELEM) + { + Node left = child.getFirstChild(); + Node right = child.getLastChild(); + child.removeChild(left); + child.removeChild(right); + n = new Node(nodeType, left, right); + } else if (childType == Token.GET_REF) { + Node ref = child.getFirstChild(); + child.removeChild(ref); + n = new Node(Token.DEL_REF, ref); + } else { + n = new Node(Token.TRUE); + } + return n; + } + case Token.TYPEOF: + if (childType == Token.NAME) { + child.setType(Token.TYPEOFNAME); + return child; + } + break; + case Token.BITNOT: + if (childType == Token.NUMBER) { + int value = ScriptRuntime.toInt32(child.getDouble()); + child.setDouble(~value); + return child; + } + break; + case Token.NEG: + if (childType == Token.NUMBER) { + child.setDouble(-child.getDouble()); + return child; + } + break; + case Token.NOT: { + int status = isAlwaysDefinedBoolean(child); + if (status != 0) { + int type; + if (status == ALWAYS_TRUE_BOOLEAN) { + type = Token.FALSE; + } else { + type = Token.TRUE; + } + if (childType == Token.TRUE || childType == Token.FALSE) { + child.setType(type); + return child; + } + return new Node(type); + } + break; + } + } + return new Node(nodeType, child); + } + + Node createYield(Node child, int lineno) + { + if (!parser.insideFunction()) { + parser.reportError("msg.bad.yield"); + } + setRequiresActivation(); + setIsGenerator(); + if (child != null) + return new Node(Token.YIELD, child, lineno); + else + return new Node(Token.YIELD, lineno); + } + + Node createCallOrNew(int nodeType, Node child) + { + int type = Node.NON_SPECIALCALL; + if (child.getType() == Token.NAME) { + String name = child.getString(); + if (name.equals("eval")) { + type = Node.SPECIALCALL_EVAL; + } else if (name.equals("With")) { + type = Node.SPECIALCALL_WITH; + } + } else if (child.getType() == Token.GETPROP) { + String name = child.getLastChild().getString(); + if (name.equals("eval")) { + type = Node.SPECIALCALL_EVAL; + } + } + Node node = new Node(nodeType, child); + if (type != Node.NON_SPECIALCALL) { + // Calls to these functions require activation objects. + setRequiresActivation(); + node.putIntProp(Node.SPECIALCALL_PROP, type); + } + return node; + } + + Node createIncDec(int nodeType, boolean post, Node child) + { + child = makeReference(child); + if (child == null) { + String msg; + if (nodeType == Token.DEC) { + msg = "msg.bad.decr"; + } else { + msg = "msg.bad.incr"; + } + parser.reportError(msg); + return null; + } + + int childType = child.getType(); + + switch (childType) { + case Token.NAME: + case Token.GETPROP: + case Token.GETELEM: + case Token.GET_REF: { + Node n = new Node(nodeType, child); + int incrDecrMask = 0; + if (nodeType == Token.DEC) { + incrDecrMask |= Node.DECR_FLAG; + } + if (post) { + incrDecrMask |= Node.POST_FLAG; + } + n.putIntProp(Node.INCRDECR_PROP, incrDecrMask); + return n; + } + } + throw Kit.codeBug(); + } + + Node createPropertyGet(Node target, String namespace, String name, + int memberTypeFlags) + { + if (namespace == null && memberTypeFlags == 0) { + if (target == null) { + return createName(name); + } + checkActivationName(name, Token.GETPROP); + if (ScriptRuntime.isSpecialProperty(name)) { + Node ref = new Node(Token.REF_SPECIAL, target); + ref.putProp(Node.NAME_PROP, name); + return new Node(Token.GET_REF, ref); + } + return new Node(Token.GETPROP, target, createString(name)); + } + Node elem = createString(name); + memberTypeFlags |= Node.PROPERTY_FLAG; + return createMemberRefGet(target, namespace, elem, memberTypeFlags); + } + + Node createElementGet(Node target, String namespace, Node elem, + int memberTypeFlags) + { + // OPT: could optimize to createPropertyGet + // iff elem is string that can not be number + if (namespace == null && memberTypeFlags == 0) { + // stand-alone [aaa] as primary expression is array literal + // declaration and should not come here! + if (target == null) throw Kit.codeBug(); + return new Node(Token.GETELEM, target, elem); + } + return createMemberRefGet(target, namespace, elem, memberTypeFlags); + } + + private Node createMemberRefGet(Node target, String namespace, Node elem, + int memberTypeFlags) + { + Node nsNode = null; + if (namespace != null) { + // See 11.1.2 in ECMA 357 + if (namespace.equals("*")) { + nsNode = new Node(Token.NULL); + } else { + nsNode = createName(namespace); + } + } + Node ref; + if (target == null) { + if (namespace == null) { + ref = new Node(Token.REF_NAME, elem); + } else { + ref = new Node(Token.REF_NS_NAME, nsNode, elem); + } + } else { + if (namespace == null) { + ref = new Node(Token.REF_MEMBER, target, elem); + } else { + ref = new Node(Token.REF_NS_MEMBER, target, nsNode, elem); + } + } + if (memberTypeFlags != 0) { + ref.putIntProp(Node.MEMBER_TYPE_PROP, memberTypeFlags); + } + return new Node(Token.GET_REF, ref); + } + + /** + * Binary + */ + Node createBinary(int nodeType, Node left, Node right) + { + switch (nodeType) { + + case Token.ADD: + // numerical addition and string concatenation + if (left.type == Token.STRING) { + String s2; + if (right.type == Token.STRING) { + s2 = right.getString(); + } else if (right.type == Token.NUMBER) { + s2 = ScriptRuntime.numberToString(right.getDouble(), 10); + } else { + break; + } + String s1 = left.getString(); + left.setString(s1.concat(s2)); + return left; + } else if (left.type == Token.NUMBER) { + if (right.type == Token.NUMBER) { + left.setDouble(left.getDouble() + right.getDouble()); + return left; + } else if (right.type == Token.STRING) { + String s1, s2; + s1 = ScriptRuntime.numberToString(left.getDouble(), 10); + s2 = right.getString(); + right.setString(s1.concat(s2)); + return right; + } + } + // can't do anything if we don't know both types - since + // 0 + object is supposed to call toString on the object and do + // string concantenation rather than addition + break; + + case Token.SUB: + // numerical subtraction + if (left.type == Token.NUMBER) { + double ld = left.getDouble(); + if (right.type == Token.NUMBER) { + //both numbers + left.setDouble(ld - right.getDouble()); + return left; + } else if (ld == 0.0) { + // first 0: 0-x -> -x + return new Node(Token.NEG, right); + } + } else if (right.type == Token.NUMBER) { + if (right.getDouble() == 0.0) { + //second 0: x - 0 -> +x + // can not make simply x because x - 0 must be number + return new Node(Token.POS, left); + } + } + break; + + case Token.MUL: + // numerical multiplication + if (left.type == Token.NUMBER) { + double ld = left.getDouble(); + if (right.type == Token.NUMBER) { + //both numbers + left.setDouble(ld * right.getDouble()); + return left; + } else if (ld == 1.0) { + // first 1: 1 * x -> +x + return new Node(Token.POS, right); + } + } else if (right.type == Token.NUMBER) { + if (right.getDouble() == 1.0) { + //second 1: x * 1 -> +x + // can not make simply x because x - 0 must be number + return new Node(Token.POS, left); + } + } + // can't do x*0: Infinity * 0 gives NaN, not 0 + break; + + case Token.DIV: + // number division + if (right.type == Token.NUMBER) { + double rd = right.getDouble(); + if (left.type == Token.NUMBER) { + // both constants -- just divide, trust Java to handle x/0 + left.setDouble(left.getDouble() / rd); + return left; + } else if (rd == 1.0) { + // second 1: x/1 -> +x + // not simply x to force number convertion + return new Node(Token.POS, left); + } + } + break; + + case Token.AND: { + // Since x && y gives x, not false, when Boolean(x) is false, + // and y, not Boolean(y), when Boolean(x) is true, x && y + // can only be simplified if x is defined. See bug 309957. + + int leftStatus = isAlwaysDefinedBoolean(left); + if (leftStatus == ALWAYS_FALSE_BOOLEAN) { + // if the first one is false, just return it + return left; + } else if (leftStatus == ALWAYS_TRUE_BOOLEAN) { + // if first is true, set to second + return right; + } + break; + } + + case Token.OR: { + // Since x || y gives x, not true, when Boolean(x) is true, + // and y, not Boolean(y), when Boolean(x) is false, x || y + // can only be simplified if x is defined. See bug 309957. + + int leftStatus = isAlwaysDefinedBoolean(left); + if (leftStatus == ALWAYS_TRUE_BOOLEAN) { + // if the first one is true, just return it + return left; + } else if (leftStatus == ALWAYS_FALSE_BOOLEAN) { + // if first is false, set to second + return right; + } + break; + } + } + + return new Node(nodeType, left, right); + } + + private Node simpleAssignment(Node left, Node right) + { + int nodeType = left.getType(); + switch (nodeType) { + case Token.NAME: + left.setType(Token.BINDNAME); + return new Node(Token.SETNAME, left, right); + + case Token.GETPROP: + case Token.GETELEM: { + Node obj = left.getFirstChild(); + Node id = left.getLastChild(); + int type; + if (nodeType == Token.GETPROP) { + type = Token.SETPROP; + } else { + type = Token.SETELEM; + } + return new Node(type, obj, id, right); + } + case Token.GET_REF: { + Node ref = left.getFirstChild(); + checkMutableReference(ref); + return new Node(Token.SET_REF, ref, right); + } + } + + throw Kit.codeBug(); + } + + private void checkMutableReference(Node n) + { + int memberTypeFlags = n.getIntProp(Node.MEMBER_TYPE_PROP, 0); + if ((memberTypeFlags & Node.DESCENDANTS_FLAG) != 0) { + parser.reportError("msg.bad.assign.left"); + } + } + + Node createAssignment(int assignType, Node left, Node right) + { + Node ref = makeReference(left); + if (ref == null) { + if (left.getType() == Token.ARRAYLIT || + left.getType() == Token.OBJECTLIT) + { + if (assignType != Token.ASSIGN) { + parser.reportError("msg.bad.destruct.op"); + return right; + } + return createDestructuringAssignment(-1, left, right); + } + parser.reportError("msg.bad.assign.left"); + return right; + } + left = ref; + + int assignOp; + switch (assignType) { + case Token.ASSIGN: + return simpleAssignment(left, right); + case Token.ASSIGN_BITOR: assignOp = Token.BITOR; break; + case Token.ASSIGN_BITXOR: assignOp = Token.BITXOR; break; + case Token.ASSIGN_BITAND: assignOp = Token.BITAND; break; + case Token.ASSIGN_LSH: assignOp = Token.LSH; break; + case Token.ASSIGN_RSH: assignOp = Token.RSH; break; + case Token.ASSIGN_URSH: assignOp = Token.URSH; break; + case Token.ASSIGN_ADD: assignOp = Token.ADD; break; + case Token.ASSIGN_SUB: assignOp = Token.SUB; break; + case Token.ASSIGN_MUL: assignOp = Token.MUL; break; + case Token.ASSIGN_DIV: assignOp = Token.DIV; break; + case Token.ASSIGN_MOD: assignOp = Token.MOD; break; + default: throw Kit.codeBug(); + } + + int nodeType = left.getType(); + switch (nodeType) { + case Token.NAME: { + Node op = new Node(assignOp, left, right); + Node lvalueLeft = Node.newString(Token.BINDNAME, left.getString()); + return new Node(Token.SETNAME, lvalueLeft, op); + } + case Token.GETPROP: + case Token.GETELEM: { + Node obj = left.getFirstChild(); + Node id = left.getLastChild(); + + int type = nodeType == Token.GETPROP + ? Token.SETPROP_OP + : Token.SETELEM_OP; + + Node opLeft = new Node(Token.USE_STACK); + Node op = new Node(assignOp, opLeft, right); + return new Node(type, obj, id, op); + } + case Token.GET_REF: { + ref = left.getFirstChild(); + checkMutableReference(ref); + Node opLeft = new Node(Token.USE_STACK); + Node op = new Node(assignOp, opLeft, right); + return new Node(Token.SET_REF_OP, ref, op); + } + } + + throw Kit.codeBug(); + } + + /** + * Given a destructuring assignment with a left hand side parsed + * as an array or object literal and a right hand side expression, + * rewrite as a series of assignments to the variables defined in + * left from property accesses to the expression on the right. + * @param type declaration type: Token.VAR or Token.LET or -1 + * @param left array or object literal containing NAME nodes for + * variables to assign + * @param right expression to assign from + * @return expression that performs a series of assignments to + * the variables defined in left + */ + Node createDestructuringAssignment(int type, Node left, Node right) + { + String tempName = parser.currentScriptOrFn.getNextTempName(); + Node result = destructuringAssignmentHelper(type, left, right, + tempName); + Node comma = result.getLastChild(); + comma.addChildToBack(createName(tempName)); + return result; + } + + private Node destructuringAssignmentHelper(int variableType, Node left, + Node right, String tempName) + { + Node result = createScopeNode(Token.LETEXPR, + parser.getCurrentLineNumber()); + result.addChildToFront(new Node(Token.LET, + createName(Token.NAME, tempName, right))); + try { + parser.pushScope(result); + parser.defineSymbol(Token.LET, true, tempName); + } finally { + parser.popScope(); + } + Node comma = new Node(Token.COMMA); + result.addChildToBack(comma); + final int setOp = variableType == Token.CONST ? Token.SETCONST + : Token.SETNAME; + List destructuringNames = new ArrayList(); + boolean empty = true; + int type = left.getType(); + if (type == Token.ARRAYLIT) { + int index = 0; + int[] skipIndices = (int[])left.getProp(Node.SKIP_INDEXES_PROP); + int skip = 0; + Node n = left.getFirstChild(); + for (;;) { + if (skipIndices != null) { + while (skip < skipIndices.length && + skipIndices[skip] == index) { + skip++; + index++; + } + } + if (n == null) + break; + Node rightElem = new Node(Token.GETELEM, + createName(tempName), + createNumber(index)); + if (n.getType() == Token.NAME) { + String name = n.getString(); + comma.addChildToBack(new Node(setOp, + createName(Token.BINDNAME, name, null), + rightElem)); + if (variableType != -1) { + parser.defineSymbol(variableType, true, name); + destructuringNames.add(name); + } + } else { + comma.addChildToBack( + destructuringAssignmentHelper(variableType, n, + rightElem, + parser.currentScriptOrFn.getNextTempName())); + } + index++; + empty = false; + n = n.getNext(); + } + } else if (type == Token.OBJECTLIT) { + int index = 0; + Object[] propertyIds = (Object[]) + left.getProp(Node.OBJECT_IDS_PROP); + for (Node n = left.getFirstChild(); n != null; n = n.getNext()) + { + Object id = propertyIds[index]; + Node rightElem = id instanceof String + ? new Node(Token.GETPROP, + createName(tempName), + createString((String)id)) + : new Node(Token.GETELEM, + createName(tempName), + createNumber(((Number)id).intValue())); + if (n.getType() == Token.NAME) { + String name = n.getString(); + comma.addChildToBack(new Node(setOp, + createName(Token.BINDNAME, name, null), + rightElem)); + if (variableType != -1) { + parser.defineSymbol(variableType, true, name); + destructuringNames.add(name); + } + } else { + comma.addChildToBack( + destructuringAssignmentHelper(variableType, n, + rightElem, + parser.currentScriptOrFn.getNextTempName())); + } + index++; + empty = false; + } + } else if (type == Token.GETPROP || type == Token.GETELEM) { + comma.addChildToBack(simpleAssignment(left, createName(tempName))); + } else { + parser.reportError("msg.bad.assign.left"); + } + if (empty) { + // Don't want a COMMA node with no children. Just add a zero. + comma.addChildToBack(createNumber(0)); + } + result.putProp(Node.DESTRUCTURING_NAMES, destructuringNames); + return result; + } + + Node createUseLocal(Node localBlock) + { + if (Token.LOCAL_BLOCK != localBlock.getType()) throw Kit.codeBug(); + Node result = new Node(Token.LOCAL_LOAD); + result.putProp(Node.LOCAL_BLOCK_PROP, localBlock); + return result; + } + + private Node.Jump makeJump(int type, Node target) + { + Node.Jump n = new Node.Jump(type); + n.target = target; + return n; + } + + private Node makeReference(Node node) + { + int type = node.getType(); + switch (type) { + case Token.NAME: + case Token.GETPROP: + case Token.GETELEM: + case Token.GET_REF: + return node; + case Token.CALL: + node.setType(Token.REF_CALL); + return new Node(Token.GET_REF, node); + } + // Signal caller to report error + return null; + } + + // Check if Node always mean true or false in boolean context + private static int isAlwaysDefinedBoolean(Node node) + { + switch (node.getType()) { + case Token.FALSE: + case Token.NULL: + return ALWAYS_FALSE_BOOLEAN; + case Token.TRUE: + return ALWAYS_TRUE_BOOLEAN; + case Token.NUMBER: { + double num = node.getDouble(); + if (num == num && num != 0.0) { + return ALWAYS_TRUE_BOOLEAN; + } else { + return ALWAYS_FALSE_BOOLEAN; + } + } + } + return 0; + } + + private void checkActivationName(String name, int token) + { + if (parser.insideFunction()) { + boolean activation = false; + if ("arguments".equals(name) + || (parser.compilerEnv.activationNames != null + && parser.compilerEnv.activationNames.contains(name))) + { + activation = true; + } else if ("length".equals(name)) { + if (token == Token.GETPROP + && parser.compilerEnv.getLanguageVersion() + == Context.VERSION_1_2) + { + // Use of "length" in 1.2 requires an activation object. + activation = true; + } + } + if (activation) { + setRequiresActivation(); + } + } + } + + private void setRequiresActivation() + { + if (parser.insideFunction()) { + ((FunctionNode)parser.currentScriptOrFn).itsNeedsActivation = true; + } + } + + private void setIsGenerator() + { + if (parser.insideFunction()) { + ((FunctionNode)parser.currentScriptOrFn).itsIsGenerator = true; + } + } + + private Parser parser; + + private static final int LOOP_DO_WHILE = 0; + private static final int LOOP_WHILE = 1; + private static final int LOOP_FOR = 2; + + private static final int ALWAYS_TRUE_BOOLEAN = 1; + private static final int ALWAYS_FALSE_BOOLEAN = -1; +} diff --git a/org/mozilla/javascript/IdFunctionCall.java b/org/mozilla/javascript/IdFunctionCall.java new file mode 100644 index 0000000..713fabf --- /dev/null +++ b/org/mozilla/javascript/IdFunctionCall.java @@ -0,0 +1,55 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-1999 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +package org.mozilla.javascript; + +/** + * Master for id-based functions that knows their properties and how to + * execute them. + */ +public interface IdFunctionCall +{ + /** + * 'thisObj' will be null if invoked as constructor, in which case + * instance of Scriptable should be returned + */ + public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope, + Scriptable thisObj, Object[] args); + +} + diff --git a/org/mozilla/javascript/IdFunctionObject.java b/org/mozilla/javascript/IdFunctionObject.java new file mode 100644 index 0000000..32d03c9 --- /dev/null +++ b/org/mozilla/javascript/IdFunctionObject.java @@ -0,0 +1,196 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-1999 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +// API class + +package org.mozilla.javascript; + +public class IdFunctionObject extends BaseFunction +{ + + static final long serialVersionUID = -5332312783643935019L; + + public IdFunctionObject(IdFunctionCall idcall, Object tag, int id, int arity) + { + if (arity < 0) + throw new IllegalArgumentException(); + + this.idcall = idcall; + this.tag = tag; + this.methodId = id; + this.arity = arity; + if (arity < 0) throw new IllegalArgumentException(); + } + + public IdFunctionObject(IdFunctionCall idcall, Object tag, int id, + String name, int arity, Scriptable scope) + { + super(scope, null); + + if (arity < 0) + throw new IllegalArgumentException(); + if (name == null) + throw new IllegalArgumentException(); + + this.idcall = idcall; + this.tag = tag; + this.methodId = id; + this.arity = arity; + this.functionName = name; + } + + public void initFunction(String name, Scriptable scope) + { + if (name == null) throw new IllegalArgumentException(); + if (scope == null) throw new IllegalArgumentException(); + this.functionName = name; + setParentScope(scope); + } + + public final boolean hasTag(Object tag) + { + return this.tag == tag; + } + + public final int methodId() + { + return methodId; + } + + public final void markAsConstructor(Scriptable prototypeProperty) + { + useCallAsConstructor = true; + setImmunePrototypeProperty(prototypeProperty); + } + + public final void addAsProperty(Scriptable target) + { + ScriptableObject.defineProperty(target, functionName, this, + ScriptableObject.DONTENUM); + } + + public void exportAsScopeProperty() + { + addAsProperty(getParentScope()); + } + + @Override + public Scriptable getPrototype() + { + // Lazy initialization of prototype: for native functions this + // may not be called at all + Scriptable proto = super.getPrototype(); + if (proto == null) { + proto = getFunctionPrototype(getParentScope()); + setPrototype(proto); + } + return proto; + } + + @Override + public Object call(Context cx, Scriptable scope, Scriptable thisObj, + Object[] args) + { + return idcall.execIdCall(this, cx, scope, thisObj, args); + } + + @Override + public Scriptable createObject(Context cx, Scriptable scope) + { + if (useCallAsConstructor) { + return null; + } + // Throw error if not explicitly coded to be used as constructor, + // to satisfy ECMAScript standard (see bugzilla 202019). + // To follow current (2003-05-01) SpiderMonkey behavior, change it to: + // return super.createObject(cx, scope); + throw ScriptRuntime.typeError1("msg.not.ctor", functionName); + } + + @Override + String decompile(int indent, int flags) + { + StringBuffer sb = new StringBuffer(); + boolean justbody = (0 != (flags & Decompiler.ONLY_BODY_FLAG)); + if (!justbody) { + sb.append("function "); + sb.append(getFunctionName()); + sb.append("() { "); + } + sb.append("[native code for "); + if (idcall instanceof Scriptable) { + Scriptable sobj = (Scriptable)idcall; + sb.append(sobj.getClassName()); + sb.append('.'); + } + sb.append(getFunctionName()); + sb.append(", arity="); + sb.append(getArity()); + sb.append(justbody ? "]\n" : "] }\n"); + return sb.toString(); + } + + @Override + public int getArity() + { + return arity; + } + + @Override + public int getLength() { return getArity(); } + + @Override + public String getFunctionName() + { + return (functionName == null) ? "" : functionName; + } + + public final RuntimeException unknown() + { + // It is program error to call id-like methods for unknown function + return new IllegalArgumentException( + "BAD FUNCTION ID="+methodId+" MASTER="+idcall); + } + + private final IdFunctionCall idcall; + private final Object tag; + private final int methodId; + private int arity; + private boolean useCallAsConstructor; + private String functionName; +} diff --git a/org/mozilla/javascript/IdScriptableObject.java b/org/mozilla/javascript/IdScriptableObject.java new file mode 100644 index 0000000..44709da --- /dev/null +++ b/org/mozilla/javascript/IdScriptableObject.java @@ -0,0 +1,741 @@ +/* -*- Mode: java; tab-width: 4; indent-tabs-mode: 1; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-1999 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +package org.mozilla.javascript; + +import java.io.*; + +/** +Base class for native object implementation that uses IdFunctionObject to export its methods to script via .prototype object. + +Any descendant should implement at least the following methods: + findInstanceIdInfo + getInstanceIdName + execIdCall + methodArity + +To define non-function properties, the descendant should override + getInstanceIdValue + setInstanceIdValue +to get/set property value and provide its default attributes. + + +To customize initializition of constructor and protype objects, descendant +may override scopeInit or fillConstructorProperties methods. + +*/ +public abstract class IdScriptableObject extends ScriptableObject + implements IdFunctionCall +{ + private transient volatile PrototypeValues prototypeValues; + + private static final class PrototypeValues implements Serializable + { + static final long serialVersionUID = 3038645279153854371L; + + private static final int VALUE_SLOT = 0; + private static final int NAME_SLOT = 1; + private static final int SLOT_SPAN = 2; + + private IdScriptableObject obj; + private int maxId; + private volatile Object[] valueArray; + private volatile short[] attributeArray; + private volatile int lastFoundId = 1; + + // The following helps to avoid creation of valueArray during runtime + // initialization for common case of "constructor" property + int constructorId; + private IdFunctionObject constructor; + private short constructorAttrs; + + PrototypeValues(IdScriptableObject obj, int maxId) + { + if (obj == null) throw new IllegalArgumentException(); + if (maxId < 1) throw new IllegalArgumentException(); + this.obj = obj; + this.maxId = maxId; + } + + final int getMaxId() + { + return maxId; + } + + final void initValue(int id, String name, Object value, int attributes) + { + if (!(1 <= id && id <= maxId)) + throw new IllegalArgumentException(); + if (name == null) + throw new IllegalArgumentException(); + if (value == NOT_FOUND) + throw new IllegalArgumentException(); + ScriptableObject.checkValidAttributes(attributes); + if (obj.findPrototypeId(name) != id) + throw new IllegalArgumentException(name); + + if (id == constructorId) { + if (!(value instanceof IdFunctionObject)) { + throw new IllegalArgumentException("consructor should be initialized with IdFunctionObject"); + } + constructor = (IdFunctionObject)value; + constructorAttrs = (short)attributes; + return; + } + + initSlot(id, name, value, attributes); + } + + private void initSlot(int id, String name, Object value, + int attributes) + { + Object[] array = valueArray; + if (array == null) + throw new IllegalStateException(); + + if (value == null) { + value = UniqueTag.NULL_VALUE; + } + int index = (id - 1) * SLOT_SPAN; + synchronized (this) { + Object value2 = array[index + VALUE_SLOT]; + if (value2 == null) { + array[index + VALUE_SLOT] = value; + array[index + NAME_SLOT] = name; + attributeArray[id - 1] = (short)attributes; + } else { + if (!name.equals(array[index + NAME_SLOT])) + throw new IllegalStateException(); + } + } + } + + final IdFunctionObject createPrecachedConstructor() + { + if (constructorId != 0) throw new IllegalStateException(); + constructorId = obj.findPrototypeId("constructor"); + if (constructorId == 0) { + throw new IllegalStateException( + "No id for constructor property"); + } + obj.initPrototypeId(constructorId); + if (constructor == null) { + throw new IllegalStateException( + obj.getClass().getName()+".initPrototypeId() did not " + +"initialize id="+constructorId); + } + constructor.initFunction(obj.getClassName(), + ScriptableObject.getTopLevelScope(obj)); + constructor.markAsConstructor(obj); + return constructor; + } + + final int findId(String name) + { + Object[] array = valueArray; + if (array == null) { + return obj.findPrototypeId(name); + } + int id = lastFoundId; + if (name == array[(id - 1) * SLOT_SPAN + NAME_SLOT]) { + return id; + } + id = obj.findPrototypeId(name); + if (id != 0) { + int nameSlot = (id - 1) * SLOT_SPAN + NAME_SLOT; + // Make cache to work! + array[nameSlot] = name; + lastFoundId = id; + } + return id; + } + + final boolean has(int id) + { + Object[] array = valueArray; + if (array == null) { + // Not yet initialized, assume all exists + return true; + } + int valueSlot = (id - 1) * SLOT_SPAN + VALUE_SLOT; + Object value = array[valueSlot]; + if (value == null) { + // The particular entry has not been yet initialized + return true; + } + return value != NOT_FOUND; + } + + final Object get(int id) + { + Object value = ensureId(id); + if (value == UniqueTag.NULL_VALUE) { + value = null; + } + return value; + } + + final void set(int id, Scriptable start, Object value) + { + if (value == NOT_FOUND) throw new IllegalArgumentException(); + ensureId(id); + int attr = attributeArray[id - 1]; + if ((attr & READONLY) == 0) { + if (start == obj) { + if (value == null) { + value = UniqueTag.NULL_VALUE; + } + int valueSlot = (id - 1) * SLOT_SPAN + VALUE_SLOT; + synchronized (this) { + valueArray[valueSlot] = value; + } + } + else { + int nameSlot = (id - 1) * SLOT_SPAN + NAME_SLOT; + String name = (String)valueArray[nameSlot]; + start.put(name, start, value); + } + } + } + + final void delete(int id) + { + ensureId(id); + int attr = attributeArray[id - 1]; + if ((attr & PERMANENT) == 0) { + int valueSlot = (id - 1) * SLOT_SPAN + VALUE_SLOT; + synchronized (this) { + valueArray[valueSlot] = NOT_FOUND; + attributeArray[id - 1] = EMPTY; + } + } + } + + final int getAttributes(int id) + { + ensureId(id); + return attributeArray[id - 1]; + } + + final void setAttributes(int id, int attributes) + { + ScriptableObject.checkValidAttributes(attributes); + ensureId(id); + synchronized (this) { + attributeArray[id - 1] = (short)attributes; + } + } + + final Object[] getNames(boolean getAll, Object[] extraEntries) + { + Object[] names = null; + int count = 0; + for (int id = 1; id <= maxId; ++id) { + Object value = ensureId(id); + if (getAll || (attributeArray[id - 1] & DONTENUM) == 0) { + if (value != NOT_FOUND) { + int nameSlot = (id - 1) * SLOT_SPAN + NAME_SLOT; + String name = (String)valueArray[nameSlot]; + if (names == null) { + names = new Object[maxId]; + } + names[count++] = name; + } + } + } + if (count == 0) { + return extraEntries; + } else if (extraEntries == null || extraEntries.length == 0) { + if (count != names.length) { + Object[] tmp = new Object[count]; + System.arraycopy(names, 0, tmp, 0, count); + names = tmp; + } + return names; + } else { + int extra = extraEntries.length; + Object[] tmp = new Object[extra + count]; + System.arraycopy(extraEntries, 0, tmp, 0, extra); + System.arraycopy(names, 0, tmp, extra, count); + return tmp; + } + } + + private Object ensureId(int id) + { + Object[] array = valueArray; + if (array == null) { + synchronized (this) { + array = valueArray; + if (array == null) { + array = new Object[maxId * SLOT_SPAN]; + valueArray = array; + attributeArray = new short[maxId]; + } + } + } + int valueSlot = (id - 1) * SLOT_SPAN + VALUE_SLOT; + Object value = array[valueSlot]; + if (value == null) { + if (id == constructorId) { + initSlot(constructorId, "constructor", + constructor, constructorAttrs); + constructor = null; // no need to refer it any longer + } else { + obj.initPrototypeId(id); + } + value = array[valueSlot]; + if (value == null) { + throw new IllegalStateException( + obj.getClass().getName()+".initPrototypeId(int id) " + +"did not initialize id="+id); + } + } + return value; + } + } + + public IdScriptableObject() + { + } + + public IdScriptableObject(Scriptable scope, Scriptable prototype) + { + super(scope, prototype); + } + + protected final Object defaultGet(String name) + { + return super.get(name, this); + } + + protected final void defaultPut(String name, Object value) + { + super.put(name, this, value); + } + + @Override + public boolean has(String name, Scriptable start) + { + int info = findInstanceIdInfo(name); + if (info != 0) { + int attr = (info >>> 16); + if ((attr & PERMANENT) != 0) { + return true; + } + int id = (info & 0xFFFF); + return NOT_FOUND != getInstanceIdValue(id); + } + if (prototypeValues != null) { + int id = prototypeValues.findId(name); + if (id != 0) { + return prototypeValues.has(id); + } + } + return super.has(name, start); + } + + @Override + public Object get(String name, Scriptable start) + { + int info = findInstanceIdInfo(name); + if (info != 0) { + int id = (info & 0xFFFF); + return getInstanceIdValue(id); + } + if (prototypeValues != null) { + int id = prototypeValues.findId(name); + if (id != 0) { + return prototypeValues.get(id); + } + } + return super.get(name, start); + } + + @Override + public void put(String name, Scriptable start, Object value) + { + int info = findInstanceIdInfo(name); + if (info != 0) { + if (start == this && isSealed()) { + throw Context.reportRuntimeError1("msg.modify.sealed", + name); + } + int attr = (info >>> 16); + if ((attr & READONLY) == 0) { + if (start == this) { + int id = (info & 0xFFFF); + setInstanceIdValue(id, value); + } + else { + start.put(name, start, value); + } + } + return; + } + if (prototypeValues != null) { + int id = prototypeValues.findId(name); + if (id != 0) { + if (start == this && isSealed()) { + throw Context.reportRuntimeError1("msg.modify.sealed", + name); + } + prototypeValues.set(id, start, value); + return; + } + } + super.put(name, start, value); + } + + @Override + public void delete(String name) + { + int info = findInstanceIdInfo(name); + if (info != 0) { + // Let the super class to throw exceptions for sealed objects + if (!isSealed()) { + int attr = (info >>> 16); + if ((attr & PERMANENT) == 0) { + int id = (info & 0xFFFF); + setInstanceIdValue(id, NOT_FOUND); + } + return; + } + } + if (prototypeValues != null) { + int id = prototypeValues.findId(name); + if (id != 0) { + if (!isSealed()) { + prototypeValues.delete(id); + } + return; + } + } + super.delete(name); + } + + @Override + public int getAttributes(String name) + { + int info = findInstanceIdInfo(name); + if (info != 0) { + int attr = (info >>> 16); + return attr; + } + if (prototypeValues != null) { + int id = prototypeValues.findId(name); + if (id != 0) { + return prototypeValues.getAttributes(id); + } + } + return super.getAttributes(name); + } + + @Override + public void setAttributes(String name, int attributes) + { + ScriptableObject.checkValidAttributes(attributes); + int info = findInstanceIdInfo(name); + if (info != 0) { + int currentAttributes = (info >>> 16); + if (attributes != currentAttributes) { + throw new RuntimeException( + "Change of attributes for this id is not supported"); + } + return; + } + if (prototypeValues != null) { + int id = prototypeValues.findId(name); + if (id != 0) { + prototypeValues.setAttributes(id, attributes); + return; + } + } + super.setAttributes(name, attributes); + } + + @Override + Object[] getIds(boolean getAll) + { + Object[] result = super.getIds(getAll); + + if (prototypeValues != null) { + result = prototypeValues.getNames(getAll, result); + } + + int maxInstanceId = getMaxInstanceId(); + if (maxInstanceId != 0) { + Object[] ids = null; + int count = 0; + + for (int id = maxInstanceId; id != 0; --id) { + String name = getInstanceIdName(id); + int info = findInstanceIdInfo(name); + if (info != 0) { + int attr = (info >>> 16); + if ((attr & PERMANENT) == 0) { + if (NOT_FOUND == getInstanceIdValue(id)) { + continue; + } + } + if (getAll || (attr & DONTENUM) == 0) { + if (count == 0) { + // Need extra room for no more then [1..id] names + ids = new Object[id]; + } + ids[count++] = name; + } + } + } + if (count != 0) { + if (result.length == 0 && ids.length == count) { + result = ids; + } + else { + Object[] tmp = new Object[result.length + count]; + System.arraycopy(result, 0, tmp, 0, result.length); + System.arraycopy(ids, 0, tmp, result.length, count); + result = tmp; + } + } + } + return result; + } + + /** + * Get maximum id findInstanceIdInfo can generate. + */ + protected int getMaxInstanceId() + { + return 0; + } + + protected static int instanceIdInfo(int attributes, int id) + { + return (attributes << 16) | id; + } + + /** + * Map name to id of instance property. + * Should return 0 if not found or the result of + * {@link #instanceIdInfo(int, int)}. + */ + protected int findInstanceIdInfo(String name) + { + return 0; + } + + /** Map id back to property name it defines. + */ + protected String getInstanceIdName(int id) + { + throw new IllegalArgumentException(String.valueOf(id)); + } + + /** Get id value. + ** If id value is constant, descendant can call cacheIdValue to store + ** value in the permanent cache. + ** Default implementation creates IdFunctionObject instance for given id + ** and cache its value + */ + protected Object getInstanceIdValue(int id) + { + throw new IllegalStateException(String.valueOf(id)); + } + + /** + * Set or delete id value. If value == NOT_FOUND , the implementation + * should make sure that the following getInstanceIdValue return NOT_FOUND. + */ + protected void setInstanceIdValue(int id, Object value) + { + throw new IllegalStateException(String.valueOf(id)); + } + + /** 'thisObj' will be null if invoked as constructor, in which case + ** instance of Scriptable should be returned. */ + public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope, + Scriptable thisObj, Object[] args) + { + throw f.unknown(); + } + + public final IdFunctionObject exportAsJSClass(int maxPrototypeId, + Scriptable scope, + boolean sealed) + { + // Set scope and prototype unless this is top level scope itself + if (scope != this && scope != null) { + setParentScope(scope); + setPrototype(getObjectPrototype(scope)); + } + + activatePrototypeMap(maxPrototypeId); + IdFunctionObject ctor = prototypeValues.createPrecachedConstructor(); + if (sealed) { + sealObject(); + } + fillConstructorProperties(ctor); + if (sealed) { + ctor.sealObject(); + } + ctor.exportAsScopeProperty(); + return ctor; + } + + public final boolean hasPrototypeMap() + { + return prototypeValues != null; + } + + public final void activatePrototypeMap(int maxPrototypeId) + { + PrototypeValues values = new PrototypeValues(this, maxPrototypeId); + synchronized (this) { + if (prototypeValues != null) + throw new IllegalStateException(); + prototypeValues = values; + } + } + + public final void initPrototypeMethod(Object tag, int id, String name, + int arity) + { + Scriptable scope = ScriptableObject.getTopLevelScope(this); + IdFunctionObject f = newIdFunction(tag, id, name, arity, scope); + prototypeValues.initValue(id, name, f, DONTENUM); + } + + public final void initPrototypeConstructor(IdFunctionObject f) + { + int id = prototypeValues.constructorId; + if (id == 0) + throw new IllegalStateException(); + if (f.methodId() != id) + throw new IllegalArgumentException(); + if (isSealed()) { f.sealObject(); } + prototypeValues.initValue(id, "constructor", f, DONTENUM); + } + + public final void initPrototypeValue(int id, String name, Object value, + int attributes) + { + prototypeValues.initValue(id, name, value, attributes); + } + + protected void initPrototypeId(int id) + { + throw new IllegalStateException(String.valueOf(id)); + } + + protected int findPrototypeId(String name) + { + throw new IllegalStateException(name); + } + + protected void fillConstructorProperties(IdFunctionObject ctor) + { + } + + protected void addIdFunctionProperty(Scriptable obj, Object tag, int id, + String name, int arity) + { + Scriptable scope = ScriptableObject.getTopLevelScope(obj); + IdFunctionObject f = newIdFunction(tag, id, name, arity, scope); + f.addAsProperty(obj); + } + + /** + * Utility method to construct type error to indicate incompatible call + * when converting script thisObj to a particular type is not possible. + * Possible usage would be to have a private function like realThis: + *

+     *  private static NativeSomething realThis(Scriptable thisObj,
+     *                                          IdFunctionObject f)
+     *  {
+     *      if (!(thisObj instanceof NativeSomething))
+     *          throw incompatibleCallError(f);
+     *      return (NativeSomething)thisObj;
+     * }
+     * 
+ * Note that although such function can be implemented universally via + * java.lang.Class.isInstance(), it would be much more slower. + * @param f function that is attempting to convert 'this' + * object. + * @return Scriptable object suitable for a check by the instanceof + * operator. + * @throws RuntimeException if no more instanceof target can be found + */ + protected static EcmaError incompatibleCallError(IdFunctionObject f) + { + throw ScriptRuntime.typeError1("msg.incompat.call", + f.getFunctionName()); + } + + private IdFunctionObject newIdFunction(Object tag, int id, String name, + int arity, Scriptable scope) + { + IdFunctionObject f = new IdFunctionObject(this, tag, id, name, arity, + scope); + if (isSealed()) { f.sealObject(); } + return f; + } + + private void readObject(ObjectInputStream stream) + throws IOException, ClassNotFoundException + { + stream.defaultReadObject(); + int maxPrototypeId = stream.readInt(); + if (maxPrototypeId != 0) { + activatePrototypeMap(maxPrototypeId); + } + } + + private void writeObject(ObjectOutputStream stream) + throws IOException + { + stream.defaultWriteObject(); + int maxPrototypeId = 0; + if (prototypeValues != null) { + maxPrototypeId = prototypeValues.getMaxId(); + } + stream.writeInt(maxPrototypeId); + } + +} + diff --git a/org/mozilla/javascript/ImporterTopLevel.java b/org/mozilla/javascript/ImporterTopLevel.java new file mode 100644 index 0000000..8b04dc9 --- /dev/null +++ b/org/mozilla/javascript/ImporterTopLevel.java @@ -0,0 +1,324 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1999 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Norris Boyd + * Igor Bukanov + * Matthias Radestock + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +// API class + +package org.mozilla.javascript; + +/** + * Class ImporterTopLevel + * + * This class defines a ScriptableObject that can be instantiated + * as a top-level ("global") object to provide functionality similar + * to Java's "import" statement. + *

+ * This class can be used to create a top-level scope using the following code: + *

+ *  Scriptable scope = new ImporterTopLevel(cx);
+ * 
+ * Then JavaScript code will have access to the following methods: + *
    + *
  • importClass - will "import" a class by making its unqualified name + * available as a property of the top-level scope + *
  • importPackage - will "import" all the classes of the package by + * searching for unqualified names as classes qualified + * by the given package. + *
+ * The following code from the shell illustrates this use: + *
+ * js> importClass(java.io.File)
+ * js> f = new File('help.txt')
+ * help.txt
+ * js> importPackage(java.util)
+ * js> v = new Vector()
+ * []
+ *
+ * @author Norris Boyd
+ */
+public class ImporterTopLevel extends IdScriptableObject
+{
+    static final long serialVersionUID = -9095380847465315412L;
+
+    private static final Object IMPORTER_TAG = "Importer";
+
+    public ImporterTopLevel() { }
+
+    public ImporterTopLevel(Context cx) {
+        this(cx, false);
+    }
+
+    public ImporterTopLevel(Context cx, boolean sealed)
+    {
+        initStandardObjects(cx, sealed);
+    }
+
+    @Override
+    public String getClassName()
+    {
+        return (topScopeFlag) ? "global" : "JavaImporter";
+    }
+
+    public static void init(Context cx, Scriptable scope, boolean sealed)
+    {
+        ImporterTopLevel obj = new ImporterTopLevel();
+        obj.exportAsJSClass(MAX_PROTOTYPE_ID, scope, sealed);
+    }
+
+    public void initStandardObjects(Context cx, boolean sealed)
+    {
+        // Assume that Context.initStandardObjects initialize JavaImporter
+        // property lazily so the above init call is not yet called
+        cx.initStandardObjects(this, sealed);
+        topScopeFlag = true;
+        // If seal is true then exportAsJSClass(cx, seal) would seal
+        // this obj. Since this is scope as well, it would not allow
+        // to add variables.
+        IdFunctionObject ctor = exportAsJSClass(MAX_PROTOTYPE_ID, this, false);
+        if (sealed) {
+            ctor.sealObject();
+        }
+        // delete "constructor" defined by exportAsJSClass so "constructor"
+        // name would refer to Object.constructor
+        // and not to JavaImporter.prototype.constructor.
+        delete("constructor");
+    }
+
+    @Override
+    public boolean has(String name, Scriptable start) {
+        return super.has(name, start)
+               || getPackageProperty(name, start) != NOT_FOUND;
+    }
+
+    @Override
+    public Object get(String name, Scriptable start) {
+        Object result = super.get(name, start);
+        if (result != NOT_FOUND)
+            return result;
+        result = getPackageProperty(name, start);
+        return result;
+    }
+
+    private Object getPackageProperty(String name, Scriptable start) {
+        Object result = NOT_FOUND;
+        Object[] elements;
+        synchronized (importedPackages) {
+            elements = importedPackages.toArray();
+        }
+        for (int i=0; i < elements.length; i++) {
+            NativeJavaPackage p = (NativeJavaPackage) elements[i];
+            Object v = p.getPkgProperty(name, start, false);
+            if (v != null && !(v instanceof NativeJavaPackage)) {
+                if (result == NOT_FOUND) {
+                    result = v;
+                } else {
+                    throw Context.reportRuntimeError2(
+                        "msg.ambig.import", result.toString(), v.toString());
+                }
+            }
+        }
+        return result;
+    }
+
+    /**
+     * @deprecated Kept only for compatibility.
+     */
+    public void importPackage(Context cx, Scriptable thisObj, Object[] args,
+                              Function funObj)
+    {
+        js_importPackage(args);
+    }
+
+    private Object js_construct(Scriptable scope, Object[] args)
+    {
+        ImporterTopLevel result = new ImporterTopLevel();
+        for (int i = 0; i != args.length; ++i) {
+            Object arg = args[i];
+            if (arg instanceof NativeJavaClass) {
+                result.importClass((NativeJavaClass)arg);
+            } else if (arg instanceof NativeJavaPackage) {
+                result.importPackage((NativeJavaPackage)arg);
+            } else {
+                throw Context.reportRuntimeError1(
+                    "msg.not.class.not.pkg", Context.toString(arg));
+            }
+        }
+        // set explicitly prototype and scope
+        // as otherwise in top scope mode BaseFunction.construct
+        // would keep them set to null. It also allow to use
+        // JavaImporter without new and still get properly
+        // initialized object.
+        result.setParentScope(scope);
+        result.setPrototype(this);
+        return result;
+    }
+
+    private Object js_importClass(Object[] args)
+    {
+        for (int i = 0; i != args.length; i++) {
+            Object arg = args[i];
+            if (!(arg instanceof NativeJavaClass)) {
+                throw Context.reportRuntimeError1(
+                    "msg.not.class", Context.toString(arg));
+            }
+            importClass((NativeJavaClass)arg);
+        }
+        return Undefined.instance;
+    }
+
+    private Object js_importPackage(Object[] args)
+    {
+        for (int i = 0; i != args.length; i++) {
+            Object arg = args[i];
+            if (!(arg instanceof NativeJavaPackage)) {
+                throw Context.reportRuntimeError1(
+                    "msg.not.pkg", Context.toString(arg));
+            }
+            importPackage((NativeJavaPackage)arg);
+        }
+        return Undefined.instance;
+    }
+
+    private void importPackage(NativeJavaPackage pkg)
+    {
+        if(pkg == null) {
+            return;
+        }
+        synchronized (importedPackages) {
+            for (int j = 0; j != importedPackages.size(); j++) {
+                if (pkg.equals(importedPackages.get(j))) {
+                    return;
+                }
+            }
+            importedPackages.add(pkg);
+        }
+    }
+
+    private void importClass(NativeJavaClass cl)
+    {
+        String s = cl.getClassObject().getName();
+        String n = s.substring(s.lastIndexOf('.')+1);
+        Object val = get(n, this);
+        if (val != NOT_FOUND && val != cl) {
+            throw Context.reportRuntimeError1("msg.prop.defined", n);
+        }
+        //defineProperty(n, cl, DONTENUM);
+        put(n, this, cl);
+    }
+
+    @Override
+    protected void initPrototypeId(int id)
+    {
+        String s;
+        int arity;
+        switch (id) {
+          case Id_constructor:   arity=0; s="constructor";   break;
+          case Id_importClass:   arity=1; s="importClass";   break;
+          case Id_importPackage: arity=1; s="importPackage"; break;
+          default: throw new IllegalArgumentException(String.valueOf(id));
+        }
+        initPrototypeMethod(IMPORTER_TAG, id, s, arity);
+    }
+
+    @Override
+    public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope,
+                             Scriptable thisObj, Object[] args)
+    {
+        if (!f.hasTag(IMPORTER_TAG)) {
+            return super.execIdCall(f, cx, scope, thisObj, args);
+        }
+        int id = f.methodId();
+        switch (id) {
+          case Id_constructor:
+            return js_construct(scope, args);
+
+          case Id_importClass:
+            return realThis(thisObj, f).js_importClass(args);
+
+          case Id_importPackage:
+            return realThis(thisObj, f).js_importPackage(args);
+        }
+        throw new IllegalArgumentException(String.valueOf(id));
+    }
+
+    private ImporterTopLevel realThis(Scriptable thisObj, IdFunctionObject f)
+    {
+        if (topScopeFlag) {
+            // when used as top scope importPackage and importClass are global
+            // function that ignore thisObj
+            return this;
+        }
+        if (!(thisObj instanceof ImporterTopLevel))
+            throw incompatibleCallError(f);
+        return (ImporterTopLevel)thisObj;
+    }
+
+// #string_id_map#
+
+    @Override
+    protected int findPrototypeId(String s)
+    {
+        int id;
+// #generated# Last update: 2007-05-09 08:15:24 EDT
+        L0: { id = 0; String X = null; int c;
+            int s_length = s.length();
+            if (s_length==11) {
+                c=s.charAt(0);
+                if (c=='c') { X="constructor";id=Id_constructor; }
+                else if (c=='i') { X="importClass";id=Id_importClass; }
+            }
+            else if (s_length==13) { X="importPackage";id=Id_importPackage; }
+            if (X!=null && X!=s && !X.equals(s)) id = 0;
+            break L0;
+        }
+// #/generated#
+        return id;
+    }
+
+    private static final int
+        Id_constructor          = 1,
+        Id_importClass          = 2,
+        Id_importPackage        = 3,
+        MAX_PROTOTYPE_ID        = 3;
+
+// #/string_id_map#
+
+    private ObjArray importedPackages = new ObjArray();
+    private boolean topScopeFlag;
+}
diff --git a/org/mozilla/javascript/InterfaceAdapter.java b/org/mozilla/javascript/InterfaceAdapter.java
new file mode 100644
index 0000000..a8d21ba
--- /dev/null
+++ b/org/mozilla/javascript/InterfaceAdapter.java
@@ -0,0 +1,156 @@
+/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Rhino code, released
+ * May 6, 1999.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1997-1999
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Igor Bukanov
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * the GNU General Public License Version 2 or later (the "GPL"), in which
+ * case the provisions of the GPL are applicable instead of those above. If
+ * you wish to allow use of your version of this file only under the terms of
+ * the GPL and not to allow others to use your version of this file under the
+ * MPL, indicate your decision by deleting the provisions above and replacing
+ * them with the notice and other provisions required by the GPL. If you do
+ * not delete the provisions above, a recipient may use your version of this
+ * file under either the MPL or the GPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+package org.mozilla.javascript;
+
+import java.lang.reflect.Method;
+
+/**
+ * Adapter to use JS function as implementation of Java interfaces with
+ * single method or multiple methods with the same signature.
+ */
+public class InterfaceAdapter
+{
+    private final Object proxyHelper;
+
+    /**
+     * Make glue object implementing interface cl that will
+     * call the supplied JS function when called.
+     * Only interfaces were all methods have the same signature is supported.
+     *
+     * @return The glue object or null if cl is not interface or
+     *         has methods with different signatures.
+     */
+    static Object create(Context cx, Class cl, Callable function)
+    {
+        if (!cl.isInterface()) throw new IllegalArgumentException();
+
+        Scriptable topScope = ScriptRuntime.getTopCallScope(cx);
+        ClassCache cache = ClassCache.get(topScope);
+        InterfaceAdapter adapter;
+        adapter = (InterfaceAdapter)cache.getInterfaceAdapter(cl);
+        ContextFactory cf = cx.getFactory();
+        if (adapter == null) {
+            Method[] methods = cl.getMethods();
+            if (methods.length == 0) {
+                throw Context.reportRuntimeError2(
+                    "msg.no.empty.interface.conversion",
+                    String.valueOf(function),
+                    cl.getClass().getName());
+            }
+            boolean canCallFunction = false;
+          canCallFunctionChecks: {
+                Class[] argTypes = methods[0].getParameterTypes();
+                // check that the rest of methods has the same signature
+                for (int i = 1; i != methods.length; ++i) {
+                    Class[] types2 = methods[i].getParameterTypes();
+                    if (types2.length != argTypes.length) {
+                        break canCallFunctionChecks;
+                    }
+                    for (int j = 0; j != argTypes.length; ++j) {
+                        if (types2[j] != argTypes[j]) {
+                            break canCallFunctionChecks;
+                        }
+                    }
+                }
+                canCallFunction= true;
+            }
+            if (!canCallFunction) {
+                throw Context.reportRuntimeError2(
+                    "msg.no.function.interface.conversion",
+                    String.valueOf(function),
+                    cl.getClass().getName());
+            }
+            adapter = new InterfaceAdapter(cf, cl);
+            cache.cacheInterfaceAdapter(cl, adapter);
+        }
+        return VMBridge.instance.newInterfaceProxy(
+            adapter.proxyHelper, cf, adapter, function, topScope);
+    }
+
+    private InterfaceAdapter(ContextFactory cf, Class cl)
+    {
+        this.proxyHelper
+            = VMBridge.instance.getInterfaceProxyHelper(
+                cf, new Class[] { cl });
+    }
+
+    public Object invoke(ContextFactory cf,
+                         final Object target,
+                         final Scriptable topScope,
+                         final Method method,
+                         final Object[] args)
+    {
+        ContextAction action = new ContextAction() {
+                public Object run(Context cx)
+                {
+                    return invokeImpl(cx, target, topScope, method, args);
+                }
+            };
+        return cf.call(action);
+    }
+
+    Object invokeImpl(Context cx,
+                      Object target,
+                      Scriptable topScope,
+                      Method method,
+                      Object[] args)
+    {
+        int N = (args == null) ? 0 : args.length;
+
+        Callable function = (Callable)target;
+        Scriptable thisObj = topScope;
+        Object[] jsargs = new Object[N + 1];
+        jsargs[N] = method.getName();
+        if (N != 0) {
+            WrapFactory wf = cx.getWrapFactory();
+            for (int i = 0; i != N; ++i) {
+                jsargs[i] = wf.wrap(cx, topScope, args[i], null);
+            }
+        }
+
+        Object result = function.call(cx, topScope, thisObj, jsargs);
+        Class javaResultType = method.getReturnType();
+        if (javaResultType == Void.TYPE) {
+            result = null;
+        } else {
+            result = Context.jsToJava(result, javaResultType);
+        }
+        return result;
+    }
+}
diff --git a/org/mozilla/javascript/InterpretedFunction.java b/org/mozilla/javascript/InterpretedFunction.java
new file mode 100644
index 0000000..c26890b
--- /dev/null
+++ b/org/mozilla/javascript/InterpretedFunction.java
@@ -0,0 +1,235 @@
+/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Rhino code, released
+ * May 6, 1999.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1997-2000
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Igor Bukanov
+ *   Bob Jervis
+ *   Roger Lawrence
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * the GNU General Public License Version 2 or later (the "GPL"), in which
+ * case the provisions of the GPL are applicable instead of those above. If
+ * you wish to allow use of your version of this file only under the terms of
+ * the GPL and not to allow others to use your version of this file under the
+ * MPL, indicate your decision by deleting the provisions above and replacing
+ * them with the notice and other provisions required by the GPL. If you do
+ * not delete the provisions above, a recipient may use your version of this
+ * file under either the MPL or the GPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+package org.mozilla.javascript;
+
+import org.mozilla.javascript.debug.DebuggableScript;
+
+final class InterpretedFunction extends NativeFunction implements Script
+{
+    static final long serialVersionUID = 541475680333911468L;
+
+    InterpreterData idata;
+    SecurityController securityController;
+    Object securityDomain;
+    Scriptable[] functionRegExps;
+
+    private InterpretedFunction(InterpreterData idata,
+                                Object staticSecurityDomain)
+    {
+        this.idata = idata;
+
+        // Always get Context from the current thread to
+        // avoid security breaches via passing mangled Context instances
+        // with bogus SecurityController
+        Context cx = Context.getContext();
+        SecurityController sc = cx.getSecurityController();
+        Object dynamicDomain;
+        if (sc != null) {
+            dynamicDomain = sc.getDynamicSecurityDomain(staticSecurityDomain);
+        } else {
+            if (staticSecurityDomain != null) {
+                throw new IllegalArgumentException();
+            }
+            dynamicDomain = null;
+        }
+
+        this.securityController = sc;
+        this.securityDomain = dynamicDomain;
+    }
+
+    private InterpretedFunction(InterpretedFunction parent, int index)
+    {
+        this.idata = parent.idata.itsNestedFunctions[index];
+        this.securityController = parent.securityController;
+        this.securityDomain = parent.securityDomain;
+    }
+
+    /**
+     * Create script from compiled bytecode.
+     */
+    static InterpretedFunction createScript(InterpreterData idata,
+                                            Object staticSecurityDomain)
+    {
+        InterpretedFunction f;
+        f = new InterpretedFunction(idata, staticSecurityDomain);
+        return f;
+    }
+
+    /**
+     * Create function compiled from Function(...) constructor.
+     */
+    static InterpretedFunction createFunction(Context cx,Scriptable scope,
+                                              InterpreterData idata,
+                                              Object staticSecurityDomain)
+    {
+        InterpretedFunction f;
+        f = new InterpretedFunction(idata, staticSecurityDomain);
+        f.initInterpretedFunction(cx, scope);
+        return f;
+    }
+
+    /**
+     * Create function embedded in script or another function.
+     */
+    static InterpretedFunction createFunction(Context cx, Scriptable scope,
+                                              InterpretedFunction  parent,
+                                              int index)
+    {
+        InterpretedFunction f = new InterpretedFunction(parent, index);
+        f.initInterpretedFunction(cx, scope);
+        return f;
+    }
+
+    Scriptable[] createRegExpWraps(Context cx, Scriptable scope)
+    {
+        if (idata.itsRegExpLiterals == null) Kit.codeBug();
+
+        RegExpProxy rep = ScriptRuntime.checkRegExpProxy(cx);
+        int N = idata.itsRegExpLiterals.length;
+        Scriptable[] array = new Scriptable[N];
+        for (int i = 0; i != N; ++i) {
+            array[i] = rep.wrapRegExp(cx, scope, idata.itsRegExpLiterals[i]);
+        }
+        return array;
+    }
+
+    private void initInterpretedFunction(Context cx, Scriptable scope)
+    {
+        initScriptFunction(cx, scope);
+        if (idata.itsRegExpLiterals != null) {
+            functionRegExps = createRegExpWraps(cx, scope);
+        }
+    }
+
+    @Override
+    public String getFunctionName()
+    {
+        return (idata.itsName == null) ? "" : idata.itsName;
+    }
+
+    /**
+     * Calls the function.
+     * @param cx the current context 
+     * @param scope the scope used for the call
+     * @param thisObj the value of "this"
+     * @param args function arguments. Must not be null. You can use 
+     * {@link ScriptRuntime#emptyArgs} to pass empty arguments.
+     * @return the result of the function call.
+     */
+    @Override
+    public Object call(Context cx, Scriptable scope, Scriptable thisObj,
+                       Object[] args)
+    {
+        if (!ScriptRuntime.hasTopCall(cx)) {
+            return ScriptRuntime.doTopCall(this, cx, scope, thisObj, args);
+        }
+        return Interpreter.interpret(this, cx, scope, thisObj, args);
+    }
+
+    public Object exec(Context cx, Scriptable scope)
+    {
+        if (!isScript()) {
+            // Can only be applied to scripts
+            throw new IllegalStateException();
+        }
+        if (!ScriptRuntime.hasTopCall(cx)) {
+            // It will go through "call" path. but they are equivalent
+            return ScriptRuntime.doTopCall(
+                this, cx, scope, scope, ScriptRuntime.emptyArgs);
+        }
+        return Interpreter.interpret(
+            this, cx, scope, scope, ScriptRuntime.emptyArgs);
+    }
+    
+    public boolean isScript() {
+        return idata.itsFunctionType == 0;
+    }
+
+    @Override
+    public String getEncodedSource()
+    {
+        return Interpreter.getEncodedSource(idata);
+    }
+
+    @Override
+    public DebuggableScript getDebuggableView()
+    {
+        return idata;
+    }
+
+    @Override
+    public Object resumeGenerator(Context cx, Scriptable scope, int operation,
+                                  Object state, Object value)
+    {
+        return Interpreter.resumeGenerator(cx, scope, operation, state, value);
+    }
+
+    @Override
+    protected int getLanguageVersion()
+    {
+        return idata.languageVersion;
+    }
+
+    @Override
+    protected int getParamCount()
+    {
+        return idata.argCount;
+    }
+
+    @Override
+    protected int getParamAndVarCount()
+    {
+        return idata.argNames.length;
+    }
+
+    @Override
+    protected String getParamOrVarName(int index)
+    {
+        return idata.argNames[index];
+    }
+
+    @Override
+    protected boolean getParamOrVarConst(int index)
+    {
+        return idata.argIsConst[index];
+    }
+}
+
diff --git a/org/mozilla/javascript/Interpreter.java b/org/mozilla/javascript/Interpreter.java
new file mode 100644
index 0000000..f7f544d
--- /dev/null
+++ b/org/mozilla/javascript/Interpreter.java
@@ -0,0 +1,4740 @@
+/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Rhino code, released
+ * May 6, 1999.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1997-2000
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Patrick Beard
+ *   Norris Boyd
+ *   Igor Bukanov
+ *   Ethan Hugg
+ *   Bob Jervis
+ *   Terry Lucas
+ *   Roger Lawrence
+ *   Milen Nankov
+ *   Hannes Wallnoefer
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * the GNU General Public License Version 2 or later (the "GPL"), in which
+ * case the provisions of the GPL are applicable instead of those above. If
+ * you wish to allow use of your version of this file only under the terms of
+ * the GPL and not to allow others to use your version of this file under the
+ * MPL, indicate your decision by deleting the provisions above and replacing
+ * them with the notice and other provisions required by the GPL. If you do
+ * not delete the provisions above, a recipient may use your version of this
+ * file under either the MPL or the GPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+package org.mozilla.javascript;
+
+import java.io.PrintStream;
+import java.io.Serializable;
+import java.util.List;
+import java.util.ArrayList;
+
+import org.mozilla.javascript.ScriptRuntime.NoSuchMethodShim;
+import org.mozilla.javascript.debug.DebugFrame;
+
+public class Interpreter implements Evaluator
+{
+
+// Additional interpreter-specific codes
+
+    private static final int
+
+    // Stack: ... value1 -> ... value1 value1
+        Icode_DUP                       = -1,
+
+    // Stack: ... value2 value1 -> ... value2 value1 value2 value1
+        Icode_DUP2                      = -2,
+
+    // Stack: ... value2 value1 -> ... value1 value2
+        Icode_SWAP                      = -3,
+
+    // Stack: ... value1 -> ...
+        Icode_POP                       = -4,
+
+    // Store stack top into return register and then pop it
+        Icode_POP_RESULT                = -5,
+
+    // To jump conditionally and pop additional stack value
+        Icode_IFEQ_POP                  = -6,
+
+    // various types of ++/--
+        Icode_VAR_INC_DEC               = -7,
+        Icode_NAME_INC_DEC              = -8,
+        Icode_PROP_INC_DEC              = -9,
+        Icode_ELEM_INC_DEC              = -10,
+        Icode_REF_INC_DEC               = -11,
+
+    // load/save scope from/to local
+        Icode_SCOPE_LOAD                = -12,
+        Icode_SCOPE_SAVE                = -13,
+
+        Icode_TYPEOFNAME                = -14,
+
+    // helper for function calls
+        Icode_NAME_AND_THIS             = -15,
+        Icode_PROP_AND_THIS             = -16,
+        Icode_ELEM_AND_THIS             = -17,
+        Icode_VALUE_AND_THIS            = -18,
+
+    // Create closure object for nested functions
+        Icode_CLOSURE_EXPR              = -19,
+        Icode_CLOSURE_STMT              = -20,
+
+    // Special calls
+        Icode_CALLSPECIAL               = -21,
+
+    // To return undefined value
+        Icode_RETUNDEF                  = -22,
+
+    // Exception handling implementation
+        Icode_GOSUB                     = -23,
+        Icode_STARTSUB                  = -24,
+        Icode_RETSUB                    = -25,
+
+    // To indicating a line number change in icodes.
+        Icode_LINE                      = -26,
+
+    // To store shorts and ints inline
+        Icode_SHORTNUMBER               = -27,
+        Icode_INTNUMBER                 = -28,
+
+    // To create and populate array to hold values for [] and {} literals
+        Icode_LITERAL_NEW               = -29,
+        Icode_LITERAL_SET               = -30,
+
+    // Array literal with skipped index like [1,,2]
+        Icode_SPARE_ARRAYLIT            = -31,
+
+    // Load index register to prepare for the following index operation
+        Icode_REG_IND_C0                = -32,
+        Icode_REG_IND_C1                = -33,
+        Icode_REG_IND_C2                = -34,
+        Icode_REG_IND_C3                = -35,
+        Icode_REG_IND_C4                = -36,
+        Icode_REG_IND_C5                = -37,
+        Icode_REG_IND1                  = -38,
+        Icode_REG_IND2                  = -39,
+        Icode_REG_IND4                  = -40,
+
+    // Load string register to prepare for the following string operation
+        Icode_REG_STR_C0                = -41,
+        Icode_REG_STR_C1                = -42,
+        Icode_REG_STR_C2                = -43,
+        Icode_REG_STR_C3                = -44,
+        Icode_REG_STR1                  = -45,
+        Icode_REG_STR2                  = -46,
+        Icode_REG_STR4                  = -47,
+
+    // Version of getvar/setvar that read var index directly from bytecode
+        Icode_GETVAR1                   = -48,
+        Icode_SETVAR1                   = -49,
+
+    // Load unefined
+        Icode_UNDEF                     = -50,
+        Icode_ZERO                      = -51,
+        Icode_ONE                       = -52,
+
+    // entrance and exit from .()
+       Icode_ENTERDQ                    = -53,
+       Icode_LEAVEDQ                    = -54,
+
+       Icode_TAIL_CALL                  = -55,
+
+    // Clear local to allow GC its context
+       Icode_LOCAL_CLEAR                = -56,
+
+    // Literal get/set
+       Icode_LITERAL_GETTER             = -57,
+       Icode_LITERAL_SETTER             = -58,
+
+    // const
+       Icode_SETCONST                   = -59,
+       Icode_SETCONSTVAR                = -60,
+       Icode_SETCONSTVAR1               = -61,
+
+    // Generator opcodes (along with Token.YIELD)
+       Icode_GENERATOR                  = -62,
+       Icode_GENERATOR_END              = -63,
+
+       Icode_DEBUGGER                   = -64,
+
+       // Last icode
+        MIN_ICODE                       = -64;
+
+    // data for parsing
+
+    private CompilerEnvirons compilerEnv;
+
+    private boolean itsInFunctionFlag;
+    private boolean itsInTryFlag;
+
+    private InterpreterData itsData;
+    private ScriptOrFnNode scriptOrFn;
+    private int itsICodeTop;
+    private int itsStackDepth;
+    private int itsLineNumber;
+    private int itsDoubleTableTop;
+    private ObjToIntMap itsStrings = new ObjToIntMap(20);
+    private int itsLocalTop;
+
+    private static final int MIN_LABEL_TABLE_SIZE = 32;
+    private static final int MIN_FIXUP_TABLE_SIZE = 40;
+    private int[] itsLabelTable;
+    private int itsLabelTableTop;
+// itsFixupTable[i] = (label_index << 32) | fixup_site
+    private long[] itsFixupTable;
+    private int itsFixupTableTop;
+    private ObjArray itsLiteralIds = new ObjArray();
+
+    private int itsExceptionTableTop;
+    private static final int EXCEPTION_TRY_START_SLOT  = 0;
+    private static final int EXCEPTION_TRY_END_SLOT    = 1;
+    private static final int EXCEPTION_HANDLER_SLOT    = 2;
+    private static final int EXCEPTION_TYPE_SLOT       = 3;
+    private static final int EXCEPTION_LOCAL_SLOT      = 4;
+    private static final int EXCEPTION_SCOPE_SLOT      = 5;
+    // SLOT_SIZE: space for try start/end, handler, start, handler type,
+    //            exception local and scope local
+    private static final int EXCEPTION_SLOT_SIZE       = 6;
+
+// ECF_ or Expression Context Flags constants: for now only TAIL is available
+    private static final int ECF_TAIL = 1 << 0;
+
+    /**
+     * Class to hold data corresponding to one interpreted call stack frame.
+     */
+    private static class CallFrame implements Cloneable, Serializable
+    {
+        static final long serialVersionUID = -2843792508994958978L;
+
+        CallFrame parentFrame;
+        // amount of stack frames before this one on the interpretation stack
+        int frameIndex;
+        // If true indicates read-only frame that is a part of continuation
+        boolean frozen;
+
+        InterpretedFunction fnOrScript;
+        InterpreterData idata;
+
+// Stack structure
+// stack[0 <= i < localShift]: arguments and local variables
+// stack[localShift <= i <= emptyStackTop]: used for local temporaries
+// stack[emptyStackTop < i < stack.length]: stack data
+// sDbl[i]: if stack[i] is UniqueTag.DOUBLE_MARK, sDbl[i] holds the number value
+
+        Object[] stack;
+        int[] stackAttributes;
+        double[] sDbl;
+        CallFrame varSource; // defaults to this unless continuation frame
+        int localShift;
+        int emptyStackTop;
+
+        DebugFrame debuggerFrame;
+        boolean useActivation;
+        boolean isContinuationsTopFrame;
+
+        Scriptable thisObj;
+        Scriptable[] scriptRegExps;
+
+// The values that change during interpretation
+
+        Object result;
+        double resultDbl;
+        int pc;
+        int pcPrevBranch;
+        int pcSourceLineStart;
+        Scriptable scope;
+
+        int savedStackTop;
+        int savedCallOp;
+        Object throwable;
+
+        CallFrame cloneFrozen()
+        {
+            if (!frozen) Kit.codeBug();
+
+            CallFrame copy;
+            try {
+                copy = (CallFrame)clone();
+            } catch (CloneNotSupportedException ex) {
+                throw new IllegalStateException();
+            }
+
+            // clone stack but keep varSource to point to values
+            // from this frame to share variables.
+
+            copy.stack = stack.clone();
+            copy.stackAttributes = stackAttributes.clone();
+            copy.sDbl = sDbl.clone();
+
+            copy.frozen = false;
+            return copy;
+        }
+    }
+
+    private static final class ContinuationJump implements Serializable
+    {
+        static final long serialVersionUID = 7687739156004308247L;
+
+        CallFrame capturedFrame;
+        CallFrame branchFrame;
+        Object result;
+        double resultDbl;
+
+        ContinuationJump(NativeContinuation c, CallFrame current)
+        {
+            this.capturedFrame = (CallFrame)c.getImplementation();
+            if (this.capturedFrame == null || current == null) {
+                // Continuation and current execution does not share
+                // any frames if there is nothing to capture or
+                // if there is no currently executed frames
+                this.branchFrame = null;
+            } else {
+                // Search for branch frame where parent frame chains starting
+                // from captured and current meet.
+                CallFrame chain1 = this.capturedFrame;
+                CallFrame chain2 = current;
+
+                // First work parents of chain1 or chain2 until the same
+                // frame depth.
+                int diff = chain1.frameIndex - chain2.frameIndex;
+                if (diff != 0) {
+                    if (diff < 0) {
+                        // swap to make sure that
+                        // chain1.frameIndex > chain2.frameIndex and diff > 0
+                        chain1 = current;
+                        chain2 = this.capturedFrame;
+                        diff = -diff;
+                    }
+                    do {
+                        chain1 = chain1.parentFrame;
+                    } while (--diff != 0);
+                    if (chain1.frameIndex != chain2.frameIndex) Kit.codeBug();
+                }
+
+                // Now walk parents in parallel until a shared frame is found
+                // or until the root is reached.
+                while (chain1 != chain2 && chain1 != null) {
+                    chain1 = chain1.parentFrame;
+                    chain2 = chain2.parentFrame;
+                }
+
+                this.branchFrame = chain1;
+                if (this.branchFrame != null && !this.branchFrame.frozen)
+                    Kit.codeBug();
+            }
+        }
+    }
+
+    private static CallFrame captureFrameForGenerator(CallFrame frame) {
+      frame.frozen = true;
+      CallFrame result = frame.cloneFrozen();
+      frame.frozen = false;
+
+      // now isolate this frame from its previous context
+      result.parentFrame = null;
+      result.frameIndex = 0;
+
+      return result;
+    }
+
+    static {
+        // Checks for byte code consistencies, good compiler can eliminate them
+
+        if (Token.LAST_BYTECODE_TOKEN > 127) {
+            String str = "Violation of Token.LAST_BYTECODE_TOKEN <= 127";
+            System.err.println(str);
+            throw new IllegalStateException(str);
+        }
+        if (MIN_ICODE < -128) {
+            String str = "Violation of Interpreter.MIN_ICODE >= -128";
+            System.err.println(str);
+            throw new IllegalStateException(str);
+        }
+    }
+
+    private static String bytecodeName(int bytecode)
+    {
+        if (!validBytecode(bytecode)) {
+            throw new IllegalArgumentException(String.valueOf(bytecode));
+        }
+
+        if (!Token.printICode) {
+            return String.valueOf(bytecode);
+        }
+
+        if (validTokenCode(bytecode)) {
+            return Token.name(bytecode);
+        }
+
+        switch (bytecode) {
+          case Icode_DUP:              return "DUP";
+          case Icode_DUP2:             return "DUP2";
+          case Icode_SWAP:             return "SWAP";
+          case Icode_POP:              return "POP";
+          case Icode_POP_RESULT:       return "POP_RESULT";
+          case Icode_IFEQ_POP:         return "IFEQ_POP";
+          case Icode_VAR_INC_DEC:      return "VAR_INC_DEC";
+          case Icode_NAME_INC_DEC:     return "NAME_INC_DEC";
+          case Icode_PROP_INC_DEC:     return "PROP_INC_DEC";
+          case Icode_ELEM_INC_DEC:     return "ELEM_INC_DEC";
+          case Icode_REF_INC_DEC:      return "REF_INC_DEC";
+          case Icode_SCOPE_LOAD:       return "SCOPE_LOAD";
+          case Icode_SCOPE_SAVE:       return "SCOPE_SAVE";
+          case Icode_TYPEOFNAME:       return "TYPEOFNAME";
+          case Icode_NAME_AND_THIS:    return "NAME_AND_THIS";
+          case Icode_PROP_AND_THIS:    return "PROP_AND_THIS";
+          case Icode_ELEM_AND_THIS:    return "ELEM_AND_THIS";
+          case Icode_VALUE_AND_THIS:   return "VALUE_AND_THIS";
+          case Icode_CLOSURE_EXPR:     return "CLOSURE_EXPR";
+          case Icode_CLOSURE_STMT:     return "CLOSURE_STMT";
+          case Icode_CALLSPECIAL:      return "CALLSPECIAL";
+          case Icode_RETUNDEF:         return "RETUNDEF";
+          case Icode_GOSUB:            return "GOSUB";
+          case Icode_STARTSUB:         return "STARTSUB";
+          case Icode_RETSUB:           return "RETSUB";
+          case Icode_LINE:             return "LINE";
+          case Icode_SHORTNUMBER:      return "SHORTNUMBER";
+          case Icode_INTNUMBER:        return "INTNUMBER";
+          case Icode_LITERAL_NEW:      return "LITERAL_NEW";
+          case Icode_LITERAL_SET:      return "LITERAL_SET";
+          case Icode_SPARE_ARRAYLIT:   return "SPARE_ARRAYLIT";
+          case Icode_REG_IND_C0:       return "REG_IND_C0";
+          case Icode_REG_IND_C1:       return "REG_IND_C1";
+          case Icode_REG_IND_C2:       return "REG_IND_C2";
+          case Icode_REG_IND_C3:       return "REG_IND_C3";
+          case Icode_REG_IND_C4:       return "REG_IND_C4";
+          case Icode_REG_IND_C5:       return "REG_IND_C5";
+          case Icode_REG_IND1:         return "LOAD_IND1";
+          case Icode_REG_IND2:         return "LOAD_IND2";
+          case Icode_REG_IND4:         return "LOAD_IND4";
+          case Icode_REG_STR_C0:       return "REG_STR_C0";
+          case Icode_REG_STR_C1:       return "REG_STR_C1";
+          case Icode_REG_STR_C2:       return "REG_STR_C2";
+          case Icode_REG_STR_C3:       return "REG_STR_C3";
+          case Icode_REG_STR1:         return "LOAD_STR1";
+          case Icode_REG_STR2:         return "LOAD_STR2";
+          case Icode_REG_STR4:         return "LOAD_STR4";
+          case Icode_GETVAR1:          return "GETVAR1";
+          case Icode_SETVAR1:          return "SETVAR1";
+          case Icode_UNDEF:            return "UNDEF";
+          case Icode_ZERO:             return "ZERO";
+          case Icode_ONE:              return "ONE";
+          case Icode_ENTERDQ:          return "ENTERDQ";
+          case Icode_LEAVEDQ:          return "LEAVEDQ";
+          case Icode_TAIL_CALL:        return "TAIL_CALL";
+          case Icode_LOCAL_CLEAR:      return "LOCAL_CLEAR";
+          case Icode_LITERAL_GETTER:   return "LITERAL_GETTER";
+          case Icode_LITERAL_SETTER:   return "LITERAL_SETTER";
+          case Icode_SETCONST:         return "SETCONST";
+          case Icode_SETCONSTVAR:      return "SETCONSTVAR";
+          case Icode_SETCONSTVAR1:     return "SETCONSTVAR1";
+          case Icode_GENERATOR:        return "GENERATOR";
+          case Icode_GENERATOR_END:    return "GENERATOR_END";
+          case Icode_DEBUGGER:         return "DEBUGGER";
+        }
+
+        // icode without name
+        throw new IllegalStateException(String.valueOf(bytecode));
+    }
+
+    private static boolean validIcode(int icode)
+    {
+        return MIN_ICODE <= icode && icode <= -1;
+    }
+
+    private static boolean validTokenCode(int token)
+    {
+        return Token.FIRST_BYTECODE_TOKEN <= token
+               && token <= Token.LAST_BYTECODE_TOKEN;
+    }
+
+    private static boolean validBytecode(int bytecode)
+    {
+        return validIcode(bytecode) || validTokenCode(bytecode);
+    }
+
+    public Object compile(CompilerEnvirons compilerEnv,
+                          ScriptOrFnNode tree,
+                          String encodedSource,
+                          boolean returnFunction)
+    {
+        this.compilerEnv = compilerEnv;
+        new NodeTransformer().transform(tree);
+
+        if (Token.printTrees) {
+            System.out.println(tree.toStringTree(tree));
+        }
+
+        if (returnFunction) {
+            tree = tree.getFunctionNode(0);
+        }
+
+        scriptOrFn = tree;
+        itsData = new InterpreterData(compilerEnv.getLanguageVersion(),
+                                      scriptOrFn.getSourceName(),
+                                      encodedSource);
+        itsData.topLevel = true;
+
+        if (returnFunction) {
+            generateFunctionICode();
+        } else {
+            generateICodeFromTree(scriptOrFn);
+        }
+
+        return itsData;
+    }
+
+    public Script createScriptObject(Object bytecode, Object staticSecurityDomain)
+    {
+        if(bytecode != itsData)
+        {
+            Kit.codeBug();
+        }
+        return InterpretedFunction.createScript(itsData,
+                                                staticSecurityDomain);
+    }
+
+    public void setEvalScriptFlag(Script script) {
+        ((InterpretedFunction)script).idata.evalScriptFlag = true;
+    }
+    
+
+    public Function createFunctionObject(Context cx, Scriptable scope,
+            Object bytecode, Object staticSecurityDomain)
+    {
+        if(bytecode != itsData)
+        {
+            Kit.codeBug();
+        }
+        return InterpretedFunction.createFunction(cx, scope, itsData,
+                                                  staticSecurityDomain);
+    }
+
+    private void generateFunctionICode()
+    {
+        itsInFunctionFlag = true;
+
+        FunctionNode theFunction = (FunctionNode)scriptOrFn;
+
+        itsData.itsFunctionType = theFunction.getFunctionType();
+        itsData.itsNeedsActivation = theFunction.requiresActivation();
+        itsData.itsName = theFunction.getFunctionName();
+        if (!theFunction.getIgnoreDynamicScope()) {
+            if (compilerEnv.isUseDynamicScope()) {
+                itsData.useDynamicScope = true;
+            }
+        }
+        if (theFunction.isGenerator()) {
+          addIcode(Icode_GENERATOR);
+          addUint16(theFunction.getBaseLineno() & 0xFFFF);
+        }
+
+        generateICodeFromTree(theFunction.getLastChild());
+    }
+
+    private void generateICodeFromTree(Node tree)
+    {
+        generateNestedFunctions();
+
+        generateRegExpLiterals();
+
+        visitStatement(tree, 0);
+        fixLabelGotos();
+        // add RETURN_RESULT only to scripts as function always ends with RETURN
+        if (itsData.itsFunctionType == 0) {
+            addToken(Token.RETURN_RESULT);
+        }
+
+        if (itsData.itsICode.length != itsICodeTop) {
+            // Make itsData.itsICode length exactly itsICodeTop to save memory
+            // and catch bugs with jumps beyond icode as early as possible
+            byte[] tmp = new byte[itsICodeTop];
+            System.arraycopy(itsData.itsICode, 0, tmp, 0, itsICodeTop);
+            itsData.itsICode = tmp;
+        }
+        if (itsStrings.size() == 0) {
+            itsData.itsStringTable = null;
+        } else {
+            itsData.itsStringTable = new String[itsStrings.size()];
+            ObjToIntMap.Iterator iter = itsStrings.newIterator();
+            for (iter.start(); !iter.done(); iter.next()) {
+                String str = (String)iter.getKey();
+                int index = iter.getValue();
+                if (itsData.itsStringTable[index] != null) Kit.codeBug();
+                itsData.itsStringTable[index] = str;
+            }
+        }
+        if (itsDoubleTableTop == 0) {
+            itsData.itsDoubleTable = null;
+        } else if (itsData.itsDoubleTable.length != itsDoubleTableTop) {
+            double[] tmp = new double[itsDoubleTableTop];
+            System.arraycopy(itsData.itsDoubleTable, 0, tmp, 0,
+                             itsDoubleTableTop);
+            itsData.itsDoubleTable = tmp;
+        }
+        if (itsExceptionTableTop != 0
+            && itsData.itsExceptionTable.length != itsExceptionTableTop)
+        {
+            int[] tmp = new int[itsExceptionTableTop];
+            System.arraycopy(itsData.itsExceptionTable, 0, tmp, 0,
+                             itsExceptionTableTop);
+            itsData.itsExceptionTable = tmp;
+        }
+
+        itsData.itsMaxVars = scriptOrFn.getParamAndVarCount();
+        // itsMaxFrameArray: interpret method needs this amount for its
+        // stack and sDbl arrays
+        itsData.itsMaxFrameArray = itsData.itsMaxVars
+                                   + itsData.itsMaxLocals
+                                   + itsData.itsMaxStack;
+
+        itsData.argNames = scriptOrFn.getParamAndVarNames();
+        itsData.argIsConst = scriptOrFn.getParamAndVarConst();
+        itsData.argCount = scriptOrFn.getParamCount();
+
+        itsData.encodedSourceStart = scriptOrFn.getEncodedSourceStart();
+        itsData.encodedSourceEnd = scriptOrFn.getEncodedSourceEnd();
+
+        if (itsLiteralIds.size() != 0) {
+            itsData.literalIds = itsLiteralIds.toArray();
+        }
+
+        if (Token.printICode) dumpICode(itsData);
+    }
+
+    private void generateNestedFunctions()
+    {
+        int functionCount = scriptOrFn.getFunctionCount();
+        if (functionCount == 0) return;
+
+        InterpreterData[] array = new InterpreterData[functionCount];
+        for (int i = 0; i != functionCount; i++) {
+            FunctionNode def = scriptOrFn.getFunctionNode(i);
+            Interpreter jsi = new Interpreter();
+            jsi.compilerEnv = compilerEnv;
+            jsi.scriptOrFn = def;
+            jsi.itsData = new InterpreterData(itsData);
+            jsi.generateFunctionICode();
+            array[i] = jsi.itsData;
+        }
+        itsData.itsNestedFunctions = array;
+    }
+
+    private void generateRegExpLiterals()
+    {
+        int N = scriptOrFn.getRegexpCount();
+        if (N == 0) return;
+
+        Context cx = Context.getContext();
+        RegExpProxy rep = ScriptRuntime.checkRegExpProxy(cx);
+        Object[] array = new Object[N];
+        for (int i = 0; i != N; i++) {
+            String string = scriptOrFn.getRegexpString(i);
+            String flags = scriptOrFn.getRegexpFlags(i);
+            array[i] = rep.compileRegExp(cx, string, flags);
+        }
+        itsData.itsRegExpLiterals = array;
+    }
+
+    private void updateLineNumber(Node node)
+    {
+        int lineno = node.getLineno();
+        if (lineno != itsLineNumber && lineno >= 0) {
+            if (itsData.firstLinePC < 0) {
+                itsData.firstLinePC = lineno;
+            }
+            itsLineNumber = lineno;
+            addIcode(Icode_LINE);
+            addUint16(lineno & 0xFFFF);
+        }
+    }
+
+    private RuntimeException badTree(Node node)
+    {
+        throw new RuntimeException(node.toString());
+    }
+
+    private void visitStatement(Node node, int initialStackDepth)
+    {
+        int type = node.getType();
+        Node child = node.getFirstChild();
+        switch (type) {
+
+          case Token.FUNCTION:
+            {
+                int fnIndex = node.getExistingIntProp(Node.FUNCTION_PROP);
+                int fnType = scriptOrFn.getFunctionNode(fnIndex).
+                                 getFunctionType();
+                // Only function expressions or function expression
+                // statements need closure code creating new function
+                // object on stack as function statements are initialized
+                // at script/function start.
+                // In addition, function expressions can not be present here
+                // at statement level, they must only be present as expressions.
+                if (fnType == FunctionNode.FUNCTION_EXPRESSION_STATEMENT) {
+                    addIndexOp(Icode_CLOSURE_STMT, fnIndex);
+                } else {
+                    if (fnType != FunctionNode.FUNCTION_STATEMENT) {
+                        throw Kit.codeBug();
+                    }
+                }
+                // For function statements or function expression statements
+                // in scripts, we need to ensure that the result of the script
+                // is the function if it is the last statement in the script.
+                // For example, eval("function () {}") should return a
+                // function, not undefined.
+                if (!itsInFunctionFlag) {
+                    addIndexOp(Icode_CLOSURE_EXPR, fnIndex);
+                    stackChange(1);
+                    addIcode(Icode_POP_RESULT);
+                    stackChange(-1);
+                }
+            }
+            break;
+
+          case Token.LABEL:
+          case Token.LOOP:
+          case Token.BLOCK:
+          case Token.EMPTY:
+          case Token.WITH:
+            updateLineNumber(node);
+          case Token.SCRIPT:
+            // fall through
+            while (child != null) {
+                visitStatement(child, initialStackDepth);
+                child = child.getNext();
+            }
+            break;
+
+          case Token.ENTERWITH:
+            visitExpression(child, 0);
+            addToken(Token.ENTERWITH);
+            stackChange(-1);
+            break;
+
+          case Token.LEAVEWITH:
+            addToken(Token.LEAVEWITH);
+            break;
+
+          case Token.LOCAL_BLOCK:
+            {
+                int local = allocLocal();
+                node.putIntProp(Node.LOCAL_PROP, local);
+                updateLineNumber(node);
+                while (child != null) {
+                    visitStatement(child, initialStackDepth);
+                    child = child.getNext();
+                }
+                addIndexOp(Icode_LOCAL_CLEAR, local);
+                releaseLocal(local);
+            }
+            break;
+
+          case Token.DEBUGGER:
+            addIcode(Icode_DEBUGGER);
+            break;
+
+          case Token.SWITCH:
+            updateLineNumber(node);
+            // See comments in IRFactory.createSwitch() for description
+            // of SWITCH node
+            {
+                visitExpression(child, 0);
+                for (Node.Jump caseNode = (Node.Jump)child.getNext();
+                     caseNode != null;
+                     caseNode = (Node.Jump)caseNode.getNext())
+                {
+                    if (caseNode.getType() != Token.CASE)
+                        throw badTree(caseNode);
+                    Node test = caseNode.getFirstChild();
+                    addIcode(Icode_DUP);
+                    stackChange(1);
+                    visitExpression(test, 0);
+                    addToken(Token.SHEQ);
+                    stackChange(-1);
+                    // If true, Icode_IFEQ_POP will jump and remove case
+                    // value from stack
+                    addGoto(caseNode.target, Icode_IFEQ_POP);
+                    stackChange(-1);
+                }
+                addIcode(Icode_POP);
+                stackChange(-1);
+            }
+            break;
+
+          case Token.TARGET:
+            markTargetLabel(node);
+            break;
+
+          case Token.IFEQ :
+          case Token.IFNE :
+            {
+                Node target = ((Node.Jump)node).target;
+                visitExpression(child, 0);
+                addGoto(target, type);
+                stackChange(-1);
+            }
+            break;
+
+          case Token.GOTO:
+            {
+                Node target = ((Node.Jump)node).target;
+                addGoto(target, type);
+            }
+            break;
+
+          case Token.JSR:
+            {
+                Node target = ((Node.Jump)node).target;
+                addGoto(target, Icode_GOSUB);
+            }
+            break;
+
+          case Token.FINALLY:
+            {
+                // Account for incomming GOTOSUB address
+                stackChange(1);
+                int finallyRegister = getLocalBlockRef(node);
+                addIndexOp(Icode_STARTSUB, finallyRegister);
+                stackChange(-1);
+                while (child != null) {
+                    visitStatement(child, initialStackDepth);
+                    child = child.getNext();
+                }
+                addIndexOp(Icode_RETSUB, finallyRegister);
+            }
+            break;
+
+          case Token.EXPR_VOID:
+          case Token.EXPR_RESULT:
+            updateLineNumber(node);
+            visitExpression(child, 0);
+            addIcode((type == Token.EXPR_VOID) ? Icode_POP : Icode_POP_RESULT);
+            stackChange(-1);
+            break;
+
+          case Token.TRY:
+            {
+                Node.Jump tryNode = (Node.Jump)node;
+                int exceptionObjectLocal = getLocalBlockRef(tryNode);
+                int scopeLocal = allocLocal();
+
+                addIndexOp(Icode_SCOPE_SAVE, scopeLocal);
+
+                int tryStart = itsICodeTop;
+                boolean savedFlag = itsInTryFlag;
+                itsInTryFlag = true;
+                while (child != null) {
+                    visitStatement(child, initialStackDepth);
+                    child = child.getNext();
+                }
+                itsInTryFlag = savedFlag;
+
+                Node catchTarget = tryNode.target;
+                if (catchTarget != null) {
+                    int catchStartPC
+                        = itsLabelTable[getTargetLabel(catchTarget)];
+                    addExceptionHandler(
+                        tryStart, catchStartPC, catchStartPC,
+                        false, exceptionObjectLocal, scopeLocal);
+                }
+                Node finallyTarget = tryNode.getFinally();
+                if (finallyTarget != null) {
+                    int finallyStartPC
+                        = itsLabelTable[getTargetLabel(finallyTarget)];
+                    addExceptionHandler(
+                        tryStart, finallyStartPC, finallyStartPC,
+                        true, exceptionObjectLocal, scopeLocal);
+                }
+
+                addIndexOp(Icode_LOCAL_CLEAR, scopeLocal);
+                releaseLocal(scopeLocal);
+            }
+            break;
+
+          case Token.CATCH_SCOPE:
+            {
+                int localIndex = getLocalBlockRef(node);
+                int scopeIndex = node.getExistingIntProp(Node.CATCH_SCOPE_PROP);
+                String name = child.getString();
+                child = child.getNext();
+                visitExpression(child, 0); // load expression object
+                addStringPrefix(name);
+                addIndexPrefix(localIndex);
+                addToken(Token.CATCH_SCOPE);
+                addUint8(scopeIndex != 0 ? 1 : 0);
+                stackChange(-1);
+            }
+            break;
+
+          case Token.THROW:
+            updateLineNumber(node);
+            visitExpression(child, 0);
+            addToken(Token.THROW);
+            addUint16(itsLineNumber & 0xFFFF);
+            stackChange(-1);
+            break;
+
+          case Token.RETHROW:
+            updateLineNumber(node);
+            addIndexOp(Token.RETHROW, getLocalBlockRef(node));
+            break;
+
+          case Token.RETURN:
+            updateLineNumber(node);
+            if (node.getIntProp(Node.GENERATOR_END_PROP, 0) != 0) {
+                // We're in a generator, so change RETURN to GENERATOR_END
+                addIcode(Icode_GENERATOR_END);
+                addUint16(itsLineNumber & 0xFFFF);
+            } else if (child != null) {
+                visitExpression(child, ECF_TAIL);
+                addToken(Token.RETURN);
+                stackChange(-1);
+            } else {
+                addIcode(Icode_RETUNDEF);
+            }
+            break;
+
+          case Token.RETURN_RESULT:
+            updateLineNumber(node);
+            addToken(Token.RETURN_RESULT);
+            break;
+
+          case Token.ENUM_INIT_KEYS:
+          case Token.ENUM_INIT_VALUES:
+          case Token.ENUM_INIT_ARRAY:
+            visitExpression(child, 0);
+            addIndexOp(type, getLocalBlockRef(node));
+            stackChange(-1);
+            break;
+
+          case Icode_GENERATOR:
+            break;
+
+          default:
+            throw badTree(node);
+        }
+
+        if (itsStackDepth != initialStackDepth) {
+            throw Kit.codeBug();
+        }
+    }
+
+    private void visitExpression(Node node, int contextFlags)
+    {
+        int type = node.getType();
+        Node child = node.getFirstChild();
+        int savedStackDepth = itsStackDepth;
+        switch (type) {
+
+          case Token.FUNCTION:
+            {
+                int fnIndex = node.getExistingIntProp(Node.FUNCTION_PROP);
+                FunctionNode fn = scriptOrFn.getFunctionNode(fnIndex);
+                // See comments in visitStatement for Token.FUNCTION case
+                if (fn.getFunctionType() != FunctionNode.FUNCTION_EXPRESSION) {
+                    throw Kit.codeBug();
+                }
+                addIndexOp(Icode_CLOSURE_EXPR, fnIndex);
+                stackChange(1);
+            }
+            break;
+
+          case Token.LOCAL_LOAD:
+            {
+                int localIndex = getLocalBlockRef(node);
+                addIndexOp(Token.LOCAL_LOAD, localIndex);
+                stackChange(1);
+            }
+            break;
+
+          case Token.COMMA:
+            {
+                Node lastChild = node.getLastChild();
+                while (child != lastChild) {
+                    visitExpression(child, 0);
+                    addIcode(Icode_POP);
+                    stackChange(-1);
+                    child = child.getNext();
+                }
+                // Preserve tail context flag if any
+                visitExpression(child, contextFlags & ECF_TAIL);
+            }
+            break;
+
+          case Token.USE_STACK:
+            // Indicates that stack was modified externally,
+            // like placed catch object
+            stackChange(1);
+            break;
+
+          case Token.REF_CALL:
+          case Token.CALL:
+          case Token.NEW:
+            {
+                if (type == Token.NEW) {
+                    visitExpression(child, 0);
+                } else {
+                    generateCallFunAndThis(child);
+                }
+                int argCount = 0;
+                while ((child = child.getNext()) != null) {
+                    visitExpression(child, 0);
+                    ++argCount;
+                }
+                int callType = node.getIntProp(Node.SPECIALCALL_PROP,
+                                               Node.NON_SPECIALCALL);
+                if (callType != Node.NON_SPECIALCALL) {
+                    // embed line number and source filename
+                    addIndexOp(Icode_CALLSPECIAL, argCount);
+                    addUint8(callType);
+                    addUint8(type == Token.NEW ? 1 : 0);
+                    addUint16(itsLineNumber & 0xFFFF);
+                } else {
+                    // Only use the tail call optimization if we're not in a try
+                    // or we're not generating debug info (since the
+                    // optimization will confuse the debugger)
+                    if (type == Token.CALL && (contextFlags & ECF_TAIL) != 0 &&
+                        !compilerEnv.isGenerateDebugInfo() && !itsInTryFlag)
+                    {
+                        type = Icode_TAIL_CALL;
+                    }
+                    addIndexOp(type, argCount);
+                }
+                // adjust stack
+                if (type == Token.NEW) {
+                    // new: f, args -> result
+                    stackChange(-argCount);
+                } else {
+                    // call: f, thisObj, args -> result
+                    // ref_call: f, thisObj, args -> ref
+                    stackChange(-1 - argCount);
+                }
+                if (argCount > itsData.itsMaxCalleeArgs) {
+                    itsData.itsMaxCalleeArgs = argCount;
+                }
+            }
+            break;
+
+          case Token.AND:
+          case Token.OR:
+            {
+                visitExpression(child, 0);
+                addIcode(Icode_DUP);
+                stackChange(1);
+                int afterSecondJumpStart = itsICodeTop;
+                int jump = (type == Token.AND) ? Token.IFNE : Token.IFEQ;
+                addGotoOp(jump);
+                stackChange(-1);
+                addIcode(Icode_POP);
+                stackChange(-1);
+                child = child.getNext();
+                // Preserve tail context flag if any
+                visitExpression(child, contextFlags & ECF_TAIL);
+                resolveForwardGoto(afterSecondJumpStart);
+            }
+            break;
+
+          case Token.HOOK:
+            {
+                Node ifThen = child.getNext();
+                Node ifElse = ifThen.getNext();
+                visitExpression(child, 0);
+                int elseJumpStart = itsICodeTop;
+                addGotoOp(Token.IFNE);
+                stackChange(-1);
+                // Preserve tail context flag if any
+                visitExpression(ifThen, contextFlags & ECF_TAIL);
+                int afterElseJumpStart = itsICodeTop;
+                addGotoOp(Token.GOTO);
+                resolveForwardGoto(elseJumpStart);
+                itsStackDepth = savedStackDepth;
+                // Preserve tail context flag if any
+                visitExpression(ifElse, contextFlags & ECF_TAIL);
+                resolveForwardGoto(afterElseJumpStart);
+            }
+            break;
+
+          case Token.GETPROP:
+          case Token.GETPROPNOWARN:
+            visitExpression(child, 0);
+            child = child.getNext();
+            addStringOp(type, child.getString());
+            break;
+
+          case Token.GETELEM:
+          case Token.DELPROP:
+          case Token.BITAND:
+          case Token.BITOR:
+          case Token.BITXOR:
+          case Token.LSH:
+          case Token.RSH:
+          case Token.URSH:
+          case Token.ADD:
+          case Token.SUB:
+          case Token.MOD:
+          case Token.DIV:
+          case Token.MUL:
+          case Token.EQ:
+          case Token.NE:
+          case Token.SHEQ:
+          case Token.SHNE:
+          case Token.IN:
+          case Token.INSTANCEOF:
+          case Token.LE:
+          case Token.LT:
+          case Token.GE:
+          case Token.GT:
+            visitExpression(child, 0);
+            child = child.getNext();
+            visitExpression(child, 0);
+            addToken(type);
+            stackChange(-1);
+            break;
+
+          case Token.POS:
+          case Token.NEG:
+          case Token.NOT:
+          case Token.BITNOT:
+          case Token.TYPEOF:
+          case Token.VOID:
+            visitExpression(child, 0);
+            if (type == Token.VOID) {
+                addIcode(Icode_POP);
+                addIcode(Icode_UNDEF);
+            } else {
+                addToken(type);
+            }
+            break;
+
+          case Token.GET_REF:
+          case Token.DEL_REF:
+            visitExpression(child, 0);
+            addToken(type);
+            break;
+
+          case Token.SETPROP:
+          case Token.SETPROP_OP:
+            {
+                visitExpression(child, 0);
+                child = child.getNext();
+                String property = child.getString();
+                child = child.getNext();
+                if (type == Token.SETPROP_OP) {
+                    addIcode(Icode_DUP);
+                    stackChange(1);
+                    addStringOp(Token.GETPROP, property);
+                    // Compensate for the following USE_STACK
+                    stackChange(-1);
+                }
+                visitExpression(child, 0);
+                addStringOp(Token.SETPROP, property);
+                stackChange(-1);
+            }
+            break;
+
+          case Token.SETELEM:
+          case Token.SETELEM_OP:
+            visitExpression(child, 0);
+            child = child.getNext();
+            visitExpression(child, 0);
+            child = child.getNext();
+            if (type == Token.SETELEM_OP) {
+                addIcode(Icode_DUP2);
+                stackChange(2);
+                addToken(Token.GETELEM);
+                stackChange(-1);
+                // Compensate for the following USE_STACK
+                stackChange(-1);
+            }
+            visitExpression(child, 0);
+            addToken(Token.SETELEM);
+            stackChange(-2);
+            break;
+
+          case Token.SET_REF:
+          case Token.SET_REF_OP:
+            visitExpression(child, 0);
+            child = child.getNext();
+            if (type == Token.SET_REF_OP) {
+                addIcode(Icode_DUP);
+                stackChange(1);
+                addToken(Token.GET_REF);
+                // Compensate for the following USE_STACK
+                stackChange(-1);
+            }
+            visitExpression(child, 0);
+            addToken(Token.SET_REF);
+            stackChange(-1);
+            break;
+
+          case Token.SETNAME:
+            {
+                String name = child.getString();
+                visitExpression(child, 0);
+                child = child.getNext();
+                visitExpression(child, 0);
+                addStringOp(Token.SETNAME, name);
+                stackChange(-1);
+            }
+            break;
+
+          case Token.SETCONST:
+            {
+                String name = child.getString();
+                visitExpression(child, 0);
+                child = child.getNext();
+                visitExpression(child, 0);
+                addStringOp(Icode_SETCONST, name);
+                stackChange(-1);
+            }
+            break;
+
+          case Token.TYPEOFNAME:
+            {
+                int index = -1;
+                // use typeofname if an activation frame exists
+                // since the vars all exist there instead of in jregs
+                if (itsInFunctionFlag && !itsData.itsNeedsActivation)
+                    index = scriptOrFn.getIndexForNameNode(node);
+                if (index == -1) {
+                    addStringOp(Icode_TYPEOFNAME, node.getString());
+                    stackChange(1);
+                } else {
+                    addVarOp(Token.GETVAR, index);
+                    stackChange(1);
+                    addToken(Token.TYPEOF);
+                }
+            }
+            break;
+
+          case Token.BINDNAME:
+          case Token.NAME:
+          case Token.STRING:
+            addStringOp(type, node.getString());
+            stackChange(1);
+            break;
+
+          case Token.INC:
+          case Token.DEC:
+            visitIncDec(node, child);
+            break;
+
+          case Token.NUMBER:
+            {
+                double num = node.getDouble();
+                int inum = (int)num;
+                if (inum == num) {
+                    if (inum == 0) {
+                        addIcode(Icode_ZERO);
+                        // Check for negative zero
+                        if (1.0 / num < 0.0) {
+                            addToken(Token.NEG);
+                        }
+                    } else if (inum == 1) {
+                        addIcode(Icode_ONE);
+                    } else if ((short)inum == inum) {
+                        addIcode(Icode_SHORTNUMBER);
+                        // write short as uin16 bit pattern
+                        addUint16(inum & 0xFFFF);
+                    } else {
+                        addIcode(Icode_INTNUMBER);
+                        addInt(inum);
+                    }
+                } else {
+                    int index = getDoubleIndex(num);
+                    addIndexOp(Token.NUMBER, index);
+                }
+                stackChange(1);
+            }
+            break;
+
+          case Token.GETVAR:
+            {
+                if (itsData.itsNeedsActivation) Kit.codeBug();
+                int index = scriptOrFn.getIndexForNameNode(node);
+                addVarOp(Token.GETVAR, index);
+                stackChange(1);
+            }
+            break;
+
+          case Token.SETVAR:
+            {
+                if (itsData.itsNeedsActivation) Kit.codeBug();
+                int index = scriptOrFn.getIndexForNameNode(child);
+                child = child.getNext();
+                visitExpression(child, 0);
+                addVarOp(Token.SETVAR, index);
+            }
+            break;
+
+          case Token.SETCONSTVAR:
+            {
+                if (itsData.itsNeedsActivation) Kit.codeBug();
+                int index = scriptOrFn.getIndexForNameNode(child);
+                child = child.getNext();
+                visitExpression(child, 0);
+                addVarOp(Token.SETCONSTVAR, index);
+            }
+            break;
+
+          case Token.NULL:
+          case Token.THIS:
+          case Token.THISFN:
+          case Token.FALSE:
+          case Token.TRUE:
+            addToken(type);
+            stackChange(1);
+            break;
+
+          case Token.ENUM_NEXT:
+          case Token.ENUM_ID:
+            addIndexOp(type, getLocalBlockRef(node));
+            stackChange(1);
+            break;
+
+          case Token.REGEXP:
+            {
+                int index = node.getExistingIntProp(Node.REGEXP_PROP);
+                addIndexOp(Token.REGEXP, index);
+                stackChange(1);
+            }
+            break;
+
+          case Token.ARRAYLIT:
+          case Token.OBJECTLIT:
+            visitLiteral(node, child);
+            break;
+
+          case Token.ARRAYCOMP:
+            visitArrayComprehension(node, child, child.getNext());
+            break;
+
+          case Token.REF_SPECIAL:
+            visitExpression(child, 0);
+            addStringOp(type, (String)node.getProp(Node.NAME_PROP));
+            break;
+
+          case Token.REF_MEMBER:
+          case Token.REF_NS_MEMBER:
+          case Token.REF_NAME:
+          case Token.REF_NS_NAME:
+            {
+                int memberTypeFlags = node.getIntProp(Node.MEMBER_TYPE_PROP, 0);
+                // generate possible target, possible namespace and member
+                int childCount = 0;
+                do {
+                    visitExpression(child, 0);
+                    ++childCount;
+                    child = child.getNext();
+                } while (child != null);
+                addIndexOp(type, memberTypeFlags);
+                stackChange(1 - childCount);
+            }
+            break;
+
+          case Token.DOTQUERY:
+            {
+                int queryPC;
+                updateLineNumber(node);
+                visitExpression(child, 0);
+                addIcode(Icode_ENTERDQ);
+                stackChange(-1);
+                queryPC = itsICodeTop;
+                visitExpression(child.getNext(), 0);
+                addBackwardGoto(Icode_LEAVEDQ, queryPC);
+            }
+            break;
+
+          case Token.DEFAULTNAMESPACE :
+          case Token.ESCXMLATTR :
+          case Token.ESCXMLTEXT :
+            visitExpression(child, 0);
+            addToken(type);
+            break;
+
+          case Token.YIELD:
+            if (child != null) {
+                visitExpression(child, 0);
+            } else {
+                addIcode(Icode_UNDEF);
+                stackChange(1);
+            }
+            addToken(Token.YIELD);
+            addUint16(node.getLineno() & 0xFFFF);
+            break;
+
+          case Token.WITHEXPR: {
+            Node enterWith = node.getFirstChild();
+            Node with = enterWith.getNext();
+            visitExpression(enterWith.getFirstChild(), 0);
+            addToken(Token.ENTERWITH);
+            stackChange(-1);
+            visitExpression(with.getFirstChild(), 0);
+            addToken(Token.LEAVEWITH);
+            break;
+          }
+
+          default:
+            throw badTree(node);
+        }
+        if (savedStackDepth + 1 != itsStackDepth) {
+            Kit.codeBug();
+        }
+    }
+
+    private void generateCallFunAndThis(Node left)
+    {
+        // Generate code to place on stack function and thisObj
+        int type = left.getType();
+        switch (type) {
+          case Token.NAME: {
+            String name = left.getString();
+            // stack: ... -> ... function thisObj
+            addStringOp(Icode_NAME_AND_THIS, name);
+            stackChange(2);
+            break;
+          }
+          case Token.GETPROP:
+          case Token.GETELEM: {
+            Node target = left.getFirstChild();
+            visitExpression(target, 0);
+            Node id = target.getNext();
+            if (type == Token.GETPROP) {
+                String property = id.getString();
+                // stack: ... target -> ... function thisObj
+                addStringOp(Icode_PROP_AND_THIS, property);
+                stackChange(1);
+            } else {
+                visitExpression(id, 0);
+                // stack: ... target id -> ... function thisObj
+                addIcode(Icode_ELEM_AND_THIS);
+            }
+            break;
+          }
+          default:
+            // Including Token.GETVAR
+            visitExpression(left, 0);
+            // stack: ... value -> ... function thisObj
+            addIcode(Icode_VALUE_AND_THIS);
+            stackChange(1);
+            break;
+        }
+    }
+
+    private void visitIncDec(Node node, Node child)
+    {
+        int incrDecrMask = node.getExistingIntProp(Node.INCRDECR_PROP);
+        int childType = child.getType();
+        switch (childType) {
+          case Token.GETVAR : {
+            if (itsData.itsNeedsActivation) Kit.codeBug();
+            int i = scriptOrFn.getIndexForNameNode(child);
+            addVarOp(Icode_VAR_INC_DEC, i);
+            addUint8(incrDecrMask);
+            stackChange(1);
+            break;
+          }
+          case Token.NAME : {
+            String name = child.getString();
+            addStringOp(Icode_NAME_INC_DEC, name);
+            addUint8(incrDecrMask);
+            stackChange(1);
+            break;
+          }
+          case Token.GETPROP : {
+            Node object = child.getFirstChild();
+            visitExpression(object, 0);
+            String property = object.getNext().getString();
+            addStringOp(Icode_PROP_INC_DEC, property);
+            addUint8(incrDecrMask);
+            break;
+          }
+          case Token.GETELEM : {
+            Node object = child.getFirstChild();
+            visitExpression(object, 0);
+            Node index = object.getNext();
+            visitExpression(index, 0);
+            addIcode(Icode_ELEM_INC_DEC);
+            addUint8(incrDecrMask);
+            stackChange(-1);
+            break;
+          }
+          case Token.GET_REF : {
+            Node ref = child.getFirstChild();
+            visitExpression(ref, 0);
+            addIcode(Icode_REF_INC_DEC);
+            addUint8(incrDecrMask);
+            break;
+          }
+          default : {
+            throw badTree(node);
+          }
+        }
+    }
+
+    private void visitLiteral(Node node, Node child)
+    {
+        int type = node.getType();
+        int count;
+        Object[] propertyIds = null;
+        if (type == Token.ARRAYLIT) {
+            count = 0;
+            for (Node n = child; n != null; n = n.getNext()) {
+                ++count;
+            }
+        } else if (type == Token.OBJECTLIT) {
+            propertyIds = (Object[])node.getProp(Node.OBJECT_IDS_PROP);
+            count = propertyIds.length;
+        } else {
+            throw badTree(node);
+        }
+        addIndexOp(Icode_LITERAL_NEW, count);
+        stackChange(2);
+        while (child != null) {
+            int childType = child.getType();
+            if (childType == Token.GET) {
+                visitExpression(child.getFirstChild(), 0);
+                addIcode(Icode_LITERAL_GETTER);
+            } else if (childType == Token.SET) {
+                visitExpression(child.getFirstChild(), 0);
+                addIcode(Icode_LITERAL_SETTER);
+            } else {
+                visitExpression(child, 0);
+                addIcode(Icode_LITERAL_SET);
+            }
+            stackChange(-1);
+            child = child.getNext();
+        }
+        if (type == Token.ARRAYLIT) {
+            int[] skipIndexes = (int[])node.getProp(Node.SKIP_INDEXES_PROP);
+            if (skipIndexes == null) {
+                addToken(Token.ARRAYLIT);
+            } else {
+                int index = itsLiteralIds.size();
+                itsLiteralIds.add(skipIndexes);
+                addIndexOp(Icode_SPARE_ARRAYLIT, index);
+            }
+        } else {
+            int index = itsLiteralIds.size();
+            itsLiteralIds.add(propertyIds);
+            addIndexOp(Token.OBJECTLIT, index);
+        }
+        stackChange(-1);
+    }
+    
+    private void visitArrayComprehension(Node node, Node initStmt, Node expr)
+    {
+        // A bit of a hack: array comprehensions are implemented using
+        // statement nodes for the iteration, yet they appear in an
+        // expression context. So we pass the current stack depth to
+        // visitStatement so it can check that the depth is not altered
+        // by statements.
+        visitStatement(initStmt, itsStackDepth);
+        visitExpression(expr, 0);
+    }
+
+    private int getLocalBlockRef(Node node)
+    {
+        Node localBlock = (Node)node.getProp(Node.LOCAL_BLOCK_PROP);
+        return localBlock.getExistingIntProp(Node.LOCAL_PROP);
+    }
+
+    private int getTargetLabel(Node target)
+    {
+        int label = target.labelId();
+        if (label != -1) {
+            return label;
+        }
+        label = itsLabelTableTop;
+        if (itsLabelTable == null || label == itsLabelTable.length) {
+            if (itsLabelTable == null) {
+                itsLabelTable = new int[MIN_LABEL_TABLE_SIZE];
+            }else {
+                int[] tmp = new int[itsLabelTable.length * 2];
+                System.arraycopy(itsLabelTable, 0, tmp, 0, label);
+                itsLabelTable = tmp;
+            }
+        }
+        itsLabelTableTop = label + 1;
+        itsLabelTable[label] = -1;
+
+        target.labelId(label);
+        return label;
+    }
+
+    private void markTargetLabel(Node target)
+    {
+        int label = getTargetLabel(target);
+        if (itsLabelTable[label] != -1) {
+            // Can mark label only once
+            Kit.codeBug();
+        }
+        itsLabelTable[label] = itsICodeTop;
+    }
+
+    private void addGoto(Node target, int gotoOp)
+    {
+        int label = getTargetLabel(target);
+        if (!(label < itsLabelTableTop)) Kit.codeBug();
+        int targetPC = itsLabelTable[label];
+
+        if (targetPC != -1) {
+            addBackwardGoto(gotoOp, targetPC);
+        } else {
+            int gotoPC = itsICodeTop;
+            addGotoOp(gotoOp);
+            int top = itsFixupTableTop;
+            if (itsFixupTable == null || top == itsFixupTable.length) {
+                if (itsFixupTable == null) {
+                    itsFixupTable = new long[MIN_FIXUP_TABLE_SIZE];
+                } else {
+                    long[] tmp = new long[itsFixupTable.length * 2];
+                    System.arraycopy(itsFixupTable, 0, tmp, 0, top);
+                    itsFixupTable = tmp;
+                }
+            }
+            itsFixupTableTop = top + 1;
+            itsFixupTable[top] = ((long)label << 32) | gotoPC;
+        }
+    }
+
+    private void fixLabelGotos()
+    {
+        for (int i = 0; i < itsFixupTableTop; i++) {
+            long fixup = itsFixupTable[i];
+            int label = (int)(fixup >> 32);
+            int jumpSource = (int)fixup;
+            int pc = itsLabelTable[label];
+            if (pc == -1) {
+                // Unlocated label
+                throw Kit.codeBug();
+            }
+            resolveGoto(jumpSource, pc);
+        }
+        itsFixupTableTop = 0;
+    }
+
+    private void addBackwardGoto(int gotoOp, int jumpPC)
+    {
+        int fromPC = itsICodeTop;
+        // Ensure that this is a jump backward
+        if (fromPC <= jumpPC) throw Kit.codeBug();
+        addGotoOp(gotoOp);
+        resolveGoto(fromPC, jumpPC);
+    }
+
+    private void resolveForwardGoto(int fromPC)
+    {
+        // Ensure that forward jump skips at least self bytecode
+        if (itsICodeTop < fromPC + 3) throw Kit.codeBug();
+        resolveGoto(fromPC, itsICodeTop);
+    }
+
+    private void resolveGoto(int fromPC, int jumpPC)
+    {
+        int offset = jumpPC - fromPC;
+        // Ensure that jumps do not overlap
+        if (0 <= offset && offset <= 2) throw Kit.codeBug();
+        int offsetSite = fromPC + 1;
+        if (offset != (short)offset) {
+            if (itsData.longJumps == null) {
+                itsData.longJumps = new UintMap();
+            }
+            itsData.longJumps.put(offsetSite, jumpPC);
+            offset = 0;
+        }
+        byte[] array = itsData.itsICode;
+        array[offsetSite] = (byte)(offset >> 8);
+        array[offsetSite + 1] = (byte)offset;
+    }
+
+    private void addToken(int token)
+    {
+        if (!validTokenCode(token)) throw Kit.codeBug();
+        addUint8(token);
+    }
+
+    private void addIcode(int icode)
+    {
+        if (!validIcode(icode)) throw Kit.codeBug();
+        // Write negative icode as uint8 bits
+        addUint8(icode & 0xFF);
+    }
+
+    private void addUint8(int value)
+    {
+        if ((value & ~0xFF) != 0) throw Kit.codeBug();
+        byte[] array = itsData.itsICode;
+        int top = itsICodeTop;
+        if (top == array.length) {
+            array = increaseICodeCapacity(1);
+        }
+        array[top] = (byte)value;
+        itsICodeTop = top + 1;
+    }
+
+    private void addUint16(int value)
+    {
+        if ((value & ~0xFFFF) != 0) throw Kit.codeBug();
+        byte[] array = itsData.itsICode;
+        int top = itsICodeTop;
+        if (top + 2 > array.length) {
+            array = increaseICodeCapacity(2);
+        }
+        array[top] = (byte)(value >>> 8);
+        array[top + 1] = (byte)value;
+        itsICodeTop = top + 2;
+    }
+
+    private void addInt(int i)
+    {
+        byte[] array = itsData.itsICode;
+        int top = itsICodeTop;
+        if (top + 4 > array.length) {
+            array = increaseICodeCapacity(4);
+        }
+        array[top] = (byte)(i >>> 24);
+        array[top + 1] = (byte)(i >>> 16);
+        array[top + 2] = (byte)(i >>> 8);
+        array[top + 3] = (byte)i;
+        itsICodeTop = top + 4;
+    }
+
+    private int getDoubleIndex(double num)
+    {
+        int index = itsDoubleTableTop;
+        if (index == 0) {
+            itsData.itsDoubleTable = new double[64];
+        } else if (itsData.itsDoubleTable.length == index) {
+            double[] na = new double[index * 2];
+            System.arraycopy(itsData.itsDoubleTable, 0, na, 0, index);
+            itsData.itsDoubleTable = na;
+        }
+        itsData.itsDoubleTable[index] = num;
+        itsDoubleTableTop = index + 1;
+        return index;
+    }
+
+    private void addGotoOp(int gotoOp)
+    {
+        byte[] array = itsData.itsICode;
+        int top = itsICodeTop;
+        if (top + 3 > array.length) {
+            array = increaseICodeCapacity(3);
+        }
+        array[top] = (byte)gotoOp;
+        // Offset would written later
+        itsICodeTop = top + 1 + 2;
+    }
+
+    private void addVarOp(int op, int varIndex)
+    {
+        switch (op) {
+          case Token.SETCONSTVAR:
+            if (varIndex < 128) {
+                addIcode(Icode_SETCONSTVAR1);
+                addUint8(varIndex);
+                return;
+            }
+            addIndexOp(Icode_SETCONSTVAR, varIndex);
+            return;
+          case Token.GETVAR:
+          case Token.SETVAR:
+            if (varIndex < 128) {
+                addIcode(op == Token.GETVAR ? Icode_GETVAR1 : Icode_SETVAR1);
+                addUint8(varIndex);
+                return;
+            }
+            // fallthrough
+          case Icode_VAR_INC_DEC:
+            addIndexOp(op, varIndex);
+            return;
+        }
+        throw Kit.codeBug();
+    }
+
+    private void addStringOp(int op, String str)
+    {
+        addStringPrefix(str);
+        if (validIcode(op)) {
+            addIcode(op);
+        } else {
+            addToken(op);
+        }
+    }
+
+    private void addIndexOp(int op, int index)
+    {
+        addIndexPrefix(index);
+        if (validIcode(op)) {
+            addIcode(op);
+        } else {
+            addToken(op);
+        }
+    }
+
+    private void addStringPrefix(String str)
+    {
+        int index = itsStrings.get(str, -1);
+        if (index == -1) {
+            index = itsStrings.size();
+            itsStrings.put(str, index);
+        }
+        if (index < 4) {
+            addIcode(Icode_REG_STR_C0 - index);
+        } else if (index <= 0xFF) {
+            addIcode(Icode_REG_STR1);
+            addUint8(index);
+         } else if (index <= 0xFFFF) {
+            addIcode(Icode_REG_STR2);
+            addUint16(index);
+         } else {
+            addIcode(Icode_REG_STR4);
+            addInt(index);
+        }
+    }
+
+    private void addIndexPrefix(int index)
+    {
+        if (index < 0) Kit.codeBug();
+        if (index < 6) {
+            addIcode(Icode_REG_IND_C0 - index);
+        } else if (index <= 0xFF) {
+            addIcode(Icode_REG_IND1);
+            addUint8(index);
+         } else if (index <= 0xFFFF) {
+            addIcode(Icode_REG_IND2);
+            addUint16(index);
+         } else {
+            addIcode(Icode_REG_IND4);
+            addInt(index);
+        }
+    }
+
+    private void addExceptionHandler(int icodeStart, int icodeEnd,
+                                     int handlerStart, boolean isFinally,
+                                     int exceptionObjectLocal, int scopeLocal)
+    {
+        int top = itsExceptionTableTop;
+        int[] table = itsData.itsExceptionTable;
+        if (table == null) {
+            if (top != 0) Kit.codeBug();
+            table = new int[EXCEPTION_SLOT_SIZE * 2];
+            itsData.itsExceptionTable = table;
+        } else if (table.length == top) {
+            table = new int[table.length * 2];
+            System.arraycopy(itsData.itsExceptionTable, 0, table, 0, top);
+            itsData.itsExceptionTable = table;
+        }
+        table[top + EXCEPTION_TRY_START_SLOT]  = icodeStart;
+        table[top + EXCEPTION_TRY_END_SLOT]    = icodeEnd;
+        table[top + EXCEPTION_HANDLER_SLOT]    = handlerStart;
+        table[top + EXCEPTION_TYPE_SLOT]       = isFinally ? 1 : 0;
+        table[top + EXCEPTION_LOCAL_SLOT]      = exceptionObjectLocal;
+        table[top + EXCEPTION_SCOPE_SLOT]      = scopeLocal;
+
+        itsExceptionTableTop = top + EXCEPTION_SLOT_SIZE;
+    }
+
+    private byte[] increaseICodeCapacity(int extraSize)
+    {
+        int capacity = itsData.itsICode.length;
+        int top = itsICodeTop;
+        if (top + extraSize <= capacity) throw Kit.codeBug();
+        capacity *= 2;
+        if (top + extraSize > capacity) {
+            capacity = top + extraSize;
+        }
+        byte[] array = new byte[capacity];
+        System.arraycopy(itsData.itsICode, 0, array, 0, top);
+        itsData.itsICode = array;
+        return array;
+    }
+
+    private void stackChange(int change)
+    {
+        if (change <= 0) {
+            itsStackDepth += change;
+        } else {
+            int newDepth = itsStackDepth + change;
+            if (newDepth > itsData.itsMaxStack) {
+                itsData.itsMaxStack = newDepth;
+            }
+            itsStackDepth = newDepth;
+        }
+    }
+
+    private int allocLocal()
+    {
+        int localSlot = itsLocalTop;
+        ++itsLocalTop;
+        if (itsLocalTop > itsData.itsMaxLocals) {
+            itsData.itsMaxLocals = itsLocalTop;
+        }
+        return localSlot;
+    }
+
+    private void releaseLocal(int localSlot)
+    {
+        --itsLocalTop;
+        if (localSlot != itsLocalTop) Kit.codeBug();
+    }
+
+    private static int getShort(byte[] iCode, int pc) {
+        return (iCode[pc] << 8) | (iCode[pc + 1] & 0xFF);
+    }
+
+    private static int getIndex(byte[] iCode, int pc) {
+        return ((iCode[pc] & 0xFF) << 8) | (iCode[pc + 1] & 0xFF);
+    }
+
+    private static int getInt(byte[] iCode, int pc) {
+        return (iCode[pc] << 24) | ((iCode[pc + 1] & 0xFF) << 16)
+               | ((iCode[pc + 2] & 0xFF) << 8) | (iCode[pc + 3] & 0xFF);
+    }
+
+    private static int getExceptionHandler(CallFrame frame,
+                                           boolean onlyFinally)
+    {
+        int[] exceptionTable = frame.idata.itsExceptionTable;
+        if (exceptionTable == null) {
+            // No exception handlers
+            return -1;
+        }
+
+        // Icode switch in the interpreter increments PC immediately
+        // and it is necessary to subtract 1 from the saved PC
+        // to point it before the start of the next instruction.
+        int pc = frame.pc - 1;
+
+        // OPT: use binary search
+        int best = -1, bestStart = 0, bestEnd = 0;
+        for (int i = 0; i != exceptionTable.length; i += EXCEPTION_SLOT_SIZE) {
+            int start = exceptionTable[i + EXCEPTION_TRY_START_SLOT];
+            int end = exceptionTable[i + EXCEPTION_TRY_END_SLOT];
+            if (!(start <= pc && pc < end)) {
+                continue;
+            }
+            if (onlyFinally && exceptionTable[i + EXCEPTION_TYPE_SLOT] != 1) {
+                continue;
+            }
+            if (best >= 0) {
+                // Since handlers always nest and they never have shared end
+                // although they can share start  it is sufficient to compare
+                // handlers ends
+                if (bestEnd < end) {
+                    continue;
+                }
+                // Check the above assumption
+                if (bestStart > start) Kit.codeBug(); // should be nested
+                if (bestEnd == end) Kit.codeBug();  // no ens sharing
+            }
+            best = i;
+            bestStart = start;
+            bestEnd = end;
+        }
+        return best;
+    }
+
+    private static void dumpICode(InterpreterData idata)
+    {
+        if (!Token.printICode) {
+            return;
+        }
+
+        byte iCode[] = idata.itsICode;
+        int iCodeLength = iCode.length;
+        String[] strings = idata.itsStringTable;
+        PrintStream out = System.out;
+        out.println("ICode dump, for " + idata.itsName
+                    + ", length = " + iCodeLength);
+        out.println("MaxStack = " + idata.itsMaxStack);
+
+        int indexReg = 0;
+        for (int pc = 0; pc < iCodeLength; ) {
+            out.flush();
+            out.print(" [" + pc + "] ");
+            int token = iCode[pc];
+            int icodeLength = bytecodeSpan(token);
+            String tname = bytecodeName(token);
+            int old_pc = pc;
+            ++pc;
+            switch (token) {
+              default:
+                if (icodeLength != 1) Kit.codeBug();
+                out.println(tname);
+                break;
+
+              case Icode_GOSUB :
+              case Token.GOTO :
+              case Token.IFEQ :
+              case Token.IFNE :
+              case Icode_IFEQ_POP :
+              case Icode_LEAVEDQ : {
+                int newPC = pc + getShort(iCode, pc) - 1;
+                out.println(tname + " " + newPC);
+                pc += 2;
+                break;
+              }
+              case Icode_VAR_INC_DEC :
+              case Icode_NAME_INC_DEC :
+              case Icode_PROP_INC_DEC :
+              case Icode_ELEM_INC_DEC :
+              case Icode_REF_INC_DEC: {
+                int incrDecrType = iCode[pc];
+                out.println(tname + " " + incrDecrType);
+                ++pc;
+                break;
+              }
+
+              case Icode_CALLSPECIAL : {
+                int callType = iCode[pc] & 0xFF;
+                boolean isNew =  (iCode[pc + 1] != 0);
+                int line = getIndex(iCode, pc+2);
+                out.println(tname+" "+callType+" "+isNew+" "+indexReg+" "+line);
+                pc += 4;
+                break;
+              }
+
+              case Token.CATCH_SCOPE:
+                {
+                    boolean afterFisrtFlag =  (iCode[pc] != 0);
+                    out.println(tname+" "+afterFisrtFlag);
+                    ++pc;
+                }
+                break;
+              case Token.REGEXP :
+                out.println(tname+" "+idata.itsRegExpLiterals[indexReg]);
+                break;
+              case Token.OBJECTLIT :
+              case Icode_SPARE_ARRAYLIT :
+                out.println(tname+" "+idata.literalIds[indexReg]);
+                break;
+              case Icode_CLOSURE_EXPR :
+              case Icode_CLOSURE_STMT :
+                out.println(tname+" "+idata.itsNestedFunctions[indexReg]);
+                break;
+              case Token.CALL :
+              case Icode_TAIL_CALL :
+              case Token.REF_CALL :
+              case Token.NEW :
+                out.println(tname+' '+indexReg);
+                break;
+              case Token.THROW :
+              case Token.YIELD :
+              case Icode_GENERATOR :
+              case Icode_GENERATOR_END :
+              {
+                int line = getIndex(iCode, pc);
+                out.println(tname + " : " + line);
+                pc += 2;
+                break;
+              }
+              case Icode_SHORTNUMBER : {
+                int value = getShort(iCode, pc);
+                out.println(tname + " " + value);
+                pc += 2;
+                break;
+              }
+              case Icode_INTNUMBER : {
+                int value = getInt(iCode, pc);
+                out.println(tname + " " + value);
+                pc += 4;
+                break;
+              }
+              case Token.NUMBER : {
+                double value = idata.itsDoubleTable[indexReg];
+                out.println(tname + " " + value);
+                break;
+              }
+              case Icode_LINE : {
+                int line = getIndex(iCode, pc);
+                out.println(tname + " : " + line);
+                pc += 2;
+                break;
+              }
+              case Icode_REG_STR1: {
+                String str = strings[0xFF & iCode[pc]];
+                out.println(tname + " \"" + str + '"');
+                ++pc;
+                break;
+              }
+              case Icode_REG_STR2: {
+                String str = strings[getIndex(iCode, pc)];
+                out.println(tname + " \"" + str + '"');
+                pc += 2;
+                break;
+              }
+              case Icode_REG_STR4: {
+                String str = strings[getInt(iCode, pc)];
+                out.println(tname + " \"" + str + '"');
+                pc += 4;
+                break;
+              }
+              case Icode_REG_IND_C0:
+                  indexReg = 0;
+                  out.println(tname);
+                  break;
+              case Icode_REG_IND_C1:
+                  indexReg = 1;
+                  out.println(tname);
+                  break;
+              case Icode_REG_IND_C2:
+                  indexReg = 2;
+                  out.println(tname);
+                  break;
+              case Icode_REG_IND_C3:
+                  indexReg = 3;
+                  out.println(tname);
+                  break;
+              case Icode_REG_IND_C4:
+                  indexReg = 4;
+                  out.println(tname);
+                  break;
+              case Icode_REG_IND_C5:
+                  indexReg = 5;
+                  out.println(tname);
+                  break;
+              case Icode_REG_IND1: {
+                indexReg = 0xFF & iCode[pc];
+                out.println(tname+" "+indexReg);
+                ++pc;
+                break;
+              }
+              case Icode_REG_IND2: {
+                indexReg = getIndex(iCode, pc);
+                out.println(tname+" "+indexReg);
+                pc += 2;
+                break;
+              }
+              case Icode_REG_IND4: {
+                indexReg = getInt(iCode, pc);
+                out.println(tname+" "+indexReg);
+                pc += 4;
+                break;
+              }
+              case Icode_GETVAR1:
+              case Icode_SETVAR1:
+              case Icode_SETCONSTVAR1:
+                indexReg = iCode[pc];
+                out.println(tname+" "+indexReg);
+                ++pc;
+                break;
+            }
+            if (old_pc + icodeLength != pc) Kit.codeBug();
+        }
+
+        int[] table = idata.itsExceptionTable;
+        if (table != null) {
+            out.println("Exception handlers: "
+                         +table.length / EXCEPTION_SLOT_SIZE);
+            for (int i = 0; i != table.length;
+                 i += EXCEPTION_SLOT_SIZE)
+            {
+                int tryStart       = table[i + EXCEPTION_TRY_START_SLOT];
+                int tryEnd         = table[i + EXCEPTION_TRY_END_SLOT];
+                int handlerStart   = table[i + EXCEPTION_HANDLER_SLOT];
+                int type           = table[i + EXCEPTION_TYPE_SLOT];
+                int exceptionLocal = table[i + EXCEPTION_LOCAL_SLOT];
+                int scopeLocal     = table[i + EXCEPTION_SCOPE_SLOT];
+
+                out.println(" tryStart="+tryStart+" tryEnd="+tryEnd
+                            +" handlerStart="+handlerStart
+                            +" type="+(type == 0 ? "catch" : "finally")
+                            +" exceptionLocal="+exceptionLocal);
+            }
+        }
+        out.flush();
+    }
+
+    private static int bytecodeSpan(int bytecode)
+    {
+        switch (bytecode) {
+            case Token.THROW :
+            case Token.YIELD:
+            case Icode_GENERATOR:
+            case Icode_GENERATOR_END:
+                // source line
+                return 1 + 2;
+
+            case Icode_GOSUB :
+            case Token.GOTO :
+            case Token.IFEQ :
+            case Token.IFNE :
+            case Icode_IFEQ_POP :
+            case Icode_LEAVEDQ :
+                // target pc offset
+                return 1 + 2;
+
+            case Icode_CALLSPECIAL :
+                // call type
+                // is new
+                // line number
+                return 1 + 1 + 1 + 2;
+
+            case Token.CATCH_SCOPE:
+                // scope flag
+                return 1 + 1;
+
+            case Icode_VAR_INC_DEC:
+            case Icode_NAME_INC_DEC:
+            case Icode_PROP_INC_DEC:
+            case Icode_ELEM_INC_DEC:
+            case Icode_REF_INC_DEC:
+                // type of ++/--
+                return 1 + 1;
+
+            case Icode_SHORTNUMBER :
+                // short number
+                return 1 + 2;
+
+            case Icode_INTNUMBER :
+                // int number
+                return 1 + 4;
+
+            case Icode_REG_IND1:
+                // ubyte index
+                return 1 + 1;
+
+            case Icode_REG_IND2:
+                // ushort index
+                return 1 + 2;
+
+            case Icode_REG_IND4:
+                // int index
+                return 1 + 4;
+
+            case Icode_REG_STR1:
+                // ubyte string index
+                return 1 + 1;
+
+            case Icode_REG_STR2:
+                // ushort string index
+                return 1 + 2;
+
+            case Icode_REG_STR4:
+                // int string index
+                return 1 + 4;
+
+            case Icode_GETVAR1:
+            case Icode_SETVAR1:
+            case Icode_SETCONSTVAR1:
+                // byte var index
+                return 1 + 1;
+
+            case Icode_LINE :
+                // line number
+                return 1 + 2;
+        }
+        if (!validBytecode(bytecode)) throw Kit.codeBug();
+        return 1;
+    }
+
+    static int[] getLineNumbers(InterpreterData data)
+    {
+        UintMap presentLines = new UintMap();
+
+        byte[] iCode = data.itsICode;
+        int iCodeLength = iCode.length;
+        for (int pc = 0; pc != iCodeLength;) {
+            int bytecode = iCode[pc];
+            int span = bytecodeSpan(bytecode);
+            if (bytecode == Icode_LINE) {
+                if (span != 3) Kit.codeBug();
+                int line = getIndex(iCode, pc + 1);
+                presentLines.put(line, 0);
+            }
+            pc += span;
+        }
+
+        return presentLines.getKeys();
+    }
+
+    public void captureStackInfo(RhinoException ex)
+    {
+        Context cx = Context.getCurrentContext();
+        if (cx == null || cx.lastInterpreterFrame == null) {
+            // No interpreter invocations
+            ex.interpreterStackInfo = null;
+            ex.interpreterLineData = null;
+            return;
+        }
+        // has interpreter frame on the stack
+        CallFrame[] array;
+        if (cx.previousInterpreterInvocations == null
+            || cx.previousInterpreterInvocations.size() == 0)
+        {
+            array = new CallFrame[1];
+        } else {
+            int previousCount = cx.previousInterpreterInvocations.size();
+            if (cx.previousInterpreterInvocations.peek()
+                == cx.lastInterpreterFrame)
+            {
+                // It can happen if exception was generated after
+                // frame was pushed to cx.previousInterpreterInvocations
+                // but before assignment to cx.lastInterpreterFrame.
+                // In this case frames has to be ignored.
+                --previousCount;
+            }
+            array = new CallFrame[previousCount + 1];
+            cx.previousInterpreterInvocations.toArray(array);
+        }
+        array[array.length - 1]  = (CallFrame)cx.lastInterpreterFrame;
+
+        int interpreterFrameCount = 0;
+        for (int i = 0; i != array.length; ++i) {
+            interpreterFrameCount += 1 + array[i].frameIndex;
+        }
+
+        int[] linePC = new int[interpreterFrameCount];
+        // Fill linePC with pc positions from all interpreter frames.
+        // Start from the most nested frame
+        int linePCIndex = interpreterFrameCount;
+        for (int i = array.length; i != 0;) {
+            --i;
+            CallFrame frame = array[i];
+            while (frame != null) {
+                --linePCIndex;
+                linePC[linePCIndex] = frame.pcSourceLineStart;
+                frame = frame.parentFrame;
+            }
+        }
+        if (linePCIndex != 0) Kit.codeBug();
+
+        ex.interpreterStackInfo = array;
+        ex.interpreterLineData = linePC;
+    }
+
+    public String getSourcePositionFromStack(Context cx, int[] linep)
+    {
+        CallFrame frame = (CallFrame)cx.lastInterpreterFrame;
+        InterpreterData idata = frame.idata;
+        if (frame.pcSourceLineStart >= 0) {
+            linep[0] = getIndex(idata.itsICode, frame.pcSourceLineStart);
+        } else {
+            linep[0] = 0;
+        }
+        return idata.itsSourceFile;
+    }
+
+    public String getPatchedStack(RhinoException ex,
+                                  String nativeStackTrace)
+    {
+        String tag = "org.mozilla.javascript.Interpreter.interpretLoop";
+        StringBuffer sb = new StringBuffer(nativeStackTrace.length() + 1000);
+        String lineSeparator = SecurityUtilities.getSystemProperty("line.separator");
+
+        CallFrame[] array = (CallFrame[])ex.interpreterStackInfo;
+        int[] linePC = ex.interpreterLineData;
+        int arrayIndex = array.length;
+        int linePCIndex = linePC.length;
+        int offset = 0;
+        while (arrayIndex != 0) {
+            --arrayIndex;
+            int pos = nativeStackTrace.indexOf(tag, offset);
+            if (pos < 0) {
+                break;
+            }
+
+            // Skip tag length
+            pos += tag.length();
+            // Skip until the end of line
+            for (; pos != nativeStackTrace.length(); ++pos) {
+                char c = nativeStackTrace.charAt(pos);
+                if (c == '\n' || c == '\r') {
+                    break;
+                }
+            }
+            sb.append(nativeStackTrace.substring(offset, pos));
+            offset = pos;
+
+            CallFrame frame = array[arrayIndex];
+            while (frame != null) {
+                if (linePCIndex == 0) Kit.codeBug();
+                --linePCIndex;
+                InterpreterData idata = frame.idata;
+                sb.append(lineSeparator);
+                sb.append("\tat script");
+                if (idata.itsName != null && idata.itsName.length() != 0) {
+                    sb.append('.');
+                    sb.append(idata.itsName);
+                }
+                sb.append('(');
+                sb.append(idata.itsSourceFile);
+                int pc = linePC[linePCIndex];
+                if (pc >= 0) {
+                    // Include line info only if available
+                    sb.append(':');
+                    sb.append(getIndex(idata.itsICode, pc));
+                }
+                sb.append(')');
+                frame = frame.parentFrame;
+            }
+        }
+        sb.append(nativeStackTrace.substring(offset));
+
+        return sb.toString();
+    }
+
+    public List getScriptStack(RhinoException ex)
+    {
+        if (ex.interpreterStackInfo == null) {
+            return null;
+        }
+        
+        List list = new ArrayList();
+        String lineSeparator =
+                SecurityUtilities.getSystemProperty("line.separator");
+
+        CallFrame[] array = (CallFrame[])ex.interpreterStackInfo;
+        int[] linePC = ex.interpreterLineData;
+        int arrayIndex = array.length;
+        int linePCIndex = linePC.length;
+        while (arrayIndex != 0) {
+            --arrayIndex;
+            StringBuilder sb = new StringBuilder();
+            CallFrame frame = array[arrayIndex];
+            while (frame != null) {
+                if (linePCIndex == 0) Kit.codeBug();
+                --linePCIndex;
+                InterpreterData idata = frame.idata;
+                sb.append("\tat ");
+                sb.append(idata.itsSourceFile);
+                int pc = linePC[linePCIndex];
+                if (pc >= 0) {
+                    // Include line info only if available
+                    sb.append(':');
+                    sb.append(getIndex(idata.itsICode, pc));
+                }
+                if (idata.itsName != null && idata.itsName.length() != 0) {
+                    sb.append(" (");
+                    sb.append(idata.itsName);
+                    sb.append(')');
+                }
+                sb.append(lineSeparator);
+                frame = frame.parentFrame;
+            }
+            list.add(sb.toString());
+        }
+        return list;
+    }
+        
+    static String getEncodedSource(InterpreterData idata)
+    {
+        if (idata.encodedSource == null) {
+            return null;
+        }
+        return idata.encodedSource.substring(idata.encodedSourceStart,
+                                             idata.encodedSourceEnd);
+    }
+
+    private static void initFunction(Context cx, Scriptable scope,
+                                     InterpretedFunction parent, int index)
+    {
+        InterpretedFunction fn;
+        fn = InterpretedFunction.createFunction(cx, scope, parent, index);
+        ScriptRuntime.initFunction(cx, scope, fn, fn.idata.itsFunctionType,
+                                   parent.idata.evalScriptFlag);
+    }
+
+    static Object interpret(InterpretedFunction ifun,
+                            Context cx, Scriptable scope,
+                            Scriptable thisObj, Object[] args)
+    {
+        if (!ScriptRuntime.hasTopCall(cx)) Kit.codeBug();
+
+        if (cx.interpreterSecurityDomain != ifun.securityDomain) {
+            Object savedDomain = cx.interpreterSecurityDomain;
+            cx.interpreterSecurityDomain = ifun.securityDomain;
+            try {
+                return ifun.securityController.callWithDomain(
+                    ifun.securityDomain, cx, ifun, scope, thisObj, args);
+            } finally {
+                cx.interpreterSecurityDomain = savedDomain;
+            }
+        }
+
+        CallFrame frame = new CallFrame();
+        initFrame(cx, scope, thisObj, args, null, 0, args.length,
+                  ifun, null, frame);
+        frame.isContinuationsTopFrame = cx.isContinuationsTopCall;
+        cx.isContinuationsTopCall = false;
+
+        return interpretLoop(cx, frame, null);
+    }
+
+    static class GeneratorState {
+        GeneratorState(int operation, Object value) {
+            this.operation = operation;
+            this.value = value;
+        }
+        int operation;
+        Object value;
+        RuntimeException returnedException;
+    }
+
+    public static Object resumeGenerator(Context cx,
+                                         Scriptable scope,
+                                         int operation,
+                                         Object savedState,
+                                         Object value)
+    {
+      CallFrame frame = (CallFrame) savedState;
+      GeneratorState generatorState = new GeneratorState(operation, value);
+      if (operation == NativeGenerator.GENERATOR_CLOSE) {
+          try {
+              return interpretLoop(cx, frame, generatorState);
+          } catch (RuntimeException e) {
+              // Only propagate exceptions other than closingException
+              if (e != value)
+                  throw e;
+          }
+          return Undefined.instance;
+      }
+      Object result = interpretLoop(cx, frame, generatorState);
+      if (generatorState.returnedException != null)
+          throw generatorState.returnedException;
+      return result;
+    }
+
+    public static Object restartContinuation(NativeContinuation c, Context cx,
+                                             Scriptable scope, Object[] args)
+    {
+        if (!ScriptRuntime.hasTopCall(cx)) {
+            return ScriptRuntime.doTopCall(c, cx, scope, null, args);
+        }
+
+        Object arg;
+        if (args.length == 0) {
+            arg = Undefined.instance;
+        } else {
+            arg = args[0];
+        }
+
+        CallFrame capturedFrame = (CallFrame)c.getImplementation();
+        if (capturedFrame == null) {
+            // No frames to restart
+            return arg;
+        }
+
+        ContinuationJump cjump = new ContinuationJump(c, null);
+
+        cjump.result = arg;
+        return interpretLoop(cx, null, cjump);
+    }
+
+    private static Object interpretLoop(Context cx, CallFrame frame,
+                                        Object throwable)
+    {
+        // throwable holds exception object to rethrow or catch
+        // It is also used for continuation restart in which case
+        // it holds ContinuationJump
+
+        final Object DBL_MRK = UniqueTag.DOUBLE_MARK;
+        final Object undefined = Undefined.instance;
+
+        final boolean instructionCounting = (cx.instructionThreshold != 0);
+        // arbitrary number to add to instructionCount when calling
+        // other functions
+        final int INVOCATION_COST = 100;
+        // arbitrary exception cost for instruction counting
+        final int EXCEPTION_COST = 100;
+
+        String stringReg = null;
+        int indexReg = -1;
+
+        if (cx.lastInterpreterFrame != null) {
+            // save the top frame from the previous interpretLoop
+            // invocation on the stack
+            if (cx.previousInterpreterInvocations == null) {
+                cx.previousInterpreterInvocations = new ObjArray();
+            }
+            cx.previousInterpreterInvocations.push(cx.lastInterpreterFrame);
+        }
+
+        // When restarting continuation throwable is not null and to jump
+        // to the code that rewind continuation state indexReg should be set
+        // to -1.
+        // With the normal call throwable == null and indexReg == -1 allows to
+        // catch bugs with using indeReg to access array elements before
+        // initializing indexReg.
+
+        GeneratorState generatorState = null;
+        if (throwable != null) {
+            if (throwable instanceof GeneratorState) {
+              generatorState = (GeneratorState) throwable;
+
+              // reestablish this call frame
+              enterFrame(cx, frame, ScriptRuntime.emptyArgs, true);
+              throwable = null;
+            } else if (!(throwable instanceof ContinuationJump)) {
+                // It should be continuation
+                Kit.codeBug();
+            }
+        }
+
+        Object interpreterResult = null;
+        double interpreterResultDbl = 0.0;
+
+        StateLoop: for (;;) {
+            withoutExceptions: try {
+
+                if (throwable != null) {
+                    // Need to return both 'frame' and 'throwable' from
+                    // 'processThrowable', so just added a 'throwable'
+                    // member in 'frame'.
+                    frame = processThrowable(cx, throwable, frame, indexReg,
+                                             instructionCounting);
+                    throwable = frame.throwable;
+                    frame.throwable = null;
+                } else {
+                    if (generatorState == null && frame.frozen) Kit.codeBug();
+                }
+
+                // Use local variables for constant values in frame
+                // for faster access
+                Object[] stack = frame.stack;
+                double[] sDbl = frame.sDbl;
+                Object[] vars = frame.varSource.stack;
+                double[] varDbls = frame.varSource.sDbl;
+                int[] varAttributes = frame.varSource.stackAttributes;
+                byte[] iCode = frame.idata.itsICode;
+                String[] strings = frame.idata.itsStringTable;
+
+                // Use local for stackTop as well. Since execption handlers
+                // can only exist at statement level where stack is empty,
+                // it is necessary to save/restore stackTop only across
+                // function calls and normal returns.
+                int stackTop = frame.savedStackTop;
+
+                // Store new frame in cx which is used for error reporting etc.
+                cx.lastInterpreterFrame = frame;
+
+                Loop: for (;;) {
+
+                    // Exception handler assumes that PC is already incremented
+                    // pass the instruction start when it searches the
+                    // exception handler
+                    int op = iCode[frame.pc++];
+                    jumplessRun: {
+
+    // Back indent to ease implementation reading
+switch (op) {
+    case Icode_GENERATOR: {
+        if (!frame.frozen) {
+          // First time encountering this opcode: create new generator
+          // object and return
+          frame.pc--; // we want to come back here when we resume
+          CallFrame generatorFrame = captureFrameForGenerator(frame);
+          generatorFrame.frozen = true;
+          NativeGenerator generator = new NativeGenerator(frame.scope, 
+              generatorFrame.fnOrScript, generatorFrame);
+          frame.result = generator;
+          break Loop;
+        } else {
+          // We are now resuming execution. Fall through to YIELD case.
+        }
+    }
+    // fall through...
+    case Token.YIELD: {
+        if (!frame.frozen) {
+            return freezeGenerator(cx, frame, stackTop, generatorState);
+        } else {
+            Object obj = thawGenerator(frame, stackTop, generatorState, op);
+            if (obj != Scriptable.NOT_FOUND) {
+                throwable = obj;
+                break withoutExceptions;
+            }
+            continue Loop;
+        }
+    }
+    case Icode_GENERATOR_END: {
+      // throw StopIteration
+      frame.frozen = true;
+      int sourceLine = getIndex(iCode, frame.pc);
+      generatorState.returnedException = new JavaScriptException(
+          NativeIterator.getStopIterationObject(frame.scope),
+          frame.idata.itsSourceFile, sourceLine);
+      break Loop;
+    }
+    case Token.THROW: {
+        Object value = stack[stackTop];
+        if (value == DBL_MRK) value = ScriptRuntime.wrapNumber(sDbl[stackTop]);
+        --stackTop;
+
+        int sourceLine = getIndex(iCode, frame.pc);
+        throwable = new JavaScriptException(value,
+                                            frame.idata.itsSourceFile,
+                                            sourceLine);
+        break withoutExceptions;
+    }
+    case Token.RETHROW: {
+        indexReg += frame.localShift;
+        throwable = stack[indexReg];
+        break withoutExceptions;
+    }
+    case Token.GE :
+    case Token.LE :
+    case Token.GT :
+    case Token.LT : {
+        --stackTop;
+        Object rhs = stack[stackTop + 1];
+        Object lhs = stack[stackTop];
+        boolean valBln;
+      object_compare:
+        {
+          number_compare:
+            {
+                double rDbl, lDbl;
+                if (rhs == DBL_MRK) {
+                    rDbl = sDbl[stackTop + 1];
+                    lDbl = stack_double(frame, stackTop);
+                } else if (lhs == DBL_MRK) {
+                    rDbl = ScriptRuntime.toNumber(rhs);
+                    lDbl = sDbl[stackTop];
+                } else {
+                    break number_compare;
+                }
+                switch (op) {
+                  case Token.GE:
+                    valBln = (lDbl >= rDbl);
+                    break object_compare;
+                  case Token.LE:
+                    valBln = (lDbl <= rDbl);
+                    break object_compare;
+                  case Token.GT:
+                    valBln = (lDbl > rDbl);
+                    break object_compare;
+                  case Token.LT:
+                    valBln = (lDbl < rDbl);
+                    break object_compare;
+                  default:
+                    throw Kit.codeBug();
+                }
+            }
+            switch (op) {
+              case Token.GE:
+                valBln = ScriptRuntime.cmp_LE(rhs, lhs);
+                break;
+              case Token.LE:
+                valBln = ScriptRuntime.cmp_LE(lhs, rhs);
+                break;
+              case Token.GT:
+                valBln = ScriptRuntime.cmp_LT(rhs, lhs);
+                break;
+              case Token.LT:
+                valBln = ScriptRuntime.cmp_LT(lhs, rhs);
+                break;
+              default:
+                throw Kit.codeBug();
+            }
+        }
+        stack[stackTop] = ScriptRuntime.wrapBoolean(valBln);
+        continue Loop;
+    }
+    case Token.IN :
+    case Token.INSTANCEOF : {
+        Object rhs = stack[stackTop];
+        if (rhs == DBL_MRK) rhs = ScriptRuntime.wrapNumber(sDbl[stackTop]);
+        --stackTop;
+        Object lhs = stack[stackTop];
+        if (lhs == DBL_MRK) lhs = ScriptRuntime.wrapNumber(sDbl[stackTop]);
+        boolean valBln;
+        if (op == Token.IN) {
+            valBln = ScriptRuntime.in(lhs, rhs, cx);
+        } else {
+            valBln = ScriptRuntime.instanceOf(lhs, rhs, cx);
+        }
+        stack[stackTop] = ScriptRuntime.wrapBoolean(valBln);
+        continue Loop;
+    }
+    case Token.EQ :
+    case Token.NE : {
+        --stackTop;
+        boolean valBln;
+        Object rhs = stack[stackTop + 1];
+        Object lhs = stack[stackTop];
+        if (rhs == DBL_MRK) {
+            if (lhs == DBL_MRK) {
+                valBln = (sDbl[stackTop] == sDbl[stackTop + 1]);
+            } else {
+                valBln = ScriptRuntime.eqNumber(sDbl[stackTop + 1], lhs);
+            }
+        } else {
+            if (lhs == DBL_MRK) {
+                valBln = ScriptRuntime.eqNumber(sDbl[stackTop], rhs);
+            } else {
+                valBln = ScriptRuntime.eq(lhs, rhs);
+            }
+        }
+        valBln ^= (op == Token.NE);
+        stack[stackTop] = ScriptRuntime.wrapBoolean(valBln);
+        continue Loop;
+    }
+    case Token.SHEQ :
+    case Token.SHNE : {
+        --stackTop;
+        boolean valBln = shallowEquals(stack, sDbl, stackTop);
+        valBln ^= (op == Token.SHNE);
+        stack[stackTop] = ScriptRuntime.wrapBoolean(valBln);
+        continue Loop;
+    }
+    case Token.IFNE :
+        if (stack_boolean(frame, stackTop--)) {
+            frame.pc += 2;
+            continue Loop;
+        }
+        break jumplessRun;
+    case Token.IFEQ :
+        if (!stack_boolean(frame, stackTop--)) {
+            frame.pc += 2;
+            continue Loop;
+        }
+        break jumplessRun;
+    case Icode_IFEQ_POP :
+        if (!stack_boolean(frame, stackTop--)) {
+            frame.pc += 2;
+            continue Loop;
+        }
+        stack[stackTop--] = null;
+        break jumplessRun;
+    case Token.GOTO :
+        break jumplessRun;
+    case Icode_GOSUB :
+        ++stackTop;
+        stack[stackTop] = DBL_MRK;
+        sDbl[stackTop] = frame.pc + 2;
+        break jumplessRun;
+    case Icode_STARTSUB :
+        if (stackTop == frame.emptyStackTop + 1) {
+            // Call from Icode_GOSUB: store return PC address in the local
+            indexReg += frame.localShift;
+            stack[indexReg] = stack[stackTop];
+            sDbl[indexReg] = sDbl[stackTop];
+            --stackTop;
+        } else {
+            // Call from exception handler: exception object is already stored
+            // in the local
+            if (stackTop != frame.emptyStackTop) Kit.codeBug();
+        }
+        continue Loop;
+    case Icode_RETSUB : {
+        // indexReg: local to store return address
+        if (instructionCounting) {
+            addInstructionCount(cx, frame, 0);
+        }
+        indexReg += frame.localShift;
+        Object value = stack[indexReg];
+        if (value != DBL_MRK) {
+            // Invocation from exception handler, restore object to rethrow
+            throwable = value;
+            break withoutExceptions;
+        }
+        // Normal return from GOSUB
+        frame.pc = (int)sDbl[indexReg];
+        if (instructionCounting) {
+            frame.pcPrevBranch = frame.pc;
+        }
+        continue Loop;
+    }
+    case Icode_POP :
+        stack[stackTop] = null;
+        stackTop--;
+        continue Loop;
+    case Icode_POP_RESULT :
+        frame.result = stack[stackTop];
+        frame.resultDbl = sDbl[stackTop];
+        stack[stackTop] = null;
+        --stackTop;
+        continue Loop;
+    case Icode_DUP :
+        stack[stackTop + 1] = stack[stackTop];
+        sDbl[stackTop + 1] = sDbl[stackTop];
+        stackTop++;
+        continue Loop;
+    case Icode_DUP2 :
+        stack[stackTop + 1] = stack[stackTop - 1];
+        sDbl[stackTop + 1] = sDbl[stackTop - 1];
+        stack[stackTop + 2] = stack[stackTop];
+        sDbl[stackTop + 2] = sDbl[stackTop];
+        stackTop += 2;
+        continue Loop;
+    case Icode_SWAP : {
+        Object o = stack[stackTop];
+        stack[stackTop] = stack[stackTop - 1];
+        stack[stackTop - 1] = o;
+        double d = sDbl[stackTop];
+        sDbl[stackTop] = sDbl[stackTop - 1];
+        sDbl[stackTop - 1] = d;
+        continue Loop;
+    }
+    case Token.RETURN :
+        frame.result = stack[stackTop];
+        frame.resultDbl = sDbl[stackTop];
+        --stackTop;
+        break Loop;
+    case Token.RETURN_RESULT :
+        break Loop;
+    case Icode_RETUNDEF :
+        frame.result = undefined;
+        break Loop;
+    case Token.BITNOT : {
+        int rIntValue = stack_int32(frame, stackTop);
+        stack[stackTop] = DBL_MRK;
+        sDbl[stackTop] = ~rIntValue;
+        continue Loop;
+    }
+    case Token.BITAND :
+    case Token.BITOR :
+    case Token.BITXOR :
+    case Token.LSH :
+    case Token.RSH : {
+        int lIntValue = stack_int32(frame, stackTop-1);
+        int rIntValue = stack_int32(frame, stackTop);
+        stack[--stackTop] = DBL_MRK;
+        switch (op) {
+          case Token.BITAND:
+            lIntValue &= rIntValue;
+            break;
+          case Token.BITOR:
+            lIntValue |= rIntValue;
+            break;
+          case Token.BITXOR:
+            lIntValue ^= rIntValue;
+            break;
+          case Token.LSH:
+            lIntValue <<= rIntValue;
+            break;
+          case Token.RSH:
+            lIntValue >>= rIntValue;
+            break;
+        }
+        sDbl[stackTop] = lIntValue;
+        continue Loop;
+    }
+    case Token.URSH : {
+        double lDbl = stack_double(frame, stackTop-1);
+        int rIntValue = stack_int32(frame, stackTop) & 0x1F;
+        stack[--stackTop] = DBL_MRK;
+        sDbl[stackTop] = ScriptRuntime.toUint32(lDbl) >>> rIntValue;
+        continue Loop;
+    }
+    case Token.NEG :
+    case Token.POS : {
+        double rDbl = stack_double(frame, stackTop);
+        stack[stackTop] = DBL_MRK;
+        if (op == Token.NEG) {
+            rDbl = -rDbl;
+        }
+        sDbl[stackTop] = rDbl;
+        continue Loop;
+    }
+    case Token.ADD :
+        --stackTop;
+        do_add(stack, sDbl, stackTop, cx);
+        continue Loop;
+    case Token.SUB :
+    case Token.MUL :
+    case Token.DIV :
+    case Token.MOD : {
+        double rDbl = stack_double(frame, stackTop);
+        --stackTop;
+        double lDbl = stack_double(frame, stackTop);
+        stack[stackTop] = DBL_MRK;
+        switch (op) {
+          case Token.SUB:
+            lDbl -= rDbl;
+            break;
+          case Token.MUL:
+            lDbl *= rDbl;
+            break;
+          case Token.DIV:
+            lDbl /= rDbl;
+            break;
+          case Token.MOD:
+            lDbl %= rDbl;
+            break;
+        }
+        sDbl[stackTop] = lDbl;
+        continue Loop;
+    }
+    case Token.NOT :
+        stack[stackTop] = ScriptRuntime.wrapBoolean(
+                              !stack_boolean(frame, stackTop));
+        continue Loop;
+    case Token.BINDNAME :
+        stack[++stackTop] = ScriptRuntime.bind(cx, frame.scope, stringReg);
+        continue Loop;
+    case Token.SETNAME : {
+        Object rhs = stack[stackTop];
+        if (rhs == DBL_MRK) rhs = ScriptRuntime.wrapNumber(sDbl[stackTop]);
+        --stackTop;
+        Scriptable lhs = (Scriptable)stack[stackTop];
+        stack[stackTop] = ScriptRuntime.setName(lhs, rhs, cx,
+                                                frame.scope, stringReg);
+        continue Loop;
+    }
+    case Icode_SETCONST: {
+        Object rhs = stack[stackTop];
+        if (rhs == DBL_MRK) rhs = ScriptRuntime.wrapNumber(sDbl[stackTop]);
+        --stackTop;
+        Scriptable lhs = (Scriptable)stack[stackTop];
+        stack[stackTop] = ScriptRuntime.setConst(lhs, rhs, cx, stringReg);
+        continue Loop;
+    }
+    case Token.DELPROP : {
+        Object rhs = stack[stackTop];
+        if (rhs == DBL_MRK) rhs = ScriptRuntime.wrapNumber(sDbl[stackTop]);
+        --stackTop;
+        Object lhs = stack[stackTop];
+        if (lhs == DBL_MRK) lhs = ScriptRuntime.wrapNumber(sDbl[stackTop]);
+        stack[stackTop] = ScriptRuntime.delete(lhs, rhs, cx);
+        continue Loop;
+    }
+    case Token.GETPROPNOWARN : {
+        Object lhs = stack[stackTop];
+        if (lhs == DBL_MRK) lhs = ScriptRuntime.wrapNumber(sDbl[stackTop]);
+        stack[stackTop] = ScriptRuntime.getObjectPropNoWarn(lhs, stringReg, cx);
+        continue Loop;
+    }
+    case Token.GETPROP : {
+        Object lhs = stack[stackTop];
+        if (lhs == DBL_MRK) lhs = ScriptRuntime.wrapNumber(sDbl[stackTop]);
+        stack[stackTop] = ScriptRuntime.getObjectProp(lhs, stringReg, cx, frame.scope);
+        continue Loop;
+    }
+    case Token.SETPROP : {
+        Object rhs = stack[stackTop];
+        if (rhs == DBL_MRK) rhs = ScriptRuntime.wrapNumber(sDbl[stackTop]);
+        --stackTop;
+        Object lhs = stack[stackTop];
+        if (lhs == DBL_MRK) lhs = ScriptRuntime.wrapNumber(sDbl[stackTop]);
+        stack[stackTop] = ScriptRuntime.setObjectProp(lhs, stringReg, rhs,
+                                                      cx);
+        continue Loop;
+    }
+    case Icode_PROP_INC_DEC : {
+        Object lhs = stack[stackTop];
+        if (lhs == DBL_MRK) lhs = ScriptRuntime.wrapNumber(sDbl[stackTop]);
+        stack[stackTop] = ScriptRuntime.propIncrDecr(lhs, stringReg,
+                                                     cx, iCode[frame.pc]);
+        ++frame.pc;
+        continue Loop;
+    }
+    case Token.GETELEM : {
+        --stackTop;
+        Object lhs = stack[stackTop];
+        if (lhs == DBL_MRK) {
+            lhs = ScriptRuntime.wrapNumber(sDbl[stackTop]);
+        }
+        Object value;
+        Object id = stack[stackTop + 1];
+        if (id != DBL_MRK) {
+            value = ScriptRuntime.getObjectElem(lhs, id, cx, frame.scope);
+        } else {
+            double d = sDbl[stackTop + 1];
+            value = ScriptRuntime.getObjectIndex(lhs, d, cx);
+        }
+        stack[stackTop] = value;
+        continue Loop;
+    }
+    case Token.SETELEM : {
+        stackTop -= 2;
+        Object rhs = stack[stackTop + 2];
+        if (rhs == DBL_MRK) {
+            rhs = ScriptRuntime.wrapNumber(sDbl[stackTop + 2]);
+        }
+        Object lhs = stack[stackTop];
+        if (lhs == DBL_MRK) {
+            lhs = ScriptRuntime.wrapNumber(sDbl[stackTop]);
+        }
+        Object value;
+        Object id = stack[stackTop + 1];
+        if (id != DBL_MRK) {
+            value = ScriptRuntime.setObjectElem(lhs, id, rhs, cx);
+        } else {
+            double d = sDbl[stackTop + 1];
+            value = ScriptRuntime.setObjectIndex(lhs, d, rhs, cx);
+        }
+        stack[stackTop] = value;
+        continue Loop;
+    }
+    case Icode_ELEM_INC_DEC: {
+        Object rhs = stack[stackTop];
+        if (rhs == DBL_MRK) rhs = ScriptRuntime.wrapNumber(sDbl[stackTop]);
+        --stackTop;
+        Object lhs = stack[stackTop];
+        if (lhs == DBL_MRK) lhs = ScriptRuntime.wrapNumber(sDbl[stackTop]);
+        stack[stackTop] = ScriptRuntime.elemIncrDecr(lhs, rhs, cx,
+                                                     iCode[frame.pc]);
+        ++frame.pc;
+        continue Loop;
+    }
+    case Token.GET_REF : {
+        Ref ref = (Ref)stack[stackTop];
+        stack[stackTop] = ScriptRuntime.refGet(ref, cx);
+        continue Loop;
+    }
+    case Token.SET_REF : {
+        Object value = stack[stackTop];
+        if (value == DBL_MRK) value = ScriptRuntime.wrapNumber(sDbl[stackTop]);
+        --stackTop;
+        Ref ref = (Ref)stack[stackTop];
+        stack[stackTop] = ScriptRuntime.refSet(ref, value, cx);
+        continue Loop;
+    }
+    case Token.DEL_REF : {
+        Ref ref = (Ref)stack[stackTop];
+        stack[stackTop] = ScriptRuntime.refDel(ref, cx);
+        continue Loop;
+    }
+    case Icode_REF_INC_DEC : {
+        Ref ref = (Ref)stack[stackTop];
+        stack[stackTop] = ScriptRuntime.refIncrDecr(ref, cx, iCode[frame.pc]);
+        ++frame.pc;
+        continue Loop;
+    }
+    case Token.LOCAL_LOAD :
+        ++stackTop;
+        indexReg += frame.localShift;
+        stack[stackTop] = stack[indexReg];
+        sDbl[stackTop] = sDbl[indexReg];
+        continue Loop;
+    case Icode_LOCAL_CLEAR :
+        indexReg += frame.localShift;
+        stack[indexReg] = null;
+        continue Loop;
+    case Icode_NAME_AND_THIS :
+        // stringReg: name
+        ++stackTop;
+        stack[stackTop] = ScriptRuntime.getNameFunctionAndThis(stringReg,
+                                                               cx, frame.scope);
+        ++stackTop;
+        stack[stackTop] = ScriptRuntime.lastStoredScriptable(cx);
+        continue Loop;
+    case Icode_PROP_AND_THIS: {
+        Object obj = stack[stackTop];
+        if (obj == DBL_MRK) obj = ScriptRuntime.wrapNumber(sDbl[stackTop]);
+        // stringReg: property
+        stack[stackTop] = ScriptRuntime.getPropFunctionAndThis(obj, stringReg,
+                                                               cx, frame.scope);
+        ++stackTop;
+        stack[stackTop] = ScriptRuntime.lastStoredScriptable(cx);
+        continue Loop;
+    }
+    case Icode_ELEM_AND_THIS: {
+        Object obj = stack[stackTop - 1];
+        if (obj == DBL_MRK) obj = ScriptRuntime.wrapNumber(sDbl[stackTop - 1]);
+        Object id = stack[stackTop];
+        if (id == DBL_MRK) id = ScriptRuntime.wrapNumber(sDbl[stackTop]);
+        stack[stackTop - 1] = ScriptRuntime.getElemFunctionAndThis(obj, id, cx);
+        stack[stackTop] = ScriptRuntime.lastStoredScriptable(cx);
+        continue Loop;
+    }
+    case Icode_VALUE_AND_THIS : {
+        Object value = stack[stackTop];
+        if (value == DBL_MRK) value = ScriptRuntime.wrapNumber(sDbl[stackTop]);
+        stack[stackTop] = ScriptRuntime.getValueFunctionAndThis(value, cx);
+        ++stackTop;
+        stack[stackTop] = ScriptRuntime.lastStoredScriptable(cx);
+        continue Loop;
+    }
+    case Icode_CALLSPECIAL : {
+        if (instructionCounting) {
+            cx.instructionCount += INVOCATION_COST;
+        }
+        int callType = iCode[frame.pc] & 0xFF;
+        boolean isNew =  (iCode[frame.pc + 1] != 0);
+        int sourceLine = getIndex(iCode, frame.pc + 2);
+
+        // indexReg: number of arguments
+        if (isNew) {
+            // stack change: function arg0 .. argN -> newResult
+            stackTop -= indexReg;
+
+            Object function = stack[stackTop];
+            if (function == DBL_MRK)
+                function = ScriptRuntime.wrapNumber(sDbl[stackTop]);
+            Object[] outArgs = getArgsArray(
+                                   stack, sDbl, stackTop + 1, indexReg);
+            stack[stackTop] = ScriptRuntime.newSpecial(
+                                  cx, function, outArgs, frame.scope, callType);
+        } else {
+            // stack change: function thisObj arg0 .. argN -> result
+            stackTop -= 1 + indexReg;
+
+            // Call code generation ensure that stack here
+            // is ... Callable Scriptable
+            Scriptable functionThis = (Scriptable)stack[stackTop + 1];
+            Callable function = (Callable)stack[stackTop];
+            Object[] outArgs = getArgsArray(
+                                   stack, sDbl, stackTop + 2, indexReg);
+            stack[stackTop] = ScriptRuntime.callSpecial(
+                                  cx, function, functionThis, outArgs,
+                                  frame.scope, frame.thisObj, callType,
+                                  frame.idata.itsSourceFile, sourceLine);
+        }
+        frame.pc += 4;
+        continue Loop;
+    }
+    case Token.CALL :
+    case Icode_TAIL_CALL :
+    case Token.REF_CALL : {
+        if (instructionCounting) {
+            cx.instructionCount += INVOCATION_COST;
+        }
+        // stack change: function thisObj arg0 .. argN -> result
+        // indexReg: number of arguments
+        stackTop -= 1 + indexReg;
+
+        // CALL generation ensures that fun and funThisObj
+        // are already Scriptable and Callable objects respectively
+        Callable fun = (Callable)stack[stackTop];
+        Scriptable funThisObj = (Scriptable)stack[stackTop + 1];
+        if (op == Token.REF_CALL) {
+            Object[] outArgs = getArgsArray(stack, sDbl, stackTop + 2,
+                                            indexReg);
+            stack[stackTop] = ScriptRuntime.callRef(fun, funThisObj,
+                                                    outArgs, cx);
+            continue Loop;
+        }
+        Scriptable calleeScope = frame.scope;
+        if (frame.useActivation) {
+            calleeScope = ScriptableObject.getTopLevelScope(frame.scope);
+        }
+        if (fun instanceof InterpretedFunction) {
+            InterpretedFunction ifun = (InterpretedFunction)fun;
+            if (frame.fnOrScript.securityDomain == ifun.securityDomain) {
+                CallFrame callParentFrame = frame;
+                CallFrame calleeFrame = new CallFrame();
+                if (op == Icode_TAIL_CALL) {
+                    // In principle tail call can re-use the current
+                    // frame and its stack arrays but it is hard to
+                    // do properly. Any exceptions that can legally
+                    // happen during frame re-initialization including
+                    // StackOverflowException during innocent looking
+                    // System.arraycopy may leave the current frame
+                    // data corrupted leading to undefined behaviour
+                    // in the catch code bellow that unwinds JS stack
+                    // on exceptions. Then there is issue about frame release
+                    // end exceptions there.
+                    // To avoid frame allocation a released frame
+                    // can be cached for re-use which would also benefit
+                    // non-tail calls but it is not clear that this caching
+                    // would gain in performance due to potentially
+                    // bad interaction with GC.
+                    callParentFrame = frame.parentFrame;
+                    // Release the current frame. See Bug #344501 to see why
+                    // it is being done here.
+                    exitFrame(cx, frame, null);
+                }
+                initFrame(cx, calleeScope, funThisObj, stack, sDbl,
+                          stackTop + 2, indexReg, ifun, callParentFrame,
+                          calleeFrame);
+                if (op != Icode_TAIL_CALL) {
+                    frame.savedStackTop = stackTop;
+                    frame.savedCallOp = op;
+                }
+                frame = calleeFrame;
+                continue StateLoop;
+            }
+        }
+
+        if (fun instanceof NativeContinuation) {
+            // Jump to the captured continuation
+            ContinuationJump cjump;
+            cjump = new ContinuationJump((NativeContinuation)fun, frame);
+
+            // continuation result is the first argument if any
+            // of continuation call
+            if (indexReg == 0) {
+                cjump.result = undefined;
+            } else {
+                cjump.result = stack[stackTop + 2];
+                cjump.resultDbl = sDbl[stackTop + 2];
+            }
+
+            // Start the real unwind job
+            throwable = cjump;
+            break withoutExceptions;
+        }
+
+        if (fun instanceof IdFunctionObject) {
+            IdFunctionObject ifun = (IdFunctionObject)fun;
+            if (NativeContinuation.isContinuationConstructor(ifun)) {
+                frame.stack[stackTop] = captureContinuation(cx,
+                        frame.parentFrame, false);
+                continue Loop;
+            }
+            // Bug 405654 -- make best effort to keep Function.apply and 
+            // Function.call within this interpreter loop invocation
+            if (BaseFunction.isApplyOrCall(ifun)) {
+                Callable applyCallable = ScriptRuntime.getCallable(funThisObj);
+                if (applyCallable instanceof InterpretedFunction) {
+                    InterpretedFunction iApplyCallable = (InterpretedFunction)applyCallable;
+                    if (frame.fnOrScript.securityDomain == iApplyCallable.securityDomain) {
+                        frame = initFrameForApplyOrCall(cx, frame, indexReg,
+                                stack, sDbl, stackTop, op, calleeScope, ifun,
+                                iApplyCallable);
+                        continue StateLoop;
+                    }
+                }
+            }
+        }
+
+        // Bug 447697 -- make best effort to keep __noSuchMethod__ within this  
+        // interpreter loop invocation
+        if (fun instanceof NoSuchMethodShim) {
+            // get the shim and the actual method
+            NoSuchMethodShim noSuchMethodShim = (NoSuchMethodShim) fun;
+            Callable noSuchMethodMethod = noSuchMethodShim.noSuchMethodMethod;
+            // if the method is in fact an InterpretedFunction
+            if (noSuchMethodMethod instanceof InterpretedFunction) {
+                InterpretedFunction ifun = (InterpretedFunction) noSuchMethodMethod;
+                if (frame.fnOrScript.securityDomain == ifun.securityDomain) {
+                    frame = initFrameForNoSuchMethod(cx, frame, indexReg, stack, sDbl,
+                                             stackTop, op, funThisObj, calleeScope,
+                                             noSuchMethodShim, ifun);
+                    continue StateLoop;
+                }
+            }
+        }
+
+        cx.lastInterpreterFrame = frame;
+        frame.savedCallOp = op;
+        frame.savedStackTop = stackTop;
+        stack[stackTop] = fun.call(cx, calleeScope, funThisObj, 
+                getArgsArray(stack, sDbl, stackTop + 2, indexReg));
+        cx.lastInterpreterFrame = null;
+
+        continue Loop;
+    }
+    case Token.NEW : {
+        if (instructionCounting) {
+            cx.instructionCount += INVOCATION_COST;
+        }
+        // stack change: function arg0 .. argN -> newResult
+        // indexReg: number of arguments
+        stackTop -= indexReg;
+
+        Object lhs = stack[stackTop];
+        if (lhs instanceof InterpretedFunction) {
+            InterpretedFunction f = (InterpretedFunction)lhs;
+            if (frame.fnOrScript.securityDomain == f.securityDomain) {
+                Scriptable newInstance = f.createObject(cx, frame.scope);
+                CallFrame calleeFrame = new CallFrame();
+                initFrame(cx, frame.scope, newInstance, stack, sDbl,
+                          stackTop + 1, indexReg, f, frame,
+                          calleeFrame);
+
+                stack[stackTop] = newInstance;
+                frame.savedStackTop = stackTop;
+                frame.savedCallOp = op;
+                frame = calleeFrame;
+                continue StateLoop;
+            }
+        }
+        if (!(lhs instanceof Function)) {
+            if (lhs == DBL_MRK) lhs = ScriptRuntime.wrapNumber(sDbl[stackTop]);
+            throw ScriptRuntime.notFunctionError(lhs);
+        }
+        Function fun = (Function)lhs;
+
+        if (fun instanceof IdFunctionObject) {
+            IdFunctionObject ifun = (IdFunctionObject)fun;
+            if (NativeContinuation.isContinuationConstructor(ifun)) {
+                frame.stack[stackTop] =
+                    captureContinuation(cx, frame.parentFrame, false);
+                continue Loop;
+            }
+        }
+
+        Object[] outArgs = getArgsArray(stack, sDbl, stackTop + 1, indexReg);
+        stack[stackTop] = fun.construct(cx, frame.scope, outArgs);
+        continue Loop;
+    }
+    case Token.TYPEOF : {
+        Object lhs = stack[stackTop];
+        if (lhs == DBL_MRK) lhs = ScriptRuntime.wrapNumber(sDbl[stackTop]);
+        stack[stackTop] = ScriptRuntime.typeof(lhs);
+        continue Loop;
+    }
+    case Icode_TYPEOFNAME :
+        stack[++stackTop] = ScriptRuntime.typeofName(frame.scope, stringReg);
+        continue Loop;
+    case Token.STRING :
+        stack[++stackTop] = stringReg;
+        continue Loop;
+    case Icode_SHORTNUMBER :
+        ++stackTop;
+        stack[stackTop] = DBL_MRK;
+        sDbl[stackTop] = getShort(iCode, frame.pc);
+        frame.pc += 2;
+        continue Loop;
+    case Icode_INTNUMBER :
+        ++stackTop;
+        stack[stackTop] = DBL_MRK;
+        sDbl[stackTop] = getInt(iCode, frame.pc);
+        frame.pc += 4;
+        continue Loop;
+    case Token.NUMBER :
+        ++stackTop;
+        stack[stackTop] = DBL_MRK;
+        sDbl[stackTop] = frame.idata.itsDoubleTable[indexReg];
+        continue Loop;
+    case Token.NAME :
+        stack[++stackTop] = ScriptRuntime.name(cx, frame.scope, stringReg);
+        continue Loop;
+    case Icode_NAME_INC_DEC :
+        stack[++stackTop] = ScriptRuntime.nameIncrDecr(frame.scope, stringReg,
+                                                       cx, iCode[frame.pc]);
+        ++frame.pc;
+        continue Loop;
+    case Icode_SETCONSTVAR1:
+        indexReg = iCode[frame.pc++];
+        // fallthrough
+    case Token.SETCONSTVAR :
+        if (!frame.useActivation) {
+            if ((varAttributes[indexReg] & ScriptableObject.READONLY) == 0) {
+                throw Context.reportRuntimeError1("msg.var.redecl",
+                                                  frame.idata.argNames[indexReg]);
+            }
+            if ((varAttributes[indexReg] & ScriptableObject.UNINITIALIZED_CONST)
+                != 0)
+            {
+                vars[indexReg] = stack[stackTop];
+                varAttributes[indexReg] &= ~ScriptableObject.UNINITIALIZED_CONST;
+                varDbls[indexReg] = sDbl[stackTop];
+            }
+        } else {
+            Object val = stack[stackTop];
+            if (val == DBL_MRK) val = ScriptRuntime.wrapNumber(sDbl[stackTop]);
+            stringReg = frame.idata.argNames[indexReg];
+            if (frame.scope instanceof ConstProperties) {
+                ConstProperties cp = (ConstProperties)frame.scope;
+                cp.putConst(stringReg, frame.scope, val);
+            } else
+                throw Kit.codeBug();
+        }
+        continue Loop;
+    case Icode_SETVAR1:
+        indexReg = iCode[frame.pc++];
+        // fallthrough
+    case Token.SETVAR :
+        if (!frame.useActivation) {
+            if ((varAttributes[indexReg] & ScriptableObject.READONLY) == 0) {
+                vars[indexReg] = stack[stackTop];
+                varDbls[indexReg] = sDbl[stackTop];
+            }
+        } else {
+            Object val = stack[stackTop];
+            if (val == DBL_MRK) val = ScriptRuntime.wrapNumber(sDbl[stackTop]);
+            stringReg = frame.idata.argNames[indexReg];
+            frame.scope.put(stringReg, frame.scope, val);
+        }
+        continue Loop;
+    case Icode_GETVAR1:
+        indexReg = iCode[frame.pc++];
+        // fallthrough
+    case Token.GETVAR :
+        ++stackTop;
+        if (!frame.useActivation) {
+            stack[stackTop] = vars[indexReg];
+            sDbl[stackTop] = varDbls[indexReg];
+        } else {
+            stringReg = frame.idata.argNames[indexReg];
+            stack[stackTop] = frame.scope.get(stringReg, frame.scope);
+        }
+        continue Loop;
+    case Icode_VAR_INC_DEC : {
+        // indexReg : varindex
+        ++stackTop;
+        int incrDecrMask = iCode[frame.pc];
+        if (!frame.useActivation) {
+            stack[stackTop] = DBL_MRK;
+            Object varValue = vars[indexReg];
+            double d;
+            if (varValue == DBL_MRK) {
+                d = varDbls[indexReg];
+            } else {
+                d = ScriptRuntime.toNumber(varValue);
+                vars[indexReg] = DBL_MRK;
+            }
+            double d2 = ((incrDecrMask & Node.DECR_FLAG) == 0)
+                        ? d + 1.0 : d - 1.0;
+            varDbls[indexReg] = d2;
+            sDbl[stackTop] = ((incrDecrMask & Node.POST_FLAG) == 0) ? d2 : d;
+        } else {
+            String varName = frame.idata.argNames[indexReg];
+            stack[stackTop] = ScriptRuntime.nameIncrDecr(frame.scope, varName,
+                                                         cx, incrDecrMask);
+        }
+        ++frame.pc;
+        continue Loop;
+    }
+    case Icode_ZERO :
+        ++stackTop;
+        stack[stackTop] = DBL_MRK;
+        sDbl[stackTop] = 0;
+        continue Loop;
+    case Icode_ONE :
+        ++stackTop;
+        stack[stackTop] = DBL_MRK;
+        sDbl[stackTop] = 1;
+        continue Loop;
+    case Token.NULL :
+        stack[++stackTop] = null;
+        continue Loop;
+    case Token.THIS :
+        stack[++stackTop] = frame.thisObj;
+        continue Loop;
+    case Token.THISFN :
+        stack[++stackTop] = frame.fnOrScript;
+        continue Loop;
+    case Token.FALSE :
+        stack[++stackTop] = Boolean.FALSE;
+        continue Loop;
+    case Token.TRUE :
+        stack[++stackTop] = Boolean.TRUE;
+        continue Loop;
+    case Icode_UNDEF :
+        stack[++stackTop] = undefined;
+        continue Loop;
+    case Token.ENTERWITH : {
+        Object lhs = stack[stackTop];
+        if (lhs == DBL_MRK) lhs = ScriptRuntime.wrapNumber(sDbl[stackTop]);
+        --stackTop;
+        frame.scope = ScriptRuntime.enterWith(lhs, cx, frame.scope);
+        continue Loop;
+    }
+    case Token.LEAVEWITH :
+        frame.scope = ScriptRuntime.leaveWith(frame.scope);
+        continue Loop;
+    case Token.CATCH_SCOPE : {
+        // stack top: exception object
+        // stringReg: name of exception variable
+        // indexReg: local for exception scope
+        --stackTop;
+        indexReg += frame.localShift;
+
+        boolean afterFirstScope =  (frame.idata.itsICode[frame.pc] != 0);
+        Throwable caughtException = (Throwable)stack[stackTop + 1];
+        Scriptable lastCatchScope;
+        if (!afterFirstScope) {
+            lastCatchScope = null;
+        } else {
+            lastCatchScope = (Scriptable)stack[indexReg];
+        }
+        stack[indexReg] = ScriptRuntime.newCatchScope(caughtException,
+                                                      lastCatchScope, stringReg,
+                                                      cx, frame.scope);
+        ++frame.pc;
+        continue Loop;
+    }
+    case Token.ENUM_INIT_KEYS :
+    case Token.ENUM_INIT_VALUES :
+    case Token.ENUM_INIT_ARRAY : {
+        Object lhs = stack[stackTop];
+        if (lhs == DBL_MRK) lhs = ScriptRuntime.wrapNumber(sDbl[stackTop]);
+        --stackTop;
+        indexReg += frame.localShift;
+        int enumType = op == Token.ENUM_INIT_KEYS 
+                         ? ScriptRuntime.ENUMERATE_KEYS :
+                       op == Token.ENUM_INIT_VALUES 
+                         ? ScriptRuntime.ENUMERATE_VALUES :
+                       ScriptRuntime.ENUMERATE_ARRAY;
+        stack[indexReg] = ScriptRuntime.enumInit(lhs, cx, enumType);
+        continue Loop;
+    }
+    case Token.ENUM_NEXT :
+    case Token.ENUM_ID : {
+        indexReg += frame.localShift;
+        Object val = stack[indexReg];
+        ++stackTop;
+        stack[stackTop] = (op == Token.ENUM_NEXT)
+                          ? (Object)ScriptRuntime.enumNext(val)
+                          : (Object)ScriptRuntime.enumId(val, cx);
+        continue Loop;
+    }
+    case Token.REF_SPECIAL : {
+        //stringReg: name of special property
+        Object obj = stack[stackTop];
+        if (obj == DBL_MRK) obj = ScriptRuntime.wrapNumber(sDbl[stackTop]);
+        stack[stackTop] = ScriptRuntime.specialRef(obj, stringReg, cx);
+        continue Loop;
+    }
+    case Token.REF_MEMBER: {
+        //indexReg: flags
+        Object elem = stack[stackTop];
+        if (elem == DBL_MRK) elem = ScriptRuntime.wrapNumber(sDbl[stackTop]);
+        --stackTop;
+        Object obj = stack[stackTop];
+        if (obj == DBL_MRK) obj = ScriptRuntime.wrapNumber(sDbl[stackTop]);
+        stack[stackTop] = ScriptRuntime.memberRef(obj, elem, cx, indexReg);
+        continue Loop;
+    }
+    case Token.REF_NS_MEMBER: {
+        //indexReg: flags
+        Object elem = stack[stackTop];
+        if (elem == DBL_MRK) elem = ScriptRuntime.wrapNumber(sDbl[stackTop]);
+        --stackTop;
+        Object ns = stack[stackTop];
+        if (ns == DBL_MRK) ns = ScriptRuntime.wrapNumber(sDbl[stackTop]);
+        --stackTop;
+        Object obj = stack[stackTop];
+        if (obj == DBL_MRK) obj = ScriptRuntime.wrapNumber(sDbl[stackTop]);
+        stack[stackTop] = ScriptRuntime.memberRef(obj, ns, elem, cx, indexReg);
+        continue Loop;
+    }
+    case Token.REF_NAME: {
+        //indexReg: flags
+        Object name = stack[stackTop];
+        if (name == DBL_MRK) name = ScriptRuntime.wrapNumber(sDbl[stackTop]);
+        stack[stackTop] = ScriptRuntime.nameRef(name, cx, frame.scope,
+                                                indexReg);
+        continue Loop;
+    }
+    case Token.REF_NS_NAME: {
+        //indexReg: flags
+        Object name = stack[stackTop];
+        if (name == DBL_MRK) name = ScriptRuntime.wrapNumber(sDbl[stackTop]);
+        --stackTop;
+        Object ns = stack[stackTop];
+        if (ns == DBL_MRK) ns = ScriptRuntime.wrapNumber(sDbl[stackTop]);
+        stack[stackTop] = ScriptRuntime.nameRef(ns, name, cx, frame.scope,
+                                                indexReg);
+        continue Loop;
+    }
+    case Icode_SCOPE_LOAD :
+        indexReg += frame.localShift;
+        frame.scope = (Scriptable)stack[indexReg];
+        continue Loop;
+    case Icode_SCOPE_SAVE :
+        indexReg += frame.localShift;
+        stack[indexReg] = frame.scope;
+        continue Loop;
+    case Icode_CLOSURE_EXPR :
+        stack[++stackTop] = InterpretedFunction.createFunction(cx, frame.scope,
+                                                               frame.fnOrScript,
+                                                               indexReg);
+        continue Loop;
+    case Icode_CLOSURE_STMT :
+        initFunction(cx, frame.scope, frame.fnOrScript, indexReg);
+        continue Loop;
+    case Token.REGEXP :
+        stack[++stackTop] = frame.scriptRegExps[indexReg];
+        continue Loop;
+    case Icode_LITERAL_NEW :
+        // indexReg: number of values in the literal
+        ++stackTop;
+        stack[stackTop] = new int[indexReg];
+        ++stackTop;
+        stack[stackTop] = new Object[indexReg];
+        sDbl[stackTop] = 0;
+        continue Loop;
+    case Icode_LITERAL_SET : {
+        Object value = stack[stackTop];
+        if (value == DBL_MRK) value = ScriptRuntime.wrapNumber(sDbl[stackTop]);
+        --stackTop;
+        int i = (int)sDbl[stackTop];
+        ((Object[])stack[stackTop])[i] = value;
+        sDbl[stackTop] = i + 1;
+        continue Loop;
+    }
+    case Icode_LITERAL_GETTER : {
+        Object value = stack[stackTop];
+        --stackTop;
+        int i = (int)sDbl[stackTop];
+        ((Object[])stack[stackTop])[i] = value;
+        ((int[])stack[stackTop - 1])[i] = -1;
+        sDbl[stackTop] = i + 1;
+        continue Loop;
+    }
+    case Icode_LITERAL_SETTER : {
+        Object value = stack[stackTop];
+        --stackTop;
+        int i = (int)sDbl[stackTop];
+        ((Object[])stack[stackTop])[i] = value;
+        ((int[])stack[stackTop - 1])[i] = +1;
+        sDbl[stackTop] = i + 1;
+        continue Loop;
+    }
+    case Token.ARRAYLIT :
+    case Icode_SPARE_ARRAYLIT :
+    case Token.OBJECTLIT : {
+        Object[] data = (Object[])stack[stackTop];
+        --stackTop;
+        int[] getterSetters = (int[])stack[stackTop];
+        Object val;
+        if (op == Token.OBJECTLIT) {
+            Object[] ids = (Object[])frame.idata.literalIds[indexReg];
+            val = ScriptRuntime.newObjectLiteral(ids, data, getterSetters, cx,
+                    frame.scope);
+        } else {
+            int[] skipIndexces = null;
+            if (op == Icode_SPARE_ARRAYLIT) {
+                skipIndexces = (int[])frame.idata.literalIds[indexReg];
+            }
+            val = ScriptRuntime.newArrayLiteral(data, skipIndexces, cx,
+                                                frame.scope);
+        }
+        stack[stackTop] = val;
+        continue Loop;
+    }
+    case Icode_ENTERDQ : {
+        Object lhs = stack[stackTop];
+        if (lhs == DBL_MRK) lhs = ScriptRuntime.wrapNumber(sDbl[stackTop]);
+        --stackTop;
+        frame.scope = ScriptRuntime.enterDotQuery(lhs, frame.scope);
+        continue Loop;
+    }
+    case Icode_LEAVEDQ : {
+        boolean valBln = stack_boolean(frame, stackTop);
+        Object x = ScriptRuntime.updateDotQuery(valBln, frame.scope);
+        if (x != null) {
+            stack[stackTop] = x;
+            frame.scope = ScriptRuntime.leaveDotQuery(frame.scope);
+            frame.pc += 2;
+            continue Loop;
+        }
+        // reset stack and PC to code after ENTERDQ
+        --stackTop;
+        break jumplessRun;
+    }
+    case Token.DEFAULTNAMESPACE : {
+        Object value = stack[stackTop];
+        if (value == DBL_MRK) value = ScriptRuntime.wrapNumber(sDbl[stackTop]);
+        stack[stackTop] = ScriptRuntime.setDefaultNamespace(value, cx);
+        continue Loop;
+    }
+    case Token.ESCXMLATTR : {
+        Object value = stack[stackTop];
+        if (value != DBL_MRK) {
+            stack[stackTop] = ScriptRuntime.escapeAttributeValue(value, cx);
+        }
+        continue Loop;
+    }
+    case Token.ESCXMLTEXT : {
+        Object value = stack[stackTop];
+        if (value != DBL_MRK) {
+            stack[stackTop] = ScriptRuntime.escapeTextValue(value, cx);
+        }
+        continue Loop;
+    }
+    case Icode_DEBUGGER:
+        if (frame.debuggerFrame != null) {
+            frame.debuggerFrame.onDebuggerStatement(cx);
+        }
+        continue Loop;
+    case Icode_LINE :
+        frame.pcSourceLineStart = frame.pc;
+        if (frame.debuggerFrame != null) {
+            int line = getIndex(iCode, frame.pc);
+            frame.debuggerFrame.onLineChange(cx, line);
+        }
+        frame.pc += 2;
+        continue Loop;
+    case Icode_REG_IND_C0:
+        indexReg = 0;
+        continue Loop;
+    case Icode_REG_IND_C1:
+        indexReg = 1;
+        continue Loop;
+    case Icode_REG_IND_C2:
+        indexReg = 2;
+        continue Loop;
+    case Icode_REG_IND_C3:
+        indexReg = 3;
+        continue Loop;
+    case Icode_REG_IND_C4:
+        indexReg = 4;
+        continue Loop;
+    case Icode_REG_IND_C5:
+        indexReg = 5;
+        continue Loop;
+    case Icode_REG_IND1:
+        indexReg = 0xFF & iCode[frame.pc];
+        ++frame.pc;
+        continue Loop;
+    case Icode_REG_IND2:
+        indexReg = getIndex(iCode, frame.pc);
+        frame.pc += 2;
+        continue Loop;
+    case Icode_REG_IND4:
+        indexReg = getInt(iCode, frame.pc);
+        frame.pc += 4;
+        continue Loop;
+    case Icode_REG_STR_C0:
+        stringReg = strings[0];
+        continue Loop;
+    case Icode_REG_STR_C1:
+        stringReg = strings[1];
+        continue Loop;
+    case Icode_REG_STR_C2:
+        stringReg = strings[2];
+        continue Loop;
+    case Icode_REG_STR_C3:
+        stringReg = strings[3];
+        continue Loop;
+    case Icode_REG_STR1:
+        stringReg = strings[0xFF & iCode[frame.pc]];
+        ++frame.pc;
+        continue Loop;
+    case Icode_REG_STR2:
+        stringReg = strings[getIndex(iCode, frame.pc)];
+        frame.pc += 2;
+        continue Loop;
+    case Icode_REG_STR4:
+        stringReg = strings[getInt(iCode, frame.pc)];
+        frame.pc += 4;
+        continue Loop;
+    default :
+        dumpICode(frame.idata);
+        throw new RuntimeException(
+            "Unknown icode : "+op+" @ pc : "+(frame.pc-1));
+}  // end of interpreter switch
+
+                    } // end of jumplessRun label block
+
+                    // This should be reachable only for jump implementation
+                    // when pc points to encoded target offset
+                    if (instructionCounting) {
+                        addInstructionCount(cx, frame, 2);
+                    }
+                    int offset = getShort(iCode, frame.pc);
+                    if (offset != 0) {
+                        // -1 accounts for pc pointing to jump opcode + 1
+                        frame.pc += offset - 1;
+                    } else {
+                        frame.pc = frame.idata.longJumps.
+                                       getExistingInt(frame.pc);
+                    }
+                    if (instructionCounting) {
+                        frame.pcPrevBranch = frame.pc;
+                    }
+                    continue Loop;
+
+                } // end of Loop: for
+
+                exitFrame(cx, frame, null);
+                interpreterResult = frame.result;
+                interpreterResultDbl = frame.resultDbl;
+                if (frame.parentFrame != null) {
+                    frame = frame.parentFrame;
+                    if (frame.frozen) {
+                        frame = frame.cloneFrozen();
+                    }
+                    setCallResult(
+                        frame, interpreterResult, interpreterResultDbl);
+                    interpreterResult = null; // Help GC
+                    continue StateLoop;
+                }
+                break StateLoop;
+
+            }  // end of interpreter withoutExceptions: try
+            catch (Throwable ex) {
+                if (throwable != null) {
+                    // This is serious bug and it is better to track it ASAP
+                    ex.printStackTrace(System.err);
+                    throw new IllegalStateException();
+                }
+                throwable = ex;
+            }
+
+            // This should be reachable only after above catch or from
+            // finally when it needs to propagate exception or from
+            // explicit throw
+            if (throwable == null) Kit.codeBug();
+
+            // Exception type
+            final int EX_CATCH_STATE = 2; // Can execute JS catch
+            final int EX_FINALLY_STATE = 1; // Can execute JS finally
+            final int EX_NO_JS_STATE = 0; // Terminate JS execution
+
+            int exState;
+            ContinuationJump cjump = null;
+
+            if (generatorState != null &&
+                generatorState.operation == NativeGenerator.GENERATOR_CLOSE &&
+                throwable == generatorState.value)
+            {
+                exState = EX_FINALLY_STATE;            	
+            } else if (throwable instanceof JavaScriptException) {
+                exState = EX_CATCH_STATE;
+            } else if (throwable instanceof EcmaError) {
+                // an offical ECMA error object,
+                exState = EX_CATCH_STATE;
+            } else if (throwable instanceof EvaluatorException) {
+                exState = EX_CATCH_STATE;
+            } else if (throwable instanceof RuntimeException) {
+                exState = cx.hasFeature(Context.FEATURE_ENHANCED_JAVA_ACCESS)
+                          ? EX_CATCH_STATE
+                          : EX_FINALLY_STATE;
+            } else if (throwable instanceof Error) {
+                exState = cx.hasFeature(Context.FEATURE_ENHANCED_JAVA_ACCESS)
+                          ? EX_CATCH_STATE
+                          : EX_NO_JS_STATE;
+            } else if (throwable instanceof ContinuationJump) {
+                // It must be ContinuationJump
+                exState = EX_FINALLY_STATE;
+                cjump = (ContinuationJump)throwable;
+            } else {
+                exState = cx.hasFeature(Context.FEATURE_ENHANCED_JAVA_ACCESS)
+                          ? EX_CATCH_STATE
+                          : EX_FINALLY_STATE;
+            }
+
+            if (instructionCounting) {
+                try {
+                    addInstructionCount(cx, frame, EXCEPTION_COST);
+                } catch (RuntimeException ex) {
+                    throwable = ex;
+                    exState = EX_FINALLY_STATE;
+                } catch (Error ex) {
+                    // Error from instruction counting
+                    //     => unconditionally terminate JS
+                    throwable = ex;
+                    cjump = null;
+                    exState = EX_NO_JS_STATE;
+                }
+            }
+            if (frame.debuggerFrame != null
+                && throwable instanceof RuntimeException)
+            {
+                // Call debugger only for RuntimeException
+                RuntimeException rex = (RuntimeException)throwable;
+                try {
+                    frame.debuggerFrame.onExceptionThrown(cx, rex);
+                } catch (Throwable ex) {
+                    // Any exception from debugger
+                    //     => unconditionally terminate JS
+                    throwable = ex;
+                    cjump = null;
+                    exState = EX_NO_JS_STATE;
+                }
+            }
+
+            for (;;) {
+                if (exState != EX_NO_JS_STATE) {
+                    boolean onlyFinally = (exState != EX_CATCH_STATE);
+                    indexReg = getExceptionHandler(frame, onlyFinally);
+                    if (indexReg >= 0) {
+                        // We caught an exception, restart the loop
+                        // with exception pending the processing at the loop
+                        // start
+                        continue StateLoop;
+                    }
+                }
+                // No allowed exception handlers in this frame, unwind
+                // to parent and try to look there
+
+                exitFrame(cx, frame, throwable);
+
+                frame = frame.parentFrame;
+                if (frame == null) { break; }
+                if (cjump != null && cjump.branchFrame == frame) {
+                    // Continuation branch point was hit,
+                    // restart the state loop to reenter continuation
+                    indexReg = -1;
+                    continue StateLoop;
+                }
+            }
+
+            // No more frames, rethrow the exception or deal with continuation
+            if (cjump != null) {
+                if (cjump.branchFrame != null) {
+                    // The above loop should locate the top frame
+                    Kit.codeBug();
+                }
+                if (cjump.capturedFrame != null) {
+                    // Restarting detached continuation
+                    indexReg = -1;
+                    continue StateLoop;
+                }
+                // Return continuation result to the caller
+                interpreterResult = cjump.result;
+                interpreterResultDbl = cjump.resultDbl;
+                throwable = null;
+            }
+            break StateLoop;
+
+        } // end of StateLoop: for(;;)
+
+        // Do cleanups/restorations before the final return or throw
+
+        if (cx.previousInterpreterInvocations != null
+            && cx.previousInterpreterInvocations.size() != 0)
+        {
+            cx.lastInterpreterFrame
+                = cx.previousInterpreterInvocations.pop();
+        } else {
+            // It was the last interpreter frame on the stack
+            cx.lastInterpreterFrame = null;
+            // Force GC of the value cx.previousInterpreterInvocations
+            cx.previousInterpreterInvocations = null;
+        }
+
+        if (throwable != null) {
+            if (throwable instanceof RuntimeException) {
+                throw (RuntimeException)throwable;
+            } else {
+                // Must be instance of Error or code bug
+                throw (Error)throwable;
+            }
+        }
+
+        return (interpreterResult != DBL_MRK)
+               ? interpreterResult
+               : ScriptRuntime.wrapNumber(interpreterResultDbl);
+    }
+
+    /**
+     * Call __noSuchMethod__.
+     */
+    private static CallFrame initFrameForNoSuchMethod(Context cx,
+            CallFrame frame, int indexReg, Object[] stack, double[] sDbl,
+            int stackTop, int op, Scriptable funThisObj, Scriptable calleeScope,
+            NoSuchMethodShim noSuchMethodShim, InterpretedFunction ifun)
+    {
+        // create an args array from the stack
+        Object[] argsArray = null;
+        // exactly like getArgsArray except that the first argument
+        // is the method name from the shim
+        int shift = stackTop + 2;
+        Object[] elements = new Object[indexReg];
+        for (int i=0; i < indexReg; ++i, ++shift) {
+            Object val = stack[shift];
+            if (val == UniqueTag.DOUBLE_MARK) {
+                val = ScriptRuntime.wrapNumber(sDbl[shift]);
+            }
+            elements[i] = val;
+        }
+        argsArray = new Object[2];
+        argsArray[0] = noSuchMethodShim.methodName;
+        argsArray[1] = cx.newArray(calleeScope, elements);
+        
+        // exactly the same as if it's a regular InterpretedFunction
+        CallFrame callParentFrame = frame;
+        CallFrame calleeFrame = new CallFrame();
+        if (op == Icode_TAIL_CALL) {
+            callParentFrame = frame.parentFrame;
+            exitFrame(cx, frame, null);
+        }
+        // init the frame with the underlying method with the 
+        // adjusted args array and shim's function
+        initFrame(cx, calleeScope, funThisObj, argsArray, null,
+          0, 2, ifun, callParentFrame, calleeFrame);
+        if (op != Icode_TAIL_CALL) {
+            frame.savedStackTop = stackTop;
+            frame.savedCallOp = op;
+        }
+        return calleeFrame;
+    }
+    
+    private static boolean shallowEquals(Object[] stack, double[] sDbl,
+            int stackTop)
+    {
+        Object rhs = stack[stackTop + 1];
+        Object lhs = stack[stackTop];
+        final Object DBL_MRK = UniqueTag.DOUBLE_MARK;
+        double rdbl, ldbl;
+        if (rhs == DBL_MRK) {
+            rdbl = sDbl[stackTop + 1];
+            if (lhs == DBL_MRK) {
+                ldbl = sDbl[stackTop];
+            } else if (lhs instanceof Number) {
+                ldbl = ((Number)lhs).doubleValue();
+            } else {
+                return false;
+            }
+        } else if (lhs == DBL_MRK) {
+            ldbl = sDbl[stackTop];
+            if (rhs == DBL_MRK) {
+                rdbl = sDbl[stackTop + 1];
+            } else if (rhs instanceof Number) {
+                rdbl = ((Number)rhs).doubleValue();
+            } else {
+                return false;
+            }
+        } else {
+            return ScriptRuntime.shallowEq(lhs, rhs);
+        }
+        return (ldbl == rdbl);
+    }
+
+    private static CallFrame processThrowable(Context cx, Object throwable,
+                                              CallFrame frame, int indexReg,
+                                              boolean instructionCounting)
+    {
+        // Recovering from exception, indexReg contains
+        // the index of handler
+
+        if (indexReg >= 0) {
+            // Normal exception handler, transfer
+            // control appropriately
+
+            if (frame.frozen) {
+                // XXX Deal with exceptios!!!
+                frame = frame.cloneFrozen();
+            }
+            
+            int[] table = frame.idata.itsExceptionTable;
+
+            frame.pc = table[indexReg + EXCEPTION_HANDLER_SLOT];
+            if (instructionCounting) {
+                frame.pcPrevBranch = frame.pc;
+            }
+
+            frame.savedStackTop = frame.emptyStackTop;
+            int scopeLocal = frame.localShift
+                             + table[indexReg
+                                     + EXCEPTION_SCOPE_SLOT];
+            int exLocal = frame.localShift
+                             + table[indexReg
+                                     + EXCEPTION_LOCAL_SLOT];
+            frame.scope = (Scriptable)frame.stack[scopeLocal];
+            frame.stack[exLocal] = throwable;
+
+            throwable = null;
+        } else {
+            // Continuation restoration
+            ContinuationJump cjump = (ContinuationJump)throwable;
+
+            // Clear throwable to indicate that exceptions are OK
+            throwable = null;
+
+            if (cjump.branchFrame != frame) Kit.codeBug();
+
+            // Check that we have at least one frozen frame
+            // in the case of detached continuation restoration:
+            // unwind code ensure that
+            if (cjump.capturedFrame == null) Kit.codeBug();
+
+            // Need to rewind branchFrame, capturedFrame
+            // and all frames in between
+            int rewindCount = cjump.capturedFrame.frameIndex + 1;
+            if (cjump.branchFrame != null) {
+                rewindCount -= cjump.branchFrame.frameIndex;
+            }
+
+            int enterCount = 0;
+            CallFrame[] enterFrames = null;
+
+            CallFrame x = cjump.capturedFrame;
+            for (int i = 0; i != rewindCount; ++i) {
+                if (!x.frozen) Kit.codeBug();
+                if (isFrameEnterExitRequired(x)) {
+                    if (enterFrames == null) {
+                        // Allocate enough space to store the rest
+                        // of rewind frames in case all of them
+                        // would require to enter
+                        enterFrames = new CallFrame[rewindCount
+                                                    - i];
+                    }
+                    enterFrames[enterCount] = x;
+                    ++enterCount;
+                }
+                x = x.parentFrame;
+            }
+
+            while (enterCount != 0) {
+                // execute enter: walk enterFrames in the reverse
+                // order since they were stored starting from
+                // the capturedFrame, not branchFrame
+                --enterCount;
+                x = enterFrames[enterCount];
+                enterFrame(cx, x, ScriptRuntime.emptyArgs, true);
+            }
+
+            // Continuation jump is almost done: capturedFrame
+            // points to the call to the function that captured
+            // continuation, so clone capturedFrame and
+            // emulate return that function with the suplied result
+            frame = cjump.capturedFrame.cloneFrozen();
+            setCallResult(frame, cjump.result, cjump.resultDbl);
+            // restart the execution
+        }
+        frame.throwable = throwable;
+        return frame;
+    }
+
+    private static Object freezeGenerator(Context cx, CallFrame frame,
+                                          int stackTop,
+                                          GeneratorState generatorState)
+    {
+          if (generatorState.operation == NativeGenerator.GENERATOR_CLOSE) {
+              // Error: no yields when generator is closing
+              throw ScriptRuntime.typeError0("msg.yield.closing");
+          }
+          // return to our caller (which should be a method of NativeGenerator)
+          frame.frozen = true;
+          frame.result = frame.stack[stackTop];
+          frame.resultDbl = frame.sDbl[stackTop];
+          frame.savedStackTop = stackTop;
+          frame.pc--; // we want to come back here when we resume
+          ScriptRuntime.exitActivationFunction(cx);
+          return (frame.result != UniqueTag.DOUBLE_MARK)
+              ? frame.result
+              : ScriptRuntime.wrapNumber(frame.resultDbl);
+    }
+
+    private static Object thawGenerator(CallFrame frame, int stackTop,
+                                        GeneratorState generatorState, int op)
+    {
+          // we are resuming execution
+          frame.frozen = false;
+          int sourceLine = getIndex(frame.idata.itsICode, frame.pc);
+          frame.pc += 2; // skip line number data
+          if (generatorState.operation == NativeGenerator.GENERATOR_THROW) {
+              // processing a call to .throw(exception): must
+              // act as if exception was thrown from resumption point
+              return new JavaScriptException(generatorState.value,
+                                                  frame.idata.itsSourceFile,
+                                                  sourceLine);
+          }
+          if (generatorState.operation == NativeGenerator.GENERATOR_CLOSE) {
+              return generatorState.value;
+          }
+          if (generatorState.operation != NativeGenerator.GENERATOR_SEND)
+              throw Kit.codeBug();
+          if (op == Token.YIELD)
+              frame.stack[stackTop] = generatorState.value;
+          return Scriptable.NOT_FOUND;
+    }
+
+    private static CallFrame initFrameForApplyOrCall(Context cx, CallFrame frame,
+            int indexReg, Object[] stack, double[] sDbl, int stackTop, int op,
+            Scriptable calleeScope, IdFunctionObject ifun,
+            InterpretedFunction iApplyCallable)
+    {
+        Scriptable applyThis;
+        if (indexReg != 0) {
+            Object obj = stack[stackTop + 2];
+            if (obj == UniqueTag.DOUBLE_MARK)
+                obj = ScriptRuntime.wrapNumber(sDbl[stackTop + 2]);
+            applyThis = ScriptRuntime.toObjectOrNull(cx, obj);
+        }
+        else {
+            applyThis = null;
+        }
+        if (applyThis == null) {
+            // This covers the case of args[0] == (null|undefined) as well.
+            applyThis = ScriptRuntime.getTopCallScope(cx);
+        }
+        if(op == Icode_TAIL_CALL) {
+            exitFrame(cx, frame, null);
+            frame = frame.parentFrame;
+        }
+        else {
+            frame.savedStackTop = stackTop;
+            frame.savedCallOp = op;
+        }
+        CallFrame calleeFrame = new CallFrame();
+        if(BaseFunction.isApply(ifun)) {
+            Object[] callArgs = indexReg < 2 ? ScriptRuntime.emptyArgs : 
+                ScriptRuntime.getApplyArguments(cx, stack[stackTop + 3]);
+            initFrame(cx, calleeScope, applyThis, callArgs, null, 0, 
+                    callArgs.length, iApplyCallable, frame, calleeFrame);
+        }
+        else {
+            // Shift args left
+            for(int i = 1; i < indexReg; ++i) {
+                stack[stackTop + 1 + i] = stack[stackTop + 2 + i];
+                sDbl[stackTop + 1 + i] = sDbl[stackTop + 2 + i];
+            }
+            int argCount = indexReg < 2 ? 0 : indexReg - 1;
+            initFrame(cx, calleeScope, applyThis, stack, sDbl, stackTop + 2, 
+                    argCount, iApplyCallable, frame, calleeFrame);
+        }
+        
+        frame = calleeFrame;
+        return frame;
+    }
+
+    private static void initFrame(Context cx, Scriptable callerScope,
+                                  Scriptable thisObj,
+                                  Object[] args, double[] argsDbl,
+                                  int argShift, int argCount,
+                                  InterpretedFunction fnOrScript,
+                                  CallFrame parentFrame, CallFrame frame)
+    {
+        InterpreterData idata = fnOrScript.idata;
+
+        boolean useActivation = idata.itsNeedsActivation;
+        DebugFrame debuggerFrame = null;
+        if (cx.debugger != null) {
+            debuggerFrame = cx.debugger.getFrame(cx, idata);
+            if (debuggerFrame != null) {
+                useActivation = true;
+            }
+        }
+
+        if (useActivation) {
+            // Copy args to new array to pass to enterActivationFunction
+            // or debuggerFrame.onEnter
+            if (argsDbl != null) {
+                args = getArgsArray(args, argsDbl, argShift, argCount);
+            }
+            argShift = 0;
+            argsDbl = null;
+        }
+
+        Scriptable scope;
+        if (idata.itsFunctionType != 0) {
+            if (!idata.useDynamicScope) {
+                scope = fnOrScript.getParentScope();
+            } else {
+                scope = callerScope;
+            }
+
+            if (useActivation) {
+                scope = ScriptRuntime.createFunctionActivation(
+                            fnOrScript, scope, args);
+            }
+        } else {
+            scope = callerScope;
+            ScriptRuntime.initScript(fnOrScript, thisObj, cx, scope,
+                                     fnOrScript.idata.evalScriptFlag);
+        }
+
+        if (idata.itsNestedFunctions != null) {
+            if (idata.itsFunctionType != 0 && !idata.itsNeedsActivation)
+                Kit.codeBug();
+            for (int i = 0; i < idata.itsNestedFunctions.length; i++) {
+                InterpreterData fdata = idata.itsNestedFunctions[i];
+                if (fdata.itsFunctionType == FunctionNode.FUNCTION_STATEMENT) {
+                    initFunction(cx, scope, fnOrScript, i);
+                }
+            }
+        }
+
+        Scriptable[] scriptRegExps = null;
+        if (idata.itsRegExpLiterals != null) {
+            // Wrapped regexps for functions are stored in
+            // InterpretedFunction
+            // but for script which should not contain references to scope
+            // the regexps re-wrapped during each script execution
+            if (idata.itsFunctionType != 0) {
+                scriptRegExps = fnOrScript.functionRegExps;
+            } else {
+                scriptRegExps = fnOrScript.createRegExpWraps(cx, scope);
+            }
+        }
+
+        // Initialize args, vars, locals and stack
+
+        int emptyStackTop = idata.itsMaxVars + idata.itsMaxLocals - 1;
+        int maxFrameArray = idata.itsMaxFrameArray;
+        if (maxFrameArray != emptyStackTop + idata.itsMaxStack + 1)
+            Kit.codeBug();
+
+        Object[] stack;
+        int[] stackAttributes;
+        double[] sDbl;
+        boolean stackReuse;
+        if (frame.stack != null && maxFrameArray <= frame.stack.length) {
+            // Reuse stacks from old frame
+            stackReuse = true;
+            stack = frame.stack;
+            stackAttributes = frame.stackAttributes;
+            sDbl = frame.sDbl;
+        } else {
+            stackReuse = false;
+            stack = new Object[maxFrameArray];
+            stackAttributes = new int[maxFrameArray];
+            sDbl = new double[maxFrameArray];
+        }
+
+        int varCount = idata.getParamAndVarCount();
+        for (int i = 0; i < varCount; i++) {
+            if (idata.getParamOrVarConst(i))
+                stackAttributes[i] = ScriptableObject.CONST;
+        }
+        int definedArgs = idata.argCount;
+        if (definedArgs > argCount) { definedArgs = argCount; }
+
+        // Fill the frame structure
+
+        frame.parentFrame = parentFrame;
+        frame.frameIndex = (parentFrame == null)
+                           ? 0 : parentFrame.frameIndex + 1;
+        if(frame.frameIndex > cx.getMaximumInterpreterStackDepth())
+        {
+            throw Context.reportRuntimeError("Exceeded maximum stack depth");
+        }
+        frame.frozen = false;
+
+        frame.fnOrScript = fnOrScript;
+        frame.idata = idata;
+
+        frame.stack = stack;
+        frame.stackAttributes = stackAttributes;
+        frame.sDbl = sDbl;
+        frame.varSource = frame;
+        frame.localShift = idata.itsMaxVars;
+        frame.emptyStackTop = emptyStackTop;
+
+        frame.debuggerFrame = debuggerFrame;
+        frame.useActivation = useActivation;
+
+        frame.thisObj = thisObj;
+        frame.scriptRegExps = scriptRegExps;
+
+        // Initialize initial values of variables that change during
+        // interpretation.
+        frame.result = Undefined.instance;
+        frame.pc = 0;
+        frame.pcPrevBranch = 0;
+        frame.pcSourceLineStart = idata.firstLinePC;
+        frame.scope = scope;
+
+        frame.savedStackTop = emptyStackTop;
+        frame.savedCallOp = 0;
+
+        System.arraycopy(args, argShift, stack, 0, definedArgs);
+        if (argsDbl != null) {
+            System.arraycopy(argsDbl, argShift, sDbl, 0, definedArgs);
+        }
+        for (int i = definedArgs; i != idata.itsMaxVars; ++i) {
+            stack[i] = Undefined.instance;
+        }
+        if (stackReuse) {
+            // Clean the stack part and space beyond stack if any
+            // of the old array to allow to GC objects there
+            for (int i = emptyStackTop + 1; i != stack.length; ++i) {
+                stack[i] = null;
+            }
+        }
+
+        enterFrame(cx, frame, args, false);
+    }
+
+    private static boolean isFrameEnterExitRequired(CallFrame frame)
+    {
+        return frame.debuggerFrame != null || frame.idata.itsNeedsActivation;
+    }
+
+    private static void enterFrame(Context cx, CallFrame frame, Object[] args, 
+                                   boolean continuationRestart)
+    {
+        boolean usesActivation = frame.idata.itsNeedsActivation; 
+        boolean isDebugged = frame.debuggerFrame != null;
+        if(usesActivation || isDebugged) {
+            Scriptable scope = frame.scope;
+            if(scope == null) {
+                Kit.codeBug();
+            } else if (continuationRestart) {
+                // Walk the parent chain of frame.scope until a NativeCall is 
+                // found. Normally, frame.scope is a NativeCall when called 
+                // from initFrame() for a debugged or activatable function. 
+                // However, when called from interpretLoop() as part of
+                // restarting a continuation, it can also be a NativeWith if 
+                // the continuation was captured within a "with" or "catch" 
+                // block ("catch" implicitly uses NativeWith to create a scope 
+                // to expose the exception variable).
+                for(;;) {
+                    if(scope instanceof NativeWith) {
+                        scope = scope.getParentScope();
+                        if (scope == null || (frame.parentFrame != null && 
+                                              frame.parentFrame.scope == scope))
+                        {
+                            // If we get here, we didn't find a NativeCall in 
+                            // the call chain before reaching parent frame's 
+                            // scope. This should not be possible.
+                            Kit.codeBug();
+                            break; // Never reached, but keeps the static analyzer happy about "scope" not being null 5 lines above.
+                        }
+                    }
+                    else {
+                        break;
+                    }
+                }
+            }
+            if (isDebugged) {
+                frame.debuggerFrame.onEnter(cx, scope, frame.thisObj, args);
+            }
+            // Enter activation only when itsNeedsActivation true, 
+            // since debugger should not interfere with activation 
+            // chaining
+            if (usesActivation) {
+                ScriptRuntime.enterActivationFunction(cx, scope);
+            }
+        }
+    }
+
+    private static void exitFrame(Context cx, CallFrame frame,
+                                  Object throwable)
+    {
+        if (frame.idata.itsNeedsActivation) {
+            ScriptRuntime.exitActivationFunction(cx);
+        }
+
+        if (frame.debuggerFrame != null) {
+            try {
+                if (throwable instanceof Throwable) {
+                    frame.debuggerFrame.onExit(cx, true, throwable);
+                } else {
+                    Object result;
+                    ContinuationJump cjump = (ContinuationJump)throwable;
+                    if (cjump == null) {
+                        result = frame.result;
+                    } else {
+                        result = cjump.result;
+                    }
+                    if (result == UniqueTag.DOUBLE_MARK) {
+                        double resultDbl;
+                        if (cjump == null) {
+                            resultDbl = frame.resultDbl;
+                        } else {
+                            resultDbl = cjump.resultDbl;
+                        }
+                        result = ScriptRuntime.wrapNumber(resultDbl);
+                    }
+                    frame.debuggerFrame.onExit(cx, false, result);
+                }
+            } catch (Throwable ex) {
+                System.err.println(
+"RHINO USAGE WARNING: onExit terminated with exception");
+                ex.printStackTrace(System.err);
+            }
+        }
+    }
+
+    private static void setCallResult(CallFrame frame,
+                                      Object callResult,
+                                      double callResultDbl)
+    {
+        if (frame.savedCallOp == Token.CALL) {
+            frame.stack[frame.savedStackTop] = callResult;
+            frame.sDbl[frame.savedStackTop] = callResultDbl;
+        } else if (frame.savedCallOp == Token.NEW) {
+            // If construct returns scriptable,
+            // then it replaces on stack top saved original instance
+            // of the object.
+            if (callResult instanceof Scriptable) {
+                frame.stack[frame.savedStackTop] = callResult;
+            }
+        } else {
+            Kit.codeBug();
+        }
+        frame.savedCallOp = 0;
+    }
+    
+    public static NativeContinuation captureContinuation(Context cx) {
+        if (cx.lastInterpreterFrame == null ||
+            !(cx.lastInterpreterFrame instanceof CallFrame))
+        {
+            throw new IllegalStateException("Interpreter frames not found");
+        }
+        return captureContinuation(cx, (CallFrame)cx.lastInterpreterFrame, true);
+    }
+
+    private static NativeContinuation captureContinuation(Context cx, CallFrame frame,
+        boolean requireContinuationsTopFrame)
+    {
+        NativeContinuation c = new NativeContinuation();
+        ScriptRuntime.setObjectProtoAndParent(
+            c, ScriptRuntime.getTopCallScope(cx));
+
+        // Make sure that all frames are frozen
+        CallFrame x = frame;
+        CallFrame outermost = frame;
+        while (x != null && !x.frozen) {
+            x.frozen = true;
+            // Allow to GC unused stack space
+            for (int i = x.savedStackTop + 1; i != x.stack.length; ++i) {
+                // Allow to GC unused stack space
+                x.stack[i] = null;
+                x.stackAttributes[i] = ScriptableObject.EMPTY;
+            }
+            if (x.savedCallOp == Token.CALL) {
+                // the call will always overwrite the stack top with the result
+                x.stack[x.savedStackTop] = null;
+            } else {
+                if (x.savedCallOp != Token.NEW) Kit.codeBug();
+                // the new operator uses stack top to store the constructed
+                // object so it shall not be cleared: see comments in
+                // setCallResult
+            }
+            outermost = x;
+            x = x.parentFrame;
+        }
+        
+        if (requireContinuationsTopFrame) {
+            while (outermost.parentFrame != null)
+                outermost = outermost.parentFrame;
+    
+            if (!outermost.isContinuationsTopFrame) {
+                throw new IllegalStateException("Cannot capture continuation " +
+                        "from JavaScript code not called directly by " +
+                        "executeScriptWithContinuations or " +
+                        "callFunctionWithContinuations");
+            }
+        }
+        
+        c.initImplementation(frame);
+        return c;
+    }
+
+    private static int stack_int32(CallFrame frame, int i)
+    {
+        Object x = frame.stack[i];
+        double value;
+        if (x == UniqueTag.DOUBLE_MARK) {
+            value = frame.sDbl[i];
+        } else {
+            value = ScriptRuntime.toNumber(x);
+        }
+        return ScriptRuntime.toInt32(value);
+    }
+
+    private static double stack_double(CallFrame frame, int i)
+    {
+        Object x = frame.stack[i];
+        if (x != UniqueTag.DOUBLE_MARK) {
+            return ScriptRuntime.toNumber(x);
+        } else {
+            return frame.sDbl[i];
+        }
+    }
+
+    private static boolean stack_boolean(CallFrame frame, int i)
+    {
+        Object x = frame.stack[i];
+        if (x == Boolean.TRUE) {
+            return true;
+        } else if (x == Boolean.FALSE) {
+            return false;
+        } else if (x == UniqueTag.DOUBLE_MARK) {
+            double d = frame.sDbl[i];
+            return d == d && d != 0.0;
+        } else if (x == null || x == Undefined.instance) {
+            return false;
+        } else if (x instanceof Number) {
+            double d = ((Number)x).doubleValue();
+            return (d == d && d != 0.0);
+        } else if (x instanceof Boolean) {
+            return ((Boolean)x).booleanValue();
+        } else {
+            return ScriptRuntime.toBoolean(x);
+        }
+    }
+
+    private static void do_add(Object[] stack, double[] sDbl, int stackTop,
+                              Context cx)
+    {
+        Object rhs = stack[stackTop + 1];
+        Object lhs = stack[stackTop];
+        double d;
+        boolean leftRightOrder;
+        if (rhs == UniqueTag.DOUBLE_MARK) {
+            d = sDbl[stackTop + 1];
+            if (lhs == UniqueTag.DOUBLE_MARK) {
+                sDbl[stackTop] += d;
+                return;
+            }
+            leftRightOrder = true;
+            // fallthrough to object + number code
+        } else if (lhs == UniqueTag.DOUBLE_MARK) {
+            d = sDbl[stackTop];
+            lhs = rhs;
+            leftRightOrder = false;
+            // fallthrough to object + number code
+        } else {
+            if (lhs instanceof Scriptable || rhs instanceof Scriptable) {
+                stack[stackTop] = ScriptRuntime.add(lhs, rhs, cx);
+            } else if (lhs instanceof String) {
+                String lstr = (String)lhs;
+                String rstr = ScriptRuntime.toString(rhs);
+                stack[stackTop] = lstr.concat(rstr);
+            } else if (rhs instanceof String) {
+                String lstr = ScriptRuntime.toString(lhs);
+                String rstr = (String)rhs;
+                stack[stackTop] = lstr.concat(rstr);
+            } else {
+                double lDbl = (lhs instanceof Number)
+                    ? ((Number)lhs).doubleValue() : ScriptRuntime.toNumber(lhs);
+                double rDbl = (rhs instanceof Number)
+                    ? ((Number)rhs).doubleValue() : ScriptRuntime.toNumber(rhs);
+                stack[stackTop] = UniqueTag.DOUBLE_MARK;
+                sDbl[stackTop] = lDbl + rDbl;
+            }
+            return;
+        }
+
+        // handle object(lhs) + number(d) code
+        if (lhs instanceof Scriptable) {
+            rhs = ScriptRuntime.wrapNumber(d);
+            if (!leftRightOrder) {
+                Object tmp = lhs;
+                lhs = rhs;
+                rhs = tmp;
+            }
+            stack[stackTop] = ScriptRuntime.add(lhs, rhs, cx);
+        } else if (lhs instanceof String) {
+            String lstr = (String)lhs;
+            String rstr = ScriptRuntime.toString(d);
+            if (leftRightOrder) {
+                stack[stackTop] = lstr.concat(rstr);
+            } else {
+                stack[stackTop] = rstr.concat(lstr);
+            }
+        } else {
+            double lDbl = (lhs instanceof Number)
+                ? ((Number)lhs).doubleValue() : ScriptRuntime.toNumber(lhs);
+            stack[stackTop] = UniqueTag.DOUBLE_MARK;
+            sDbl[stackTop] = lDbl + d;
+        }
+    }
+
+    private static Object[] getArgsArray(Object[] stack, double[] sDbl,
+                                         int shift, int count)
+    {
+        if (count == 0) {
+            return ScriptRuntime.emptyArgs;
+        }
+        Object[] args = new Object[count];
+        for (int i = 0; i != count; ++i, ++shift) {
+            Object val = stack[shift];
+            if (val == UniqueTag.DOUBLE_MARK) {
+                val = ScriptRuntime.wrapNumber(sDbl[shift]);
+            }
+            args[i] = val;
+        }
+        return args;
+    }
+
+    private static void addInstructionCount(Context cx, CallFrame frame,
+                                            int extra)
+    {
+        cx.instructionCount += frame.pc - frame.pcPrevBranch + extra;
+        if (cx.instructionCount > cx.instructionThreshold) {
+            cx.observeInstructionCount(cx.instructionCount);
+            cx.instructionCount = 0;
+        }
+    }
+}
diff --git a/org/mozilla/javascript/InterpreterData.java b/org/mozilla/javascript/InterpreterData.java
new file mode 100644
index 0000000..7435b10
--- /dev/null
+++ b/org/mozilla/javascript/InterpreterData.java
@@ -0,0 +1,192 @@
+/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Rhino code, released
+ * May 6, 1999.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1997-2000
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Norris Boyd
+ *   Bob Jervis
+ *   Roger Lawrence
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * the GNU General Public License Version 2 or later (the "GPL"), in which
+ * case the provisions of the GPL are applicable instead of those above. If
+ * you wish to allow use of your version of this file only under the terms of
+ * the GPL and not to allow others to use your version of this file under the
+ * MPL, indicate your decision by deleting the provisions above and replacing
+ * them with the notice and other provisions required by the GPL. If you do
+ * not delete the provisions above, a recipient may use your version of this
+ * file under either the MPL or the GPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+package org.mozilla.javascript;
+
+import java.io.Serializable;
+
+import org.mozilla.javascript.debug.DebuggableScript;
+
+final class InterpreterData implements Serializable, DebuggableScript
+{
+    static final long serialVersionUID = 5067677351589230234L;
+
+    static final int INITIAL_MAX_ICODE_LENGTH = 1024;
+    static final int INITIAL_STRINGTABLE_SIZE = 64;
+    static final int INITIAL_NUMBERTABLE_SIZE = 64;
+
+    InterpreterData(int languageVersion,
+                    String sourceFile, String encodedSource)
+    {
+        this.languageVersion = languageVersion;
+        this.itsSourceFile = sourceFile;
+        this.encodedSource = encodedSource;
+
+        init();
+    }
+
+    InterpreterData(InterpreterData parent)
+    {
+        this.parentData = parent;
+        this.languageVersion = parent.languageVersion;
+        this.itsSourceFile = parent.itsSourceFile;
+        this.encodedSource = parent.encodedSource;
+
+        init();
+    }
+
+    private void init()
+    {
+        itsICode = new byte[INITIAL_MAX_ICODE_LENGTH];
+        itsStringTable = new String[INITIAL_STRINGTABLE_SIZE];
+    }
+
+    String itsName;
+    String itsSourceFile;
+    boolean itsNeedsActivation;
+    int itsFunctionType;
+
+    String[] itsStringTable;
+    double[] itsDoubleTable;
+    InterpreterData[] itsNestedFunctions;
+    Object[] itsRegExpLiterals;
+
+    byte[] itsICode;
+
+    int[] itsExceptionTable;
+
+    int itsMaxVars;
+    int itsMaxLocals;
+    int itsMaxStack;
+    int itsMaxFrameArray;
+
+    // see comments in NativeFuncion for definition of argNames and argCount
+    String[] argNames;
+    boolean[] argIsConst;
+    int argCount;
+
+    int itsMaxCalleeArgs;
+
+    String encodedSource;
+    int encodedSourceStart;
+    int encodedSourceEnd;
+
+    int languageVersion;
+
+    boolean useDynamicScope;
+
+    boolean topLevel;
+
+    Object[] literalIds;
+
+    UintMap longJumps;
+
+    int firstLinePC = -1; // PC for the first LINE icode
+
+    InterpreterData parentData;
+
+    boolean evalScriptFlag; // true if script corresponds to eval() code
+
+    public boolean isTopLevel()
+    {
+        return topLevel;
+    }
+
+    public boolean isFunction()
+    {
+        return itsFunctionType != 0;
+    }
+
+    public String getFunctionName()
+    {
+        return itsName;
+    }
+
+    public int getParamCount()
+    {
+        return argCount;
+    }
+
+    public int getParamAndVarCount()
+    {
+        return argNames.length;
+    }
+
+    public String getParamOrVarName(int index)
+    {
+        return argNames[index];
+    }
+
+    public boolean getParamOrVarConst(int index)
+    {
+        return argIsConst[index];
+    }
+
+    public String getSourceName()
+    {
+        return itsSourceFile;
+    }
+
+    public boolean isGeneratedScript()
+    {
+        return ScriptRuntime.isGeneratedScript(itsSourceFile);
+    }
+
+    public int[] getLineNumbers()
+    {
+        return Interpreter.getLineNumbers(this);
+    }
+
+    public int getFunctionCount()
+    {
+        return (itsNestedFunctions == null) ? 0 : itsNestedFunctions.length;
+    }
+
+    public DebuggableScript getFunction(int index)
+    {
+        return itsNestedFunctions[index];
+    }
+
+    public DebuggableScript getParent()
+    {
+         return parentData;
+    }
+
+}
diff --git a/org/mozilla/javascript/JavaAdapter.java b/org/mozilla/javascript/JavaAdapter.java
new file mode 100644
index 0000000..be1b363
--- /dev/null
+++ b/org/mozilla/javascript/JavaAdapter.java
@@ -0,0 +1,1140 @@
+/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Rhino code, released
+ * May 6, 1999.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1997-1999
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Patrick Beard
+ *   Norris Boyd
+ *   Igor Bukanov
+ *   Mike McCabe
+ *   Matthias Radestock
+ *   Andi Vajda
+ *   Andrew Wason
+ *   Kemal Bayram
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * the GNU General Public License Version 2 or later (the "GPL"), in which
+ * case the provisions of the GPL are applicable instead of those above. If
+ * you wish to allow use of your version of this file only under the terms of
+ * the GPL and not to allow others to use your version of this file under the
+ * MPL, indicate your decision by deleting the provisions above and replacing
+ * them with the notice and other provisions required by the GPL. If you do
+ * not delete the provisions above, a recipient may use your version of this
+ * file under either the MPL or the GPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+package org.mozilla.javascript;
+
+import org.mozilla.classfile.*;
+import java.lang.reflect.*;
+import java.io.*;
+import java.security.*;
+import java.util.*;
+
+public final class JavaAdapter implements IdFunctionCall
+{
+    /**
+     * Provides a key with which to distinguish previously generated
+     * adapter classes stored in a hash table.
+     */
+    static class JavaAdapterSignature
+    {
+        Class superClass;
+        Class[] interfaces;
+        ObjToIntMap names;
+
+        JavaAdapterSignature(Class superClass, Class[] interfaces,
+                             ObjToIntMap names)
+        {
+            this.superClass = superClass;
+            this.interfaces = interfaces;
+            this.names = names;
+        }
+
+        @Override
+        public boolean equals(Object obj)
+        {
+            if (!(obj instanceof JavaAdapterSignature))
+                return false;
+            JavaAdapterSignature sig = (JavaAdapterSignature) obj;
+            if (superClass != sig.superClass)
+                return false;
+            if (interfaces != sig.interfaces) {
+                if (interfaces.length != sig.interfaces.length)
+                    return false;
+                for (int i=0; i < interfaces.length; i++)
+                    if (interfaces[i] != sig.interfaces[i])
+                        return false;
+            }
+            if (names.size() != sig.names.size())
+                return false;
+            ObjToIntMap.Iterator iter = new ObjToIntMap.Iterator(names);
+            for (iter.start(); !iter.done(); iter.next()) {
+                String name = (String)iter.getKey();
+                int arity = iter.getValue();
+                if (arity != names.get(name, arity + 1))
+                    return false;
+            }
+            return true;
+        }
+
+        @Override
+        public int hashCode()
+        {
+            return superClass.hashCode()
+                | (0x9e3779b9 * (names.size() | (interfaces.length << 16)));
+        }
+    }
+
+    public static void init(Context cx, Scriptable scope, boolean sealed)
+    {
+        JavaAdapter obj = new JavaAdapter();
+        IdFunctionObject ctor = new IdFunctionObject(obj, FTAG, Id_JavaAdapter,
+                                                     "JavaAdapter", 1, scope);
+        ctor.markAsConstructor(null);
+        if (sealed) {
+            ctor.sealObject();
+        }
+        ctor.exportAsScopeProperty();
+    }
+
+    public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope,
+                             Scriptable thisObj, Object[] args)
+    {
+        if (f.hasTag(FTAG)) {
+            if (f.methodId() == Id_JavaAdapter) {
+                return js_createAdapter(cx, scope, args);
+            }
+        }
+        throw f.unknown();
+    }
+
+    public static Object convertResult(Object result, Class c)
+    {
+        if (result == Undefined.instance &&
+            (c != ScriptRuntime.ObjectClass &&
+             c != ScriptRuntime.StringClass))
+        {
+            // Avoid an error for an undefined value; return null instead.
+            return null;
+        }
+        return Context.jsToJava(result, c);
+    }
+
+    public static Scriptable createAdapterWrapper(Scriptable obj,
+                                                  Object adapter)
+    {
+        Scriptable scope = ScriptableObject.getTopLevelScope(obj);
+        NativeJavaObject res = new NativeJavaObject(scope, adapter, null, true);
+        res.setPrototype(obj);
+        return res;
+    }
+
+    public static Object getAdapterSelf(Class adapterClass, Object adapter)
+        throws NoSuchFieldException, IllegalAccessException
+    {
+        Field self = adapterClass.getDeclaredField("self");
+        return self.get(adapter);
+    }
+
+    static Object js_createAdapter(Context cx, Scriptable scope, Object[] args)
+    {
+        int N = args.length;
+        if (N == 0) {
+            throw ScriptRuntime.typeError0("msg.adapter.zero.args");
+        }
+
+        Class superClass = null;
+        Class[] intfs = new Class[N - 1];
+        int interfaceCount = 0;
+        for (int i = 0; i != N - 1; ++i) {
+            Object arg = args[i];
+            if (!(arg instanceof NativeJavaClass)) {
+                throw ScriptRuntime.typeError2("msg.not.java.class.arg",
+                                               String.valueOf(i),
+                                               ScriptRuntime.toString(arg));
+            }
+            Class c = ((NativeJavaClass) arg).getClassObject();
+            if (!c.isInterface()) {
+                if (superClass != null) {
+                    throw ScriptRuntime.typeError2("msg.only.one.super",
+                              superClass.getName(), c.getName());
+                }
+                superClass = c;
+            } else {
+                intfs[interfaceCount++] = c;
+            }
+        }
+
+        if (superClass == null)
+            superClass = ScriptRuntime.ObjectClass;
+
+        Class[] interfaces = new Class[interfaceCount];
+        System.arraycopy(intfs, 0, interfaces, 0, interfaceCount);
+        Scriptable obj = ScriptRuntime.toObject(cx, scope, args[N - 1]);
+
+        Class adapterClass = getAdapterClass(scope, superClass, interfaces,
+                                             obj);
+
+        Class[] ctorParms = {
+            ScriptRuntime.ContextFactoryClass,
+            ScriptRuntime.ScriptableClass
+        };
+        Object[] ctorArgs = { cx.getFactory(), obj };
+        try {
+            Object adapter = adapterClass.getConstructor(ctorParms).
+                                 newInstance(ctorArgs);
+            return getAdapterSelf(adapterClass, adapter);
+        } catch (Exception ex) {
+            throw Context.throwAsScriptRuntimeEx(ex);
+        }
+    }
+
+    // Needed by NativeJavaObject serializer
+    public static void writeAdapterObject(Object javaObject,
+                                          ObjectOutputStream out)
+        throws IOException
+    {
+        Class cl = javaObject.getClass();
+        out.writeObject(cl.getSuperclass().getName());
+
+        Class[] interfaces = cl.getInterfaces();
+        String[] interfaceNames = new String[interfaces.length];
+
+        for (int i=0; i < interfaces.length; i++)
+            interfaceNames[i] = interfaces[i].getName();
+
+        out.writeObject(interfaceNames);
+
+        try {
+            Object delegee = cl.getField("delegee").get(javaObject);
+            out.writeObject(delegee);
+            return;
+        } catch (IllegalAccessException e) {
+        } catch (NoSuchFieldException e) {
+        }
+        throw new IOException();
+    }
+
+    // Needed by NativeJavaObject de-serializer
+    public static Object readAdapterObject(Scriptable self,
+                                           ObjectInputStream in)
+        throws IOException, ClassNotFoundException
+    {
+        ContextFactory factory;
+        Context cx = Context.getCurrentContext();
+        if (cx != null) {
+            factory = cx.getFactory();
+        } else {
+            factory = null;
+        }
+
+        Class superClass = Class.forName((String)in.readObject());
+
+        String[] interfaceNames = (String[])in.readObject();
+        Class[] interfaces = new Class[interfaceNames.length];
+
+        for (int i=0; i < interfaceNames.length; i++)
+            interfaces[i] = Class.forName(interfaceNames[i]);
+
+        Scriptable delegee = (Scriptable)in.readObject();
+
+        Class adapterClass = getAdapterClass(self, superClass, interfaces,
+                                             delegee);
+
+        Class[] ctorParms = {
+            ScriptRuntime.ContextFactoryClass,
+            ScriptRuntime.ScriptableClass,
+            ScriptRuntime.ScriptableClass
+        };
+        Object[] ctorArgs = { factory, delegee, self };
+        try {
+            return adapterClass.getConstructor(ctorParms).newInstance(ctorArgs);
+        } catch(InstantiationException e) {
+        } catch(IllegalAccessException e) {
+        } catch(InvocationTargetException e) {
+        } catch(NoSuchMethodException e) {
+        }
+
+        throw new ClassNotFoundException("adapter");
+    }
+
+    private static ObjToIntMap getObjectFunctionNames(Scriptable obj)
+    {
+        Object[] ids = ScriptableObject.getPropertyIds(obj);
+        ObjToIntMap map = new ObjToIntMap(ids.length);
+        for (int i = 0; i != ids.length; ++i) {
+            if (!(ids[i] instanceof String))
+                continue;
+            String id = (String) ids[i];
+            Object value = ScriptableObject.getProperty(obj, id);
+            if (value instanceof Function) {
+                Function f = (Function)value;
+                int length = ScriptRuntime.toInt32(
+                                 ScriptableObject.getProperty(f, "length"));
+                if (length < 0) {
+                    length = 0;
+                }
+                map.put(id, length);
+            }
+        }
+        return map;
+    }
+
+    private static Class getAdapterClass(Scriptable scope, Class superClass,
+                                         Class[] interfaces, Scriptable obj)
+    {
+        ClassCache cache = ClassCache.get(scope);
+        Map> generated
+            = cache.getInterfaceAdapterCacheMap();
+
+        ObjToIntMap names = getObjectFunctionNames(obj);
+        JavaAdapterSignature sig;
+        sig = new JavaAdapterSignature(superClass, interfaces, names);
+        Class adapterClass = generated.get(sig);
+        if (adapterClass == null) {
+            String adapterName = "adapter"
+                                 + cache.newClassSerialNumber();
+            byte[] code = createAdapterCode(names, adapterName,
+                                            superClass, interfaces, null);
+
+            adapterClass = loadAdapterClass(adapterName, code);
+            if (cache.isCachingEnabled()) {
+                generated.put(sig, adapterClass);
+            }
+        }
+        return adapterClass;
+    }
+
+    public static byte[] createAdapterCode(ObjToIntMap functionNames,
+                                           String adapterName,
+                                           Class superClass,
+                                           Class[] interfaces,
+                                           String scriptClassName)
+    {
+        ClassFileWriter cfw = new ClassFileWriter(adapterName,
+                                                  superClass.getName(),
+                                                  "");
+        cfw.addField("factory", "Lorg/mozilla/javascript/ContextFactory;",
+                     (short) (ClassFileWriter.ACC_PUBLIC |
+                              ClassFileWriter.ACC_FINAL));
+        cfw.addField("delegee", "Lorg/mozilla/javascript/Scriptable;",
+                     (short) (ClassFileWriter.ACC_PUBLIC |
+                              ClassFileWriter.ACC_FINAL));
+        cfw.addField("self", "Lorg/mozilla/javascript/Scriptable;",
+                     (short) (ClassFileWriter.ACC_PUBLIC |
+                              ClassFileWriter.ACC_FINAL));
+        int interfacesCount = interfaces == null ? 0 : interfaces.length;
+        for (int i=0; i < interfacesCount; i++) {
+            if (interfaces[i] != null)
+                cfw.addInterface(interfaces[i].getName());
+        }
+
+        String superName = superClass.getName().replace('.', '/');
+        generateCtor(cfw, adapterName, superName);
+        generateSerialCtor(cfw, adapterName, superName);
+        if (scriptClassName != null)
+            generateEmptyCtor(cfw, adapterName, superName, scriptClassName);
+
+        ObjToIntMap generatedOverrides = new ObjToIntMap();
+        ObjToIntMap generatedMethods = new ObjToIntMap();
+
+        // generate methods to satisfy all specified interfaces.
+        for (int i = 0; i < interfacesCount; i++) {
+            Method[] methods = interfaces[i].getMethods();
+            for (int j = 0; j < methods.length; j++) {
+                Method method = methods[j];
+                int mods = method.getModifiers();
+                if (Modifier.isStatic(mods) || Modifier.isFinal(mods)) {
+                    continue;
+                }
+                String methodName = method.getName();
+                Class[] argTypes = method.getParameterTypes();
+                if (!functionNames.has(methodName)) {
+                    try {
+                        superClass.getMethod(methodName, argTypes);
+                        // The class we're extending implements this method and
+                        // the JavaScript object doesn't have an override. See
+                        // bug 61226.
+                        continue;
+                    } catch (NoSuchMethodException e) {
+                        // Not implemented by superclass; fall through
+                    }
+                }
+                // make sure to generate only one instance of a particular
+                // method/signature.
+                String methodSignature = getMethodSignature(method, argTypes);
+                String methodKey = methodName + methodSignature;
+                if (! generatedOverrides.has(methodKey)) {
+                    generateMethod(cfw, adapterName, methodName,
+                                   argTypes, method.getReturnType());
+                    generatedOverrides.put(methodKey, 0);
+                    generatedMethods.put(methodName, 0);
+                }
+            }
+        }
+
+        // Now, go through the superclass's methods, checking for abstract
+        // methods or additional methods to override.
+
+        // generate any additional overrides that the object might contain.
+        Method[] methods = getOverridableMethods(superClass);
+        for (int j = 0; j < methods.length; j++) {
+            Method method = methods[j];
+            int mods = method.getModifiers();
+            // if a method is marked abstract, must implement it or the
+            // resulting class won't be instantiable. otherwise, if the object
+            // has a property of the same name, then an override is intended.
+            boolean isAbstractMethod = Modifier.isAbstract(mods);
+            String methodName = method.getName();
+            if (isAbstractMethod || functionNames.has(methodName)) {
+                // make sure to generate only one instance of a particular
+                // method/signature.
+                Class[] argTypes = method.getParameterTypes();
+                String methodSignature = getMethodSignature(method, argTypes);
+                String methodKey = methodName + methodSignature;
+                if (! generatedOverrides.has(methodKey)) {
+                    generateMethod(cfw, adapterName, methodName,
+                                   argTypes, method.getReturnType());
+                    generatedOverrides.put(methodKey, 0);
+                    generatedMethods.put(methodName, 0);
+                    
+                    // if a method was overridden, generate a "super$method"
+                    // which lets the delegate call the superclass' version.
+                    if (!isAbstractMethod) {
+                        generateSuper(cfw, adapterName, superName,
+                                      methodName, methodSignature,
+                                      argTypes, method.getReturnType());
+                    }
+                }
+            }
+        }
+
+        // Generate Java methods for remaining properties that are not
+        // overrides.
+        ObjToIntMap.Iterator iter = new ObjToIntMap.Iterator(functionNames);
+        for (iter.start(); !iter.done(); iter.next()) {
+            String functionName = (String)iter.getKey();
+            if (generatedMethods.has(functionName))
+                continue;
+            int length = iter.getValue();
+            Class[] parms = new Class[length];
+            for (int k=0; k < length; k++)
+                parms[k] = ScriptRuntime.ObjectClass;
+            generateMethod(cfw, adapterName, functionName, parms,
+                           ScriptRuntime.ObjectClass);
+        }
+        return cfw.toByteArray();
+    }
+
+    static Method[] getOverridableMethods(Class c)
+    {
+        ArrayList list = new ArrayList();
+        HashSet skip = new HashSet();
+        while (c != null) {
+            appendOverridableMethods(c, list, skip);
+            for (Class intf: c.getInterfaces())
+                appendOverridableMethods(intf, list, skip);
+            c = c.getSuperclass();
+        }
+        return list.toArray(new Method[list.size()]);
+    }
+    
+    private static void appendOverridableMethods(Class c, 
+            ArrayList list, HashSet skip)
+    {
+        Method[] methods = c.getDeclaredMethods();
+        for (int i = 0; i < methods.length; i++) {
+            String methodKey = methods[i].getName() + 
+                getMethodSignature(methods[i],
+                        methods[i].getParameterTypes());
+            if (skip.contains(methodKey))
+                continue; // skip this method
+            int mods = methods[i].getModifiers();
+            if (Modifier.isStatic(mods))
+                continue;
+            if (Modifier.isFinal(mods)) {
+                // Make sure we don't add a final method to the list
+                // of overridable methods.
+                skip.add(methodKey);
+                continue;
+            }
+            if (Modifier.isPublic(mods) || Modifier.isProtected(mods)) {
+                list.add(methods[i]);
+                skip.add(methodKey);
+            }
+        }
+    }
+
+    static Class loadAdapterClass(String className, byte[] classBytes)
+    {
+        Object staticDomain;
+        Class domainClass = SecurityController.getStaticSecurityDomainClass();
+        if(domainClass == CodeSource.class || domainClass == ProtectionDomain.class) {
+            ProtectionDomain protectionDomain = JavaAdapter.class.getProtectionDomain();
+            if(domainClass == CodeSource.class) {
+                staticDomain = protectionDomain == null ? null : protectionDomain.getCodeSource();
+            }
+            else {
+                staticDomain = protectionDomain;
+            }
+        }
+        else {
+            staticDomain = null;
+        }
+        GeneratedClassLoader loader = SecurityController.createLoader(null, 
+                staticDomain);
+        Class result = loader.defineClass(className, classBytes);
+        loader.linkClass(result);
+        return result;
+    }
+
+    public static Function getFunction(Scriptable obj, String functionName)
+    {
+        Object x = ScriptableObject.getProperty(obj, functionName);
+        if (x == Scriptable.NOT_FOUND) {
+            // This method used to swallow the exception from calling
+            // an undefined method. People have come to depend on this
+            // somewhat dubious behavior. It allows people to avoid
+            // implementing listener methods that they don't care about,
+            // for instance.
+            return null;
+        }
+        if (!(x instanceof Function))
+            throw ScriptRuntime.notFunctionError(x, functionName);
+
+        return (Function)x;
+    }
+
+    /**
+     * Utility method which dynamically binds a Context to the current thread,
+     * if none already exists.
+     */
+    public static Object callMethod(ContextFactory factory,
+                                    final Scriptable thisObj,
+                                    final Function f, final Object[] args,
+                                    final long argsToWrap)
+    {
+        if (f == null) {
+            // See comments in getFunction
+            return Undefined.instance;
+        }
+        if (factory == null) {
+            factory = ContextFactory.getGlobal();
+        }
+
+        final Scriptable scope = f.getParentScope();
+        if (argsToWrap == 0) {
+            return Context.call(factory, f, scope, thisObj, args);
+        }
+
+        Context cx = Context.getCurrentContext();
+        if (cx != null) {
+            return doCall(cx, scope, thisObj, f, args, argsToWrap);
+        } else {
+            return factory.call(new ContextAction() {
+                public Object run(Context cx)
+                {
+                    return doCall(cx, scope, thisObj, f, args, argsToWrap);
+                }
+            });
+        }
+    }
+
+    private static Object doCall(Context cx, Scriptable scope,
+                                 Scriptable thisObj, Function f,
+                                 Object[] args, long argsToWrap)
+    {
+        // Wrap the rest of objects
+        for (int i = 0; i != args.length; ++i) {
+            if (0 != (argsToWrap & (1 << i))) {
+                Object arg = args[i];
+                if (!(arg instanceof Scriptable)) {
+                    args[i] = cx.getWrapFactory().wrap(cx, scope, arg,
+                                                       null);
+                }
+            }
+        }
+        return f.call(cx, scope, thisObj, args);
+    }
+
+    public static Scriptable runScript(final Script script)
+    {
+        return (Scriptable)ContextFactory.getGlobal().call(
+            new ContextAction() {
+                public Object run(Context cx)
+                {
+                    ScriptableObject global = ScriptRuntime.getGlobal(cx);
+                    script.exec(cx, global);
+                    return global;
+                }
+            });
+    }
+
+    private static void generateCtor(ClassFileWriter cfw, String adapterName,
+                                     String superName)
+    {
+        cfw.startMethod("",
+                        "(Lorg/mozilla/javascript/ContextFactory;"
+                        +"Lorg/mozilla/javascript/Scriptable;)V",
+                        ClassFileWriter.ACC_PUBLIC);
+
+        // Invoke base class constructor
+        cfw.add(ByteCode.ALOAD_0);  // this
+        cfw.addInvoke(ByteCode.INVOKESPECIAL, superName, "", "()V");
+
+        // Save parameter in instance variable "factory"
+        cfw.add(ByteCode.ALOAD_0);  // this
+        cfw.add(ByteCode.ALOAD_1);  // first arg: ContextFactory instance
+        cfw.add(ByteCode.PUTFIELD, adapterName, "factory",
+                "Lorg/mozilla/javascript/ContextFactory;");
+
+        // Save parameter in instance variable "delegee"
+        cfw.add(ByteCode.ALOAD_0);  // this
+        cfw.add(ByteCode.ALOAD_2);  // second arg: Scriptable delegee
+        cfw.add(ByteCode.PUTFIELD, adapterName, "delegee",
+                "Lorg/mozilla/javascript/Scriptable;");
+
+        cfw.add(ByteCode.ALOAD_0);  // this for the following PUTFIELD for self
+        // create a wrapper object to be used as "this" in method calls
+        cfw.add(ByteCode.ALOAD_2);  // the Scriptable delegee
+        cfw.add(ByteCode.ALOAD_0);  // this
+        cfw.addInvoke(ByteCode.INVOKESTATIC,
+                      "org/mozilla/javascript/JavaAdapter",
+                      "createAdapterWrapper",
+                      "(Lorg/mozilla/javascript/Scriptable;"
+                      +"Ljava/lang/Object;"
+                      +")Lorg/mozilla/javascript/Scriptable;");
+        cfw.add(ByteCode.PUTFIELD, adapterName, "self",
+                "Lorg/mozilla/javascript/Scriptable;");
+
+        cfw.add(ByteCode.RETURN);
+        cfw.stopMethod((short)3); // 3: this + factory + delegee
+    }
+
+    private static void generateSerialCtor(ClassFileWriter cfw,
+                                           String adapterName,
+                                           String superName)
+    {
+        cfw.startMethod("",
+                        "(Lorg/mozilla/javascript/ContextFactory;"
+                        +"Lorg/mozilla/javascript/Scriptable;"
+                        +"Lorg/mozilla/javascript/Scriptable;"
+                        +")V",
+                        ClassFileWriter.ACC_PUBLIC);
+
+        // Invoke base class constructor
+        cfw.add(ByteCode.ALOAD_0);  // this
+        cfw.addInvoke(ByteCode.INVOKESPECIAL, superName, "", "()V");
+
+        // Save parameter in instance variable "factory"
+        cfw.add(ByteCode.ALOAD_0);  // this
+        cfw.add(ByteCode.ALOAD_1);  // first arg: ContextFactory instance
+        cfw.add(ByteCode.PUTFIELD, adapterName, "factory",
+                "Lorg/mozilla/javascript/ContextFactory;");
+
+        // Save parameter in instance variable "delegee"
+        cfw.add(ByteCode.ALOAD_0);  // this
+        cfw.add(ByteCode.ALOAD_2);  // second arg: Scriptable delegee
+        cfw.add(ByteCode.PUTFIELD, adapterName, "delegee",
+                "Lorg/mozilla/javascript/Scriptable;");
+        // save self
+        cfw.add(ByteCode.ALOAD_0);  // this
+        cfw.add(ByteCode.ALOAD_3);  // second arg: Scriptable self
+        cfw.add(ByteCode.PUTFIELD, adapterName, "self",
+                "Lorg/mozilla/javascript/Scriptable;");
+
+        cfw.add(ByteCode.RETURN);
+        cfw.stopMethod((short)4); // 4: this + factory + delegee + self
+    }
+
+    private static void generateEmptyCtor(ClassFileWriter cfw,
+                                          String adapterName,
+                                          String superName,
+                                          String scriptClassName)
+    {
+        cfw.startMethod("", "()V", ClassFileWriter.ACC_PUBLIC);
+
+        // Invoke base class constructor
+        cfw.add(ByteCode.ALOAD_0);  // this
+        cfw.addInvoke(ByteCode.INVOKESPECIAL, superName, "", "()V");
+
+        // Set factory to null to use current global when necessary
+        cfw.add(ByteCode.ALOAD_0);
+        cfw.add(ByteCode.ACONST_NULL);
+        cfw.add(ByteCode.PUTFIELD, adapterName, "factory",
+                "Lorg/mozilla/javascript/ContextFactory;");
+
+        // Load script class
+        cfw.add(ByteCode.NEW, scriptClassName);
+        cfw.add(ByteCode.DUP);
+        cfw.addInvoke(ByteCode.INVOKESPECIAL, scriptClassName, "", "()V");
+
+        // Run script and save resulting scope
+        cfw.addInvoke(ByteCode.INVOKESTATIC,
+                      "org/mozilla/javascript/JavaAdapter",
+                      "runScript",
+                      "(Lorg/mozilla/javascript/Script;"
+                      +")Lorg/mozilla/javascript/Scriptable;");
+        cfw.add(ByteCode.ASTORE_1);
+
+        // Save the Scriptable in instance variable "delegee"
+        cfw.add(ByteCode.ALOAD_0);  // this
+        cfw.add(ByteCode.ALOAD_1);  // the Scriptable
+        cfw.add(ByteCode.PUTFIELD, adapterName, "delegee",
+                "Lorg/mozilla/javascript/Scriptable;");
+
+        cfw.add(ByteCode.ALOAD_0);  // this for the following PUTFIELD for self
+        // create a wrapper object to be used as "this" in method calls
+        cfw.add(ByteCode.ALOAD_1);  // the Scriptable
+        cfw.add(ByteCode.ALOAD_0);  // this
+        cfw.addInvoke(ByteCode.INVOKESTATIC,
+                      "org/mozilla/javascript/JavaAdapter",
+                      "createAdapterWrapper",
+                      "(Lorg/mozilla/javascript/Scriptable;"
+                      +"Ljava/lang/Object;"
+                      +")Lorg/mozilla/javascript/Scriptable;");
+        cfw.add(ByteCode.PUTFIELD, adapterName, "self",
+                "Lorg/mozilla/javascript/Scriptable;");
+
+        cfw.add(ByteCode.RETURN);
+        cfw.stopMethod((short)2); // this + delegee
+    }
+
+    /**
+     * Generates code to wrap Java arguments into Object[].
+     * Non-primitive Java types are left as-is pending conversion
+     * in the helper method. Leaves the array object on the top of the stack.
+     */
+    static void generatePushWrappedArgs(ClassFileWriter cfw,
+                                        Class[] argTypes,
+                                        int arrayLength)
+    {
+        // push arguments
+        cfw.addPush(arrayLength);
+        cfw.add(ByteCode.ANEWARRAY, "java/lang/Object");
+        int paramOffset = 1;
+        for (int i = 0; i != argTypes.length; ++i) {
+            cfw.add(ByteCode.DUP); // duplicate array reference
+            cfw.addPush(i);
+            paramOffset += generateWrapArg(cfw, paramOffset, argTypes[i]);
+            cfw.add(ByteCode.AASTORE);
+        }
+    }
+
+    /**
+     * Generates code to wrap Java argument into Object.
+     * Non-primitive Java types are left unconverted pending conversion
+     * in the helper method. Leaves the wrapper object on the top of the stack.
+     */
+    private static int generateWrapArg(ClassFileWriter cfw, int paramOffset,
+                                       Class argType)
+    {
+        int size = 1;
+        if (!argType.isPrimitive()) {
+            cfw.add(ByteCode.ALOAD, paramOffset);
+
+        } else if (argType == Boolean.TYPE) {
+            // wrap boolean values with java.lang.Boolean.
+            cfw.add(ByteCode.NEW, "java/lang/Boolean");
+            cfw.add(ByteCode.DUP);
+            cfw.add(ByteCode.ILOAD, paramOffset);
+            cfw.addInvoke(ByteCode.INVOKESPECIAL, "java/lang/Boolean",
+                          "", "(Z)V");
+
+        } else if (argType == Character.TYPE) {
+            // Create a string of length 1 using the character parameter.
+            cfw.add(ByteCode.ILOAD, paramOffset);
+            cfw.addInvoke(ByteCode.INVOKESTATIC, "java/lang/String",
+                          "valueOf", "(C)Ljava/lang/String;");
+
+        } else {
+            // convert all numeric values to java.lang.Double.
+            cfw.add(ByteCode.NEW, "java/lang/Double");
+            cfw.add(ByteCode.DUP);
+            String typeName = argType.getName();
+            switch (typeName.charAt(0)) {
+            case 'b':
+            case 's':
+            case 'i':
+                // load an int value, convert to double.
+                cfw.add(ByteCode.ILOAD, paramOffset);
+                cfw.add(ByteCode.I2D);
+                break;
+            case 'l':
+                // load a long, convert to double.
+                cfw.add(ByteCode.LLOAD, paramOffset);
+                cfw.add(ByteCode.L2D);
+                size = 2;
+                break;
+            case 'f':
+                // load a float, convert to double.
+                cfw.add(ByteCode.FLOAD, paramOffset);
+                cfw.add(ByteCode.F2D);
+                break;
+            case 'd':
+                cfw.add(ByteCode.DLOAD, paramOffset);
+                size = 2;
+                break;
+            }
+            cfw.addInvoke(ByteCode.INVOKESPECIAL, "java/lang/Double",
+                          "", "(D)V");
+        }
+        return size;
+    }
+
+    /**
+     * Generates code to convert a wrapped value type to a primitive type.
+     * Handles unwrapping java.lang.Boolean, and java.lang.Number types.
+     * Generates the appropriate RETURN bytecode.
+     */
+    static void generateReturnResult(ClassFileWriter cfw, Class retType,
+                                     boolean callConvertResult)
+    {
+        // wrap boolean values with java.lang.Boolean, convert all other
+        // primitive values to java.lang.Double.
+        if (retType == Void.TYPE) {
+            cfw.add(ByteCode.POP);
+            cfw.add(ByteCode.RETURN);
+
+        } else if (retType == Boolean.TYPE) {
+            cfw.addInvoke(ByteCode.INVOKESTATIC,
+                          "org/mozilla/javascript/Context",
+                          "toBoolean", "(Ljava/lang/Object;)Z");
+            cfw.add(ByteCode.IRETURN);
+
+        } else if (retType == Character.TYPE) {
+            // characters are represented as strings in JavaScript.
+            // return the first character.
+            // first convert the value to a string if possible.
+            cfw.addInvoke(ByteCode.INVOKESTATIC,
+                          "org/mozilla/javascript/Context",
+                          "toString",
+                          "(Ljava/lang/Object;)Ljava/lang/String;");
+            cfw.add(ByteCode.ICONST_0);
+            cfw.addInvoke(ByteCode.INVOKEVIRTUAL, "java/lang/String",
+                          "charAt", "(I)C");
+            cfw.add(ByteCode.IRETURN);
+
+        } else if (retType.isPrimitive()) {
+            cfw.addInvoke(ByteCode.INVOKESTATIC,
+                          "org/mozilla/javascript/Context",
+                          "toNumber", "(Ljava/lang/Object;)D");
+            String typeName = retType.getName();
+            switch (typeName.charAt(0)) {
+            case 'b':
+            case 's':
+            case 'i':
+                cfw.add(ByteCode.D2I);
+                cfw.add(ByteCode.IRETURN);
+                break;
+            case 'l':
+                cfw.add(ByteCode.D2L);
+                cfw.add(ByteCode.LRETURN);
+                break;
+            case 'f':
+                cfw.add(ByteCode.D2F);
+                cfw.add(ByteCode.FRETURN);
+                break;
+            case 'd':
+                cfw.add(ByteCode.DRETURN);
+                break;
+            default:
+                throw new RuntimeException("Unexpected return type " +
+                                           retType.toString());
+            }
+
+        } else {
+            String retTypeStr = retType.getName();
+            if (callConvertResult) {
+                cfw.addLoadConstant(retTypeStr);
+                cfw.addInvoke(ByteCode.INVOKESTATIC,
+                              "java/lang/Class",
+                              "forName",
+                              "(Ljava/lang/String;)Ljava/lang/Class;");
+
+                cfw.addInvoke(ByteCode.INVOKESTATIC,
+                              "org/mozilla/javascript/JavaAdapter",
+                              "convertResult",
+                              "(Ljava/lang/Object;"
+                              +"Ljava/lang/Class;"
+                              +")Ljava/lang/Object;");
+            }
+            // Now cast to return type
+            cfw.add(ByteCode.CHECKCAST, retTypeStr);
+            cfw.add(ByteCode.ARETURN);
+        }
+    }
+
+    private static void generateMethod(ClassFileWriter cfw, String genName,
+                                       String methodName, Class[] parms,
+                                       Class returnType)
+    {
+        StringBuffer sb = new StringBuffer();
+        int paramsEnd = appendMethodSignature(parms, returnType, sb);
+        String methodSignature = sb.toString();
+        cfw.startMethod(methodName, methodSignature,
+                        ClassFileWriter.ACC_PUBLIC);
+
+        // Prepare stack to call method
+
+        // push factory
+        cfw.add(ByteCode.ALOAD_0);
+        cfw.add(ByteCode.GETFIELD, genName, "factory",
+                "Lorg/mozilla/javascript/ContextFactory;");
+
+        // push self
+        cfw.add(ByteCode.ALOAD_0);
+        cfw.add(ByteCode.GETFIELD, genName, "self",
+                "Lorg/mozilla/javascript/Scriptable;");
+
+        // push function
+        cfw.add(ByteCode.ALOAD_0);
+        cfw.add(ByteCode.GETFIELD, genName, "delegee",
+                "Lorg/mozilla/javascript/Scriptable;");
+        cfw.addPush(methodName);
+        cfw.addInvoke(ByteCode.INVOKESTATIC,
+                      "org/mozilla/javascript/JavaAdapter",
+                      "getFunction",
+                      "(Lorg/mozilla/javascript/Scriptable;"
+                      +"Ljava/lang/String;"
+                      +")Lorg/mozilla/javascript/Function;");
+
+        // push arguments
+        generatePushWrappedArgs(cfw, parms, parms.length);
+
+        // push bits to indicate which parameters should be wrapped
+        if (parms.length > 64) {
+            // If it will be an issue, then passing a static boolean array
+            // can be an option, but for now using simple bitmask
+            throw Context.reportRuntimeError0(
+                "JavaAdapter can not subclass methods with more then"
+                +" 64 arguments.");
+        }
+        long convertionMask = 0;
+        for (int i = 0; i != parms.length; ++i) {
+            if (!parms[i].isPrimitive()) {
+                convertionMask |= (1 << i);
+            }
+        }
+        cfw.addPush(convertionMask);
+
+        // go through utility method, which creates a Context to run the
+        // method in.
+        cfw.addInvoke(ByteCode.INVOKESTATIC,
+                      "org/mozilla/javascript/JavaAdapter",
+                      "callMethod",
+                      "(Lorg/mozilla/javascript/ContextFactory;"
+                      +"Lorg/mozilla/javascript/Scriptable;"
+                      +"Lorg/mozilla/javascript/Function;"
+                      +"[Ljava/lang/Object;"
+                      +"J"
+                      +")Ljava/lang/Object;");
+
+        generateReturnResult(cfw, returnType, true);
+
+        cfw.stopMethod((short)paramsEnd);
+    }
+
+    /**
+     * Generates code to push typed parameters onto the operand stack
+     * prior to a direct Java method call.
+     */
+    private static int generatePushParam(ClassFileWriter cfw, int paramOffset,
+                                         Class paramType)
+    {
+        if (!paramType.isPrimitive()) {
+            cfw.addALoad(paramOffset);
+            return 1;
+        }
+        String typeName = paramType.getName();
+        switch (typeName.charAt(0)) {
+        case 'z':
+        case 'b':
+        case 'c':
+        case 's':
+        case 'i':
+            // load an int value, convert to double.
+            cfw.addILoad(paramOffset);
+            return 1;
+        case 'l':
+            // load a long, convert to double.
+            cfw.addLLoad(paramOffset);
+            return 2;
+        case 'f':
+            // load a float, convert to double.
+            cfw.addFLoad(paramOffset);
+            return 1;
+        case 'd':
+            cfw.addDLoad(paramOffset);
+            return 2;
+        }
+        throw Kit.codeBug();
+    }
+
+    /**
+     * Generates code to return a Java type, after calling a Java method
+     * that returns the same type.
+     * Generates the appropriate RETURN bytecode.
+     */
+    private static void generatePopResult(ClassFileWriter cfw,
+                                          Class retType)
+    {
+        if (retType.isPrimitive()) {
+            String typeName = retType.getName();
+            switch (typeName.charAt(0)) {
+            case 'b':
+            case 'c':
+            case 's':
+            case 'i':
+            case 'z':
+                cfw.add(ByteCode.IRETURN);
+                break;
+            case 'l':
+                cfw.add(ByteCode.LRETURN);
+                break;
+            case 'f':
+                cfw.add(ByteCode.FRETURN);
+                break;
+            case 'd':
+                cfw.add(ByteCode.DRETURN);
+                break;
+            }
+        } else {
+            cfw.add(ByteCode.ARETURN);
+        }
+    }
+
+    /**
+     * Generates a method called "super$methodName()" which can be called
+     * from JavaScript that is equivalent to calling "super.methodName()"
+     * from Java. Eventually, this may be supported directly in JavaScript.
+     */
+    private static void generateSuper(ClassFileWriter cfw,
+                                      String genName, String superName,
+                                      String methodName, String methodSignature,
+                                      Class[] parms, Class returnType)
+    {
+        cfw.startMethod("super$" + methodName, methodSignature,
+                        ClassFileWriter.ACC_PUBLIC);
+
+        // push "this"
+        cfw.add(ByteCode.ALOAD, 0);
+
+        // push the rest of the parameters.
+        int paramOffset = 1;
+        for (int i = 0; i < parms.length; i++) {
+            paramOffset += generatePushParam(cfw, paramOffset, parms[i]);
+        }
+
+        // call the superclass implementation of the method.
+        cfw.addInvoke(ByteCode.INVOKESPECIAL,
+                      superName,
+                      methodName,
+                      methodSignature);
+
+        // now, handle the return type appropriately.
+        Class retType = returnType;
+        if (!retType.equals(Void.TYPE)) {
+            generatePopResult(cfw, retType);
+        } else {
+            cfw.add(ByteCode.RETURN);
+        }
+        cfw.stopMethod((short)(paramOffset + 1));
+    }
+
+    /**
+     * Returns a fully qualified method name concatenated with its signature.
+     */
+    private static String getMethodSignature(Method method, Class[] argTypes)
+    {
+        StringBuffer sb = new StringBuffer();
+        appendMethodSignature(argTypes, method.getReturnType(), sb);
+        return sb.toString();
+    }
+
+    static int appendMethodSignature(Class[] argTypes,
+                                     Class returnType,
+                                     StringBuffer sb)
+    {
+        sb.append('(');
+        int firstLocal = 1 + argTypes.length; // includes this.
+        for (int i = 0; i < argTypes.length; i++) {
+            Class type = argTypes[i];
+            appendTypeString(sb, type);
+            if (type == Long.TYPE || type == Double.TYPE) {
+                // adjust for duble slot
+                ++firstLocal;
+            }
+        }
+        sb.append(')');
+        appendTypeString(sb, returnType);
+        return firstLocal;
+    }
+
+    private static StringBuffer appendTypeString(StringBuffer sb, Class type)
+    {
+        while (type.isArray()) {
+            sb.append('[');
+            type = type.getComponentType();
+        }
+        if (type.isPrimitive()) {
+            char typeLetter;
+            if (type == Boolean.TYPE) {
+                typeLetter = 'Z';
+            } else if (type == Long.TYPE) {
+                typeLetter = 'J';
+            } else {
+                String typeName = type.getName();
+                typeLetter = Character.toUpperCase(typeName.charAt(0));
+            }
+            sb.append(typeLetter);
+        } else {
+            sb.append('L');
+            sb.append(type.getName().replace('.', '/'));
+            sb.append(';');
+        }
+        return sb;
+    }
+
+    static int[] getArgsToConvert(Class[] argTypes)
+    {
+        int count = 0;
+        for (int i = 0; i != argTypes.length; ++i) {
+            if (!argTypes[i].isPrimitive())
+                ++count;
+        }
+        if (count == 0)
+            return null;
+        int[] array = new int[count];
+        count = 0;
+        for (int i = 0; i != argTypes.length; ++i) {
+            if (!argTypes[i].isPrimitive())
+                array[count++] = i;
+        }
+        return array;
+    }
+
+    private static final Object FTAG = "JavaAdapter";
+    private static final int Id_JavaAdapter = 1;
+}
diff --git a/org/mozilla/javascript/JavaMembers.java b/org/mozilla/javascript/JavaMembers.java
new file mode 100644
index 0000000..4744a1c
--- /dev/null
+++ b/org/mozilla/javascript/JavaMembers.java
@@ -0,0 +1,933 @@
+/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Rhino code, released
+ * May 6, 1999.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1997-2000
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Norris Boyd
+ *   Cameron McCormack
+ *   Frank Mitchell
+ *   Mike Shaver
+ *   Kurt Westerfeld
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * the GNU General Public License Version 2 or later (the "GPL"), in which
+ * case the provisions of the GPL are applicable instead of those above. If
+ * you wish to allow use of your version of this file only under the terms of
+ * the GPL and not to allow others to use your version of this file under the
+ * MPL, indicate your decision by deleting the provisions above and replacing
+ * them with the notice and other provisions required by the GPL. If you do
+ * not delete the provisions above, a recipient may use your version of this
+ * file under either the MPL or the GPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+package org.mozilla.javascript;
+
+import java.lang.reflect.*;
+import java.util.*;
+
+/**
+ *
+ * @author Mike Shaver
+ * @author Norris Boyd
+ * @see NativeJavaObject
+ * @see NativeJavaClass
+ */
+class JavaMembers
+{
+    JavaMembers(Scriptable scope, Class cl)
+    {
+        this(scope, cl, false);
+    }
+
+    JavaMembers(Scriptable scope, Class cl, boolean includeProtected)
+    {
+        try {
+            Context cx = ContextFactory.getGlobal().enterContext();
+            ClassShutter shutter = cx.getClassShutter();
+            if (shutter != null && !shutter.visibleToScripts(cl.getName())) {
+                throw Context.reportRuntimeError1("msg.access.prohibited",
+                                                  cl.getName());
+            }
+            this.includePrivate = cx.hasFeature(
+                Context.FEATURE_ENHANCED_JAVA_ACCESS);
+            this.members = new HashMap();
+            this.staticMembers = new HashMap();
+            this.cl = cl;
+            reflect(scope, includeProtected);
+        } finally {
+            Context.exit();
+        }
+    }
+
+    boolean has(String name, boolean isStatic)
+    {
+        Map ht = isStatic ? staticMembers : members;
+        Object obj = ht.get(name);
+        if (obj != null) {
+            return true;
+        }
+        return findExplicitFunction(name, isStatic) != null;
+    }
+
+    Object get(Scriptable scope, String name, Object javaObject,
+               boolean isStatic)
+    {
+        Map ht = isStatic ? staticMembers : members;
+        Object member = ht.get(name);
+        if (!isStatic && member == null) {
+            // Try to get static member from instance (LC3)
+            member = staticMembers.get(name);
+        }
+        if (member == null) {
+            member = this.getExplicitFunction(scope, name,
+                                              javaObject, isStatic);
+            if (member == null)
+                return Scriptable.NOT_FOUND;
+        }
+        if (member instanceof Scriptable) {
+            return member;
+        }
+        Context cx = Context.getContext();
+        Object rval;
+        Class type;
+        try {
+            if (member instanceof BeanProperty) {
+                BeanProperty bp = (BeanProperty) member;
+                if (bp.getter == null)
+                    return Scriptable.NOT_FOUND;
+                rval = bp.getter.invoke(javaObject, Context.emptyArgs);
+                type = bp.getter.method().getReturnType();
+            } else {
+                Field field = (Field) member;
+                rval = field.get(isStatic ? null : javaObject);
+                type = field.getType();
+            }
+        } catch (Exception ex) {
+            throw Context.throwAsScriptRuntimeEx(ex);
+        }
+        // Need to wrap the object before we return it.
+        scope = ScriptableObject.getTopLevelScope(scope);
+        return cx.getWrapFactory().wrap(cx, scope, rval, type);
+    }
+
+    void put(Scriptable scope, String name, Object javaObject,
+             Object value, boolean isStatic)
+    {
+        Map ht = isStatic ? staticMembers : members;
+        Object member = ht.get(name);
+        if (!isStatic && member == null) {
+            // Try to get static member from instance (LC3)
+            member = staticMembers.get(name);
+        }
+        if (member == null)
+            throw reportMemberNotFound(name);
+        if (member instanceof FieldAndMethods) {
+            FieldAndMethods fam = (FieldAndMethods) ht.get(name);
+            member = fam.field;
+        }
+
+        // Is this a bean property "set"?
+        if (member instanceof BeanProperty) {
+            BeanProperty bp = (BeanProperty)member;
+            if (bp.setter == null) {
+                throw reportMemberNotFound(name);
+            }
+            // If there's only one setter or if the value is null, use the
+            // main setter. Otherwise, let the NativeJavaMethod decide which
+            // setter to use:
+            if (bp.setters == null || value == null) {
+                Class setType = bp.setter.argTypes[0];
+                Object[] args = { Context.jsToJava(value, setType) };
+                try {
+                    bp.setter.invoke(javaObject, args);
+                } catch (Exception ex) {
+                  throw Context.throwAsScriptRuntimeEx(ex);
+                }
+            } else {
+                Object[] args = { value };
+                bp.setters.call(Context.getContext(),
+                                ScriptableObject.getTopLevelScope(scope),
+                                scope, args);
+            }
+        }
+        else {
+            if (!(member instanceof Field)) {
+                String str = (member == null) ? "msg.java.internal.private"
+                                              : "msg.java.method.assign";
+                throw Context.reportRuntimeError1(str, name);
+            }
+            Field field = (Field)member;
+            Object javaValue = Context.jsToJava(value, field.getType());
+            try {
+                field.set(javaObject, javaValue);
+            } catch (IllegalAccessException accessEx) {
+                if ((field.getModifiers() & Modifier.FINAL) != 0) {
+                    // treat Java final the same as JavaScript [[READONLY]]
+                    return;
+                }
+                throw Context.throwAsScriptRuntimeEx(accessEx);
+            } catch (IllegalArgumentException argEx) {
+                throw Context.reportRuntimeError3(
+                    "msg.java.internal.field.type",
+                    value.getClass().getName(), field,
+                    javaObject.getClass().getName());
+            }
+        }
+    }
+
+    Object[] getIds(boolean isStatic)
+    {
+        Map map = isStatic ? staticMembers : members;
+        return map.keySet().toArray(new Object[map.size()]);
+    }
+
+    static String javaSignature(Class type)
+    {
+        if (!type.isArray()) {
+            return type.getName();
+        } else {
+            int arrayDimension = 0;
+            do {
+                ++arrayDimension;
+                type = type.getComponentType();
+            } while (type.isArray());
+            String name = type.getName();
+            String suffix = "[]";
+            if (arrayDimension == 1) {
+                return name.concat(suffix);
+            } else {
+                int length = name.length() + arrayDimension * suffix.length();
+                StringBuffer sb = new StringBuffer(length);
+                sb.append(name);
+                while (arrayDimension != 0) {
+                    --arrayDimension;
+                    sb.append(suffix);
+                }
+                return sb.toString();
+            }
+        }
+    }
+
+    static String liveConnectSignature(Class[] argTypes)
+    {
+        int N = argTypes.length;
+        if (N == 0) { return "()"; }
+        StringBuffer sb = new StringBuffer();
+        sb.append('(');
+        for (int i = 0; i != N; ++i) {
+            if (i != 0) {
+                sb.append(',');
+            }
+            sb.append(javaSignature(argTypes[i]));
+        }
+        sb.append(')');
+        return sb.toString();
+    }
+
+    private MemberBox findExplicitFunction(String name, boolean isStatic)
+    {
+        int sigStart = name.indexOf('(');
+        if (sigStart < 0) { return null; }
+
+        Map ht = isStatic ? staticMembers : members;
+        MemberBox[] methodsOrCtors = null;
+        boolean isCtor = (isStatic && sigStart == 0);
+
+        if (isCtor) {
+            // Explicit request for an overloaded constructor
+            methodsOrCtors = ctors;
+        } else {
+            // Explicit request for an overloaded method
+            String trueName = name.substring(0,sigStart);
+            Object obj = ht.get(trueName);
+            if (!isStatic && obj == null) {
+                // Try to get static member from instance (LC3)
+                obj = staticMembers.get(trueName);
+            }
+            if (obj instanceof NativeJavaMethod) {
+                NativeJavaMethod njm = (NativeJavaMethod)obj;
+                methodsOrCtors = njm.methods;
+            }
+        }
+
+        if (methodsOrCtors != null) {
+            for (int i = 0; i < methodsOrCtors.length; i++) {
+                Class[] type = methodsOrCtors[i].argTypes;
+                String sig = liveConnectSignature(type);
+                if (sigStart + sig.length() == name.length()
+                    && name.regionMatches(sigStart, sig, 0, sig.length()))
+                {
+                    return methodsOrCtors[i];
+                }
+            }
+        }
+
+        return null;
+    }
+
+    private Object getExplicitFunction(Scriptable scope, String name,
+                                       Object javaObject, boolean isStatic)
+    {
+        Map ht = isStatic ? staticMembers : members;
+        Object member = null;
+        MemberBox methodOrCtor = findExplicitFunction(name, isStatic);
+
+        if (methodOrCtor != null) {
+            Scriptable prototype =
+                ScriptableObject.getFunctionPrototype(scope);
+
+            if (methodOrCtor.isCtor()) {
+                NativeJavaConstructor fun =
+                    new NativeJavaConstructor(methodOrCtor);
+                fun.setPrototype(prototype);
+                member = fun;
+                ht.put(name, fun);
+            } else {
+                String trueName = methodOrCtor.getName();
+                member = ht.get(trueName);
+
+                if (member instanceof NativeJavaMethod &&
+                    ((NativeJavaMethod)member).methods.length > 1 ) {
+                    NativeJavaMethod fun =
+                        new NativeJavaMethod(methodOrCtor, name);
+                    fun.setPrototype(prototype);
+                    ht.put(name, fun);
+                    member = fun;
+                }
+            }
+        }
+
+        return member;
+    }
+
+    /**
+     * Retrieves mapping of methods to accessible methods for a class.
+     * In case the class is not public, retrieves methods with same 
+     * signature as its public methods from public superclasses and 
+     * interfaces (if they exist). Basically upcasts every method to the 
+     * nearest accessible method.
+     */
+    private static Method[] discoverAccessibleMethods(Class clazz, 
+                                                      boolean includeProtected,
+                                                      boolean includePrivate)
+    {
+        Map map = new HashMap();
+        discoverAccessibleMethods(clazz, map, includeProtected, includePrivate);
+        return map.values().toArray(new Method[map.size()]);
+    }
+    
+    private static void discoverAccessibleMethods(Class clazz, 
+            Map map, boolean includeProtected,
+            boolean includePrivate)
+    {
+        if (Modifier.isPublic(clazz.getModifiers()) || includePrivate) {
+            try {
+                if (includeProtected || includePrivate) {
+                    while (clazz != null) {
+                        try {
+                            Method[] methods = clazz.getDeclaredMethods();
+                            for (int i = 0; i < methods.length; i++) {
+                                Method method = methods[i];
+                                int mods = method.getModifiers();
+    
+                                if (Modifier.isPublic(mods) ||
+                                    Modifier.isProtected(mods) ||
+                                    includePrivate)
+                                {
+                                    if (includePrivate)
+                                        method.setAccessible(true);
+                                    map.put(new MethodSignature(method), method);
+                                }
+                            }
+                            clazz = clazz.getSuperclass();
+                        } catch (SecurityException e) {
+                            // Some security settings (i.e., applets) disallow
+                            // access to Class.getDeclaredMethods. Fall back to
+                            // Class.getMethods.
+                            Method[] methods = clazz.getMethods();
+                            for (int i = 0; i < methods.length; i++) {
+                                Method method = methods[i];
+                                MethodSignature sig 
+                                    = new MethodSignature(method);
+                                if (map.get(sig) == null)
+                                    map.put(sig, method);
+                            }
+                            break; // getMethods gets superclass methods, no
+                                   // need to loop any more
+                        }
+                    }
+                } else {
+                    Method[] methods = clazz.getMethods();
+                    for (int i = 0; i < methods.length; i++) {
+                        Method method = methods[i];
+                        MethodSignature sig = new MethodSignature(method);
+                        map.put(sig, method);
+                    }
+                }
+                return;
+            } catch (SecurityException e) {
+                Context.reportWarning(
+                        "Could not discover accessible methods of class " +
+                            clazz.getName() + " due to lack of privileges, " +
+                            "attemping superclasses/interfaces.");
+                // Fall through and attempt to discover superclass/interface
+                // methods
+            }
+        }
+
+        Class[] interfaces = clazz.getInterfaces();
+        for (int i = 0; i < interfaces.length; i++) {
+            discoverAccessibleMethods(interfaces[i], map, includeProtected,
+                    includePrivate);
+        }
+        Class superclass = clazz.getSuperclass();
+        if (superclass != null) {
+            discoverAccessibleMethods(superclass, map, includeProtected,
+                    includePrivate);
+        }
+    }
+
+    private static final class MethodSignature
+    {
+        private final String name;
+        private final Class[] args;
+        
+        private MethodSignature(String name, Class[] args)
+        {
+            this.name = name;
+            this.args = args;
+        }
+        
+        MethodSignature(Method method)
+        {
+            this(method.getName(), method.getParameterTypes());
+        }
+        
+        @Override
+        public boolean equals(Object o)
+        {
+            if(o instanceof MethodSignature)
+            {
+                MethodSignature ms = (MethodSignature)o;
+                return ms.name.equals(name) && Arrays.equals(args, ms.args);
+            }
+            return false;
+        }
+        
+        @Override
+        public int hashCode()
+        {
+            return name.hashCode() ^ args.length;
+        }
+    }
+    
+    private void reflect(Scriptable scope, boolean includeProtected)
+    {
+        // We reflect methods first, because we want overloaded field/method
+        // names to be allocated to the NativeJavaMethod before the field
+        // gets in the way.
+
+        Method[] methods = discoverAccessibleMethods(cl, includeProtected,
+                                                     includePrivate);
+        for (int i = 0; i < methods.length; i++) {
+            Method method = methods[i];
+            int mods = method.getModifiers();
+            boolean isStatic = Modifier.isStatic(mods);
+            Map ht = isStatic ? staticMembers : members;
+            String name = method.getName();
+            Object value = ht.get(name);
+            if (value == null) {
+                ht.put(name, method);
+            } else {
+                ObjArray overloadedMethods;
+                if (value instanceof ObjArray) {
+                    overloadedMethods = (ObjArray)value;
+                } else {
+                    if (!(value instanceof Method)) Kit.codeBug();
+                    // value should be instance of Method as at this stage
+                    // staticMembers and members can only contain methods
+                    overloadedMethods = new ObjArray();
+                    overloadedMethods.add(value);
+                    ht.put(name, overloadedMethods);
+                }
+                overloadedMethods.add(method);
+            }
+        }
+
+        // replace Method instances by wrapped NativeJavaMethod objects
+        // first in staticMembers and then in members
+        for (int tableCursor = 0; tableCursor != 2; ++tableCursor) {
+            boolean isStatic = (tableCursor == 0);
+            Map ht = isStatic ? staticMembers : members;
+            for (String name: ht.keySet()) {
+                MemberBox[] methodBoxes;
+                Object value = ht.get(name);
+                if (value instanceof Method) {
+                    methodBoxes = new MemberBox[1];
+                    methodBoxes[0] = new MemberBox((Method)value);
+                } else {
+                    ObjArray overloadedMethods = (ObjArray)value;
+                    int N = overloadedMethods.size();
+                    if (N < 2) Kit.codeBug();
+                    methodBoxes = new MemberBox[N];
+                    for (int i = 0; i != N; ++i) {
+                        Method method = (Method)overloadedMethods.get(i);
+                        methodBoxes[i] = new MemberBox(method);
+                    }
+                }
+                NativeJavaMethod fun = new NativeJavaMethod(methodBoxes);
+                if (scope != null) {
+                    ScriptRuntime.setFunctionProtoAndParent(fun, scope);
+                }
+                ht.put(name, fun);
+            }
+        }
+
+        // Reflect fields.
+        Field[] fields = getAccessibleFields();
+        for (int i = 0; i < fields.length; i++) {
+            Field field = fields[i];
+            String name = field.getName();
+            int mods = field.getModifiers();
+            if (!includePrivate && !Modifier.isPublic(mods)) {
+                continue;
+            }
+            try {
+                boolean isStatic = Modifier.isStatic(mods);
+                Map ht = isStatic ? staticMembers : members;
+                Object member = ht.get(name);
+                if (member == null) {
+                    ht.put(name, field);
+                } else if (member instanceof NativeJavaMethod) {
+                    NativeJavaMethod method = (NativeJavaMethod) member;
+                    FieldAndMethods fam
+                        = new FieldAndMethods(scope, method.methods, field);
+                    Map fmht = isStatic ? staticFieldAndMethods
+                                              : fieldAndMethods;
+                    if (fmht == null) {
+                        fmht = new HashMap();
+                        if (isStatic) {
+                            staticFieldAndMethods = fmht;
+                        } else {
+                            fieldAndMethods = fmht;
+                        }
+                    }
+                    fmht.put(name, fam);
+                    ht.put(name, fam);
+                } else if (member instanceof Field) {
+                    Field oldField = (Field) member;
+                    // If this newly reflected field shadows an inherited field,
+                    // then replace it. Otherwise, since access to the field
+                    // would be ambiguous from Java, no field should be
+                    // reflected.
+                    // For now, the first field found wins, unless another field
+                    // explicitly shadows it.
+                    if (oldField.getDeclaringClass().
+                            isAssignableFrom(field.getDeclaringClass()))
+                    {
+                        ht.put(name, field);
+                    }
+                } else {
+                    // "unknown member type"
+                    Kit.codeBug();
+                }
+            } catch (SecurityException e) {
+                // skip this field
+                Context.reportWarning("Could not access field "
+                        + name + " of class " + cl.getName() +
+                        " due to lack of privileges.");
+            }
+        }
+
+        // Create bean properties from corresponding get/set methods first for
+        // static members and then for instance members
+        for (int tableCursor = 0; tableCursor != 2; ++tableCursor) {
+            boolean isStatic = (tableCursor == 0);
+            Map ht = isStatic ? staticMembers : members;
+
+            Map toAdd = new HashMap();
+
+            // Now, For each member, make "bean" properties.
+            for (String name: ht.keySet()) {
+                // Is this a getter?
+                boolean memberIsGetMethod = name.startsWith("get");
+                boolean memberIsSetMethod = name.startsWith("set");
+                boolean memberIsIsMethod = name.startsWith("is");
+                if (memberIsGetMethod || memberIsIsMethod 
+                        || memberIsSetMethod) {
+                    // Double check name component.
+                    String nameComponent
+                        = name.substring(memberIsIsMethod ? 2 : 3);
+                    if (nameComponent.length() == 0)
+                        continue;
+
+                    // Make the bean property name.
+                    String beanPropertyName = nameComponent;
+                    char ch0 = nameComponent.charAt(0);
+                    if (Character.isUpperCase(ch0)) {
+                        if (nameComponent.length() == 1) {
+                            beanPropertyName = nameComponent.toLowerCase();
+                        } else {
+                            char ch1 = nameComponent.charAt(1);
+                            if (!Character.isUpperCase(ch1)) {
+                                beanPropertyName = Character.toLowerCase(ch0)
+                                                   +nameComponent.substring(1);
+                            }
+                        }
+                    }
+
+                    // If we already have a member by this name, don't do this
+                    // property.
+                    if (toAdd.containsKey(beanPropertyName))
+                        continue;
+                    Object v = ht.get(beanPropertyName);
+                    if (v != null) {
+                        // A private field shouldn't mask a public getter/setter
+                        if (!includePrivate || !(v instanceof Member) ||
+                            !Modifier.isPrivate(((Member)v).getModifiers()))
+
+                        {
+                            continue;
+                        }
+                    }
+
+                    // Find the getter method, or if there is none, the is-
+                    // method.
+                    MemberBox getter = null;
+                    getter = findGetter(isStatic, ht, "get", nameComponent);
+                    // If there was no valid getter, check for an is- method.
+                    if (getter == null) {
+                        getter = findGetter(isStatic, ht, "is", nameComponent);
+                    }
+
+                    // setter
+                    MemberBox setter = null;
+                    NativeJavaMethod setters = null;
+                    String setterName = "set".concat(nameComponent);
+
+                    if (ht.containsKey(setterName)) {
+                        // Is this value a method?
+                        Object member = ht.get(setterName);
+                        if (member instanceof NativeJavaMethod) {
+                            NativeJavaMethod njmSet = (NativeJavaMethod)member;
+                            if (getter != null) {
+                                // We have a getter. Now, do we have a matching 
+                                // setter?
+                                Class type = getter.method().getReturnType();
+                                setter = extractSetMethod(type, njmSet.methods,
+                                                            isStatic);
+                            } else {
+                                // No getter, find any set method
+                                setter = extractSetMethod(njmSet.methods, 
+                                                            isStatic);
+                            }
+                            if (njmSet.methods.length > 1) {
+                                setters = njmSet;
+                            }
+                        }
+                    }
+                    // Make the property.
+                    BeanProperty bp = new BeanProperty(getter, setter,
+                                                       setters);
+                    toAdd.put(beanPropertyName, bp);
+                }
+            }
+
+            // Add the new bean properties.
+            for (String key: toAdd.keySet()) {
+                Object value = toAdd.get(key);
+                ht.put(key, value);
+            }
+        }
+
+        // Reflect constructors
+        Constructor[] constructors = getAccessibleConstructors();
+        ctors = new MemberBox[constructors.length];
+        for (int i = 0; i != constructors.length; ++i) {
+            ctors[i] = new MemberBox(constructors[i]);
+        }
+    }
+
+    private Constructor[] getAccessibleConstructors()
+    {
+      // The JVM currently doesn't allow changing access on java.lang.Class
+      // constructors, so don't try
+      if (includePrivate && cl != ScriptRuntime.ClassClass) {
+          try {
+              Constructor[] cons = cl.getDeclaredConstructors();
+              Constructor.setAccessible(cons, true);
+
+              return cons;
+          } catch (SecurityException e) {
+              // Fall through to !includePrivate case
+              Context.reportWarning("Could not access constructor " +
+                    " of class " + cl.getName() +
+                    " due to lack of privileges.");
+          }
+      }
+      return cl.getConstructors();
+    }
+
+    private Field[] getAccessibleFields() {
+        if (includePrivate) {
+            try {
+                List fieldsList = new ArrayList();
+                Class currentClass = cl;
+
+                while (currentClass != null) {
+                    // get all declared fields in this class, make them
+                    // accessible, and save
+                    Field[] declared = currentClass.getDeclaredFields();
+                    for (int i = 0; i < declared.length; i++) {
+                        declared[i].setAccessible(true);
+                        fieldsList.add(declared[i]);
+                    }
+                    // walk up superclass chain.  no need to deal specially with
+                    // interfaces, since they can't have fields
+                    currentClass = currentClass.getSuperclass();
+                }
+
+                return fieldsList.toArray(new Field[fieldsList.size()]);
+            } catch (SecurityException e) {
+                // fall through to !includePrivate case
+            }
+        }
+        return cl.getFields();
+    }
+
+    private MemberBox findGetter(boolean isStatic, Map ht, String prefix,
+                                 String propertyName)
+    {
+        String getterName = prefix.concat(propertyName);
+        if (ht.containsKey(getterName)) {
+            // Check that the getter is a method.
+            Object member = ht.get(getterName);
+            if (member instanceof NativeJavaMethod) {
+                NativeJavaMethod njmGet = (NativeJavaMethod) member;
+                return extractGetMethod(njmGet.methods, isStatic);
+            }
+        }
+        return null;
+    }
+
+    private static MemberBox extractGetMethod(MemberBox[] methods,
+                                              boolean isStatic)
+    {
+        // Inspect the list of all MemberBox for the only one having no
+        // parameters
+        for (int methodIdx = 0; methodIdx < methods.length; methodIdx++) {
+            MemberBox method = methods[methodIdx];
+            // Does getter method have an empty parameter list with a return
+            // value (eg. a getSomething() or isSomething())?
+            if (method.argTypes.length == 0
+                && (!isStatic || method.isStatic()))
+            {
+                Class type = method.method().getReturnType();
+                if (type != Void.TYPE) {
+                    return method;
+                }
+                break;
+            }
+        }
+        return null;
+    }
+
+    private static MemberBox extractSetMethod(Class type, MemberBox[] methods,
+                                              boolean isStatic)
+    {
+        //
+        // Note: it may be preferable to allow NativeJavaMethod.findFunction()
+        //       to find the appropriate setter; unfortunately, it requires an
+        //       instance of the target arg to determine that.
+        //
+
+        // Make two passes: one to find a method with direct type assignment,
+        // and one to find a widening conversion.
+        for (int pass = 1; pass <= 2; ++pass) {
+            for (int i = 0; i < methods.length; ++i) {
+                MemberBox method = methods[i];
+                if (!isStatic || method.isStatic()) {
+                    Class[] params = method.argTypes;
+                    if (params.length == 1) {
+                        if (pass == 1) {
+                            if (params[0] == type) {
+                                return method;
+                            }
+                        } else {
+                            if (pass != 2) Kit.codeBug();
+                            if (params[0].isAssignableFrom(type)) {
+                                return method;
+                            }
+                        }
+                    }
+                }
+            }
+        }
+        return null;
+    }
+
+    private static MemberBox extractSetMethod(MemberBox[] methods,
+                                              boolean isStatic)
+    {
+
+        for (int i = 0; i < methods.length; ++i) {
+            MemberBox method = methods[i];
+            if (!isStatic || method.isStatic()) {
+                if (method.method().getReturnType() == Void.TYPE) {
+                    if (method.argTypes.length == 1) {
+                        return method;
+                    }
+                }
+            }
+        }
+        return null;
+    }
+
+    Map getFieldAndMethodsObjects(Scriptable scope,
+            Object javaObject, boolean isStatic)
+    {
+        Map ht = isStatic ? staticFieldAndMethods : fieldAndMethods;
+        if (ht == null)
+            return null;
+        int len = ht.size();
+        Map result = new HashMap(len);
+        for (FieldAndMethods fam: ht.values()) {
+            FieldAndMethods famNew = new FieldAndMethods(scope, fam.methods,
+                                                         fam.field);
+            famNew.javaObject = javaObject;
+            result.put(fam.field.getName(), famNew);
+        }
+        return result;
+    }
+
+    static JavaMembers lookupClass(Scriptable scope, Class dynamicType,
+                                   Class staticType, boolean includeProtected)
+    {
+        JavaMembers members;
+        scope = ScriptableObject.getTopLevelScope(scope);
+        ClassCache cache = ClassCache.get(scope);
+        Map,JavaMembers> ct = cache.getClassCacheMap();
+
+        Class cl = dynamicType;
+        for (;;) {
+            members = ct.get(cl);
+            if (members != null) {
+                return members;
+            }
+            try {
+                members = new JavaMembers(scope, cl, includeProtected);
+                break;
+            } catch (SecurityException e) {
+                // Reflection may fail for objects that are in a restricted
+                // access package (e.g. sun.*).  If we get a security
+                // exception, try again with the static type if it is interface.
+                // Otherwise, try superclass
+                if (staticType != null && staticType.isInterface()) {
+                    cl = staticType;
+                    staticType = null; // try staticType only once
+                } else {
+                    Class parent = cl.getSuperclass();
+                    if (parent == null) {
+                        if (cl.isInterface()) {
+                            // last resort after failed staticType interface
+                            parent = ScriptRuntime.ObjectClass;
+                        } else {
+                            throw e;
+                        }
+                    }
+                    cl = parent;
+                }
+            }
+        }
+
+        if (cache.isCachingEnabled())
+            ct.put(cl, members);
+        return members;
+    }
+
+    RuntimeException reportMemberNotFound(String memberName)
+    {
+        return Context.reportRuntimeError2(
+            "msg.java.member.not.found", cl.getName(), memberName);
+    }
+
+    private Class cl;
+    private Map members;
+    private Map fieldAndMethods;
+    private Map staticMembers;
+    private Map staticFieldAndMethods;
+    MemberBox[] ctors;
+    private boolean includePrivate;
+}
+
+class BeanProperty
+{
+    BeanProperty(MemberBox getter, MemberBox setter, NativeJavaMethod setters)
+    {
+        this.getter = getter;
+        this.setter = setter;
+        this.setters = setters;
+    }
+
+    MemberBox getter;
+    MemberBox setter;
+    NativeJavaMethod setters;
+}
+
+class FieldAndMethods extends NativeJavaMethod
+{
+    static final long serialVersionUID = -9222428244284796755L;
+
+    FieldAndMethods(Scriptable scope, MemberBox[] methods, Field field)
+    {
+        super(methods);
+        this.field = field;
+        setParentScope(scope);
+        setPrototype(ScriptableObject.getFunctionPrototype(scope));
+    }
+
+    @Override
+    public Object getDefaultValue(Class hint)
+    {
+        if (hint == ScriptRuntime.FunctionClass)
+            return this;
+        Object rval;
+        Class type;
+        try {
+            rval = field.get(javaObject);
+            type = field.getType();
+        } catch (IllegalAccessException accEx) {
+            throw Context.reportRuntimeError1(
+                "msg.java.internal.private", field.getName());
+        }
+        Context cx  = Context.getContext();
+        rval = cx.getWrapFactory().wrap(cx, this, rval, type);
+        if (rval instanceof Scriptable) {
+            rval = ((Scriptable) rval).getDefaultValue(hint);
+        }
+        return rval;
+    }
+
+    Field field;
+    Object javaObject;
+}
diff --git a/org/mozilla/javascript/JavaScriptException.java b/org/mozilla/javascript/JavaScriptException.java
new file mode 100644
index 0000000..99d696e
--- /dev/null
+++ b/org/mozilla/javascript/JavaScriptException.java
@@ -0,0 +1,118 @@
+/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Rhino code, released
+ * May 6, 1999.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1997-1999
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Norris Boyd
+ *   Bojan Cekrlic
+ *   Hannes Wallnoefer
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * the GNU General Public License Version 2 or later (the "GPL"), in which
+ * case the provisions of the GPL are applicable instead of those above. If
+ * you wish to allow use of your version of this file only under the terms of
+ * the GPL and not to allow others to use your version of this file under the
+ * MPL, indicate your decision by deleting the provisions above and replacing
+ * them with the notice and other provisions required by the GPL. If you do
+ * not delete the provisions above, a recipient may use your version of this
+ * file under either the MPL or the GPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+// API class
+
+package org.mozilla.javascript;
+
+/**
+ * Java reflection of JavaScript exceptions.
+ * Instances of this class are thrown by the JavaScript 'throw' keyword.
+ *
+ * @author Mike McCabe
+ */
+public class JavaScriptException extends RhinoException
+{
+    static final long serialVersionUID = -7666130513694669293L;
+
+    /**
+     * @deprecated
+     * Use {@link WrappedException#WrappedException(Throwable)} to report
+     * exceptions in Java code.
+     */
+    public JavaScriptException(Object value)
+    {
+        this(value, "", 0);
+    }
+
+    /**
+     * Create a JavaScript exception wrapping the given JavaScript value
+     *
+     * @param value the JavaScript value thrown.
+     */
+    public JavaScriptException(Object value, String sourceName, int lineNumber)
+    {
+        recordErrorOrigin(sourceName, lineNumber, null, 0);
+        this.value = value;
+    }
+
+    @Override
+    public String details()
+    {
+       try {
+           return ScriptRuntime.toString(value);
+       } catch (RuntimeException rte) {
+           // ScriptRuntime.toString may throw a RuntimeException
+           if (value == null) {
+               return "null";
+           } else if (value instanceof Scriptable) {
+               return ScriptRuntime.defaultObjectToString((Scriptable)value);
+           } else {
+               return value.toString();
+           }
+       }
+    }
+
+    /**
+     * @return the value wrapped by this exception
+     */
+    public Object getValue()
+    {
+        return value;
+    }
+
+    /**
+     * @deprecated Use {@link RhinoException#sourceName()} from the super class.
+     */
+    public String getSourceName()
+    {
+        return sourceName();
+    }
+
+    /**
+     * @deprecated Use {@link RhinoException#lineNumber()} from the super class.
+     */
+    public int getLineNumber()
+    {
+        return lineNumber();
+    }
+
+    private Object value;
+}
diff --git a/org/mozilla/javascript/Kit.java b/org/mozilla/javascript/Kit.java
new file mode 100644
index 0000000..6c9b696
--- /dev/null
+++ b/org/mozilla/javascript/Kit.java
@@ -0,0 +1,455 @@
+/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Rhino code, released
+ * May 6, 1999.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1997-1999
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Igor Bukanov, igor@fastmail.fm
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * the GNU General Public License Version 2 or later (the "GPL"), in which
+ * case the provisions of the GPL are applicable instead of those above. If
+ * you wish to allow use of your version of this file only under the terms of
+ * the GPL and not to allow others to use your version of this file under the
+ * MPL, indicate your decision by deleting the provisions above and replacing
+ * them with the notice and other provisions required by the GPL. If you do
+ * not delete the provisions above, a recipient may use your version of this
+ * file under either the MPL or the GPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+package org.mozilla.javascript;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Reader;
+import java.lang.reflect.Method;
+import java.util.Map;
+
+/**
+ * Collection of utilities
+ */
+
+public class Kit
+{
+    /**
+     * Reflection of Throwable.initCause(Throwable) from JDK 1.4
+     * or nul if it is not available.
+     */
+    private static Method Throwable_initCause = null;
+
+    static {
+        // Are we running on a JDK 1.4 or later system?
+        try {
+            Class ThrowableClass = Kit.classOrNull("java.lang.Throwable");
+            Class[] signature = { ThrowableClass };
+            Throwable_initCause
+                = ThrowableClass.getMethod("initCause", signature);
+        } catch (Exception ex) {
+            // Assume any exceptions means the method does not exist.
+        }
+    }
+
+    public static Class classOrNull(String className)
+    {
+        try {
+            return Class.forName(className);
+        } catch  (ClassNotFoundException ex) {
+        } catch  (SecurityException ex) {
+        } catch  (LinkageError ex) {
+        } catch (IllegalArgumentException e) {
+            // Can be thrown if name has characters that a class name
+            // can not contain
+        }
+        return null;
+    }
+
+    /**
+     * Attempt to load the class of the given name. Note that the type parameter
+     * isn't checked.
+     */
+    public static Class classOrNull(ClassLoader loader, String className)
+    {
+        try {
+            return loader.loadClass(className);
+        } catch (ClassNotFoundException ex) {
+        } catch (SecurityException ex) {
+        } catch (LinkageError ex) {
+        } catch (IllegalArgumentException e) {
+            // Can be thrown if name has characters that a class name
+            // can not contain
+        }
+        return null;
+    }
+
+    static Object newInstanceOrNull(Class cl)
+    {
+        try {
+            return cl.newInstance();
+        } catch (SecurityException x) {
+        } catch  (LinkageError ex) {
+        } catch (InstantiationException x) {
+        } catch (IllegalAccessException x) {
+        }
+        return null;
+    }
+
+    /**
+     * Check that testClass is accessible from the given loader.
+     */
+    static boolean testIfCanLoadRhinoClasses(ClassLoader loader)
+    {
+        Class testClass = ScriptRuntime.ContextFactoryClass;
+        Class x = Kit.classOrNull(loader, testClass.getName());
+        if (x != testClass) {
+            // The check covers the case when x == null =>
+            // loader does not know about testClass or the case
+            // when x != null && x != testClass =>
+            // loader loads a class unrelated to testClass
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * If initCause methods exists in Throwable, call
+     * ex.initCause(cause) or otherwise do nothing.
+     * @return The ex argument.
+     */
+    public static RuntimeException initCause(RuntimeException ex,
+                                             Throwable cause)
+    {
+        if (Throwable_initCause != null) {
+            Object[] args = { cause };
+            try {
+                Throwable_initCause.invoke(ex, args);
+            } catch (Exception e) {
+                // Ignore any exceptions
+            }
+        }
+        return ex;
+    }
+
+    /**
+     * If character c is a hexadecimal digit, return
+     * accumulator * 16 plus corresponding
+     * number. Otherise return -1.
+     */
+    public static int xDigitToInt(int c, int accumulator)
+    {
+        check: {
+            // Use 0..9 < A..Z < a..z
+            if (c <= '9') {
+                c -= '0';
+                if (0 <= c) { break check; }
+            } else if (c <= 'F') {
+                if ('A' <= c) {
+                    c -= ('A' - 10);
+                    break check;
+                }
+            } else if (c <= 'f') {
+                if ('a' <= c) {
+                    c -= ('a' - 10);
+                    break check;
+                }
+            }
+            return -1;
+        }
+        return (accumulator << 4) | c;
+    }
+
+    /**
+     * Add listener to bag of listeners.
+     * The function does not modify bag and return a new collection
+     * containing listener and all listeners from bag.
+     * Bag without listeners always represented as the null value.
+     * 

+ * Usage example: + *

+     *     private volatile Object changeListeners;
+     *
+     *     public void addMyListener(PropertyChangeListener l)
+     *     {
+     *         synchronized (this) {
+     *             changeListeners = Kit.addListener(changeListeners, l);
+     *         }
+     *     }
+     *
+     *     public void removeTextListener(PropertyChangeListener l)
+     *     {
+     *         synchronized (this) {
+     *             changeListeners = Kit.removeListener(changeListeners, l);
+     *         }
+     *     }
+     *
+     *     public void fireChangeEvent(Object oldValue, Object newValue)
+     *     {
+     *     // Get immune local copy
+     *         Object listeners = changeListeners;
+     *         if (listeners != null) {
+     *             PropertyChangeEvent e = new PropertyChangeEvent(
+     *                 this, "someProperty" oldValue, newValue);
+     *             for (int i = 0; ; ++i) {
+     *                 Object l = Kit.getListener(listeners, i);
+     *                 if (l == null)
+     *                     break;
+     *                 ((PropertyChangeListener)l).propertyChange(e);
+     *             }
+     *         }
+     *     }
+     * 
+ * + * @param listener Listener to add to bag + * @param bag Current collection of listeners. + * @return A new bag containing all listeners from bag and + * listener. + * @see #removeListener(Object bag, Object listener) + * @see #getListener(Object bag, int index) + */ + public static Object addListener(Object bag, Object listener) + { + if (listener == null) throw new IllegalArgumentException(); + if (listener instanceof Object[]) throw new IllegalArgumentException(); + + if (bag == null) { + bag = listener; + } else if (!(bag instanceof Object[])) { + bag = new Object[] { bag, listener }; + } else { + Object[] array = (Object[])bag; + int L = array.length; + // bag has at least 2 elements if it is array + if (L < 2) throw new IllegalArgumentException(); + Object[] tmp = new Object[L + 1]; + System.arraycopy(array, 0, tmp, 0, L); + tmp[L] = listener; + bag = tmp; + } + + return bag; + } + + /** + * Remove listener from bag of listeners. + * The function does not modify bag and return a new collection + * containing all listeners from bag except listener. + * If bag does not contain listener, the function returns + * bag. + *

+ * For usage example, see {@link #addListener(Object bag, Object listener)}. + * + * @param listener Listener to remove from bag + * @param bag Current collection of listeners. + * @return A new bag containing all listeners from bag except + * listener. + * @see #addListener(Object bag, Object listener) + * @see #getListener(Object bag, int index) + */ + public static Object removeListener(Object bag, Object listener) + { + if (listener == null) throw new IllegalArgumentException(); + if (listener instanceof Object[]) throw new IllegalArgumentException(); + + if (bag == listener) { + bag = null; + } else if (bag instanceof Object[]) { + Object[] array = (Object[])bag; + int L = array.length; + // bag has at least 2 elements if it is array + if (L < 2) throw new IllegalArgumentException(); + if (L == 2) { + if (array[1] == listener) { + bag = array[0]; + } else if (array[0] == listener) { + bag = array[1]; + } + } else { + int i = L; + do { + --i; + if (array[i] == listener) { + Object[] tmp = new Object[L - 1]; + System.arraycopy(array, 0, tmp, 0, i); + System.arraycopy(array, i + 1, tmp, i, L - (i + 1)); + bag = tmp; + break; + } + } while (i != 0); + } + } + + return bag; + } + + /** + * Get listener at index position in bag or null if + * index equals to number of listeners in bag. + *

+ * For usage example, see {@link #addListener(Object bag, Object listener)}. + * + * @param bag Current collection of listeners. + * @param index Index of the listener to access. + * @return Listener at the given index or null. + * @see #addListener(Object bag, Object listener) + * @see #removeListener(Object bag, Object listener) + */ + public static Object getListener(Object bag, int index) + { + if (index == 0) { + if (bag == null) + return null; + if (!(bag instanceof Object[])) + return bag; + Object[] array = (Object[])bag; + // bag has at least 2 elements if it is array + if (array.length < 2) throw new IllegalArgumentException(); + return array[0]; + } else if (index == 1) { + if (!(bag instanceof Object[])) { + if (bag == null) throw new IllegalArgumentException(); + return null; + } + Object[] array = (Object[])bag; + // the array access will check for index on its own + return array[1]; + } else { + // bag has to array + Object[] array = (Object[])bag; + int L = array.length; + if (L < 2) throw new IllegalArgumentException(); + if (index == L) + return null; + return array[index]; + } + } + + static Object initHash(Map h, Object key, Object initialValue) + { + synchronized (h) { + Object current = h.get(key); + if (current == null) { + h.put(key, initialValue); + } else { + initialValue = current; + } + } + return initialValue; + } + + private final static class ComplexKey + { + private Object key1; + private Object key2; + private int hash; + + ComplexKey(Object key1, Object key2) + { + this.key1 = key1; + this.key2 = key2; + } + + @Override + public boolean equals(Object anotherObj) + { + if (!(anotherObj instanceof ComplexKey)) + return false; + ComplexKey another = (ComplexKey)anotherObj; + return key1.equals(another.key1) && key2.equals(another.key2); + } + + @Override + public int hashCode() + { + if (hash == 0) { + hash = key1.hashCode() ^ key2.hashCode(); + } + return hash; + } + } + + public static Object makeHashKeyFromPair(Object key1, Object key2) + { + if (key1 == null) throw new IllegalArgumentException(); + if (key2 == null) throw new IllegalArgumentException(); + return new ComplexKey(key1, key2); + } + + public static String readReader(Reader r) + throws IOException + { + char[] buffer = new char[512]; + int cursor = 0; + for (;;) { + int n = r.read(buffer, cursor, buffer.length - cursor); + if (n < 0) { break; } + cursor += n; + if (cursor == buffer.length) { + char[] tmp = new char[buffer.length * 2]; + System.arraycopy(buffer, 0, tmp, 0, cursor); + buffer = tmp; + } + } + return new String(buffer, 0, cursor); + } + + public static byte[] readStream(InputStream is, int initialBufferCapacity) + throws IOException + { + if (initialBufferCapacity <= 0) { + throw new IllegalArgumentException( + "Bad initialBufferCapacity: "+initialBufferCapacity); + } + byte[] buffer = new byte[initialBufferCapacity]; + int cursor = 0; + for (;;) { + int n = is.read(buffer, cursor, buffer.length - cursor); + if (n < 0) { break; } + cursor += n; + if (cursor == buffer.length) { + byte[] tmp = new byte[buffer.length * 2]; + System.arraycopy(buffer, 0, tmp, 0, cursor); + buffer = tmp; + } + } + if (cursor != buffer.length) { + byte[] tmp = new byte[cursor]; + System.arraycopy(buffer, 0, tmp, 0, cursor); + buffer = tmp; + } + return buffer; + } + + /** + * Throws RuntimeException to indicate failed assertion. + * The function never returns and its return type is RuntimeException + * only to be able to write throw Kit.codeBug() if plain + * Kit.codeBug() triggers unreachable code error. + */ + public static RuntimeException codeBug() + throws RuntimeException + { + RuntimeException ex = new IllegalStateException("FAILED ASSERTION"); + // Print stack trace ASAP + ex.printStackTrace(System.err); + throw ex; + } +} + diff --git a/org/mozilla/javascript/LazilyLoadedCtor.java b/org/mozilla/javascript/LazilyLoadedCtor.java new file mode 100644 index 0000000..d6df9e2 --- /dev/null +++ b/org/mozilla/javascript/LazilyLoadedCtor.java @@ -0,0 +1,141 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-2000 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Norris Boyd + * Igor Bukanov + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +package org.mozilla.javascript; + +import java.lang.reflect.*; + +/** + * Avoid loading classes unless they are used. + * + *

This improves startup time and average memory usage. + */ +public final class LazilyLoadedCtor implements java.io.Serializable { + private static final long serialVersionUID = 1L; + + private static final int STATE_BEFORE_INIT = 0; + private static final int STATE_INITIALIZING = 1; + private static final int STATE_WITH_VALUE = 2; + + private final ScriptableObject scope; + private final String propertyName; + private final String className; + private final boolean sealed; + private Object initializedValue; + private int state; + + public LazilyLoadedCtor(ScriptableObject scope, String propertyName, + String className, boolean sealed) + { + + this.scope = scope; + this.propertyName = propertyName; + this.className = className; + this.sealed = sealed; + this.state = STATE_BEFORE_INIT; + + scope.addLazilyInitializedValue(propertyName, 0, this, + ScriptableObject.DONTENUM); + } + + void init() + { + synchronized (this) { + if (state == STATE_INITIALIZING) + throw new IllegalStateException( + "Recursive initialization for "+propertyName); + if (state == STATE_BEFORE_INIT) { + state = STATE_INITIALIZING; + // Set value now to have something to set in finally block if + // buildValue throws. + Object value = Scriptable.NOT_FOUND; + try { + value = buildValue(); + } finally { + initializedValue = value; + state = STATE_WITH_VALUE; + } + } + } + } + + Object getValue() + { + if (state != STATE_WITH_VALUE) + throw new IllegalStateException(propertyName); + return initializedValue; + } + + private Object buildValue() + { + Class cl = cast(Kit.classOrNull(className)); + if (cl != null) { + try { + Object value = ScriptableObject.buildClassCtor(scope, cl, + sealed, false); + if (value != null) { + return value; + } + else { + // cl has own static initializer which is expected + // to set the property on its own. + value = scope.get(propertyName, scope); + if (value != Scriptable.NOT_FOUND) + return value; + } + } catch (InvocationTargetException ex) { + Throwable target = ex.getTargetException(); + if (target instanceof RuntimeException) { + throw (RuntimeException)target; + } + } catch (RhinoException ex) { + } catch (InstantiationException ex) { + } catch (IllegalAccessException ex) { + } catch (SecurityException ex) { + } + } + return Scriptable.NOT_FOUND; + } + + @SuppressWarnings({"unchecked"}) + private Class cast(Class cl) { + return (Class)cl; + } + +} diff --git a/org/mozilla/javascript/MemberBox.java b/org/mozilla/javascript/MemberBox.java new file mode 100644 index 0000000..8a50fe8 --- /dev/null +++ b/org/mozilla/javascript/MemberBox.java @@ -0,0 +1,372 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-1999 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Felix Meschberger + * Norris Boyd + * Ulrike Mueller + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +package org.mozilla.javascript; + +import java.lang.reflect.*; +import java.io.*; + +/** + * Wrappper class for Method and Constructor instances to cache + * getParameterTypes() results, recover from IllegalAccessException + * in some cases and provide serialization support. + * + * @author Igor Bukanov + */ + +final class MemberBox implements Serializable +{ + static final long serialVersionUID = 6358550398665688245L; + + private transient Member memberObject; + transient Class[] argTypes; + transient Object delegateTo; + transient boolean vararg; + + + MemberBox(Method method) + { + init(method); + } + + MemberBox(Constructor constructor) + { + init(constructor); + } + + private void init(Method method) + { + this.memberObject = method; + this.argTypes = method.getParameterTypes(); + this.vararg = VMBridge.instance.isVarArgs(method); + } + + private void init(Constructor constructor) + { + this.memberObject = constructor; + this.argTypes = constructor.getParameterTypes(); + this.vararg = VMBridge.instance.isVarArgs(constructor); + } + + Method method() + { + return (Method)memberObject; + } + + Constructor ctor() + { + return (Constructor)memberObject; + } + + Member member() + { + return memberObject; + } + + boolean isMethod() + { + return memberObject instanceof Method; + } + + boolean isCtor() + { + return memberObject instanceof Constructor; + } + + boolean isStatic() + { + return Modifier.isStatic(memberObject.getModifiers()); + } + + String getName() + { + return memberObject.getName(); + } + + Class getDeclaringClass() + { + return memberObject.getDeclaringClass(); + } + + String toJavaDeclaration() + { + StringBuffer sb = new StringBuffer(); + if (isMethod()) { + Method method = method(); + sb.append(method.getReturnType()); + sb.append(' '); + sb.append(method.getName()); + } else { + Constructor ctor = ctor(); + String name = ctor.getDeclaringClass().getName(); + int lastDot = name.lastIndexOf('.'); + if (lastDot >= 0) { + name = name.substring(lastDot + 1); + } + sb.append(name); + } + sb.append(JavaMembers.liveConnectSignature(argTypes)); + return sb.toString(); + } + + @Override + public String toString() + { + return memberObject.toString(); + } + + Object invoke(Object target, Object[] args) + { + Method method = method(); + try { + try { + return method.invoke(target, args); + } catch (IllegalAccessException ex) { + Method accessible = searchAccessibleMethod(method, argTypes); + if (accessible != null) { + memberObject = accessible; + method = accessible; + } else { + if (!VMBridge.instance.tryToMakeAccessible(method)) { + throw Context.throwAsScriptRuntimeEx(ex); + } + } + // Retry after recovery + return method.invoke(target, args); + } + } catch (InvocationTargetException ite) { + // Must allow ContinuationPending exceptions to propagate unhindered + Throwable e = ite; + do { + e = ((InvocationTargetException) e).getTargetException(); + } while ((e instanceof InvocationTargetException)); + if (e instanceof ContinuationPending) + throw (ContinuationPending) e; + throw Context.throwAsScriptRuntimeEx(e); + } catch (Exception ex) { + throw Context.throwAsScriptRuntimeEx(ex); + } + } + + Object newInstance(Object[] args) + { + Constructor ctor = ctor(); + try { + try { + return ctor.newInstance(args); + } catch (IllegalAccessException ex) { + if (!VMBridge.instance.tryToMakeAccessible(ctor)) { + throw Context.throwAsScriptRuntimeEx(ex); + } + } + return ctor.newInstance(args); + } catch (Exception ex) { + throw Context.throwAsScriptRuntimeEx(ex); + } + } + + private static Method searchAccessibleMethod(Method method, Class[] params) + { + int modifiers = method.getModifiers(); + if (Modifier.isPublic(modifiers) && !Modifier.isStatic(modifiers)) { + Class c = method.getDeclaringClass(); + if (!Modifier.isPublic(c.getModifiers())) { + String name = method.getName(); + Class[] intfs = c.getInterfaces(); + for (int i = 0, N = intfs.length; i != N; ++i) { + Class intf = intfs[i]; + if (Modifier.isPublic(intf.getModifiers())) { + try { + return intf.getMethod(name, params); + } catch (NoSuchMethodException ex) { + } catch (SecurityException ex) { } + } + } + for (;;) { + c = c.getSuperclass(); + if (c == null) { break; } + if (Modifier.isPublic(c.getModifiers())) { + try { + Method m = c.getMethod(name, params); + int mModifiers = m.getModifiers(); + if (Modifier.isPublic(mModifiers) + && !Modifier.isStatic(mModifiers)) + { + return m; + } + } catch (NoSuchMethodException ex) { + } catch (SecurityException ex) { } + } + } + } + } + return null; + } + + private void readObject(ObjectInputStream in) + throws IOException, ClassNotFoundException + { + in.defaultReadObject(); + Member member = readMember(in); + if (member instanceof Method) { + init((Method)member); + } else { + init((Constructor)member); + } + } + + private void writeObject(ObjectOutputStream out) + throws IOException + { + out.defaultWriteObject(); + writeMember(out, memberObject); + } + + /** + * Writes a Constructor or Method object. + * + * Methods and Constructors are not serializable, so we must serialize + * information about the class, the name, and the parameters and + * recreate upon deserialization. + */ + private static void writeMember(ObjectOutputStream out, Member member) + throws IOException + { + if (member == null) { + out.writeBoolean(false); + return; + } + out.writeBoolean(true); + if (!(member instanceof Method || member instanceof Constructor)) + throw new IllegalArgumentException("not Method or Constructor"); + out.writeBoolean(member instanceof Method); + out.writeObject(member.getName()); + out.writeObject(member.getDeclaringClass()); + if (member instanceof Method) { + writeParameters(out, ((Method) member).getParameterTypes()); + } else { + writeParameters(out, ((Constructor) member).getParameterTypes()); + } + } + + /** + * Reads a Method or a Constructor from the stream. + */ + private static Member readMember(ObjectInputStream in) + throws IOException, ClassNotFoundException + { + if (!in.readBoolean()) + return null; + boolean isMethod = in.readBoolean(); + String name = (String) in.readObject(); + Class declaring = (Class) in.readObject(); + Class[] parms = readParameters(in); + try { + if (isMethod) { + return declaring.getMethod(name, parms); + } else { + return declaring.getConstructor(parms); + } + } catch (NoSuchMethodException e) { + throw new IOException("Cannot find member: " + e); + } + } + + private static final Class[] primitives = { + Boolean.TYPE, + Byte.TYPE, + Character.TYPE, + Double.TYPE, + Float.TYPE, + Integer.TYPE, + Long.TYPE, + Short.TYPE, + Void.TYPE + }; + + /** + * Writes an array of parameter types to the stream. + * + * Requires special handling because primitive types cannot be + * found upon deserialization by the default Java implementation. + */ + private static void writeParameters(ObjectOutputStream out, Class[] parms) + throws IOException + { + out.writeShort(parms.length); + outer: + for (int i=0; i < parms.length; i++) { + Class parm = parms[i]; + boolean primitive = parm.isPrimitive(); + out.writeBoolean(primitive); + if (!primitive) { + out.writeObject(parm); + continue; + } + for (int j=0; j < primitives.length; j++) { + if (parm.equals(primitives[j])) { + out.writeByte(j); + continue outer; + } + } + throw new IllegalArgumentException("Primitive " + parm + + " not found"); + } + } + + /** + * Reads an array of parameter types from the stream. + */ + private static Class[] readParameters(ObjectInputStream in) + throws IOException, ClassNotFoundException + { + Class[] result = new Class[in.readShort()]; + for (int i=0; i < result.length; i++) { + if (!in.readBoolean()) { + result[i] = (Class) in.readObject(); + continue; + } + result[i] = primitives[in.readByte()]; + } + return result; + } +} + diff --git a/org/mozilla/javascript/NativeArray.java b/org/mozilla/javascript/NativeArray.java new file mode 100644 index 0000000..dc0b0e6 --- /dev/null +++ b/org/mozilla/javascript/NativeArray.java @@ -0,0 +1,1745 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-1999 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Norris Boyd + * Mike McCabe + * Igor Bukanov + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +package org.mozilla.javascript; + +import java.util.Arrays; + +/** + * This class implements the Array native object. + * @author Norris Boyd + * @author Mike McCabe + */ +public class NativeArray extends IdScriptableObject +{ + static final long serialVersionUID = 7331366857676127338L; + + /* + * Optimization possibilities and open issues: + * - Long vs. double schizophrenia. I suspect it might be better + * to use double throughout. + * + * - Functions that need a new Array call "new Array" in the + * current scope rather than using a hardwired constructor; + * "Array" could be redefined. It turns out that js calls the + * equivalent of "new Array" in the current scope, except that it + * always gets at least an object back, even when Array == null. + */ + + private static final Object ARRAY_TAG = "Array"; + private static final Integer NEGATIVE_ONE = new Integer(-1); + + static void init(Scriptable scope, boolean sealed) + { + NativeArray obj = new NativeArray(0); + obj.exportAsJSClass(MAX_PROTOTYPE_ID, scope, sealed); + } + + static int getMaximumInitialCapacity() { + return maximumInitialCapacity; + } + + static void setMaximumInitialCapacity(int maximumInitialCapacity) { + NativeArray.maximumInitialCapacity = maximumInitialCapacity; + } + + public NativeArray(long lengthArg) + { + denseOnly = lengthArg <= maximumInitialCapacity; + if (denseOnly) { + int intLength = (int) lengthArg; + if (intLength < DEFAULT_INITIAL_CAPACITY) + intLength = DEFAULT_INITIAL_CAPACITY; + dense = new Object[intLength]; + Arrays.fill(dense, Scriptable.NOT_FOUND); + } + length = lengthArg; + } + + public NativeArray(Object[] array) + { + denseOnly = true; + dense = array; + length = array.length; + } + + @Override + public String getClassName() + { + return "Array"; + } + + private static final int + Id_length = 1, + MAX_INSTANCE_ID = 1; + + @Override + protected int getMaxInstanceId() + { + return MAX_INSTANCE_ID; + } + + @Override + protected int findInstanceIdInfo(String s) + { + if (s.equals("length")) { + return instanceIdInfo(DONTENUM | PERMANENT, Id_length); + } + return super.findInstanceIdInfo(s); + } + + @Override + protected String getInstanceIdName(int id) + { + if (id == Id_length) { return "length"; } + return super.getInstanceIdName(id); + } + + @Override + protected Object getInstanceIdValue(int id) + { + if (id == Id_length) { + return ScriptRuntime.wrapNumber(length); + } + return super.getInstanceIdValue(id); + } + + @Override + protected void setInstanceIdValue(int id, Object value) + { + if (id == Id_length) { + setLength(value); return; + } + super.setInstanceIdValue(id, value); + } + + @Override + protected void fillConstructorProperties(IdFunctionObject ctor) + { + addIdFunctionProperty(ctor, ARRAY_TAG, ConstructorId_join, + "join", 2); + addIdFunctionProperty(ctor, ARRAY_TAG, ConstructorId_reverse, + "reverse", 1); + addIdFunctionProperty(ctor, ARRAY_TAG, ConstructorId_sort, + "sort", 2); + addIdFunctionProperty(ctor, ARRAY_TAG, ConstructorId_push, + "push", 2); + addIdFunctionProperty(ctor, ARRAY_TAG, ConstructorId_pop, + "pop", 2); + addIdFunctionProperty(ctor, ARRAY_TAG, ConstructorId_shift, + "shift", 2); + addIdFunctionProperty(ctor, ARRAY_TAG, ConstructorId_unshift, + "unshift", 2); + addIdFunctionProperty(ctor, ARRAY_TAG, ConstructorId_splice, + "splice", 2); + addIdFunctionProperty(ctor, ARRAY_TAG, ConstructorId_concat, + "concat", 2); + addIdFunctionProperty(ctor, ARRAY_TAG, ConstructorId_slice, + "slice", 2); + addIdFunctionProperty(ctor, ARRAY_TAG, ConstructorId_indexOf, + "indexOf", 2); + addIdFunctionProperty(ctor, ARRAY_TAG, ConstructorId_lastIndexOf, + "lastIndexOf", 2); + addIdFunctionProperty(ctor, ARRAY_TAG, ConstructorId_every, + "every", 2); + addIdFunctionProperty(ctor, ARRAY_TAG, ConstructorId_filter, + "filter", 2); + addIdFunctionProperty(ctor, ARRAY_TAG, ConstructorId_forEach, + "forEach", 2); + addIdFunctionProperty(ctor, ARRAY_TAG, ConstructorId_map, + "map", 2); + addIdFunctionProperty(ctor, ARRAY_TAG, ConstructorId_some, + "some", 2); + super.fillConstructorProperties(ctor); + } + + @Override + protected void initPrototypeId(int id) + { + String s; + int arity; + switch (id) { + case Id_constructor: arity=1; s="constructor"; break; + case Id_toString: arity=0; s="toString"; break; + case Id_toLocaleString: arity=1; s="toLocaleString"; break; + case Id_toSource: arity=0; s="toSource"; break; + case Id_join: arity=1; s="join"; break; + case Id_reverse: arity=0; s="reverse"; break; + case Id_sort: arity=1; s="sort"; break; + case Id_push: arity=1; s="push"; break; + case Id_pop: arity=1; s="pop"; break; + case Id_shift: arity=1; s="shift"; break; + case Id_unshift: arity=1; s="unshift"; break; + case Id_splice: arity=1; s="splice"; break; + case Id_concat: arity=1; s="concat"; break; + case Id_slice: arity=1; s="slice"; break; + case Id_indexOf: arity=1; s="indexOf"; break; + case Id_lastIndexOf: arity=1; s="lastIndexOf"; break; + case Id_every: arity=1; s="every"; break; + case Id_filter: arity=1; s="filter"; break; + case Id_forEach: arity=1; s="forEach"; break; + case Id_map: arity=1; s="map"; break; + case Id_some: arity=1; s="some"; break; + default: throw new IllegalArgumentException(String.valueOf(id)); + } + initPrototypeMethod(ARRAY_TAG, id, s, arity); + } + + @Override + public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope, + Scriptable thisObj, Object[] args) + { + if (!f.hasTag(ARRAY_TAG)) { + return super.execIdCall(f, cx, scope, thisObj, args); + } + int id = f.methodId(); + again: + for (;;) { + switch (id) { + case ConstructorId_join: + case ConstructorId_reverse: + case ConstructorId_sort: + case ConstructorId_push: + case ConstructorId_pop: + case ConstructorId_shift: + case ConstructorId_unshift: + case ConstructorId_splice: + case ConstructorId_concat: + case ConstructorId_slice: + case ConstructorId_indexOf: + case ConstructorId_lastIndexOf: + case ConstructorId_every: + case ConstructorId_filter: + case ConstructorId_forEach: + case ConstructorId_map: + case ConstructorId_some: { + thisObj = ScriptRuntime.toObject(scope, args[0]); + Object[] newArgs = new Object[args.length-1]; + for (int i=0; i < newArgs.length; i++) + newArgs[i] = args[i+1]; + args = newArgs; + id = -id; + continue again; + } + + case Id_constructor: { + boolean inNewExpr = (thisObj == null); + if (!inNewExpr) { + // IdFunctionObject.construct will set up parent, proto + return f.construct(cx, scope, args); + } + return jsConstructor(cx, scope, args); + } + + case Id_toString: + return toStringHelper(cx, scope, thisObj, + cx.hasFeature(Context.FEATURE_TO_STRING_AS_SOURCE), false); + + case Id_toLocaleString: + return toStringHelper(cx, scope, thisObj, false, true); + + case Id_toSource: + return toStringHelper(cx, scope, thisObj, true, false); + + case Id_join: + return js_join(cx, thisObj, args); + + case Id_reverse: + return js_reverse(cx, thisObj, args); + + case Id_sort: + return js_sort(cx, scope, thisObj, args); + + case Id_push: + return js_push(cx, thisObj, args); + + case Id_pop: + return js_pop(cx, thisObj, args); + + case Id_shift: + return js_shift(cx, thisObj, args); + + case Id_unshift: + return js_unshift(cx, thisObj, args); + + case Id_splice: + return js_splice(cx, scope, thisObj, args); + + case Id_concat: + return js_concat(cx, scope, thisObj, args); + + case Id_slice: + return js_slice(cx, thisObj, args); + + case Id_indexOf: + return indexOfHelper(cx, thisObj, args, false); + + case Id_lastIndexOf: + return indexOfHelper(cx, thisObj, args, true); + + case Id_every: + case Id_filter: + case Id_forEach: + case Id_map: + case Id_some: + return iterativeMethod(cx, id, scope, thisObj, args); + } + throw new IllegalArgumentException(String.valueOf(id)); + } + } + + @Override + public Object get(int index, Scriptable start) + { + if (!denseOnly && isGetterOrSetter(null, index, false)) + return super.get(index, start); + if (dense != null && 0 <= index && index < dense.length) + return dense[index]; + return super.get(index, start); + } + + @Override + public boolean has(int index, Scriptable start) + { + if (!denseOnly && isGetterOrSetter(null, index, false)) + return super.has(index, start); + if (dense != null && 0 <= index && index < dense.length) + return dense[index] != NOT_FOUND; + return super.has(index, start); + } + + // if id is an array index (ECMA 15.4.0), return the number, + // otherwise return -1L + private static long toArrayIndex(String id) + { + double d = ScriptRuntime.toNumber(id); + if (d == d) { + long index = ScriptRuntime.toUint32(d); + if (index == d && index != 4294967295L) { + // Assume that ScriptRuntime.toString(index) is the same + // as java.lang.Long.toString(index) for long + if (Long.toString(index).equals(id)) { + return index; + } + } + } + return -1; + } + + @Override + public void put(String id, Scriptable start, Object value) + { + super.put(id, start, value); + if (start == this) { + // If the object is sealed, super will throw exception + long index = toArrayIndex(id); + if (index >= length) { + length = index + 1; + denseOnly = false; + } + } + } + + private boolean ensureCapacity(int capacity) + { + if (capacity > dense.length) { + if (capacity > MAX_PRE_GROW_SIZE) { + denseOnly = false; + return false; + } + capacity = Math.max(capacity, (int)(dense.length * GROW_FACTOR)); + Object[] newDense = new Object[capacity]; + System.arraycopy(dense, 0, newDense, 0, dense.length); + Arrays.fill(newDense, dense.length, newDense.length, + Scriptable.NOT_FOUND); + dense = newDense; + } + return true; + } + + @Override + public void put(int index, Scriptable start, Object value) + { + if (start == this && !isSealed() && dense != null && 0 <= index && + (denseOnly || !isGetterOrSetter(null, index, true))) + { + if (index < dense.length) { + dense[index] = value; + if (this.length <= index) + this.length = (long)index + 1; + return; + } else if (denseOnly && index < dense.length * GROW_FACTOR && + ensureCapacity(index+1)) + { + dense[index] = value; + this.length = (long)index + 1; + return; + } else { + denseOnly = false; + } + } + super.put(index, start, value); + if (start == this) { + // only set the array length if given an array index (ECMA 15.4.0) + if (this.length <= index) { + // avoid overflowing index! + this.length = (long)index + 1; + } + } + } + + @Override + public void delete(int index) + { + if (dense != null && 0 <= index && index < dense.length && + !isSealed() && (denseOnly || !isGetterOrSetter(null, index, true))) + { + dense[index] = NOT_FOUND; + } else { + super.delete(index); + } + } + + @Override + public Object[] getIds() + { + Object[] superIds = super.getIds(); + if (dense == null) { return superIds; } + int N = dense.length; + long currentLength = length; + if (N > currentLength) { + N = (int)currentLength; + } + if (N == 0) { return superIds; } + int superLength = superIds.length; + Object[] ids = new Object[N + superLength]; + + int presentCount = 0; + for (int i = 0; i != N; ++i) { + // Replace existing elements by their indexes + if (dense[i] != NOT_FOUND) { + ids[presentCount] = new Integer(i); + ++presentCount; + } + } + if (presentCount != N) { + // dense contains deleted elems, need to shrink the result + Object[] tmp = new Object[presentCount + superLength]; + System.arraycopy(ids, 0, tmp, 0, presentCount); + ids = tmp; + } + System.arraycopy(superIds, 0, ids, presentCount, superLength); + return ids; + } + + @Override + public Object getDefaultValue(Class hint) + { + if (hint == ScriptRuntime.NumberClass) { + Context cx = Context.getContext(); + if (cx.getLanguageVersion() == Context.VERSION_1_2) + return new Long(length); + } + return super.getDefaultValue(hint); + } + + /** + * See ECMA 15.4.1,2 + */ + private static Object jsConstructor(Context cx, Scriptable scope, + Object[] args) + { + if (args.length == 0) + return new NativeArray(0); + + // Only use 1 arg as first element for version 1.2; for + // any other version (including 1.3) follow ECMA and use it as + // a length. + if (cx.getLanguageVersion() == Context.VERSION_1_2) { + return new NativeArray(args); + } else { + Object arg0 = args[0]; + if (args.length > 1 || !(arg0 instanceof Number)) { + return new NativeArray(args); + } else { + long len = ScriptRuntime.toUint32(arg0); + if (len != ((Number)arg0).doubleValue()) + throw Context.reportRuntimeError0("msg.arraylength.bad"); + return new NativeArray(len); + } + } + } + + public long getLength() { + return length; + } + + /** @deprecated Use {@link #getLength()} instead. */ + public long jsGet_length() { + return getLength(); + } + + /** + * Change the value of the internal flag that determines whether all + * storage is handed by a dense backing array rather than an associative + * store. + * @param denseOnly new value for denseOnly flag + * @throws IllegalArgumentException if an attempt is made to enable + * denseOnly after it was disabled; NativeArray code is not written + * to handle switching back to a dense representation + */ + void setDenseOnly(boolean denseOnly) { + if (denseOnly && !this.denseOnly) + throw new IllegalArgumentException(); + this.denseOnly = denseOnly; + } + + private void setLength(Object val) { + /* XXX do we satisfy this? + * 15.4.5.1 [[Put]](P, V): + * 1. Call the [[CanPut]] method of A with name P. + * 2. If Result(1) is false, return. + * ? + */ + + double d = ScriptRuntime.toNumber(val); + long longVal = ScriptRuntime.toUint32(d); + if (longVal != d) + throw Context.reportRuntimeError0("msg.arraylength.bad"); + + if (denseOnly) { + if (longVal < length) { + // downcast okay because denseOnly + Arrays.fill(dense, (int) longVal, dense.length, NOT_FOUND); + length = longVal; + return; + } else if (longVal < MAX_PRE_GROW_SIZE && + longVal < (length * GROW_FACTOR) && + ensureCapacity((int)longVal)) + { + length = longVal; + return; + } else { + denseOnly = false; + } + } + if (longVal < length) { + // remove all properties between longVal and length + if (length - longVal > 0x1000) { + // assume that the representation is sparse + Object[] e = getIds(); // will only find in object itself + for (int i=0; i < e.length; i++) { + Object id = e[i]; + if (id instanceof String) { + // > MAXINT will appear as string + String strId = (String)id; + long index = toArrayIndex(strId); + if (index >= longVal) + delete(strId); + } else { + int index = ((Integer)id).intValue(); + if (index >= longVal) + delete(index); + } + } + } else { + // assume a dense representation + for (long i = longVal; i < length; i++) { + deleteElem(this, i); + } + } + } + length = longVal; + } + + /* Support for generic Array-ish objects. Most of the Array + * functions try to be generic; anything that has a length + * property is assumed to be an array. + * getLengthProperty returns 0 if obj does not have the length property + * or its value is not convertible to a number. + */ + static long getLengthProperty(Context cx, Scriptable obj) { + // These will both give numeric lengths within Uint32 range. + if (obj instanceof NativeString) { + return ((NativeString)obj).getLength(); + } else if (obj instanceof NativeArray) { + return ((NativeArray)obj).getLength(); + } + return ScriptRuntime.toUint32( + ScriptRuntime.getObjectProp(obj, "length", cx)); + } + + private static Object setLengthProperty(Context cx, Scriptable target, + long length) + { + return ScriptRuntime.setObjectProp( + target, "length", ScriptRuntime.wrapNumber(length), cx); + } + + /* Utility functions to encapsulate index > Integer.MAX_VALUE + * handling. Also avoids unnecessary object creation that would + * be necessary to use the general ScriptRuntime.get/setElem + * functions... though this is probably premature optimization. + */ + private static void deleteElem(Scriptable target, long index) { + int i = (int)index; + if (i == index) { target.delete(i); } + else { target.delete(Long.toString(index)); } + } + + private static Object getElem(Context cx, Scriptable target, long index) + { + if (index > Integer.MAX_VALUE) { + String id = Long.toString(index); + return ScriptRuntime.getObjectProp(target, id, cx); + } else { + return ScriptRuntime.getObjectIndex(target, (int)index, cx); + } + } + + private static void setElem(Context cx, Scriptable target, long index, + Object value) + { + if (index > Integer.MAX_VALUE) { + String id = Long.toString(index); + ScriptRuntime.setObjectProp(target, id, value, cx); + } else { + ScriptRuntime.setObjectIndex(target, (int)index, value, cx); + } + } + + private static String toStringHelper(Context cx, Scriptable scope, + Scriptable thisObj, + boolean toSource, boolean toLocale) + { + /* It's probably redundant to handle long lengths in this + * function; StringBuilders are limited to 2^31 in java. + */ + + long length = getLengthProperty(cx, thisObj); + + StringBuilder result = new StringBuilder(256); + + // whether to return '4,unquoted,5' or '[4, "quoted", 5]' + String separator; + + if (toSource) { + result.append('['); + separator = ", "; + } else { + separator = ","; + } + + boolean haslast = false; + long i = 0; + + boolean toplevel, iterating; + if (cx.iterating == null) { + toplevel = true; + iterating = false; + cx.iterating = new ObjToIntMap(31); + } else { + toplevel = false; + iterating = cx.iterating.has(thisObj); + } + + // Make sure cx.iterating is set to null when done + // so we don't leak memory + try { + if (!iterating) { + cx.iterating.put(thisObj, 0); // stop recursion. + for (i = 0; i < length; i++) { + if (i > 0) result.append(separator); + Object elem = getElem(cx, thisObj, i); + if (elem == null || elem == Undefined.instance) { + haslast = false; + continue; + } + haslast = true; + + if (toSource) { + result.append(ScriptRuntime.uneval(cx, scope, elem)); + + } else if (elem instanceof String) { + String s = (String)elem; + if (toSource) { + result.append('\"'); + result.append(ScriptRuntime.escapeString(s)); + result.append('\"'); + } else { + result.append(s); + } + + } else { + if (toLocale) + { + Callable fun; + Scriptable funThis; + fun = ScriptRuntime.getPropFunctionAndThis( + elem, "toLocaleString", cx); + funThis = ScriptRuntime.lastStoredScriptable(cx); + elem = fun.call(cx, scope, funThis, + ScriptRuntime.emptyArgs); + } + result.append(ScriptRuntime.toString(elem)); + } + } + } + } finally { + if (toplevel) { + cx.iterating = null; + } + } + + if (toSource) { + //for [,,].length behavior; we want toString to be symmetric. + if (!haslast && i > 0) + result.append(", ]"); + else + result.append(']'); + } + return result.toString(); + } + + /** + * See ECMA 15.4.4.3 + */ + private static String js_join(Context cx, Scriptable thisObj, + Object[] args) + { + long llength = getLengthProperty(cx, thisObj); + int length = (int)llength; + if (llength != length) { + throw Context.reportRuntimeError1( + "msg.arraylength.too.big", String.valueOf(llength)); + } + // if no args, use "," as separator + String separator = (args.length < 1 || args[0] == Undefined.instance) + ? "," + : ScriptRuntime.toString(args[0]); + if (thisObj instanceof NativeArray) { + NativeArray na = (NativeArray) thisObj; + if (na.denseOnly) { + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < length; i++) { + if (i != 0) { + sb.append(separator); + } + if (i < na.dense.length) { + Object temp = na.dense[i]; + if (temp != null && temp != Undefined.instance && + temp != Scriptable.NOT_FOUND) + { + sb.append(ScriptRuntime.toString(temp)); + } + } + } + return sb.toString(); + } + } + if (length == 0) { + return ""; + } + String[] buf = new String[length]; + int total_size = 0; + for (int i = 0; i != length; i++) { + Object temp = getElem(cx, thisObj, i); + if (temp != null && temp != Undefined.instance) { + String str = ScriptRuntime.toString(temp); + total_size += str.length(); + buf[i] = str; + } + } + total_size += (length - 1) * separator.length(); + StringBuilder sb = new StringBuilder(total_size); + for (int i = 0; i != length; i++) { + if (i != 0) { + sb.append(separator); + } + String str = buf[i]; + if (str != null) { + // str == null for undefined or null + sb.append(str); + } + } + return sb.toString(); + } + + /** + * See ECMA 15.4.4.4 + */ + private static Scriptable js_reverse(Context cx, Scriptable thisObj, + Object[] args) + { + if (thisObj instanceof NativeArray) { + NativeArray na = (NativeArray) thisObj; + if (na.denseOnly) { + for (int i=0, j=((int)na.length)-1; i < j; i++,j--) { + Object temp = na.dense[i]; + na.dense[i] = na.dense[j]; + na.dense[j] = temp; + } + return thisObj; + } + } + long len = getLengthProperty(cx, thisObj); + + long half = len / 2; + for(long i=0; i < half; i++) { + long j = len - i - 1; + Object temp1 = getElem(cx, thisObj, i); + Object temp2 = getElem(cx, thisObj, j); + setElem(cx, thisObj, i, temp2); + setElem(cx, thisObj, j, temp1); + } + return thisObj; + } + + /** + * See ECMA 15.4.4.5 + */ + private static Scriptable js_sort(Context cx, Scriptable scope, + Scriptable thisObj, Object[] args) + { + long length = getLengthProperty(cx, thisObj); + + if (length <= 1) { return thisObj; } + + Object compare; + Object[] cmpBuf; + + if (args.length > 0 && Undefined.instance != args[0]) { + // sort with given compare function + compare = args[0]; + cmpBuf = new Object[2]; // Buffer for cmp arguments + } else { + // sort with default compare + compare = null; + cmpBuf = null; + } + if (thisObj instanceof NativeArray) { + NativeArray na = (NativeArray) thisObj; + if (na.denseOnly) { + int ilength = (int) length; + heapsort(cx, scope, na.dense, ilength, compare, cmpBuf); + return thisObj; + } + } + + // Should we use the extended sort function, or the faster one? + if (length >= Integer.MAX_VALUE) { + heapsort_extended(cx, scope, thisObj, length, compare, cmpBuf); + } else { + int ilength = (int)length; + // copy the JS array into a working array, so it can be + // sorted cheaply. + Object[] working = new Object[ilength]; + for (int i = 0; i != ilength; ++i) { + working[i] = getElem(cx, thisObj, i); + } + + heapsort(cx, scope, working, ilength, compare, cmpBuf); + + // copy the working array back into thisObj + for (int i = 0; i != ilength; ++i) { + setElem(cx, thisObj, i, working[i]); + } + } + return thisObj; + } + + // Return true only if x > y + private static boolean isBigger(Context cx, Scriptable scope, + Object x, Object y, + Object cmp, Object[] cmpBuf) + { + if (cmp == null) { + if (cmpBuf != null) Kit.codeBug(); + } else { + if (cmpBuf == null || cmpBuf.length != 2) Kit.codeBug(); + } + + Object undef = Undefined.instance; + Object notfound = Scriptable.NOT_FOUND; + + // sort undefined to end + if (y == undef || y == notfound) { + return false; // x can not be bigger then undef + } else if (x == undef || x == notfound) { + return true; // y != undef here, so x > y + } + + if (cmp == null) { + // if no cmp function supplied, sort lexicographically + String a = ScriptRuntime.toString(x); + String b = ScriptRuntime.toString(y); + return a.compareTo(b) > 0; + } + else { + // assemble args and call supplied JS cmp function + cmpBuf[0] = x; + cmpBuf[1] = y; + Callable fun = ScriptRuntime.getValueFunctionAndThis(cmp, cx); + Scriptable funThis = ScriptRuntime.lastStoredScriptable(cx); + + Object ret = fun.call(cx, scope, funThis, cmpBuf); + double d = ScriptRuntime.toNumber(ret); + + // XXX what to do when cmp function returns NaN? ECMA states + // that it's then not a 'consistent comparison function'... but + // then what do we do? Back out and start over with the generic + // cmp function when we see a NaN? Throw an error? + + // for now, just ignore it: + + return d > 0; + } + } + +/** Heapsort implementation. + * See "Introduction to Algorithms" by Cormen, Leiserson, Rivest for details. + * Adjusted for zero based indexes. + */ + private static void heapsort(Context cx, Scriptable scope, + Object[] array, int length, + Object cmp, Object[] cmpBuf) + { + if (length <= 1) Kit.codeBug(); + + // Build heap + for (int i = length / 2; i != 0;) { + --i; + Object pivot = array[i]; + heapify(cx, scope, pivot, array, i, length, cmp, cmpBuf); + } + + // Sort heap + for (int i = length; i != 1;) { + --i; + Object pivot = array[i]; + array[i] = array[0]; + heapify(cx, scope, pivot, array, 0, i, cmp, cmpBuf); + } + } + +/** pivot and child heaps of i should be made into heap starting at i, + * original array[i] is never used to have less array access during sorting. + */ + private static void heapify(Context cx, Scriptable scope, + Object pivot, Object[] array, int i, int end, + Object cmp, Object[] cmpBuf) + { + for (;;) { + int child = i * 2 + 1; + if (child >= end) { + break; + } + Object childVal = array[child]; + if (child + 1 < end) { + Object nextVal = array[child + 1]; + if (isBigger(cx, scope, nextVal, childVal, cmp, cmpBuf)) { + ++child; childVal = nextVal; + } + } + if (!isBigger(cx, scope, childVal, pivot, cmp, cmpBuf)) { + break; + } + array[i] = childVal; + i = child; + } + array[i] = pivot; + } + +/** Version of heapsort that call getElem/setElem on target to query/assign + * array elements instead of Java array access + */ + private static void heapsort_extended(Context cx, Scriptable scope, + Scriptable target, long length, + Object cmp, Object[] cmpBuf) + { + if (length <= 1) Kit.codeBug(); + + // Build heap + for (long i = length / 2; i != 0;) { + --i; + Object pivot = getElem(cx, target, i); + heapify_extended(cx, scope, pivot, target, i, length, cmp, cmpBuf); + } + + // Sort heap + for (long i = length; i != 1;) { + --i; + Object pivot = getElem(cx, target, i); + setElem(cx, target, i, getElem(cx, target, 0)); + heapify_extended(cx, scope, pivot, target, 0, i, cmp, cmpBuf); + } + } + + private static void heapify_extended(Context cx, Scriptable scope, + Object pivot, Scriptable target, + long i, long end, + Object cmp, Object[] cmpBuf) + { + for (;;) { + long child = i * 2 + 1; + if (child >= end) { + break; + } + Object childVal = getElem(cx, target, child); + if (child + 1 < end) { + Object nextVal = getElem(cx, target, child + 1); + if (isBigger(cx, scope, nextVal, childVal, cmp, cmpBuf)) { + ++child; childVal = nextVal; + } + } + if (!isBigger(cx, scope, childVal, pivot, cmp, cmpBuf)) { + break; + } + setElem(cx, target, i, childVal); + i = child; + } + setElem(cx, target, i, pivot); + } + + /** + * Non-ECMA methods. + */ + + private static Object js_push(Context cx, Scriptable thisObj, + Object[] args) + { + if (thisObj instanceof NativeArray) { + NativeArray na = (NativeArray) thisObj; + if (na.denseOnly && + na.ensureCapacity((int) na.length + args.length)) + { + for (int i = 0; i < args.length; i++) { + na.dense[(int)na.length++] = args[i]; + } + return ScriptRuntime.wrapNumber(na.length); + } + } + long length = getLengthProperty(cx, thisObj); + for (int i = 0; i < args.length; i++) { + setElem(cx, thisObj, length + i, args[i]); + } + + length += args.length; + Object lengthObj = setLengthProperty(cx, thisObj, length); + + /* + * If JS1.2, follow Perl4 by returning the last thing pushed. + * Otherwise, return the new array length. + */ + if (cx.getLanguageVersion() == Context.VERSION_1_2) + // if JS1.2 && no arguments, return undefined. + return args.length == 0 + ? Undefined.instance + : args[args.length - 1]; + + else + return lengthObj; + } + + private static Object js_pop(Context cx, Scriptable thisObj, + Object[] args) + { + Object result; + if (thisObj instanceof NativeArray) { + NativeArray na = (NativeArray) thisObj; + if (na.denseOnly && na.length > 0) { + na.length--; + result = na.dense[(int)na.length]; + na.dense[(int)na.length] = NOT_FOUND; + return result; + } + } + long length = getLengthProperty(cx, thisObj); + if (length > 0) { + length--; + + // Get the to-be-deleted property's value. + result = getElem(cx, thisObj, length); + + // We don't need to delete the last property, because + // setLength does that for us. + } else { + result = Undefined.instance; + } + // necessary to match js even when length < 0; js pop will give a + // length property to any target it is called on. + setLengthProperty(cx, thisObj, length); + + return result; + } + + private static Object js_shift(Context cx, Scriptable thisObj, + Object[] args) + { + if (thisObj instanceof NativeArray) { + NativeArray na = (NativeArray) thisObj; + if (na.denseOnly && na.length > 0) { + na.length--; + Object result = na.dense[0]; + System.arraycopy(na.dense, 1, na.dense, 0, (int)na.length); + na.dense[(int)na.length] = NOT_FOUND; + return result; + } + } + Object result; + long length = getLengthProperty(cx, thisObj); + if (length > 0) { + long i = 0; + length--; + + // Get the to-be-deleted property's value. + result = getElem(cx, thisObj, i); + + /* + * Slide down the array above the first element. Leave i + * set to point to the last element. + */ + if (length > 0) { + for (i = 1; i <= length; i++) { + Object temp = getElem(cx, thisObj, i); + setElem(cx, thisObj, i - 1, temp); + } + } + // We don't need to delete the last property, because + // setLength does that for us. + } else { + result = Undefined.instance; + } + setLengthProperty(cx, thisObj, length); + return result; + } + + private static Object js_unshift(Context cx, Scriptable thisObj, + Object[] args) + { + if (thisObj instanceof NativeArray) { + NativeArray na = (NativeArray) thisObj; + if (na.denseOnly && + na.ensureCapacity((int)na.length + args.length)) + { + System.arraycopy(na.dense, 0, na.dense, args.length, + (int) na.length); + for (int i = 0; i < args.length; i++) { + na.dense[i] = args[i]; + } + na.length += args.length; + return ScriptRuntime.wrapNumber(na.length); + } + } + long length = getLengthProperty(cx, thisObj); + int argc = args.length; + + if (args.length > 0) { + /* Slide up the array to make room for args at the bottom */ + if (length > 0) { + for (long last = length - 1; last >= 0; last--) { + Object temp = getElem(cx, thisObj, last); + setElem(cx, thisObj, last + argc, temp); + } + } + + /* Copy from argv to the bottom of the array. */ + for (int i = 0; i < args.length; i++) { + setElem(cx, thisObj, i, args[i]); + } + + /* Follow Perl by returning the new array length. */ + length += args.length; + return setLengthProperty(cx, thisObj, length); + } + return ScriptRuntime.wrapNumber(length); + } + + private static Object js_splice(Context cx, Scriptable scope, + Scriptable thisObj, Object[] args) + { + NativeArray na = null; + boolean denseMode = false; + if (thisObj instanceof NativeArray) { + na = (NativeArray) thisObj; + denseMode = na.denseOnly; + } + + /* create an empty Array to return. */ + scope = getTopLevelScope(scope); + int argc = args.length; + if (argc == 0) + return ScriptRuntime.newObject(cx, scope, "Array", null); + long length = getLengthProperty(cx, thisObj); + + /* Convert the first argument into a starting index. */ + long begin = toSliceIndex(ScriptRuntime.toInteger(args[0]), length); + argc--; + + /* Convert the second argument into count */ + long count; + if (args.length == 1) { + count = length - begin; + } else { + double dcount = ScriptRuntime.toInteger(args[1]); + if (dcount < 0) { + count = 0; + } else if (dcount > (length - begin)) { + count = length - begin; + } else { + count = (long)dcount; + } + argc--; + } + + long end = begin + count; + + /* If there are elements to remove, put them into the return value. */ + Object result; + if (count != 0) { + if (count == 1 + && (cx.getLanguageVersion() == Context.VERSION_1_2)) + { + /* + * JS lacks "list context", whereby in Perl one turns the + * single scalar that's spliced out into an array just by + * assigning it to @single instead of $single, or by using it + * as Perl push's first argument, for instance. + * + * JS1.2 emulated Perl too closely and returned a non-Array for + * the single-splice-out case, requiring callers to test and + * wrap in [] if necessary. So JS1.3, default, and other + * versions all return an array of length 1 for uniformity. + */ + result = getElem(cx, thisObj, begin); + } else { + if (denseMode) { + int intLen = (int) (end - begin); + Object[] copy = new Object[intLen]; + System.arraycopy(na.dense, (int) begin, copy, 0, intLen); + result = cx.newArray(scope, copy); + } else { + Scriptable resultArray = ScriptRuntime.newObject(cx, scope, + "Array", null); + for (long last = begin; last != end; last++) { + Object temp = getElem(cx, thisObj, last); + setElem(cx, resultArray, last - begin, temp); + } + result = resultArray; + } + } + } else { // (count == 0) + if (cx.getLanguageVersion() == Context.VERSION_1_2) { + /* Emulate C JS1.2; if no elements are removed, return undefined. */ + result = Undefined.instance; + } else { + result = ScriptRuntime.newObject(cx, scope, "Array", null); + } + } + + /* Find the direction (up or down) to copy and make way for argv. */ + long delta = argc - count; + if (denseMode && length + delta < Integer.MAX_VALUE && + na.ensureCapacity((int) (length + delta))) + { + System.arraycopy(na.dense, (int) end, na.dense, + (int) (begin + argc), (int) (length - end)); + if (argc > 0) { + System.arraycopy(args, 2, na.dense, (int) begin, argc); + } + if (delta < 0) { + Arrays.fill(na.dense, (int) (length + delta), (int) length, + NOT_FOUND); + } + na.length = length + delta; + return result; + } + + if (delta > 0) { + for (long last = length - 1; last >= end; last--) { + Object temp = getElem(cx, thisObj, last); + setElem(cx, thisObj, last + delta, temp); + } + } else if (delta < 0) { + for (long last = end; last < length; last++) { + Object temp = getElem(cx, thisObj, last); + setElem(cx, thisObj, last + delta, temp); + } + } + + /* Copy from argv into the hole to complete the splice. */ + int argoffset = args.length - argc; + for (int i = 0; i < argc; i++) { + setElem(cx, thisObj, begin + i, args[i + argoffset]); + } + + /* Update length in case we deleted elements from the end. */ + setLengthProperty(cx, thisObj, length + delta); + return result; + } + + /* + * See Ecma 262v3 15.4.4.4 + */ + private static Scriptable js_concat(Context cx, Scriptable scope, + Scriptable thisObj, Object[] args) + { + // create an empty Array to return. + scope = getTopLevelScope(scope); + Function ctor = ScriptRuntime.getExistingCtor(cx, scope, "Array"); + Scriptable result = ctor.construct(cx, scope, ScriptRuntime.emptyArgs); + if (thisObj instanceof NativeArray && result instanceof NativeArray) { + NativeArray denseThis = (NativeArray) thisObj; + NativeArray denseResult = (NativeArray) result; + if (denseThis.denseOnly && denseResult.denseOnly) { + // First calculate length of resulting array + boolean canUseDense = true; + int length = (int) denseThis.length; + for (int i = 0; i < args.length && canUseDense; i++) { + if (args[i] instanceof NativeArray) { + // only try to use dense approach for Array-like + // objects that are actually NativeArrays + final NativeArray arg = (NativeArray) args[i]; + canUseDense = arg.denseOnly; + length += arg.length; + } else { + length++; + } + } + if (canUseDense && denseResult.ensureCapacity(length)) { + System.arraycopy(denseThis.dense, 0, denseResult.dense, + 0, (int) denseThis.length); + int cursor = (int) denseThis.length; + for (int i = 0; i < args.length && canUseDense; i++) { + if (args[i] instanceof NativeArray) { + NativeArray arg = (NativeArray) args[i]; + System.arraycopy(arg.dense, 0, + denseResult.dense, cursor, + (int)arg.length); + cursor += (int)arg.length; + } else { + denseResult.dense[cursor++] = args[i]; + } + } + denseResult.length = length; + return result; + } + } + } + + long length; + long slot = 0; + + /* Put the target in the result array; only add it as an array + * if it looks like one. + */ + if (ScriptRuntime.instanceOf(thisObj, ctor, cx)) { + length = getLengthProperty(cx, thisObj); + + // Copy from the target object into the result + for (slot = 0; slot < length; slot++) { + Object temp = getElem(cx, thisObj, slot); + setElem(cx, result, slot, temp); + } + } else { + setElem(cx, result, slot++, thisObj); + } + + /* Copy from the arguments into the result. If any argument + * has a numeric length property, treat it as an array and add + * elements separately; otherwise, just copy the argument. + */ + for (int i = 0; i < args.length; i++) { + if (ScriptRuntime.instanceOf(args[i], ctor, cx)) { + // ScriptRuntime.instanceOf => instanceof Scriptable + Scriptable arg = (Scriptable)args[i]; + length = getLengthProperty(cx, arg); + for (long j = 0; j < length; j++, slot++) { + Object temp = getElem(cx, arg, j); + setElem(cx, result, slot, temp); + } + } else { + setElem(cx, result, slot++, args[i]); + } + } + return result; + } + + private Scriptable js_slice(Context cx, Scriptable thisObj, + Object[] args) + { + Scriptable scope = getTopLevelScope(this); + Scriptable result = ScriptRuntime.newObject(cx, scope, "Array", null); + long length = getLengthProperty(cx, thisObj); + + long begin, end; + if (args.length == 0) { + begin = 0; + end = length; + } else { + begin = toSliceIndex(ScriptRuntime.toInteger(args[0]), length); + if (args.length == 1) { + end = length; + } else { + end = toSliceIndex(ScriptRuntime.toInteger(args[1]), length); + } + } + + for (long slot = begin; slot < end; slot++) { + Object temp = getElem(cx, thisObj, slot); + setElem(cx, result, slot - begin, temp); + } + + return result; + } + + private static long toSliceIndex(double value, long length) { + long result; + if (value < 0.0) { + if (value + length < 0.0) { + result = 0; + } else { + result = (long)(value + length); + } + } else if (value > length) { + result = length; + } else { + result = (long)value; + } + return result; + } + + /** + * Implements the methods "indexOf" and "lastIndexOf". + */ + private Object indexOfHelper(Context cx, Scriptable thisObj, + Object[] args, boolean isLast) + { + Object compareTo = args.length > 0 ? args[0] : Undefined.instance; + long length = getLengthProperty(cx, thisObj); + long start; + if (isLast) { + // lastIndexOf + /* + * From http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Objects:Array:lastIndexOf + * The index at which to start searching backwards. Defaults to the + * array's length, i.e. the whole array will be searched. If the + * index is greater than or equal to the length of the array, the + * whole array will be searched. If negative, it is taken as the + * offset from the end of the array. Note that even when the index + * is negative, the array is still searched from back to front. If + * the calculated index is less than 0, -1 is returned, i.e. the + * array will not be searched. + */ + if (args.length < 2) { + // default + start = length-1; + } else { + start = ScriptRuntime.toInt32(ScriptRuntime.toNumber(args[1])); + if (start >= length) + start = length-1; + else if (start < 0) + start += length; + // Note that start may be negative, but that's okay + // as the result of -1 will fall out from the code below + } + } else { + // indexOf + /* + * From http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Objects:Array:indexOf + * The index at which to begin the search. Defaults to 0, i.e. the + * whole array will be searched. If the index is greater than or + * equal to the length of the array, -1 is returned, i.e. the array + * will not be searched. If negative, it is taken as the offset from + * the end of the array. Note that even when the index is negative, + * the array is still searched from front to back. If the calculated + * index is less than 0, the whole array will be searched. + */ + if (args.length < 2) { + // default + start = 0; + } else { + start = ScriptRuntime.toInt32(ScriptRuntime.toNumber(args[1])); + if (start < 0) { + start += length; + if (start < 0) + start = 0; + } + // Note that start may be > length-1, but that's okay + // as the result of -1 will fall out from the code below + } + } + if (thisObj instanceof NativeArray) { + NativeArray na = (NativeArray) thisObj; + if (na.denseOnly) { + if (isLast) { + for (int i=(int)start; i >= 0; i--) { + if (na.dense[i] != Scriptable.NOT_FOUND && + ScriptRuntime.shallowEq(na.dense[i], compareTo)) + { + return new Long(i); + } + } + } else { + for (int i=(int)start; i < length; i++) { + if (na.dense[i] != Scriptable.NOT_FOUND && + ScriptRuntime.shallowEq(na.dense[i], compareTo)) + { + return new Long(i); + } + } + } + return NEGATIVE_ONE; + } + } + if (isLast) { + for (long i=start; i >= 0; i--) { + if (ScriptRuntime.shallowEq(getElem(cx, thisObj, i), compareTo)) { + return new Long(i); + } + } + } else { + for (long i=start; i < length; i++) { + if (ScriptRuntime.shallowEq(getElem(cx, thisObj, i), compareTo)) { + return new Long(i); + } + } + } + return NEGATIVE_ONE; + } + + /** + * Implements the methods "every", "filter", "forEach", "map", and "some". + */ + private Object iterativeMethod(Context cx, int id, Scriptable scope, + Scriptable thisObj, Object[] args) + { + Object callbackArg = args.length > 0 ? args[0] : Undefined.instance; + if (callbackArg == null || !(callbackArg instanceof Function)) { + throw ScriptRuntime.notFunctionError( + ScriptRuntime.toString(callbackArg)); + } + Function f = (Function) callbackArg; + Scriptable parent = ScriptableObject.getTopLevelScope(f); + Scriptable thisArg; + if (args.length < 2 || args[1] == null || args[1] == Undefined.instance) + { + thisArg = parent; + } else { + thisArg = ScriptRuntime.toObject(cx, scope, args[1]); + } + long length = getLengthProperty(cx, thisObj); + Scriptable array = ScriptRuntime.newObject(cx, scope, "Array", null); + long j=0; + for (long i=0; i < length; i++) { + Object[] innerArgs = new Object[3]; + Object elem = (i > Integer.MAX_VALUE) + ? ScriptableObject.getProperty(thisObj, Long.toString(i)) + : ScriptableObject.getProperty(thisObj, (int)i); + if (elem == Scriptable.NOT_FOUND) { + continue; + } + innerArgs[0] = elem; + innerArgs[1] = new Long(i); + innerArgs[2] = thisObj; + Object result = f.call(cx, parent, thisArg, innerArgs); + switch (id) { + case Id_every: + if (!ScriptRuntime.toBoolean(result)) + return Boolean.FALSE; + break; + case Id_filter: + if (ScriptRuntime.toBoolean(result)) + setElem(cx, array, j++, innerArgs[0]); + break; + case Id_forEach: + break; + case Id_map: + setElem(cx, array, i, result); + break; + case Id_some: + if (ScriptRuntime.toBoolean(result)) + return Boolean.TRUE; + break; + } + } + switch (id) { + case Id_every: + return Boolean.TRUE; + case Id_filter: + case Id_map: + return array; + case Id_some: + return Boolean.FALSE; + case Id_forEach: + default: + return Undefined.instance; + } + } + +// #string_id_map# + + @Override + protected int findPrototypeId(String s) + { + int id; +// #generated# Last update: 2005-09-26 15:47:42 EDT + L0: { id = 0; String X = null; int c; + L: switch (s.length()) { + case 3: c=s.charAt(0); + if (c=='m') { if (s.charAt(2)=='p' && s.charAt(1)=='a') {id=Id_map; break L0;} } + else if (c=='p') { if (s.charAt(2)=='p' && s.charAt(1)=='o') {id=Id_pop; break L0;} } + break L; + case 4: switch (s.charAt(2)) { + case 'i': X="join";id=Id_join; break L; + case 'm': X="some";id=Id_some; break L; + case 'r': X="sort";id=Id_sort; break L; + case 's': X="push";id=Id_push; break L; + } break L; + case 5: c=s.charAt(1); + if (c=='h') { X="shift";id=Id_shift; } + else if (c=='l') { X="slice";id=Id_slice; } + else if (c=='v') { X="every";id=Id_every; } + break L; + case 6: c=s.charAt(0); + if (c=='c') { X="concat";id=Id_concat; } + else if (c=='f') { X="filter";id=Id_filter; } + else if (c=='s') { X="splice";id=Id_splice; } + break L; + case 7: switch (s.charAt(0)) { + case 'f': X="forEach";id=Id_forEach; break L; + case 'i': X="indexOf";id=Id_indexOf; break L; + case 'r': X="reverse";id=Id_reverse; break L; + case 'u': X="unshift";id=Id_unshift; break L; + } break L; + case 8: c=s.charAt(3); + if (c=='o') { X="toSource";id=Id_toSource; } + else if (c=='t') { X="toString";id=Id_toString; } + break L; + case 11: c=s.charAt(0); + if (c=='c') { X="constructor";id=Id_constructor; } + else if (c=='l') { X="lastIndexOf";id=Id_lastIndexOf; } + break L; + case 14: X="toLocaleString";id=Id_toLocaleString; break L; + } + if (X!=null && X!=s && !X.equals(s)) id = 0; + } +// #/generated# + return id; + } + + private static final int + Id_constructor = 1, + Id_toString = 2, + Id_toLocaleString = 3, + Id_toSource = 4, + Id_join = 5, + Id_reverse = 6, + Id_sort = 7, + Id_push = 8, + Id_pop = 9, + Id_shift = 10, + Id_unshift = 11, + Id_splice = 12, + Id_concat = 13, + Id_slice = 14, + Id_indexOf = 15, + Id_lastIndexOf = 16, + Id_every = 17, + Id_filter = 18, + Id_forEach = 19, + Id_map = 20, + Id_some = 21, + + MAX_PROTOTYPE_ID = 21; + +// #/string_id_map# + + private static final int + ConstructorId_join = -Id_join, + ConstructorId_reverse = -Id_reverse, + ConstructorId_sort = -Id_sort, + ConstructorId_push = -Id_push, + ConstructorId_pop = -Id_pop, + ConstructorId_shift = -Id_shift, + ConstructorId_unshift = -Id_unshift, + ConstructorId_splice = -Id_splice, + ConstructorId_concat = -Id_concat, + ConstructorId_slice = -Id_slice, + ConstructorId_indexOf = -Id_indexOf, + ConstructorId_lastIndexOf = -Id_lastIndexOf, + ConstructorId_every = -Id_every, + ConstructorId_filter = -Id_filter, + ConstructorId_forEach = -Id_forEach, + ConstructorId_map = -Id_map, + ConstructorId_some = -Id_some; + + /** + * Internal representation of the JavaScript array's length property. + */ + private long length; + + /** + * Fast storage for dense arrays. Sparse arrays will use the superclass's + * hashtable storage scheme. + */ + private Object[] dense; + + /** + * True if all numeric properties are stored in dense. + */ + private boolean denseOnly; + + /** + * The maximum size of dense that will be allocated initially. + */ + private static int maximumInitialCapacity = 10000; + + /** + * The default capacity for dense. + */ + private static final int DEFAULT_INITIAL_CAPACITY = 10; + + /** + * The factor to grow dense by. + */ + private static final double GROW_FACTOR = 1.5; + private static final int MAX_PRE_GROW_SIZE = (int)(Integer.MAX_VALUE / GROW_FACTOR); +} diff --git a/org/mozilla/javascript/NativeBoolean.java b/org/mozilla/javascript/NativeBoolean.java new file mode 100644 index 0000000..07d1482 --- /dev/null +++ b/org/mozilla/javascript/NativeBoolean.java @@ -0,0 +1,175 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-1999 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Norris Boyd + * Igor Bukanov + * Mike McCabe + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +package org.mozilla.javascript; + +/** + * This class implements the Boolean native object. + * See ECMA 15.6. + * @author Norris Boyd + */ +final class NativeBoolean extends IdScriptableObject +{ + static final long serialVersionUID = -3716996899943880933L; + + private static final Object BOOLEAN_TAG = "Boolean"; + + static void init(Scriptable scope, boolean sealed) + { + NativeBoolean obj = new NativeBoolean(false); + obj.exportAsJSClass(MAX_PROTOTYPE_ID, scope, sealed); + } + + private NativeBoolean(boolean b) + { + booleanValue = b; + } + + @Override + public String getClassName() + { + return "Boolean"; + } + + @Override + public Object getDefaultValue(Class typeHint) { + // This is actually non-ECMA, but will be proposed + // as a change in round 2. + if (typeHint == ScriptRuntime.BooleanClass) + return ScriptRuntime.wrapBoolean(booleanValue); + return super.getDefaultValue(typeHint); + } + + @Override + protected void initPrototypeId(int id) + { + String s; + int arity; + switch (id) { + case Id_constructor: arity=1; s="constructor"; break; + case Id_toString: arity=0; s="toString"; break; + case Id_toSource: arity=0; s="toSource"; break; + case Id_valueOf: arity=0; s="valueOf"; break; + default: throw new IllegalArgumentException(String.valueOf(id)); + } + initPrototypeMethod(BOOLEAN_TAG, id, s, arity); + } + + @Override + public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope, + Scriptable thisObj, Object[] args) + { + if (!f.hasTag(BOOLEAN_TAG)) { + return super.execIdCall(f, cx, scope, thisObj, args); + } + int id = f.methodId(); + + if (id == Id_constructor) { + boolean b; + if (args.length == 0) { + b = false; + } else { + b = args[0] instanceof ScriptableObject && + ((ScriptableObject) args[0]).avoidObjectDetection() + ? true + : ScriptRuntime.toBoolean(args[0]); + } + if (thisObj == null) { + // new Boolean(val) creates a new boolean object. + return new NativeBoolean(b); + } + // Boolean(val) converts val to a boolean. + return ScriptRuntime.wrapBoolean(b); + } + + // The rest of Boolean.prototype methods require thisObj to be Boolean + + if (!(thisObj instanceof NativeBoolean)) + throw incompatibleCallError(f); + boolean value = ((NativeBoolean)thisObj).booleanValue; + + switch (id) { + + case Id_toString: + return value ? "true" : "false"; + + case Id_toSource: + return value ? "(new Boolean(true))" : "(new Boolean(false))"; + + case Id_valueOf: + return ScriptRuntime.wrapBoolean(value); + } + throw new IllegalArgumentException(String.valueOf(id)); + } + +// #string_id_map# + + @Override + protected int findPrototypeId(String s) + { + int id; +// #generated# Last update: 2007-05-09 08:15:31 EDT + L0: { id = 0; String X = null; int c; + int s_length = s.length(); + if (s_length==7) { X="valueOf";id=Id_valueOf; } + else if (s_length==8) { + c=s.charAt(3); + if (c=='o') { X="toSource";id=Id_toSource; } + else if (c=='t') { X="toString";id=Id_toString; } + } + else if (s_length==11) { X="constructor";id=Id_constructor; } + if (X!=null && X!=s && !X.equals(s)) id = 0; + break L0; + } +// #/generated# + return id; + } + + private static final int + Id_constructor = 1, + Id_toString = 2, + Id_toSource = 3, + Id_valueOf = 4, + MAX_PROTOTYPE_ID = 4; + +// #/string_id_map# + + private boolean booleanValue; +} diff --git a/org/mozilla/javascript/NativeCall.java b/org/mozilla/javascript/NativeCall.java new file mode 100644 index 0000000..f4e1949 --- /dev/null +++ b/org/mozilla/javascript/NativeCall.java @@ -0,0 +1,158 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-1999 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Norris Boyd + * Bob Jervis + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +package org.mozilla.javascript; + +/** + * This class implements the activation object. + * + * See ECMA 10.1.6 + * + * @see org.mozilla.javascript.Arguments + * @author Norris Boyd + */ +public final class NativeCall extends IdScriptableObject +{ + static final long serialVersionUID = -7471457301304454454L; + + private static final Object CALL_TAG = "Call"; + + static void init(Scriptable scope, boolean sealed) + { + NativeCall obj = new NativeCall(); + obj.exportAsJSClass(MAX_PROTOTYPE_ID, scope, sealed); + } + + NativeCall() { } + + NativeCall(NativeFunction function, Scriptable scope, Object[] args) + { + this.function = function; + + setParentScope(scope); + // leave prototype null + + this.originalArgs = (args == null) ? ScriptRuntime.emptyArgs : args; + + // initialize values of arguments + int paramAndVarCount = function.getParamAndVarCount(); + int paramCount = function.getParamCount(); + if (paramAndVarCount != 0) { + for (int i = 0; i < paramCount; ++i) { + String name = function.getParamOrVarName(i); + Object val = i < args.length ? args[i] + : Undefined.instance; + defineProperty(name, val, PERMANENT); + } + } + + // initialize "arguments" property but only if it was not overridden by + // the parameter with the same name + if (!super.has("arguments", this)) { + defineProperty("arguments", new Arguments(this), PERMANENT); + } + + if (paramAndVarCount != 0) { + for (int i = paramCount; i < paramAndVarCount; ++i) { + String name = function.getParamOrVarName(i); + if (!super.has(name, this)) { + if (function.getParamOrVarConst(i)) + defineProperty(name, Undefined.instance, CONST); + else + defineProperty(name, Undefined.instance, PERMANENT); + } + } + } + } + + @Override + public String getClassName() + { + return "Call"; + } + + @Override + protected int findPrototypeId(String s) + { + return s.equals("constructor") ? Id_constructor : 0; + } + + @Override + protected void initPrototypeId(int id) + { + String s; + int arity; + if (id == Id_constructor) { + arity=1; s="constructor"; + } else { + throw new IllegalArgumentException(String.valueOf(id)); + } + initPrototypeMethod(CALL_TAG, id, s, arity); + } + + @Override + public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope, + Scriptable thisObj, Object[] args) + { + if (!f.hasTag(CALL_TAG)) { + return super.execIdCall(f, cx, scope, thisObj, args); + } + int id = f.methodId(); + if (id == Id_constructor) { + if (thisObj != null) { + throw Context.reportRuntimeError1("msg.only.from.new", "Call"); + } + ScriptRuntime.checkDeprecated(cx, "Call"); + NativeCall result = new NativeCall(); + result.setPrototype(getObjectPrototype(scope)); + return result; + } + throw new IllegalArgumentException(String.valueOf(id)); + } + + private static final int + Id_constructor = 1, + MAX_PROTOTYPE_ID = 1; + + NativeFunction function; + Object[] originalArgs; + + transient NativeCall parentActivationCall; +} + diff --git a/org/mozilla/javascript/NativeContinuation.java b/org/mozilla/javascript/NativeContinuation.java new file mode 100644 index 0000000..5ed53d8 --- /dev/null +++ b/org/mozilla/javascript/NativeContinuation.java @@ -0,0 +1,139 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-1999 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +package org.mozilla.javascript; + +public final class NativeContinuation extends IdScriptableObject + implements Function +{ + static final long serialVersionUID = 1794167133757605367L; + + private static final Object FTAG = "Continuation"; + + private Object implementation; + + public static void init(Context cx, Scriptable scope, boolean sealed) + { + NativeContinuation obj = new NativeContinuation(); + obj.exportAsJSClass(MAX_PROTOTYPE_ID, scope, sealed); + } + + public Object getImplementation() + { + return implementation; + } + + public void initImplementation(Object implementation) + { + this.implementation = implementation; + } + + @Override + public String getClassName() + { + return "Continuation"; + } + + public Scriptable construct(Context cx, Scriptable scope, Object[] args) + { + throw Context.reportRuntimeError("Direct call is not supported"); + } + + public Object call(Context cx, Scriptable scope, Scriptable thisObj, + Object[] args) + { + return Interpreter.restartContinuation(this, cx, scope, args); + } + + public static boolean isContinuationConstructor(IdFunctionObject f) + { + if (f.hasTag(FTAG) && f.methodId() == Id_constructor) { + return true; + } + return false; + } + + @Override + protected void initPrototypeId(int id) + { + String s; + int arity; + switch (id) { + case Id_constructor: arity=0; s="constructor"; break; + default: throw new IllegalArgumentException(String.valueOf(id)); + } + initPrototypeMethod(FTAG, id, s, arity); + } + + @Override + public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope, + Scriptable thisObj, Object[] args) + { + if (!f.hasTag(FTAG)) { + return super.execIdCall(f, cx, scope, thisObj, args); + } + int id = f.methodId(); + switch (id) { + case Id_constructor: + throw Context.reportRuntimeError("Direct call is not supported"); + } + throw new IllegalArgumentException(String.valueOf(id)); + } + +// #string_id_map# + + @Override + protected int findPrototypeId(String s) + { + int id; +// #generated# Last update: 2007-05-09 08:16:40 EDT + L0: { id = 0; String X = null; + if (s.length()==11) { X="constructor";id=Id_constructor; } + if (X!=null && X!=s && !X.equals(s)) id = 0; + break L0; + } +// #/generated# + return id; + } + + private static final int + Id_constructor = 1, + MAX_PROTOTYPE_ID = 1; + +// #/string_id_map# +} diff --git a/org/mozilla/javascript/NativeDate.java b/org/mozilla/javascript/NativeDate.java new file mode 100644 index 0000000..2eb8145 --- /dev/null +++ b/org/mozilla/javascript/NativeDate.java @@ -0,0 +1,1610 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-1999 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Peter Annema + * Norris Boyd + * Mike McCabe + * Ilya Frank + * + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +package org.mozilla.javascript; + +import java.util.Date; +import java.text.DateFormat; + +/** + * This class implements the Date native object. + * See ECMA 15.9. + * @author Mike McCabe + */ +final class NativeDate extends IdScriptableObject +{ + static final long serialVersionUID = -8307438915861678966L; + + private static final Object DATE_TAG = "Date"; + + private static final String js_NaN_date_str = "Invalid Date"; + + static void init(Scriptable scope, boolean sealed) + { + NativeDate obj = new NativeDate(); + // Set the value of the prototype Date to NaN ('invalid date'); + obj.date = ScriptRuntime.NaN; + obj.exportAsJSClass(MAX_PROTOTYPE_ID, scope, sealed); + } + + private NativeDate() + { + if (thisTimeZone == null) { + // j.u.TimeZone is synchronized, so setting class statics from it + // should be OK. + thisTimeZone = java.util.TimeZone.getDefault(); + LocalTZA = thisTimeZone.getRawOffset(); + } + } + + @Override + public String getClassName() + { + return "Date"; + } + + @Override + public Object getDefaultValue(Class typeHint) + { + if (typeHint == null) + typeHint = ScriptRuntime.StringClass; + return super.getDefaultValue(typeHint); + } + + double getJSTimeValue() + { + return date; + } + + @Override + protected void fillConstructorProperties(IdFunctionObject ctor) + { + addIdFunctionProperty(ctor, DATE_TAG, ConstructorId_now, + "now", 0); + addIdFunctionProperty(ctor, DATE_TAG, ConstructorId_parse, + "parse", 1); + addIdFunctionProperty(ctor, DATE_TAG, ConstructorId_UTC, + "UTC", 1); + super.fillConstructorProperties(ctor); + } + + @Override + protected void initPrototypeId(int id) + { + String s; + int arity; + switch (id) { + case Id_constructor: arity=1; s="constructor"; break; + case Id_toString: arity=0; s="toString"; break; + case Id_toTimeString: arity=0; s="toTimeString"; break; + case Id_toDateString: arity=0; s="toDateString"; break; + case Id_toLocaleString: arity=0; s="toLocaleString"; break; + case Id_toLocaleTimeString: arity=0; s="toLocaleTimeString"; break; + case Id_toLocaleDateString: arity=0; s="toLocaleDateString"; break; + case Id_toUTCString: arity=0; s="toUTCString"; break; + case Id_toSource: arity=0; s="toSource"; break; + case Id_valueOf: arity=0; s="valueOf"; break; + case Id_getTime: arity=0; s="getTime"; break; + case Id_getYear: arity=0; s="getYear"; break; + case Id_getFullYear: arity=0; s="getFullYear"; break; + case Id_getUTCFullYear: arity=0; s="getUTCFullYear"; break; + case Id_getMonth: arity=0; s="getMonth"; break; + case Id_getUTCMonth: arity=0; s="getUTCMonth"; break; + case Id_getDate: arity=0; s="getDate"; break; + case Id_getUTCDate: arity=0; s="getUTCDate"; break; + case Id_getDay: arity=0; s="getDay"; break; + case Id_getUTCDay: arity=0; s="getUTCDay"; break; + case Id_getHours: arity=0; s="getHours"; break; + case Id_getUTCHours: arity=0; s="getUTCHours"; break; + case Id_getMinutes: arity=0; s="getMinutes"; break; + case Id_getUTCMinutes: arity=0; s="getUTCMinutes"; break; + case Id_getSeconds: arity=0; s="getSeconds"; break; + case Id_getUTCSeconds: arity=0; s="getUTCSeconds"; break; + case Id_getMilliseconds: arity=0; s="getMilliseconds"; break; + case Id_getUTCMilliseconds: arity=0; s="getUTCMilliseconds"; break; + case Id_getTimezoneOffset: arity=0; s="getTimezoneOffset"; break; + case Id_setTime: arity=1; s="setTime"; break; + case Id_setMilliseconds: arity=1; s="setMilliseconds"; break; + case Id_setUTCMilliseconds: arity=1; s="setUTCMilliseconds"; break; + case Id_setSeconds: arity=2; s="setSeconds"; break; + case Id_setUTCSeconds: arity=2; s="setUTCSeconds"; break; + case Id_setMinutes: arity=3; s="setMinutes"; break; + case Id_setUTCMinutes: arity=3; s="setUTCMinutes"; break; + case Id_setHours: arity=4; s="setHours"; break; + case Id_setUTCHours: arity=4; s="setUTCHours"; break; + case Id_setDate: arity=1; s="setDate"; break; + case Id_setUTCDate: arity=1; s="setUTCDate"; break; + case Id_setMonth: arity=2; s="setMonth"; break; + case Id_setUTCMonth: arity=2; s="setUTCMonth"; break; + case Id_setFullYear: arity=3; s="setFullYear"; break; + case Id_setUTCFullYear: arity=3; s="setUTCFullYear"; break; + case Id_setYear: arity=1; s="setYear"; break; + default: throw new IllegalArgumentException(String.valueOf(id)); + } + initPrototypeMethod(DATE_TAG, id, s, arity); + } + + @Override + public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope, + Scriptable thisObj, Object[] args) + { + if (!f.hasTag(DATE_TAG)) { + return super.execIdCall(f, cx, scope, thisObj, args); + } + int id = f.methodId(); + switch (id) { + case ConstructorId_now: + return ScriptRuntime.wrapNumber(now()); + + case ConstructorId_parse: + { + String dataStr = ScriptRuntime.toString(args, 0); + return ScriptRuntime.wrapNumber(date_parseString(dataStr)); + } + + case ConstructorId_UTC: + return ScriptRuntime.wrapNumber(jsStaticFunction_UTC(args)); + + case Id_constructor: + { + // if called as a function, just return a string + // representing the current time. + if (thisObj != null) + return date_format(now(), Id_toString); + return jsConstructor(args); + } + } + + // The rest of Date.prototype methods require thisObj to be Date + + if (!(thisObj instanceof NativeDate)) + throw incompatibleCallError(f); + NativeDate realThis = (NativeDate)thisObj; + double t = realThis.date; + + switch (id) { + + case Id_toString: + case Id_toTimeString: + case Id_toDateString: + if (t == t) { + return date_format(t, id); + } + return js_NaN_date_str; + + case Id_toLocaleString: + case Id_toLocaleTimeString: + case Id_toLocaleDateString: + if (t == t) { + return toLocale_helper(t, id); + } + return js_NaN_date_str; + + case Id_toUTCString: + if (t == t) { + return js_toUTCString(t); + } + return js_NaN_date_str; + + case Id_toSource: + return "(new Date("+ScriptRuntime.toString(t)+"))"; + + case Id_valueOf: + case Id_getTime: + return ScriptRuntime.wrapNumber(t); + + case Id_getYear: + case Id_getFullYear: + case Id_getUTCFullYear: + if (t == t) { + if (id != Id_getUTCFullYear) t = LocalTime(t); + t = YearFromTime(t); + if (id == Id_getYear) { + if (cx.hasFeature(Context.FEATURE_NON_ECMA_GET_YEAR)) { + if (1900 <= t && t < 2000) { + t -= 1900; + } + } else { + t -= 1900; + } + } + } + return ScriptRuntime.wrapNumber(t); + + case Id_getMonth: + case Id_getUTCMonth: + if (t == t) { + if (id == Id_getMonth) t = LocalTime(t); + t = MonthFromTime(t); + } + return ScriptRuntime.wrapNumber(t); + + case Id_getDate: + case Id_getUTCDate: + if (t == t) { + if (id == Id_getDate) t = LocalTime(t); + t = DateFromTime(t); + } + return ScriptRuntime.wrapNumber(t); + + case Id_getDay: + case Id_getUTCDay: + if (t == t) { + if (id == Id_getDay) t = LocalTime(t); + t = WeekDay(t); + } + return ScriptRuntime.wrapNumber(t); + + case Id_getHours: + case Id_getUTCHours: + if (t == t) { + if (id == Id_getHours) t = LocalTime(t); + t = HourFromTime(t); + } + return ScriptRuntime.wrapNumber(t); + + case Id_getMinutes: + case Id_getUTCMinutes: + if (t == t) { + if (id == Id_getMinutes) t = LocalTime(t); + t = MinFromTime(t); + } + return ScriptRuntime.wrapNumber(t); + + case Id_getSeconds: + case Id_getUTCSeconds: + if (t == t) { + if (id == Id_getSeconds) t = LocalTime(t); + t = SecFromTime(t); + } + return ScriptRuntime.wrapNumber(t); + + case Id_getMilliseconds: + case Id_getUTCMilliseconds: + if (t == t) { + if (id == Id_getMilliseconds) t = LocalTime(t); + t = msFromTime(t); + } + return ScriptRuntime.wrapNumber(t); + + case Id_getTimezoneOffset: + if (t == t) { + t = (t - LocalTime(t)) / msPerMinute; + } + return ScriptRuntime.wrapNumber(t); + + case Id_setTime: + t = TimeClip(ScriptRuntime.toNumber(args, 0)); + realThis.date = t; + return ScriptRuntime.wrapNumber(t); + + case Id_setMilliseconds: + case Id_setUTCMilliseconds: + case Id_setSeconds: + case Id_setUTCSeconds: + case Id_setMinutes: + case Id_setUTCMinutes: + case Id_setHours: + case Id_setUTCHours: + t = makeTime(t, args, id); + realThis.date = t; + return ScriptRuntime.wrapNumber(t); + + case Id_setDate: + case Id_setUTCDate: + case Id_setMonth: + case Id_setUTCMonth: + case Id_setFullYear: + case Id_setUTCFullYear: + t = makeDate(t, args, id); + realThis.date = t; + return ScriptRuntime.wrapNumber(t); + + case Id_setYear: + { + double year = ScriptRuntime.toNumber(args, 0); + + if (year != year || Double.isInfinite(year)) { + t = ScriptRuntime.NaN; + } else { + if (t != t) { + t = 0; + } else { + t = LocalTime(t); + } + + if (year >= 0 && year <= 99) + year += 1900; + + double day = MakeDay(year, MonthFromTime(t), + DateFromTime(t)); + t = MakeDate(day, TimeWithinDay(t)); + t = internalUTC(t); + t = TimeClip(t); + } + } + realThis.date = t; + return ScriptRuntime.wrapNumber(t); + + default: throw new IllegalArgumentException(String.valueOf(id)); + } + + } + + /* ECMA helper functions */ + + private static final double HalfTimeDomain = 8.64e15; + private static final double HoursPerDay = 24.0; + private static final double MinutesPerHour = 60.0; + private static final double SecondsPerMinute = 60.0; + private static final double msPerSecond = 1000.0; + private static final double MinutesPerDay = (HoursPerDay * MinutesPerHour); + private static final double SecondsPerDay = (MinutesPerDay * SecondsPerMinute); + private static final double SecondsPerHour = (MinutesPerHour * SecondsPerMinute); + private static final double msPerDay = (SecondsPerDay * msPerSecond); + private static final double msPerHour = (SecondsPerHour * msPerSecond); + private static final double msPerMinute = (SecondsPerMinute * msPerSecond); + + private static double Day(double t) + { + return Math.floor(t / msPerDay); + } + + private static double TimeWithinDay(double t) + { + double result; + result = t % msPerDay; + if (result < 0) + result += msPerDay; + return result; + } + + private static boolean IsLeapYear(int year) + { + return year % 4 == 0 && (year % 100 != 0 || year % 400 == 0); + } + + /* math here has to be f.p, because we need + * floor((1968 - 1969) / 4) == -1 + */ + private static double DayFromYear(double y) + { + return ((365 * ((y)-1970) + Math.floor(((y)-1969)/4.0) + - Math.floor(((y)-1901)/100.0) + Math.floor(((y)-1601)/400.0))); + } + + private static double TimeFromYear(double y) + { + return DayFromYear(y) * msPerDay; + } + + private static int YearFromTime(double t) + { + int lo = (int) Math.floor((t / msPerDay) / 366) + 1970; + int hi = (int) Math.floor((t / msPerDay) / 365) + 1970; + int mid; + + /* above doesn't work for negative dates... */ + if (hi < lo) { + int temp = lo; + lo = hi; + hi = temp; + } + + /* Use a simple binary search algorithm to find the right + year. This seems like brute force... but the computation + of hi and lo years above lands within one year of the + correct answer for years within a thousand years of + 1970; the loop below only requires six iterations + for year 270000. */ + while (hi > lo) { + mid = (hi + lo) / 2; + if (TimeFromYear(mid) > t) { + hi = mid - 1; + } else { + lo = mid + 1; + if (TimeFromYear(lo) > t) { + return mid; + } + } + } + return lo; + } + + private static double DayFromMonth(int m, int year) + { + int day = m * 30; + + if (m >= 7) { day += m / 2 - 1; } + else if (m >= 2) { day += (m - 1) / 2 - 1; } + else { day += m; } + + if (m >= 2 && IsLeapYear(year)) { ++day; } + + return day; + } + + private static int MonthFromTime(double t) + { + int year = YearFromTime(t); + int d = (int)(Day(t) - DayFromYear(year)); + + d -= 31 + 28; + if (d < 0) { + return (d < -28) ? 0 : 1; + } + + if (IsLeapYear(year)) { + if (d == 0) + return 1; // 29 February + --d; + } + + // d: date count from 1 March + int estimate = d / 30; // approx number of month since March + int mstart; + switch (estimate) { + case 0: return 2; + case 1: mstart = 31; break; + case 2: mstart = 31+30; break; + case 3: mstart = 31+30+31; break; + case 4: mstart = 31+30+31+30; break; + case 5: mstart = 31+30+31+30+31; break; + case 6: mstart = 31+30+31+30+31+31; break; + case 7: mstart = 31+30+31+30+31+31+30; break; + case 8: mstart = 31+30+31+30+31+31+30+31; break; + case 9: mstart = 31+30+31+30+31+31+30+31+30; break; + case 10: return 11; //Late december + default: throw Kit.codeBug(); + } + // if d < mstart then real month since March == estimate - 1 + return (d >= mstart) ? estimate + 2 : estimate + 1; + } + + private static int DateFromTime(double t) + { + int year = YearFromTime(t); + int d = (int)(Day(t) - DayFromYear(year)); + + d -= 31 + 28; + if (d < 0) { + return (d < -28) ? d + 31 + 28 + 1 : d + 28 + 1; + } + + if (IsLeapYear(year)) { + if (d == 0) + return 29; // 29 February + --d; + } + + // d: date count from 1 March + int mdays, mstart; + switch (d / 30) { // approx number of month since March + case 0: return d + 1; + case 1: mdays = 31; mstart = 31; break; + case 2: mdays = 30; mstart = 31+30; break; + case 3: mdays = 31; mstart = 31+30+31; break; + case 4: mdays = 30; mstart = 31+30+31+30; break; + case 5: mdays = 31; mstart = 31+30+31+30+31; break; + case 6: mdays = 31; mstart = 31+30+31+30+31+31; break; + case 7: mdays = 30; mstart = 31+30+31+30+31+31+30; break; + case 8: mdays = 31; mstart = 31+30+31+30+31+31+30+31; break; + case 9: mdays = 30; mstart = 31+30+31+30+31+31+30+31+30; break; + case 10: + return d - (31+30+31+30+31+31+30+31+30) + 1; //Late december + default: throw Kit.codeBug(); + } + d -= mstart; + if (d < 0) { + // wrong estimate: sfhift to previous month + d += mdays; + } + return d + 1; + } + + private static int WeekDay(double t) + { + double result; + result = Day(t) + 4; + result = result % 7; + if (result < 0) + result += 7; + return (int) result; + } + + private static double now() + { + return System.currentTimeMillis(); + } + + /* Should be possible to determine the need for this dynamically + * if we go with the workaround... I'm not using it now, because I + * can't think of any clean way to make toLocaleString() and the + * time zone (comment) in toString match the generated string + * values. Currently it's wrong-but-consistent in all but the + * most recent betas of the JRE - seems to work in 1.1.7. + */ + private final static boolean TZO_WORKAROUND = false; + private static double DaylightSavingTA(double t) + { + // Another workaround! The JRE doesn't seem to know about DST + // before year 1 AD, so we map to equivalent dates for the + // purposes of finding dst. To be safe, we do this for years + // outside 1970-2038. + if (t < 0.0 || t > 2145916800000.0) { + int year = EquivalentYear(YearFromTime(t)); + double day = MakeDay(year, MonthFromTime(t), DateFromTime(t)); + t = MakeDate(day, TimeWithinDay(t)); + } + if (!TZO_WORKAROUND) { + Date date = new Date((long) t); + if (thisTimeZone.inDaylightTime(date)) + return msPerHour; + else + return 0; + } else { + /* Use getOffset if inDaylightTime() is broken, because it + * seems to work acceptably. We don't switch over to it + * entirely, because it requires (expensive) exploded date arguments, + * and the api makes it impossible to handle dst + * changeovers cleanly. + */ + + // Hardcode the assumption that the changeover always + // happens at 2:00 AM: + t += LocalTZA + (HourFromTime(t) <= 2 ? msPerHour : 0); + + int year = YearFromTime(t); + double offset = thisTimeZone.getOffset(year > 0 ? 1 : 0, + year, + MonthFromTime(t), + DateFromTime(t), + WeekDay(t), + (int)TimeWithinDay(t)); + + if ((offset - LocalTZA) != 0) + return msPerHour; + else + return 0; + // return offset - LocalTZA; + } + } + + /* + * Find a year for which any given date will fall on the same weekday. + * + * This function should be used with caution when used other than + * for determining DST; it hasn't been proven not to produce an + * incorrect year for times near year boundaries. + */ + private static int EquivalentYear(int year) + { + int day = (int) DayFromYear(year) + 4; + day = day % 7; + if (day < 0) + day += 7; + // Years and leap years on which Jan 1 is a Sunday, Monday, etc. + if (IsLeapYear(year)) { + switch (day) { + case 0: return 1984; + case 1: return 1996; + case 2: return 1980; + case 3: return 1992; + case 4: return 1976; + case 5: return 1988; + case 6: return 1972; + } + } else { + switch (day) { + case 0: return 1978; + case 1: return 1973; + case 2: return 1974; + case 3: return 1975; + case 4: return 1981; + case 5: return 1971; + case 6: return 1977; + } + } + // Unreachable + throw Kit.codeBug(); + } + + private static double LocalTime(double t) + { + return t + LocalTZA + DaylightSavingTA(t); + } + + private static double internalUTC(double t) + { + return t - LocalTZA - DaylightSavingTA(t - LocalTZA); + } + + private static int HourFromTime(double t) + { + double result; + result = Math.floor(t / msPerHour) % HoursPerDay; + if (result < 0) + result += HoursPerDay; + return (int) result; + } + + private static int MinFromTime(double t) + { + double result; + result = Math.floor(t / msPerMinute) % MinutesPerHour; + if (result < 0) + result += MinutesPerHour; + return (int) result; + } + + private static int SecFromTime(double t) + { + double result; + result = Math.floor(t / msPerSecond) % SecondsPerMinute; + if (result < 0) + result += SecondsPerMinute; + return (int) result; + } + + private static int msFromTime(double t) + { + double result; + result = t % msPerSecond; + if (result < 0) + result += msPerSecond; + return (int) result; + } + + private static double MakeTime(double hour, double min, + double sec, double ms) + { + return ((hour * MinutesPerHour + min) * SecondsPerMinute + sec) + * msPerSecond + ms; + } + + private static double MakeDay(double year, double month, double date) + { + year += Math.floor(month / 12); + + month = month % 12; + if (month < 0) + month += 12; + + double yearday = Math.floor(TimeFromYear(year) / msPerDay); + double monthday = DayFromMonth((int)month, (int)year); + + return yearday + monthday + date - 1; + } + + private static double MakeDate(double day, double time) + { + return day * msPerDay + time; + } + + private static double TimeClip(double d) + { + if (d != d || + d == Double.POSITIVE_INFINITY || + d == Double.NEGATIVE_INFINITY || + Math.abs(d) > HalfTimeDomain) + { + return ScriptRuntime.NaN; + } + if (d > 0.0) + return Math.floor(d + 0.); + else + return Math.ceil(d + 0.); + } + + /* end of ECMA helper functions */ + + /* find UTC time from given date... no 1900 correction! */ + private static double date_msecFromDate(double year, double mon, + double mday, double hour, + double min, double sec, + double msec) + { + double day; + double time; + double result; + + day = MakeDay(year, mon, mday); + time = MakeTime(hour, min, sec, msec); + result = MakeDate(day, time); + return result; + } + + /* compute the time in msec (unclipped) from the given args */ + private static final int MAXARGS = 7; + private static double date_msecFromArgs(Object[] args) + { + double array[] = new double[MAXARGS]; + int loop; + double d; + + for (loop = 0; loop < MAXARGS; loop++) { + if (loop < args.length) { + d = ScriptRuntime.toNumber(args[loop]); + if (d != d || Double.isInfinite(d)) { + return ScriptRuntime.NaN; + } + array[loop] = ScriptRuntime.toInteger(args[loop]); + } else { + if (loop == 2) { + array[loop] = 1; /* Default the date argument to 1. */ + } else { + array[loop] = 0; + } + } + } + + /* adjust 2-digit years into the 20th century */ + if (array[0] >= 0 && array[0] <= 99) + array[0] += 1900; + + return date_msecFromDate(array[0], array[1], array[2], + array[3], array[4], array[5], array[6]); + } + + private static double jsStaticFunction_UTC(Object[] args) + { + return TimeClip(date_msecFromArgs(args)); + } + + private static double date_parseString(String s) + { + int year = -1; + int mon = -1; + int mday = -1; + int hour = -1; + int min = -1; + int sec = -1; + char c = 0; + char si = 0; + int i = 0; + int n = -1; + double tzoffset = -1; + char prevc = 0; + int limit = 0; + boolean seenplusminus = false; + + limit = s.length(); + while (i < limit) { + c = s.charAt(i); + i++; + if (c <= ' ' || c == ',' || c == '-') { + if (i < limit) { + si = s.charAt(i); + if (c == '-' && '0' <= si && si <= '9') { + prevc = c; + } + } + continue; + } + if (c == '(') { /* comments) */ + int depth = 1; + while (i < limit) { + c = s.charAt(i); + i++; + if (c == '(') + depth++; + else if (c == ')') + if (--depth <= 0) + break; + } + continue; + } + if ('0' <= c && c <= '9') { + n = c - '0'; + while (i < limit && '0' <= (c = s.charAt(i)) && c <= '9') { + n = n * 10 + c - '0'; + i++; + } + + /* allow TZA before the year, so + * 'Wed Nov 05 21:49:11 GMT-0800 1997' + * works */ + + /* uses of seenplusminus allow : in TZA, so Java + * no-timezone style of GMT+4:30 works + */ + if ((prevc == '+' || prevc == '-')/* && year>=0 */) { + /* make ':' case below change tzoffset */ + seenplusminus = true; + + /* offset */ + if (n < 24) + n = n * 60; /* EG. "GMT-3" */ + else + n = n % 100 + n / 100 * 60; /* eg "GMT-0430" */ + if (prevc == '+') /* plus means east of GMT */ + n = -n; + if (tzoffset != 0 && tzoffset != -1) + return ScriptRuntime.NaN; + tzoffset = n; + } else if (n >= 70 || + (prevc == '/' && mon >= 0 && mday >= 0 + && year < 0)) + { + if (year >= 0) + return ScriptRuntime.NaN; + else if (c <= ' ' || c == ',' || c == '/' || i >= limit) + year = n < 100 ? n + 1900 : n; + else + return ScriptRuntime.NaN; + } else if (c == ':') { + if (hour < 0) + hour = /*byte*/ n; + else if (min < 0) + min = /*byte*/ n; + else + return ScriptRuntime.NaN; + } else if (c == '/') { + if (mon < 0) + mon = /*byte*/ n-1; + else if (mday < 0) + mday = /*byte*/ n; + else + return ScriptRuntime.NaN; + } else if (i < limit && c != ',' && c > ' ' && c != '-') { + return ScriptRuntime.NaN; + } else if (seenplusminus && n < 60) { /* handle GMT-3:30 */ + if (tzoffset < 0) + tzoffset -= n; + else + tzoffset += n; + } else if (hour >= 0 && min < 0) { + min = /*byte*/ n; + } else if (min >= 0 && sec < 0) { + sec = /*byte*/ n; + } else if (mday < 0) { + mday = /*byte*/ n; + } else { + return ScriptRuntime.NaN; + } + prevc = 0; + } else if (c == '/' || c == ':' || c == '+' || c == '-') { + prevc = c; + } else { + int st = i - 1; + while (i < limit) { + c = s.charAt(i); + if (!(('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z'))) + break; + i++; + } + int letterCount = i - st; + if (letterCount < 2) + return ScriptRuntime.NaN; + /* + * Use ported code from jsdate.c rather than the locale-specific + * date-parsing code from Java, to keep js and rhino consistent. + * Is this the right strategy? + */ + String wtb = "am;pm;" + +"monday;tuesday;wednesday;thursday;friday;" + +"saturday;sunday;" + +"january;february;march;april;may;june;" + +"july;august;september;october;november;december;" + +"gmt;ut;utc;est;edt;cst;cdt;mst;mdt;pst;pdt;"; + int index = 0; + for (int wtbOffset = 0; ;) { + int wtbNext = wtb.indexOf(';', wtbOffset); + if (wtbNext < 0) + return ScriptRuntime.NaN; + if (wtb.regionMatches(true, wtbOffset, s, st, letterCount)) + break; + wtbOffset = wtbNext + 1; + ++index; + } + if (index < 2) { + /* + * AM/PM. Count 12:30 AM as 00:30, 12:30 PM as + * 12:30, instead of blindly adding 12 if PM. + */ + if (hour > 12 || hour < 0) { + return ScriptRuntime.NaN; + } else if (index == 0) { + // AM + if (hour == 12) + hour = 0; + } else { + // PM + if (hour != 12) + hour += 12; + } + } else if ((index -= 2) < 7) { + // ignore week days + } else if ((index -= 7) < 12) { + // month + if (mon < 0) { + mon = index; + } else { + return ScriptRuntime.NaN; + } + } else { + index -= 12; + // timezones + switch (index) { + case 0 /* gmt */: tzoffset = 0; break; + case 1 /* ut */: tzoffset = 0; break; + case 2 /* utc */: tzoffset = 0; break; + case 3 /* est */: tzoffset = 5 * 60; break; + case 4 /* edt */: tzoffset = 4 * 60; break; + case 5 /* cst */: tzoffset = 6 * 60; break; + case 6 /* cdt */: tzoffset = 5 * 60; break; + case 7 /* mst */: tzoffset = 7 * 60; break; + case 8 /* mdt */: tzoffset = 6 * 60; break; + case 9 /* pst */: tzoffset = 8 * 60; break; + case 10 /* pdt */:tzoffset = 7 * 60; break; + default: Kit.codeBug(); + } + } + } + } + if (year < 0 || mon < 0 || mday < 0) + return ScriptRuntime.NaN; + if (sec < 0) + sec = 0; + if (min < 0) + min = 0; + if (hour < 0) + hour = 0; + + double msec = date_msecFromDate(year, mon, mday, hour, min, sec, 0); + if (tzoffset == -1) { /* no time zone specified, have to use local */ + return internalUTC(msec); + } else { + return msec + tzoffset * msPerMinute; + } + } + + private static String date_format(double t, int methodId) + { + StringBuffer result = new StringBuffer(60); + double local = LocalTime(t); + + /* Tue Oct 31 09:41:40 GMT-0800 (PST) 2000 */ + /* Tue Oct 31 2000 */ + /* 09:41:40 GMT-0800 (PST) */ + + if (methodId != Id_toTimeString) { + appendWeekDayName(result, WeekDay(local)); + result.append(' '); + appendMonthName(result, MonthFromTime(local)); + result.append(' '); + append0PaddedUint(result, DateFromTime(local), 2); + result.append(' '); + int year = YearFromTime(local); + if (year < 0) { + result.append('-'); + year = -year; + } + append0PaddedUint(result, year, 4); + if (methodId != Id_toDateString) + result.append(' '); + } + + if (methodId != Id_toDateString) { + append0PaddedUint(result, HourFromTime(local), 2); + result.append(':'); + append0PaddedUint(result, MinFromTime(local), 2); + result.append(':'); + append0PaddedUint(result, SecFromTime(local), 2); + + // offset from GMT in minutes. The offset includes daylight + // savings, if it applies. + int minutes = (int) Math.floor((LocalTZA + DaylightSavingTA(t)) + / msPerMinute); + // map 510 minutes to 0830 hours + int offset = (minutes / 60) * 100 + minutes % 60; + if (offset > 0) { + result.append(" GMT+"); + } else { + result.append(" GMT-"); + offset = -offset; + } + append0PaddedUint(result, offset, 4); + + if (timeZoneFormatter == null) + timeZoneFormatter = new java.text.SimpleDateFormat("zzz"); + + // Find an equivalent year before getting the timezone + // comment. See DaylightSavingTA. + if (t < 0.0 || t > 2145916800000.0) { + int equiv = EquivalentYear(YearFromTime(local)); + double day = MakeDay(equiv, MonthFromTime(t), DateFromTime(t)); + t = MakeDate(day, TimeWithinDay(t)); + } + result.append(" ("); + java.util.Date date = new Date((long) t); + synchronized (timeZoneFormatter) { + result.append(timeZoneFormatter.format(date)); + } + result.append(')'); + } + return result.toString(); + } + + /* the javascript constructor */ + private static Object jsConstructor(Object[] args) + { + NativeDate obj = new NativeDate(); + + // if called as a constructor with no args, + // return a new Date with the current time. + if (args.length == 0) { + obj.date = now(); + return obj; + } + + // if called with just one arg - + if (args.length == 1) { + Object arg0 = args[0]; + if (arg0 instanceof Scriptable) + arg0 = ((Scriptable) arg0).getDefaultValue(null); + double date; + if (arg0 instanceof String) { + // it's a string; parse it. + date = date_parseString((String)arg0); + } else { + // if it's not a string, use it as a millisecond date + date = ScriptRuntime.toNumber(arg0); + } + obj.date = TimeClip(date); + return obj; + } + + double time = date_msecFromArgs(args); + + if (!Double.isNaN(time) && !Double.isInfinite(time)) + time = TimeClip(internalUTC(time)); + + obj.date = time; + + return obj; + } + + private static String toLocale_helper(double t, int methodId) + { + java.text.DateFormat formatter; + switch (methodId) { + case Id_toLocaleString: + if (localeDateTimeFormatter == null) { + localeDateTimeFormatter + = DateFormat.getDateTimeInstance(DateFormat.LONG, + DateFormat.LONG); + } + formatter = localeDateTimeFormatter; + break; + case Id_toLocaleTimeString: + if (localeTimeFormatter == null) { + localeTimeFormatter + = DateFormat.getTimeInstance(DateFormat.LONG); + } + formatter = localeTimeFormatter; + break; + case Id_toLocaleDateString: + if (localeDateFormatter == null) { + localeDateFormatter + = DateFormat.getDateInstance(DateFormat.LONG); + } + formatter = localeDateFormatter; + break; + default: formatter = null; // unreachable + } + + synchronized (formatter) { + return formatter.format(new Date((long) t)); + } + } + + private static String js_toUTCString(double date) + { + StringBuffer result = new StringBuffer(60); + + appendWeekDayName(result, WeekDay(date)); + result.append(", "); + append0PaddedUint(result, DateFromTime(date), 2); + result.append(' '); + appendMonthName(result, MonthFromTime(date)); + result.append(' '); + int year = YearFromTime(date); + if (year < 0) { + result.append('-'); year = -year; + } + append0PaddedUint(result, year, 4); + result.append(' '); + append0PaddedUint(result, HourFromTime(date), 2); + result.append(':'); + append0PaddedUint(result, MinFromTime(date), 2); + result.append(':'); + append0PaddedUint(result, SecFromTime(date), 2); + result.append(" GMT"); + return result.toString(); + } + + private static void append0PaddedUint(StringBuffer sb, int i, int minWidth) + { + if (i < 0) Kit.codeBug(); + int scale = 1; + --minWidth; + if (i >= 10) { + if (i < 1000 * 1000 * 1000) { + for (;;) { + int newScale = scale * 10; + if (i < newScale) { break; } + --minWidth; + scale = newScale; + } + } else { + // Separated case not to check against 10 * 10^9 overflow + minWidth -= 9; + scale = 1000 * 1000 * 1000; + } + } + while (minWidth > 0) { + sb.append('0'); + --minWidth; + } + while (scale != 1) { + sb.append((char)('0' + (i / scale))); + i %= scale; + scale /= 10; + } + sb.append((char)('0' + i)); + } + + private static void appendMonthName(StringBuffer sb, int index) + { + // Take advantage of the fact that all month abbreviations + // have the same length to minimize amount of strings runtime has + // to keep in memory + String months = "Jan"+"Feb"+"Mar"+"Apr"+"May"+"Jun" + +"Jul"+"Aug"+"Sep"+"Oct"+"Nov"+"Dec"; + index *= 3; + for (int i = 0; i != 3; ++i) { + sb.append(months.charAt(index + i)); + } + } + + private static void appendWeekDayName(StringBuffer sb, int index) + { + String days = "Sun"+"Mon"+"Tue"+"Wed"+"Thu"+"Fri"+"Sat"; + index *= 3; + for (int i = 0; i != 3; ++i) { + sb.append(days.charAt(index + i)); + } + } + + private static double makeTime(double date, Object[] args, int methodId) + { + int maxargs; + boolean local = true; + switch (methodId) { + case Id_setUTCMilliseconds: + local = false; + // fallthrough + case Id_setMilliseconds: + maxargs = 1; + break; + + case Id_setUTCSeconds: + local = false; + // fallthrough + case Id_setSeconds: + maxargs = 2; + break; + + case Id_setUTCMinutes: + local = false; + // fallthrough + case Id_setMinutes: + maxargs = 3; + break; + + case Id_setUTCHours: + local = false; + // fallthrough + case Id_setHours: + maxargs = 4; + break; + + default: + Kit.codeBug(); + maxargs = 0; + } + + int i; + double conv[] = new double[4]; + double hour, min, sec, msec; + double lorutime; /* Local or UTC version of date */ + + double time; + double result; + + /* just return NaN if the date is already NaN */ + if (date != date) + return date; + + /* Satisfy the ECMA rule that if a function is called with + * fewer arguments than the specified formal arguments, the + * remaining arguments are set to undefined. Seems like all + * the Date.setWhatever functions in ECMA are only varargs + * beyond the first argument; this should be set to undefined + * if it's not given. This means that "d = new Date(); + * d.setMilliseconds()" returns NaN. Blech. + */ + if (args.length == 0) + args = ScriptRuntime.padArguments(args, 1); + + for (i = 0; i < args.length && i < maxargs; i++) { + conv[i] = ScriptRuntime.toNumber(args[i]); + + // limit checks that happen in MakeTime in ECMA. + if (conv[i] != conv[i] || Double.isInfinite(conv[i])) { + return ScriptRuntime.NaN; + } + conv[i] = ScriptRuntime.toInteger(conv[i]); + } + + if (local) + lorutime = LocalTime(date); + else + lorutime = date; + + i = 0; + int stop = args.length; + + if (maxargs >= 4 && i < stop) + hour = conv[i++]; + else + hour = HourFromTime(lorutime); + + if (maxargs >= 3 && i < stop) + min = conv[i++]; + else + min = MinFromTime(lorutime); + + if (maxargs >= 2 && i < stop) + sec = conv[i++]; + else + sec = SecFromTime(lorutime); + + if (maxargs >= 1 && i < stop) + msec = conv[i++]; + else + msec = msFromTime(lorutime); + + time = MakeTime(hour, min, sec, msec); + result = MakeDate(Day(lorutime), time); + + if (local) + result = internalUTC(result); + date = TimeClip(result); + + return date; + } + + private static double makeDate(double date, Object[] args, int methodId) + { + int maxargs; + boolean local = true; + switch (methodId) { + case Id_setUTCDate: + local = false; + // fallthrough + case Id_setDate: + maxargs = 1; + break; + + case Id_setUTCMonth: + local = false; + // fallthrough + case Id_setMonth: + maxargs = 2; + break; + + case Id_setUTCFullYear: + local = false; + // fallthrough + case Id_setFullYear: + maxargs = 3; + break; + + default: + Kit.codeBug(); + maxargs = 0; + } + + int i; + double conv[] = new double[3]; + double year, month, day; + double lorutime; /* local or UTC version of date */ + double result; + + /* See arg padding comment in makeTime.*/ + if (args.length == 0) + args = ScriptRuntime.padArguments(args, 1); + + for (i = 0; i < args.length && i < maxargs; i++) { + conv[i] = ScriptRuntime.toNumber(args[i]); + + // limit checks that happen in MakeDate in ECMA. + if (conv[i] != conv[i] || Double.isInfinite(conv[i])) { + return ScriptRuntime.NaN; + } + conv[i] = ScriptRuntime.toInteger(conv[i]); + } + + /* return NaN if date is NaN and we're not setting the year, + * If we are, use 0 as the time. */ + if (date != date) { + if (args.length < 3) { + return ScriptRuntime.NaN; + } else { + lorutime = 0; + } + } else { + if (local) + lorutime = LocalTime(date); + else + lorutime = date; + } + + i = 0; + int stop = args.length; + + if (maxargs >= 3 && i < stop) + year = conv[i++]; + else + year = YearFromTime(lorutime); + + if (maxargs >= 2 && i < stop) + month = conv[i++]; + else + month = MonthFromTime(lorutime); + + if (maxargs >= 1 && i < stop) + day = conv[i++]; + else + day = DateFromTime(lorutime); + + day = MakeDay(year, month, day); /* day within year */ + result = MakeDate(day, TimeWithinDay(lorutime)); + + if (local) + result = internalUTC(result); + + date = TimeClip(result); + + return date; + } + +// #string_id_map# + + @Override + protected int findPrototypeId(String s) + { + int id; +// #generated# Last update: 2007-05-09 08:15:38 EDT + L0: { id = 0; String X = null; int c; + L: switch (s.length()) { + case 6: X="getDay";id=Id_getDay; break L; + case 7: switch (s.charAt(3)) { + case 'D': c=s.charAt(0); + if (c=='g') { X="getDate";id=Id_getDate; } + else if (c=='s') { X="setDate";id=Id_setDate; } + break L; + case 'T': c=s.charAt(0); + if (c=='g') { X="getTime";id=Id_getTime; } + else if (c=='s') { X="setTime";id=Id_setTime; } + break L; + case 'Y': c=s.charAt(0); + if (c=='g') { X="getYear";id=Id_getYear; } + else if (c=='s') { X="setYear";id=Id_setYear; } + break L; + case 'u': X="valueOf";id=Id_valueOf; break L; + } break L; + case 8: switch (s.charAt(3)) { + case 'H': c=s.charAt(0); + if (c=='g') { X="getHours";id=Id_getHours; } + else if (c=='s') { X="setHours";id=Id_setHours; } + break L; + case 'M': c=s.charAt(0); + if (c=='g') { X="getMonth";id=Id_getMonth; } + else if (c=='s') { X="setMonth";id=Id_setMonth; } + break L; + case 'o': X="toSource";id=Id_toSource; break L; + case 't': X="toString";id=Id_toString; break L; + } break L; + case 9: X="getUTCDay";id=Id_getUTCDay; break L; + case 10: c=s.charAt(3); + if (c=='M') { + c=s.charAt(0); + if (c=='g') { X="getMinutes";id=Id_getMinutes; } + else if (c=='s') { X="setMinutes";id=Id_setMinutes; } + } + else if (c=='S') { + c=s.charAt(0); + if (c=='g') { X="getSeconds";id=Id_getSeconds; } + else if (c=='s') { X="setSeconds";id=Id_setSeconds; } + } + else if (c=='U') { + c=s.charAt(0); + if (c=='g') { X="getUTCDate";id=Id_getUTCDate; } + else if (c=='s') { X="setUTCDate";id=Id_setUTCDate; } + } + break L; + case 11: switch (s.charAt(3)) { + case 'F': c=s.charAt(0); + if (c=='g') { X="getFullYear";id=Id_getFullYear; } + else if (c=='s') { X="setFullYear";id=Id_setFullYear; } + break L; + case 'M': X="toGMTString";id=Id_toGMTString; break L; + case 'T': X="toUTCString";id=Id_toUTCString; break L; + case 'U': c=s.charAt(0); + if (c=='g') { + c=s.charAt(9); + if (c=='r') { X="getUTCHours";id=Id_getUTCHours; } + else if (c=='t') { X="getUTCMonth";id=Id_getUTCMonth; } + } + else if (c=='s') { + c=s.charAt(9); + if (c=='r') { X="setUTCHours";id=Id_setUTCHours; } + else if (c=='t') { X="setUTCMonth";id=Id_setUTCMonth; } + } + break L; + case 's': X="constructor";id=Id_constructor; break L; + } break L; + case 12: c=s.charAt(2); + if (c=='D') { X="toDateString";id=Id_toDateString; } + else if (c=='T') { X="toTimeString";id=Id_toTimeString; } + break L; + case 13: c=s.charAt(0); + if (c=='g') { + c=s.charAt(6); + if (c=='M') { X="getUTCMinutes";id=Id_getUTCMinutes; } + else if (c=='S') { X="getUTCSeconds";id=Id_getUTCSeconds; } + } + else if (c=='s') { + c=s.charAt(6); + if (c=='M') { X="setUTCMinutes";id=Id_setUTCMinutes; } + else if (c=='S') { X="setUTCSeconds";id=Id_setUTCSeconds; } + } + break L; + case 14: c=s.charAt(0); + if (c=='g') { X="getUTCFullYear";id=Id_getUTCFullYear; } + else if (c=='s') { X="setUTCFullYear";id=Id_setUTCFullYear; } + else if (c=='t') { X="toLocaleString";id=Id_toLocaleString; } + break L; + case 15: c=s.charAt(0); + if (c=='g') { X="getMilliseconds";id=Id_getMilliseconds; } + else if (c=='s') { X="setMilliseconds";id=Id_setMilliseconds; } + break L; + case 17: X="getTimezoneOffset";id=Id_getTimezoneOffset; break L; + case 18: c=s.charAt(0); + if (c=='g') { X="getUTCMilliseconds";id=Id_getUTCMilliseconds; } + else if (c=='s') { X="setUTCMilliseconds";id=Id_setUTCMilliseconds; } + else if (c=='t') { + c=s.charAt(8); + if (c=='D') { X="toLocaleDateString";id=Id_toLocaleDateString; } + else if (c=='T') { X="toLocaleTimeString";id=Id_toLocaleTimeString; } + } + break L; + } + if (X!=null && X!=s && !X.equals(s)) id = 0; + break L0; + } +// #/generated# + return id; + } + + private static final int + ConstructorId_now = -3, + ConstructorId_parse = -2, + ConstructorId_UTC = -1, + + Id_constructor = 1, + Id_toString = 2, + Id_toTimeString = 3, + Id_toDateString = 4, + Id_toLocaleString = 5, + Id_toLocaleTimeString = 6, + Id_toLocaleDateString = 7, + Id_toUTCString = 8, + Id_toSource = 9, + Id_valueOf = 10, + Id_getTime = 11, + Id_getYear = 12, + Id_getFullYear = 13, + Id_getUTCFullYear = 14, + Id_getMonth = 15, + Id_getUTCMonth = 16, + Id_getDate = 17, + Id_getUTCDate = 18, + Id_getDay = 19, + Id_getUTCDay = 20, + Id_getHours = 21, + Id_getUTCHours = 22, + Id_getMinutes = 23, + Id_getUTCMinutes = 24, + Id_getSeconds = 25, + Id_getUTCSeconds = 26, + Id_getMilliseconds = 27, + Id_getUTCMilliseconds = 28, + Id_getTimezoneOffset = 29, + Id_setTime = 30, + Id_setMilliseconds = 31, + Id_setUTCMilliseconds = 32, + Id_setSeconds = 33, + Id_setUTCSeconds = 34, + Id_setMinutes = 35, + Id_setUTCMinutes = 36, + Id_setHours = 37, + Id_setUTCHours = 38, + Id_setDate = 39, + Id_setUTCDate = 40, + Id_setMonth = 41, + Id_setUTCMonth = 42, + Id_setFullYear = 43, + Id_setUTCFullYear = 44, + Id_setYear = 45, + + MAX_PROTOTYPE_ID = 45; + + private static final int + Id_toGMTString = Id_toUTCString; // Alias, see Ecma B.2.6 +// #/string_id_map# + + /* cached values */ + private static java.util.TimeZone thisTimeZone; + private static double LocalTZA; + private static java.text.DateFormat timeZoneFormatter; + private static java.text.DateFormat localeDateTimeFormatter; + private static java.text.DateFormat localeDateFormatter; + private static java.text.DateFormat localeTimeFormatter; + + private double date; +} + + diff --git a/org/mozilla/javascript/NativeError.java b/org/mozilla/javascript/NativeError.java new file mode 100644 index 0000000..4d8f364 --- /dev/null +++ b/org/mozilla/javascript/NativeError.java @@ -0,0 +1,232 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-1999 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Igor Bukanov + * Roger Lawrence + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + + +package org.mozilla.javascript; + +/** + * + * The class of error objects + * + * ECMA 15.11 + */ +final class NativeError extends IdScriptableObject +{ + static final long serialVersionUID = -5338413581437645187L; + + private static final Object ERROR_TAG = "Error"; + + static void init(Scriptable scope, boolean sealed) + { + NativeError obj = new NativeError(); + ScriptableObject.putProperty(obj, "name", "Error"); + ScriptableObject.putProperty(obj, "message", ""); + ScriptableObject.putProperty(obj, "fileName", ""); + ScriptableObject.putProperty(obj, "lineNumber", new Integer(0)); + obj.exportAsJSClass(MAX_PROTOTYPE_ID, scope, sealed); + } + + static NativeError make(Context cx, Scriptable scope, + IdFunctionObject ctorObj, Object[] args) + { + Scriptable proto = (Scriptable)(ctorObj.get("prototype", ctorObj)); + + NativeError obj = new NativeError(); + obj.setPrototype(proto); + obj.setParentScope(scope); + + int arglen = args.length; + if (arglen >= 1) { + ScriptableObject.putProperty(obj, "message", + ScriptRuntime.toString(args[0])); + if (arglen >= 2) { + ScriptableObject.putProperty(obj, "fileName", args[1]); + if (arglen >= 3) { + int line = ScriptRuntime.toInt32(args[2]); + ScriptableObject.putProperty(obj, "lineNumber", + new Integer(line)); + } + } + } + if(arglen < 3 && cx.hasFeature(Context.FEATURE_LOCATION_INFORMATION_IN_ERROR)) { + // Fill in fileName and lineNumber automatically when not specified + // explicitly, see Bugzilla issue #342807 + int[] linep = new int[1]; + String fileName = Context.getSourcePositionFromStack(linep); + ScriptableObject.putProperty(obj, "lineNumber", + new Integer(linep[0])); + if(arglen < 2) { + ScriptableObject.putProperty(obj, "fileName", fileName); + } + } + return obj; + } + + @Override + public String getClassName() + { + return "Error"; + } + + @Override + public String toString() + { + return js_toString(this); + } + + @Override + protected void initPrototypeId(int id) + { + String s; + int arity; + switch (id) { + case Id_constructor: arity=1; s="constructor"; break; + case Id_toString: arity=0; s="toString"; break; + case Id_toSource: arity=0; s="toSource"; break; + default: throw new IllegalArgumentException(String.valueOf(id)); + } + initPrototypeMethod(ERROR_TAG, id, s, arity); + } + + @Override + public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope, + Scriptable thisObj, Object[] args) + { + if (!f.hasTag(ERROR_TAG)) { + return super.execIdCall(f, cx, scope, thisObj, args); + } + int id = f.methodId(); + switch (id) { + case Id_constructor: + return make(cx, scope, f, args); + + case Id_toString: + return js_toString(thisObj); + + case Id_toSource: + return js_toSource(cx, scope, thisObj); + } + throw new IllegalArgumentException(String.valueOf(id)); + } + + private static String js_toString(Scriptable thisObj) + { + return getString(thisObj, "name")+": "+getString(thisObj, "message"); + } + + private static String js_toSource(Context cx, Scriptable scope, + Scriptable thisObj) + { + // Emulation of SpiderMonkey behavior + Object name = ScriptableObject.getProperty(thisObj, "name"); + Object message = ScriptableObject.getProperty(thisObj, "message"); + Object fileName = ScriptableObject.getProperty(thisObj, "fileName"); + Object lineNumber = ScriptableObject.getProperty(thisObj, "lineNumber"); + + StringBuffer sb = new StringBuffer(); + sb.append("(new "); + if (name == NOT_FOUND) { + name = Undefined.instance; + } + sb.append(ScriptRuntime.toString(name)); + sb.append("("); + if (message != NOT_FOUND + || fileName != NOT_FOUND + || lineNumber != NOT_FOUND) + { + if (message == NOT_FOUND) { + message = ""; + } + sb.append(ScriptRuntime.uneval(cx, scope, message)); + if (fileName != NOT_FOUND || lineNumber != NOT_FOUND) { + sb.append(", "); + if (fileName == NOT_FOUND) { + fileName = ""; + } + sb.append(ScriptRuntime.uneval(cx, scope, fileName)); + if (lineNumber != NOT_FOUND) { + int line = ScriptRuntime.toInt32(lineNumber); + if (line != 0) { + sb.append(", "); + sb.append(ScriptRuntime.toString(line)); + } + } + } + } + sb.append("))"); + return sb.toString(); + } + + private static String getString(Scriptable obj, String id) + { + Object value = ScriptableObject.getProperty(obj, id); + if (value == NOT_FOUND) return ""; + return ScriptRuntime.toString(value); + } + + @Override + protected int findPrototypeId(String s) + { + int id; +// #string_id_map# +// #generated# Last update: 2007-05-09 08:15:45 EDT + L0: { id = 0; String X = null; int c; + int s_length = s.length(); + if (s_length==8) { + c=s.charAt(3); + if (c=='o') { X="toSource";id=Id_toSource; } + else if (c=='t') { X="toString";id=Id_toString; } + } + else if (s_length==11) { X="constructor";id=Id_constructor; } + if (X!=null && X!=s && !X.equals(s)) id = 0; + break L0; + } +// #/generated# + return id; + } + + private static final int + Id_constructor = 1, + Id_toString = 2, + Id_toSource = 3, + + MAX_PROTOTYPE_ID = 3; + +// #/string_id_map# +} diff --git a/org/mozilla/javascript/NativeFunction.java b/org/mozilla/javascript/NativeFunction.java new file mode 100644 index 0000000..ffa6a86 --- /dev/null +++ b/org/mozilla/javascript/NativeFunction.java @@ -0,0 +1,172 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-1999 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Norris Boyd + * Igor Bukanov + * Bob Jervis + * Roger Lawrence + * Mike McCabe + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +package org.mozilla.javascript; + +import org.mozilla.javascript.debug.DebuggableScript; + +/** + * This class implements the Function native object. + * See ECMA 15.3. + * @author Norris Boyd + */ +public abstract class NativeFunction extends BaseFunction +{ + + public final void initScriptFunction(Context cx, Scriptable scope) + { + ScriptRuntime.setFunctionProtoAndParent(this, scope); + } + + /** + * @param indent How much to indent the decompiled result + * + * @param flags Flags specifying format of decompilation output + */ + @Override + final String decompile(int indent, int flags) + { + String encodedSource = getEncodedSource(); + if (encodedSource == null) { + return super.decompile(indent, flags); + } else { + UintMap properties = new UintMap(1); + properties.put(Decompiler.INITIAL_INDENT_PROP, indent); + return Decompiler.decompile(encodedSource, flags, properties); + } + } + + @Override + public int getLength() + { + int paramCount = getParamCount(); + if (getLanguageVersion() != Context.VERSION_1_2) { + return paramCount; + } + Context cx = Context.getContext(); + NativeCall activation = ScriptRuntime.findFunctionActivation(cx, this); + if (activation == null) { + return paramCount; + } + return activation.originalArgs.length; + } + + @Override + public int getArity() + { + return getParamCount(); + } + + /** + * @deprecated Use {@link BaseFunction#getFunctionName()} instead. + * For backwards compatibility keep an old method name used by + * Batik and possibly others. + */ + public String jsGet_name() + { + return getFunctionName(); + } + + /** + * Get encoded source string. + */ + public String getEncodedSource() + { + return null; + } + + public DebuggableScript getDebuggableView() + { + return null; + } + + /** + * Resume execution of a suspended generator. + * @param cx The current context + * @param scope Scope for the parent generator function + * @param operation The resumption operation (next, send, etc.. ) + * @param state The generator state (has locals, stack, etc.) + * @param value The return value of yield (if required). + * @return The next yielded value (if any) + */ + public Object resumeGenerator(Context cx, Scriptable scope, + int operation, Object state, Object value) + { + throw new EvaluatorException("resumeGenerator() not implemented"); + } + + + protected abstract int getLanguageVersion(); + + /** + * Get number of declared parameters. It should be 0 for scripts. + */ + protected abstract int getParamCount(); + + /** + * Get number of declared parameters and variables defined through var + * statements. + */ + protected abstract int getParamAndVarCount(); + + /** + * Get parameter or variable name. + * If index < {@link #getParamCount()}, then return the name of the + * corresponding parameter. Otherwise return the name of variable. + */ + protected abstract String getParamOrVarName(int index); + + /** + * Get parameter or variable const-ness. + * If index < {@link #getParamCount()}, then return the const-ness + * of the corresponding parameter. Otherwise return whether the variable is + * const. + */ + protected boolean getParamOrVarConst(int index) + { + // By default return false to preserve compatibility with existing + // classes subclassing this class, which are mostly generated by jsc + // from earlier Rhino versions. See Bugzilla #396117. + return false; + } +} + diff --git a/org/mozilla/javascript/NativeGenerator.java b/org/mozilla/javascript/NativeGenerator.java new file mode 100644 index 0000000..46c993b --- /dev/null +++ b/org/mozilla/javascript/NativeGenerator.java @@ -0,0 +1,288 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Contributor(s): + * Norris Boyd + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +package org.mozilla.javascript; + +/** + * This class implements generator objects. See + * http://developer.mozilla.org/en/docs/New_in_JavaScript_1.7#Generators + * + * @author Norris Boyd + */ +public final class NativeGenerator extends IdScriptableObject { + private static final long serialVersionUID = 1645892441041347273L; + + private static final Object GENERATOR_TAG = "Generator"; + + static NativeGenerator init(ScriptableObject scope, boolean sealed) { + // Generator + // Can't use "NativeGenerator().exportAsJSClass" since we don't want + // to define "Generator" as a constructor in the top-level scope. + + NativeGenerator prototype = new NativeGenerator(); + if (scope != null) { + prototype.setParentScope(scope); + prototype.setPrototype(getObjectPrototype(scope)); + } + prototype.activatePrototypeMap(MAX_PROTOTYPE_ID); + if (sealed) { + prototype.sealObject(); + } + + // Need to access Generator prototype when constructing + // Generator instances, but don't have a generator constructor + // to use to find the prototype. Use the "associateValue" + // approach instead. + if (scope != null) { + scope.associateValue(GENERATOR_TAG, prototype); + } + + return prototype; + } + + /** + * Only for constructing the prototype object. + */ + private NativeGenerator() { } + + public NativeGenerator(Scriptable scope, NativeFunction function, + Object savedState) + { + this.function = function; + this.savedState = savedState; + // Set parent and prototype properties. Since we don't have a + // "Generator" constructor in the top scope, we stash the + // prototype in the top scope's associated value. + Scriptable top = ScriptableObject.getTopLevelScope(scope); + this.setParentScope(top); + NativeGenerator prototype = (NativeGenerator) + ScriptableObject.getTopScopeValue(top, GENERATOR_TAG); + this.setPrototype(prototype); + } + + public static final int GENERATOR_SEND = 0, + GENERATOR_THROW = 1, + GENERATOR_CLOSE = 2; + + @Override + public String getClassName() { + return "Generator"; + } + + /** + * Close the generator if it is still open. + */ + @Override + public void finalize() throws Throwable { + if (savedState != null) { + // This is a little tricky since we are most likely running in + // a different thread. We need to get a Context to run this, and + // we must call "doTopCall" since this will likely be the outermost + // JavaScript frame on this thread. + Context cx = Context.getCurrentContext(); + ContextFactory factory = cx != null ? cx.getFactory() + : ContextFactory.getGlobal(); + factory.call(new CloseGeneratorAction(this)); + } + } + + private static class CloseGeneratorAction implements ContextAction { + private NativeGenerator generator; + + CloseGeneratorAction(NativeGenerator generator) { + this.generator = generator; + } + + public Object run(Context cx) { + Scriptable scope = ScriptableObject.getTopLevelScope(generator); + Callable closeGenerator = new Callable() { + public Object call(Context cx, Scriptable scope, + Scriptable thisObj, Object[] args) { + return ((NativeGenerator)thisObj).resume(cx, scope, + GENERATOR_CLOSE, new GeneratorClosedException()); + } + }; + return ScriptRuntime.doTopCall(closeGenerator, cx, scope, + generator, null); + } + } + + @Override + protected void initPrototypeId(int id) { + String s; + int arity; + switch (id) { + case Id_close: arity=1; s="close"; break; + case Id_next: arity=1; s="next"; break; + case Id_send: arity=0; s="send"; break; + case Id_throw: arity=0; s="throw"; break; + case Id___iterator__: arity=1; s="__iterator__"; break; + default: throw new IllegalArgumentException(String.valueOf(id)); + } + initPrototypeMethod(GENERATOR_TAG, id, s, arity); + } + + @Override + public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope, + Scriptable thisObj, Object[] args) + { + if (!f.hasTag(GENERATOR_TAG)) { + return super.execIdCall(f, cx, scope, thisObj, args); + } + int id = f.methodId(); + + if (!(thisObj instanceof NativeGenerator)) + throw incompatibleCallError(f); + + NativeGenerator generator = (NativeGenerator) thisObj; + + switch (id) { + + case Id_close: + // need to run any pending finally clauses + return generator.resume(cx, scope, GENERATOR_CLOSE, + new GeneratorClosedException()); + + case Id_next: + // arguments to next() are ignored + generator.firstTime = false; + return generator.resume(cx, scope, GENERATOR_SEND, + Undefined.instance); + + case Id_send: { + Object arg = args.length > 0 ? args[0] : Undefined.instance; + if (generator.firstTime && !arg.equals(Undefined.instance)) { + throw ScriptRuntime.typeError0("msg.send.newborn"); + } + return generator.resume(cx, scope, GENERATOR_SEND, arg); + } + + case Id_throw: + return generator.resume(cx, scope, GENERATOR_THROW, + args.length > 0 ? args[0] : Undefined.instance); + + case Id___iterator__: + return thisObj; + + default: + throw new IllegalArgumentException(String.valueOf(id)); + } + } + + private Object resume(Context cx, Scriptable scope, int operation, + Object value) + { + if (savedState == null) { + if (operation == GENERATOR_CLOSE) + return Undefined.instance; + Object thrown; + if (operation == GENERATOR_THROW) { + thrown = value; + } else { + thrown = NativeIterator.getStopIterationObject(scope); + } + throw new JavaScriptException(thrown, lineSource, lineNumber); + } + try { + synchronized (this) { + // generator execution is necessarily single-threaded and + // non-reentrant. + // See https://bugzilla.mozilla.org/show_bug.cgi?id=349263 + if (locked) + throw ScriptRuntime.typeError0("msg.already.exec.gen"); + locked = true; + } + return function.resumeGenerator(cx, scope, operation, savedState, + value); + } catch (GeneratorClosedException e) { + // On closing a generator in the compile path, the generator + // throws a special exception. This ensures execution of all pending + // finalizers and will not get caught by user code. + return Undefined.instance; + } catch (RhinoException e) { + lineNumber = e.lineNumber(); + lineSource = e.lineSource(); + savedState = null; + throw e; + } finally { + synchronized (this) { + locked = false; + } + if (operation == GENERATOR_CLOSE) + savedState = null; + } + } + +// #string_id_map# + + @Override + protected int findPrototypeId(String s) { + int id; +// #generated# Last update: 2007-06-14 13:13:03 EDT + L0: { id = 0; String X = null; int c; + int s_length = s.length(); + if (s_length==4) { + c=s.charAt(0); + if (c=='n') { X="next";id=Id_next; } + else if (c=='s') { X="send";id=Id_send; } + } + else if (s_length==5) { + c=s.charAt(0); + if (c=='c') { X="close";id=Id_close; } + else if (c=='t') { X="throw";id=Id_throw; } + } + else if (s_length==12) { X="__iterator__";id=Id___iterator__; } + if (X!=null && X!=s && !X.equals(s)) id = 0; + break L0; + } +// #/generated# + return id; + } + + private static final int + Id_close = 1, + Id_next = 2, + Id_send = 3, + Id_throw = 4, + Id___iterator__ = 5, + MAX_PROTOTYPE_ID = 5; + +// #/string_id_map# + private NativeFunction function; + private Object savedState; + private String lineSource; + private int lineNumber; + private boolean firstTime = true; + private boolean locked; + + public static class GeneratorClosedException extends RuntimeException { + private static final long serialVersionUID = 2561315658662379681L; + } +} diff --git a/org/mozilla/javascript/NativeGlobal.java b/org/mozilla/javascript/NativeGlobal.java new file mode 100644 index 0000000..a65fc08 --- /dev/null +++ b/org/mozilla/javascript/NativeGlobal.java @@ -0,0 +1,795 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-1999 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Norris Boyd + * Igor Bukanov + * Mike McCabe + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +package org.mozilla.javascript; + +import java.io.Serializable; + +import org.mozilla.javascript.xml.XMLLib; + +/** + * This class implements the global native object (function and value + * properties only). + * + * See ECMA 15.1.[12]. + * + * @author Mike Shaver + */ + +public class NativeGlobal implements Serializable, IdFunctionCall +{ + static final long serialVersionUID = 6080442165748707530L; + + public static void init(Context cx, Scriptable scope, boolean sealed) { + NativeGlobal obj = new NativeGlobal(); + + for (int id = 1; id <= LAST_SCOPE_FUNCTION_ID; ++id) { + String name; + int arity = 1; + switch (id) { + case Id_decodeURI: + name = "decodeURI"; + break; + case Id_decodeURIComponent: + name = "decodeURIComponent"; + break; + case Id_encodeURI: + name = "encodeURI"; + break; + case Id_encodeURIComponent: + name = "encodeURIComponent"; + break; + case Id_escape: + name = "escape"; + break; + case Id_eval: + name = "eval"; + break; + case Id_isFinite: + name = "isFinite"; + break; + case Id_isNaN: + name = "isNaN"; + break; + case Id_isXMLName: + name = "isXMLName"; + break; + case Id_parseFloat: + name = "parseFloat"; + break; + case Id_parseInt: + name = "parseInt"; + arity = 2; + break; + case Id_unescape: + name = "unescape"; + break; + case Id_uneval: + name = "uneval"; + break; + default: + throw Kit.codeBug(); + } + IdFunctionObject f = new IdFunctionObject(obj, FTAG, id, name, + arity, scope); + if (sealed) { + f.sealObject(); + } + f.exportAsScopeProperty(); + } + + ScriptableObject.defineProperty( + scope, "NaN", ScriptRuntime.NaNobj, + ScriptableObject.DONTENUM); + ScriptableObject.defineProperty( + scope, "Infinity", + ScriptRuntime.wrapNumber(Double.POSITIVE_INFINITY), + ScriptableObject.DONTENUM); + ScriptableObject.defineProperty( + scope, "undefined", Undefined.instance, + ScriptableObject.DONTENUM); + + String[] errorMethods = { + "ConversionError", + "EvalError", + "RangeError", + "ReferenceError", + "SyntaxError", + "TypeError", + "URIError", + "InternalError", + "JavaException" + }; + + /* + Each error constructor gets its own Error object as a prototype, + with the 'name' property set to the name of the error. + */ + for (int i = 0; i < errorMethods.length; i++) { + String name = errorMethods[i]; + Scriptable errorProto = ScriptRuntime. + newObject(cx, scope, "Error", + ScriptRuntime.emptyArgs); + errorProto.put("name", errorProto, name); + if (sealed) { + if (errorProto instanceof ScriptableObject) { + ((ScriptableObject)errorProto).sealObject(); + } + } + IdFunctionObject ctor = new IdFunctionObject(obj, FTAG, + Id_new_CommonError, + name, 1, scope); + ctor.markAsConstructor(errorProto); + if (sealed) { + ctor.sealObject(); + } + ctor.exportAsScopeProperty(); + } + } + + public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope, + Scriptable thisObj, Object[] args) + { + if (f.hasTag(FTAG)) { + int methodId = f.methodId(); + switch (methodId) { + case Id_decodeURI: + case Id_decodeURIComponent: { + String str = ScriptRuntime.toString(args, 0); + return decode(str, methodId == Id_decodeURI); + } + + case Id_encodeURI: + case Id_encodeURIComponent: { + String str = ScriptRuntime.toString(args, 0); + return encode(str, methodId == Id_encodeURI); + } + + case Id_escape: + return js_escape(args); + + case Id_eval: + return js_eval(cx, scope, thisObj, args); + + case Id_isFinite: { + boolean result; + if (args.length < 1) { + result = false; + } else { + double d = ScriptRuntime.toNumber(args[0]); + result = (d == d + && d != Double.POSITIVE_INFINITY + && d != Double.NEGATIVE_INFINITY); + } + return ScriptRuntime.wrapBoolean(result); + } + + case Id_isNaN: { + // The global method isNaN, as per ECMA-262 15.1.2.6. + boolean result; + if (args.length < 1) { + result = true; + } else { + double d = ScriptRuntime.toNumber(args[0]); + result = (d != d); + } + return ScriptRuntime.wrapBoolean(result); + } + + case Id_isXMLName: { + Object name = (args.length == 0) + ? Undefined.instance : args[0]; + XMLLib xmlLib = XMLLib.extractFromScope(scope); + return ScriptRuntime.wrapBoolean( + xmlLib.isXMLName(cx, name)); + } + + case Id_parseFloat: + return js_parseFloat(args); + + case Id_parseInt: + return js_parseInt(args); + + case Id_unescape: + return js_unescape(args); + + case Id_uneval: { + Object value = (args.length != 0) + ? args[0] : Undefined.instance; + return ScriptRuntime.uneval(cx, scope, value); + } + + case Id_new_CommonError: + // The implementation of all the ECMA error constructors + // (SyntaxError, TypeError, etc.) + return NativeError.make(cx, scope, f, args); + } + } + throw f.unknown(); + } + + /** + * The global method parseInt, as per ECMA-262 15.1.2.2. + */ + private Object js_parseInt(Object[] args) { + String s = ScriptRuntime.toString(args, 0); + int radix = ScriptRuntime.toInt32(args, 1); + + int len = s.length(); + if (len == 0) + return ScriptRuntime.NaNobj; + + boolean negative = false; + int start = 0; + char c; + do { + c = s.charAt(start); + if (!Character.isWhitespace(c)) + break; + start++; + } while (start < len); + + if (c == '+' || (negative = (c == '-'))) + start++; + + final int NO_RADIX = -1; + if (radix == 0) { + radix = NO_RADIX; + } else if (radix < 2 || radix > 36) { + return ScriptRuntime.NaNobj; + } else if (radix == 16 && len - start > 1 && s.charAt(start) == '0') { + c = s.charAt(start+1); + if (c == 'x' || c == 'X') + start += 2; + } + + if (radix == NO_RADIX) { + radix = 10; + if (len - start > 1 && s.charAt(start) == '0') { + c = s.charAt(start+1); + if (c == 'x' || c == 'X') { + radix = 16; + start += 2; + } else if ('0' <= c && c <= '9') { + radix = 8; + start++; + } + } + } + + double d = ScriptRuntime.stringToNumber(s, start, radix); + return ScriptRuntime.wrapNumber(negative ? -d : d); + } + + /** + * The global method parseFloat, as per ECMA-262 15.1.2.3. + * + * @param args the arguments to parseFloat, ignoring args[>=1] + */ + private Object js_parseFloat(Object[] args) + { + if (args.length < 1) + return ScriptRuntime.NaNobj; + + String s = ScriptRuntime.toString(args[0]); + int len = s.length(); + int start = 0; + // Scan forward to skip whitespace + char c; + for (;;) { + if (start == len) { + return ScriptRuntime.NaNobj; + } + c = s.charAt(start); + if (!TokenStream.isJSSpace(c)) { + break; + } + ++start; + } + + int i = start; + if (c == '+' || c == '-') { + ++i; + if (i == len) { + return ScriptRuntime.NaNobj; + } + c = s.charAt(i); + } + + if (c == 'I') { + // check for "Infinity" + if (i+8 <= len && s.regionMatches(i, "Infinity", 0, 8)) { + double d; + if (s.charAt(start) == '-') { + d = Double.NEGATIVE_INFINITY; + } else { + d = Double.POSITIVE_INFINITY; + } + return ScriptRuntime.wrapNumber(d); + } + return ScriptRuntime.NaNobj; + } + + // Find the end of the legal bit + int decimal = -1; + int exponent = -1; + for (; i < len; i++) { + switch (s.charAt(i)) { + case '.': + if (decimal != -1) // Only allow a single decimal point. + break; + decimal = i; + continue; + + case 'e': + case 'E': + if (exponent != -1) + break; + exponent = i; + continue; + + case '+': + case '-': + // Only allow '+' or '-' after 'e' or 'E' + if (exponent != i-1) + break; + continue; + + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + continue; + + default: + break; + } + break; + } + s = s.substring(start, i); + try { + return Double.valueOf(s); + } + catch (NumberFormatException ex) { + return ScriptRuntime.NaNobj; + } + } + + /** + * The global method escape, as per ECMA-262 15.1.2.4. + + * Includes code for the 'mask' argument supported by the C escape + * method, which used to be part of the browser imbedding. Blame + * for the strange constant names should be directed there. + */ + + private Object js_escape(Object[] args) { + final int + URL_XALPHAS = 1, + URL_XPALPHAS = 2, + URL_PATH = 4; + + String s = ScriptRuntime.toString(args, 0); + + int mask = URL_XALPHAS | URL_XPALPHAS | URL_PATH; + if (args.length > 1) { // the 'mask' argument. Non-ECMA. + double d = ScriptRuntime.toNumber(args[1]); + if (d != d || ((mask = (int) d) != d) || + 0 != (mask & ~(URL_XALPHAS | URL_XPALPHAS | URL_PATH))) + { + throw Context.reportRuntimeError0("msg.bad.esc.mask"); + } + } + + StringBuffer sb = null; + for (int k = 0, L = s.length(); k != L; ++k) { + int c = s.charAt(k); + if (mask != 0 + && ((c >= '0' && c <= '9') + || (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') + || c == '@' || c == '*' || c == '_' || c == '-' || c == '.' + || (0 != (mask & URL_PATH) && (c == '/' || c == '+')))) + { + if (sb != null) { + sb.append((char)c); + } + } else { + if (sb == null) { + sb = new StringBuffer(L + 3); + sb.append(s); + sb.setLength(k); + } + + int hexSize; + if (c < 256) { + if (c == ' ' && mask == URL_XPALPHAS) { + sb.append('+'); + continue; + } + sb.append('%'); + hexSize = 2; + } else { + sb.append('%'); + sb.append('u'); + hexSize = 4; + } + + // append hexadecimal form of c left-padded with 0 + for (int shift = (hexSize - 1) * 4; shift >= 0; shift -= 4) { + int digit = 0xf & (c >> shift); + int hc = (digit < 10) ? '0' + digit : 'A' - 10 + digit; + sb.append((char)hc); + } + } + } + + return (sb == null) ? s : sb.toString(); + } + + /** + * The global unescape method, as per ECMA-262 15.1.2.5. + */ + + private Object js_unescape(Object[] args) + { + String s = ScriptRuntime.toString(args, 0); + int firstEscapePos = s.indexOf('%'); + if (firstEscapePos >= 0) { + int L = s.length(); + char[] buf = s.toCharArray(); + int destination = firstEscapePos; + for (int k = firstEscapePos; k != L;) { + char c = buf[k]; + ++k; + if (c == '%' && k != L) { + int end, start; + if (buf[k] == 'u') { + start = k + 1; + end = k + 5; + } else { + start = k; + end = k + 2; + } + if (end <= L) { + int x = 0; + for (int i = start; i != end; ++i) { + x = Kit.xDigitToInt(buf[i], x); + } + if (x >= 0) { + c = (char)x; + k = end; + } + } + } + buf[destination] = c; + ++destination; + } + s = new String(buf, 0, destination); + } + return s; + } + + private Object js_eval(Context cx, Scriptable scope, Scriptable thisObj, Object[] args) + { + if (thisObj.getParentScope() == null) { + // We allow indirect calls to eval as long as the script will execute in + // the global scope. + return ScriptRuntime.evalSpecial(cx, scope, thisObj, args, "eval code", 1); + } + String m = ScriptRuntime.getMessage1("msg.cant.call.indirect", "eval"); + throw NativeGlobal.constructError(cx, "EvalError", m, scope); + } + + static boolean isEvalFunction(Object functionObj) + { + if (functionObj instanceof IdFunctionObject) { + IdFunctionObject function = (IdFunctionObject)functionObj; + if (function.hasTag(FTAG) && function.methodId() == Id_eval) { + return true; + } + } + return false; + } + + /** + * @deprecated Use {@link ScriptRuntime#constructError(String,String)} + * instead. + */ + public static EcmaError constructError(Context cx, + String error, + String message, + Scriptable scope) + { + return ScriptRuntime.constructError(error, message); + } + + /** + * @deprecated Use + * {@link ScriptRuntime#constructError(String,String,String,int,String,int)} + * instead. + */ + public static EcmaError constructError(Context cx, + String error, + String message, + Scriptable scope, + String sourceName, + int lineNumber, + int columnNumber, + String lineSource) + { + return ScriptRuntime.constructError(error, message, + sourceName, lineNumber, + lineSource, columnNumber); + } + + /* + * ECMA 3, 15.1.3 URI Handling Function Properties + * + * The following are implementations of the algorithms + * given in the ECMA specification for the hidden functions + * 'Encode' and 'Decode'. + */ + private static String encode(String str, boolean fullUri) { + byte[] utf8buf = null; + StringBuffer sb = null; + + for (int k = 0, length = str.length(); k != length; ++k) { + char C = str.charAt(k); + if (encodeUnescaped(C, fullUri)) { + if (sb != null) { + sb.append(C); + } + } else { + if (sb == null) { + sb = new StringBuffer(length + 3); + sb.append(str); + sb.setLength(k); + utf8buf = new byte[6]; + } + if (0xDC00 <= C && C <= 0xDFFF) { + throw Context.reportRuntimeError0("msg.bad.uri"); + } + int V; + if (C < 0xD800 || 0xDBFF < C) { + V = C; + } else { + k++; + if (k == length) { + throw Context.reportRuntimeError0("msg.bad.uri"); + } + char C2 = str.charAt(k); + if (!(0xDC00 <= C2 && C2 <= 0xDFFF)) { + throw Context.reportRuntimeError0("msg.bad.uri"); + } + V = ((C - 0xD800) << 10) + (C2 - 0xDC00) + 0x10000; + } + int L = oneUcs4ToUtf8Char(utf8buf, V); + for (int j = 0; j < L; j++) { + int d = 0xff & utf8buf[j]; + sb.append('%'); + sb.append(toHexChar(d >>> 4)); + sb.append(toHexChar(d & 0xf)); + } + } + } + return (sb == null) ? str : sb.toString(); + } + + private static char toHexChar(int i) { + if (i >> 4 != 0) Kit.codeBug(); + return (char)((i < 10) ? i + '0' : i - 10 + 'A'); + } + + private static int unHex(char c) { + if ('A' <= c && c <= 'F') { + return c - 'A' + 10; + } else if ('a' <= c && c <= 'f') { + return c - 'a' + 10; + } else if ('0' <= c && c <= '9') { + return c - '0'; + } else { + return -1; + } + } + + private static int unHex(char c1, char c2) { + int i1 = unHex(c1); + int i2 = unHex(c2); + if (i1 >= 0 && i2 >= 0) { + return (i1 << 4) | i2; + } + return -1; + } + + private static String decode(String str, boolean fullUri) { + char[] buf = null; + int bufTop = 0; + + for (int k = 0, length = str.length(); k != length;) { + char C = str.charAt(k); + if (C != '%') { + if (buf != null) { + buf[bufTop++] = C; + } + ++k; + } else { + if (buf == null) { + // decode always compress so result can not be bigger then + // str.length() + buf = new char[length]; + str.getChars(0, k, buf, 0); + bufTop = k; + } + int start = k; + if (k + 3 > length) + throw Context.reportRuntimeError0("msg.bad.uri"); + int B = unHex(str.charAt(k + 1), str.charAt(k + 2)); + if (B < 0) throw Context.reportRuntimeError0("msg.bad.uri"); + k += 3; + if ((B & 0x80) == 0) { + C = (char)B; + } else { + // Decode UTF-8 sequence into ucs4Char and encode it into + // UTF-16 + int utf8Tail, ucs4Char, minUcs4Char; + if ((B & 0xC0) == 0x80) { + // First UTF-8 should be ouside 0x80..0xBF + throw Context.reportRuntimeError0("msg.bad.uri"); + } else if ((B & 0x20) == 0) { + utf8Tail = 1; ucs4Char = B & 0x1F; + minUcs4Char = 0x80; + } else if ((B & 0x10) == 0) { + utf8Tail = 2; ucs4Char = B & 0x0F; + minUcs4Char = 0x800; + } else if ((B & 0x08) == 0) { + utf8Tail = 3; ucs4Char = B & 0x07; + minUcs4Char = 0x10000; + } else if ((B & 0x04) == 0) { + utf8Tail = 4; ucs4Char = B & 0x03; + minUcs4Char = 0x200000; + } else if ((B & 0x02) == 0) { + utf8Tail = 5; ucs4Char = B & 0x01; + minUcs4Char = 0x4000000; + } else { + // First UTF-8 can not be 0xFF or 0xFE + throw Context.reportRuntimeError0("msg.bad.uri"); + } + if (k + 3 * utf8Tail > length) + throw Context.reportRuntimeError0("msg.bad.uri"); + for (int j = 0; j != utf8Tail; j++) { + if (str.charAt(k) != '%') + throw Context.reportRuntimeError0("msg.bad.uri"); + B = unHex(str.charAt(k + 1), str.charAt(k + 2)); + if (B < 0 || (B & 0xC0) != 0x80) + throw Context.reportRuntimeError0("msg.bad.uri"); + ucs4Char = (ucs4Char << 6) | (B & 0x3F); + k += 3; + } + // Check for overlongs and other should-not-present codes + if (ucs4Char < minUcs4Char + || ucs4Char == 0xFFFE || ucs4Char == 0xFFFF) + { + ucs4Char = 0xFFFD; + } + if (ucs4Char >= 0x10000) { + ucs4Char -= 0x10000; + if (ucs4Char > 0xFFFFF) + throw Context.reportRuntimeError0("msg.bad.uri"); + char H = (char)((ucs4Char >>> 10) + 0xD800); + C = (char)((ucs4Char & 0x3FF) + 0xDC00); + buf[bufTop++] = H; + } else { + C = (char)ucs4Char; + } + } + if (fullUri && URI_DECODE_RESERVED.indexOf(C) >= 0) { + for (int x = start; x != k; x++) { + buf[bufTop++] = str.charAt(x); + } + } else { + buf[bufTop++] = C; + } + } + } + return (buf == null) ? str : new String(buf, 0, bufTop); + } + + private static boolean encodeUnescaped(char c, boolean fullUri) { + if (('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z') + || ('0' <= c && c <= '9')) + { + return true; + } + if ("-_.!~*'()".indexOf(c) >= 0) + return true; + if (fullUri) { + return URI_DECODE_RESERVED.indexOf(c) >= 0; + } + return false; + } + + private static final String URI_DECODE_RESERVED = ";/?:@&=+$,#"; + + /* Convert one UCS-4 char and write it into a UTF-8 buffer, which must be + * at least 6 bytes long. Return the number of UTF-8 bytes of data written. + */ + private static int oneUcs4ToUtf8Char(byte[] utf8Buffer, int ucs4Char) { + int utf8Length = 1; + + //JS_ASSERT(ucs4Char <= 0x7FFFFFFF); + if ((ucs4Char & ~0x7F) == 0) + utf8Buffer[0] = (byte)ucs4Char; + else { + int i; + int a = ucs4Char >>> 11; + utf8Length = 2; + while (a != 0) { + a >>>= 5; + utf8Length++; + } + i = utf8Length; + while (--i > 0) { + utf8Buffer[i] = (byte)((ucs4Char & 0x3F) | 0x80); + ucs4Char >>>= 6; + } + utf8Buffer[0] = (byte)(0x100 - (1 << (8-utf8Length)) + ucs4Char); + } + return utf8Length; + } + + private static final Object FTAG = "Global"; + + private static final int + Id_decodeURI = 1, + Id_decodeURIComponent = 2, + Id_encodeURI = 3, + Id_encodeURIComponent = 4, + Id_escape = 5, + Id_eval = 6, + Id_isFinite = 7, + Id_isNaN = 8, + Id_isXMLName = 9, + Id_parseFloat = 10, + Id_parseInt = 11, + Id_unescape = 12, + Id_uneval = 13, + + LAST_SCOPE_FUNCTION_ID = 13, + + Id_new_CommonError = 14; +} diff --git a/org/mozilla/javascript/NativeIterator.java b/org/mozilla/javascript/NativeIterator.java new file mode 100644 index 0000000..f383707 --- /dev/null +++ b/org/mozilla/javascript/NativeIterator.java @@ -0,0 +1,269 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Contributor(s): + * Norris Boyd + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +package org.mozilla.javascript; + +import java.util.Iterator; + +/** + * This class implements iterator objects. See + * http://developer.mozilla.org/en/docs/New_in_JavaScript_1.7#Iterators + * + * @author Norris Boyd + */ +public final class NativeIterator extends IdScriptableObject { + private static final long serialVersionUID = -4136968203581667681L; + private static final Object ITERATOR_TAG = "Iterator"; + + static void init(ScriptableObject scope, boolean sealed) { + // Iterator + NativeIterator iterator = new NativeIterator(); + iterator.exportAsJSClass(MAX_PROTOTYPE_ID, scope, sealed); + + // Generator + NativeGenerator.init(scope, sealed); + + // StopIteration + NativeObject obj = new StopIteration(); + obj.setPrototype(getObjectPrototype(scope)); + obj.setParentScope(scope); + if (sealed) { obj.sealObject(); } + ScriptableObject.defineProperty(scope, STOP_ITERATION, obj, + ScriptableObject.DONTENUM); + // Use "associateValue" so that generators can continue to + // throw StopIteration even if the property of the global + // scope is replaced or deleted. + scope.associateValue(ITERATOR_TAG, obj); + } + + /** + * Only for constructing the prototype object. + */ + private NativeIterator() { + } + + private NativeIterator(Object objectIterator) { + this.objectIterator = objectIterator; + } + + /** + * Get the value of the "StopIteration" object. Note that this value + * is stored in the top-level scope using "associateValue" so the + * value can still be found even if a script overwrites or deletes + * the global "StopIteration" property. + * @param scope a scope whose parent chain reaches a top-level scope + * @return the StopIteration object + */ + public static Object getStopIterationObject(Scriptable scope) { + Scriptable top = ScriptableObject.getTopLevelScope(scope); + return ScriptableObject.getTopScopeValue(top, ITERATOR_TAG); + } + + private static final String STOP_ITERATION = "StopIteration"; + public static final String ITERATOR_PROPERTY_NAME = "__iterator__"; + + static class StopIteration extends NativeObject { + private static final long serialVersionUID = 2485151085722377663L; + + @Override + public String getClassName() { + return STOP_ITERATION; + } + + /* StopIteration has custom instanceof behavior since it + * doesn't have a constructor. + */ + @Override + public boolean hasInstance(Scriptable instance) { + return instance instanceof StopIteration; + } + } + + @Override + public String getClassName() { + return "Iterator"; + } + + @Override + protected void initPrototypeId(int id) { + String s; + int arity; + switch (id) { + case Id_constructor: arity=2; s="constructor"; break; + case Id_next: arity=0; s="next"; break; + case Id___iterator__: arity=1; s=ITERATOR_PROPERTY_NAME; break; + default: throw new IllegalArgumentException(String.valueOf(id)); + } + initPrototypeMethod(ITERATOR_TAG, id, s, arity); + } + + @Override + public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope, + Scriptable thisObj, Object[] args) + { + if (!f.hasTag(ITERATOR_TAG)) { + return super.execIdCall(f, cx, scope, thisObj, args); + } + int id = f.methodId(); + + if (id == Id_constructor) { + return jsConstructor(cx, scope, thisObj, args); + } + + if (!(thisObj instanceof NativeIterator)) + throw incompatibleCallError(f); + + NativeIterator iterator = (NativeIterator) thisObj; + + switch (id) { + + case Id_next: + return iterator.next(cx, scope); + + case Id___iterator__: + /// XXX: what about argument? SpiderMonkey apparently ignores it + return thisObj; + + default: + throw new IllegalArgumentException(String.valueOf(id)); + } + } + + /* The JavaScript constructor */ + private static Object jsConstructor(Context cx, Scriptable scope, + Scriptable thisObj, Object[] args) + { + if (args.length == 0 || args[0] == null || + args[0] == Undefined.instance) + { + throw ScriptRuntime.typeError1("msg.no.properties", + ScriptRuntime.toString(args[0])); + } + Scriptable obj = ScriptRuntime.toObject(scope, args[0]); + boolean keyOnly = args.length > 1 && ScriptRuntime.toBoolean(args[1]); + if (thisObj != null) { + // Called as a function. Convert to iterator if possible. + + // For objects that implement java.lang.Iterable or + // java.util.Iterator, have JavaScript Iterator call the underlying + // iteration methods + Iterator iterator = + VMBridge.instance.getJavaIterator(cx, scope, obj); + if (iterator != null) { + scope = ScriptableObject.getTopLevelScope(scope); + return cx.getWrapFactory().wrap(cx, scope, + new WrappedJavaIterator(iterator, scope), + WrappedJavaIterator.class); + } + + // Otherwise, just call the runtime routine + Scriptable jsIterator = ScriptRuntime.toIterator(cx, scope, obj, + keyOnly); + if (jsIterator != null) { + return jsIterator; + } + } + + // Otherwise, just set up to iterate over the properties of the object. + // Do not call __iterator__ method. + Object objectIterator = ScriptRuntime.enumInit(obj, cx, + keyOnly ? ScriptRuntime.ENUMERATE_KEYS_NO_ITERATOR + : ScriptRuntime.ENUMERATE_ARRAY_NO_ITERATOR); + ScriptRuntime.setEnumNumbers(objectIterator, true); + NativeIterator result = new NativeIterator(objectIterator); + result.setPrototype(NativeIterator.getClassPrototype(scope, + result.getClassName())); + result.setParentScope(scope); + return result; + } + + private Object next(Context cx, Scriptable scope) { + Boolean b = ScriptRuntime.enumNext(this.objectIterator); + if (!b.booleanValue()) { + // Out of values. Throw StopIteration. + throw new JavaScriptException( + NativeIterator.getStopIterationObject(scope), null, 0); + } + return ScriptRuntime.enumId(this.objectIterator, cx); + } + + static public class WrappedJavaIterator + { + WrappedJavaIterator(Iterator iterator, Scriptable scope) { + this.iterator = iterator; + this.scope = scope; + } + + public Object next() { + if (!iterator.hasNext()) { + // Out of values. Throw StopIteration. + throw new JavaScriptException( + NativeIterator.getStopIterationObject(scope), null, 0); + } + return iterator.next(); + } + + public Object __iterator__(boolean b) { + return this; + } + + private Iterator iterator; + private Scriptable scope; + } + +// #string_id_map# + + @Override + protected int findPrototypeId(String s) { + int id; +// #generated# Last update: 2007-06-11 09:43:19 EDT + L0: { id = 0; String X = null; + int s_length = s.length(); + if (s_length==4) { X="next";id=Id_next; } + else if (s_length==11) { X="constructor";id=Id_constructor; } + else if (s_length==12) { X="__iterator__";id=Id___iterator__; } + if (X!=null && X!=s && !X.equals(s)) id = 0; + break L0; + } +// #/generated# + return id; + } + + private static final int + Id_constructor = 1, + Id_next = 2, + Id___iterator__ = 3, + MAX_PROTOTYPE_ID = 3; + +// #/string_id_map# + + private Object objectIterator; +} + diff --git a/org/mozilla/javascript/NativeJavaArray.java b/org/mozilla/javascript/NativeJavaArray.java new file mode 100644 index 0000000..b2766df --- /dev/null +++ b/org/mozilla/javascript/NativeJavaArray.java @@ -0,0 +1,180 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-1999 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Norris Boyd + * Igor Bukanov + * Frank Mitchell + * Mike Shaver + * Kemal Bayram + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +package org.mozilla.javascript; + +import java.lang.reflect.Array; + +/** + * This class reflects Java arrays into the JavaScript environment. + * + * @author Mike Shaver + * @see NativeJavaClass + * @see NativeJavaObject + * @see NativeJavaPackage + */ + +public class NativeJavaArray extends NativeJavaObject +{ + static final long serialVersionUID = -924022554283675333L; + + @Override + public String getClassName() { + return "JavaArray"; + } + + public static NativeJavaArray wrap(Scriptable scope, Object array) { + return new NativeJavaArray(scope, array); + } + + @Override + public Object unwrap() { + return array; + } + + public NativeJavaArray(Scriptable scope, Object array) { + super(scope, null, ScriptRuntime.ObjectClass); + Class cl = array.getClass(); + if (!cl.isArray()) { + throw new RuntimeException("Array expected"); + } + this.array = array; + this.length = Array.getLength(array); + this.cls = cl.getComponentType(); + } + + @Override + public boolean has(String id, Scriptable start) { + return id.equals("length") || super.has(id, start); + } + + @Override + public boolean has(int index, Scriptable start) { + return 0 <= index && index < length; + } + + @Override + public Object get(String id, Scriptable start) { + if (id.equals("length")) + return new Integer(length); + Object result = super.get(id, start); + if (result == NOT_FOUND && + !ScriptableObject.hasProperty(getPrototype(), id)) + { + throw Context.reportRuntimeError2( + "msg.java.member.not.found", array.getClass().getName(), id); + } + return result; + } + + @Override + public Object get(int index, Scriptable start) { + if (0 <= index && index < length) { + Context cx = Context.getContext(); + Object obj = Array.get(array, index); + return cx.getWrapFactory().wrap(cx, this, obj, cls); + } + return Undefined.instance; + } + + @Override + public void put(String id, Scriptable start, Object value) { + // Ignore assignments to "length"--it's readonly. + if (!id.equals("length")) + throw Context.reportRuntimeError1( + "msg.java.array.member.not.found", id); + } + + @Override + public void put(int index, Scriptable start, Object value) { + if (0 <= index && index < length) { + Array.set(array, index, Context.jsToJava(value, cls)); + } + else { + throw Context.reportRuntimeError2( + "msg.java.array.index.out.of.bounds", String.valueOf(index), + String.valueOf(length - 1)); + } + } + + @Override + public Object getDefaultValue(Class hint) { + if (hint == null || hint == ScriptRuntime.StringClass) + return array.toString(); + if (hint == ScriptRuntime.BooleanClass) + return Boolean.TRUE; + if (hint == ScriptRuntime.NumberClass) + return ScriptRuntime.NaNobj; + return this; + } + + @Override + public Object[] getIds() { + Object[] result = new Object[length]; + int i = length; + while (--i >= 0) + result[i] = new Integer(i); + return result; + } + + @Override + public boolean hasInstance(Scriptable value) { + if (!(value instanceof Wrapper)) + return false; + Object instance = ((Wrapper)value).unwrap(); + return cls.isInstance(instance); + } + + @Override + public Scriptable getPrototype() { + if (prototype == null) { + prototype = + ScriptableObject.getClassPrototype(this.getParentScope(), + "Array"); + } + return prototype; + } + + Object array; + int length; + Class cls; +} diff --git a/org/mozilla/javascript/NativeJavaClass.java b/org/mozilla/javascript/NativeJavaClass.java new file mode 100644 index 0000000..f72f9e7 --- /dev/null +++ b/org/mozilla/javascript/NativeJavaClass.java @@ -0,0 +1,329 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-1999 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Norris Boyd + * Frank Mitchell + * Mike Shaver + * Kurt Westerfeld + * Kemal Bayram + * Ulrike Mueller + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +package org.mozilla.javascript; + +import java.lang.reflect.*; +import java.util.Map; + +/** + * This class reflects Java classes into the JavaScript environment, mainly + * for constructors and static members. We lazily reflect properties, + * and currently do not guarantee that a single j.l.Class is only + * reflected once into the JS environment, although we should. + * The only known case where multiple reflections + * are possible occurs when a j.l.Class is wrapped as part of a + * method return or property access, rather than by walking the + * Packages/java tree. + * + * @author Mike Shaver + * @see NativeJavaArray + * @see NativeJavaObject + * @see NativeJavaPackage + */ + +public class NativeJavaClass extends NativeJavaObject implements Function +{ + static final long serialVersionUID = -6460763940409461664L; + + // Special property for getting the underlying Java class object. + static final String javaClassPropertyName = "__javaObject__"; + + public NativeJavaClass() { + } + + public NativeJavaClass(Scriptable scope, Class cl) { + this.parent = scope; + this.javaObject = cl; + initMembers(); + } + + @Override + protected void initMembers() { + Class cl = (Class)javaObject; + members = JavaMembers.lookupClass(parent, cl, cl, false); + staticFieldAndMethods + = members.getFieldAndMethodsObjects(this, cl, true); + } + + @Override + public String getClassName() { + return "JavaClass"; + } + + @Override + public boolean has(String name, Scriptable start) { + return members.has(name, true) || javaClassPropertyName.equals(name); + } + + @Override + public Object get(String name, Scriptable start) { + // When used as a constructor, ScriptRuntime.newObject() asks + // for our prototype to create an object of the correct type. + // We don't really care what the object is, since we're returning + // one constructed out of whole cloth, so we return null. + if (name.equals("prototype")) + return null; + + if (staticFieldAndMethods != null) { + Object result = staticFieldAndMethods.get(name); + if (result != null) + return result; + } + + if (members.has(name, true)) { + return members.get(this, name, javaObject, true); + } + + if (javaClassPropertyName.equals(name)) { + Context cx = Context.getContext(); + Scriptable scope = ScriptableObject.getTopLevelScope(start); + return cx.getWrapFactory().wrap(cx, scope, javaObject, + ScriptRuntime.ClassClass); + } + + // experimental: look for nested classes by appending $name to + // current class' name. + Class nestedClass = findNestedClass(getClassObject(), name); + if (nestedClass != null) { + NativeJavaClass nestedValue = new NativeJavaClass + (ScriptableObject.getTopLevelScope(this), nestedClass); + nestedValue.setParentScope(this); + return nestedValue; + } + + throw members.reportMemberNotFound(name); + } + + @Override + public void put(String name, Scriptable start, Object value) { + members.put(this, name, javaObject, value, true); + } + + @Override + public Object[] getIds() { + return members.getIds(true); + } + + public Class getClassObject() { + return (Class) super.unwrap(); + } + + @Override + public Object getDefaultValue(Class hint) { + if (hint == null || hint == ScriptRuntime.StringClass) + return this.toString(); + if (hint == ScriptRuntime.BooleanClass) + return Boolean.TRUE; + if (hint == ScriptRuntime.NumberClass) + return ScriptRuntime.NaNobj; + return this; + } + + public Object call(Context cx, Scriptable scope, Scriptable thisObj, + Object[] args) + { + // If it looks like a "cast" of an object to this class type, + // walk the prototype chain to see if there's a wrapper of a + // object that's an instanceof this class. + if (args.length == 1 && args[0] instanceof Scriptable) { + Class c = getClassObject(); + Scriptable p = (Scriptable) args[0]; + do { + if (p instanceof Wrapper) { + Object o = ((Wrapper) p).unwrap(); + if (c.isInstance(o)) + return p; + } + p = p.getPrototype(); + } while (p != null); + } + return construct(cx, scope, args); + } + + public Scriptable construct(Context cx, Scriptable scope, Object[] args) + { + Class classObject = getClassObject(); + int modifiers = classObject.getModifiers(); + if (! (Modifier.isInterface(modifiers) || + Modifier.isAbstract(modifiers))) + { + MemberBox[] ctors = members.ctors; + int index = NativeJavaMethod.findFunction(cx, ctors, args); + if (index < 0) { + String sig = NativeJavaMethod.scriptSignature(args); + throw Context.reportRuntimeError2( + "msg.no.java.ctor", classObject.getName(), sig); + } + + // Found the constructor, so try invoking it. + return constructSpecific(cx, scope, args, ctors[index]); + } else { + Scriptable topLevel = ScriptableObject.getTopLevelScope(this); + String msg = ""; + try { + // trying to construct an interface; use JavaAdapter to + // construct a new class on the fly that implements this + // interface. + Object v = topLevel.get("JavaAdapter", topLevel); + if (v != NOT_FOUND) { + Function f = (Function) v; + Object[] adapterArgs = { this, args[0] }; + return f.construct(cx, topLevel,adapterArgs); + } + } catch (Exception ex) { + // fall through to error + String m = ex.getMessage(); + if (m != null) + msg = m; + } + throw Context.reportRuntimeError2( + "msg.cant.instantiate", msg, classObject.getName()); + } + } + + static Scriptable constructSpecific(Context cx, Scriptable scope, + Object[] args, MemberBox ctor) + { + Scriptable topLevel = ScriptableObject.getTopLevelScope(scope); + Class[] argTypes = ctor.argTypes; + + if (ctor.vararg) { + // marshall the explicit parameter + Object[] newArgs = new Object[argTypes.length]; + for (int i = 0; i < argTypes.length-1; i++) { + newArgs[i] = Context.jsToJava(args[i], argTypes[i]); + } + + Object varArgs; + + // Handle special situation where a single variable parameter + // is given and it is a Java or ECMA array. + if (args.length == argTypes.length && + (args[args.length-1] == null || + args[args.length-1] instanceof NativeArray || + args[args.length-1] instanceof NativeJavaArray)) + { + // convert the ECMA array into a native array + varArgs = Context.jsToJava(args[args.length-1], + argTypes[argTypes.length - 1]); + } else { + // marshall the variable parameter + Class componentType = argTypes[argTypes.length - 1]. + getComponentType(); + varArgs = Array.newInstance(componentType, + args.length - argTypes.length + 1); + for (int i=0; i < Array.getLength(varArgs); i++) { + Object value = Context.jsToJava(args[argTypes.length-1 + i], + componentType); + Array.set(varArgs, i, value); + } + } + + // add varargs + newArgs[argTypes.length-1] = varArgs; + // replace the original args with the new one + args = newArgs; + } else { + Object[] origArgs = args; + for (int i = 0; i < args.length; i++) { + Object arg = args[i]; + Object x = Context.jsToJava(arg, argTypes[i]); + if (x != arg) { + if (args == origArgs) { + args = origArgs.clone(); + } + args[i] = x; + } + } + } + + Object instance = ctor.newInstance(args); + // we need to force this to be wrapped, because construct _has_ + // to return a scriptable + return cx.getWrapFactory().wrapNewObject(cx, topLevel, instance); + } + + @Override + public String toString() { + return "[JavaClass " + getClassObject().getName() + "]"; + } + + /** + * Determines if prototype is a wrapped Java object and performs + * a Java "instanceof". + * Exception: if value is an instance of NativeJavaClass, it isn't + * considered an instance of the Java class; this forestalls any + * name conflicts between java.lang.Class's methods and the + * static methods exposed by a JavaNativeClass. + */ + @Override + public boolean hasInstance(Scriptable value) { + + if (value instanceof Wrapper && + !(value instanceof NativeJavaClass)) { + Object instance = ((Wrapper)value).unwrap(); + + return getClassObject().isInstance(instance); + } + + // value wasn't something we understand + return false; + } + + private static Class findNestedClass(Class parentClass, String name) { + String nestedClassName = parentClass.getName() + '$' + name; + ClassLoader loader = parentClass.getClassLoader(); + if (loader == null) { + // ALERT: if loader is null, nested class should be loaded + // via system class loader which can be different from the + // loader that brought Rhino classes that Class.forName() would + // use, but ClassLoader.getSystemClassLoader() is Java 2 only + return Kit.classOrNull(nestedClassName); + } else { + return Kit.classOrNull(loader, nestedClassName); + } + } + + private Map staticFieldAndMethods; +} diff --git a/org/mozilla/javascript/NativeJavaConstructor.java b/org/mozilla/javascript/NativeJavaConstructor.java new file mode 100644 index 0000000..557aeb5 --- /dev/null +++ b/org/mozilla/javascript/NativeJavaConstructor.java @@ -0,0 +1,88 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-1999 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Norris Boyd + * Frank Mitchell + * Mike Shaver + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +package org.mozilla.javascript; + +/** + * This class reflects a single Java constructor into the JavaScript + * environment. It satisfies a request for an overloaded constructor, + * as introduced in LiveConnect 3. + * All NativeJavaConstructors behave as JSRef `bound' methods, in that they + * always construct the same NativeJavaClass regardless of any reparenting + * that may occur. + * + * @author Frank Mitchell + * @see NativeJavaMethod + * @see NativeJavaPackage + * @see NativeJavaClass + */ + +public class NativeJavaConstructor extends BaseFunction +{ + static final long serialVersionUID = -8149253217482668463L; + + MemberBox ctor; + + public NativeJavaConstructor(MemberBox ctor) + { + this.ctor = ctor; + } + + @Override + public Object call(Context cx, Scriptable scope, Scriptable thisObj, + Object[] args) + { + return NativeJavaClass.constructSpecific(cx, scope, args, ctor); + } + + @Override + public String getFunctionName() + { + String sig = JavaMembers.liveConnectSignature(ctor.argTypes); + return "".concat(sig); + } + + @Override + public String toString() + { + return "[JavaConstructor " + ctor.getName() + "]"; + } +} + diff --git a/org/mozilla/javascript/NativeJavaMethod.java b/org/mozilla/javascript/NativeJavaMethod.java new file mode 100644 index 0000000..b6eaf8b --- /dev/null +++ b/org/mozilla/javascript/NativeJavaMethod.java @@ -0,0 +1,580 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-1999 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Norris Boyd + * Frank Mitchell + * Mike Shaver + * Ulrike Mueller + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +package org.mozilla.javascript; + +import java.lang.reflect.*; + +/** + * This class reflects Java methods into the JavaScript environment and + * handles overloading of methods. + * + * @author Mike Shaver + * @see NativeJavaArray + * @see NativeJavaPackage + * @see NativeJavaClass + */ + +public class NativeJavaMethod extends BaseFunction +{ + static final long serialVersionUID = -3440381785576412928L; + + NativeJavaMethod(MemberBox[] methods) + { + this.functionName = methods[0].getName(); + this.methods = methods; + } + + NativeJavaMethod(MemberBox method, String name) + { + this.functionName = name; + this.methods = new MemberBox[] { method }; + } + + public NativeJavaMethod(Method method, String name) + { + this(new MemberBox(method), name); + } + + @Override + public String getFunctionName() + { + return functionName; + } + + static String scriptSignature(Object[] values) + { + StringBuffer sig = new StringBuffer(); + for (int i = 0; i != values.length; ++i) { + Object value = values[i]; + + String s; + if (value == null) { + s = "null"; + } else if (value instanceof Boolean) { + s = "boolean"; + } else if (value instanceof String) { + s = "string"; + } else if (value instanceof Number) { + s = "number"; + } else if (value instanceof Scriptable) { + if (value instanceof Undefined) { + s = "undefined"; + } else if (value instanceof Wrapper) { + Object wrapped = ((Wrapper)value).unwrap(); + s = wrapped.getClass().getName(); + } else if (value instanceof Function) { + s = "function"; + } else { + s = "object"; + } + } else { + s = JavaMembers.javaSignature(value.getClass()); + } + + if (i != 0) { + sig.append(','); + } + sig.append(s); + } + return sig.toString(); + } + + @Override + String decompile(int indent, int flags) + { + StringBuffer sb = new StringBuffer(); + boolean justbody = (0 != (flags & Decompiler.ONLY_BODY_FLAG)); + if (!justbody) { + sb.append("function "); + sb.append(getFunctionName()); + sb.append("() {"); + } + sb.append("/*\n"); + sb.append(toString()); + sb.append(justbody ? "*/\n" : "*/}\n"); + return sb.toString(); + } + + @Override + public String toString() + { + StringBuffer sb = new StringBuffer(); + for (int i = 0, N = methods.length; i != N; ++i) { + Method method = methods[i].method(); + sb.append(JavaMembers.javaSignature(method.getReturnType())); + sb.append(' '); + sb.append(method.getName()); + sb.append(JavaMembers.liveConnectSignature(methods[i].argTypes)); + sb.append('\n'); + } + return sb.toString(); + } + + @Override + public Object call(Context cx, Scriptable scope, Scriptable thisObj, + Object[] args) + { + // Find a method that matches the types given. + if (methods.length == 0) { + throw new RuntimeException("No methods defined for call"); + } + + int index = findFunction(cx, methods, args); + if (index < 0) { + Class c = methods[0].method().getDeclaringClass(); + String sig = c.getName() + '.' + getFunctionName() + '(' + + scriptSignature(args) + ')'; + throw Context.reportRuntimeError1("msg.java.no_such_method", sig); + } + + MemberBox meth = methods[index]; + Class[] argTypes = meth.argTypes; + + if (meth.vararg) { + // marshall the explicit parameters + Object[] newArgs = new Object[argTypes.length]; + for (int i = 0; i < argTypes.length-1; i++) { + newArgs[i] = Context.jsToJava(args[i], argTypes[i]); + } + + Object varArgs; + + // Handle special situation where a single variable parameter + // is given and it is a Java or ECMA array or is null. + if (args.length == argTypes.length && + (args[args.length-1] == null || + args[args.length-1] instanceof NativeArray || + args[args.length-1] instanceof NativeJavaArray)) + { + // convert the ECMA array into a native array + varArgs = Context.jsToJava(args[args.length-1], + argTypes[argTypes.length - 1]); + } else { + // marshall the variable parameters + Class componentType = argTypes[argTypes.length - 1]. + getComponentType(); + varArgs = Array.newInstance(componentType, + args.length - argTypes.length + 1); + for (int i = 0; i < Array.getLength(varArgs); i++) { + Object value = Context.jsToJava(args[argTypes.length-1 + i], + componentType); + Array.set(varArgs, i, value); + } + } + + // add varargs + newArgs[argTypes.length-1] = varArgs; + // replace the original args with the new one + args = newArgs; + } else { + // First, we marshall the args. + Object[] origArgs = args; + for (int i = 0; i < args.length; i++) { + Object arg = args[i]; + Object coerced = Context.jsToJava(arg, argTypes[i]); + if (coerced != arg) { + if (origArgs == args) { + args = args.clone(); + } + args[i] = coerced; + } + } + } + Object javaObject; + if (meth.isStatic()) { + javaObject = null; // don't need an object + } else { + Scriptable o = thisObj; + Class c = meth.getDeclaringClass(); + for (;;) { + if (o == null) { + throw Context.reportRuntimeError3( + "msg.nonjava.method", getFunctionName(), + ScriptRuntime.toString(thisObj), c.getName()); + } + if (o instanceof Wrapper) { + javaObject = ((Wrapper)o).unwrap(); + if (c.isInstance(javaObject)) { + break; + } + } + o = o.getPrototype(); + } + } + if (debug) { + printDebug("Calling ", meth, args); + } + + Object retval = meth.invoke(javaObject, args); + Class staticType = meth.method().getReturnType(); + + if (debug) { + Class actualType = (retval == null) ? null + : retval.getClass(); + System.err.println(" ----- Returned " + retval + + " actual = " + actualType + + " expect = " + staticType); + } + + Object wrapped = cx.getWrapFactory().wrap(cx, scope, + retval, staticType); + if (debug) { + Class actualType = (wrapped == null) ? null + : wrapped.getClass(); + System.err.println(" ----- Wrapped as " + wrapped + + " class = " + actualType); + } + + if (wrapped == null && staticType == Void.TYPE) { + wrapped = Undefined.instance; + } + return wrapped; + } + + /** + * Find the index of the correct function to call given the set of methods + * or constructors and the arguments. + * If no function can be found to call, return -1. + */ + static int findFunction(Context cx, + MemberBox[] methodsOrCtors, Object[] args) + { + if (methodsOrCtors.length == 0) { + return -1; + } else if (methodsOrCtors.length == 1) { + MemberBox member = methodsOrCtors[0]; + Class[] argTypes = member.argTypes; + int alength = argTypes.length; + + if (member.vararg) { + alength--; + if ( alength > args.length) { + return -1; + } + } else { + if (alength != args.length) { + return -1; + } + } + for (int j = 0; j != alength; ++j) { + if (!NativeJavaObject.canConvert(args[j], argTypes[j])) { + if (debug) printDebug("Rejecting (args can't convert) ", + member, args); + return -1; + } + } + if (debug) printDebug("Found ", member, args); + return 0; + } + + int firstBestFit = -1; + int[] extraBestFits = null; + int extraBestFitsCount = 0; + + search: + for (int i = 0; i < methodsOrCtors.length; i++) { + MemberBox member = methodsOrCtors[i]; + Class[] argTypes = member.argTypes; + int alength = argTypes.length; + if (member.vararg) { + alength--; + if ( alength > args.length) { + continue search; + } + } else { + if (alength != args.length) { + continue search; + } + } + for (int j = 0; j < alength; j++) { + if (!NativeJavaObject.canConvert(args[j], argTypes[j])) { + if (debug) printDebug("Rejecting (args can't convert) ", + member, args); + continue search; + } + } + if (firstBestFit < 0) { + if (debug) printDebug("Found first applicable ", member, args); + firstBestFit = i; + } else { + // Compare with all currently fit methods. + // The loop starts from -1 denoting firstBestFit and proceed + // until extraBestFitsCount to avoid extraBestFits allocation + // in the most common case of no ambiguity + int betterCount = 0; // number of times member was prefered over + // best fits + int worseCount = 0; // number of times best fits were prefered + // over member + for (int j = -1; j != extraBestFitsCount; ++j) { + int bestFitIndex; + if (j == -1) { + bestFitIndex = firstBestFit; + } else { + bestFitIndex = extraBestFits[j]; + } + MemberBox bestFit = methodsOrCtors[bestFitIndex]; + if (cx.hasFeature(Context.FEATURE_ENHANCED_JAVA_ACCESS) && + (bestFit.member().getModifiers() & Modifier.PUBLIC) != + (member.member().getModifiers() & Modifier.PUBLIC)) + { + // When FEATURE_ENHANCED_JAVA_ACCESS gives us access + // to non-public members, continue to prefer public + // methods in overloading + if ((bestFit.member().getModifiers() & Modifier.PUBLIC) == 0) + ++betterCount; + else + ++worseCount; + } else { + int preference = preferSignature(args, argTypes, + member.vararg, + bestFit.argTypes, + bestFit.vararg ); + if (preference == PREFERENCE_AMBIGUOUS) { + break; + } else if (preference == PREFERENCE_FIRST_ARG) { + ++betterCount; + } else if (preference == PREFERENCE_SECOND_ARG) { + ++worseCount; + } else { + if (preference != PREFERENCE_EQUAL) Kit.codeBug(); + // This should not happen in theory + // but on some JVMs, Class.getMethods will return all + // static methods of the class hierarchy, even if + // a derived class's parameters match exactly. + // We want to call the derived class's method. + if (bestFit.isStatic() && + bestFit.getDeclaringClass().isAssignableFrom( + member.getDeclaringClass())) + { + // On some JVMs, Class.getMethods will return all + // static methods of the class hierarchy, even if + // a derived class's parameters match exactly. + // We want to call the derived class's method. + if (debug) printDebug( + "Substituting (overridden static)", + member, args); + if (j == -1) { + firstBestFit = i; + } else { + extraBestFits[j] = i; + } + } else { + if (debug) printDebug( + "Ignoring same signature member ", + member, args); + } + continue search; + } + } + } + if (betterCount == 1 + extraBestFitsCount) { + // member was prefered over all best fits + if (debug) printDebug( + "New first applicable ", member, args); + firstBestFit = i; + extraBestFitsCount = 0; + } else if (worseCount == 1 + extraBestFitsCount) { + // all best fits were prefered over member, ignore it + if (debug) printDebug( + "Rejecting (all current bests better) ", member, args); + } else { + // some ambiguity was present, add member to best fit set + if (debug) printDebug( + "Added to best fit set ", member, args); + if (extraBestFits == null) { + // Allocate maximum possible array + extraBestFits = new int[methodsOrCtors.length - 1]; + } + extraBestFits[extraBestFitsCount] = i; + ++extraBestFitsCount; + } + } + } + + if (firstBestFit < 0) { + // Nothing was found + return -1; + } else if (extraBestFitsCount == 0) { + // single best fit + return firstBestFit; + } + + // report remaining ambiguity + StringBuffer buf = new StringBuffer(); + for (int j = -1; j != extraBestFitsCount; ++j) { + int bestFitIndex; + if (j == -1) { + bestFitIndex = firstBestFit; + } else { + bestFitIndex = extraBestFits[j]; + } + buf.append("\n "); + buf.append(methodsOrCtors[bestFitIndex].toJavaDeclaration()); + } + + MemberBox firstFitMember = methodsOrCtors[firstBestFit]; + String memberName = firstFitMember.getName(); + String memberClass = firstFitMember.getDeclaringClass().getName(); + + if (methodsOrCtors[0].isMethod()) { + throw Context.reportRuntimeError3( + "msg.constructor.ambiguous", + memberName, scriptSignature(args), buf.toString()); + } else { + throw Context.reportRuntimeError4( + "msg.method.ambiguous", memberClass, + memberName, scriptSignature(args), buf.toString()); + } + } + + /** Types are equal */ + private static final int PREFERENCE_EQUAL = 0; + private static final int PREFERENCE_FIRST_ARG = 1; + private static final int PREFERENCE_SECOND_ARG = 2; + /** No clear "easy" conversion */ + private static final int PREFERENCE_AMBIGUOUS = 3; + + /** + * Determine which of two signatures is the closer fit. + * Returns one of PREFERENCE_EQUAL, PREFERENCE_FIRST_ARG, + * PREFERENCE_SECOND_ARG, or PREFERENCE_AMBIGUOUS. + */ + private static int preferSignature(Object[] args, + Class[] sig1, + boolean vararg1, + Class[] sig2, + boolean vararg2 ) + { + // TODO: This test is pretty primitive. It basically prefers + // a matching no vararg method over a vararg method independent + // of the type conversion cost. This can lead to unexpected results. + int alength = args.length; + if (!vararg1 && vararg2) { + // prefer the no vararg signature + return PREFERENCE_FIRST_ARG; + } else if (vararg1 && !vararg2) { + // prefer the no vararg signature + return PREFERENCE_SECOND_ARG; + } else if (vararg1 && vararg2) { + if (sig1.length < sig2.length) { + // prefer the signature with more explicit types + return PREFERENCE_SECOND_ARG; + } else if (sig1.length > sig2.length) { + // prefer the signature with more explicit types + return PREFERENCE_FIRST_ARG; + } else { + // Both are varargs and have the same length, so make the + // decision with the explicit args. + alength = Math.min(args.length, sig1.length-1); + } + } + + int totalPreference = 0; + for (int j = 0; j < alength; j++) { + Class type1 = sig1[j]; + Class type2 = sig2[j]; + if (type1 == type2) { + continue; + } + Object arg = args[j]; + + // Determine which of type1, type2 is easier to convert from arg. + + int rank1 = NativeJavaObject.getConversionWeight(arg, type1); + int rank2 = NativeJavaObject.getConversionWeight(arg, type2); + + int preference; + if (rank1 < rank2) { + preference = PREFERENCE_FIRST_ARG; + } else if (rank1 > rank2) { + preference = PREFERENCE_SECOND_ARG; + } else { + // Equal ranks + if (rank1 == NativeJavaObject.CONVERSION_NONTRIVIAL) { + if (type1.isAssignableFrom(type2)) { + preference = PREFERENCE_SECOND_ARG; + } else if (type2.isAssignableFrom(type1)) { + preference = PREFERENCE_FIRST_ARG; + } else { + preference = PREFERENCE_AMBIGUOUS; + } + } else { + preference = PREFERENCE_AMBIGUOUS; + } + } + + totalPreference |= preference; + + if (totalPreference == PREFERENCE_AMBIGUOUS) { + break; + } + } + return totalPreference; + } + + + private static final boolean debug = false; + + private static void printDebug(String msg, MemberBox member, + Object[] args) + { + if (debug) { + StringBuffer sb = new StringBuffer(); + sb.append(" ----- "); + sb.append(msg); + sb.append(member.getDeclaringClass().getName()); + sb.append('.'); + if (member.isMethod()) { + sb.append(member.getName()); + } + sb.append(JavaMembers.liveConnectSignature(member.argTypes)); + sb.append(" for arguments ("); + sb.append(scriptSignature(args)); + sb.append(')'); + System.out.println(sb); + } + } + + MemberBox[] methods; + private String functionName; +} + diff --git a/org/mozilla/javascript/NativeJavaObject.java b/org/mozilla/javascript/NativeJavaObject.java new file mode 100644 index 0000000..6bb106a --- /dev/null +++ b/org/mozilla/javascript/NativeJavaObject.java @@ -0,0 +1,1002 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-2000 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Norris Boyd + * Igor Bukanov + * Frank Mitchell + * Mike Shaver + * Kemal Bayram + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +package org.mozilla.javascript; + +import java.io.*; +import java.lang.reflect.*; +import java.util.Map; +import java.util.Date; + +/** + * This class reflects non-Array Java objects into the JavaScript environment. It + * reflect fields directly, and uses NativeJavaMethod objects to reflect (possibly + * overloaded) methods.

+ * + * @author Mike Shaver + * @see NativeJavaArray + * @see NativeJavaPackage + * @see NativeJavaClass + */ + +public class NativeJavaObject implements Scriptable, Wrapper, Serializable +{ + static final long serialVersionUID = -6948590651130498591L; + + public NativeJavaObject() { } + + public NativeJavaObject(Scriptable scope, Object javaObject, + Class staticType) + { + this(scope, javaObject, staticType, false); + } + + public NativeJavaObject(Scriptable scope, Object javaObject, + Class staticType, boolean isAdapter) + { + this.parent = scope; + this.javaObject = javaObject; + this.staticType = staticType; + this.isAdapter = isAdapter; + initMembers(); + } + + protected void initMembers() { + Class dynamicType; + if (javaObject != null) { + dynamicType = javaObject.getClass(); + } else { + dynamicType = staticType; + } + members = JavaMembers.lookupClass(parent, dynamicType, staticType, + isAdapter); + fieldAndMethods + = members.getFieldAndMethodsObjects(this, javaObject, false); + } + + public boolean has(String name, Scriptable start) { + return members.has(name, false); + } + + public boolean has(int index, Scriptable start) { + return false; + } + + public Object get(String name, Scriptable start) { + if (fieldAndMethods != null) { + Object result = fieldAndMethods.get(name); + if (result != null) { + return result; + } + } + // TODO: passing 'this' as the scope is bogus since it has + // no parent scope + return members.get(this, name, javaObject, false); + } + + public Object get(int index, Scriptable start) { + throw members.reportMemberNotFound(Integer.toString(index)); + } + + public void put(String name, Scriptable start, Object value) { + // We could be asked to modify the value of a property in the + // prototype. Since we can't add a property to a Java object, + // we modify it in the prototype rather than copy it down. + if (prototype == null || members.has(name, false)) + members.put(this, name, javaObject, value, false); + else + prototype.put(name, prototype, value); + } + + public void put(int index, Scriptable start, Object value) { + throw members.reportMemberNotFound(Integer.toString(index)); + } + + public boolean hasInstance(Scriptable value) { + // This is an instance of a Java class, so always return false + return false; + } + + public void delete(String name) { + } + + public void delete(int index) { + } + + public Scriptable getPrototype() { + if (prototype == null && javaObject instanceof String) { + return ScriptableObject.getClassPrototype(parent, "String"); + } + return prototype; + } + + /** + * Sets the prototype of the object. + */ + public void setPrototype(Scriptable m) { + prototype = m; + } + + /** + * Returns the parent (enclosing) scope of the object. + */ + public Scriptable getParentScope() { + return parent; + } + + /** + * Sets the parent (enclosing) scope of the object. + */ + public void setParentScope(Scriptable m) { + parent = m; + } + + public Object[] getIds() { + return members.getIds(false); + } + +/** +@deprecated Use {@link Context#getWrapFactory()} together with calling {@link +WrapFactory#wrap(Context, Scriptable, Object, Class)} +*/ + public static Object wrap(Scriptable scope, Object obj, Class staticType) { + + Context cx = Context.getContext(); + return cx.getWrapFactory().wrap(cx, scope, obj, staticType); + } + + public Object unwrap() { + return javaObject; + } + + public String getClassName() { + return "JavaObject"; + } + + public Object getDefaultValue(Class hint) + { + Object value; + if (hint == null) { + if (javaObject instanceof Boolean) { + hint = ScriptRuntime.BooleanClass; + } + } + if (hint == null || hint == ScriptRuntime.StringClass) { + value = javaObject.toString(); + } else { + String converterName; + if (hint == ScriptRuntime.BooleanClass) { + converterName = "booleanValue"; + } else if (hint == ScriptRuntime.NumberClass) { + converterName = "doubleValue"; + } else { + throw Context.reportRuntimeError0("msg.default.value"); + } + Object converterObject = get(converterName, this); + if (converterObject instanceof Function) { + Function f = (Function)converterObject; + value = f.call(Context.getContext(), f.getParentScope(), + this, ScriptRuntime.emptyArgs); + } else { + if (hint == ScriptRuntime.NumberClass + && javaObject instanceof Boolean) + { + boolean b = ((Boolean)javaObject).booleanValue(); + value = ScriptRuntime.wrapNumber(b ? 1.0 : 0.0); + } else { + value = javaObject.toString(); + } + } + } + return value; + } + + /** + * Determine whether we can/should convert between the given type and the + * desired one. This should be superceded by a conversion-cost calculation + * function, but for now I'll hide behind precedent. + */ + public static boolean canConvert(Object fromObj, Class to) { + int weight = getConversionWeight(fromObj, to); + + return (weight < CONVERSION_NONE); + } + + private static final int JSTYPE_UNDEFINED = 0; // undefined type + private static final int JSTYPE_NULL = 1; // null + private static final int JSTYPE_BOOLEAN = 2; // boolean + private static final int JSTYPE_NUMBER = 3; // number + private static final int JSTYPE_STRING = 4; // string + private static final int JSTYPE_JAVA_CLASS = 5; // JavaClass + private static final int JSTYPE_JAVA_OBJECT = 6; // JavaObject + private static final int JSTYPE_JAVA_ARRAY = 7; // JavaArray + private static final int JSTYPE_OBJECT = 8; // Scriptable + + static final byte CONVERSION_TRIVIAL = 1; + static final byte CONVERSION_NONTRIVIAL = 0; + static final byte CONVERSION_NONE = 99; + + /** + * Derive a ranking based on how "natural" the conversion is. + * The special value CONVERSION_NONE means no conversion is possible, + * and CONVERSION_NONTRIVIAL signals that more type conformance testing + * is required. + * Based on + * + * "preferred method conversions" from Live Connect 3 + */ + static int getConversionWeight(Object fromObj, Class to) { + int fromCode = getJSTypeCode(fromObj); + + switch (fromCode) { + + case JSTYPE_UNDEFINED: + if (to == ScriptRuntime.StringClass || + to == ScriptRuntime.ObjectClass) { + return 1; + } + break; + + case JSTYPE_NULL: + if (!to.isPrimitive()) { + return 1; + } + break; + + case JSTYPE_BOOLEAN: + // "boolean" is #1 + if (to == Boolean.TYPE) { + return 1; + } + else if (to == ScriptRuntime.BooleanClass) { + return 2; + } + else if (to == ScriptRuntime.ObjectClass) { + return 3; + } + else if (to == ScriptRuntime.StringClass) { + return 4; + } + break; + + case JSTYPE_NUMBER: + if (to.isPrimitive()) { + if (to == Double.TYPE) { + return 1; + } + else if (to != Boolean.TYPE) { + return 1 + getSizeRank(to); + } + } + else { + if (to == ScriptRuntime.StringClass) { + // native numbers are #1-8 + return 9; + } + else if (to == ScriptRuntime.ObjectClass) { + return 10; + } + else if (ScriptRuntime.NumberClass.isAssignableFrom(to)) { + // "double" is #1 + return 2; + } + } + break; + + case JSTYPE_STRING: + if (to == ScriptRuntime.StringClass) { + return 1; + } + else if (to.isInstance(fromObj)) { + return 2; + } + else if (to.isPrimitive()) { + if (to == Character.TYPE) { + return 3; + } else if (to != Boolean.TYPE) { + return 4; + } + } + break; + + case JSTYPE_JAVA_CLASS: + if (to == ScriptRuntime.ClassClass) { + return 1; + } + else if (to == ScriptRuntime.ObjectClass) { + return 3; + } + else if (to == ScriptRuntime.StringClass) { + return 4; + } + break; + + case JSTYPE_JAVA_OBJECT: + case JSTYPE_JAVA_ARRAY: + Object javaObj = fromObj; + if (javaObj instanceof Wrapper) { + javaObj = ((Wrapper)javaObj).unwrap(); + } + if (to.isInstance(javaObj)) { + return CONVERSION_NONTRIVIAL; + } + if (to == ScriptRuntime.StringClass) { + return 2; + } + else if (to.isPrimitive() && to != Boolean.TYPE) { + return (fromCode == JSTYPE_JAVA_ARRAY) + ? CONVERSION_NONE : 2 + getSizeRank(to); + } + break; + + case JSTYPE_OBJECT: + // Other objects takes #1-#3 spots + if (Scriptable.class.isAssignableFrom(to) && to.isInstance(fromObj)) { + // No conversion required + return 1; + } + if (to.isArray()) { + if (fromObj instanceof NativeArray) { + // This is a native array conversion to a java array + // Array conversions are all equal, and preferable to object + // and string conversion, per LC3. + return 1; + } + } + else if (to == ScriptRuntime.ObjectClass) { + return 2; + } + else if (to == ScriptRuntime.StringClass) { + return 3; + } + else if (to == ScriptRuntime.DateClass) { + if (fromObj instanceof NativeDate) { + // This is a native date to java date conversion + return 1; + } + } + else if (to.isInterface()) { + if (fromObj instanceof Function) { + // See comments in coerceType + if (to.getMethods().length == 1) { + return 1; + } + } + return 11; + } + else if (to.isPrimitive() && to != Boolean.TYPE) { + return 3 + getSizeRank(to); + } + break; + } + + return CONVERSION_NONE; + } + + static int getSizeRank(Class aType) { + if (aType == Double.TYPE) { + return 1; + } + else if (aType == Float.TYPE) { + return 2; + } + else if (aType == Long.TYPE) { + return 3; + } + else if (aType == Integer.TYPE) { + return 4; + } + else if (aType == Short.TYPE) { + return 5; + } + else if (aType == Character.TYPE) { + return 6; + } + else if (aType == Byte.TYPE) { + return 7; + } + else if (aType == Boolean.TYPE) { + return CONVERSION_NONE; + } + else { + return 8; + } + } + + private static int getJSTypeCode(Object value) { + if (value == null) { + return JSTYPE_NULL; + } + else if (value == Undefined.instance) { + return JSTYPE_UNDEFINED; + } + else if (value instanceof String) { + return JSTYPE_STRING; + } + else if (value instanceof Number) { + return JSTYPE_NUMBER; + } + else if (value instanceof Boolean) { + return JSTYPE_BOOLEAN; + } + else if (value instanceof Scriptable) { + if (value instanceof NativeJavaClass) { + return JSTYPE_JAVA_CLASS; + } + else if (value instanceof NativeJavaArray) { + return JSTYPE_JAVA_ARRAY; + } + else if (value instanceof Wrapper) { + return JSTYPE_JAVA_OBJECT; + } + else { + return JSTYPE_OBJECT; + } + } + else if (value instanceof Class) { + return JSTYPE_JAVA_CLASS; + } + else { + Class valueClass = value.getClass(); + if (valueClass.isArray()) { + return JSTYPE_JAVA_ARRAY; + } + else { + return JSTYPE_JAVA_OBJECT; + } + } + } + + /** + * Not intended for public use. Callers should use the + * public API Context.toType. + * @deprecated as of 1.5 Release 4 + * @see org.mozilla.javascript.Context#jsToJava(Object, Class) + */ + public static Object coerceType(Class type, Object value) + { + return coerceTypeImpl(type, value); + } + + /** + * Type-munging for field setting and method invocation. + * Conforms to LC3 specification + */ + static Object coerceTypeImpl(Class type, Object value) + { + if (value != null && value.getClass() == type) { + return value; + } + + switch (getJSTypeCode(value)) { + + case JSTYPE_NULL: + // raise error if type.isPrimitive() + if (type.isPrimitive()) { + reportConversionError(value, type); + } + return null; + + case JSTYPE_UNDEFINED: + if (type == ScriptRuntime.StringClass || + type == ScriptRuntime.ObjectClass) { + return "undefined"; + } + else { + reportConversionError("undefined", type); + } + break; + + case JSTYPE_BOOLEAN: + // Under LC3, only JS Booleans can be coerced into a Boolean value + if (type == Boolean.TYPE || + type == ScriptRuntime.BooleanClass || + type == ScriptRuntime.ObjectClass) { + return value; + } + else if (type == ScriptRuntime.StringClass) { + return value.toString(); + } + else { + reportConversionError(value, type); + } + break; + + case JSTYPE_NUMBER: + if (type == ScriptRuntime.StringClass) { + return ScriptRuntime.toString(value); + } + else if (type == ScriptRuntime.ObjectClass) { + return coerceToNumber(Double.TYPE, value); + } + else if ((type.isPrimitive() && type != Boolean.TYPE) || + ScriptRuntime.NumberClass.isAssignableFrom(type)) { + return coerceToNumber(type, value); + } + else { + reportConversionError(value, type); + } + break; + + case JSTYPE_STRING: + if (type == ScriptRuntime.StringClass || type.isInstance(value)) { + return value; + } + else if (type == Character.TYPE + || type == ScriptRuntime.CharacterClass) + { + // Special case for converting a single char string to a + // character + // Placed here because it applies *only* to JS strings, + // not other JS objects converted to strings + if (((String)value).length() == 1) { + return new Character(((String)value).charAt(0)); + } + else { + return coerceToNumber(type, value); + } + } + else if ((type.isPrimitive() && type != Boolean.TYPE) + || ScriptRuntime.NumberClass.isAssignableFrom(type)) + { + return coerceToNumber(type, value); + } + else { + reportConversionError(value, type); + } + break; + + case JSTYPE_JAVA_CLASS: + if (value instanceof Wrapper) { + value = ((Wrapper)value).unwrap(); + } + + if (type == ScriptRuntime.ClassClass || + type == ScriptRuntime.ObjectClass) { + return value; + } + else if (type == ScriptRuntime.StringClass) { + return value.toString(); + } + else { + reportConversionError(value, type); + } + break; + + case JSTYPE_JAVA_OBJECT: + case JSTYPE_JAVA_ARRAY: + if (value instanceof Wrapper) { + value = ((Wrapper)value).unwrap(); + } + if (type.isPrimitive()) { + if (type == Boolean.TYPE) { + reportConversionError(value, type); + } + return coerceToNumber(type, value); + } + else { + if (type == ScriptRuntime.StringClass) { + return value.toString(); + } + else { + if (type.isInstance(value)) { + return value; + } + else { + reportConversionError(value, type); + } + } + } + break; + + case JSTYPE_OBJECT: + if (type == ScriptRuntime.StringClass) { + return ScriptRuntime.toString(value); + } + else if (type.isPrimitive()) { + if (type == Boolean.TYPE) { + reportConversionError(value, type); + } + return coerceToNumber(type, value); + } + else if (type.isInstance(value)) { + return value; + } + else if (type == ScriptRuntime.DateClass + && value instanceof NativeDate) + { + double time = ((NativeDate)value).getJSTimeValue(); + // XXX: This will replace NaN by 0 + return new Date((long)time); + } + else if (type.isArray() && value instanceof NativeArray) { + // Make a new java array, and coerce the JS array components + // to the target (component) type. + NativeArray array = (NativeArray) value; + long length = array.getLength(); + Class arrayType = type.getComponentType(); + Object Result = Array.newInstance(arrayType, (int)length); + for (int i = 0 ; i < length ; ++i) { + try { + Array.set(Result, i, coerceType(arrayType, + array.get(i, array))); + } + catch (EvaluatorException ee) { + reportConversionError(value, type); + } + } + + return Result; + } + else if (value instanceof Wrapper) { + value = ((Wrapper)value).unwrap(); + if (type.isInstance(value)) + return value; + reportConversionError(value, type); + } + else if (type.isInterface() && value instanceof Callable) { + // Try to use function as implementation of Java interface. + // + // XXX: Currently only instances of ScriptableObject are + // supported since the resulting interface proxies should + // be reused next time conversion is made and generic + // Callable has no storage for it. Weak references can + // address it but for now use this restriction. + if (value instanceof ScriptableObject) { + ScriptableObject so = (ScriptableObject)value; + Object key = Kit.makeHashKeyFromPair( + COERCED_INTERFACE_KEY, type); + Object old = so.getAssociatedValue(key); + if (old != null) { + // Function was already wrapped + return old; + } + Context cx = Context.getContext(); + Object glue + = InterfaceAdapter.create(cx, type, (Callable)value); + // Store for later retrival + glue = so.associateValue(key, glue); + return glue; + } + reportConversionError(value, type); + } else { + reportConversionError(value, type); + } + break; + } + + return value; + } + + private static Object coerceToNumber(Class type, Object value) + { + Class valueClass = value.getClass(); + + // Character + if (type == Character.TYPE || type == ScriptRuntime.CharacterClass) { + if (valueClass == ScriptRuntime.CharacterClass) { + return value; + } + return new Character((char)toInteger(value, + ScriptRuntime.CharacterClass, + Character.MIN_VALUE, + Character.MAX_VALUE)); + } + + // Double, Float + if (type == ScriptRuntime.ObjectClass || + type == ScriptRuntime.DoubleClass || type == Double.TYPE) { + return valueClass == ScriptRuntime.DoubleClass + ? value + : new Double(toDouble(value)); + } + + if (type == ScriptRuntime.FloatClass || type == Float.TYPE) { + if (valueClass == ScriptRuntime.FloatClass) { + return value; + } + else { + double number = toDouble(value); + if (Double.isInfinite(number) || Double.isNaN(number) + || number == 0.0) { + return new Float((float)number); + } + else { + double absNumber = Math.abs(number); + if (absNumber < Float.MIN_VALUE) { + return new Float((number > 0.0) ? +0.0 : -0.0); + } + else if (absNumber > Float.MAX_VALUE) { + return new Float((number > 0.0) ? + Float.POSITIVE_INFINITY : + Float.NEGATIVE_INFINITY); + } + else { + return new Float((float)number); + } + } + } + } + + // Integer, Long, Short, Byte + if (type == ScriptRuntime.IntegerClass || type == Integer.TYPE) { + if (valueClass == ScriptRuntime.IntegerClass) { + return value; + } + else { + return new Integer((int)toInteger(value, + ScriptRuntime.IntegerClass, + Integer.MIN_VALUE, + Integer.MAX_VALUE)); + } + } + + if (type == ScriptRuntime.LongClass || type == Long.TYPE) { + if (valueClass == ScriptRuntime.LongClass) { + return value; + } else { + /* Long values cannot be expressed exactly in doubles. + * We thus use the largest and smallest double value that + * has a value expressible as a long value. We build these + * numerical values from their hexidecimal representations + * to avoid any problems caused by attempting to parse a + * decimal representation. + */ + final double max = Double.longBitsToDouble(0x43dfffffffffffffL); + final double min = Double.longBitsToDouble(0xc3e0000000000000L); + return new Long(toInteger(value, + ScriptRuntime.LongClass, + min, + max)); + } + } + + if (type == ScriptRuntime.ShortClass || type == Short.TYPE) { + if (valueClass == ScriptRuntime.ShortClass) { + return value; + } + else { + return new Short((short)toInteger(value, + ScriptRuntime.ShortClass, + Short.MIN_VALUE, + Short.MAX_VALUE)); + } + } + + if (type == ScriptRuntime.ByteClass || type == Byte.TYPE) { + if (valueClass == ScriptRuntime.ByteClass) { + return value; + } + else { + return new Byte((byte)toInteger(value, + ScriptRuntime.ByteClass, + Byte.MIN_VALUE, + Byte.MAX_VALUE)); + } + } + + return new Double(toDouble(value)); + } + + + private static double toDouble(Object value) + { + if (value instanceof Number) { + return ((Number)value).doubleValue(); + } + else if (value instanceof String) { + return ScriptRuntime.toNumber((String)value); + } + else if (value instanceof Scriptable) { + if (value instanceof Wrapper) { + // XXX: optimize tail-recursion? + return toDouble(((Wrapper)value).unwrap()); + } + else { + return ScriptRuntime.toNumber(value); + } + } + else { + Method meth; + try { + meth = value.getClass().getMethod("doubleValue", + (Class [])null); + } + catch (NoSuchMethodException e) { + meth = null; + } + catch (SecurityException e) { + meth = null; + } + if (meth != null) { + try { + return ((Number)meth.invoke(value, + (Object [])null)).doubleValue(); + } + catch (IllegalAccessException e) { + // XXX: ignore, or error message? + reportConversionError(value, Double.TYPE); + } + catch (InvocationTargetException e) { + // XXX: ignore, or error message? + reportConversionError(value, Double.TYPE); + } + } + return ScriptRuntime.toNumber(value.toString()); + } + } + + private static long toInteger(Object value, Class type, + double min, double max) + { + double d = toDouble(value); + + if (Double.isInfinite(d) || Double.isNaN(d)) { + // Convert to string first, for more readable message + reportConversionError(ScriptRuntime.toString(value), type); + } + + if (d > 0.0) { + d = Math.floor(d); + } + else { + d = Math.ceil(d); + } + + if (d < min || d > max) { + // Convert to string first, for more readable message + reportConversionError(ScriptRuntime.toString(value), type); + } + return (long)d; + } + + static void reportConversionError(Object value, Class type) + { + // It uses String.valueOf(value), not value.toString() since + // value can be null, bug 282447. + throw Context.reportRuntimeError2( + "msg.conversion.not.allowed", + String.valueOf(value), + JavaMembers.javaSignature(type)); + } + + private void writeObject(ObjectOutputStream out) + throws IOException + { + out.defaultWriteObject(); + + out.writeBoolean(isAdapter); + if (isAdapter) { + if (adapter_writeAdapterObject == null) { + throw new IOException(); + } + Object[] args = { javaObject, out }; + try { + adapter_writeAdapterObject.invoke(null, args); + } catch (Exception ex) { + throw new IOException(); + } + } else { + out.writeObject(javaObject); + } + + if (staticType != null) { + out.writeObject(staticType.getClass().getName()); + } else { + out.writeObject(null); + } + } + + private void readObject(ObjectInputStream in) + throws IOException, ClassNotFoundException + { + in.defaultReadObject(); + + isAdapter = in.readBoolean(); + if (isAdapter) { + if (adapter_readAdapterObject == null) + throw new ClassNotFoundException(); + Object[] args = { this, in }; + try { + javaObject = adapter_readAdapterObject.invoke(null, args); + } catch (Exception ex) { + throw new IOException(); + } + } else { + javaObject = in.readObject(); + } + + String className = (String)in.readObject(); + if (className != null) { + staticType = Class.forName(className); + } else { + staticType = null; + } + + initMembers(); + } + + /** + * The prototype of this object. + */ + protected Scriptable prototype; + + /** + * The parent scope of this object. + */ + protected Scriptable parent; + + protected transient Object javaObject; + + protected transient Class staticType; + protected transient JavaMembers members; + private transient Map fieldAndMethods; + private transient boolean isAdapter; + + private static final Object COERCED_INTERFACE_KEY = "Coerced Interface"; + private static Method adapter_writeAdapterObject; + private static Method adapter_readAdapterObject; + + static { + // Reflection in java is verbose + Class[] sig2 = new Class[2]; + Class cl = Kit.classOrNull("org.mozilla.javascript.JavaAdapter"); + if (cl != null) { + try { + sig2[0] = ScriptRuntime.ObjectClass; + sig2[1] = Kit.classOrNull("java.io.ObjectOutputStream"); + adapter_writeAdapterObject = cl.getMethod("writeAdapterObject", + sig2); + + sig2[0] = ScriptRuntime.ScriptableClass; + sig2[1] = Kit.classOrNull("java.io.ObjectInputStream"); + adapter_readAdapterObject = cl.getMethod("readAdapterObject", + sig2); + + } catch (Exception ex) { + adapter_writeAdapterObject = null; + adapter_readAdapterObject = null; + } + } + } + +} diff --git a/org/mozilla/javascript/NativeJavaPackage.java b/org/mozilla/javascript/NativeJavaPackage.java new file mode 100644 index 0000000..464762a --- /dev/null +++ b/org/mozilla/javascript/NativeJavaPackage.java @@ -0,0 +1,218 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-1999 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Norris Boyd + * Frank Mitchell + * Mike Shaver + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +package org.mozilla.javascript; + +import java.util.HashSet; +import java.util.Set; + +/** + * This class reflects Java packages into the JavaScript environment. We + * lazily reflect classes and subpackages, and use a caching/sharing + * system to ensure that members reflected into one JavaPackage appear + * in all other references to the same package (as with Packages.java.lang + * and java.lang). + * + * @author Mike Shaver + * @see NativeJavaArray + * @see NativeJavaObject + * @see NativeJavaClass + */ + +public class NativeJavaPackage extends ScriptableObject +{ + static final long serialVersionUID = 7445054382212031523L; + + NativeJavaPackage(boolean internalUsage, String packageName, + ClassLoader classLoader) + { + this.packageName = packageName; + this.classLoader = classLoader; + } + + /** + * @deprecated NativeJavaPackage is an internal class, do not use + * it directly. + */ + public NativeJavaPackage(String packageName, ClassLoader classLoader) { + this(false, packageName, classLoader); + } + + /** + * @deprecated NativeJavaPackage is an internal class, do not use + * it directly. + */ + public NativeJavaPackage(String packageName) { + this(false, packageName, + Context.getCurrentContext().getApplicationClassLoader()); + } + + @Override + public String getClassName() { + return "JavaPackage"; + } + + @Override + public boolean has(String id, Scriptable start) { + return true; + } + + @Override + public boolean has(int index, Scriptable start) { + return false; + } + + @Override + public void put(String id, Scriptable start, Object value) { + // Can't add properties to Java packages. Sorry. + } + + @Override + public void put(int index, Scriptable start, Object value) { + throw Context.reportRuntimeError0("msg.pkg.int"); + } + + @Override + public Object get(String id, Scriptable start) { + return getPkgProperty(id, start, true); + } + + @Override + public Object get(int index, Scriptable start) { + return NOT_FOUND; + } + + // set up a name which is known to be a package so we don't + // need to look for a class by that name + NativeJavaPackage forcePackage(String name, Scriptable scope) + { + Object cached = super.get(name, this); + if (cached != null && cached instanceof NativeJavaPackage) { + return (NativeJavaPackage) cached; + } else { + String newPackage = packageName.length() == 0 + ? name + : packageName + "." + name; + NativeJavaPackage pkg = new NativeJavaPackage(true, newPackage, classLoader); + ScriptRuntime.setObjectProtoAndParent(pkg, scope); + super.put(name, this, pkg); + return pkg; + } + } + + synchronized Object getPkgProperty(String name, Scriptable start, + boolean createPkg) + { + Object cached = super.get(name, start); + if (cached != NOT_FOUND) + return cached; + if (negativeCache != null && negativeCache.contains(name)) { + // Performance optimization: see bug 421071 + return null; + } + + String className = (packageName.length() == 0) + ? name : packageName + '.' + name; + Context cx = Context.getContext(); + ClassShutter shutter = cx.getClassShutter(); + Scriptable newValue = null; + if (shutter == null || shutter.visibleToScripts(className)) { + Class cl = null; + if (classLoader != null) { + cl = Kit.classOrNull(classLoader, className); + } else { + cl = Kit.classOrNull(className); + } + if (cl != null) { + newValue = new NativeJavaClass(getTopLevelScope(this), cl); + newValue.setPrototype(getPrototype()); + } + } + if (newValue == null) { + if (createPkg) { + NativeJavaPackage pkg; + pkg = new NativeJavaPackage(true, className, classLoader); + ScriptRuntime.setObjectProtoAndParent(pkg, getParentScope()); + newValue = pkg; + } else { + // add to negative cache + if (negativeCache == null) + negativeCache = new HashSet(); + negativeCache.add(name); + } + } + if (newValue != null) { + // Make it available for fast lookup and sharing of + // lazily-reflected constructors and static members. + super.put(name, start, newValue); + } + return newValue; + } + + @Override + public Object getDefaultValue(Class ignored) { + return toString(); + } + + @Override + public String toString() { + return "[JavaPackage " + packageName + "]"; + } + + @Override + public boolean equals(Object obj) { + if(obj instanceof NativeJavaPackage) { + NativeJavaPackage njp = (NativeJavaPackage)obj; + return packageName.equals(njp.packageName) && + classLoader == njp.classLoader; + } + return false; + } + + @Override + public int hashCode() { + return packageName.hashCode() ^ + (classLoader == null ? 0 : classLoader.hashCode()); + } + + private String packageName; + private ClassLoader classLoader; + private Set negativeCache = null; +} diff --git a/org/mozilla/javascript/NativeJavaTopPackage.java b/org/mozilla/javascript/NativeJavaTopPackage.java new file mode 100644 index 0000000..3095363 --- /dev/null +++ b/org/mozilla/javascript/NativeJavaTopPackage.java @@ -0,0 +1,186 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-1999 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Norris Boyd + * Frank Mitchell + * Mike Shaver + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +package org.mozilla.javascript; + +/** + * This class reflects Java packages into the JavaScript environment. We + * lazily reflect classes and subpackages, and use a caching/sharing + * system to ensure that members reflected into one JavaPackage appear + * in all other references to the same package (as with Packages.java.lang + * and java.lang). + * + * @author Mike Shaver + * @see NativeJavaArray + * @see NativeJavaObject + * @see NativeJavaClass + */ + +public class NativeJavaTopPackage + extends NativeJavaPackage implements Function, IdFunctionCall +{ + static final long serialVersionUID = -1455787259477709999L; + + // we know these are packages so we can skip the class check + // note that this is ok even if the package isn't present. + private static final String[][] commonPackages = { + {"java", "lang", "reflect"}, + {"java", "io"}, + {"java", "math"}, + {"java", "net"}, + {"java", "util", "zip"}, + {"java", "text", "resources"}, + {"java", "applet"}, + {"javax", "swing"} + }; + + NativeJavaTopPackage(ClassLoader loader) + { + super(true, "", loader); + } + + public Object call(Context cx, Scriptable scope, Scriptable thisObj, + Object[] args) + { + return construct(cx, scope, args); + } + + public Scriptable construct(Context cx, Scriptable scope, Object[] args) + { + ClassLoader loader = null; + if (args.length != 0) { + Object arg = args[0]; + if (arg instanceof Wrapper) { + arg = ((Wrapper)arg).unwrap(); + } + if (arg instanceof ClassLoader) { + loader = (ClassLoader)arg; + } + } + if (loader == null) { + Context.reportRuntimeError0("msg.not.classloader"); + return null; + } + return new NativeJavaPackage(true, "", loader); + } + + public static void init(Context cx, Scriptable scope, boolean sealed) + { + ClassLoader loader = cx.getApplicationClassLoader(); + final NativeJavaTopPackage top = new NativeJavaTopPackage(loader); + top.setPrototype(getObjectPrototype(scope)); + top.setParentScope(scope); + + for (int i = 0; i != commonPackages.length; i++) { + NativeJavaPackage parent = top; + for (int j = 0; j != commonPackages[i].length; j++) { + parent = parent.forcePackage(commonPackages[i][j], scope); + } + } + + // getClass implementation + IdFunctionObject getClass = new IdFunctionObject(top, FTAG, Id_getClass, + "getClass", 1, scope); + + // We want to get a real alias, and not a distinct JavaPackage + // with the same packageName, so that we share classes and top + // that are underneath. + String[] topNames = { "java", "javax", "org", "com", "edu", "net" }; + NativeJavaPackage[] topPackages = new NativeJavaPackage[topNames.length]; + for (int i=0; i < topNames.length; i++) { + topPackages[i] = (NativeJavaPackage)top.get(topNames[i], top); + } + + // It's safe to downcast here since initStandardObjects takes + // a ScriptableObject. + ScriptableObject global = (ScriptableObject) scope; + + if (sealed) { + getClass.sealObject(); + } + getClass.exportAsScopeProperty(); + global.defineProperty("Packages", top, ScriptableObject.DONTENUM); + for (int i=0; i < topNames.length; i++) { + global.defineProperty(topNames[i], topPackages[i], + ScriptableObject.DONTENUM); + } + } + + public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope, + Scriptable thisObj, Object[] args) + { + if (f.hasTag(FTAG)) { + if (f.methodId() == Id_getClass) { + return js_getClass(cx, scope, args); + } + } + throw f.unknown(); + } + + private Scriptable js_getClass(Context cx, Scriptable scope, Object[] args) + { + if (args.length > 0 && args[0] instanceof Wrapper) { + Scriptable result = this; + Class cl = ((Wrapper) args[0]).unwrap().getClass(); + // Evaluate the class name by getting successive properties of + // the string to find the appropriate NativeJavaClass object + String name = cl.getName(); + int offset = 0; + for (;;) { + int index = name.indexOf('.', offset); + String propName = index == -1 + ? name.substring(offset) + : name.substring(offset, index); + Object prop = result.get(propName, result); + if (!(prop instanceof Scriptable)) + break; // fall through to error + result = (Scriptable) prop; + if (index == -1) + return result; + offset = index+1; + } + } + throw Context.reportRuntimeError0("msg.not.java.obj"); + } + + private static final Object FTAG = "JavaTopPackage"; + private static final int Id_getClass = 1; +} + diff --git a/org/mozilla/javascript/NativeMath.java b/org/mozilla/javascript/NativeMath.java new file mode 100644 index 0000000..d91a80f --- /dev/null +++ b/org/mozilla/javascript/NativeMath.java @@ -0,0 +1,403 @@ +/* -*- Mode: java; tab-width: 4; indent-tabs-mode: 1; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-1999 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Norris Boyd + * Igor Bukanov + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +package org.mozilla.javascript; + +/** + * This class implements the Math native object. + * See ECMA 15.8. + * @author Norris Boyd + */ + +final class NativeMath extends IdScriptableObject +{ + static final long serialVersionUID = -8838847185801131569L; + + private static final Object MATH_TAG = "Math"; + + static void init(Scriptable scope, boolean sealed) + { + NativeMath obj = new NativeMath(); + obj.activatePrototypeMap(MAX_ID); + obj.setPrototype(getObjectPrototype(scope)); + obj.setParentScope(scope); + if (sealed) { obj.sealObject(); } + ScriptableObject.defineProperty(scope, "Math", obj, + ScriptableObject.DONTENUM); + } + + private NativeMath() + { + } + + @Override + public String getClassName() { return "Math"; } + + @Override + protected void initPrototypeId(int id) + { + if (id <= LAST_METHOD_ID) { + String name; + int arity; + switch (id) { + case Id_toSource: arity = 0; name = "toSource"; break; + case Id_abs: arity = 1; name = "abs"; break; + case Id_acos: arity = 1; name = "acos"; break; + case Id_asin: arity = 1; name = "asin"; break; + case Id_atan: arity = 1; name = "atan"; break; + case Id_atan2: arity = 2; name = "atan2"; break; + case Id_ceil: arity = 1; name = "ceil"; break; + case Id_cos: arity = 1; name = "cos"; break; + case Id_exp: arity = 1; name = "exp"; break; + case Id_floor: arity = 1; name = "floor"; break; + case Id_log: arity = 1; name = "log"; break; + case Id_max: arity = 2; name = "max"; break; + case Id_min: arity = 2; name = "min"; break; + case Id_pow: arity = 2; name = "pow"; break; + case Id_random: arity = 0; name = "random"; break; + case Id_round: arity = 1; name = "round"; break; + case Id_sin: arity = 1; name = "sin"; break; + case Id_sqrt: arity = 1; name = "sqrt"; break; + case Id_tan: arity = 1; name = "tan"; break; + default: throw new IllegalStateException(String.valueOf(id)); + } + initPrototypeMethod(MATH_TAG, id, name, arity); + } else { + String name; + double x; + switch (id) { + case Id_E: x = Math.E; name = "E"; break; + case Id_PI: x = Math.PI; name = "PI"; break; + case Id_LN10: x = 2.302585092994046; name = "LN10"; break; + case Id_LN2: x = 0.6931471805599453; name = "LN2"; break; + case Id_LOG2E: x = 1.4426950408889634; name = "LOG2E"; break; + case Id_LOG10E: x = 0.4342944819032518; name = "LOG10E"; break; + case Id_SQRT1_2: x = 0.7071067811865476; name = "SQRT1_2"; break; + case Id_SQRT2: x = 1.4142135623730951; name = "SQRT2"; break; + default: throw new IllegalStateException(String.valueOf(id)); + } + initPrototypeValue(id, name, ScriptRuntime.wrapNumber(x), + DONTENUM | READONLY | PERMANENT); + } + } + + @Override + public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope, + Scriptable thisObj, Object[] args) + { + if (!f.hasTag(MATH_TAG)) { + return super.execIdCall(f, cx, scope, thisObj, args); + } + double x; + int methodId = f.methodId(); + switch (methodId) { + case Id_toSource: + return "Math"; + + case Id_abs: + x = ScriptRuntime.toNumber(args, 0); + // abs(-0.0) should be 0.0, but -0.0 < 0.0 == false + x = (x == 0.0) ? 0.0 : (x < 0.0) ? -x : x; + break; + + case Id_acos: + case Id_asin: + x = ScriptRuntime.toNumber(args, 0); + if (x == x && -1.0 <= x && x <= 1.0) { + x = (methodId == Id_acos) ? Math.acos(x) : Math.asin(x); + } else { + x = Double.NaN; + } + break; + + case Id_atan: + x = ScriptRuntime.toNumber(args, 0); + x = Math.atan(x); + break; + + case Id_atan2: + x = ScriptRuntime.toNumber(args, 0); + x = Math.atan2(x, ScriptRuntime.toNumber(args, 1)); + break; + + case Id_ceil: + x = ScriptRuntime.toNumber(args, 0); + x = Math.ceil(x); + break; + + case Id_cos: + x = ScriptRuntime.toNumber(args, 0); + x = (x == Double.POSITIVE_INFINITY + || x == Double.NEGATIVE_INFINITY) + ? Double.NaN : Math.cos(x); + break; + + case Id_exp: + x = ScriptRuntime.toNumber(args, 0); + x = (x == Double.POSITIVE_INFINITY) ? x + : (x == Double.NEGATIVE_INFINITY) ? 0.0 + : Math.exp(x); + break; + + case Id_floor: + x = ScriptRuntime.toNumber(args, 0); + x = Math.floor(x); + break; + + case Id_log: + x = ScriptRuntime.toNumber(args, 0); + // Java's log(<0) = -Infinity; we need NaN + x = (x < 0) ? Double.NaN : Math.log(x); + break; + + case Id_max: + case Id_min: + x = (methodId == Id_max) + ? Double.NEGATIVE_INFINITY : Double.POSITIVE_INFINITY; + for (int i = 0; i != args.length; ++i) { + double d = ScriptRuntime.toNumber(args[i]); + if (d != d) { + x = d; // NaN + break; + } + if (methodId == Id_max) { + // if (x < d) x = d; does not work due to -0.0 >= +0.0 + x = Math.max(x, d); + } else { + x = Math.min(x, d); + } + } + break; + + case Id_pow: + x = ScriptRuntime.toNumber(args, 0); + x = js_pow(x, ScriptRuntime.toNumber(args, 1)); + break; + + case Id_random: + x = Math.random(); + break; + + case Id_round: + x = ScriptRuntime.toNumber(args, 0); + if (x == x && x != Double.POSITIVE_INFINITY + && x != Double.NEGATIVE_INFINITY) + { + // Round only finite x + long l = Math.round(x); + if (l != 0) { + x = l; + } else { + // We must propagate the sign of d into the result + if (x < 0.0) { + x = ScriptRuntime.negativeZero; + } else if (x != 0.0) { + x = 0.0; + } + } + } + break; + + case Id_sin: + x = ScriptRuntime.toNumber(args, 0); + x = (x == Double.POSITIVE_INFINITY + || x == Double.NEGATIVE_INFINITY) + ? Double.NaN : Math.sin(x); + break; + + case Id_sqrt: + x = ScriptRuntime.toNumber(args, 0); + x = Math.sqrt(x); + break; + + case Id_tan: + x = ScriptRuntime.toNumber(args, 0); + x = Math.tan(x); + break; + + default: throw new IllegalStateException(String.valueOf(methodId)); + } + return ScriptRuntime.wrapNumber(x); + } + + // See Ecma 15.8.2.13 + private double js_pow(double x, double y) { + double result; + if (y != y) { + // y is NaN, result is always NaN + result = y; + } else if (y == 0) { + // Java's pow(NaN, 0) = NaN; we need 1 + result = 1.0; + } else if (x == 0) { + // Many differences from Java's Math.pow + if (1 / x > 0) { + result = (y > 0) ? 0 : Double.POSITIVE_INFINITY; + } else { + // x is -0, need to check if y is an odd integer + long y_long = (long)y; + if (y_long == y && (y_long & 0x1) != 0) { + result = (y > 0) ? -0.0 : Double.NEGATIVE_INFINITY; + } else { + result = (y > 0) ? 0.0 : Double.POSITIVE_INFINITY; + } + } + } else { + result = Math.pow(x, y); + if (result != result) { + // Check for broken Java implementations that gives NaN + // when they should return something else + if (y == Double.POSITIVE_INFINITY) { + if (x < -1.0 || 1.0 < x) { + result = Double.POSITIVE_INFINITY; + } else if (-1.0 < x && x < 1.0) { + result = 0; + } + } else if (y == Double.NEGATIVE_INFINITY) { + if (x < -1.0 || 1.0 < x) { + result = 0; + } else if (-1.0 < x && x < 1.0) { + result = Double.POSITIVE_INFINITY; + } + } else if (x == Double.POSITIVE_INFINITY) { + result = (y > 0) ? Double.POSITIVE_INFINITY : 0.0; + } else if (x == Double.NEGATIVE_INFINITY) { + long y_long = (long)y; + if (y_long == y && (y_long & 0x1) != 0) { + // y is odd integer + result = (y > 0) ? Double.NEGATIVE_INFINITY : -0.0; + } else { + result = (y > 0) ? Double.POSITIVE_INFINITY : 0.0; + } + } + } + } + return result; + } + +// #string_id_map# + + @Override + protected int findPrototypeId(String s) + { + int id; +// #generated# Last update: 2004-03-17 13:51:32 CET + L0: { id = 0; String X = null; int c; + L: switch (s.length()) { + case 1: if (s.charAt(0)=='E') {id=Id_E; break L0;} break L; + case 2: if (s.charAt(0)=='P' && s.charAt(1)=='I') {id=Id_PI; break L0;} break L; + case 3: switch (s.charAt(0)) { + case 'L': if (s.charAt(2)=='2' && s.charAt(1)=='N') {id=Id_LN2; break L0;} break L; + case 'a': if (s.charAt(2)=='s' && s.charAt(1)=='b') {id=Id_abs; break L0;} break L; + case 'c': if (s.charAt(2)=='s' && s.charAt(1)=='o') {id=Id_cos; break L0;} break L; + case 'e': if (s.charAt(2)=='p' && s.charAt(1)=='x') {id=Id_exp; break L0;} break L; + case 'l': if (s.charAt(2)=='g' && s.charAt(1)=='o') {id=Id_log; break L0;} break L; + case 'm': c=s.charAt(2); + if (c=='n') { if (s.charAt(1)=='i') {id=Id_min; break L0;} } + else if (c=='x') { if (s.charAt(1)=='a') {id=Id_max; break L0;} } + break L; + case 'p': if (s.charAt(2)=='w' && s.charAt(1)=='o') {id=Id_pow; break L0;} break L; + case 's': if (s.charAt(2)=='n' && s.charAt(1)=='i') {id=Id_sin; break L0;} break L; + case 't': if (s.charAt(2)=='n' && s.charAt(1)=='a') {id=Id_tan; break L0;} break L; + } break L; + case 4: switch (s.charAt(1)) { + case 'N': X="LN10";id=Id_LN10; break L; + case 'c': X="acos";id=Id_acos; break L; + case 'e': X="ceil";id=Id_ceil; break L; + case 'q': X="sqrt";id=Id_sqrt; break L; + case 's': X="asin";id=Id_asin; break L; + case 't': X="atan";id=Id_atan; break L; + } break L; + case 5: switch (s.charAt(0)) { + case 'L': X="LOG2E";id=Id_LOG2E; break L; + case 'S': X="SQRT2";id=Id_SQRT2; break L; + case 'a': X="atan2";id=Id_atan2; break L; + case 'f': X="floor";id=Id_floor; break L; + case 'r': X="round";id=Id_round; break L; + } break L; + case 6: c=s.charAt(0); + if (c=='L') { X="LOG10E";id=Id_LOG10E; } + else if (c=='r') { X="random";id=Id_random; } + break L; + case 7: X="SQRT1_2";id=Id_SQRT1_2; break L; + case 8: X="toSource";id=Id_toSource; break L; + } + if (X!=null && X!=s && !X.equals(s)) id = 0; + } +// #/generated# + return id; + } + + private static final int + Id_toSource = 1, + Id_abs = 2, + Id_acos = 3, + Id_asin = 4, + Id_atan = 5, + Id_atan2 = 6, + Id_ceil = 7, + Id_cos = 8, + Id_exp = 9, + Id_floor = 10, + Id_log = 11, + Id_max = 12, + Id_min = 13, + Id_pow = 14, + Id_random = 15, + Id_round = 16, + Id_sin = 17, + Id_sqrt = 18, + Id_tan = 19, + + LAST_METHOD_ID = 19; + + private static final int + Id_E = LAST_METHOD_ID + 1, + Id_PI = LAST_METHOD_ID + 2, + Id_LN10 = LAST_METHOD_ID + 3, + Id_LN2 = LAST_METHOD_ID + 4, + Id_LOG2E = LAST_METHOD_ID + 5, + Id_LOG10E = LAST_METHOD_ID + 6, + Id_SQRT1_2 = LAST_METHOD_ID + 7, + Id_SQRT2 = LAST_METHOD_ID + 8, + + MAX_ID = LAST_METHOD_ID + 8; + +// #/string_id_map# +} diff --git a/org/mozilla/javascript/NativeNumber.java b/org/mozilla/javascript/NativeNumber.java new file mode 100644 index 0000000..50ff847 --- /dev/null +++ b/org/mozilla/javascript/NativeNumber.java @@ -0,0 +1,250 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-1999 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Norris Boyd + * Igor Bukanov + * Mike McCabe + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +package org.mozilla.javascript; + +/** + * This class implements the Number native object. + * + * See ECMA 15.7. + * + * @author Norris Boyd + */ +final class NativeNumber extends IdScriptableObject +{ + static final long serialVersionUID = 3504516769741512101L; + + private static final Object NUMBER_TAG = "Number"; + + private static final int MAX_PRECISION = 100; + + static void init(Scriptable scope, boolean sealed) + { + NativeNumber obj = new NativeNumber(0.0); + obj.exportAsJSClass(MAX_PROTOTYPE_ID, scope, sealed); + } + + private NativeNumber(double number) + { + doubleValue = number; + } + + @Override + public String getClassName() + { + return "Number"; + } + + @Override + protected void fillConstructorProperties(IdFunctionObject ctor) + { + final int attr = ScriptableObject.DONTENUM | + ScriptableObject.PERMANENT | + ScriptableObject.READONLY; + + ctor.defineProperty("NaN", ScriptRuntime.NaNobj, attr); + ctor.defineProperty("POSITIVE_INFINITY", + ScriptRuntime.wrapNumber(Double.POSITIVE_INFINITY), + attr); + ctor.defineProperty("NEGATIVE_INFINITY", + ScriptRuntime.wrapNumber(Double.NEGATIVE_INFINITY), + attr); + ctor.defineProperty("MAX_VALUE", + ScriptRuntime.wrapNumber(Double.MAX_VALUE), + attr); + ctor.defineProperty("MIN_VALUE", + ScriptRuntime.wrapNumber(Double.MIN_VALUE), + attr); + + super.fillConstructorProperties(ctor); + } + + @Override + protected void initPrototypeId(int id) + { + String s; + int arity; + switch (id) { + case Id_constructor: arity=1; s="constructor"; break; + case Id_toString: arity=1; s="toString"; break; + case Id_toLocaleString: arity=1; s="toLocaleString"; break; + case Id_toSource: arity=0; s="toSource"; break; + case Id_valueOf: arity=0; s="valueOf"; break; + case Id_toFixed: arity=1; s="toFixed"; break; + case Id_toExponential: arity=1; s="toExponential"; break; + case Id_toPrecision: arity=1; s="toPrecision"; break; + default: throw new IllegalArgumentException(String.valueOf(id)); + } + initPrototypeMethod(NUMBER_TAG, id, s, arity); + } + + @Override + public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope, + Scriptable thisObj, Object[] args) + { + if (!f.hasTag(NUMBER_TAG)) { + return super.execIdCall(f, cx, scope, thisObj, args); + } + int id = f.methodId(); + if (id == Id_constructor) { + double val = (args.length >= 1) + ? ScriptRuntime.toNumber(args[0]) : 0.0; + if (thisObj == null) { + // new Number(val) creates a new Number object. + return new NativeNumber(val); + } + // Number(val) converts val to a number value. + return ScriptRuntime.wrapNumber(val); + } + + // The rest of Number.prototype methods require thisObj to be Number + + if (!(thisObj instanceof NativeNumber)) + throw incompatibleCallError(f); + double value = ((NativeNumber)thisObj).doubleValue; + + switch (id) { + + case Id_toString: + case Id_toLocaleString: + { + // toLocaleString is just an alias for toString for now + int base = (args.length == 0) + ? 10 : ScriptRuntime.toInt32(args[0]); + return ScriptRuntime.numberToString(value, base); + } + + case Id_toSource: + return "(new Number("+ScriptRuntime.toString(value)+"))"; + + case Id_valueOf: + return ScriptRuntime.wrapNumber(value); + + case Id_toFixed: + return num_to(value, args, DToA.DTOSTR_FIXED, + DToA.DTOSTR_FIXED, -20, 0); + + case Id_toExponential: + return num_to(value, args, DToA.DTOSTR_STANDARD_EXPONENTIAL, + DToA.DTOSTR_EXPONENTIAL, 0, 1); + + case Id_toPrecision: + return num_to(value, args, DToA.DTOSTR_STANDARD, + DToA.DTOSTR_PRECISION, 1, 0); + + default: throw new IllegalArgumentException(String.valueOf(id)); + } + } + + @Override + public String toString() { + return ScriptRuntime.numberToString(doubleValue, 10); + } + + private static String num_to(double val, + Object[] args, + int zeroArgMode, int oneArgMode, + int precisionMin, int precisionOffset) + { + int precision; + if (args.length == 0) { + precision = 0; + oneArgMode = zeroArgMode; + } else { + /* We allow a larger range of precision than + ECMA requires; this is permitted by ECMA. */ + precision = ScriptRuntime.toInt32(args[0]); + if (precision < precisionMin || precision > MAX_PRECISION) { + String msg = ScriptRuntime.getMessage1( + "msg.bad.precision", ScriptRuntime.toString(args[0])); + throw ScriptRuntime.constructError("RangeError", msg); + } + } + StringBuffer sb = new StringBuffer(); + DToA.JS_dtostr(sb, oneArgMode, precision + precisionOffset, val); + return sb.toString(); + } + +// #string_id_map# + + @Override + protected int findPrototypeId(String s) + { + int id; +// #generated# Last update: 2007-05-09 08:15:50 EDT + L0: { id = 0; String X = null; int c; + L: switch (s.length()) { + case 7: c=s.charAt(0); + if (c=='t') { X="toFixed";id=Id_toFixed; } + else if (c=='v') { X="valueOf";id=Id_valueOf; } + break L; + case 8: c=s.charAt(3); + if (c=='o') { X="toSource";id=Id_toSource; } + else if (c=='t') { X="toString";id=Id_toString; } + break L; + case 11: c=s.charAt(0); + if (c=='c') { X="constructor";id=Id_constructor; } + else if (c=='t') { X="toPrecision";id=Id_toPrecision; } + break L; + case 13: X="toExponential";id=Id_toExponential; break L; + case 14: X="toLocaleString";id=Id_toLocaleString; break L; + } + if (X!=null && X!=s && !X.equals(s)) id = 0; + break L0; + } +// #/generated# + return id; + } + + private static final int + Id_constructor = 1, + Id_toString = 2, + Id_toLocaleString = 3, + Id_toSource = 4, + Id_valueOf = 5, + Id_toFixed = 6, + Id_toExponential = 7, + Id_toPrecision = 8, + MAX_PROTOTYPE_ID = 8; + +// #/string_id_map# + + private double doubleValue; +} diff --git a/org/mozilla/javascript/NativeObject.java b/org/mozilla/javascript/NativeObject.java new file mode 100644 index 0000000..39f4dd3 --- /dev/null +++ b/org/mozilla/javascript/NativeObject.java @@ -0,0 +1,321 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-1999 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Norris Boyd + * Igor Bukanov + * Bob Jervis + * Mike McCabe + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +package org.mozilla.javascript; + +/** + * This class implements the Object native object. + * See ECMA 15.2. + * @author Norris Boyd + */ +public class NativeObject extends IdScriptableObject +{ + static final long serialVersionUID = -6345305608474346996L; + + private static final Object OBJECT_TAG = "Object"; + + static void init(Scriptable scope, boolean sealed) + { + NativeObject obj = new NativeObject(); + obj.exportAsJSClass(MAX_PROTOTYPE_ID, scope, sealed); + } + + @Override + public String getClassName() + { + return "Object"; + } + + @Override + public String toString() + { + return ScriptRuntime.defaultObjectToString(this); + } + + @Override + protected void initPrototypeId(int id) + { + String s; + int arity; + switch (id) { + case Id_constructor: arity=1; s="constructor"; break; + case Id_toString: arity=0; s="toString"; break; + case Id_toLocaleString: arity=0; s="toLocaleString"; break; + case Id_valueOf: arity=0; s="valueOf"; break; + case Id_hasOwnProperty: arity=1; s="hasOwnProperty"; break; + case Id_propertyIsEnumerable: + arity=1; s="propertyIsEnumerable"; break; + case Id_isPrototypeOf: arity=1; s="isPrototypeOf"; break; + case Id_toSource: arity=0; s="toSource"; break; + case Id___defineGetter__: + arity=2; s="__defineGetter__"; break; + case Id___defineSetter__: + arity=2; s="__defineSetter__"; break; + case Id___lookupGetter__: + arity=1; s="__lookupGetter__"; break; + case Id___lookupSetter__: + arity=1; s="__lookupSetter__"; break; + default: throw new IllegalArgumentException(String.valueOf(id)); + } + initPrototypeMethod(OBJECT_TAG, id, s, arity); + } + + @Override + public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope, + Scriptable thisObj, Object[] args) + { + if (!f.hasTag(OBJECT_TAG)) { + return super.execIdCall(f, cx, scope, thisObj, args); + } + int id = f.methodId(); + switch (id) { + case Id_constructor: { + if (thisObj != null) { + // BaseFunction.construct will set up parent, proto + return f.construct(cx, scope, args); + } + if (args.length == 0 || args[0] == null + || args[0] == Undefined.instance) + { + return new NativeObject(); + } + return ScriptRuntime.toObject(cx, scope, args[0]); + } + + case Id_toLocaleString: // For now just alias toString + case Id_toString: { + if (cx.hasFeature(Context.FEATURE_TO_STRING_AS_SOURCE)) { + String s = ScriptRuntime.defaultObjectToSource(cx, scope, + thisObj, args); + int L = s.length(); + if (L != 0 && s.charAt(0) == '(' && s.charAt(L - 1) == ')') { + // Strip () that surrounds toSource + s = s.substring(1, L - 1); + } + return s; + } + return ScriptRuntime.defaultObjectToString(thisObj); + } + + case Id_valueOf: + return thisObj; + + case Id_hasOwnProperty: { + boolean result; + if (args.length == 0) { + result = false; + } else { + String s = ScriptRuntime.toStringIdOrIndex(cx, args[0]); + if (s == null) { + int index = ScriptRuntime.lastIndexResult(cx); + result = thisObj.has(index, thisObj); + } else { + result = thisObj.has(s, thisObj); + } + } + return ScriptRuntime.wrapBoolean(result); + } + + case Id_propertyIsEnumerable: { + boolean result; + if (args.length == 0) { + result = false; + } else { + String s = ScriptRuntime.toStringIdOrIndex(cx, args[0]); + if (s == null) { + int index = ScriptRuntime.lastIndexResult(cx); + result = thisObj.has(index, thisObj); + if (result && thisObj instanceof ScriptableObject) { + ScriptableObject so = (ScriptableObject)thisObj; + int attrs = so.getAttributes(index); + result = ((attrs & ScriptableObject.DONTENUM) == 0); + } + } else { + result = thisObj.has(s, thisObj); + if (result && thisObj instanceof ScriptableObject) { + ScriptableObject so = (ScriptableObject)thisObj; + int attrs = so.getAttributes(s); + result = ((attrs & ScriptableObject.DONTENUM) == 0); + } + } + } + return ScriptRuntime.wrapBoolean(result); + } + + case Id_isPrototypeOf: { + boolean result = false; + if (args.length != 0 && args[0] instanceof Scriptable) { + Scriptable v = (Scriptable) args[0]; + do { + v = v.getPrototype(); + if (v == thisObj) { + result = true; + break; + } + } while (v != null); + } + return ScriptRuntime.wrapBoolean(result); + } + + case Id_toSource: + return ScriptRuntime.defaultObjectToSource(cx, scope, thisObj, + args); + case Id___defineGetter__: + case Id___defineSetter__: + { + if (args.length < 2 || !(args[1] instanceof Callable)) { + Object badArg = (args.length >= 2 ? args[1] + : Undefined.instance); + throw ScriptRuntime.notFunctionError(badArg); + } + if (!(thisObj instanceof ScriptableObject)) { + throw Context.reportRuntimeError2( + "msg.extend.scriptable", + thisObj.getClass().getName(), + String.valueOf(args[0])); + } + ScriptableObject so = (ScriptableObject)thisObj; + String name = ScriptRuntime.toStringIdOrIndex(cx, args[0]); + int index = (name != null ? 0 + : ScriptRuntime.lastIndexResult(cx)); + Callable getterOrSetter = (Callable)args[1]; + boolean isSetter = (id == Id___defineSetter__); + so.setGetterOrSetter(name, index, getterOrSetter, isSetter); + if (so instanceof NativeArray) + ((NativeArray)so).setDenseOnly(false); + } + return Undefined.instance; + + case Id___lookupGetter__: + case Id___lookupSetter__: + { + if (args.length < 1 || + !(thisObj instanceof ScriptableObject)) + return Undefined.instance; + + ScriptableObject so = (ScriptableObject)thisObj; + String name = ScriptRuntime.toStringIdOrIndex(cx, args[0]); + int index = (name != null ? 0 + : ScriptRuntime.lastIndexResult(cx)); + boolean isSetter = (id == Id___lookupSetter__); + Object gs; + for (;;) { + gs = so.getGetterOrSetter(name, index, isSetter); + if (gs != null) + break; + // If there is no getter or setter for the object itself, + // how about the prototype? + Scriptable v = so.getPrototype(); + if (v == null) + break; + if (v instanceof ScriptableObject) + so = (ScriptableObject)v; + else + break; + } + if (gs != null) + return gs; + } + return Undefined.instance; + + default: + throw new IllegalArgumentException(String.valueOf(id)); + } + } + +// #string_id_map# + + @Override + protected int findPrototypeId(String s) + { + int id; +// #generated# Last update: 2007-05-09 08:15:55 EDT + L0: { id = 0; String X = null; int c; + L: switch (s.length()) { + case 7: X="valueOf";id=Id_valueOf; break L; + case 8: c=s.charAt(3); + if (c=='o') { X="toSource";id=Id_toSource; } + else if (c=='t') { X="toString";id=Id_toString; } + break L; + case 11: X="constructor";id=Id_constructor; break L; + case 13: X="isPrototypeOf";id=Id_isPrototypeOf; break L; + case 14: c=s.charAt(0); + if (c=='h') { X="hasOwnProperty";id=Id_hasOwnProperty; } + else if (c=='t') { X="toLocaleString";id=Id_toLocaleString; } + break L; + case 16: c=s.charAt(2); + if (c=='d') { + c=s.charAt(8); + if (c=='G') { X="__defineGetter__";id=Id___defineGetter__; } + else if (c=='S') { X="__defineSetter__";id=Id___defineSetter__; } + } + else if (c=='l') { + c=s.charAt(8); + if (c=='G') { X="__lookupGetter__";id=Id___lookupGetter__; } + else if (c=='S') { X="__lookupSetter__";id=Id___lookupSetter__; } + } + break L; + case 20: X="propertyIsEnumerable";id=Id_propertyIsEnumerable; break L; + } + if (X!=null && X!=s && !X.equals(s)) id = 0; + break L0; + } +// #/generated# + return id; + } + + private static final int + Id_constructor = 1, + Id_toString = 2, + Id_toLocaleString = 3, + Id_valueOf = 4, + Id_hasOwnProperty = 5, + Id_propertyIsEnumerable = 6, + Id_isPrototypeOf = 7, + Id_toSource = 8, + Id___defineGetter__ = 9, + Id___defineSetter__ = 10, + Id___lookupGetter__ = 11, + Id___lookupSetter__ = 12, + MAX_PROTOTYPE_ID = 12; + +// #/string_id_map# +} diff --git a/org/mozilla/javascript/NativeScript.java b/org/mozilla/javascript/NativeScript.java new file mode 100644 index 0000000..ec1e559 --- /dev/null +++ b/org/mozilla/javascript/NativeScript.java @@ -0,0 +1,230 @@ +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Rhino code, released + * May 6, 1999. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1997-1999 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Norris Boyd + * Igor Bukanov + * Roger Lawrence + * Mike McCabe + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License Version 2 or later (the "GPL"), in which + * case the provisions of the GPL are applicable instead of those above. If + * you wish to allow use of your version of this file only under the terms of + * the GPL and not to allow others to use your version of this file under the + * MPL, indicate your decision by deleting the provisions above and replacing + * them with the notice and other provisions required by the GPL. If you do + * not delete the provisions above, a recipient may use your version of this + * file under either the MPL or the GPL. + * + * ***** END LICENSE BLOCK ***** */ + +package org.mozilla.javascript; + +/** + * The JavaScript Script object. + * + * Note that the C version of the engine uses XDR as the format used + * by freeze and thaw. Since this depends on the internal format of + * structures in the C runtime, we cannot duplicate it. + * + * Since we cannot replace 'this' as a result of the compile method, + * will forward requests to execute to the nonnull 'script' field. + * + * @since 1.3 + * @author Norris Boyd + */ + +class NativeScript extends BaseFunction +{ + static final long serialVersionUID = -6795101161980121700L; + + private static final Object SCRIPT_TAG = "Script"; + + static void init(Scriptable scope, boolean sealed) + { + NativeScript obj = new NativeScript(null); + obj.exportAsJSClass(MAX_PROTOTYPE_ID, scope, sealed); + } + + private NativeScript(Script script) + { + this.script = script; + } + + /** + * Returns the name of this JavaScript class, "Script". + */ + @Override + public String getClassName() + { + return "Script"; + } + + @Override + public Object call(Context cx, Scriptable scope, Scriptable thisObj, + Object[] args) + { + if (script != null) { + return script.exec(cx, scope); + } + return Undefined.instance; + } + + @Override + public Scriptable construct(Context cx, Scriptable scope, Object[] args) + { + throw Context.reportRuntimeError0("msg.script.is.not.constructor"); + } + + @Override + public int getLength() + { + return 0; + } + + @Override + public int getArity() + { + return 0; + } + + @Override + String decompile(int indent, int flags) + { + if (script instanceof NativeFunction) { + return ((NativeFunction)script).decompile(indent, flags); + } + return super.decompile(indent, flags); + } + + @Override + protected void initPrototypeId(int id) + { + String s; + int arity; + switch (id) { + case Id_constructor: arity=1; s="constructor"; break; + case Id_toString: arity=0; s="toString"; break; + case Id_exec: arity=0; s="exec"; break; + case Id_compile: arity=1; s="compile"; break; + default: throw new IllegalArgumentException(String.valueOf(id)); + } + initPrototypeMethod(SCRIPT_TAG, id, s, arity); + } + + @Override + public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope, + Scriptable thisObj, Object[] args) + { + if (!f.hasTag(SCRIPT_TAG)) { + return super.execIdCall(f, cx, scope, thisObj, args); + } + int id = f.methodId(); + switch (id) { + case Id_constructor: { + String source = (args.length == 0) + ? "" + : ScriptRuntime.toString(args[0]); + Script script = compile(cx, source); + NativeScript nscript = new NativeScript(script); + ScriptRuntime.setObjectProtoAndParent(nscript, scope); + return nscript; + } + + case Id_toString: { + NativeScript real = realThis(thisObj, f); + Script realScript = real.script; + if (realScript == null) { return ""; } + return cx.decompileScript(realScript, 0); + } + + case Id_exec: { + throw Context.reportRuntimeError1( + "msg.cant.call.indirect", "exec"); + } + + case Id_compile: { + NativeScript real = realThis(thisObj, f); + String source = ScriptRuntime.toString(args, 0); + real.script = compile(cx, source); + return real; + } + } + throw new IllegalArgumentException(String.valueOf(id)); + } + + private static NativeScript realThis(Scriptable thisObj, IdFunctionObject f) + { + if (!(thisObj instanceof NativeScript)) + throw incompatibleCallError(f); + return (NativeScript)thisObj; + } + + private static Script compile(Context cx, String source) + { + int[] linep = { 0 }; + String filename = Context.getSourcePositionFromStack(linep); + if (filename == null) { + filename = "