From: gilleain t. <gil...@gm...> - 2009-02-21 20:03:38
|
Hi, I'm working on it! The problem has been that swing-jchempaint users (or, Stefan and Christoph) want the natural scale to be the default, and bioclipse-jchempaint users (or, Ola and Jonathan) want fit -to-screen to be the default. I am trying to satisfy two diametrically opposed demands, and sometimes things get lost. To summarise my current (and final!) thinking: 1) If editing while fit-to-screen (bioclipse style), adding things or moving things will cause things to shrink. 2) If editing while NOT fit-to-screen (swing style) then scrollbars are necessary. Rajarshi has a third use-case, which is painting on a frame that can resize. This is essentially fit-to-screen, and should work as he expects (no cutoff by the edges, and the margin in the RenderModel should be respected). I really hope that this will be my final word on this, as I don't like changing things for everyone else, but if I don't get it right now, it will be a bug nest forever, I fear. As of today, I am trying to get the renderer to have two sets of methods (where T stand for a ChemObject): public Rectangle2D paintT(T chemObject, IDrawVisitor visitor, boolean reset); public void paintT(T chemObject, IDrawVisitor visitor, Rectangle2D screenBounds, boolean reset); I'm not actually using generics, I'm just saving typing. The first set of methods will paint at the scale determined by the bond length only, while the second set uses the supplied screen bounds to calculate the zoom factor that will fit to screen. One highly desired feature seems to be that when moving an atom, other atoms should not move around too. This means not re-calculating the scale on each repaint. Any call to a paint method with reset=true will cause the scale to be recalculated (such as when resizing a non-editable image when fitToScreen=true). I am sorry that the code is still volatile, but I still believe that both jchempaints benefit from sharing this core as improvements to one benefit both. gilleain On Sat, Feb 21, 2009 at 7:43 PM, Rajarshi Guha <rg...@in...> wrote: > > On Feb 21, 2009, at 2:40 PM, Egon Willighagen wrote: > >> On Sat, Feb 21, 2009 at 8:37 PM, Rajarshi Guha <rg...@in...> >> wrote: >>> Hi, has there been any changes in the jcp code (as of today) that >>> might cause a problem with a depiction going of the edges of a >>> JPanel? The same depiction code that I had before now displays a >>> structure with the top and bottom slightly cut off when resizing >>> vertically and the left and right when resizing horizontally >> >> In editing mode 'fit-to-screen' is not the best... I think that the >> default value for 'fit-to-screen' has been set to false now... can you >> try setting that to true, for your rendering app? Does that solve the >> problem? > > yes, fit to screen is true (and the zoom factor is 0) > > ------------------------------------------------------------------- > Rajarshi Guha <rg...@in...> > GPG Fingerprint: D070 5427 CC5B 7938 929C DD13 66A1 922C 51E7 9E84 > ------------------------------------------------------------------- > How I wish I were what I was when I wished I were what I am. > > > > ------------------------------------------------------------------------------ > Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA > -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise > -Strategies to boost innovation and cut costs with open source participation > -Receive a $600 discount off the registration fee with the source code: SFAD > http://p.sf.net/sfu/XcvMzF8H > _______________________________________________ > Cdk-jchempaint mailing list > Cdk...@li... > https://lists.sourceforge.net/lists/listinfo/cdk-jchempaint > |