org.kalmeo.kuix.widget
Class ScrollPane

java.lang.Object
  extended by org.kalmeo.kuix.widget.Widget
      extended by org.kalmeo.kuix.widget.ScrollPane

public class ScrollPane
extends Widget

This class represents a scroll pane.

For further informations, visit the Kuix widgets reference page.

Author:
bbeaulant

Nested Class Summary
 
Nested classes/interfaces inherited from class org.kalmeo.kuix.widget.Widget
Widget.BindInstruction
 
Field Summary
protected  Widget container
           
 
Fields inherited from class org.kalmeo.kuix.widget.Widget
bindInstructions, DEFAULT_ALIGN, DEFAULT_BACKGROUND_ALIGN, DEFAULT_BACKGROUND_REPEAT, DEFAULT_BORDER, DEFAULT_GAP, DEFAULT_MARGIN, DEFAULT_MIN_SIZE, DEFAULT_PADDING, DEFAULT_SPAN, DEFAULT_WEIGHT, next, parent, previous
 
Constructor Summary
ScrollPane()
          Construct a ScrollPane
ScrollPane(java.lang.String tag)
          Construct a ScrollPane
ScrollPane(java.lang.String tag, boolean useMarkers)
          Construct a ScrollPane
 
Method Summary
 Widget add(Widget widget)
          Add a Widget to this as child
 boolean bestScrollToChild(Widget child, boolean useIncrementLimit)
          Arrange the scroll offset according to the child position
protected  Widget getContainer()
           
 Widget getInternalChildInstance(java.lang.String tag)
          Returns the first internal child instance corresponding to the given tag.
 Layout getLayout()
           
 ScrollBar getScrollBar()
          Return the ScrollBar instance.
 void invalidate(Widget fromWidget)
          Invalidate the widget's size and position and propagate the information to its parent.
 boolean isAutoScroll()
           
 boolean isChildInsideClippedArea(Widget child)
          Check if the given child widget has a part of its area in the ScrollPane clipped area.
 boolean isHorizontal()
           
 boolean isMarkerWidget(Widget widget)
          Check if widget is one of the ScrollPane markers.
 boolean isShowScrollBar()
           
 boolean processPointerEvent(byte type, int x, int y)
          Process a pointer event
 void removeAll()
          Remove all childs.
 boolean setAttribute(java.lang.String name, java.lang.String value)
          Set the value to the specified attribute representing by the name
 void setAutoScroll(boolean autoScroll)
          The autoScroll attribute force the scroll position to the max value each time the ScrollPane content change or is invalidated.
 void setHorizontal(boolean horizontal)
           
 void setShowScrollBar(boolean showScrollBar)
           
 
Methods inherited from class org.kalmeo.kuix.widget.Widget
add, bringNear, bringToFront, catchChildrenFrom, cleanUp, cleanUpChildren, clearCachedStyle, doLayout, getAlign, getAttribute, getAuthorStyle, getAvailablePseudoClasses, getBackgroundAlign, getBackgroundColor, getBackgroundImage, getBackgroundRepeat, getBorder, getBorderAlign, getBorderColor, getBorderImage, getBorderStroke, getCachedMetrics, getChild, getColor, getDataProvider, getDefaultStylePropertyValue, getDesktop, getDisplayX, getDisplayY, getFocusManager, getGap, getGrayedColor, getHeight, getId, getInheritedTag, getInnerHeight, getInnerWidth, getInsets, getLastChild, getLayoutData, getMargin, getMinSize, getOtherFocus, getPadding, getPreferredSize, getSpan, getStyleClasses, getStylePropertyValue, getStyles, getTag, getWeight, getWidget, getWidgetAt, getWidgetAt, getWidth, getX, getY, hasBindInstruction, hasShortcutKeyCodes, hasShortcuts, invalidate, invalidateAppearance, invalidateAppearanceRegion, invalidateStylePropertiesCache, isFocusable, isFocused, isFocusWidgetChild, isIndividualyVisible, isInvalidated, isInWidgetTree, isObjectAttribute, isPseudoClassCompatible, isShortcutKeyCodeCompatible, isVisible, markAsValidate, needToComputePreferredSize, onAdded, onChildAdded, onChildRemoved, onFocus, onLostFocus, onRemoved, paint, paintBackground, paintBorder, paintChildrenImpl, paintImpl, paintMosaicImage, parseAuthorStyle, processActionEvent, processDataBindEvent, processFocusEvent, processItemsModelUpdateEvent, processKeyEvent, processModelUpdateEvent, processShortcutKeyEvent, propagateFocusEvent, remove, removeAttributeBindInstruction, requestBackwardFocus, requestFocus, requestForwardFocus, sendToBack, setAttributeBindInstruction, setAuthorStyle, setBounds, setDataProvider, setId, setObjectAttribute, setShortcutKeyCodes, setShortcuts, setStyleClass, setStyleClasses, setVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

