de.enough.polish.ui.gaugeviews
Class TachometerGaugeView

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

public class TachometerGaugeView
extends ItemView

Shows a tachometer visualization of a Gauge.

The tachometer has 3 different sections: too low, normal, too high which can be customized by setting colors and the areas. It's also possible to specify a start value and to simulate floating point support by specifying a divide factor.
Supported attributes:

Copyright Enough Software 2006 - 2009

 history
        Jan 23, 2007 - rob creation
 

Author:
Robert Virkus, j2mepolish@enough.de, Tim Muders

Field Summary
 
Fields inherited from class de.enough.polish.ui.ItemView
availableHeight, availableWidth, contentHeight, contentWidth, isFocused, isLayoutCenter, isLayoutRight, layout, paddingHorizontal, paddingVertical, parentItem
 
Constructor Summary
TachometerGaugeView()
           
 
Method Summary
protected  void initContent(Item parent, int firstLineWidth, int availWidth, int availHeight)
          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, Graphics g)
          Paints this item view.
protected  void setStyle(Style style, boolean resetStyle)
          Sets the style for this view and is used to specify animatable CSS attribute.
 
Methods inherited from class de.enough.polish.ui.ItemView
addFullRepaintRegion, adjustToContentArea, animate, animate, defocus, destroy, focus, getScreen, handleKeyPressed, handleKeyReleased, handlePointerDragged, handlePointerPressed, handlePointerReleased, handlePointerTouchDown, handlePointerTouchUp, hideNotify, init, initContentByParent, notifyItemPressedEnd, notifyItemPressedEnd, notifyItemPressedStart, notifyItemPressedStart, paintBackground, paintBorder, paintContentByParent, releaseResources, removeItemBackground, removeItemBorder, removeParentBackground, removeParentBorder, removeViewFromParent, requestInit, setStyle, showNotify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TachometerGaugeView

public TachometerGaugeView()
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

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.

setStyle

protected void setStyle(Style style,
                        boolean resetStyle)
Description copied from class: ItemView
Sets the style for this view and is used to specify animatable CSS attribute. The style can include additional parameters for the view. Subclasses should call super.setStyle(style, resetStyle) first.

Overrides:
setStyle in class ItemView
Parameters:
style - the style
resetStyle - true when default style settings should be applied when nothing is set

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