Search this API

y.option
Class ImageCellRenderer

java.lang.Object
  extended by y.option.ImageCellRenderer
All Implemented Interfaces:
javax.swing.Icon, javax.swing.ListCellRenderer, javax.swing.table.TableCellRenderer

public class ImageCellRenderer
extends java.lang.Object
implements javax.swing.Icon, javax.swing.ListCellRenderer, javax.swing.table.TableCellRenderer

Renderer for Images.

 
Your browser does not support SVG content.

Constructor Summary
ImageCellRenderer(GuiFactory factory, int desiredWidth, int desiredHeight)
          Creates a new instance of ImageCellRenderer.
 
Method Summary
 int getIconHeight()
          Returns the height of the last displayed Image.
 int getIconWidth()
          Returns the width of the last displayed Image.
 java.awt.Component getListCellRendererComponent(javax.swing.JList list, java.lang.Object value, int index, boolean isSelected, boolean cellHasFocus)
          Returns a component that has been configured to display an image.
 java.awt.Component getTableCellRendererComponent(javax.swing.JTable table, java.lang.Object value, boolean isSelected, boolean hasFocus, int row, int column)
          Returns a component that has been configured to display an image.
 void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
          Paints the last displayed Image on the specified Graphics context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageCellRenderer

public ImageCellRenderer(GuiFactory factory,
                         int desiredWidth,
                         int desiredHeight)
Creates a new instance of ImageCellRenderer.

Parameters:
factory - the GuiFactory used for localization
Method Detail

getListCellRendererComponent

public java.awt.Component getListCellRendererComponent(javax.swing.JList list,
                                                       java.lang.Object value,
                                                       int index,
                                                       boolean isSelected,
                                                       boolean cellHasFocus)
Returns a component that has been configured to display an image. The image may be provided through several means: For all other types of values, the returned component will be blank.

Specified by:
getListCellRendererComponent in interface javax.swing.ListCellRenderer

paintIcon

public void paintIcon(java.awt.Component c,
                      java.awt.Graphics g,
                      int x,
                      int y)
Paints the last displayed Image on the specified Graphics context.

Specified by:
paintIcon in interface javax.swing.Icon

getIconWidth

public int getIconWidth()
Returns the width of the last displayed Image.

Specified by:
getIconWidth in interface javax.swing.Icon
Returns:
the width of the last displayed Image.

getIconHeight

public int getIconHeight()
Returns the height of the last displayed Image.

Specified by:
getIconHeight in interface javax.swing.Icon
Returns:
the height of the last displayed Image.

getTableCellRendererComponent

public java.awt.Component getTableCellRendererComponent(javax.swing.JTable table,
                                                        java.lang.Object value,
                                                        boolean isSelected,
                                                        boolean hasFocus,
                                                        int row,
                                                        int column)
Returns a component that has been configured to display an image. The image may be provided through several means: For all other types of values, the returned component will be blank.

Specified by:
getTableCellRendererComponent in interface javax.swing.table.TableCellRenderer

© Copyright 2000-2022,
yWorks GmbH.
All rights reserved.