diff --git a/source/org/thdl/tib/input/DuffPane.java b/source/org/thdl/tib/input/DuffPane.java index 9cfec57..fb454cb 100644 --- a/source/org/thdl/tib/input/DuffPane.java +++ b/source/org/thdl/tib/input/DuffPane.java @@ -1566,21 +1566,25 @@ public void paste(int offset) { * Converts the currently selected text from Roman transliteration to * TibetanMachineWeb. * @param fromACIP true if the selection is ACIP, false if it is EWTS +* @param withWarnings true if and only if you want warnings to appear +* in the output, such as "this could be a mistranscription of blah..." * */ - public void toTibetanMachineWeb(boolean fromACIP) { + public void toTibetanMachineWeb(boolean fromACIP, boolean withWarnings) { int start = getSelectionStart(); int end = getSelectionEnd(); - toTibetanMachineWeb(fromACIP, start, end); + toTibetanMachineWeb(fromACIP, withWarnings, start, end); } /** * Converts a stretch of text from Extended Wylie to TibetanMachineWeb. * @param fromACIP true if the selection is ACIP, false if it is EWTS +* @param withWarnings true if and only if you want warnings to appear +* in the output, such as "this could be a mistranscription of blah..." * @param start the begin point for the conversion -* @param end the end point for the conversion -*/ - public void toTibetanMachineWeb(boolean fromACIP, int start, int end) { +* @param end the end point for the conversion */ + public void toTibetanMachineWeb(boolean fromACIP, boolean withWarnings, + int start, int end) { if (start == end) return; @@ -1605,7 +1609,10 @@ public void paste(int offset) { DuffData[] duffdata = null; if (fromACIP) { getTibDoc().remove(start, i-start); - TibTextUtils.insertTibetanMachineWebForACIP(sb.toString(), getTibDoc(), start); + TibTextUtils.insertTibetanMachineWebForACIP(sb.toString(), + getTibDoc(), + start, + withWarnings); } else duffdata = TibTextUtils.getTibetanMachineWebForEWTS(sb.toString()); diff --git a/source/org/thdl/tib/input/Jskad.java b/source/org/thdl/tib/input/Jskad.java index a4c9b31..c1a1a83 100644 --- a/source/org/thdl/tib/input/Jskad.java +++ b/source/org/thdl/tib/input/Jskad.java @@ -434,19 +434,27 @@ public class Jskad extends JPanel implements DocumentListener { JMenuItem wylieTMWItem = new JMenuItem("Convert Wylie to Tibetan"); wylieTMWItem.addActionListener(new ThdlActionListener() { public void theRealActionPerformed(ActionEvent e) { - toTibetan(false); + toTibetan(false, true); } }); convertSelectionMenu.add(wylieTMWItem); - JMenuItem ACIPTMWItem = new JMenuItem("Convert ACIP to Tibetan"); + JMenuItem ACIPTMWItem = new JMenuItem("Convert ACIP to Tibetan (no warnings)"); ACIPTMWItem.addActionListener(new ThdlActionListener() { public void theRealActionPerformed(ActionEvent e) { - toTibetan(true); + toTibetan(true, false); } }); convertSelectionMenu.add(ACIPTMWItem); + JMenuItem ACIPTMWWarnItem = new JMenuItem("Convert ACIP to Tibetan (with warnings)"); + ACIPTMWWarnItem.addActionListener(new ThdlActionListener() { + public void theRealActionPerformed(ActionEvent e) { + toTibetan(true, true); + } + }); + convertSelectionMenu.add(ACIPTMWWarnItem); + JMenu convertAllMenu = new JMenu("Convert All"); JMenuItem toTMItem = new JMenuItem("Convert Tibetan to TM"); // DLC FIXME: do it just in the selection? @@ -1130,9 +1138,9 @@ public class Jskad extends JPanel implements DocumentListener { dp.paste(dp.getCaret().getDot()); } - private void toTibetan(boolean fromACIP) { + private void toTibetan(boolean fromACIP, boolean withWarnings) { Jskad.this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - dp.toTibetanMachineWeb(fromACIP); + dp.toTibetanMachineWeb(fromACIP, withWarnings); Jskad.this.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } diff --git a/source/org/thdl/tib/input/package.html b/source/org/thdl/tib/input/package.html index d3e59c0..d7db8ae 100644 --- a/source/org/thdl/tib/input/package.html +++ b/source/org/thdl/tib/input/package.html @@ -15,7 +15,8 @@ -->
-Provides classes and methods for inputting Tibetan text. +Provides classes and methods for inputting and converting to and from +Tibetan text.Designed for use with the Tibetan Computer Company's free cross-platform Tibetan Machine Web fonts, this package contains