ptolemy.actor.gui
Class HTMLAbout

java.lang.Object
  extended byptolemy.actor.gui.HTMLAbout

public class HTMLAbout
extends java.lang.Object

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.

Since:
Ptolemy II 3.0
Version:
$Id: HTMLAbout.java,v 1.22 2004/04/25 17:15:36 cxh Exp $
Author:
Christopher Hylands
See Also:
HTMLViewer.hyperlinkUpdate(HyperlinkEvent)
Accepted Rating:
Red (cxh)
Proposed Rating:
Red (cxh)

Constructor Summary
HTMLAbout()
           
 
Method Summary
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 java.net.URL runAllDemos(java.lang.String demosFileName, Configuration configuration)
          Run all the local .xml files that are linked to from an HTML file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HTMLAbout

public HTMLAbout()
Method Detail

about

public static java.lang.String about(Configuration configuration)
Return a string containing HTML that describes the about: features.

If the configuration contains an _applicationName attribute then that attributed is used as the name of the application in the generated text. If _applicationName is not present, then the default name is "Ptolemy II".

Parameters:
configuration - The configuration to look for the _applicationName attribute in

generateLinks

public static java.net.URL generateLinks(java.lang.String demosFileName,
                                         java.lang.String regexp,
                                         Configuration configuration)
                                  throws java.lang.Exception
Call Configuration.openModel() on relative URLs that match a regexp. files are linked to from an HTML file.

Parameters:
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.
Returns:
the URL of the HTML file that was searched.
Throws:
java.lang.Exception

hyperlinkUpdate

public static java.net.URL hyperlinkUpdate(javax.swing.event.HyperlinkEvent event,
                                           Configuration configuration)
                                    throws java.lang.Throwable
Process an "about:" HyperlinkEvent.

Parameters:
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.
Returns:
A URL that points to the results.
Throws:
java.lang.Throwable - If there is a problem invoking the about task.

runAllDemos

public static java.net.URL runAllDemos(java.lang.String demosFileName,
                                       Configuration configuration)
                                throws java.lang.Exception
Run all the local .xml files that are linked to from an HTML file.

Parameters:
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.
Returns:
the URL of the HTML file that was searched.
Throws:
java.lang.Exception