Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Prevent image from moving off screen?

Help
2010-03-05
2013-05-29
  • Warren Weis
    Warren Weis
    2010-03-05

    Please accept my apologies.  This is my very first exposure to prefuse, and hopefully I
    will have more time later to investigate this software.

    We use prefuse in a very simple way:

    a.)  We have a Display variable:

    private Display imageDisplayControl;

    b.)  We add an image to it:
    imageDisplayControl.setBackgroundImage(currentImage, false, false);

    c.)  we use the zoom capabilities of the Display class.

    The problem is, this allows the user to pull the image off the display screen.
    I just found I can set the image to "fixed" if the second parameter in the
    setBackgroundImage method is "true"… However, then it won't respond to zoom
    events either, which was the whole point.

    I have no idea who wrote this code, so I don't know if setting the image as the
    background image is the best way to do this at all, but is there some way
    to say "yes" to zoom and "yes" to no moving the image around?