/* A viewer for Welcome Windows Copyright (c) 2006-2014 The Regents of the University of California. All rights reserved. Permission is hereby granted, without written agreement and without license or royalty fees, to use, copy, modify, and distribute this software and its documentation for any purpose, provided that the above copyright notice and the following two paragraphs appear in all copies of this software. IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. PT_COPYRIGHT_VERSION_2 COPYRIGHTENDKEY */ package ptolemy.actor.gui; import java.awt.BorderLayout; import java.awt.Color; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JPanel; import ptolemy.data.BooleanToken; import ptolemy.data.expr.SingletonParameter; import ptolemy.util.MessageHandler; /////////////////////////////////////////////////////////////////// //// WelcomeWindow /** A toplevel frame that can view HTML documents, but has no menus.
This window uses the _showWelcomeWindowAtStartup
SingletonParameter preference in
{@link ptolemy.actor.gui.PtolemyPreferences} to determine whether the
window is shown or not. If this parameter is not present or is true,
then the window is show, if the parameter is false, then it is not shown.
This parameter is set in ~/.ptolemyII/PtolemyPreferences.xml, which under
Windows might be in
c:/Documents and Settings/yourlogin/.ptolemyII/PtolemyPreferences.xml
The easiest way to adjust the configuration so that this window
is used is to edit the welcomeWindow.xml
file that corresponds
with the configuration and set the tableau to be
ptolemy.actor.gui.WelcomeWindowTableau
For example, $PTII/ptolemy/configs/full/welcomeWindow.xml
might look like:
<?xml version="1.0" standalone="no"?> <!DOCTYPE plot PUBLIC "-//UC Berkeley//DTD MoML 1//EN" "http://ptolemy.eecs.berkeley.edu/xml/dtd/MoML_1.dtd"> <entity name="directory"> <entity name="doc" class="ptolemy.actor.gui.HTMLEffigy"> <entity name="tableau" class="ptolemy.actor.gui.WelcomeWindowTableau"> <!-- If you adjust the size, be sure to try it under Java 1.5 --> <property name="size" value="[600, 220]"/> <property name="url" value="ptolemy/configs/full/intro.htm"/> </entity> </entity> </entity>The above configuration will create a WelcomeWindow with a 600x200 size that displays the contents of
ptolemy/configs/full/intro.htm
Note that since this widow has no menus, if you use this window, then
you will want to set the
_applicationBlankPtolemyEffigyAtStartup
parameter in the
configuration so that a blank Graph Editor window pops up along with
this welcome window. For example:
<property name="_applicationBlankPtolemyEffigyAtStartup" class="ptolemy.data.expr.Parameter" value="true"/>@author Christopher Brooks, Nandita Mangal @version $Id: WelcomeWindow.java 70402 2014-10-23 00:52:20Z cxh $ @since Ptolemy II 5.2 @Pt.ProposedRating Red (cxh) @Pt.AcceptedRating Red (cxh) */ @SuppressWarnings("serial") public class WelcomeWindow extends HTMLViewer { /** Construct a blank HTML Viewer with no menu items. */ public WelcomeWindow() { super(); //setUndecorated(true); setResizable(false); _statusBar = null; // Add the close panel _closePanel = new JPanel(); _closePanel.setBackground(new Color(227, 231, 236)); _closePanel.setSize(401, 100); _closePanel.setLayout(new BorderLayout()); _startupCheck = new JCheckBox( "
Show this dialog upon startup |