de.enough.polish.ui.containerviews
Class ShuffleView

java.lang.Object
  extended by de.enough.polish.ui.ItemView
      extended by de.enough.polish.ui.ContainerView
          extended by de.enough.polish.ui.containerviews.ShuffleView
All Implemented Interfaces:
Serializable

public class ShuffleView
extends ContainerView

Shows the items in a normal list. During the beginning an animation is shown, in which the items are moved horizontally from left and right into their position.

Copyright Enough Software 2004 - 2009

 history
        18-Nov-2004 - rob creation
 

Author:
Robert Virkus, j2mepolish@enough.de

Field Summary
 
Fields inherited from class de.enough.polish.ui.ContainerView
allowCycling, allowsAutoTraversal, allowsDirectSelectionByPointerEvent, appearanceMode, columnsSetting, columnsWidths, EQUAL_WIDTH_COLUMNS, focusedIndex, focusedItem, focusFirstElement, isAlignHeights, isExpandItems, isHorizontal, isPointerPressedHandled, isSequentialTraversal, isVertical, leftXOffset, NO_COLUMNS, NORMAL_WIDTH_COLUMNS, numberOfColumns, numberOfRows, parentContainer, restartAnimation, rightXOffset, rowsHeights, STATIC_WIDTH_COLUMNS, topYOffset, yOffset
 
Fields inherited from class de.enough.polish.ui.ItemView
availableHeight, availableWidth, contentHeight, contentWidth, isFocused, isLayoutCenter, isLayoutRight, layout, paddingHorizontal, paddingVertical, parentItem
 
Constructor Summary
ShuffleView()
          Creates new DroppingView
 
Method Summary
 boolean animate()
          Animates this view - the items appear to drop from above.
protected  void initContent(Item parentItm, int firstLineWidth, int availWidth, int availHeight)
          Initializes this container view.
protected  void paintItem(Item item, int index, int x, int y, int leftBorder, int rightBorder, int clipX, int clipY, int clipWidth, int clipHeight, Graphics g)
          Paints this item at the specified position.
protected  void setStyle(Style style)
          Sets the style for this view.
 void showNotify()
          Notifies this view that it is about to be shown (again).
 
Methods inherited from class de.enough.polish.ui.ContainerView
addFullRepaintRegion, animate, destroy, focusItem, focusItem, focusItem, getItemRelativeY, getNextFocusableItem, getNextItem, getParentRelativeY, getScreen, getScrollTargetXOffset, getScrollXOffset, handleKeyPressed, handlePointerDragged, handlePointerPressed, handlePointerReleased, handlePointerTouchDown, handlePointerTouchUp, isInBottomRow, isLayoutExpand, isValid, isVirtualContainer, paintContent, paintContent, releaseResources, scroll, setScrollXOffset, setScrollXOffset, shiftFocus, startScroll
 
Methods inherited from class de.enough.polish.ui.ItemView
adjustToContentArea, defocus, focus, handleKeyReleased, hideNotify, init, initContentByParent, notifyItemPressedEnd, notifyItemPressedEnd, notifyItemPressedStart, notifyItemPressedStart, paintBackground, paintBorder, paintContentByParent, removeItemBackground, removeItemBorder, removeParentBackground, removeParentBorder, removeViewFromParent, requestInit, setStyle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShuffleView

public ShuffleView()
Creates new DroppingView

Method Detail

initContent

protected void initContent(Item parentItm,
                           int firstLineWidth,
                           int availWidth,
                           int availHeight)
Description copied from class: ContainerView
Initializes this container view. The implementation needs to calculate and set the contentWidth and contentHeight fields. The style of the focused item has already been set. When the contentWidth will be larger than the specified availWidth, the container view allows to scroll horizontally automatically using pointer events.

Overrides:
initContent in class ContainerView
Parameters:
parentItm - the Container which uses this view, use parent.getItems() for retrieving all items.
firstLineWidth - the maximum width of the first line
availWidth - the maximum width of any following lines
availHeight - the maximum height of the view
See Also:
ItemView.contentWidth, ItemView.contentHeight

paintItem

protected void paintItem(Item item,
                         int index,
                         int x,
                         int y,
                         int leftBorder,
                         int rightBorder,
                         int clipX,
                         int clipY,
                         int clipWidth,
                         int clipHeight,
                         Graphics g)
Description copied from class: ContainerView
Paints this item at the specified position. Subclasses can override this method for taking advantage of the table support of the basic ContainerView class. When the item is outside of the given clipping area, it will not be painted.

Overrides:
paintItem in class ContainerView
Parameters:
item - the item that needs to be painted
index - the index of the item
x - the horizontal position of the item
y - the vertical position of the item
leftBorder - the left border
rightBorder - the right border
clipX - absolute horizontal clipping start
clipY - absolute verical clipping start
clipWidth - clipping width
clipHeight - clipping height
g - the graphics context

setStyle

protected void setStyle(Style style)
Description copied from class: ContainerView
Sets the style for this view. The style can include additional parameters for the view. Subclasses should call super.setStyle(style) first.

Overrides:
setStyle in class ContainerView
Parameters:
style - the style

showNotify

public void showNotify()
Description copied from class: ContainerView
Notifies this view that it is about to be shown (again). The default implementation just sets the restartAnimation-field to true.

Overrides:
showNotify in class ContainerView

animate

public boolean animate()
Animates this view - the items appear to drop from above.

Overrides:
animate in class ItemView
Returns:
true when the view was really animated.
See Also:
ItemView.animate(long, ClippingRegion)