com.sibvisions.rad.ui.celleditor
Class AbstractImageViewer<C>

java.lang.Object
  extended by com.sibvisions.rad.ui.celleditor.AbstractStyledCellEditor
      extended by com.sibvisions.rad.ui.celleditor.AbstractImageViewer<C>
Type Parameters:
C - the type of the content.
All Implemented Interfaces:
ICellEditor, ICellRenderer<C>, IImageViewer<C>, IStyledCellEditor, IAlignmentConstants
Direct Known Subclasses:
JVxImageViewer

public abstract class AbstractImageViewer<C>
extends AbstractStyledCellEditor
implements IImageViewer<C>

The AbstractImageViewer is an IImageViewer implementation, which provides a base implementation.


Field Summary
protected  boolean bPreserveAspectRatio
          whether to preserve aspect ration.
protected  java.lang.String sDefaultImageName
          The default image name.
 
Fields inherited from class com.sibvisions.rad.ui.celleditor.AbstractStyledCellEditor
horizontalAlignment, verticalAlignment
 
Fields inherited from interface javax.rad.ui.IAlignmentConstants
ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_DEFAULT, ALIGN_LEFT, ALIGN_RIGHT, ALIGN_STRETCH, ALIGN_TOP
 
Constructor Summary
protected AbstractImageViewer()
          Creates a new instance of AbstractImageViewer.
 
Method Summary
 java.lang.String getDefaultImageName()
          Gets the default image that is shown if selectedIndex is -1.
 boolean isPreserveAspectRatio()
          If the aspect ratio of the image should be preserved if it is stretched in any direction.
 void setDefaultImageName(java.lang.String pDefaultImageName)
          Sets the default image name that is shown if selectedIndex is -1.
 void setPreserveAspectRatio(boolean pPreserveAspectRatio)
          Sets if the aspect ratio of the image should be preserved if it is stretched in any direction.
 
Methods inherited from class com.sibvisions.rad.ui.celleditor.AbstractStyledCellEditor
getHorizontalAlignment, getVerticalAlignment, isDirectCellEditor, setHorizontalAlignment, setVerticalAlignment
 
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
 
Methods inherited from interface javax.rad.ui.IAlignmentConstants
getHorizontalAlignment, getVerticalAlignment, setHorizontalAlignment, setVerticalAlignment
 
Methods inherited from interface javax.rad.model.ui.ICellRenderer
getCellRendererComponent
 

Field Detail

sDefaultImageName

protected java.lang.String sDefaultImageName
The default image name.


bPreserveAspectRatio

protected boolean bPreserveAspectRatio
whether to preserve aspect ration.

Constructor Detail

AbstractImageViewer

protected AbstractImageViewer()
Creates a new instance of AbstractImageViewer.

Method Detail

getDefaultImageName

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

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

setDefaultImageName

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

Specified by:
setDefaultImageName in interface IImageViewer<C>
Parameters:
pDefaultImageName - the default image name.

isPreserveAspectRatio

public boolean isPreserveAspectRatio()
If the aspect ratio of the image should be preserved if it is stretched in any direction.

Specified by:
isPreserveAspectRatio in interface IImageViewer<C>
Returns:
true if the aspect ratio of the image is preserved when stretched.

setPreserveAspectRatio

public void setPreserveAspectRatio(boolean pPreserveAspectRatio)
Sets if the aspect ratio of the image should be preserved if it is stretched in any direction.

Specified by:
setPreserveAspectRatio in interface IImageViewer<C>
Parameters:
pPreserveAspectRatio - true if the aspect ratio of the image is preserved when stretched.


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.