Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.4.0)

E13403-05

oracle.javatools.ui
Class ViewportChangeNotifier

java.lang.Object
  extended by oracle.javatools.ui.ViewportChangeNotifier

public class ViewportChangeNotifier
extends java.lang.Object

It is sometimes useful to know if a component has changed its position on screen as a result of scrolling. The component might not be added directly to the scrolled viewport or it might be part of a component hierarchy that contains many viewports. This class finds all of the viewports in a components hierarchy and listens for position changes to them, forwarding their events to interested ChangeListeners. To use, create an instance of this class with the component to monitor. The instance will begin listening to the viewports in the component hierarchy immediately or whenever the component is first added to the hierarchy. If the component hierarchy changes at any parent level then this mechanism reassociates automatically with any new or removed viewports. When done, dispose() must be called or the references to the viewports and the component may be retained causing a memory leak.


Constructor Summary
ViewportChangeNotifier(javax.swing.JComponent component)
          Create an instance of a ViewportChangeNotifier and begin listening to any viewports in its component hierarchy.
 
Method Summary
 void addChangeListener(javax.swing.event.ChangeListener listener)
           
 void dispose()
          Stop listening to any viewports in the hierarchy, and cleanup.
 void removeChangeListener(javax.swing.event.ChangeListener listener)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ViewportChangeNotifier

public ViewportChangeNotifier(javax.swing.JComponent component)
Create an instance of a ViewportChangeNotifier and begin listening to any viewports in its component hierarchy. Call dispose() when done.

Parameters:
component -
Method Detail

dispose

public void dispose()
Stop listening to any viewports in the hierarchy, and cleanup. No more events will be fired by this class and the instance is effectively useless.


addChangeListener

public void addChangeListener(javax.swing.event.ChangeListener listener)

removeChangeListener

public void removeChangeListener(javax.swing.event.ChangeListener listener)

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.4.0)

E13403-05

Copyright © 1997, 2011, Oracle. All rights reserved.