|
From: Sanjay <sg...@us...> - 2007-03-13 10:07:04
|
Update of /cvsroot/fieldling/Fieldling/src/fieldling/quilldriver/gui In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv19117/src/fieldling/quilldriver/gui Modified Files: QDShell.java Log Message: Testing support for JMFPlayer Index: QDShell.java =================================================================== RCS file: /cvsroot/fieldling/Fieldling/src/fieldling/quilldriver/gui/QDShell.java,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** QDShell.java 11 Dec 2006 20:50:38 -0000 1.59 --- QDShell.java 13 Mar 2007 10:06:59 -0000 1.60 *************** *** 46,59 **** private QD qd = null; private Container contentPane; ! /* Declaring the following private instance variables was the only way I figured to share * information between the method itself and its inner classes. */ private boolean optionsChanged; ! private static void printSyntax() { ! System.out.println("Syntax: QDShell [-THDLTranscription | -THDLReadonly transcript-file-list]"); } ! public static void main(String[] args) { --- 46,59 ---- private QD qd = null; private Container contentPane; ! /* Declaring the following private instance variables was the only way I figured to share * information between the method itself and its inner classes. */ private boolean optionsChanged; ! private static void printSyntax() { ! System.out.println("Syntax: QDShell [-THDLTranscription | -THDLReadonly | -TranscribeQuechua] [-JMFPlayer | -QT4JPlayer] transcript-file-list]"); } ! public static void main(String[] args) { *************** *** 62,66 **** maximize the transcript, and then click on the video, then the video suddenly maximizes and you can't see the transcript any more--not what we want! ! http://forum.java.sun.com/thread.jspa?forumID=57&threadID=586119 Problem with "Windows Look N Feel" --- 62,66 ---- maximize the transcript, and then click on the video, then the video suddenly maximizes and you can't see the transcript any more--not what we want! ! http://forum.java.sun.com/thread.jspa?forumID=57&threadID=586119 Problem with "Windows Look N Feel" *************** *** 75,81 **** me what's the cause of the problem and if possible send me the solution.*/ ! try { UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); ! } catch (Exception e) { } PrintStream ps=null; try --- 75,83 ---- me what's the cause of the problem and if possible send me the solution.*/ ! try ! { UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); ! } ! catch (Exception e) { } PrintStream ps=null; try *************** *** 92,96 **** http://sourceforge.net/mailarchive/message.php?msg_id=2997255*/ System.setProperty("javax.xml.transform.TransformerFactory", "net.sf.saxon.TransformerFactoryImpl"); ! try { --- 94,98 ---- http://sourceforge.net/mailarchive/message.php?msg_id=2997255*/ System.setProperty("javax.xml.transform.TransformerFactory", "net.sf.saxon.TransformerFactoryImpl"); ! try { *************** *** 98,104 **** System.setOut(ps); System.setErr(ps); ! } catch (FileNotFoundException fnfe) { ! } ! if (args.length==0) { --- 100,106 ---- System.setOut(ps); System.setErr(ps); ! } ! catch (FileNotFoundException fnfe) { } ! if (args.length==0) { *************** *** 106,137 **** return; } ! ! if (args[0].charAt(0)!='-') ! { ! System.out.println("Syntax error: option expected!"); ! printSyntax(); ! return; ! } ! ! String option = args[0].substring(1); ! String configName; ! // for now only these two options are available. More to come... ! if (!option.equals("THDLTranscription") && !option.equals("THDLReadonly") && !option.equals("TranscribeQuechua")) { ! System.out.println("Syntax error: invalid option \"" + option + "\"!"); ! printSyntax(); ! return; } ! ! if (args.length==1) { ! new QDShell(option, PreferenceManager.MEDIA_PLAYER_DEFAULT); return; } ! ! File[] transcriptFile = new File[args.length-1]; ! for (int i=1; i<args.length; i++) { ! transcriptFile[i-1] = new File (args[i]); ! if (!transcriptFile[i-1].exists()) { System.out.println("Error reading file!"); --- 108,151 ---- return; } ! ! int i; ! String option, configName=PreferenceManager.CONFIGURATION_DEFAULT, mediaPlayer=PreferenceManager.MEDIA_PLAYER_DEFAULT; ! ! for(i=0; i<args.length; i++) { ! ! if (args[i].charAt(0)!='-') ! { ! System.out.println("Syntax error: option expected!"); ! printSyntax(); ! return; ! } ! ! option = args[i].substring(1); ! if (option.equals("THDLTranscription") || option.equals("THDLReadonly") || option.equals("TranscribeQuechua")) ! { ! configName = option; ! } ! else if (option.equals("JMFPlayer") || option.equals("QT4JPlayer")) ! { ! mediaPlayer = "fieldling.media.player." + option; ! } ! else ! { ! System.out.println("Syntax error: invalid option \"" + option + "\"!"); ! printSyntax(); ! return; ! } } ! if (i==args.length) { ! new QDShell(configName, mediaPlayer); return; } ! ! File[] transcriptFile = new File[args.length-i]; ! for (int j=i; j<args.length; i++) { ! transcriptFile[j-i] = new File (args[j]); ! if (!transcriptFile[j-i].exists()) { System.out.println("Error reading file!"); *************** *** 140,148 **** } // if arguments are passed through the command-line default to Quick-time for Java ! new QDShell(transcriptFile[0], option, PreferenceManager.MEDIA_PLAYER_DEFAULT); } catch (NoClassDefFoundError err) { } } ! public QDShell() { --- 154,162 ---- } // if arguments are passed through the command-line default to Quick-time for Java ! new QDShell(transcriptFile[0], configName, mediaPlayer); } catch (NoClassDefFoundError err) { } } ! public QDShell() { *************** *** 150,154 **** PreferenceManager.MEDIA_PLAYER_DEFAULT); } ! public QDShell(String configName, String mediaPlayer) { --- 164,168 ---- PreferenceManager.MEDIA_PLAYER_DEFAULT); } ! public QDShell(String configName, String mediaPlayer) { *************** *** 156,160 **** setVisible(true); } ! public QDShell(File transcriptFile, String configName, String mediaPlayer) { --- 170,174 ---- setVisible(true); } ! public QDShell(File transcriptFile, String configName, String mediaPlayer) { *************** *** 163,172 **** setVisible(true); } ! public QDShell(QD qd) { loadGenericInitialState(qd); setVisible(true); } ! public PanelPlayer getMediaPlayer(String mediaPlayer) { try { --- 177,186 ---- setVisible(true); } ! public QDShell(QD qd) { loadGenericInitialState(qd); setVisible(true); } ! public PanelPlayer getMediaPlayer(String mediaPlayer) { try { *************** *** 176,180 **** } } ! public void putPreferences() { PreferenceManager.setInt(PreferenceManager.WINDOW_X_KEY, getX()); --- 190,194 ---- } } ! public void putPreferences() { PreferenceManager.setInt(PreferenceManager.WINDOW_X_KEY, getX()); *************** *** 183,191 **** PreferenceManager.setInt(PreferenceManager.WINDOW_HEIGHT_KEY, getHeight()); } ! public QD getQD() { return qd; } ! public void activateQD(QD qd, boolean hasLoadedTranscript) { this.qd = qd; --- 197,205 ---- PreferenceManager.setInt(PreferenceManager.WINDOW_HEIGHT_KEY, getHeight()); } ! public QD getQD() { return qd; } ! public void activateQD(QD qd, boolean hasLoadedTranscript) { this.qd = qd; *************** *** 207,211 **** repaint(); } ! public void deActivateQD(QD qd) { contentPane.remove(qd); --- 221,225 ---- repaint(); } ! public void deActivateQD(QD qd) { contentPane.remove(qd); *************** *** 216,220 **** //this.qd = null; } ! /** Constructor for generic stuff loaded regardless of how to get initial state (wizard, command-line, * or defaults in pref manager). Not meant to be called directly!!! */ --- 230,234 ---- //this.qd = null; } ! /** Constructor for generic stuff loaded regardless of how to get initial state (wizard, command-line, * or defaults in pref manager). Not meant to be called directly!!! */ *************** *** 239,243 **** }); } ! private void loadSpecificInitialStateFromDefaults() throws Exception { --- 253,257 ---- }); } ! private void loadSpecificInitialStateFromDefaults() throws Exception { *************** *** 258,267 **** loadSpecificInitialState(transcriptFile, mediaURL); } ! private void loadSpecificInitialState(File transcriptFile) { loadSpecificInitialState(transcriptFile, null); } ! private void loadSpecificInitialState(File transcriptFile, String mediaURL) { --- 272,281 ---- loadSpecificInitialState(transcriptFile, mediaURL); } ! private void loadSpecificInitialState(File transcriptFile) { loadSpecificInitialState(transcriptFile, null); } ! private void loadSpecificInitialState(File transcriptFile, String mediaURL) { *************** *** 282,286 **** } /* ! java.util.List recentFileList = new ArrayList(); java.util.List recentVideoList = new ArrayList(); --- 296,300 ---- } /* ! java.util.List recentFileList = new ArrayList(); java.util.List recentVideoList = new ArrayList(); *************** *** 314,318 **** count++; } ! /*protected void makeRecentlyOpened(String s, String t) { String r = PreferenceManager.getValue(PreferenceManager.RECENT_FILES_KEY, null); --- 328,332 ---- count++; } ! /*protected void makeRecentlyOpened(String s, String t) { String r = PreferenceManager.getValue(PreferenceManager.RECENT_FILES_KEY, null); *************** *** 350,353 **** PreferenceManager.setValue(PreferenceManager.RECENT_FILES_KEY, sb.toString()); PreferenceManager.setValue(PreferenceManager.RECENT_VIDEOS_KEY, sb2.toString()); ! */ --- 364,367 ---- PreferenceManager.setValue(PreferenceManager.RECENT_FILES_KEY, sb.toString()); PreferenceManager.setValue(PreferenceManager.RECENT_VIDEOS_KEY, sb2.toString()); ! */ |