container

protected final Widget container
Constructor Detail

ScrollPane

public ScrollPane()
Construct a ScrollPane


ScrollPane

public ScrollPane(java.lang.String tag)
Construct a ScrollPane

Parameters:
tag -

ScrollPane

public ScrollPane(java.lang.String tag,
                  boolean useMarkers)
Construct a ScrollPane

Parameters:
tag -
useMarkers -
Method Detail

setAttribute

public boolean setAttribute(java.lang.String name,
                            java.lang.String value)
Description copied from class: Widget
Set the value to the specified attribute representing by the name

Overrides:
setAttribute in class Widget
Returns:
true if the attribute exists

getInternalChildInstance

public Widget getInternalChildInstance(java.lang.String tag)
Description copied from class: Widget
Returns the first internal child instance corresponding to the given tag.

Overrides:
getInternalChildInstance in class Widget
Returns:
the child instance if it exists.

getLayout

public Layout getLayout()
Overrides:
getLayout in class Widget
Returns:
the layout

isHorizontal

public boolean isHorizontal()
Returns:
the horizontal

setHorizontal

public void setHorizontal(boolean horizontal)
Parameters:
horizontal - the horizontal to set

isShowScrollBar

public boolean isShowScrollBar()
Returns:
the showScrollBar

setShowScrollBar

public void setShowScrollBar(boolean showScrollBar)
Parameters:
showScrollBar - the showScrollBar to set

isAutoScroll

public boolean isAutoScroll()
Returns:
the autoScroll

setAutoScroll

public void setAutoScroll(boolean autoScroll)
The autoScroll attribute force the scroll position to the max value each time the ScrollPane content change or is invalidated.

Parameters:
autoScroll - the autoScroll to set

isMarkerWidget

public boolean isMarkerWidget(Widget widget)
Check if widget is one of the ScrollPane markers.

Parameters:
widget -
Returns:
true if the given widget is one of the ScrollPane markers.

getContainer

protected Widget getContainer()
Returns:
the container

getScrollBar

public ScrollBar getScrollBar()
Return the ScrollBar instance.

Returns:
the scrollBar

invalidate

public void invalidate(Widget fromWidget)
Description copied from class: Widget
Invalidate the widget's size and position and propagate the information to its parent. Calling this method will generate a call to the doLayout() and paint() method on all invalidated widgets.

Overrides:
invalidate in class Widget
Parameters:
fromWidget - the Widget responsible of the invalidation.

isChildInsideClippedArea

public boolean isChildInsideClippedArea(Widget child)
Check if the given child widget has a part of its area in the ScrollPane clipped area.

Parameters:
child -
Returns:
true if the child widget has a part of its area in the ScrollPane clipped area.

bestScrollToChild

public boolean bestScrollToChild(Widget child,
                                 boolean useIncrementLimit)
Arrange the scroll offset according to the child position

Parameters:
child -
useIncrementLimit -
Returns:
true the child is displayable after scroll, else false

add

public Widget add(Widget widget)
Description copied from class: Widget
Add a Widget to this as child

Overrides:
add in class Widget
Parameters:
widget - The Widget to add
Returns:
This Widget

removeAll

public void removeAll()
Description copied from class: Widget
Remove all childs.
Caution : this method do NOT cleanUp child widgets. It only remove widgets from widget tree.

Overrides:
removeAll in class Widget

processPointerEvent

public boolean processPointerEvent(byte type,
                                   int x,
                                   int y)
Description copied from class: Widget
Process a pointer event

Overrides:
processPointerEvent in class Widget
Returns:
true if the event is treated by the widget


Copyright © 2007-2008 Kalmeo. All Rights Reserved.