JDisplay 4.7 build: 9639 released: 2014-08-01 compiled with: Java 1.8.0_131 Displays Java, HTML, bat, SQL, ini, csv, properties... source. Copyright: (c) 2004-2017 Canadian Mind Products. signed Java Applet. Download from: http://mindprod.com/products2.html#JDISPLAY View HTML to run this program online at: http://mindprod.com/applet/jdisplay.html ---- Notes: You must install the Java JRE to use this program. See http://mindprod.com/jgloss/jgloss/jre.html This program requires a manual install! See below. I put out an avalanche of free software into the world, and submit PAD files to hundreds of distribution sites, but I rarely hear back from anyone. What's happening? Does it all just work fine? It is so complicated nobody can figure out how to use it and they give up on it? It is it useful? Since everyone has the source, do people just fix the programs to their liking themselves? Did you have trouble installing? Do I presume you know too much? I would be happy to hear from you about your experiences, positive or negative and your requests for improvements. A one-line email to roedy@mindprod.com would be great. ===> Free <=== Full source included. You may even include the source code, modified or unmodified in free/commercial open source/proprietary programs that you write and distribute. May be used freely for any purpose but military. For more details on this restriction, see http://mindprod.com/contact/nonmil.html If you include any Canadian Mind Products code in your own applications, your app too must be labelled non-military use only. http://mindprod.com/contact/nonmil.html All Java jars and source code are included. If you need the class files or Javadoc, you will have to build them yourself. To streamline the zip downloads, class files and Javadoc have been removed. ---- Prerequisites: This program runs under any OS that supports Java, (e.g.W2K/XP/W2003/Vista/W2008/W7-32/W7-64/W8-32/W8-64/Linux/LinuxARM/LinuxX86 /LinuxX64/Ubuntu/Solaris/SolarisSPARC/SolarisSPARC64/SolarisX86/SolarisX64/OSX/AIX...) so long as you have <><> Java version 1.8 <><> or later installed (32-bit or 64-bit Java). See http://mindprod.com/jgloss/installingjava.html for details. ---- Installing on a PC: Download source and compiled jar files to run on your own machine as an Applet. First install a recent Java JDK or JVM. See http://mindprod.com/jgloss/installingjava.html. To install, extract the zip download with WinZip (or similar unzip utility) into any directory you please, often J:\ -- ticking off the use folder names option. ---- Installing on a MacIntosh: Use Safari to download source and compiled jar files to run on your own machine as an Applet. Safari will automatically unpack the zip into ~/Downloads (version 10.5) [or on the Desktop (version 10.4 and earlier)]. First install a recent Java JDK or JVM. See http://mindprod.com/jgloss/installingjava.html. You may optionally move the download tree to a permanent home. I don't have a MacIntosh, just a PC, so I can't test my Java programs for Mac compatibility. In theory they should work without problems, but in practice that does not always happen. If you have problems please, let me know, preferably with screenshots and complete verbatim error messages. ---- Rebuilding: The zip already contains the necessary jar files, so unless you modify the program, there is no need to recompile the source or rebuild the jar. Configure.java basedir="E:/" in rebuild.xml to the drive where your files are. Configure.java your certificate name with environment SET cert=mindprodcert2017rsa Configure.java your certificate password with environment SET jarsignerpassword=sesame Use ANT and rebuild.xml, not build.xml, to recompile and recreate the jar. ---- Use: JDisplay displays Java, HTML, bat, SQL, ini, csv, properties, Bali, MFT... files a variety of colours, fonts, sizes and weights to help make them more presentable and readable. Why would you use it? For the same sorts of reasons you use colours and fonts in an IDE like IntelliJ or Eclipse. They make the code much easier to understand. There is no server-side code used. Java utilities parse the code snippets into compact binary tokens, assigning colours, fonts, sizes and weights to each token. Then the tokens can be rendered three ways: 1. using a Java Applet. This is usually best for very large listings. 2. as piece of CSS style-decorated HTML code you include in your html as an iframe. This is usually best for intermediate listings. 3. inline in your HTML. This is usually best for short listings. The problem, in the process of editing the html it is fairly easy to damage the generated listings. They must be regenerated before every upload. I have been using the JDisplay suite of utilities for many years. I did not write it for public use. I offer it on an as-is basis. The code itself in well documented, but there is no step-by-step documentation on getting it to work. I presume the user is familiar with bat and ant files and Java building. I have not included the enormous HTML static macros package which I use for deciding the sizes and display rendering method for each snippet, though I did include the code to make those decisions hooked into your own framework. The parsers are rough and ready. They need to work on code snippets and erroneous code, not perfect code the way a standard parser does. If improve the parsers, or add new ones, please pass them along for the public distribution. JDisplay is enormously more complicated than it appears on the surface. You can spelunk and discover all manner of interesting code you can cannibalise. There are finite state machines, clipregion sensitive Canvas rendering, HTML generators, ObjectStreams... PACKAGES com/mindprod/compactor compacts html to remove excess white space. com/mindprod/entities interconvert & <-> & etc. com/mindprod/filter set of FilenameFilters com/mindprod/htmlmacros/jdisplay.java part of a large static macros package to expand macros embedded in HTML before the files are uploaded to the server. com/mindprod/hunkio does IO in big hunks. com/mindprod/jdisplayaux static macro to decide which of three ways to render a given snippet and inserts the appropriate HTML to do that into your HTML. com/mindprod/jdisplayorphans detects orphan not referenced by any of your HTML. com/mindprod/jprep parses the snippets of code, producing binary *.ser files. com/mindprod/jtokens Tokens and parsers for various languages rendered. mindprod.css = style sheet that controls the fonts/tokens/sizes PROGRAM FLOW 1. Run jprep -- parse snippets to binary *.ser files and iframe/*.html files 2. Manually decide which of three methods to use, and insert appropriate HTML. (or rig up some code to do this automatically using code in JDisplayAux) 3. Upload to website. 4. View code inline, as iframe, or via invocation of JDisplay Applet. See http://mindprod.com/applet/jdisplay.html for samples of all three invocation styles. DIRECTORY STRUCTURE Let's say your html lives in: E:\mindprod\jgloss Then the corresponding program listing snippets will live in: E:\mindprod\jgloss\snippets the generated *.ser file live in E:\mindprod\jgloss\snippets\ser and the generated iframe *.html files will live in E:\mindprod\jgloss\snippets\iframe All off this must be uploaded to your website. PROBLEMS All code should be include with the exception of the htmlmacros package. If you find something missing you can probably get it at http://mindprod.com/products.html. In any case, please let me know, so I can include it. If you have questions, please feel free to ask. It will help me put together some minimalist documentation. Why the picture frame logo? It symbolises presenting the program listing in an aesthetically pleasing form. ---- Version History: 1.2 2004-05-15 split off calcPreferredSize into its own class 1.3 2004-05-23 Put all logic about calculating panel and frame size in PreferredSize None left to JDisplay macro. no bar parameter. Computed automatically. manual control of when ScrollBars used. 1.4 2004-05-29 Flip back from Swing to AWT so that Ctrl-C Ctrl-V will work. Even with AWT, I need a TextArea, not the PrettyCanvas. Downside mainly was losing ability to turn or horizontal and vertical scrollbars automatically. Adjust for fact scrollbars are all or nothing. Can't have just vertical. Redo all tokenizers with lookaheaad, and explicit handled boolean. Eliminate the enter method on all tokenizers. Explicit list of all choices on default for proofreading. Eliminate flicker with removal of super.paint(). \ in bat now show in special font. 1.5 2004-06-01 slightly larger margins, use new BatTokenizer, HTMLTokenizer, JavaTokenizer 1.6 2004-07-16 better recovery when cannot read *.ser file. 1.7 2005-06-12 destroy, make sure not null before remove. Futures implement my own copy/paste that works with Swing or AWT token needs to remember where it is on screen. 1.8 2005-07-28 major overhaul to use new tokenizers.. 1.9 2005-09-07 allow JDisplay to run under Eclipse 2.0 2005-11-11 make snippet/ optional in Applet url parameter. 2.1 2005-12-25 add parser for *.properties files 2.2 2005-12-25 add parser for *.csv files 2.3 2005-12-25 add parser for *.ini files 2.4 2005-12-25 more robust error handling 2.5 2006-01-27 prints vm version, more checks. 2.6 2006-03-06 reformat with IntelliJ and add Javadoc 2.7 2007-04-29 use a corresponding mono font when turn off colour. 2.8 2007-05-05 add iformat rendering, use of snippet/ser and snippet/iformat 2.9 2007-07-12 first public distribution. 3.0 2007-07-26 add support for annotations. 3.1 2007-08-20 new colour scheme. 3.2 2007-09-17 rename snippets -> snippet. Label *.java and *.javafrag properly. 3.3 2008-01-11 add support for hex and octal numerics. 3.4 2008-02-23 bold variable definitions. more robust display of class on dump. 3.5 2008-02-24 change sizes and spacing 3.6 2008-03-06 convert to Swing 3.7 2008-04-18 get JDisplay and CSS font renderings in closer sync 3.8 2008-04-30 improve way numeric literals are rendered in Java. 3.9 2008-08-08 add vanilla text parser for text files. No changes needed to JDisplay itself, just the bundle. 4.0 2009-04-12 shorter style names, improved highlighting. 4.1 2009-08-30 tone down colour for keywords. 4.2 2009-09-30 fine tune size of fonts, adjusting large or small fonts to normal size, shrink keyword size. 4.3 2010-02-08 highlight begin and ends of comments and CDATAs specially. 4.4 2010-02-10 add manifest tokenizer. 4.5 2011-02-03 tidy up code, fix bug stopping B&W version from scrolling. 4.6 2014-04-17 must be signed. Reads files and sets LAF. 4.7 2014-08-01 change *.html to *.htm, *.adler to *.checksum, use 64bit FNV1a64 checksums. -30-