[jsword-svn] r2089 - in trunk/jsword-limbo/src/main/java/org/crosswire: bibledesktop/display/jdtb common/config/swing common/swing

dmsmith at crosswire.org dmsmith at crosswire.org
Sat Mar 5 15:30:09 MST 2011


Author: dmsmith
Date: 2011-03-05 15:30:08 -0700 (Sat, 05 Mar 2011)
New Revision: 2089

Removed:
   trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/display/jdtb/Msg.java
   trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/display/jdtb/Msg.properties
Modified:
   trunk/jsword-limbo/src/main/java/org/crosswire/common/config/swing/ColorField.java
   trunk/jsword-limbo/src/main/java/org/crosswire/common/config/swing/MapField.java
   trunk/jsword-limbo/src/main/java/org/crosswire/common/config/swing/WizardConfigEditor.java
   trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/DocumentWriter.java
Log:


Deleted: trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/display/jdtb/Msg.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/display/jdtb/Msg.java	2011-03-05 20:36:55 UTC (rev 2088)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/display/jdtb/Msg.java	2011-03-05 22:30:08 UTC (rev 2089)
@@ -1,42 +0,0 @@
-/**
- * Distribution License:
- * BibleDesktop is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, version 2 as published by
- * the Free Software Foundation. This program is distributed in the hope
- * that it will be useful, but WITHOUT ANY WARRANTY; without even the
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * The License is available on the internet at:
- *       http://www.gnu.org/copyleft/gpl.html
- * or by writing to:
- *      Free Software Foundation, Inc.
- *      59 Temple Place - Suite 330
- *      Boston, MA 02111-1307, USA
- *
- * Copyright: 2005
- *     The copyright to this program is held by it's authors.
- *
- * ID: $Id$
- */
-package org.crosswire.bibledesktop.display.jdtb;
-
-import org.crosswire.common.util.MsgBase;
-
-/**
- * Compile safe Msg resource settings.
- * 
- * @see gnu.gpl.License for license details.<br>
- *      The copyright to this program is held by it's authors.
- * @author Joe Walker [joe at eireneh dot com]
- */
-class Msg extends MsgBase {
-    static final Msg TRANSFORM_FAIL = new Msg("JDTBBookDataDisplay.TransformationFailure");
-
-    /**
-     * Passthrough ctor
-     */
-    private Msg(String name) {
-        super(name);
-    }
-}

Deleted: trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/display/jdtb/Msg.properties
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/display/jdtb/Msg.properties	2011-03-05 20:36:55 UTC (rev 2088)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/display/jdtb/Msg.properties	2011-03-05 22:30:08 UTC (rev 2089)
@@ -1 +0,0 @@
-JDTBBookDataDisplay.TransformationFailure=Transformation Failure

