Gave higher priority to the dictionary name specified in the properties file than to the dictionary name passed as an argument.

This commit is contained in:
amontano 2005-04-26 05:25:19 +00:00
parent 14ad55aa3f
commit e096aee67b
2 changed files with 42 additions and 37 deletions

View file

@ -209,9 +209,7 @@ public class SwingWindowScannerFilter extends WindowScannerFilter
break; break;
default: default:
System.out.println("Syntax error!"); System.out.println("Syntax error!");
System.out.println("Sintaxis: java SwingWindowScannerFilter [options] arch-dict"); System.out.println("Sintaxis: java SwingWindowScannerFilter [arch-dict]");
System.out.println("Options:");
System.out.println(" -simple: runs the non-swing version.");
System.out.println(TibetanScanner.copyrightASCII); System.out.println(TibetanScanner.copyrightASCII);
} }
} }

View file

@ -55,14 +55,21 @@ public abstract class WindowScannerFilter implements WindowListener, FocusListen
protected Frame mainWindow; protected Frame mainWindow;
/** This class is not meant to be called by itself */ /** This class is not meant to be called by itself */
public WindowScannerFilter() public WindowScannerFilter(String argument)
{ {
String response, dictType; String response, dictType;
WhichDictionaryFrame wdf; WhichDictionaryFrame wdf;
mainWindow = null;
response = ThdlOptions.getStringOption(defOpenOption); response = ThdlOptions.getStringOption(defOpenOption);
if (response==null || response.equals("")) if (response==null || response.equals(""))
{
if (argument!=null && !argument.equals(""))
{
response = argument;
}
else
{ {
mainWindow = new Frame("Tibetan Translation Tool"); mainWindow = new Frame("Tibetan Translation Tool");
mainWindow.show(); mainWindow.show();
@ -95,13 +102,13 @@ public abstract class WindowScannerFilter implements WindowListener, FocusListen
} }
} }
} }
}
makeWindow (response); makeWindow (response);
} }
public WindowScannerFilter(String file) public WindowScannerFilter()
{ {
mainWindow = null; this(null);
makeWindow (file);
} }
protected abstract WhichDictionaryFrame getWhichDictionaryFrame(); protected abstract WhichDictionaryFrame getWhichDictionaryFrame();