de.enough.polish.ui.gaugeviews
Class CyclingIconsGaugeView

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

public class CyclingIconsGaugeView
extends ItemView

Shows an animation of cyclic aligned icons for visualizing an CONTINUOUS_RUNNING indefinite gauge.

Copyright Enough Software 2007 - 2008

 history
        Aug 30, 2007 - asc creation
 

Author:
Andre Schmidt, andre@enough.de

Field Summary
 
Fields inherited from class de.enough.polish.ui.ItemView
contentHeight, contentWidth, isFocused, isLayoutCenter, isLayoutRight, layout, paddingHorizontal, paddingVertical, parentItem
 
Constructor Summary
CyclingIconsGaugeView()
           
 
Method Summary
 void animate(long currentTime, ClippingRegion repaintRegion)
          Animates this item.
 javax.microedition.lcdui.Image getCenterImage(int startIndex, javax.microedition.lcdui.Graphics g, int i)
           
protected  void initContent(Item parent, int firstLineWidth, int lineWidth)
          Initialises this item view.
protected  boolean isValid(Item parent, Style style)
          Determines whether this view is valid for the given item.
protected  void paintContent(Item parent, int x, int y, int leftBorder, int rightBorder, javax.microedition.lcdui.Graphics g)
          Paints this item view.
protected  void setStyle(Style style)
          Sets the style for this view.
 
Methods inherited from class de.enough.polish.ui.ItemView
addFullRepaintRegion, animate, defocus, focus, getScreen, handleKeyPressed, handleKeyReleased, handlePointerPressed, handlePointerReleased, hideNotify, initContentByParent, notifyItemPressedEnd, notifyItemPressedStart, paintBackground, paintBorder, paintContentByParent, releaseResources, removeItemBackground, removeItemBorder, removeParentBackground, removeParentBorder, removeViewFromParent, requestInit, showNotify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CyclingIconsGaugeView

public CyclingIconsGaugeView()
Method Detail

initContent

protected void initContent(Item parent,
                           int firstLineWidth,
                           int lineWidth)
Description copied from class: ItemView
Initialises this item view. The implementation needs to calculate and set the contentWidth and contentHeight fields. The implementation should take the fields preferredWidth and preferredHeight into account.

Specified by:
initContent in class ItemView
Parameters:
parent - the parent item
firstLineWidth - the maximum width of the first line
lineWidth - the maximum width of any following lines
See Also:
ItemView.contentWidth, ItemView.contentHeight

setStyle

protected void setStyle(Style style)
Description copied from class: ItemView
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 ItemView
Parameters:
style - the style

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,
                            javax.microedition.lcdui.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.

getCenterImage

public javax.microedition.lcdui.Image getCenterImage(int startIndex,
                                                     javax.microedition.lcdui.Graphics g,
                                                     int i)

isValid

protected boolean isValid(Item parent,
                          Style style)
Determines whether this view is valid for the given item.

Overrides:
isValid in class ItemView
Parameters:
parent - the parent item
style - the style
Returns:
true when this view can be applied