Modified: trunk/jsword-limbo/src/main/java/org/crosswire/common/config/swing/ColorField.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/common/config/swing/ColorField.java	2011-03-05 20:36:55 UTC (rev 2088)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/common/config/swing/ColorField.java	2011-03-05 22:30:08 UTC (rev 2089)
@@ -51,9 +51,10 @@
      * Create a new FileField
      */
     public ColorField() {
-        actions = new ActionFactory(ColorField.class, this);
+        actions = new ActionFactory(this);
 
-        JButton edit = new JButton(actions.getAction(EDIT));
+        // FIXME(DMS)
+        JButton edit = new JButton(actions.addAction(EDIT));
         edit.setIcon(new CustomIcon());
         edit.setMargin(new Insets(1, 2, 1, 1));
 
@@ -114,7 +115,7 @@
      * @throws ClassNotFoundException
      */
     private void readObject(ObjectInputStream is) throws IOException, ClassNotFoundException {
-        actions = new ActionFactory(ColorField.class, this);
+        actions = new ActionFactory(this);
         is.defaultReadObject();
     }
 

Modified: trunk/jsword-limbo/src/main/java/org/crosswire/common/config/swing/MapField.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/common/config/swing/MapField.java	2011-03-05 20:36:55 UTC (rev 2088)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/common/config/swing/MapField.java	2011-03-05 22:30:08 UTC (rev 2089)
@@ -44,6 +44,7 @@
 import org.crosswire.common.swing.ExceptionPane;
 import org.crosswire.common.swing.FieldLayout;
 import org.crosswire.common.swing.MapTableModel;
+import org.crosswire.common.swing.CWMsg;
 import org.crosswire.common.util.Convert;
 
 /**
@@ -62,7 +63,7 @@
         tableModel = new NamedMapTableModel();
         table = new JTable(tableModel);
 
-        actions = new ActionFactory(MapField.class, this);
+        actions = new ActionFactory(this);
 
         JPanel buttons = new JPanel(new FlowLayout());
 
@@ -73,9 +74,9 @@
         JScrollPane scroll = new JScrollPane();
         scroll.setViewportView(table);
 
-        buttons.add(new JButton(actions.getAction(ADD)));
-        buttons.add(new JButton(actions.getAction(REMOVE)));
-        buttons.add(new JButton(actions.getAction(UPDATE)));
+        buttons.add(new JButton(actions.addAction("Add", CWMsg.gettext("Add"))));
+        buttons.add(new JButton(actions.addAction("Remove", CWMsg.gettext("Remove"))));
+        buttons.add(new JButton(actions.addAction("Update", CWMsg.gettext("Update"))));
 
         Border title = BorderFactory.createTitledBorder(LimboMsg.COMPONENT_EDITOR.toString());
         Border pad = BorderFactory.createEmptyBorder(5, 5, 5, 5);

Modified: trunk/jsword-limbo/src/main/java/org/crosswire/common/config/swing/WizardConfigEditor.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/common/config/swing/WizardConfigEditor.java	2011-03-05 20:36:55 UTC (rev 2088)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/common/config/swing/WizardConfigEditor.java	2011-03-05 22:30:08 UTC (rev 2089)
@@ -52,6 +52,7 @@
 import org.crosswire.common.swing.EdgeBorder;
 import org.crosswire.common.swing.FormPane;
 import org.crosswire.common.swing.GuiUtil;
+import org.crosswire.common.swing.CWMsg;
 import org.crosswire.common.util.Logger;
 
 /**
@@ -76,14 +77,14 @@
      * 
      */
     public WizardConfigEditor() {
-        actions = new ActionFactory(WizardConfigEditor.class, this);
+        actions = new ActionFactory(this);
 
         names = new ArrayList();
         layout = new CardLayout();
         deck = new JPanel(layout);
 
         // I18N(DMS)
-        title = new JLabel(UserMsg.gettext("Preferences"), SwingConstants.LEADING);
+        title = new JLabel(CWMsg.gettext("Preferences"), SwingConstants.LEADING);
         title.setIcon(TASK_ICON_LARGE);
         title.setFont(getFont().deriveFont(Font.PLAIN, 16));
         title.setPreferredSize(new Dimension(30, 30));
@@ -168,21 +169,26 @@
      */
     private JComponent getButtonPane() {
 
-        finish = new JButton(actions.getAction(FINISH));
-        next = new JButton(actions.getAction(NEXT));
+        // FIXME(DMS)
+        finish = new JButton(actions.addAction(FINISH));
+        // FIXME(DMS)
+        next = new JButton(actions.addAction(NEXT));
 
         JPanel buttons = new JPanel();
 
         buttons.setLayout(new GridLayout(1, 2, 10, 10));
         buttons.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
-        buttons.add(new JButton(actions.getAction(HELP)));
-        buttons.add(new JButton(actions.getAction(CANCEL)));
-        buttons.add(new JButton(actions.getAction(BACK)));
+        // FIXME(DMS)
+        buttons.add(new JButton(actions.addAction(HELP)));
+        // FIXME(DMS)
+        buttons.add(new JButton(actions.addAction(CANCEL)));
+        // FIXME(DMS)
+        buttons.add(new JButton(actions.addAction(BACK)));
         buttons.add(next);
         buttons.add(finish);
 
-        actions.getAction(HELP).setEnabled(false);
-        actions.getAction(BACK).setEnabled(false);
+        actions.findAction(HELP).setEnabled(false);
+        actions.findAction(BACK).setEnabled(false);
 
         JPanel retcode = new JPanel(new BorderLayout(10, 10));
 
@@ -231,8 +237,8 @@
                 Integer.valueOf(posn + 1), Integer.valueOf(wcards)
         }));
 
-        actions.getAction(BACK).setEnabled(posn != 0);
-        actions.getAction(NEXT).setEnabled(posn != (wcards - 1));
+        actions.findAction(BACK).setEnabled(posn != 0);
+        actions.findAction(NEXT).setEnabled(posn != (wcards - 1));
 
         if (posn == wcards - 1) {
             dialog.getRootPane().setDefaultButton(finish);
@@ -279,7 +285,7 @@
      * @throws ClassNotFoundException
      */
     private void readObject(ObjectInputStream is) throws IOException, ClassNotFoundException {
-        actions = new ActionFactory(WizardConfigEditor.class, this);
+        actions = new ActionFactory(this);
         is.defaultReadObject();
     }
 

Modified: trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/DocumentWriter.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/DocumentWriter.java	2011-03-05 20:36:55 UTC (rev 2088)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/common/swing/DocumentWriter.java	2011-03-05 22:30:08 UTC (rev 2089)
@@ -76,7 +76,7 @@
             // exception whilst not ideal seems like the best option.
         }
 
-        synchronized (lock) {
+        synchronized (lck) {
             this.doc = doc;
         }
     }
@@ -88,7 +88,7 @@
      */
     @Override
     public void write(char[] cbuf, int off, int len) {
-        synchronized (lock) {
+        synchronized (lck) {
             queue = queue + new String(cbuf, off, len);
             update();
         }
@@ -101,7 +101,7 @@
      */
     @Override
     public void write(int c) {
-        synchronized (lock) {
+        synchronized (lck) {
             queue = queue + (char) c;
             update();
         }
@@ -114,7 +114,7 @@
      */
     @Override
     public void write(char[] cbuf) {
-        synchronized (lock) {
+        synchronized (lck) {
             queue = queue + new String(cbuf);
             update();
         }
@@ -127,7 +127,7 @@
      */
     @Override
     public void write(String str) {
-        synchronized (lock) {
+        synchronized (lck) {
             queue = queue + str;
             update();
         }
@@ -140,7 +140,7 @@
      */
     @Override
     public void write(String str, int off, int len) {
-        synchronized (lock) {
+        synchronized (lck) {
             queue = queue + str.substring(off, off + len);
             update();
         }
@@ -193,7 +193,7 @@
     /**
      * The object to lock on to read or write the queue or the updater
      */
-    protected Object lock = new Object();
+    protected Object lck = new Object();
 
     /**
      * The queue of strings to be added to the GUI
@@ -220,7 +220,7 @@
      */
     class Updater implements Runnable {
         public void run() {
-            synchronized (lock) {
+            synchronized (lck) {
                 try {
                     doc.insertString(doc.getLength(), queue, null);
 




More information about the jsword-svn mailing list