[jsword-svn] r1005 - in trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop: desktop journal

dmsmith at crosswire.org dmsmith at crosswire.org
Wed Feb 15 07:56:59 MST 2006


Author: dmsmith
Date: 2006-02-15 07:56:51 -0700 (Wed, 15 Feb 2006)
New Revision: 1005

Modified:
   trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/Desktop.java
   trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/journal/BlogClientFrame.java
   trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/journal/BlogClientPanel.java
   trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/journal/BlogEntriesPanel.java
   trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/journal/BlogEntriesTableModel.java
Log:
Applied Journaling patch

Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/Desktop.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/Desktop.java	2006-02-14 21:26:27 UTC (rev 1004)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/Desktop.java	2006-02-15 14:56:51 UTC (rev 1005)
@@ -62,6 +62,7 @@
 import org.crosswire.bibledesktop.display.URLEvent;
 import org.crosswire.bibledesktop.display.URLEventListener;
 import org.crosswire.bibledesktop.journal.BlogClientFrame;
+import org.crosswire.bibledesktop.signal.ResizeJournalSignal;
 import org.crosswire.bibledesktop.util.ConfigurableSwingConverter;
 import org.crosswire.common.config.ChoiceFactory;
 import org.crosswire.common.config.Config;
@@ -317,6 +318,14 @@
         setEnabled(true);
         setTitle(Msg.getApplicationTitle());
     }
+    
+    /**
+     * Cause the Journal to reset itself to preferred size
+     */
+    public void channel(ResizeJournalSignal signal)
+    {
+        sptBlog.resetToPreferredSizes();
+    }
 
     private JMenuBar createMenuBar(ToolBar toolbar)
     {

Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/journal/BlogClientFrame.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/journal/BlogClientFrame.java	2006-02-14 21:26:27 UTC (rev 1004)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/journal/BlogClientFrame.java	2006-02-15 14:56:51 UTC (rev 1005)
@@ -317,7 +317,7 @@
         }
     }
 
-    private void setEnabledRecursive(final Container cont, final boolean enabled)
+    void setEnabledRecursive(final Container cont, final boolean enabled)
     {
         cont.setEnabled(enabled);
 
@@ -338,6 +338,7 @@
     private static BlogType type = BlogType.META_WEBLOG;
 
     private static final BlogClientFrame SELF = new BlogClientFrame();
+    private static final long serialVersionUID = 1L;
 
     private GriddedPanel disconnectedPanel;
     private Component curPanel;

Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/journal/BlogClientPanel.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/journal/BlogClientPanel.java	2006-02-14 21:26:27 UTC (rev 1004)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/journal/BlogClientPanel.java	2006-02-15 14:56:51 UTC (rev 1005)
@@ -48,7 +48,10 @@
  */
 public class BlogClientPanel extends JPanel implements BlogClientTab
 {
-    /** Creates new form BlogClientPanel */
+
+    /**
+     * Creates new form BlogClientPanel
+     */
     public BlogClientPanel()
     {
         initComponents();
@@ -57,7 +60,9 @@
         ReflectionBus.plug(this);
     }
 
-    /** Inject BlogSite dependency.*/
+    /**
+     * Inject BlogSite dependency.
+     */
     public void setBlog(Blog blogSite)
     {
         this.blogSite = blogSite;
@@ -92,7 +97,9 @@
         }
     }
 
-    /** Load blog entry into form */
+    /**
+     * Load blog entry into form
+     */
     public void loadEntry(String id)
     {
         try
@@ -141,7 +148,9 @@
         }
     }
 
-    /** Publish entry to blog */
+    /**
+     * Publish entry to blog
+     */
     public void publishButtonPressed()
     {
         try
@@ -154,19 +163,25 @@
         }
     }
 
-    /** Save entry to blog as draft */
+    /**
+     * Save entry to blog as draft
+     */
     public void draftButtonPressed()
     {
         postEntry(false);
     }
 
-    /** New button was pressed to start new entry */
+    /**
+     * New button was pressed to start new entry
+     */
     public void newButtonPressed()
     {
         reset();
     }
 
-    /** Delete current entry */
+    /**
+     * Delete current entry
+     */
     public void deleteButtonPressed()
     {
         if (entry != null)
@@ -184,7 +199,9 @@
         }
     }
 
-    /** Upload image and add <img> tag to blog entry */
+    /**
+     * Upload image and add <img> tag to blog entry
+     */
     public void uploadButtonPressed()
     {
         JFileChooser chooser = new JFileChooser();
@@ -208,7 +225,9 @@
         }
     }
 
-    /** New button was pressed to start new entry */
+    /**
+     * New button was pressed to start new entry
+     */
     public void reset()
     {
         entry = null;
@@ -220,13 +239,17 @@
         editorPanel.setDocumentText(EMPTY_STRING);
     }
 
-    /** Called by tabbed container */
+    /**
+     * Called by tabbed container
+     */
     public void onSelected()
     {
         // nothing to do
     }
 
