From 7cdbf3333301a6abb2f9f6abe21fe2c78d51e228 Mon Sep 17 00:00:00 2001 From: amontano Date: Fri, 25 Jul 2003 01:42:17 +0000 Subject: [PATCH] changed it to support for 30 dictionaries (instead of just 15) --- .../org/thdl/tib/scanner/DictionarySource.java | 8 ++++---- .../thdl/tib/scanner/WindowScannerFilter.java | 16 ++++++++++++++-- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/source/org/thdl/tib/scanner/DictionarySource.java b/source/org/thdl/tib/scanner/DictionarySource.java index 1f5c3b3..7961c10 100644 --- a/source/org/thdl/tib/scanner/DictionarySource.java +++ b/source/org/thdl/tib/scanner/DictionarySource.java @@ -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; } diff --git a/source/org/thdl/tib/scanner/WindowScannerFilter.java b/source/org/thdl/tib/scanner/WindowScannerFilter.java index 4c32d56..37f1a96 100644 --- a/source/org/thdl/tib/scanner/WindowScannerFilter.java +++ b/source/org/thdl/tib/scanner/WindowScannerFilter.java @@ -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(); }