|
IntroductionJAS now includes the capability to display HTML pages and the ability to
follow hyperlinks to other pages. Plots may be embedded within these pages using
the HTML JAS uses the swing JEditorPane component to display web pages. This component
supports most features of HTML 3.2. We have found it to work quite well with simple HTML
pages, but not to do a great job with pages containing frames or nested tables.
The viewer includes limited support for cascading style sheets. There is
currently no support for the SecurityIt is important to note that the JAS HTML feature is designed for browsing pages which are "trusted" by the viewer. Objects loaded by these pages are run with the same security as JAS itself, and thus have full access to the file system of the local machine. Browsing the web in general using the built in HTML display capability is not recommended. Navigating within Web Pages and HyperlinksHyperlinks can be embedded within HTML pages and are interpreted in the
normal way. Currently the The View menu contains the normal browser "Home", "Forward", "Backward" and "Refresh" items, as well as a "Web Page" item for opening an arbitrary page using a URL. You can also open a local HTML file using the "Open" item in the "File" menu. The same navigation controls are available from the HTML page's popup menu and from the "Web" toolbar. Embedding Objects using the Object TagJava objects can be embedded within a page using the <OBJECT classid="jas.bean.XMLPlot" id="Plot1"> <PARAM name="xmlURL" value="plot1.xml"> <PARAM name="opaque" value="true"> </OBJECT> The Embedding Custom ObjectsThe example above showed how to use a built-in bean, but you can also embed your own beans within an HTML page. The example below shows a simple bean which extends the Swing JSlider, and which accepts a single parameter, the name of a Plot to attach itself to. Once the slider has attached itself to a plot it can be used to change the number of bins in the plot. This bean can be included in the HTML page using the following code: <OBJECT classid="RebinSlider" id="Slider"> <PARAM name="target" value="Plot1"> <PARAM name="opaque" value="true"> </OBJECT> Note that the RebinSlider specifies the object to connect to using the The RebinSlider is able to communicate with the other sliders objects on the page because it implements jas.bean.PageContextHook. When a bean implements this interface JAS will call its init method when the bean is first created, and the destroy method when the page containing the object is closed. The init method is called with a jas.bean.PageContext object which can be used by the bean to locate other beans on the page, and to interact with its container. Currently classes are loaded using the system CLASSPATH specified when
JAS was started, but we plan to support more flexible loading of classes,
including loading from the same location as the HTML page which contains
the Using Full Screen ModeThe JAS Window menu now includes a "Full Screen" item which can be used to display any JAS window so that it fills the entire screen. To exit full screen mode use the escape key, or right click on the window to bring up a popup window and select "Close". Full screen mode when used in combination with an HTML page and a style sheet that selects suitably large fonts, can be used for making presentations. Since you can include active plots and objects within your presentation you can show the effects of varying cuts "live" in your presentation. The Full Screen mode is a new addition to JAS in release 2.0 Alpha 3. Your comments and suggestions for improving this feature are particularly welcome. Future PlansFuture releases of JAS will probably support embedding some scripting language within the HTML page to simplify the task of writing "glue" code to interconnect beams on a page. We also plan to add support for editing HTML pages within JAS, either directly on the HTML page, or by editing the HTML source code. Finally some improved support for presentations, for example easier navigation between pages without having to embed links in each page. Support for printing Web Pages is currently very limited, we are working on proper multi page printing of HTML pages and expect this to be in the next alpha release of JAS. |
Page last updated: Wednesday, January 14, 2004 by SLAC\tonyj