changed it to support for 30 dictionaries (instead of just 15)

This commit is contained in:
amontano 2003-07-25 01:42:17 +00:00
parent 7b04d7bca5
commit 7cdbf33333
2 changed files with 18 additions and 6 deletions

View file

@ -20,7 +20,7 @@ package org.thdl.tib.scanner;
import java.io.*;
/** Specifies a subset of dictionaries among a set of
dictionaries. Supports a maximum of 15 dictionaries.
dictionaries. Supports a maximum of 30 dictionaries.
@author Andrés Montano Pellegrini
*/
@ -29,7 +29,7 @@ public class DictionarySource
private int dicts;
/** Last bit of word; 1 if there are more brothers.*/
private static final int lastBit=32768;
private static final int lastBit=1073741824;
private static final int allDicts=lastBit-1;
public DictionarySource()
@ -80,13 +80,13 @@ public class DictionarySource
int numDict;
if (hasNext) numDict = lastBit | dicts;
else numDict = dicts;
raf.writeShort(numDict);
raf.writeInt(numDict);
}
public static DictionarySource read(DataInput raf) throws IOException
{
DictionarySource ds = new DictionarySource();
ds.setDicts(raf.readShort());
ds.setDicts(raf.readInt());
return ds;
}

View file

@ -137,6 +137,17 @@ public class WindowScannerFilter implements WindowListener, FocusListener, Actio
// frame.setSize(240,320);
//else frame.setSize(500,600);
frame.show();
if (usingSwing)
{
//JOptionPane.showMessageDialog(frame, TibetanScanner.aboutUnicode, "About", JOptionPane.PLAIN_MESSAGE);
diagAbout = new AboutDialog(frame, true);
}
else if (diagAbout==null)
{
diagAbout = new AboutDialog(frame, false);
}
diagAbout.show();
}
public static void main(String[] args)
@ -287,11 +298,12 @@ public class WindowScannerFilter implements WindowListener, FocusListener, Actio
{
if (usingSwing)
{
JOptionPane.showMessageDialog(frame, TibetanScanner.aboutUnicode, "About", JOptionPane.PLAIN_MESSAGE);
//JOptionPane.showMessageDialog(frame, TibetanScanner.aboutUnicode, "About", JOptionPane.PLAIN_MESSAGE);
diagAbout = new AboutDialog(frame, true);
}
else if (diagAbout==null)
{
diagAbout = new AboutDialog(frame);
diagAbout = new AboutDialog(frame, false);
}
diagAbout.show();
}