Hi,

  I have duplicated a problem in OJ with selection feedback.  When a large
vector dataset is loaded, and mouse wheel zoom is used to zoom out,
selection feedback stops working for a while.  Note that the selection
mechanism is still working as verified by the status panel, but items do not
highlight in yellow.  After a while, selection feedback starts working
again.  This problem does not exist in SkyJUMP so it is probably due to
differences in the RenderManager.

The mouse wheel modification  (shown below) uses a timer to ensure that the
view is redrawn after 700 ms.  To prevent it from happening until that time,
the RenderManager's setPaintingEnabled(false) method is used.  In the
Timer's actionPerformed method, it is set back to true and a repaintPanel is
used to update the view.  In SkyJUMP, the RenderManager itself has been
modified to do this.  It may be necessary to modify RenderManager in OJ to
avoid this problem.  I will look for a workaround first.

Here is the old method of handling mouse wheel moved:

    public void mouseWheelMoved(MouseWheelEvent e) {
        int nclicks = e.getWheelRotation();  //negative is up/away
        try {
            double zoomFactor = (nclicks > 0)
                ? (1 / (Math.abs(nclicks)*WHEEL_ZOOM_IN_FACTOR)) :
                    (Math.abs(nclicks)*WHEEL_ZOOM_IN_FACTOR);
            zoomAt(e.getPoint(), zoomFactor, false);
        } catch (Throwable t) {
            getPanel().getContext().handleThrowable(t);
        }
    }

Here is the new method:

public void mouseWheelMoved(MouseWheelEvent e) {
    int nclicks = e.getWheelRotation();  //negative is up/away
    mouseWheelCount = mouseWheelCount + nclicks;
    if (mouseWheelCount == 0)
        scale = 1d;
    else if (mouseWheelCount < 0)
        scale = Math.abs(mouseWheelCount)*WHEEL_ZOOM_IN_FACTOR;
    else
        scale = 1 / (mouseWheelCount*WHEEL_ZOOM_IN_FACTOR);
    try {
        if (mouseWheelUpdateTimer == null) {
            RenderingManager renderManager =
getPanel().getRenderingManager();
            renderManager.setPaintingEnabled(false);
            mouseWheelUpdateTimer = new Timer(700,
                    new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    try {
                        zoomAt(getCentre(), scale, false);
                        mouseWheelUpdateTimer.stop();
                        mouseWheelUpdateTimer = null;
                        mouseWheelCount = 0;
                        origImage = null;
                        RenderingManager renderManager =
getPanel().getRenderingManager();
                        renderManager.setPaintingEnabled(true);
                        renderManager.repaintPanel();
                    } catch (NoninvertibleTransformException e1) {
                    }
                }
            });
            mouseWheelUpdateTimer.start();
            mouseWheelUpdateTimer.setRepeats(false);
            cacheImage();
            scaleImageAtCentre(scale);
        } else {
            mouseWheelUpdateTimer.restart();
            scaleImageAtCentre(scale);
        }
    } catch (Throwable t) {
        getPanel().getContext().handleThrowable(t);
    }
}

regards,
Larry

On Fri, Feb 19, 2010 at 2:25 AM, luca marletta <lucama...@gmail.com> wrote:

> Hi,
> I'd like to check opinions about the new feature to speed up zoom is
> very powerful but in my case causes a delay on on every other events
> and it becomes really not much nice to work.
>
> I observe delay for window menu on right mouse click, select items and so
> on.
>
> Could you write comment to understand if that is just my problem?
>
> luca
>
>
> luca marletta
> www.beopen.it
>
>
> ------------------------------------------------------------------------------
> Download Intel&#174; Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> Jump-pilot-devel mailing list
> Jump-pilot-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>



-- 
Larry Becker
Integrated Systems Analysts, Inc.
------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to