diff --git a/source/org/thdl/tib/scanner/BinaryFileGenerator.java b/source/org/thdl/tib/scanner/BinaryFileGenerator.java index 96d326f..82c2392 100644 --- a/source/org/thdl/tib/scanner/BinaryFileGenerator.java +++ b/source/org/thdl/tib/scanner/BinaryFileGenerator.java @@ -507,8 +507,8 @@ public class BinaryFileGenerator extends SimplifiedLinkedList add(s1, s2 , defNum); } } + currentLine++; } - currentLine++; } } diff --git a/source/org/thdl/tib/scanner/DictionaryListSelectionListener.java b/source/org/thdl/tib/scanner/DictionaryListSelectionListener.java index fcd6014..088b758 100644 --- a/source/org/thdl/tib/scanner/DictionaryListSelectionListener.java +++ b/source/org/thdl/tib/scanner/DictionaryListSelectionListener.java @@ -47,7 +47,7 @@ public class DictionaryListSelectionListener implements ListSelectionListener { int selectedRow = lsm.getMinSelectionIndex(); //TableModel tm = table.getModel(); - fullDef.setText(table.getValueAt(selectedRow, 1).toString()); + fullDef.setText(table.getValueAt(selectedRow, 2).toString()); } } } \ No newline at end of file diff --git a/source/org/thdl/tib/scanner/DictionaryTable.java b/source/org/thdl/tib/scanner/DictionaryTable.java index 631a4c1..f4bcd3b 100644 --- a/source/org/thdl/tib/scanner/DictionaryTable.java +++ b/source/org/thdl/tib/scanner/DictionaryTable.java @@ -102,5 +102,17 @@ public class DictionaryTable extends JTable tc.setCellRenderer(normalRenderer); DictionaryTableModel dtm = (DictionaryTableModel) getModel(); dtm.activateTibetan(activate); - } + } + + public void setTibetanFontSize(int size) + { + DuffCellRenderer dcr = (DuffCellRenderer) duffRenderer; + dcr.setTibetanFontSize(size); + } + + public void setRomanFont(Font f) + { + AlmostDefaultTableCellRenderer tcr = (AlmostDefaultTableCellRenderer) normalRenderer; + tcr.setFont(f); + } } \ No newline at end of file diff --git a/source/org/thdl/tib/scanner/DictionaryTableModel.java b/source/org/thdl/tib/scanner/DictionaryTableModel.java index d67375b..7834737 100644 --- a/source/org/thdl/tib/scanner/DictionaryTableModel.java +++ b/source/org/thdl/tib/scanner/DictionaryTableModel.java @@ -59,15 +59,14 @@ public class DictionaryTableModel extends AbstractTableModel public Object getValueAt(int row, int column) { - if (column==0) - { - if (tibetanActivated) - return arrayTibetan[row]; - else - return array[row].getWylie(); + switch(column) + { + case 0: + if (tibetanActivated) return arrayTibetan[row]; + else return array[row].getWylie(); + case 1: return array[row].getDef(); + default: return array[row].toString(); } - else - return array[row].getDef(); } diff --git a/source/org/thdl/tib/scanner/DuffScannerPanel.java b/source/org/thdl/tib/scanner/DuffScannerPanel.java index d434156..5589063 100644 --- a/source/org/thdl/tib/scanner/DuffScannerPanel.java +++ b/source/org/thdl/tib/scanner/DuffScannerPanel.java @@ -22,7 +22,8 @@ import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; import javax.swing.table.*; -import org.thdl.tib.input.DuffPane; +import org.thdl.tib.input.*; +import org.thdl.util.*; /** Graphical interfase to be used by applications and applets to input a Tibetan text (in Roman or Tibetan script) and @@ -33,7 +34,7 @@ import org.thdl.tib.input.DuffPane; @see WindowScannerFilter @see AppletScannerFilter */ -public class DuffScannerPanel extends ScannerPanel +public class DuffScannerPanel extends ScannerPanel implements ItemListener { private TextArea fullDef, txtInput; private DuffPane duffInput; @@ -46,11 +47,31 @@ public class DuffScannerPanel extends ScannerPanel private DictionaryTableModel model; boolean showingTibetan; + + private PreferenceWindow prefWindow; + private Choice script, keyboard; + + /** the middleman that keeps code regarding Tibetan keyboards + * clean */ + final static JskadKeyboardManager keybdMgr; + + static { + try { + keybdMgr + = new JskadKeyboardManager(JskadKeyboardFactory.getAllAvailableJskadKeyboards()); + } catch (Exception e) { + throw new ThdlLazyException(e); + } + } public DuffScannerPanel(String file) { - super(file); - Panel panel1, panel2; + super(file, true); + Panel panel1, panel2, toolBar; + int i; + + prefWindow = null; + panel2 = new Panel(new BorderLayout()); panel1 = getDictPanel(); if (panel1!=null) panel2.add (panel1, BorderLayout.NORTH); @@ -83,8 +104,36 @@ public class DuffScannerPanel extends ScannerPanel panel2.add(panel1, BorderLayout.CENTER); add(panel2, BorderLayout.CENTER); showingTibetan = true; + + toolBar = getToolBar(); + toolBar.setLayout(new FlowLayout()); + toolBar.add(new Label("Display:")); -// tibetanFont = new Font("TibetanMachine",Font.PLAIN,36); + script = new Choice(); + script.add("Tibetan script"); + script.add("Roman script"); + toolBar.add(script); + script.addItemListener(this); + + toolBar.add(new Label("Keyboard:")); + + keyboard = new Choice(); + String keyboardNames[] = keybdMgr.getIdentifyingStrings(); + for (i=0; i