javax.swing.plaf.basic

Class BasicTreeUI.ComponentHandler

public class BasicTreeUI.ComponentHandler extends ComponentAdapter implements ActionListener

Updates the preferred size when scrolling, if necessary.
Field Summary
protected JScrollBarscrollBar
ScrollBar that is being adjusted
protected Timertimer
Timer used when inside a scrollpane and the scrollbar is adjusting
Constructor Summary
ComponentHandler()
Constructor
Method Summary
voidactionPerformed(ActionEvent ae)
Public as a result of Timer.
voidcomponentMoved(ComponentEvent e)
Invoked when the component's position changes.
protected JScrollPanegetScrollPane()
Returns the JScrollPane housing the JTree, or null if one isn't found.
protected voidstartTimer()
Creates, if necessary, and starts a Timer to check if needed to resize the bounds

Field Detail

scrollBar

protected JScrollBar scrollBar
ScrollBar that is being adjusted

timer

protected Timer timer
Timer used when inside a scrollpane and the scrollbar is adjusting

Constructor Detail

ComponentHandler

public ComponentHandler()
Constructor

Method Detail

actionPerformed

public void actionPerformed(ActionEvent ae)
Public as a result of Timer. If the scrollBar is null, or not adjusting, this stops the timer and updates the sizing.

Parameters: ae is the action performed

componentMoved

public void componentMoved(ComponentEvent e)
Invoked when the component's position changes.

Parameters: e the event that occurs when moving the component

getScrollPane

protected JScrollPane getScrollPane()
Returns the JScrollPane housing the JTree, or null if one isn't found.

Returns: JScrollPane housing the JTree, or null if one isn't found.

startTimer

protected void startTimer()
Creates, if necessary, and starts a Timer to check if needed to resize the bounds