org.apache.pivot.wtk.skin
Class ScrollPaneSkin

java.lang.Object
  extended by org.apache.pivot.wtk.skin.ComponentSkin
      extended by org.apache.pivot.wtk.skin.ContainerSkin
          extended by org.apache.pivot.wtk.skin.ScrollPaneSkin
All Implemented Interfaces:
ComponentKeyListener, ComponentListener, ComponentMouseButtonListener, ComponentMouseListener, ComponentMouseWheelListener, ComponentStateListener, ComponentTooltipListener, ConstrainedVisual, ContainerListener, ContainerMouseListener, ScrollBarValueListener, ScrollPaneListener, Skin, Viewport.Skin, ViewportListener, Visual
Direct Known Subclasses:
TerraScrollPaneSkin

public class ScrollPaneSkin
extends ContainerSkin
implements Viewport.Skin, ScrollPaneListener, ViewportListener, ScrollBarValueListener

Scroll pane skin.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.pivot.wtk.skin.ContainerSkin
ContainerSkin.IndexFocusTraversalPolicy
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ScrollPaneListener
ScrollPaneListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ViewportListener
ViewportListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ContainerListener
ContainerListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ContainerMouseListener
ContainerMouseListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentListener
ComponentListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentStateListener
ComponentStateListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentMouseListener
ComponentMouseListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentMouseButtonListener
ComponentMouseButtonListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentKeyListener
ComponentKeyListener.Adapter
 
Constructor Summary
ScrollPaneSkin()
           
 
Method Summary
 void columnHeaderChanged(ScrollPane scrollPane, Component previousColumnHeader)
          Called when the scroll pane's column header changed.
 void cornerChanged(ScrollPane scrollPane, Component previousCorner)
          Called when the scroll pane's corner component changed.
 int getBaseline(int width, int height)
          Returns the baseline for a given width and height.
 int getHorizontalIncrement()
           
 int getHorizontalReveal()
           
 int getPreferredHeight(int width)
          Returns the visual's preferred height given the provided width constraint.
 Dimensions getPreferredSize()
          Returns the visual's unconstrained preferred size.
 int getPreferredWidth(int height)
          Returns the visual's preferred width given the provided height constraint.
 int getVerticalIncrement()
           
 int getVerticalReveal()
           
 Bounds getViewportBounds()
          The bounds of the Viewport within the container, for example, in ScrollPaneSkin, this excludes the scrollbars.
 void horizontalScrollBarPolicyChanged(ScrollPane scrollPane, ScrollPane.ScrollBarPolicy previousHorizontalScrollBarPolicy)
          Called when the scroll pane's horizontal scroll bar policy changed.
 void install(Component component)
          Associates a skin with a component.
 boolean keyPressed(Component component, int keyCode, Keyboard.KeyLocation keyLocation)
          Key presses have no effect if the event has already been consumed.
 void layout()
          If the component on which the skin is installed is a container, lays out the container's children.
 boolean mouseWheel(Component component, Mouse.ScrollType scrollType, int scrollAmount, int wheelRotation, int x, int y)
          Called when the mouse wheel is scrolled over a component.
 void rowHeaderChanged(ScrollPane scrollPane, Component previousRowHeader)
          Called when the scroll pane's row header changed.
 void scrollLeftChanged(Viewport viewport, int previousScrollLeft)
          Called when a viewport's scroll left has changed.
 void scrollTopChanged(Viewport viewport, int previousScrollTop)
          Called when a viewport's scroll top has changed.
 void setBackgroundPaint(Paint backgroundPaint)
          Sets the object used to paint the background of the container.
 void setHorizontalIncrement(int horizontalIncrement)
           
 void setHorizontalReveal(int horizontalReveal)
           
 void setVerticalIncrement(int verticalIncrement)
           
 void setVerticalReveal(int verticalReveal)
           
 void valueChanged(ScrollBar scrollBar, int previousValue)
          Called when a scroll bar's value has changed.
 void verticalScrollBarPolicyChanged(ScrollPane scrollPane, ScrollPane.ScrollBarPolicy previousVerticalScrollBarPolicy)
          Called when the scroll pane's vertical scroll bar policy changed.
 void viewChanged(Viewport viewport, Component previousView)
          Called when a viewport's view component has changed.
 