-    /** Post entry to blog */
+    /**
+     * Post entry to blog
+     */
     public void postEntry(boolean publish)
     {
         try
@@ -267,33 +290,24 @@
         }
     }
 
-    /** This method is called from within the constructor to
+    /**
+     * This method is called from within the constructor to
      * initialize the form.
-     * WARNING: Do NOT modify this code. The content of this method is
-     * always regenerated by the Form Editor.
      */
-    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
-    /**
-     * 
-     */
     private void initComponents()
     {
-        //      GEN-BEGIN:initComponents
         mTitleField = new javax.swing.JTextField();
         mTitleLabel = new javax.swing.JLabel();
         mCategoryLabel = new javax.swing.JLabel();
         mCategoryCombo = new javax.swing.JComboBox();
-        mScrollPane = new javax.swing.JScrollPane();
         //mTextArea = new javax.swing.JTextArea();
         mPublishButton = new javax.swing.JButton();
         mNewButton = new javax.swing.JButton();
         mDraftButton = new javax.swing.JButton();
-        mPubDateLabel = new javax.swing.JLabel();
-        mUpdateDateLabel = new javax.swing.JLabel();
         mPubDateField = new javax.swing.JLabel();
         mUpdateDateField = new javax.swing.JLabel();
         mDeleteButton = new javax.swing.JButton();
-        mUploadImage = new javax.swing.JButton();
+        //mUploadImage = new javax.swing.JButton();
 
         propsPanel = new GriddedPanel();
 
@@ -360,7 +374,7 @@
         {
             public void actionPerformed(java.awt.event.ActionEvent evt)
             {
-                mPublishButtonActionPerformed(evt);
+                publishButtonPressed();
             }
         });
         buttonsPanel.add(mPublishButton);
@@ -370,7 +384,7 @@
         {
             public void actionPerformed(java.awt.event.ActionEvent evt)
             {
-                mNewButtonActionPerformed(evt);
+                newButtonPressed();
             }
         });
 
@@ -381,7 +395,7 @@
         {
             public void actionPerformed(java.awt.event.ActionEvent evt)
             {
-                mDraftButtonActionPerformed(evt);
+                draftButtonPressed();
             }
         });
 
@@ -392,7 +406,7 @@
         {
             public void actionPerformed(java.awt.event.ActionEvent evt)
             {
-                mDeleteButtonActionPerformed(evt);
+                deleteButtonPressed();
             }
         });
 
@@ -402,7 +416,7 @@
          mUploadImage.setText("Upload Image...");
          mUploadImage.addActionListener(new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
-         mUploadImageActionPerformed(evt);
+         uploadButtonPressed();
          }
          });
          */
@@ -414,58 +428,28 @@
         add(btnPanel, BorderLayout.EAST);
     }
 
-    // </editor-fold>//GEN-END:initComponents
 
-    private void mDeleteButtonActionPerformed(java.awt.event.ActionEvent evt)
-    { //GEN-FIRST:event_mDeleteButtonActionPerformed
-        deleteButtonPressed();
-    } //GEN-LAST:event_mDeleteButtonActionPerformed
-
-    private void mUploadImageActionPerformed(java.awt.event.ActionEvent evt)
-    { //GEN-FIRST:event_mUploadImageActionPerformed
-        uploadButtonPressed();
-    } //GEN-LAST:event_mUploadImageActionPerformed
-
-    private void mNewButtonActionPerformed(java.awt.event.ActionEvent evt)
-    { //GEN-FIRST:event_mNewButtonActionPerformed
-        newButtonPressed();
-    } //GEN-LAST:event_mNewButtonActionPerformed
-
-    private void mDraftButtonActionPerformed(java.awt.event.ActionEvent evt)
-    { //GEN-FIRST:event_mDraftButtonActionPerformed
-        draftButtonPressed();
-    } //GEN-LAST:event_mDraftButtonActionPerformed
-
-    private void mPublishButtonActionPerformed(java.awt.event.ActionEvent evt)
-    { //GEN-FIRST:event_mPublishButtonActionPerformed
-        publishButtonPressed();
-    } //GEN-LAST:event_mPublishButtonActionPerformed
-
     public static final String EMPTY_STRING = ""; //$NON-NLS-1$
     private Blog blogSite;
     private BlogEntry entry;
     private Window window;
 
-    // Variables declaration - do not modify//GEN-BEGIN:variables
     private javax.swing.JLabel mCategoryLabel;
-    private javax.swing.JScrollPane mCategoryListScroll;
     private javax.swing.JButton mDeleteButton;
     private javax.swing.JButton mDraftButton;
     private javax.swing.JButton mNewButton;
     private javax.swing.JLabel mPubDateField;
-    private javax.swing.JLabel mPubDateLabel;
     private javax.swing.JButton mPublishButton;
