001 package com.croftsoft.apps.jogl.imp; 002 003 import java.awt.*; 004 005 import com.croftsoft.apps.jogl.JoglConfig; 006 import com.croftsoft.core.CroftSoftConstants; 007 008 /*********************************************************************** 009 * Jogl configuration. 010 * 011 * Can be modified to be persistent. 012 * 013 * @version 014 * $Id: JoglConfigImp.java,v 1.3 2008/09/26 23:28:05 croft Exp $ 015 * @since 016 * 2008-02-10 017 * @author 018 * <a href="https://www.croftsoft.com/">David Wallace Croft</a> 019 ***********************************************************************/ 020 021 public final class JoglConfigImp 022 implements JoglConfig 023 //////////////////////////////////////////////////////////////////////// 024 //////////////////////////////////////////////////////////////////////// 025 { 026 027 private static final String VERSION 028 = "$Date: 2008/09/26 23:28:05 $"; 029 030 private static final String TITLE 031 = "CroftSoft JOGL Demo"; 032 033 private static final String INFO 034 = TITLE + "\n" 035 + "Version " + VERSION + "\n" 036 + CroftSoftConstants.COPYRIGHT + "\n" 037 + CroftSoftConstants.DEFAULT_LICENSE + "\n" 038 + CroftSoftConstants.HOME_PAGE + "\n"; 039 040 private static final int 041 FRAME_WIDTH = 600, 042 FRAME_HEIGHT = 400; 043 044 private static final double UPDATE_RATE = 100.0; 045 046 private static final String 047 SHUTDOWN_CONFIRMATION_PROMPT = "Exit " + TITLE + "?"; 048 049 //////////////////////////////////////////////////////////////////////// 050 //////////////////////////////////////////////////////////////////////// 051 052 public static JoglConfigImp load ( final String [ ] args ) 053 //////////////////////////////////////////////////////////////////////// 054 { 055 // Could load from a persistent XML file. 056 // See "Enumerated Accessors" tutorial at 057 // https://www.croftsoft.com/library/tutorials/enum/ 058 059 return new JoglConfigImp ( ); 060 } 061 062 //////////////////////////////////////////////////////////////////////// 063 //////////////////////////////////////////////////////////////////////// 064 065 public String getInfo ( ) { return INFO; } 066 067 public Dimension getFrameSize ( ) 068 { return new Dimension ( FRAME_WIDTH, FRAME_HEIGHT ); } 069 070 public String getFrameTitle ( ) { return TITLE; } 071 072 public String getShutdownConfirmationPrompt ( ) 073 { return SHUTDOWN_CONFIRMATION_PROMPT; } 074 075 public String getThreadName ( ) { return TITLE; } 076 077 public double getUpdateRate ( ) { return UPDATE_RATE; } 078 079 //////////////////////////////////////////////////////////////////////// 080 //////////////////////////////////////////////////////////////////////// 081 }