org.salespointframework.desktop.renderer
Class CountingStockListViewRenderer

java.lang.Object
  extended by org.salespointframework.desktop.renderer.AbstractListViewRenderer
      extended by org.salespointframework.desktop.renderer.CatalogListViewRenderer
          extended by org.salespointframework.desktop.renderer.CountingStockListViewRenderer
All Implemented Interfaces:
javax.swing.ListCellRenderer
Direct Known Subclasses:
DataBasketListViewRenderer

public class CountingStockListViewRenderer
extends CatalogListViewRenderer

Default ListCellRenderer for CountingStock items

Since:
4.0
Author:
Thomas Kissinger

Nested Class Summary
 
Nested classes/interfaces inherited from class org.salespointframework.desktop.renderer.CatalogListViewRenderer
CatalogListViewRenderer.ShadowStyle
 
Nested classes/interfaces inherited from class org.salespointframework.desktop.renderer.AbstractListViewRenderer
AbstractListViewRenderer.CategoryItem, AbstractListViewRenderer.RenderComponent, AbstractListViewRenderer.RenderContext
 
Field Summary
protected  javax.swing.JLabel count
          count label
protected  float countScale
          count label scale. value is multiplied with component height. 0f < scale <= 1f
protected  boolean renderCount
          true, if count should be displayed
 
Fields inherited from class org.salespointframework.desktop.renderer.CatalogListViewRenderer
imagePanel, locale, name, nameScaleFactor, price, priceScalefactor, RENDER_LAYOUT_SIDE_BY_SIDE, RENDER_LAYOUT_UPON_THE_OTHER, RENDER_ORIENTATION_NAME_CENTER, RENDER_ORIENTATION_NAME_LEFT, RENDER_ORIENTATION_NAME_RIGHT, RENDER_ORIENTATION_PRICE_CENTER, RENDER_ORIENTATION_PRICE_LEFT, RENDER_ORIENTATION_PRICE_RIGHT, RENDER_SHOW_NAME, RENDER_SHOW_PRICE, renderAttributes, shadowStyle
 
Fields inherited from class org.salespointframework.desktop.renderer.AbstractListViewRenderer
cache, categoryLine, categoryName, RENDER_ELEMENT_TYPE_CELL, RENDER_ELEMENT_TYPE_SEPERATOR, renderContext, workingComponent
 
Constructor Summary
CountingStockListViewRenderer()
          default constructor
CountingStockListViewRenderer(CatalogListViewRenderer.ShadowStyle shadowStyle, java.util.Locale locale)
          constructor
CountingStockListViewRenderer(CatalogListViewRenderer.ShadowStyle shadowStyle, java.util.Locale locale, int renderAttributes)
          constructor
 
Method Summary
protected  java.lang.Object getCacheKey(java.lang.Object value)
          override cache key method to receive a unique key. and make dnd working.
protected  CatalogItem getCatalogItem(AbstractListViewRenderer.RenderContext renderContext)
          extract CatalogItem form RenderContext
protected  int getCount(AbstractListViewRenderer.RenderContext renderContext)
          extract count from RenderContext
protected  void initializeCSComponents()
          create necessary components
protected  void initializeCSComponentValues()
          set and update component values
protected  void render()
          render
protected  void renderCSComponents()
          put components on AbstractListViewRenderer.workingComponent
 void setCountScale(float scale)
          set countScale
 
Methods inherited from class org.salespointframework.desktop.renderer.CatalogListViewRenderer
initializeComponents, initializeComponentValues, renderRack, setNameScaleFactor, setPriceScaleFactor
 
Methods inherited from class org.salespointframework.desktop.renderer.AbstractListViewRenderer
createWorkingComponent, getCategoryItem, getListCellRendererComponent, initializeSeperatorComponents, initializeSeperatorComponentValues, renderComponent, renderSeperator, renderSeperatorRack
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

count

protected javax.swing.JLabel count
count label


countScale

protected float countScale
count label scale. value is multiplied with component height. 0f < scale <= 1f


renderCount

protected boolean renderCount
true, if count should be displayed

Constructor Detail

CountingStockListViewRenderer

public CountingStockListViewRenderer()
default constructor


CountingStockListViewRenderer

public CountingStockListViewRenderer(CatalogListViewRenderer.ShadowStyle shadowStyle,
                                     java.util.Locale locale)
constructor

Parameters:
shadowStyle - CatalogListViewRenderer.shadowStyle
locale - CatalogListViewRenderer.locale

CountingStockListViewRenderer

public CountingStockListViewRenderer(CatalogListViewRenderer.ShadowStyle shadowStyle,
                                     java.util.Locale locale,
                                     int renderAttributes)
constructor

Parameters:
shadowStyle - CatalogListViewRenderer.shadowStyle
locale - CatalogListViewRenderer.locale
renderAttributes - CatalogListViewRenderer.renderAttributes
Method Detail

setCountScale

public void setCountScale(float scale)
set countScale

Parameters:
scale - new scale

getCacheKey

protected java.lang.Object getCacheKey(java.lang.Object value)
override cache key method to receive a unique key. and make dnd working.

Overrides:
getCacheKey in class AbstractListViewRenderer
Returns:
unique cache key

getCatalogItem

protected CatalogItem getCatalogItem(AbstractListViewRenderer.RenderContext renderContext)
extract CatalogItem form RenderContext

Overrides:
getCatalogItem in class CatalogListViewRenderer
Returns:

getCount

protected int getCount(AbstractListViewRenderer.RenderContext renderContext)
extract count from RenderContext

Parameters:
renderContext -
Returns:

initializeCSComponents

protected void initializeCSComponents()
create necessary components


initializeCSComponentValues

protected void initializeCSComponentValues()
set and update component values


renderCSComponents

protected void renderCSComponents()
put components on AbstractListViewRenderer.workingComponent


render

protected void render()
render

Overrides:
render in class CatalogListViewRenderer