APIdia Launch Partner
Top Description Inners Fields Constructors Methods
javax.swing.plaf.synth

public Class SynthScrollPaneUI

extends BasicScrollPaneUI
implements PropertyChangeListener, SynthUI
Class Inheritance
All Implemented Interfaces
javax.swing.plaf.synth.SynthUI, javax.swing.plaf.synth.SynthConstants, java.beans.PropertyChangeListener, java.util.EventListener
Imports
java.awt.Component, .Graphics, .Insets, .Rectangle, java.awt.event.ContainerEvent, .ContainerListener, .FocusEvent, .FocusListener, java.beans.PropertyChangeEvent, .PropertyChangeListener, javax.swing.JComponent, .JScrollPane, .JViewport, .UIManager, javax.swing.border.AbstractBorder, .Border, javax.swing.plaf.ComponentUI, .UIResource, javax.swing.plaf.basic.BasicScrollPaneUI, javax.swing.text.JTextComponent

Provides the Synth L&F UI delegate for javax.swing.JScrollPane.
Author
Scott Violet
Since
1.7

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
SynthScrollPaneUI.ViewportBorder

A subclass of AbstractBorder that implements UIResource.

private class
SynthScrollPaneUI.ViewportViewFocusHandler

Handle keeping track of the viewport's view's focus

Field Summary

Modifier and TypeField and Description
private SynthStyle
private SynthScrollPaneUI.ViewportViewFocusHandler
private boolean
Inherited from javax.swing.plaf.basic.BasicScrollPaneUI:
hsbChangeListenerscrollpanespPropertyChangeListenerviewportChangeListenervsbChangeListener

Constructor Summary

AccessConstructor and Description
public
SynthScrollPaneUI()

Constructs a SynthScrollPaneUI.

Method Summary

Modifier and TypeMethod and Description
public static ComponentUI

Returns:

the UI object
createUI
(JComponent
component to create UI object for
x
)

Hides javax.swing.plaf.basic.BasicScrollPaneUI.createUI.

Creates a new UI object for the given component.

private int
public SynthContext
getContext(JComponent c)

Implements javax.swing.plaf.synth.SynthUI.getContext.

Returns the Context for the specified component.

private SynthContext
getContext(JComponent c, int state)

protected void
protected void
public void
paint(Graphics
the Graphics object used for painting
g
,
JComponent
the component being painted
c
)

Overrides javax.swing.plaf.basic.BasicScrollPaneUI.paint.

Paints the specified component according to the Look and Feel.

protected void
paint(SynthContext
context for the component being painted
context
,
Graphics
the Graphics object used for painting
g
)

Paints the specified component.

public void
paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h)

Implements javax.swing.plaf.synth.SynthUI.paintBorder.

Paints the border.

public void
propertyChange(PropertyChangeEvent e)

Implements java.beans.PropertyChangeListener.propertyChange.

This method gets called when a bound property is changed.

protected void
protected void
public void
update(Graphics
the Graphics object used for painting
g
,
JComponent
the component being painted
c
)

Overrides javax.swing.plaf.ComponentUI.update.

Notifies this UI delegate to repaint the specified component.

private void
Inherited from javax.swing.plaf.basic.BasicScrollPaneUI:
createHSBChangeListenercreateMouseWheelListenercreatePropertyChangeListenercreateViewportChangeListenercreateVSBChangeListenergetBaselinegetBaselineResizeBehaviorgetMaximumSizeinstallKeyboardActionsinstallUIsyncScrollPaneWithViewportuninstallKeyboardActionsuninstallUIupdateColumnHeaderupdateRowHeaderupdateScrollBarDisplayPolicyupdateViewport

Field Detail

styleback to summary
private SynthStyle style
viewportViewFocusHandlerback to summary
private SynthScrollPaneUI.ViewportViewFocusHandler viewportViewFocusHandler
viewportViewHasFocusback to summary
private boolean viewportViewHasFocus

Constructor Detail

SynthScrollPaneUIback to summary
public SynthScrollPaneUI()