Methods inherited from class org.apache.pivot.wtk.skin.ContainerSkin
componentInserted, componentMoved, componentsRemoved, focusTraversalPolicyChanged, getBackgroundColor, getBackgroundPaint, isFocusable, isOpaque, mouseDown, mouseMove, mouseUp, mouseWheel, paint, setBackgroundColor, setBackgroundColor, setBackgroundPaint, setBackgroundPaint
 
Methods inherited from class org.apache.pivot.wtk.skin.ComponentSkin
cursorChanged, decodeFont, dragSourceChanged, dropTargetChanged, enabledChanged, focusedChanged, getBaseline, getComponent, getHeight, getWidth, heightLimitsChanged, invalidateComponent, keyReleased, keyTyped, locationChanged, menuHandlerChanged, mouseClick, mouseDown, mouseMove, mouseOut, mouseOver, mouseUp, nameChanged, parentChanged, preferredSizeChanged, repaintComponent, repaintComponent, repaintComponent, repaintComponent, repaintComponent, setSize, sizeChanged, tooltipDelayChanged, tooltipTextChanged, tooltipTriggered, visibleChanged, widthLimitsChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScrollPaneSkin

public ScrollPaneSkin()
Method Detail

install

public void install(Component component)
Description copied from interface: Skin
Associates a skin with a component.

Specified by:
install in interface Skin
Overrides:
install in class ContainerSkin
Parameters:
component - The component to which the skin is being attached.

getPreferredWidth

public int getPreferredWidth(int height)
Description copied from interface: ConstrainedVisual
Returns the visual's preferred width given the provided height constraint.

Specified by:
getPreferredWidth in interface ConstrainedVisual
Overrides:
getPreferredWidth in class ContainerSkin
Parameters:
height - The height by which to constrain the preferred width, or -1 for no constraint.

getPreferredHeight

public int getPreferredHeight(int width)
Description copied from interface: ConstrainedVisual
Returns the visual's preferred height given the provided width constraint.

Specified by:
getPreferredHeight in interface ConstrainedVisual
Overrides:
getPreferredHeight in class ContainerSkin
Parameters:
width - The width by which to constrain the preferred height, or -1 for no constraint.

getPreferredSize

public Dimensions getPreferredSize()
Description copied from interface: ConstrainedVisual
Returns the visual's unconstrained preferred size.

Specified by:
getPreferredSize in interface ConstrainedVisual
Overrides:
getPreferredSize in class ComponentSkin

getBaseline

public int getBaseline(int width,
                       int height)
Description copied from interface: ConstrainedVisual
Returns the baseline for a given width and height.

Specified by:
getBaseline in interface ConstrainedVisual
Overrides:
getBaseline in class ComponentSkin
Returns:
The baseline relative to the origin of this visual, or -1 if this visual does not have a baseline.

mouseWheel

public boolean mouseWheel(Component component,
                          Mouse.ScrollType scrollType,
                          int scrollAmount,
                          int wheelRotation,
                          int x,
                          int y)
Description copied from interface: ComponentMouseWheelListener
Called when the mouse wheel is scrolled over a component.

Specified by:
mouseWheel in interface ComponentMouseWheelListener
Overrides:
mouseWheel in class ComponentSkin
Returns:
true to consume the event; false to allow it to propagate.

keyPressed

public boolean keyPressed(Component component,
                          int keyCode,
                          Keyboard.KeyLocation keyLocation)
Key presses have no effect if the event has already been consumed.

UP Scroll up a single scroll unit.
DOWN Scroll down a single scroll unit.
LEFT Scroll left a single scroll unit.
RIGHT Scroll right a single scroll unit.
PAGE_UP Scroll up a single scroll block.
PAGE_DOWN Scroll down a single scroll block.

