|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.plaf.ComponentUI
javax.swing.plaf.ScrollPaneUI
javax.swing.plaf.basic.BasicScrollPaneUI
public class BasicScrollPaneUI
A UI delegate for the JScrollPane
component.
Nested Class Summary | |
---|---|
class |
BasicScrollPaneUI.HSBChangeListener
Listens for changes in the state of the horizontal scrollbar's model and updates the scrollpane accordingly. |
protected class |
BasicScrollPaneUI.MouseWheelHandler
Listens for mouse wheel events and update the scrollpane accordingly. |
class |
BasicScrollPaneUI.PropertyChangeHandler
Listens for property changes on the scrollpane and update the view accordingly. |
class |
BasicScrollPaneUI.ViewportChangeHandler
Listens for changes of the viewport's extent size and updates the scrollpane accordingly. |
class |
BasicScrollPaneUI.VSBChangeListener
Listens for changes in the state of the vertical scrollbar's model and updates the scrollpane accordingly. |
Field Summary | |
---|---|
protected ChangeListener |
hsbChangeListener
The horizontal scrollbar listener. |
protected JScrollPane |
scrollpane
The Scrollpane for which the UI is provided by this class. |
protected PropertyChangeListener |
spPropertyChangeListener
The scrollpane property change listener. |
protected ChangeListener |
viewportChangeListener
The viewport listener. |
protected ChangeListener |
vsbChangeListener
The vertical scrollbar listener. |
Constructor Summary | |
---|---|
BasicScrollPaneUI()
|
Method Summary | |
---|---|
protected ChangeListener |
createHSBChangeListener()
Creates and returns the change listener for the horizontal scrollbar. |
protected MouseWheelListener |
createMouseWheelListener()
Creates and returns the mouse wheel listener for the scrollpane. |
protected PropertyChangeListener |
createPropertyChangeListener()
Creates and returns the property change listener for the scrollpane. |
static ComponentUI |
createUI(JComponent c)
|
protected ChangeListener |
createViewportChangeListener()
Creates and returns the change listener for the viewport. |
protected ChangeListener |
createVSBChangeListener()
Creates and returns the change listener for the vertical scrollbar. |
Dimension |
getMinimumSize(JComponent c)
Determines the minimum size of a component. |
protected void |
installDefaults(JScrollPane p)
|
protected void |
installKeyboardActions(JScrollPane sp)
Installs additional keyboard actions on the scrollpane. |
protected void |
installListeners(JScrollPane sp)
Installs the listeners on the scrollbars, the viewport and the scrollpane. |
void |
installUI(JComponent c)
Sets up the specified component so it conforms the the design guidelines of the implemented look and feel. |
void |
paint(Graphics g,
JComponent c)
Paints the component according to the design guidelines of the look and feel. |
protected void |
syncScrollPaneWithViewport()
Synchronizes the scrollbar and header settings positions and extent with the viewport's view position and extent. |
protected void |
uninstallDefaults(JScrollPane p)
|
protected void |
uninstallKeyboardActions(JScrollPane sp)
Uninstalls all keyboard actions from the JScrollPane that have been installed by installKeyboardActions(javax.swing.JScrollPane) . |
protected void |
uninstallListeners(JComponent c)
Uninstalls all the listeners that have been installed in installListeners(JScrollPane) . |
void |
uninstallUI(JComponent c)
Puts the specified component into the state it had before ComponentUI.installUI(javax.swing.JComponent) was called. |
protected void |
updateColumnHeader(PropertyChangeEvent ev)
Receives notification when the columnHeader property has
changed on the scrollpane. |
protected void |
updateRowHeader(PropertyChangeEvent ev)
Receives notification when the rowHeader property has changed
on the scrollpane. |
protected void |
updateScrollBarDisplayPolicy(PropertyChangeEvent ev)
Receives notification when the scrollBarDisplayPolicy
property has changed on the scrollpane. |
protected void |
updateViewport(PropertyChangeEvent ev)
Receives notification when the viewport property has changed
on the scrollpane. |
Methods inherited from class javax.swing.plaf.ComponentUI |
---|
contains, getAccessibleChild, getAccessibleChildrenCount, getMaximumSize, getPreferredSize, update |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected JScrollPane scrollpane
protected ChangeListener hsbChangeListener
protected ChangeListener vsbChangeListener
protected ChangeListener viewportChangeListener
protected PropertyChangeListener spPropertyChangeListener
Constructor Detail |
---|
public BasicScrollPaneUI()
Method Detail |
---|
public static ComponentUI createUI(JComponent c)
protected void installDefaults(JScrollPane p)
protected void uninstallDefaults(JScrollPane p)
public void installUI(JComponent c)
ComponentUI
ComponentUI
delegate is created.
The delegate object then receives an installUI
message.
This method should perform the following tasks:
UIResource
marker
interface, such as BorderUIResource
or ColorUIResource
.LayoutManager
.JSplitPane
might install a special
component for the divider.
installUI
in class ComponentUI
c
- the component for which this delegate will provide
services.ComponentUI.uninstallUI(javax.swing.JComponent)
,
JComponent.setUI(javax.swing.plaf.ComponentUI)
,
JComponent.updateUI()
protected void installListeners(JScrollPane sp)
sp
- the scrollpane on which to install the listenersprotected void installKeyboardActions(JScrollPane sp)
sp
- the scrollpane to install keyboard actions onprotected void uninstallKeyboardActions(JScrollPane sp)
installKeyboardActions(javax.swing.JScrollPane)
. This is a hook method
provided to subclasses to add their own keyboard actions.
sp
- the scrollpane to uninstall keyboard actions fromprotected ChangeListener createHSBChangeListener()
protected ChangeListener createVSBChangeListener()
protected ChangeListener createViewportChangeListener()
protected PropertyChangeListener createPropertyChangeListener()
protected MouseWheelListener createMouseWheelListener()
public void uninstallUI(JComponent c)
ComponentUI
ComponentUI.installUI(javax.swing.JComponent)
was called.
uninstallUI
in class ComponentUI
c
- the component for which this delegate has provided
services.ComponentUI.installUI(javax.swing.JComponent)
,
JComponent.setUI(javax.swing.plaf.ComponentUI)
,
JComponent.updateUI()
protected void uninstallListeners(JComponent c)
installListeners(JScrollPane)
.
c
- the scrollpane from which to uninstall the listenerspublic Dimension getMinimumSize(JComponent c)
ComponentUI
ComponentUI.getPreferredSize(javax.swing.JComponent)
, but subclasses
might want to override this.
getMinimumSize
in class ComponentUI
c
- the component for which this delegate performs services.
null
to indicate that
c
’s layout manager should be asked
to calculate the minimum size.public void paint(Graphics g, JComponent c)
ComponentUI
paint
in class ComponentUI
g
- the graphics for painting.c
- the component for which this delegate performs
services.protected void syncScrollPaneWithViewport()
protected void updateColumnHeader(PropertyChangeEvent ev)
columnHeader
property has
changed on the scrollpane.
ev
- the property change eventprotected void updateRowHeader(PropertyChangeEvent ev)
rowHeader
property has changed
on the scrollpane.
ev
- the property change eventprotected void updateScrollBarDisplayPolicy(PropertyChangeEvent ev)
scrollBarDisplayPolicy
property has changed on the scrollpane.
ev
- the property change eventprotected void updateViewport(PropertyChangeEvent ev)
viewport
property has changed
on the scrollpane.
This method sets removes the viewportChangeListener from the old viewport
and adds it to the new viewport.
ev
- the property change event
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |