001         package com.croftsoft.apps.agoracast.c2p;
002    
003         import java.awt.*;
004         import java.io.*;
005         import javax.swing.JFrame;
006         import javax.swing.WindowConstants;
007    
008         import com.croftsoft.core.gui.FrameManager;
009         import com.croftsoft.core.gui.ShutdownWindowListener;
010         import com.croftsoft.core.gui.WindowLib;
011         import com.croftsoft.core.io.FileLib;
012         import com.croftsoft.core.lang.ClassLib;
013         import com.croftsoft.core.lang.NullArgumentException;
014         import com.croftsoft.core.util.log.PrintStreamLog;
015         
016         /*********************************************************************
017         * <p />
018         *
019         * @version
020         *   2001-08-06
021         * @since
022         *   2001-07-24
023         * @author
024         *   <a href="https://www.croftsoft.com/">David Wallace Croft</a>
025         *********************************************************************/
026    
027         public final class  AgoracastFrame
028           extends JFrame
029           implements AgoracastConstants
030         //////////////////////////////////////////////////////////////////////
031         //////////////////////////////////////////////////////////////////////
032         {
033    
034         public static void  main ( String [ ]  args )
035           throws IOException
036         //////////////////////////////////////////////////////////////////////
037         {
038           new AgoracastFrame ( new AgoracastMediator ( ), "" )
039             .setVisible ( true );
040         }
041    
042         public  AgoracastFrame (
043           AgoracastMediator  agoracastMediator,
044           String             documentationText )
045         //////////////////////////////////////////////////////////////////////
046         {
047           super ( FRAME_TITLE );
048    
049           NullArgumentException.check ( agoracastMediator );
050    
051           agoracastMediator.setParentFrame ( this );
052    
053           setDefaultCloseOperation ( WindowConstants.DO_NOTHING_ON_CLOSE );
054    
055           addWindowListener (
056             new ShutdownWindowListener ( agoracastMediator ) );
057    
058           getContentPane ( ).add ( new AgoracastPanel (
059             agoracastMediator, documentationText, this ) );
060    
061           Dimension  size = Toolkit.getDefaultToolkit ( ).getScreenSize ( );
062    
063           size.width  *= 0.8;
064    
065           size.height *= 0.8;
066    
067           WindowLib.centerOnScreen ( this, size );
068    
069           try
070           {
071             Image  frameIconImage = ClassLib.getResourceAsImage (
072               AgoracastFrame.class, FRAME_ICON_IMAGE_NAME );
073    
074             setIconImage ( frameIconImage );
075           }
076           catch ( IOException  ex )
077           {
078             ex.printStackTrace ( );
079           }
080         }
081    
082         //////////////////////////////////////////////////////////////////////
083         //////////////////////////////////////////////////////////////////////
084         }