changed it to support for 30 dictionaries (instead of just 15)
This commit is contained in:
parent
7b04d7bca5
commit
7cdbf33333
2 changed files with 18 additions and 6 deletions
|
@ -20,7 +20,7 @@ package org.thdl.tib.scanner;
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
|
|
||||||
/** Specifies a subset of dictionaries among a set of
|
/** 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
|
@author Andrés Montano Pellegrini
|
||||||
*/
|
*/
|
||||||
|
@ -29,7 +29,7 @@ public class DictionarySource
|
||||||
private int dicts;
|
private int dicts;
|
||||||
|
|
||||||
/** Last bit of word; 1 if there are more brothers.*/
|
/** 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;
|
private static final int allDicts=lastBit-1;
|
||||||
|
|
||||||
public DictionarySource()
|
public DictionarySource()
|
||||||
|
@ -80,13 +80,13 @@ public class DictionarySource
|
||||||
int numDict;
|
int numDict;
|
||||||
if (hasNext) numDict = lastBit | dicts;
|
if (hasNext) numDict = lastBit | dicts;
|
||||||
else numDict = dicts;
|
else numDict = dicts;
|
||||||
raf.writeShort(numDict);
|
raf.writeInt(numDict);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DictionarySource read(DataInput raf) throws IOException
|
public static DictionarySource read(DataInput raf) throws IOException
|
||||||
{
|
{
|
||||||
DictionarySource ds = new DictionarySource();
|
DictionarySource ds = new DictionarySource();
|
||||||
ds.setDicts(raf.readShort());
|
ds.setDicts(raf.readInt());
|
||||||
return ds;
|
return ds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -137,6 +137,17 @@ public class WindowScannerFilter implements WindowListener, FocusListener, Actio
|
||||||
// frame.setSize(240,320);
|
// frame.setSize(240,320);
|
||||||
//else frame.setSize(500,600);
|
//else frame.setSize(500,600);
|
||||||
frame.show();
|
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)
|
public static void main(String[] args)
|
||||||
|
@ -287,11 +298,12 @@ public class WindowScannerFilter implements WindowListener, FocusListener, Actio
|
||||||
{
|
{
|
||||||
if (usingSwing)
|
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)
|
else if (diagAbout==null)
|
||||||
{
|
{
|
||||||
diagAbout = new AboutDialog(frame);
|
diagAbout = new AboutDialog(frame, false);
|
||||||
}
|
}
|
||||||
diagAbout.show();
|
diagAbout.show();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue