org.salespointframework.desktop.renderer
Class CatalogListViewRenderer

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

public class CatalogListViewRenderer
extends AbstractListViewRenderer

default renderer for CatalogItems

Since:
4.0
Author:
Thomas Kissinger

Nested Class Summary
static class CatalogListViewRenderer.ShadowStyle
          controls the shadow effect shadow in front of image shadow behind image no shadow effect
 
Nested classes/interfaces inherited from class org.salespointframework.desktop.renderer.AbstractListViewRenderer
AbstractListViewRenderer.CategoryItem, AbstractListViewRenderer.RenderComponent, AbstractListViewRenderer.RenderContext
 
Field Summary
protected  ImagePanel imagePanel
          panel which displays the image
protected  java.util.Locale locale
          Locale used for price formatting
protected  javax.swing.JTextPane name
          text pane for name
protected  float nameScaleFactor
          scale factor of name label. component height will me multiplied with this value 0f < scale <= 1f
protected  javax.swing.JLabel price
          label for price
protected  float priceScalefactor
          scale factor for price label. component height will be multiplied with this value 0f < scale <= 1f
static int RENDER_LAYOUT_SIDE_BY_SIDE
          name and price an the same horizontal line
static int RENDER_LAYOUT_UPON_THE_OTHER
          name and price each in a new line
static int RENDER_ORIENTATION_NAME_CENTER
          name centered
static int RENDER_ORIENTATION_NAME_LEFT
          left aligned name
static int RENDER_ORIENTATION_NAME_RIGHT
          name right aligned
static int RENDER_ORIENTATION_PRICE_CENTER
          center the price
static int RENDER_ORIENTATION_PRICE_LEFT
          left align the price
static int RENDER_ORIENTATION_PRICE_RIGHT
          right align the price
static int RENDER_SHOW_NAME
          show the name
static int RENDER_SHOW_PRICE
          show the price
protected  int renderAttributes
          render attributes control the behavior of the renderer. you can concatenate attributes by an binary or ( | ) attributes are: 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
protected  CatalogListViewRenderer.ShadowStyle shadowStyle
          current shadow effect
 
Fields inherited from class org.salespointframework.desktop.renderer.AbstractListViewRenderer
cache, categoryLine, categoryName, RENDER_ELEMENT_TYPE_CELL, RENDER_ELEMENT_TYPE_SEPERATOR, renderContext, workingComponent
 
Constructor Summary
CatalogListViewRenderer()
          default constructor
CatalogListViewRenderer(CatalogListViewRenderer.ShadowStyle shadowStyle, java.util.Locale locale)
          constructor
CatalogListViewRenderer(CatalogListViewRenderer.ShadowStyle shadowStyle, java.util.Locale locale, int renderAttributes)
          constructor
 
Method Summary
protected  CatalogItem getCatalogItem(AbstractListViewRenderer.RenderContext renderContext)
          extract CatalogItem from RenderContext
protected  void initializeComponents()
          create necessary components
protected  void initializeComponentValues()
          set or update component values
protected  void render()
          render the component
protected  void renderRack()
          put components on AbstractListViewRenderer.workingComponent
 void setNameScaleFactor(float scale)
          set nameScaleFactor
 void setPriceScaleFactor(float scale)
          set priceScalefactor
 
Methods inherited from class org.salespointframework.desktop.renderer.AbstractListViewRenderer
createWorkingComponent, getCacheKey, 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

RENDER_LAYOUT_SIDE_BY_SIDE

public static int RENDER_LAYOUT_SIDE_BY_SIDE
name and price an the same horizontal line


RENDER_LAYOUT_UPON_THE_OTHER

public static int RENDER_LAYOUT_UPON_THE_OTHER
name and price each in a new line


RENDER_SHOW_NAME

public static int RENDER_SHOW_NAME
show the name


RENDER_SHOW_PRICE

public static int RENDER_SHOW_PRICE
show the price


RENDER_ORIENTATION_NAME_LEFT

public static int RENDER_ORIENTATION_NAME_LEFT
left aligned name


RENDER_ORIENTATION_NAME_CENTER

public static int RENDER_ORIENTATION_NAME_CENTER
name centered


RENDER_ORIENTATION_NAME_RIGHT

public static int RENDER_ORIENTATION_NAME_RIGHT
name right aligned


RENDER_ORIENTATION_PRICE_LEFT

public static int RENDER_ORIENTATION_PRICE_LEFT
left align the price


RENDER_ORIENTATION_PRICE_CENTER

public static int RENDER_ORIENTATION_PRICE_CENTER
center the price


RENDER_ORIENTATION_PRICE_RIGHT

public static int RENDER_ORIENTATION_PRICE_RIGHT
right align the price


shadowStyle

protected CatalogListViewRenderer.ShadowStyle shadowStyle
current shadow effect


locale

protected java.util.Locale locale
Locale used for price formatting


renderAttributes

protected int renderAttributes
render attributes control the behavior of the renderer. you can concatenate attributes by an binary or ( | ) attributes are: 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


nameScaleFactor

protected float nameScaleFactor
scale factor of name label. component height will me multiplied with this value 0f < scale <= 1f


priceScalefactor

protected float priceScalefactor
scale factor for price label. component height will be multiplied with this value 0f < scale <= 1f


imagePanel

protected ImagePanel imagePanel
panel which displays the image


name

protected javax.swing.JTextPane name
text pane for name


price

protected javax.swing.JLabel price
label for price

Constructor Detail

CatalogListViewRenderer

public CatalogListViewRenderer()
default constructor


CatalogListViewRenderer

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

Parameters:
shadowStyle - shadowStyle
locale - locale

CatalogListViewRenderer

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

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

setNameScaleFactor

public void setNameScaleFactor(float scale)
set nameScaleFactor

Parameters:
scale - new scale

setPriceScaleFactor

public void setPriceScaleFactor(float scale)
set priceScalefactor

Parameters:
scale - new scale

getCatalogItem

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

Parameters:
renderContext -
Returns:

initializeComponents

protected void initializeComponents()
create necessary components


initializeComponentValues

protected void initializeComponentValues()
set or update component values


renderRack

protected void renderRack()
put components on AbstractListViewRenderer.workingComponent


render

protected void render()
render the component

Specified by:
render in class AbstractListViewRenderer