Determine when a component comes into view in a scrollpane

So I have an application called FlickrBackup (http://sunkencity.org/flickrbackup). The main page of the GUI goes out to flickr (a photosharing site) and downloads a list of all your photos. It then creates little square panels that have the photos thumbnails on them and allows you to select them. Currently, the GUI goes out and downloads ALL the thumbnails and loads them all into the GUI. I would like to change it to only go out an download the thumbnail IF that panel/photo is visible in the scrollpane. The reason for this is because some users have upwards of 3000+ photos, so many of them are running into memory issues. If they don't even scrolldown to look at them, why should I load them?
So here is what I have:
A JPanel with a ScrollPane we'll call the ImageContainer
I add many PhotoDisplayPanels to the image container. Most of them are outside the visible viewports view (something like 20 fit on the screen). These panels just use a JLabel to display the photo.
I have tried adding a HierarchyListener to the PhotoDisplayPanel, but the event(any HierarchyEvent, not just showing/displayable) is only fired once and that is when the component is added to the ImageContainer and is shown for the first time.
Does anyone know if there is a way to get notified when a component becomes visible in a scrollpanes view?
I'm also confused by the terminology used in the javadocs for isShowing and the HierarchyEvents. isShowing says:
"Determines whether this component is showing on screen. This means that the component must be visible, and it must be in a container that is visible and showing."
Does the first 'visible' mean setVisible(true)? Or does it mean I can see it with my own two eyes? It seems once you add a component to a panel, it is by default in a visible state unless you specifically setVisible(false).
Any help you can give would be great!
Thanks!
Andrew

your player is in the middle of the screen, i just
dont have a picture for that yetWell, nothing happens, even using the arrow keys. Sorry, but I'm giving up.

Similar Messages

  • HT4847 If I buy extra storage when will it come into effect?

    I have just paid for extra storage but it's still saying that I don't have enough

    You "don't have enough" for what?  Could it be that whatever you're doing results in errors or issues regarding storage **on your device** and has nothing to do with icloud?
    To find out where you don't have enough storage...
    Go to Settings>General>Usage to see how much "Storage" you have available on the device.  Farther down the list is the available storage on iCloud.

  • Make a Flash animation play only when it scrolls into view

    I am designing a very long page. There will be a flash animation at the bottom of the page. I want this animation to play only when the user scrolls down and this flash object comes into view. How do I do this? I am quite familiar with flash and actionscript, so I just need some pointers.
    I have seen that this is already being used for advertisements. If you visit www.amazon.com, there are ads that appear far below on the page. These ads play only when you scroll down and the ad appears within the browser window. This happens on many other sites as well.
    Many popular sites also use something like this. On CNN, try opening a new tab that loads a flash video. The video begins to play only when you actually go to that tab. Until you open the tab and the contents become visible in your browser window, the video doesn't start. How is this done?
    Thanks in advance,
      Kumar

    Hmmm ... It looks like Amazon doesn't always run ads. I will give another example.
    Take a look at http://digg.com/
    There is a 300x250 ad at the top of the right-column. Ignore that.
    In addition, there is a second 300x250 ad halfway down the page in the right column.
    This second 300x250 ad appears when you scroll down.
    The interesting thing is that the ad plays from the beginning when you first see it after scrolling down!
    Most flash ads run for 15 seconds. After that the animation stops. When you see this second 300x250 ad, you will find it at the beginning of its 15 second animation. It plays from the beginning even if you wait for some time before scrolling down. This means that the ad is waiting for you to scroll down before it begins to play.
    How is this done?
    Thanks.

  • How long to Refurbished Macbooks come into stock?1

    I am hoping to buy the Macbook for £550, I have been watching it recently, and it has not been in stock for quite a while now. Does anyone have any idea when they normally come into stock?

    Hi rasta9997,
    There's really no guarantee. For example, at the time of this posting the 2.26GHz "Unibody" plastic MacBook is available on the refurbished site. It wasn't there 20 minutes ago and it might not be there in 20 minutes. I've purchased my fair share of refurbished machines (about 15 over the past 5 years) and from my experience Apple usually releases them during "peak times."
    For example... around 4:15am PST I've seen them make all sorts of products available. Presumably to target East Coast early birds @ 7:30am. In addition I've noticed other batch releases around 4:30pm PST, again presumably to target people when they get home from work or out of class.
    Hardly a scientific statement of fact but one thing's for certain, most of the sub $1000 portable offerings are gone within a few hours.

  • Scrolling component into view programmatically without using javascript

    Hi,
    Is it possible to scroll an adf component into view programmatically without using javascript?
    I know of <af:scrollComponentIntoViewBehaviour> that can be added to a command component , but is there a way to do that programmatically in a bean?
    Problem with using javascript is its not guaranteed to work in different browsers.
    Regards,
    Rakesh.

    Hi John,
    Thanks for the reply.
    If i use the af:scrollComponentIntoViewBehavior, then i wont be able to achieve my desired functionality.
    In my use case, i want the id, of the component that needs to be scrolled into view, to be determined in the server listener of the button which is not happening.
    Code snippet in jspx page is as follows:
    <af:commandButton id="cb1" immediate="true">
    <af:clientListener method="clickButton" type="click"/>
    <af:serverListener type="customEvent"
    method="#{pageFlowScope.bean.doScroll }"/>
    <af:scrollComponentIntoViewBehavior id="#{pageFlowScope.bean.compId}/>
    </af:commandButton>
    And the java code for method doScroll is something like :
    public void doScroll (ClientEvent clientEvent)
    //logic to determine compId goes here
    compId = "id";
    So, the problem here is "compId" is set to some value when bean is loaded and the id in the af:scrollComponentIntoViewBehavior will be set to that value forever.
    I cant find any way of telling it to re-read the "compId" value, say after clicking the button. I can refresh the button in the server listener to update the compId .
    But the updated compId will come into picture from *next click*. This is because, after the button is clicked, "scroll" action happens first and then serverListener executes.
    Is there a way to change order of this execution like "execute server listener first and then do the scrolling thing" ?
    Regards,
    Rakesh.
    Edited by: 927925 on Jul 27, 2012 2:02 AM

  • When I send an email the rely comes into another account in my apple email.  How do I set it so that my email comes to the correct address?

    When I send an email the rely comes into another account in my apple email.  How do I set it so that my email comes to the correct address?

    Hi Sunny C,
    Welcome to the Support Communities!  The "From" field should be showing by default, but you can check or change your settings for Mail with the instructions below:
    Mail (Yosemite): Set Mail preferences
    http://support.apple.com/kb/PH19178
    In the Composing pane, you can set the email account that you want to send new messages from.
    Also, check the View command on the Menu bar.  View > Message Attributes should have a checkmark beside the "From" field.
    Cheers,
    Judy

  • TS4479 When plugging Apple TV into my samsung tv hdmi port nothing comes up. Actually my Sat TV plays on that same HDMI inport

    When plugging Apple TV into my samsung tv hdmi port nothing comes up. Actually my Sat TV plays on that same HDMI inport

    Check these troubleshooting steps:
    http://support.apple.com/kb/HT1551?viewlocale=en_US&locale=en_US
    Specifically I wonder if the AppleTV may be trying to connect with an unsupported resolution giving a black screen.  Try cycling display resolutions using these remote commands in step 6:
    If your TV screen appears fuzzy or black (you see no video)
    Make sure the television you are using supports the Apple TV resolution requirements. Please see the Apple TV technical specifications.
    When you connect power, check to make sure the LED turns on. If the LED is not on, then verify with a known good power outlet or connect something else to the outlet you're using for Apple TV and make sure it works (such as a lamp or clock).
    Make sure you're using the correct video cables and that they are connected firmly to Apple TV and to your TV.
    Connect the HDMI cable directly into the Apple TV and your television, remove any third party devices or adapters.
    Make sure the input setting you've selected on your TV matches the input you have your video cables connected to. See the documentation that came with your TV for more information.
    Change the Apple TV resolution by pressing and holding the Menu and Up button for six seconds. The Apple TV will automatically cycle to the next resolution at approximately 20 second intervals. Pressing the Select button will immediately cycle to the next resolution.
    If you are connected via HDMI, try unplugging and replugging your HDMI cable.
    If HDMI isn't working on an Apple TV (1st generation), try component cables instead (and disconnect the HDMI cable temporarily). Read more about HDMI vs component video.

  • IE Script error when double clicking on a view in Abap Webdynpro component

    Hello experts,
    I am running mini SAP trial version 2004 with Internet explorer 7.0 and also installed gui patch 23.
    I am making a sample application in SE80 and when double clicking on a view in Abap Webdynpro component I get following error:
    <b>Internet Explorer Script Error</b>
    An error has occured in the script on this page.
    Line: 1
    Char: 1
    Error: 'wdp_show_menu' is undefined
    Code: 0
    URL: http://satellite5200:8000/sap/bc/wdvd/painting.html?_vdrespkey=EOJ6V1JQMX0VLTQ7AP6DQM64Y&_vdframe=painting&sap-client=000
    Do you want to continue running scripts on this page?
    Thanks in advance.
    Bhupendra

    Hi Bhupendra,
       If you are seeing this error in the Se 80 editor , i guess you can ignoire that ...While running the application it will not show any error.
    Thanks
    Anzy

  • Safari problem:  when I switch back into safari from another application, the menu bar comes up but no tabs or windows.  What's going on?  Just started yesterday.  I have found a workaround: when I Command Tab back to safari, I hit command T to open a new

    Safari problem:  when I switch back into safari from another application, the menu bar comes up but no tabs or windows.  What's going on?  Just started yesterday.  I have found a workaround: when I Command Tab back to safari, I hit command T to open a new tab and Command W to close it, and my other tabs are visible.
    I have tried shutting down, closing tabs, with no success.  What's going on and how can I fix it?
    Thanks,
    Cindi B
    PS:  I'm not sure of the actual OS level, but I have not allowed it to upgrade to Maverick yet; concerned about it because of a few things I've read...

    A Safari extension or third party plugin may be causing the menu bar issue.
    From the Safari menu bar click Safari > Preferences then select the Extensions tab. Turn that OFF, quit and relaunch Safari to test. If that helped, turn one extension on then quit and relaunch Safari to test until you find the incompatible extension then click uninstall.
    If it's not an extensions issue, try troubleshooting third party plug-ins.
    Back to Safari > Preferences. This time select the Security tab. Deselect:  Allow plug-ins. Quit and relaunch Safari to test.
    If that made a difference, instructions for troubleshooting plugins here.
    As for which OS X is installed.
    Click the Apple () menu top left in your screen. From the drop down menu click About This Mac.
    The version is noted there.
    v10.6 Snow Leopard v10.7 Lion  v10.8 Mountain Lion
    It's your choice whether or not to upgrade to Mavericks. If you decide to do this, make sure your Mac meets the requirements noted here.

  • View next received email when I click back into a folder

    Hello
    Does anyone know how to view the next new email without having to actually click into it?
    I have rules sent to place emails in folders when I receive a new emails.
    I used to be able to click that folder and it would highlight the most recent email and I could read it with the preview pane and then click to another folder and that email would be marked as read.
    It only does this for the first mail of the day when I click back into the folder it shows me the first email received that day and not the most recent which obviously is the one I am interested in.
    Does anyone know of a fix for this please. I cannot seem to find an answer in the forums all they seem to do is highlight other issues I have to look forward to, I have checked my rules, I have tried changing view settings and filters. Nothing seems to work
    (as seems to be the case with most of microsofts products) I have a number of issues with this new look office, but this is the one that annoys me the most. I have workarounds for most of the other issues.
    I would like to go back to office 2003, however this is part of a major upgrade (depending on your point of view)  to our systems and as I am only an end user however I will not get a say.
    If all else fails I will be blind by the end of the week and it will no longer be a concern (We have office 2013 on one screen and navision on the other) I suspect health and safety will insist on snow googles as standard equipment.
    Any help or pointers from fellow sufferers would be greatly appreciated.

    Outlook provides the keyboard shortcut of Ctrl + < (Last item) and Ctrl + > (Next item) to view the message after we open the email item.
    Tony Chen
    TechNet Community Support

  • I put my ipod touch in DFU mode, but when I plug it into my computer the restore your ipod alert does not come up in itunes. What can/should I do?

    I have been on the Apple Support page for several hours now and cannot find my exact circumstance and other suggestions have yet to help me. I purchased a locked ipod touch and when I plug it into my laptop itunes says "Itunes could not connect to ipod because it is locked with a passcode". The guy I bought it from told me the password but I failed to write it down and remember it and he has since moved so I can't find him. I have tried putting it in DFU mode and I can get it there, but then Itunes does not show the pop-up that everyone has said will come up with the alert about an ipod trying to restore itself so I cannot get it to do so. Any suggestions would be greatly appreciated!
    Thanks,
    AM

    When in DFU mode and connected to the computer iTunes does not say anything but iTunes will see the iPod and you can restore the iPod via iTunes. When in recovery mode and you connect, iTunes will say it found an iPod in recovery mode.

  • When i turn my iphone 4 on, it comes up with a picture of a cord connecting to an itunes icon. when i plug it into my pc, it says the settings on my iphone need to be restored. but i dont want to restore it as will lose everything on it. what shall i do?

    when i turn my iphone 4 on, it comes up with a picture of a cord connecting to an itunes icon. when i plug it into my pc, it says the settings on my iphone need to be restored. but i dont want to restore it as will lose everything on it. what shall i do?

    You have no chose but to restore your phone. What do you mean "lose everything"? Is your data/iTunes content not on your computer?

  • My ipod froze so I restarted it. it happened again, so I restarted it again, and it was fine but then it ran out of battery. Now when I plug it into the charger it, the Apple sign comes up for 5 seconds then that's it, it doesn't turn on. help please?

    My ipod froze so I restarted it, but then it happened again, so I restarted it again, and it was fine but then it ran out of battery. Now when I plug it into the charger it, the Apple sign comes up for 5 seconds then disappears, it doesn't turn on or come up with the charging sign. Is it not going to work again, or is ther something I can do? Please help.

    I have the same problem, and my Ipod turned off (when I held the home and power button)
    but then when I held down the home button (after turned off) nothing happened, the screen is still black.
    Do you know what I should maybe do?
    Thanks is advance

  • When i save a picture in a web page, the picture does not come into my photo albums! I don't see it anywhere. Plz help

    When i save a picture in a web page, the picture does not come into my photo albums! I don't see it anywhere. Plz help

    Does it show up in your camera roll?

  • How to add default values when adding custom component to design view?

    I have a set of custom components (usually) extending Spark components. But when adding our custom component onto design view, how can I define defult values (in AS3).
    For example, s:Button has default label = 'Button' when added to application, or mx:DataGrid has 3 columns predefined, but when using custom components there are no predefined values like this.
    I can put this values in constructor, but they are not visible in design time, only runtime.
    Any ideas? Thanks
    Esmin

    yes, I am. By the way I've found the solution. Someone might find this usefull.
    In design.xml having
    <component name="ExtendedTextInput" namespace="mynamespace" category="beta" displayName="ExtendedTextInput"/>
    use this
    <component name="ExtendedTextInput" namespace="mynamespace" category="beta" displayName="ExtendedTextInput">
            <defaultAttribute name="text" value="ExtendedTextInput"/>
        </component>
    so when adding this component to design view, it will have text setted to value ('ExtendedTextInput' in this case).

Maybe you are looking for