|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.actor.gui.HTMLAbout
public class HTMLAbout
This class contains static methods that are called
by when HTMLViewer.hyperlinkUpdate() is invoked on a hyperlink
that starts with about:
. This facility is primarily
used for testing.
HTMLViewer.hyperlinkUpdate(HyperlinkEvent)
Red (cxh) |
Red (cxh) |
Field Summary | |
---|---|
private static java.util.List |
_demosURLs
|
Constructor Summary | |
---|---|
HTMLAbout()
|
Method Summary | |
---|---|
private static java.lang.String |
_aboutHTML(java.lang.String fileName)
|
private static java.lang.String |
_checkCompleteDemos(java.lang.String completeDemos,
java.util.List otherDemos)
Check that all the demos in otherDemos are in complete Demos |
private static boolean |
_configurationExists(java.lang.String configurationName)
|
static java.net.URL |
_expandLibrary(java.lang.String regexp,
Configuration configuration)
Expand the left hand library pane. |
private static java.net.URL |
_getDemoURL(java.lang.String demosFileName)
|
private static java.util.List |
_getURLs(java.net.URL demosURL,
java.lang.String regexp)
Open up a file, return a list of relative URLs that match a regexp. |
private static java.util.List |
_getURLs(java.net.URL demosURL,
java.lang.String regexp,
boolean absoluteURLs,
int depth)
Open up a file, return a list of relative or absolute URLs that match a regexp. |
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.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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static java.util.List _demosURLs
Constructor Detail |
---|
public HTMLAbout()
Method Detail |
---|
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 in
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.private static java.lang.String _aboutHTML(java.lang.String fileName)
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.private static java.net.URL _getDemoURL(java.lang.String demosFileName) throws java.io.IOException
java.io.IOException
private static java.lang.String _checkCompleteDemos(java.lang.String completeDemos, java.util.List otherDemos) throws java.io.IOException
completeDemos
- A URL pointing to the completeDemos.htm fileotherDemos
- A list of Strings where each string names a demo.
java.io.IOException
private static java.util.List _getURLs(java.net.URL demosURL, java.lang.String regexp) throws java.io.IOException
demosURL
- The URL of the file containing URLs.regexp
- The regular expression, for example ".*.xml$".
java.io.IOException
private static java.util.List _getURLs(java.net.URL demosURL, java.lang.String regexp, boolean absoluteURLs, int depth) throws java.io.IOException
demosURL
- The URL of the file containing URLs.regexp
- The regular expression, for example ".*.xml$".absoluteURLs
- True if we should return absolute URLs.depth
- Depth to recurse. Depth of 0 do not recurse.
Recursing only makes sense if the regexp argument includes .htm* files:
".*(.htm|.html|.xml)"
java.io.IOException
private static boolean _configurationExists(java.lang.String configurationName)
private static java.net.URL _temporaryHTMLFile(java.lang.String prefix, java.lang.String suffix, java.lang.String contents) throws java.io.IOException
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |