setCanvasLocation(image.getWidth()+2*BrowserUI.TOP_LEFT_IMAGE, image.getHeight()+2*BrowserUI.TOP_LEFT_IMAGE);
System.out.println(model.getPixelsSizeX());
    public void paintComponent(Graphics g)    {        super.paintComponent(g);        Graphics2D g2D = (Graphics2D) g;        g2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING,                            RenderingHints.VALUE_ANTIALIAS_ON);        g2D.setRenderingHint(RenderingHints.KEY_RENDERING,                            RenderingHints.VALUE_RENDER_QUALITY);        g2D.setRenderingHint(RenderingHints.KEY_INTERPOLATION,                            RenderingHints.VALUE_INTERPOLATION_BILINEAR);        BufferedImage image = model.getDisplayedImage();        if (image == null) return;        paintXYFrame(g2D);        setCanvasLocation(image.getWidth()+2*BrowserUI.TOP_LEFT_IMAGE,                            image.getHeight()+2*BrowserUI.TOP_LEFT_IMAGE);        double v = 1;//model.getPixelsSizeX()/model.getZoomFactor();        if (v > 0) {            int h = image.getHeight()+3*BrowserUI.TOP_LEFT_IMAGE/2;            paintScaleBar(g2D, BrowserUI.TOP_LEFT_IMAGE, h, 2*LENGTH,                       ""+(int) v+NANOMETER);        }        g2D.drawImage(image, null, BrowserUI.TOP_LEFT_IMAGE,                        BrowserUI.TOP_LEFT_IMAGE);      }