Constructs a SynthScrollPaneUI.

Method Detail

createUIback to summary
public static ComponentUI createUI(JComponent x)

Hides javax.swing.plaf.basic.BasicScrollPaneUI.createUI.

Creates a new UI object for the given component.

Parameters
x:JComponent

component to create UI object for

Returns:ComponentUI

the UI object

getComponentStateback to summary
private int getComponentState(JComponent c)
getContextback to summary
public SynthContext getContext(JComponent c)

Implements javax.swing.plaf.synth.SynthUI.getContext.

Doc from javax.swing.plaf.synth.SynthUI.getContext.

Returns the Context for the specified component.

Annotations
@Override
getContextback to summary
private SynthContext getContext(JComponent c, int state)
installDefaultsback to summary
protected void installDefaults(JScrollPane scrollpane)

Overrides javax.swing.plaf.basic.BasicScrollPaneUI.installDefaults.

Doc from javax.swing.plaf.basic.BasicScrollPaneUI.installDefaults.

Installs default properties.

Annotations
@Override
installListenersback to summary
protected void installListeners(JScrollPane c)

Overrides javax.swing.plaf.basic.BasicScrollPaneUI.installListeners.

Doc from javax.swing.plaf.basic.BasicScrollPaneUI.installListeners.

Registers listeners.

Annotations
@Override
paintback to summary
public void paint(Graphics g, JComponent c)

Overrides javax.swing.plaf.basic.BasicScrollPaneUI.paint.

Paints the specified component according to the Look and Feel.

This method is not used by Synth Look and Feel. Painting is handled by the paint(SynthContext, Graphics) method.

Parameters
g:Graphics

the Graphics object used for painting

c:JComponent

the component being painted

Annotations
@Override
See Also
paint(SynthContext, Graphics)
paintback to summary
protected void paint(SynthContext context, Graphics g)

Paints the specified component.

Parameters
context:SynthContext

context for the component being painted

g:Graphics

the Graphics object used for painting

See Also
update(Graphics, JComponent)
paintBorderback to summary
public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h)

Implements javax.swing.plaf.synth.SynthUI.paintBorder.

Doc from javax.swing.plaf.synth.SynthUI.paintBorder.

Paints the border.

Annotations
@Override
propertyChangeback to summary
public void propertyChange(PropertyChangeEvent e)

Implements java.beans.PropertyChangeListener.propertyChange.

Doc from java.beans.PropertyChangeListener.propertyChange.

This method gets called when a bound property is changed.

uninstallDefaultsback to summary
protected void uninstallDefaults(JScrollPane c)

Overrides javax.swing.plaf.basic.BasicScrollPaneUI.uninstallDefaults.

Doc from javax.swing.plaf.basic.BasicScrollPaneUI.uninstallDefaults.

Uninstalls default properties.

Annotations
@Override
uninstallListenersback to summary
protected void uninstallListeners(JComponent c)

Overrides javax.swing.plaf.basic.BasicScrollPaneUI.uninstallListeners.

Doc from javax.swing.plaf.basic.BasicScrollPaneUI.uninstallListeners.

Unregisters listeners.

Annotations
@Override
updateback to summary
public void update(Graphics g, JComponent c)

Overrides javax.swing.plaf.ComponentUI.update.

Notifies this UI delegate to repaint the specified component. This method paints the component background, then calls the paint(SynthContext, Graphics) method.

In general, this method does not need to be overridden by subclasses. All Look and Feel rendering code should reside in the paint method.

Parameters
g:Graphics

the Graphics object used for painting

c:JComponent

the component being painted

Annotations
@Override
See Also
paint(SynthContext, Graphics)
updateStyleback to summary
private void updateStyle(JScrollPane c)
javax.swing.plaf.synth back to summary

private Class SynthScrollPaneUI.ViewportBorder

extends AbstractBorder
implements UIResource
Class Inheritance
All Implemented Interfaces
javax.swing.plaf.UIResource
Annotations
@SuppressWarnings:serial

A subclass of AbstractBorder that implements UIResource.

