[jsword-devel] SwordBookMetaData

DM Smith jsword-devel@crosswire.org
Sun, 28 Mar 2004 22:41:06 -0500


The patch has a fatal bug. Dumb last minute change. I will fix and resend.

>From: "DM Smith" <dmsmith555@hotmail.com>
>Reply-To: jsword-devel@crosswire.org
>To: jsword-devel@crosswire.org
>Subject: RE: [jsword-devel] SwordBookMetaData
>Date: Sun, 28 Mar 2004 17:31:07 -0500
>
>Attached is a patch for BookMetaData and its display.
>Here is a summary of the changes I made:
>MapTableModel returns a string of the object held in the iterator. This 
>allows it to be used by any map and not just Properties.
>
>BookMetaData used to return Properties from getProperties. Now it returns 
>Map. Perhaps the named should be changed as well.
>
>SwordBookMetadata:
>When a line ended with \, I concatenated the next line with \n as a 
>separator. I added the method getContinuation as a helper.
>
>When creating the props map, which has strings for values, I use \n to 
>separate elements in the list.
>
>Changed props from a Properties to a LinkedHashMap. This required changing 
>from setProperty to put.
>
>In parseLine, I trimed the value. (The key was already trimmed.)
>
>There is still an opportunity to eliminate duplicate input lines. But that 
>probably should be a cleanup in the input.
>
>Modified getFullName to output parts only if they existed. This eliminated 
>the trailing ','.
>
>Removed BOOK and DRIVER from the props since they were objects and not 
>strings. Nothing was using it. They could be added back in as strings.
>
>Changed "table" from a HashMap to a LinkedHashMap to preserve the input 
>order. This allows for save to lossless wrt order.
>
>To DefaultBookMetaData
>The properties member variable was used to store both strings and objects 
>for the same key. I changed it that it only stored strings. For each pair 
>of set functions setX(Object x) and setX(String x), I made the second call 
>the first and the first set the member variable and stored the field in the 
>map.
>
>I changed getFullName to be the same as for SwordBookMetaData.
>
>I changed props from a Properties to a LinkedHashMap to preserve insertion 
>order.
>
>I added two new classes: MapTable and MapCellRenderer. The MapTable works 
>with a MapTableModel to present multiline data in rows that are tall enough 
>to show the entire contents. The MapCellRenderer differs from the 
>DefaultTableCellRenderer in that it uses a JTextArea to render text instead 
>of a JLabel. This allows for it to render html, if we ever decide to go 
>there. JLabel's support for html is really weak. I set it up to wrap text 
>if the column is too narrow.
>
>I modified SitePane to use MapTable rather than JTable. It might make sense 
>to use it where ever MapTableModel is used. I only used it here.
>
>_________________________________________________________________
>Free up your inbox with MSN Hotmail Extra Storage. Multiple plans 
>available. 
>http://join.msn.com/?pgmarket=en-us&page=hotmail/es2&ST=1/go/onm00200362ave/direct/01/
><< patchmap.zip >>

_________________________________________________________________
Free up your inbox with MSN Hotmail Extra Storage. Multiple plans available. 
http://join.msn.com/?pgmarket=en-us&page=hotmail/es2&ST=1/go/onm00200362ave/direct/01/