FileDocCategorySizeDatePackage
AboutDialog.javaAPI DocJMF 2.1.1e5256Mon May 12 12:20:32 BST 2003jmapps.jmstudio

AboutDialog

public class AboutDialog extends JMDialog

Fields Summary
private Image
imageAbout
private Image
imageSunLogo
private TextView
textCopyrightEng
private TextView
textCopyrightFr
Constructors Summary
public AboutDialog(Frame frame)

	    super ( frame, JMFI18N.getResource("jmstudio.about.title"), true );

        try {
            init();
        }
        catch (Exception e) {
            e.printStackTrace();
        }
    
Methods Summary
public voidactionPerformed(java.awt.event.ActionEvent event)

        String  strAction;

        strAction = event.getActionCommand ();
        if ( strAction.equals(ACTION_CLOSE) ) {
            setAction ( ACTION_CLOSE );
            this.dispose ();
        }
    
public static voidcreateDialog(java.awt.Frame frame)

        AboutDialog    dlg;

        if ( frame == null )
            frame = new Frame ();
        dlg = new AboutDialog ( frame );
        dlg.show ();
    
protected voidinit()

        Panel           panelImage;
        JMPanel         panelAboutText;
        JMPanel         panelLogo;
        Panel           panel;
        Panel           panelButtons;
        Panel           panelCopyright;
        ImageArea       fieldImage;
        Label           label;
        String          strVersion;
        Dimension       dimText;
        int             nTextHeightEng;
        int             nTextHeightFr;
        String          strCopyright;
        Font            font;


        this.addWindowListener ( this );
        this.setLayout ( new BorderLayout() );
        this.setBackground ( new Color(204,204,204) );

        this.imageAbout = ImageArea.loadImage ( "aboutBox.gif", this, true );
        this.imageSunLogo = ImageArea.loadImage ( "SunLogoForGrey.gif", this, true );

        panelImage = new Panel ( new BorderLayout() );
        this.add ( panelImage, BorderLayout.NORTH );
        panelAboutText = new JMPanel ( new BorderLayout(6,6) );
        panelAboutText.setEmptyBorder ( 12, 12, 12, 12 );
        this.add ( panelAboutText, BorderLayout.CENTER );
        panelLogo = new JMPanel ( new BorderLayout() );
        panelLogo.setEmptyBorder ( 12, 12, 12, 12 );
        this.add ( panelLogo, BorderLayout.SOUTH );

        fieldImage = new ImageArea ( imageAbout );
        fieldImage.setInsets ( 0, 0, 0, 0 );
        panelImage.add ( fieldImage, BorderLayout.CENTER );

        strVersion = Manager.getVersion ();
        strVersion = JMFI18N.getResource("jmstudio.about.version") + " " +
	    strVersion;
        label = new Label ( strVersion );
        panelAboutText.add ( label, BorderLayout.NORTH );

        panelCopyright = new Panel ( new GridLayout(0,1,6,6) );
        panelAboutText.add ( panelCopyright, BorderLayout.CENTER );
        font = new Font ( "Dialog", Font.PLAIN, 10 );

        strCopyright = "Copyright 2003 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Third-party software, including font technology, is copyrighted and licensed from Sun suppliers. Sun, Sun Microsystems, the Sun Logo, and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. Federal Acquisitions: Commercial Software -- Government users subject to standard license terms and conditions.";
        textCopyrightEng = new TextView ( strCopyright );
        textCopyrightEng.setFont ( font );
        panelCopyright.add ( textCopyrightEng );

        strCopyright = "Copyright 2003 Sun Microsystems, Inc. Tous droits réservés. Distribué par des licences qui en restreignent l'u. Le logiciel détenu par des tiers, et qui comprend la technologie relative aux polices de caractères, est protégé par un copyright et licencié par des fournisseurs de Sun. Sun, Sun Microsystems, le logo Sun, et Java sont des marques de fabrique ou des marques déposées de Sun Microsystems, Inc. aux Etats-Unis et dans d'autres pays.";
        textCopyrightFr = new TextView ( strCopyright );
        textCopyrightFr.setFont ( font );
        panelCopyright.add ( textCopyrightFr );

        fieldImage = new ImageArea ( imageSunLogo );
        panelLogo.add ( fieldImage, BorderLayout.WEST );

        panel = new JMPanel ( new BorderLayout(6,6) );
        panelLogo.add ( panel, BorderLayout.EAST );
        panelButtons = createButtonPanel ( new String[] { ACTION_CLOSE } );
        panel.add ( panelButtons, BorderLayout.SOUTH );

        this.pack ();
        
        dimText = textCopyrightEng.getSize();
        textCopyrightEng.setPreferredWidth ( dimText.width );
        dimText = textCopyrightFr.getSize();
        textCopyrightFr.setPreferredWidth ( dimText.width );

        this.setResizable ( false );
        this.pack ();
        setLocationCenter ();
    
public voidwindowClosing(java.awt.event.WindowEvent event)

        setAction ( ACTION_CLOSE );
        this.dispose ();