org.xith3d.ui.hud.widgets
Class ScrollPane

java.lang.Object
  extended by org.xith3d.ui.hud.base.WidgetBase
      extended by org.xith3d.ui.hud.base.RectangularWidget
          extended by org.xith3d.ui.hud.base.RectangularContentPaneWrapper
              extended by org.xith3d.ui.hud.widgets.ScrollPane
All Implemented Interfaces:
org.jagatoo.datatypes.NamableObject, org.jagatoo.datatypes.NamedObject, org.openmali.types.twodee.Positioned2f, org.openmali.types.twodee.Positioned2fRO, org.openmali.types.twodee.Sized2f, org.openmali.types.twodee.Sized2fRO, ContentPaneWrapper, Widget

public class ScrollPane
extends RectangularContentPaneWrapper

A ScrollPane can be used to scroll the content of a WidgetContainer.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.xith3d.ui.hud.base.Widget
Widget.DescriptionBase
 
Field Summary
 
Fields inherited from class org.xith3d.ui.hud.base.WidgetBase
containerListeners, transformGroup, translation, Z_INDEX_UNIT, Z_INDEX_UNIT_ASSEMBLER
 
Constructor Summary
ScrollPane(WidgetContainer contentPane)
          Creates a new ScrollPane.
ScrollPane(WidgetContainer contentPane, int zIndex)
          Creates a new ScrollPane.
ScrollPane(WidgetContainer contentPane, int zIndex, Scrollbar.Description sbDescHorizontal, Scrollbar.Description sbDescVertical)
          Creates a new ScrollPane.
ScrollPane(WidgetContainer contentPane, int zIndex, Scrollbar.Description sbDescHorizontal, Scrollbar.Description sbDescVertical, java.lang.String spacerTex)
          Creates a new ScrollPane.
ScrollPane(WidgetContainer contentPane, int zIndex, Scrollbar.Description sbDescHorizontal, Scrollbar.Description sbDescVertical, Texture spacerTex)
          Creates a new ScrollPane.
ScrollPane(WidgetContainer contentPane, int zIndex, java.lang.String spacerTex)
          Creates a new ScrollPane.
ScrollPane(WidgetContainer contentPane, int zIndex, Texture spacerTex)
          Creates a new ScrollPane.
ScrollPane(WidgetContainer contentPane, Scrollbar.Description sbDescHorizontal, Scrollbar.Description sbDescVertical, java.lang.String spacerTex)
          Creates a new ScrollPane.
ScrollPane(WidgetContainer contentPane, Scrollbar.Description sbDescHorizontal, Scrollbar.Description sbDescVertical, Texture spacerTex)
          Creates a new ScrollPane.
ScrollPane(WidgetContainer contentPane, java.lang.String spacerTex)
          Creates a new ScrollPane.
ScrollPane(WidgetContainer contentPane, Texture spacerTex)
          Creates a new ScrollPane.
 
Method Summary
 WidgetContainer getContentPane()
          
 ContentPaneWrapper getContentPaneWrapper()
          
 float getTransparency()
          
protected  void init()
          This method is called when the WidgetContainer is set.
 void onMouseButtonPressed(org.jagatoo.input.devices.components.MouseButton button, int x, int y, long when, long lastWhen, boolean isTopMost, boolean hasFocus)
          This event is fired, when a mouse button is pressed on a focused Widget.
 void onMouseButtonReleased(org.jagatoo.input.devices.components.MouseButton button, int x, int y, long when, long lastWhen, boolean isTopMost, boolean hasFocus)
          This event is fired, when a mouse button is released on a focused Widget.
 void onMouseMoved(int x, int y, int buttonsState, long when, boolean isTopMost, boolean hasFocus)
          This event is fired, when the mouse is moved on a Widget.
 void onMouseUnbound()
          This event is fired, when the mouse is released.
 void onMouseWheelMoved(int delta, boolean isPageMove, int x, int y, long when, boolean isTopMost)
          This event is fired, when the mouse wheel is moved on a Widget.
 void recalcScrollArea()
          Recalculates the place needed by the children on the content pane.
 
Methods inherited from class org.xith3d.ui.hud.base.RectangularContentPaneWrapper
pick
 
Methods inherited from class org.xith3d.ui.hud.base.RectangularWidget
getPickHeight, getPickSGZPosition, getPickWidth
 
