001         package com.croftsoft.apps.client;
002         
003         import java.awt.*;
004         import java.net.*;
005         
006         import com.croftsoft.core.CroftSoftConstants;
007         
008         /*********************************************************************
009         * Configuration.
010         *  
011         * Can be modified to be persistent.
012         * 
013         * @version
014         *   $Id: ClientConfig.java,v 1.7 2006/12/09 05:24:59 croft Exp $
015         * @since
016         *   2006-10-30
017         * @author
018         *   <a href="https://www.croftsoft.com/">David Wallace Croft</a>
019         *********************************************************************/
020    
021         public final class  ClientConfig
022         //////////////////////////////////////////////////////////////////////
023         //////////////////////////////////////////////////////////////////////
024         {
025           
026         private static final String  VERSION
027           = "$Date: 2006/12/09 05:24:59 $";
028       
029         private static final String  TITLE
030           = "CroftSoft Client";
031       
032         private static final String  INFO
033           = TITLE + "\n"
034           + "Version " + VERSION + "\n"
035           + CroftSoftConstants.COPYRIGHT + "\n"
036           + CroftSoftConstants.DEFAULT_LICENSE + "\n"
037           + CroftSoftConstants.HOME_PAGE + "\n";
038    
039         private static final String  DEFAULT_CODE_BASE_NAME
040           = "http://CroftSoft.com:8080/";
041         
042         private static final int
043           FRAME_WIDTH  = 600,
044           FRAME_HEIGHT = 400;
045       
046         private static final double  UPDATE_RATE = 85.0;
047         
048         private static final String
049           SHUTDOWN_CONFIRMATION_PROMPT = "Exit " + TITLE + "?";
050         
051         private static final Font    FONT
052           = new Font ( "Arioso", Font.BOLD, 20 );
053         
054         //
055         
056         private String  botId;
057         
058         private URL     codeBase;
059    
060         //////////////////////////////////////////////////////////////////////
061         //////////////////////////////////////////////////////////////////////
062         
063         public static ClientConfig  load ( String [ ]  args )
064         //////////////////////////////////////////////////////////////////////
065         {
066           // Could load from a persistent XML file.
067           
068           return new ClientConfig ( );
069         }
070         
071         //////////////////////////////////////////////////////////////////////
072         //////////////////////////////////////////////////////////////////////
073         
074         public  ClientConfig ( )
075         //////////////////////////////////////////////////////////////////////
076         {
077           try
078           {
079             System.setProperty (
080               "freetts.voices",
081               "com.sun.speech.freetts.en.us.cmu_us_kal.KevinVoiceDirectory" );
082           }
083           catch ( final Exception  ex )
084           {
085             ex.printStackTrace ( );
086           }
087         }
088         
089         //////////////////////////////////////////////////////////////////////
090         //////////////////////////////////////////////////////////////////////
091         
092         public String  getBotId ( ) { return botId; }
093         
094         public URL     getCodeBase ( ) { return codeBase; }
095         
096         public String  getDefaultCodeBaseName ( ) {
097           return DEFAULT_CODE_BASE_NAME; }
098         
099         public String  getInfo ( ) { return INFO; }
100         
101         public Font  getFont ( ) { return FONT; }
102         
103         public Dimension  getFrameSize ( )
104           { return new Dimension ( FRAME_WIDTH, FRAME_HEIGHT ); }
105         
106         public String  getFrameTitle ( ) { return TITLE; }
107    
108         public String  getShutdownConfirmationPrompt ( )
109           { return SHUTDOWN_CONFIRMATION_PROMPT; }
110         
111         public String  getThreadName ( ) { return TITLE; }
112         
113         public double  getUpdateRate ( ) { return UPDATE_RATE; }
114         
115         //////////////////////////////////////////////////////////////////////
116         //////////////////////////////////////////////////////////////////////
117         
118         public void  setBotId ( final String  botId )
119         //////////////////////////////////////////////////////////////////////
120         {
121           this.botId = botId;
122         }
123         
124         public void  setCodeBase ( final URL  codeBase )
125         //////////////////////////////////////////////////////////////////////
126         {
127           this.codeBase = codeBase;
128         }
129         
130         //////////////////////////////////////////////////////////////////////
131         //////////////////////////////////////////////////////////////////////
132         }