001 package com.croftsoft.apps.ajgp.input; 002 003 import java.awt.*; 004 005 import com.croftsoft.core.CroftSoftConstants; 006 import com.croftsoft.core.animation.AnimatedApplet; 007 import com.croftsoft.core.animation.AnimationInit; 008 009 /********************************************************************* 010 * User input example 011 * 012 * @version 013 * 2003-09-29 014 * @since 015 * 2003-09-29 016 * @author 017 * <a href="https://www.croftsoft.com/">David Wallace Croft</a> 018 *********************************************************************/ 019 020 public final class InputExample 021 extends AnimatedApplet 022 ////////////////////////////////////////////////////////////////////// 023 ////////////////////////////////////////////////////////////////////// 024 { 025 026 private static final String VERSION 027 = "2003-09-29"; 028 029 private static final String TITLE 030 = "CroftSoft Input Example"; 031 032 private static final String APPLET_INFO 033 = "\n" + TITLE + "\n" 034 + CroftSoftConstants.COPYRIGHT + "\n" 035 + CroftSoftConstants.HOME_PAGE + "\n" 036 + "Version " + VERSION + "\n" 037 + CroftSoftConstants.DEFAULT_LICENSE + "\n"; 038 039 ////////////////////////////////////////////////////////////////////// 040 // animation constants 041 ////////////////////////////////////////////////////////////////////// 042 043 private static final Font FONT 044 = new Font ( "Arioso", Font.BOLD, 20 ); 045 046 ////////////////////////////////////////////////////////////////////// 047 ////////////////////////////////////////////////////////////////////// 048 049 public static void main ( String [ ] args ) 050 ////////////////////////////////////////////////////////////////////// 051 { 052 launch ( new InputExample ( ) ); 053 } 054 055 private static AnimationInit createAnimationInit ( ) 056 ////////////////////////////////////////////////////////////////////// 057 { 058 AnimationInit animationInit = new AnimationInit ( ); 059 060 animationInit.setAppletInfo ( APPLET_INFO ); 061 062 animationInit.setFont ( FONT ); 063 064 animationInit.setFrameTitle ( TITLE ); 065 066 animationInit.setShutdownConfirmationPrompt ( null ); 067 068 return animationInit; 069 } 070 071 ////////////////////////////////////////////////////////////////////// 072 ////////////////////////////////////////////////////////////////////// 073 074 public InputExample ( ) 075 ////////////////////////////////////////////////////////////////////// 076 { 077 super ( createAnimationInit ( ) ); 078 } 079 080 ////////////////////////////////////////////////////////////////////// 081 // interface Lifecycle methods 082 ////////////////////////////////////////////////////////////////////// 083 084 public void init ( ) 085 ////////////////////////////////////////////////////////////////////// 086 { 087 super.init ( ); 088 089 addComponentAnimator ( new InputAnimator ( animatedComponent ) ); 090 } 091 092 ////////////////////////////////////////////////////////////////////// 093 ////////////////////////////////////////////////////////////////////// 094 }