From: Egon W. <ego...@gm...> - 2010-02-15 16:14:04
|
On Mon, Feb 15, 2010 at 4:54 PM, gilleain torrance <gil...@gm...> wrote: > There is 'scaleToFit' which is a boolean property of the Renderer. If > true, the diagram is scaled to fit the screen; if false, it is scaled > according to the current bond length and zoom. There is no such thing > as zooming on a scaled-to-fit diagram Why not? Scale-to-fit means to me that the whole molecule (etc) should fit the diagram when the zoom = 1.0 ... > - a border can be set, which has > much the same effect since a border of 10 on a screen of size 100x100 > is the same as zooming by 0.9. > > The renderer is designed to do (at least) two different things. > Firstly, to draw diagrams with a 'natural' bond length on a scrolled > canvas. Secondly, to draw diagrams with a scaled bond length on a > fixed size canvas. The first is jchempaint, while the second seems to > be what Konstantin wants. > > It so happens that the JCP application also requires the molecule to > be zoomed until it fits the screen. The term 'zoom' was used in the past JChemPaint for something does not not refer to details in the world to screen coordinate transition, but merely if the user wants to 'zoom' in in part of the molecule... > This is most certainly zoom and > not scale, as the zoom factor is set in the model, and the status bar > is updated (thanks to Stefan's code) to indicate this. The scale factor is also set in the model... The scrollbar stuff complicated it a bit more... > To a degree, this is explained in the class comments. Or perhaps just > hinted at. There is also some explanation and use cases on the wiki, > in the renderer tutorial. Since these things are possibly not clear > enough, I will fix them instead of 'fixing' the code, which I do not > believe is broken... There might simply be a confusion over terminology... Let's try to get these terms synchronized... I'll read up on the tutorials... > That said, it is only through use-cases like this that the code is > improved, and the more people using the rendering for different > things, the better it should get. Also, the opposing functions do make > for complex code, so I certainly don't think that there are no bugs. Indeed. I'm happy to see this get noticed now, and not after the patch is done... >> This is the git repository with the JChemPaint code used by Bioclipse... >> >> git clone http://pele.farmbio.uu.se/git/cdk-jchempaint.git > > I may be doing it wrong, but this only gives me a cdk checkout, with > no new renderer or controller packages. Do patches then have to be > applied on top? Right... I keep forgetting to mention that one should not look a the 'master' branch, but at 13-unsorted-patches branch, or one of the cdk-jchempaint-X tags... so, after the 'git clone' do one of the following two: git checkout -b cdk-jchempaint cdk-jchempaint-5 or git checkout -b cdk-jchempaint 13-unsorted-patches Egon -- Post-doc @ Uppsala University Proteochemometrics / Bioclipse Group of Prof. Jarl Wikberg Homepage: http://egonw.github.com/ Blog: http://chem-bla-ics.blogspot.com/ PubList: http://www.citeulike.org/user/egonw/tag/papers |