[jsword-devel] SwordBookMetaData

DM Smith jsword-devel@crosswire.org
Sun, 28 Mar 2004 17:31:07 -0500


This is a multi-part message in MIME format.

------=_NextPart_000_207e_2745_7aab
Content-Type: text/plain; format=flowed

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/

------=_NextPart_000_207e_2745_7aab
Content-Type: application/x-zip-compressed; name="patchmap.zip"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="patchmap.zip"

UEsDBBQAAAAIAH2HfDAcuBvM0hYAALFgAAAMAAAAcGF0Y2htYXAudHh07Tz7
c9tGzj8nM/4ftr6bWo5k6u34mcbxo1Xq11j2l+m0nQ4lriQmFKkjKSu+nv/3
A7DL5fJpOmnvbr4px2OTXACLxQJYLLD0wLX45z320bw3m2NvPvfcpudPm2Pf
C4KV7fPoJTy40+aFubg1Rw6/8CzuGIi09vLw66+1lz4PfZvfQx/Mhz+B7bms
bWyvvbTsyYRtLdmWD48sr/+tra0vZ/9Ft8UuvXvWabW6rL2719/Z67TZVguu
F9R/vV7/CuqdHWDZR+o91unstbp77a6gvvby7Vu21e50Gjusjn9es7dv114y
/fo99YyXHRou/xzWNvdTjY8gCfjRX4FQl76bQKmXtRuhN4RpcKdJ6o/a/dgM
xzNWO/085osQJ4l/3tSageOBplAfg5XnWymZyZcjz/vUfAe/Lnhonpih+eer
U7uf1Kd2n+UwoPTp+dy/2GVnfKSmu/d6rxsrE/autOkLaGd1qdPSdakHKlTv
RXpkzxeeH1JnRgizawAhfub5czPcz2sewhuHFwMtQ9shGtCwlWm49r0F90Ob
B6hjmWawDKQHP81Xr1BdXrGjhOhhlhY+D7gbBsxkcx7OPIt5Exb6phs4ZogT
Gc44e2eDfRnsyHEIPWArO5xJU3qNNlQXf2JTesVuZ3YQkYQ7iwf21OUWCz0W
LBfE6cR2LezCW4Zs7vmcmSO8NRlORUzJN4EHHxgxXWYio2PvHkYd86tAm9IS
F8uRY49ZLB425WH8FJukBARB5UAwSVcKLxoWZ8Pr09OT314BH24Qmii8YMHH
9uSBzbwVm5gBjgEFxWh25yBfk6zWDoxnWurIDOxx84RPzKUT/mfNtpe02h4r
5qK67ZaPp9SQe8+x4yf6yTHqdtKot9God7JG7fLQuLs5zzXma9MPuPLRZaac
tdVz2/3ErR/MYCasttCay50AiyFAOIYSjiGWTIEhVps7uN2XRry7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