Specified by:
keyPressed in interface ComponentKeyListener
Overrides:
keyPressed in class ComponentSkin
Returns:
true to consume the event; false to allow it to propagate.
See Also:
ScrollBar.getBlockIncrement(), ScrollBar.getUnitIncrement()

layout

public void layout()
Description copied from interface: Skin
If the component on which the skin is installed is a container, lays out the container's children.

Specified by:
layout in interface Skin

setBackgroundPaint

public void setBackgroundPaint(Paint backgroundPaint)
Description copied from class: ContainerSkin
Sets the object used to paint the background of the container.

Overrides:
setBackgroundPaint in class ContainerSkin
Parameters:
backgroundPaint - The Paint object

getHorizontalIncrement

public int getHorizontalIncrement()

setHorizontalIncrement

public void setHorizontalIncrement(int horizontalIncrement)

getVerticalIncrement

public int getVerticalIncrement()

setVerticalIncrement

public void setVerticalIncrement(int verticalIncrement)

getHorizontalReveal

public int getHorizontalReveal()

setHorizontalReveal

public void setHorizontalReveal(int horizontalReveal)

getVerticalReveal

public int getVerticalReveal()

setVerticalReveal

public void setVerticalReveal(int verticalReveal)

getViewportBounds

public Bounds getViewportBounds()
Description copied from interface: Viewport.Skin
The bounds of the Viewport within the container, for example, in ScrollPaneSkin, this excludes the scrollbars.

Specified by:
getViewportBounds in interface Viewport.Skin

horizontalScrollBarPolicyChanged

public void horizontalScrollBarPolicyChanged(ScrollPane scrollPane,
                                             ScrollPane.ScrollBarPolicy previousHorizontalScrollBarPolicy)
Description copied from interface: ScrollPaneListener
Called when the scroll pane's horizontal scroll bar policy changed.

Specified by:
horizontalScrollBarPolicyChanged in interface ScrollPaneListener

verticalScrollBarPolicyChanged

public void verticalScrollBarPolicyChanged(ScrollPane scrollPane,
                                           ScrollPane.ScrollBarPolicy previousVerticalScrollBarPolicy)
Description copied from interface: ScrollPaneListener
Called when the scroll pane's vertical scroll bar policy changed.

Specified by:
verticalScrollBarPolicyChanged in interface ScrollPaneListener

rowHeaderChanged

public void rowHeaderChanged(ScrollPane scrollPane,
                             Component previousRowHeader)
Description copied from interface: ScrollPaneListener
Called when the scroll pane's row header changed.

Specified by:
rowHeaderChanged in interface ScrollPaneListener

columnHeaderChanged

public void columnHeaderChanged(ScrollPane scrollPane,
                                Component previousColumnHeader)
Description copied from interface: ScrollPaneListener
Called when the scroll pane's column header changed.

Specified by:
columnHeaderChanged in interface ScrollPaneListener

cornerChanged

public void cornerChanged(ScrollPane scrollPane,
                          Component previousCorner)
Description copied from interface: ScrollPaneListener
Called when the scroll pane's corner component changed.

Specified by:
cornerChanged in interface ScrollPaneListener

scrollTopChanged

public void scrollTopChanged(Viewport viewport,
                             int previousScrollTop)
Description copied from interface: ViewportListener
Called when a viewport's scroll top has changed.

Specified by:
scrollTopChanged in interface ViewportListener

scrollLeftChanged

public void scrollLeftChanged(Viewport viewport,
                              int previousScrollLeft)
Description copied from interface: ViewportListener
Called when a viewport's scroll left has changed.

Specified by:
scrollLeftChanged in interface ViewportListener

viewChanged

public void viewChanged(Viewport viewport,
                        Component previousView)
Description copied from interface: ViewportListener
Called when a viewport's view component has changed.

Specified by:
viewChanged in interface ViewportListener

valueChanged

public void valueChanged(ScrollBar scrollBar,
                         int previousValue)
Description copied from interface: ScrollBarValueListener
Called when a scroll bar's value has changed.

Specified by:
valueChanged in interface ScrollBarValueListener