Field Summary

Modifier and TypeField and Description
private Insets

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Insets
getBorderInsets(Component c, Insets insets)

Overrides javax.swing.border.AbstractBorder.getBorderInsets.

Reinitializes the insets parameter with this Border's current Insets.

public boolean
isBorderOpaque()

Overrides javax.swing.border.AbstractBorder.isBorderOpaque.

Implements javax.swing.border.Border.isBorderOpaque.

This default implementation returns false.

public void
paintBorder(Component c, Graphics g, int x, int y, int width, int height)

Overrides javax.swing.border.AbstractBorder.paintBorder.

Implements javax.swing.border.Border.paintBorder.

This default implementation does no painting.

Inherited from javax.swing.border.AbstractBorder:
getBaselinegetBaselineResizeBehaviorgetBorderInsetsgetInteriorRectanglegetInteriorRectangle

Field Detail

insetsback to summary
private Insets insets

Constructor Detail

ViewportBorderback to summary
pack-priv ViewportBorder(SynthContext context)

Method Detail

getBorderInsetsback to summary
public Insets getBorderInsets(Component c, Insets insets)

Overrides javax.swing.border.AbstractBorder.getBorderInsets.

Doc from javax.swing.border.AbstractBorder.getBorderInsets.

Reinitializes the insets parameter with this Border's current Insets.

Annotations
@Override
isBorderOpaqueback to summary
public boolean isBorderOpaque()

Overrides javax.swing.border.AbstractBorder.isBorderOpaque.

Implements javax.swing.border.Border.isBorderOpaque.

Doc from javax.swing.border.AbstractBorder.isBorderOpaque.

This default implementation returns false.

Annotations
@Override
paintBorderback to summary
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height)

Overrides javax.swing.border.AbstractBorder.paintBorder.

Implements javax.swing.border.Border.paintBorder.

Doc from javax.swing.border.AbstractBorder.paintBorder.

This default implementation does no painting.

Annotations
@Override
javax.swing.plaf.synth back to summary

private Class SynthScrollPaneUI.ViewportViewFocusHandler

extends Object
implements ContainerListener, FocusListener
Class Inheritance
  • java.lang.Object
  • javax.swing.plaf.synth.SynthScrollPaneUI.ViewportViewFocusHandler
All Implemented Interfaces
java.awt.event.FocusListener, java.util.EventListener, java.awt.event.ContainerListener

Handle keeping track of the viewport's view's focus

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
componentAdded(ContainerEvent e)

Implements java.awt.event.ContainerListener.componentAdded.

Invoked when a component has been added to the container.

public void
componentRemoved(ContainerEvent e)

Implements java.awt.event.ContainerListener.componentRemoved.

Invoked when a component has been removed from the container.

public void
focusGained(FocusEvent e)

Implements java.awt.event.FocusListener.focusGained.

Invoked when a component gains the keyboard focus.

public void
focusLost(FocusEvent e)

Implements java.awt.event.FocusListener.focusLost.

Invoked when a component loses the keyboard focus.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ViewportViewFocusHandlerback to summary
private ViewportViewFocusHandler()

Method Detail

componentAddedback to summary
public void componentAdded(ContainerEvent e)

Implements java.awt.event.ContainerListener.componentAdded.

Doc from java.awt.event.ContainerListener.componentAdded.

Invoked when a component has been added to the container.

componentRemovedback to summary
public void componentRemoved(ContainerEvent e)

Implements java.awt.event.ContainerListener.componentRemoved.

Doc from java.awt.event.ContainerListener.componentRemoved.

Invoked when a component has been removed from the container.

focusGainedback to summary
public void focusGained(FocusEvent e)

Implements java.awt.event.FocusListener.focusGained.

Doc from java.awt.event.FocusListener.focusGained.

Invoked when a component gains the keyboard focus.

focusLostback to summary
public void focusLost(FocusEvent e)

Implements java.awt.event.FocusListener.focusLost.

Doc from java.awt.event.FocusListener.focusLost.

Invoked when a component loses the keyboard focus.