From: Mark G. <mg...@us...> - 2002-04-26 23:39:47
|
Update of /cvsroot/gmod/apollo/src/java/apollo/gui In directory usw-pr-cvs1:/tmp/cvs-serv24253 Modified Files: Tag: sanger_branch StrandedZoomableApolloPanel.java Log Message: Fixed bug where new file loaded would show previous files zoom factor if the previous file was zoomed in. Index: StrandedZoomableApolloPanel.java =================================================================== RCS file: /cvsroot/gmod/apollo/src/java/apollo/gui/StrandedZoomableApolloPanel.java,v retrieving revision 1.90.2.58 retrieving revision 1.90.2.59 diff -C2 -d -r1.90.2.58 -r1.90.2.59 *** StrandedZoomableApolloPanel.java 24 Apr 2002 00:54:12 -0000 1.90.2.58 --- StrandedZoomableApolloPanel.java 26 Apr 2002 23:39:44 -0000 1.90.2.59 *************** *** 278,284 **** // true means force an update even if there isn't a change updateSiteVisibility(true); ! //afp.doLayout(); ! // nomis addition ! setZoomFactor(1.0); --- 278,284 ---- // true means force an update even if there isn't a change updateSiteVisibility(true); ! // set zoom factor, ! // boolean true means force zoom factor through without testing bounds ! setZoomFactor(1.0,true); *************** *** 1221,1228 **** } ! ! public void setZoomFactor(double factor) { ! if (((double)afp.getLinearVisibleWidth()*xscale/factor > 2.0 ) && ! ((double)afp.getLinearVisibleWidth()*xscale/factor < 1000000000.0)) { xscale = factor; afp.setZoomFactor(xscale,-1.0); --- 1221,1234 ---- } ! /** boolean force means force in the new factor and dont test it ! * against the limits. This is necasary when initially bringing up a new ! * curation set, the factor is being set to 1 which we know is ok, and the ! * xscale is from the old set which the width is from the new so if we do ! * test it at this point it falsely fails and thus the force ! */ ! private void setZoomFactor(double factor,boolean force) { ! double newDesiredWidth = (double)afp.getLinearVisibleWidth()*xscale/factor; ! // If we are forcing the zoom OR the zoom is between 2 and a billion do the zoom ! if ( force || ( (newDesiredWidth > 2.0 ) && (newDesiredWidth < 1000000000.0) ) ) { xscale = factor; afp.setZoomFactor(xscale,-1.0); *************** *** 1238,1243 **** zoomLabel.setText("Zoom factor = "+new Format("%6.4f").form(xscale)); } ! public double getZoomFactor() { return xscale; } --- 1244,1252 ---- zoomLabel.setText("Zoom factor = "+new Format("%6.4f").form(xscale)); } + private void setZoomFactor(double factor) { + setZoomFactor(factor,false); + } ! private double getZoomFactor() { return xscale; } |