public class HTMLAbout
extends java.lang.Object
about:
. This facility is primarily
used for testing.HTMLViewer.hyperlinkUpdate(HyperlinkEvent)
Constructor and Description |
---|
HTMLAbout() |
Modifier and Type | Method and Description |
---|---|
static java.net.URL |
_expandLibrary(java.lang.String regexp,
Configuration configuration)
Expand the left hand library pane.
|
(package private) static java.net.URL |
_temporaryHTMLFile(java.lang.String prefix,
java.lang.String suffix,
java.lang.String contents) |
static java.lang.String |
about(Configuration configuration)
Return a string containing HTML that describes the about:
features.
|
static java.lang.String |
checkCompleteDemos(java.lang.String completeDemos)
Check that all the demos in otherDemos are in completeDemos.
|
static java.net.URL |
generateLinks(java.lang.String demosFileName,
java.lang.String regexp,
Configuration configuration)
Call Configuration.openModel() on relative URLs that match a regexp.
|
static java.net.URL |
hyperlinkUpdate(javax.swing.event.HyperlinkEvent event,
Configuration configuration)
Process an "about:" HyperlinkEvent.
|
static void |
main(java.lang.String[] args)
Generate a file that contains urls of models.
|
static java.net.URL |
runAllDemos(java.lang.String demosFileName,
Configuration configuration)
Run all the local .xml files that are linked to from an HTML file.
|
static void |
writeDemoURLs(java.lang.String demosFileName,
java.lang.String outputFileName)
Write the urls of the demo urls.
|
static void |
writeLiveLinks(java.io.FileWriter fileWriter,
java.lang.String demo,
java.lang.String ptII)
Open the model, look for any LiveLinks and write their names.
|
public static java.lang.String about(Configuration configuration)
If the configuration contains an _applicationName attribute then that attribute is used as the name of the application in the generated text. If _applicationName is not present, then the default name is "Ptolemy II".
If the configuration contains an _applicationDemos Parameter then that parameter is assumed to be an array of strings name naming HTML files that should be searched for demos and expanded.
configuration
- The configuration to look for the
_applicationName attribute inpublic static java.lang.String checkCompleteDemos(java.lang.String completeDemos) throws java.io.IOException
about(Configuration)
before calling this method.completeDemos
- A URL pointing to the completeDemos.htm filejava.io.IOException
- If there is a problem reading the
completeDemos.htm file.public static java.net.URL generateLinks(java.lang.String demosFileName, java.lang.String regexp, Configuration configuration) throws java.lang.Exception
demosFileName
- The name of the HTML file that contains links
to the .xml, .htm and .html files.
If this argument is the empty string, then
"ptolemy/configs/doc/completeDemos.htm" is used.regexp
- The regular expression of the links we are interested
in.configuration
- The configuration to open the files in.java.lang.Exception
- If there is a problem opening a model.public static java.net.URL hyperlinkUpdate(javax.swing.event.HyperlinkEvent event, Configuration configuration) throws java.lang.Throwable
event
- The HyperlinkEvent to process. The description of
the event should start with "about:". If there are no specific
matches for the description, then a general usage message is
returned.configuration
- The configuration in which we are operating.java.lang.Throwable
- If there is a problem invoking the about
task.public static void main(java.lang.String[] args) throws java.io.IOException
args
- The optional name of the file containing the demos
followed by the optional name of the output file. The default
demo file is ptolemy/configs/doc/completeDemos.htm, the default
output file is models.txt.java.io.IOException
- If there is a problem reading the demo
file or writing the model file.public static java.net.URL runAllDemos(java.lang.String demosFileName, Configuration configuration) throws java.lang.Exception
demosFileName
- The name of the HTML file that contains links
to the .xml files. If this argument is the empty string, then
"ptolemy/configs/doc/completeDemos.htm" is used.configuration
- The configuration to run the files in.java.lang.Exception
- If there is a problem running a demo.public static void writeDemoURLs(java.lang.String demosFileName, java.lang.String outputFileName) throws java.io.IOException
demosFileName
- The name of the demo file.outputFileName
- The name of the file that is generated.java.io.IOException
- If there is a problem reading the demo file
or writing the output file.public static void writeLiveLinks(java.io.FileWriter fileWriter, java.lang.String demo, java.lang.String ptII) throws java.lang.Throwable
fileWriter
- The FileWriter to write the file names to..demo
- The string path to the demo to be searched for live links.ptII
- The Ptolemy II home directory.java.lang.Throwable
- If there is a problem opening the demo.public static java.net.URL _expandLibrary(java.lang.String regexp, Configuration configuration) throws java.lang.Exception
regexp
- The regular expression of the links we are interested
in.configuration
- The configuration to open the files in.java.lang.Exception
- If there is a problem opening a model.static java.net.URL _temporaryHTMLFile(java.lang.String prefix, java.lang.String suffix, java.lang.String contents) throws java.io.IOException
java.io.IOException