Methods inherited from class org.xith3d.ui.hud.base.WidgetBase
addContainerListener, addFocusListener, addInputListener, addLocationListener, addSizeListener, addVisibilityListener, detach, detach, getAspect, getAssembly, getCachedToolTipWidget, getContainer, getContextMenu, getCursor, getHeight, getHUD, getInheritedCursor, getLeft, getLocation, getName, getSGNode, getSGZPosition, getSize, getToolTip, getTop, getUserObject, getWidgetAssembler, getWidth, getZIndex, hasFocus, hasFocus, hasToolTip, isClickable, isDraggable, isFocussable, isInitialized, isInitializing, isPickable, isVisible, onAddedToContainer, onAddedToHUD, onControllerAxisChanged, onControllerButtonPressed, onControllerButtonReleased, onDetached, onFocusGained, onFocusLost, onInputStateChanged, onKeyPressed, onKeyReleased, onKeyTyped, onMouseEntered, onMouseLeft, onMouseStopped, onRemovedFromContainer, pickWidgetAssembler, removeContainerListener, removeFocusListener, removeInputListener, removeLocationListener, removeSizeListener, removeVisibilityListener, requestFocus, setAssembly, setCachedToolTipWidget, setClickable, setContainer, setContextMenu, setCursor, setDraggable, setFocussable, setHeight, setLocation, setLocation, setLocation, setName, setPickable, setSize, setSize, setSize, setSize, setToolTip, setTransparency, setUserObject, setVisible, setWidth, setZIndex, toString, update, updateTranslation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.xith3d.ui.hud.base.Widget
addContainerListener, addFocusListener, addInputListener, addLocationListener, addSizeListener, addVisibilityListener, detach, detach, getAspect, getAssembly, getCachedToolTipWidget, getContainer, getContextMenu, getCursor, getHeight, getHUD, getInheritedCursor, getLeft, getLocation, getName, getSGNode, getSGZPosition, getSize, getToolTip, getTop, getUserObject, getWidth, getZIndex, hasFocus, hasFocus, hasToolTip, isClickable, isDraggable, isFocussable, isPickable, isVisible, onControllerAxisChanged, onControllerButtonPressed, onControllerButtonReleased, onDetached, onFocusGained, onFocusLost, onInputStateChanged, onKeyPressed, onKeyReleased, onKeyTyped, onMouseEntered, onMouseLeft, onMouseStopped, removeContainerListener, removeFocusListener, removeInputListener, removeLocationListener, removeSizeListener, removeVisibilityListener, requestFocus, setAssembly, setCachedToolTipWidget, setClickable, setContainer, setContextMenu, setCursor, setDraggable, setFocussable, setLocation, setLocation, setName, setPickable, setSize, setSize, setSize, setToolTip, setTransparency, setUserObject, setVisible, setZIndex, update
 
Methods inherited from interface org.openmali.types.twodee.Sized2f
setHeight, setWidth
 

Constructor Detail

ScrollPane

public ScrollPane(WidgetContainer contentPane,
                  int zIndex,
                  Scrollbar.Description sbDescHorizontal,
                  Scrollbar.Description sbDescVertical,
                  Texture spacerTex)
Creates a new ScrollPane.

Parameters:
contentPane - the WidgetContainer to scroll
zIndex - the z-index
sbDescHorizontal - the Scrollbar.Description for the horizontal Scrollbar
sbDescVertical - the Scrollbar.Description for the vertical Scrollbar
spacerTex - the texture to place between the two Scrollbars

ScrollPane

public ScrollPane(WidgetContainer contentPane,
                  Scrollbar.Description sbDescHorizontal,
                  Scrollbar.Description sbDescVertical,
                  Texture spacerTex)
Creates a new ScrollPane.

Parameters:
contentPane - the WidgetContainer to scroll
sbDescHorizontal - the Scrollbar.Description for the horizontal Scrollbar
sbDescVertical - the Scrollbar.Description for the vertical Scrollbar
spacerTex - the texture to place between the two Scrollbars

ScrollPane

public ScrollPane(WidgetContainer contentPane,
                  int zIndex,
                  Scrollbar.Description sbDescHorizontal,
                  Scrollbar.Description sbDescVertical,
                  java.lang.String spacerTex)
Creates a new ScrollPane.

Parameters:
contentPane - the WidgetContainer to scroll
zIndex - the z-index
sbDescHorizontal - the Scrollbar.Description for the horizontal Scrollbar
sbDescVertical - the Scrollbar.Description for the vertical Scrollbar
spacerTex - the texture to place between the two Scrollbars

ScrollPane

public ScrollPane(WidgetContainer contentPane,
                  Scrollbar.Description sbDescHorizontal,
                  Scrollbar.Description sbDescVertical,
                  java.lang.String spacerTex)
Creates a new ScrollPane.

Parameters:
contentPane - the WidgetContainer to scroll
sbDescHorizontal - the Scrollbar.Description for the horizontal Scrollbar
sbDescVertical - the Scrollbar.Description for the vertical Scrollbar
spacerTex - the texture to place between the two Scrollbars

ScrollPane

public ScrollPane(WidgetContainer contentPane,
                  int zIndex,
                  Scrollbar.Description sbDescHorizontal,
                  Scrollbar.Description sbDescVertical)
Creates a new ScrollPane.

