I've been working on a simple java spreadsheet component. Its only got basic functionality and does not intend to be used in an actual spreadsheet application at this stage. I have released an extension of JTable with has some spreadsheet facilities as an open source project http://jeppers.sourceforge.net however I am currently working on a new implementation that extends JComponent (from scratch in other words). Currently it has the following features: * Setting of foreground color, background color, horizontal alignment, vertical alignment, formatting of text, and cell borders on an individual cell basis. * Merging/Unmerging of cells * Editors and renderers on a per cell basis * Basic Formulas The problem I am having is inserting/removing of rows and columns. This is due to having multiple models that the component (JGrid) uses. And it makes use of the JavaBean Event Model (Observer pattern). Refer to the Overview.gif attachment. The reason for this problem is that I can not guarantee that all models support the same number of rows and columns before repainting. Refer to "paint sequence.png". With the JavaBeans event model, the order of notification is implementation defined, therefore I cannot know when to repaint without requiring user invention. Anyway, the purpose of this email is to find out how the painting of the cells in gnumeric is handled. In particular the painting of spanned cells. I've download the source code, but I'm a bit lost by it all. If you could point my in the right direction it would be appreciated. Thanks. Cameron Zemek.
Attachment:
Overview.gif
Description: GIF image
Attachment:
paint sequence.png
Description: PNG image