From fab76cb82efdff7d4441b30a71310243d1200bb9 Mon Sep 17 00:00:00 2001 From: eg3p Date: Sat, 2 Nov 2002 22:10:12 +0000 Subject: [PATCH] no message --- source/org/thdl/quilldriver/QD.java | 183 ++++++++++------------- source/org/thdl/quilldriver/QDShell.java | 53 +++---- 2 files changed, 105 insertions(+), 131 deletions(-) diff --git a/source/org/thdl/quilldriver/QD.java b/source/org/thdl/quilldriver/QD.java index c28b61c..1757ada 100644 --- a/source/org/thdl/quilldriver/QD.java +++ b/source/org/thdl/quilldriver/QD.java @@ -49,6 +49,7 @@ import org.thdl.util.ThdlActionListener; import org.thdl.util.ThdlAbstractAction; import org.thdl.util.ThdlOptions; import org.thdl.util.SimpleSpinner; +import org.thdl.util.ThdlI18n; public class QD extends JDesktopPane { private final static JskadKeyboardManager keybdMgr @@ -79,10 +80,6 @@ public class QD extends JDesktopPane { public Style componentStyle; public DataFlavor timeFlavor; - /** Either "qt4j" or "jmf", corresponding to the thdl.media.player - property. */ - protected String thdl_mediaplayer_property = null; - //class fields because they are affected depending on whether we're //in read-only or edit mode protected JMenu editMenu, searchMenu; @@ -103,9 +100,12 @@ public class QD extends JDesktopPane { protected KeyStroke insert1TimeKey, insert2TimesKey, insertSpeakerKey; protected KeyStroke findKey, replaceKey; + protected JskadKeyboard activeKeyboard = null; + protected JskadKeyboard wylieKeyboard; -public QD(ResourceBundle messages) { - this.messages = messages; + +public QD() { + messages = ThdlI18n.getResourceBundle(); setBackground(new JFrame().getBackground()); setDragMode(JDesktopPane.OUTLINE_DRAG_MODE); @@ -167,6 +167,10 @@ public QD(ResourceBundle messages) { SpeakerData speakerData = new SpeakerData(speakers, keymap); speakerTable = new SpeakerTable(speakerData); +//FIXME when save/load bug is fixed + JskadKeyboard[] allKeyboards = JskadKeyboardFactory.getAllAvailableJskadKeyboards(); + wylieKeyboard = allKeyboards[0]; + pane = new DuffPane(); pane.setKeymap(keymap); new TimePointDropTarget(pane); @@ -321,10 +325,8 @@ class TimePoint extends JLabel implements DragGestureListener, DragSourceListene return String.valueOf(time); } public void playSegment() { - int i=pos.getOffset(); - System.out.println(String.valueOf(i)); try { - for (i++; i 0) dp.setText(""); @@ -1064,15 +1051,13 @@ if (keyboard_url != null) { currentWork = new Work(); work.add(currentWork); -/* URGENT FIX LOADING PROBLEM -if (keyboard_url != null) { - dp.registerKeyboard(keyboard_url); - // project.tName.setupKeyboard(); - // project.tTask.setupKeyboard(); - sharedDP.setupKeyboard(); - sharedDP2.setupKeyboard(); -} -*/ +//FIXME this should be replaced once the relevant bug in TibetanDocument is fixed +//FIXME: grep for URGENT and fix or Fix or FIX + if (activeKeyboard != null) { + activeKeyboard.activate(dp); + activeKeyboard.activate(sharedDP); + activeKeyboard.activate(sharedDP2); + } project.setTranscript(t); jtp.addTab(messages.getString("ProjectDetails"), project); @@ -1438,21 +1423,15 @@ class SpeakerTable extends JTable public JMenuBar getTextMenuBar() { JMenu modeMenu = new JMenu(messages.getString("Mode")); - JRadioButton editButton = new JRadioButton(messages.getString("Edit")); - JRadioButton viewButton = new JRadioButton(messages.getString("ReadOnly")); - editButton.setActionCommand("edit"); - viewButton.setActionCommand("view"); + JMenuItem editMenuItem = new JMenuItem(messages.getString("Edit")); + JMenuItem viewMenuItem = new JMenuItem(messages.getString("ReadOnly")); + editMenuItem.setActionCommand("edit"); + viewMenuItem.setActionCommand("view"); RadioListener l = new RadioListener(); - editButton.addActionListener(l); - viewButton.addActionListener(l); - editButton.setSelected(true); - ButtonGroup bg = new ButtonGroup(); - bg.add(editButton); - bg.add(viewButton); - JPanel buttons = new JPanel(new GridLayout(0,1)); - buttons.add(editButton); - buttons.add(viewButton); - modeMenu.add(buttons); + editMenuItem.addActionListener(l); + viewMenuItem.addActionListener(l); + modeMenu.add(editMenuItem); + modeMenu.add(viewMenuItem); JMenu viewMenu = new JMenu(messages.getString("View")); JMenuItem previousItem = new JMenuItem(messages.getString("Previous")); diff --git a/source/org/thdl/quilldriver/QDShell.java b/source/org/thdl/quilldriver/QDShell.java index 81bfbaa..91c09ff 100644 --- a/source/org/thdl/quilldriver/QDShell.java +++ b/source/org/thdl/quilldriver/QDShell.java @@ -27,12 +27,14 @@ import java.awt.event.*; import javax.swing.text.*; import javax.swing.text.rtf.*; +import org.thdl.media.*; import org.thdl.util.ThdlDebug; import org.thdl.util.ThdlActionListener; import org.thdl.util.ThdlOptions; import org.thdl.tib.input.JskadKeyboardManager; import org.thdl.tib.input.JskadKeyboardFactory; import org.thdl.tib.input.JskadKeyboard; +import org.thdl.util.ThdlI18n; import org.thdl.savant.JdkVersionHacks; @@ -59,15 +61,8 @@ public class QDShell extends JFrame { if (args.length == 2) { locale = new Locale(new String(args[0]), new String(args[1])); - Locale[] locales = Locale.getAvailableLocales(); - for (int k=0; k 0) { + SmartMoviePanel defaultPlayer = (SmartMoviePanel)moviePlayers.get(0); + qd.setMediaPlayer(defaultPlayer); //set qd media player to default + if (moviePlayers.size() > 1) + preferencesMenu.add(mediaPlayerMenu); + } JMenuBar bar = new JMenuBar(); bar.add(projectMenu);