Parameters:
contentPane - the WidgetContainer to scroll
zIndex - the z-index
sbDescHorizontal - the Scrollbar.Description for the horizontal Scrollbar
sbDescVertical - the Scrollbar.Description for the vertical Scrollbar

ScrollPane

public ScrollPane(WidgetContainer contentPane,
                  int zIndex,
                  Texture spacerTex)
Creates a new ScrollPane.

Parameters:
contentPane - the WidgetContainer to scroll
zIndex - the z-index
spacerTex - the texture to place between the two Scrollbars

ScrollPane

public ScrollPane(WidgetContainer contentPane,
                  Texture spacerTex)
Creates a new ScrollPane.

Parameters:
contentPane - the WidgetContainer to scroll
spacerTex - the texture to place between the two Scrollbars

ScrollPane

public ScrollPane(WidgetContainer contentPane,
                  int zIndex,
                  java.lang.String spacerTex)
Creates a new ScrollPane.

Parameters:
contentPane - the WidgetContainer to scroll
zIndex - the z-index
spacerTex - the texture to place between the two Scrollbars

ScrollPane

public ScrollPane(WidgetContainer contentPane,
                  java.lang.String spacerTex)
Creates a new ScrollPane.

Parameters:
contentPane - the WidgetContainer to scroll
spacerTex - the texture to place between the two Scrollbars

ScrollPane

public ScrollPane(WidgetContainer contentPane,
                  int zIndex)
Creates a new ScrollPane.

Parameters:
contentPane - the WidgetContainer to scroll
zIndex - the z-index

ScrollPane

public ScrollPane(WidgetContainer contentPane)
Creates a new ScrollPane.

Parameters:
contentPane - the WidgetContainer to scroll
Method Detail

getTransparency

public float getTransparency()

Returns:
the whole Widget's Transparency.

onMouseButtonPressed

public void onMouseButtonPressed(org.jagatoo.input.devices.components.MouseButton button,
                                 int x,
                                 int y,
                                 long when,
                                 long lastWhen,
                                 boolean isTopMost,
                                 boolean hasFocus)
This event is fired, when a mouse button is pressed on a focused Widget.

Specified by:
onMouseButtonPressed in interface Widget
Overrides:
onMouseButtonPressed in class WidgetBase
Parameters:
button - the button that was pressed
x - the current mouse x position
y - the current mouse y position
isTopMost - is this Widget topMost
hasFocus - is this Widget focused
See Also:
net.jtank.input.MouseCode

onMouseButtonReleased

public void onMouseButtonReleased(org.jagatoo.input.devices.components.MouseButton button,
                                  int x,
                                  int y,
                                  long when,
                                  long lastWhen,
                                  boolean isTopMost,
                                  boolean hasFocus)
This event is fired, when a mouse button is released on a focused Widget.

Specified by:
onMouseButtonReleased in interface Widget
Overrides:
onMouseButtonReleased in class WidgetBase
Parameters:
button - the button that was released
x - the current mouse x position
y - the current mouse y position
isTopMost - is this Widget topMost
hasFocus - is this Widget focused
See Also:
net.jtank.input.MouseCode

onMouseUnbound

public void onMouseUnbound()
This event is fired, when the mouse is released. onMouseMoved will not be called on the Widget anymore, when the mouse is not over it.

Specified by:
onMouseUnbound in interface Widget
Overrides:
onMouseUnbound in class WidgetBase

onMouseMoved

public void onMouseMoved(int x,
                         int y,
                         int buttonsState,
                         long when,
                         boolean isTopMost,
                         boolean hasFocus)
This event is fired, when the mouse is moved on a Widget.

Specified by:
onMouseMoved in interface Widget
Overrides:
onMouseMoved in class WidgetBase
Parameters:
x - the new X coordinate
y - the new Y coordinate
isTopMost - is this Widget topMost
hasFocus - is this Widget focused

onMouseWheelMoved

public void onMouseWheelMoved(int delta,
                              boolean isPageMove,
                              int x,
                              int y,
                              long when,
                              boolean isTopMost)
This event is fired, when the mouse wheel is moved on a Widget.

Specified by:
onMouseWheelMoved in interface Widget
Overrides:
onMouseWheelMoved in class WidgetBase
Parameters:
delta - a positive value when the wheel was moved up
x - the current mouse x position
y - the current mouse y position
isTopMost - is this Widget topMost

getContentPaneWrapper

public final ContentPaneWrapper getContentPaneWrapper()

Returns:
the ContentPaneWrapper, that contains the ContentPane of this ContentPaneWrapper, if there is any.

getContentPane

public final WidgetContainer getContentPane()

Returns:
the ContentPane of this Frame

recalcScrollArea

public void recalcScrollArea()
Recalculates the place needed by the children on the content pane. Depending on this space the Scrollbars' upper values are set. TODO: This method does not calculate correctly!!!


init

protected void init()
This method is called when the WidgetContainer is set.

Specified by:
init in class WidgetBase