de.enough.polish.ui.itemviews
Class ExplodingParticlesItemView

java.lang.Object
  extended by de.enough.polish.ui.ItemView
      extended by de.enough.polish.ui.itemviews.ExplodingParticlesItemView
All Implemented Interfaces:
Serializable

public class ExplodingParticlesItemView
extends ItemView

Splits the affected item into single pixels that quickly expand.

usage (e.g. for visualizing a pressed state):

 .myItem {
        font-color: blue;
 }
 .myItem:hover {
        font-color: red;
 }
 .myItem:pressed {
        view-type: particle;
 }
 

Copyright Enough Software 2007 - 2009

 history
        Sep 16, 2007 - rob creation
 

Author:
Robert Virkus, j2mepolish@enough.de

Field Summary
 
Fields inherited from class de.enough.polish.ui.ItemView
availableHeight, availableWidth, contentHeight, contentWidth, isFocused, isLayoutCenter, isLayoutRight, layout, paddingHorizontal, paddingVertical, parentItem
 
Constructor Summary
ExplodingParticlesItemView()
          Creates a new view
 
Method Summary
 void animate(long currentTime, ClippingRegion repaintRegion)
          Animates this item.
protected  void initContent(Item parent, int firstLineWidth, int availWidth, int availHeight)
          Initialises this item view.
protected  void paintContent(Item parent, int x, int y, int leftBorder, int rightBorder, Graphics g)
          Paints this item view.
 
Methods inherited from class de.enough.polish.ui.ItemView
addFullRepaintRegion, adjustToContentArea, animate, defocus, destroy, focus, getScreen, handleKeyPressed, handleKeyReleased, handlePointerDragged, handlePointerPressed, handlePointerReleased, handlePointerTouchDown, handlePointerTouchUp, hideNotify, init, initContentByParent, isValid, notifyItemPressedEnd, notifyItemPressedEnd, notifyItemPressedStart, notifyItemPressedStart, paintBackground, paintBorder, paintContentByParent, releaseResources, removeItemBackground, removeItemBorder, removeParentBackground, removeParentBorder, removeViewFromParent, requestInit, setStyle, setStyle, showNotify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExplodingParticlesItemView

public ExplodingParticlesItemView()
Creates a new view

Method Detail

initContent

protected void initContent(Item parent,
                           int firstLineWidth,
                           int availWidth,
                           int availHeight)
Description copied from class: ItemView
Initialises this item view. The implementation needs to calculate and set the contentWidth and contentHeight fields.

Specified by:
initContent in class ItemView
Parameters:
parent - the parent item
firstLineWidth - the maximum width of the first line
availWidth - the maximum width of the view
availHeight - the maximum height of the view
See Also:
ItemView.contentWidth, ItemView.contentHeight

animate

public void animate(long currentTime,
                    ClippingRegion repaintRegion)
Description copied from class: ItemView
Animates this item. Subclasses can override this method to create animations. The default implementation animates the background and the item view if present.

Overrides:
animate in class ItemView
Parameters:
currentTime - the current time in milliseconds
repaintRegion - the repaint area that needs to be updated when this item is animated
See Also:
Item.getAbsoluteX(), Item.getAbsoluteY()

paintContent

protected void paintContent(Item parent,
                            int x,
                            int y,
                            int leftBorder,
                            int rightBorder,
                            Graphics g)
Description copied from class: ItemView
Paints this item view.

Specified by:
paintContent in class ItemView
Parameters:
parent - the parent item
x - the left start position
y - the upper start position
leftBorder - the left border, nothing must be painted left of this position
rightBorder - the right border, nothing must be painted right of this position
g - the Graphics on which this item should be painted.