-    private javax.swing.JScrollPane mScrollPane;
     //private javax.swing.JTextArea mTextArea;
     private javax.swing.JTextField mTitleField;
     private javax.swing.JLabel mTitleLabel;
     private javax.swing.JLabel mUpdateDateField;
-    private javax.swing.JLabel mUpdateDateLabel;
-    private javax.swing.JButton mUploadImage;
+    //private javax.swing.JButton mUploadImage;
     private javax.swing.JComboBox mCategoryCombo;
     private KafenioPanel editorPanel;
     private GriddedPanel propsPanel;
     private JPanel textPanel;
     private JPanel buttonsPanel;
-    // End of variables declaration//GEN-END:variables
+    
+    private static final long serialVersionUID = 1L;
 }

Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/journal/BlogEntriesPanel.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/journal/BlogEntriesPanel.java	2006-02-14 21:26:27 UTC (rev 1004)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/journal/BlogEntriesPanel.java	2006-02-15 14:56:51 UTC (rev 1005)
@@ -15,11 +15,18 @@
  */
 package org.crosswire.bibledesktop.journal;
 
+import java.awt.BorderLayout;
+import java.awt.Insets;
 import java.awt.event.MouseAdapter;
 import java.awt.event.MouseEvent;
 
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTable;
 import javax.swing.ScrollPaneConstants;
+import javax.swing.border.EmptyBorder;
 import javax.swing.table.AbstractTableModel;
+import javax.swing.table.DefaultTableModel;
 import javax.swing.table.TableModel;
 
 import org.crosswire.bibledesktop.signal.LoadEntrySignal;
@@ -31,9 +38,11 @@
  * Panel with table that lists recent blog entries.
  * @author David M Johnson
  */
-public class BlogEntriesPanel extends javax.swing.JPanel implements BlogClientTab
+public class BlogEntriesPanel extends JPanel implements BlogClientTab
 {
-    /** Creates new form BlogEntriesPanel */
+    /**
+     * Creates new form BlogEntriesPanel
+     */
     public BlogEntriesPanel()
     {
         initComponents();
@@ -52,23 +61,21 @@
         });
     }
 
-    /** This method is called from within the constructor to
+    /**
+     * This method is called from within the constructor to
      * initialize the form.
-     * WARNING: Do NOT modify this code. The content of this method is
-     * always regenerated by the Form Editor.
      */
-    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
     private void initComponents()
     {
-        mScrollPane = new javax.swing.JScrollPane();
-        mBlogEntries = new javax.swing.JTable();
+        mScrollPane = new JScrollPane();
+        mBlogEntries = new JTable();
 
-        setLayout(new java.awt.BorderLayout());
+        setLayout(new BorderLayout());
 
-        setBorder(new javax.swing.border.EmptyBorder(new java.awt.Insets(10, 10, 10, 10)));
+        setBorder(new EmptyBorder(new Insets(10, 10, 10, 10)));
         mScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
         mScrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
-        mBlogEntries.setModel(new javax.swing.table.DefaultTableModel(
+        mBlogEntries.setModel(new DefaultTableModel(
             new Object [][] {
                 {null, null, null, null},
                 {null, null, null, null},
@@ -84,18 +91,21 @@
         ));
         mScrollPane.setViewportView(mBlogEntries);
 
-        add(mScrollPane, java.awt.BorderLayout.NORTH);
+        add(mScrollPane, BorderLayout.NORTH);
     }
-    // </editor-fold>//GEN-END:initComponents
 
-    /** Inject BlogSite dependency. */
+    /**
+     * Inject BlogSite dependency.
+     */
     public void setBlog(Blog blogSite)
     {
         this.blogSite = blogSite;
         reset();
     }
 
-    /** Update table of blog entries. */
+    /**
+     * Update table of blog entries.
+     */
     public void onSelected()
     {
         reset();
@@ -108,15 +118,14 @@
         model.fireTableDataChanged();
     }
 
-    // Variables declaration - do not modify//GEN-BEGIN:variables
-    private javax.swing.JTable mBlogEntries;
-    private javax.swing.JScrollPane mScrollPane;
-    // End of variables declaration//GEN-END:variables
+    JTable mBlogEntries;
+    private JScrollPane mScrollPane;
 
-    private Blog blogSite;
+    Blog blogSite;
     public static final int TITLE_COLUMN = 0;
     public static final int DATE_COLUMN = 1;
     public static final int ID_COLUMN = 2;
     public static final int COLUMN_COUNT = 3;
 
+    private static final long serialVersionUID = 1L;
 }

Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/journal/BlogEntriesTableModel.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/journal/BlogEntriesTableModel.java	2006-02-14 21:26:27 UTC (rev 1004)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/journal/BlogEntriesTableModel.java	2006-02-15 14:56:51 UTC (rev 1005)
@@ -87,4 +87,6 @@
     }
 
     private List entries = new ArrayList();
+
+    private static final long serialVersionUID = 1L;
 }



More information about the jsword-svn mailing list