javax.rad.genui.celleditor
Class UIImageViewer

java.lang.Object
  extended by javax.rad.genui.celleditor.UICellEditor<IImageViewer>
      extended by javax.rad.genui.celleditor.UIImageViewer
All Implemented Interfaces:
ICellEditor, ICellRenderer, IImageViewer, IStyledCellEditor, IAlignmentConstants, IResource

public class UIImageViewer
extends UICellEditor<IImageViewer>
implements IImageViewer

Platform and technology independent image viewer. It is designed for use with AWT, Swing, SWT, JSP, JSF, ... .


Field Summary
 
Fields inherited from interface javax.rad.ui.IAlignmentConstants
ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT, ALIGN_STRETCH, ALIGN_TOP
 
Constructor Summary
  UIImageViewer()
          Creates a new instance of UIImageViewer.
protected UIImageViewer(IImageViewer pViewer)
          Creates a new instance of UIImageViewer with the given image viewer.
  UIImageViewer(int pHorizontalAlignment, int pVerticalAlignment)
          Creates a new instance of UIImageViewer.
  UIImageViewer(String pDefaultImage)
          Creates a new instance of UIImageViewer.
  UIImageViewer(String pDefaultImage, int pHorizontalAlignment, int pVerticalAlignment)
          Creates a new instance of UIImageViewer.
 
Method Summary
 Object getCellRendererComponent(Object pParentComponent, IDataPage pDataPage, int pRowNumber, IDataRow pDataRow, String pColumnName, boolean pIsSelected, boolean pHasFocus)
          Configures a IComponent for rendering.
 String getDefaultImageName()
          Gets the default image that is shown if selectedIndex is -1.
 int getHorizontalAlignment()
          Returns the alignment along the x axis.
 int getVerticalAlignment()
          Returns the alignment along the y axis.
 void setDefaultImageName(String pDefaultImage)
          Sets the default image name that is shown if selectedIndex is -1.
 void setHorizontalAlignment(int pHorizontalAlignment)
          Sets the horizontal alignment.
 void setVerticalAlignment(int pVerticalAlignment)
          Sets the vertical alignment.
 
Methods inherited from class javax.rad.genui.celleditor.UICellEditor
createCellEditorHandler, getDefaultCellEditor, getResource, isDirectCellEditor, setDefaultCellEditor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.rad.model.ui.ICellEditor
createCellEditorHandler, isDirectCellEditor
 

Constructor Detail

UIImageViewer

public UIImageViewer()
Creates a new instance of UIImageViewer.

See Also:
IImageViewer

UIImageViewer

protected UIImageViewer(IImageViewer pViewer)
Creates a new instance of UIImageViewer with the given image viewer.

Parameters:
pViewer - the image viewer
See Also:
IImageViewer

UIImageViewer

public UIImageViewer(String pDefaultImage)
Creates a new instance of UIImageViewer.

Parameters:
pDefaultImage - the default image.
See Also:
IImageViewer

UIImageViewer

public UIImageViewer(int pHorizontalAlignment,
                     int pVerticalAlignment)
Creates a new instance of UIImageViewer.

Parameters:
pHorizontalAlignment - the horizontal alignment.
pVerticalAlignment - the vertical alignment.
See Also:
IImageViewer

UIImageViewer

public UIImageViewer(String pDefaultImage,
                     int pHorizontalAlignment,
                     int pVerticalAlignment)
Creates a new instance of UIImageViewer.

Parameters:
pDefaultImage - the default image.
pHorizontalAlignment - the horizontal alignment.
pVerticalAlignment - the vertical alignment.
See Also:
IImageViewer
Method Detail

getCellRendererComponent

public Object getCellRendererComponent(Object pParentComponent,
                                       IDataPage pDataPage,
                                       int pRowNumber,
                                       IDataRow pDataRow,
                                       String pColumnName,
                                       boolean pIsSelected,
                                       boolean pHasFocus)
Configures a IComponent for rendering. The IComponent can be reused for performance reasons. After a new call of getCellRendererComponent, the previous IComponent can't be used for rendering anymore.

Specified by:
getCellRendererComponent in interface ICellRenderer
Parameters:
pParentComponent - the Parent Component from which.
pDataPage - the DataPage of the row to be rendered.
pRowNumber - the row number of the row to be rendered.
pDataRow - the row to be rendered (is the same as pDataPage.getRow(pRowNumber)).
pColumnName - the column name to be rendered.
pIsSelected - true, if the cell is selected (shown with selected background).
pHasFocus - true, if the cell has the focus (cell is the current editing cell).
Returns:
the renderer Component. It can only be used until the next call of this function.

getHorizontalAlignment

public int getHorizontalAlignment()
Returns the alignment along the x axis. This specifies how the component would like to be aligned relative to other components. Possible values are defined in AlignmentConstants.

Specified by:
getHorizontalAlignment in interface IAlignmentConstants
Overrides:
getHorizontalAlignment in class UICellEditor<IImageViewer>
Returns:
the horizontal alignment

setHorizontalAlignment

public void setHorizontalAlignment(int pHorizontalAlignment)
Sets the horizontal alignment. Possible values are defined in AlignmentConstants.

Specified by:
setHorizontalAlignment in interface IAlignmentConstants
Overrides:
setHorizontalAlignment in class UICellEditor<IImageViewer>
Parameters:
pHorizontalAlignment - the new vertical alignment

getVerticalAlignment

public int getVerticalAlignment()
Returns the alignment along the y axis. This specifies how the component would like to be aligned relative to other components. Possible values are defined in AlignmentConstants.

Specified by:
getVerticalAlignment in interface IAlignmentConstants
Overrides:
getVerticalAlignment in class UICellEditor<IImageViewer>
Returns:
the vertical alignment

setVerticalAlignment

public void setVerticalAlignment(int pVerticalAlignment)
Sets the vertical alignment. Possible values are defined in AlignmentConstants.

Specified by:
setVerticalAlignment in interface IAlignmentConstants
Overrides:
setVerticalAlignment in class UICellEditor<IImageViewer>
Parameters:
pVerticalAlignment - the new vertical alignment

getDefaultImageName

public String getDefaultImageName()
Gets the default image that is shown if selectedIndex is -1.

Specified by:
getDefaultImageName in interface IImageViewer
Returns:
the default image.

setDefaultImageName

public void setDefaultImageName(String pDefaultImage)
Sets the default image name that is shown if selectedIndex is -1.

Specified by:
setDefaultImageName in interface IImageViewer
Parameters:
pDefaultImage - the default image name.


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.