uk.ac.starlink.topcat
Class ColumnCellRenderer

java.lang.Object
  extended by uk.ac.starlink.topcat.ColumnCellRenderer
All Implemented Interfaces:
ListCellRenderer

public class ColumnCellRenderer
extends Object
implements ListCellRenderer

List cell renderer which will render StarTableColumn objects sensibly.

Since:
20 Feb 2004
Author:
Mark Taylor (Starlink)

Constructor Summary
ColumnCellRenderer()
          Constructs a default renderer.
ColumnCellRenderer(JComboBox comboBox)
          Sets up a ColumnCellRenderer for a given combo box.
 
Method Summary
 Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean hasFocus)
           
 Object mapValue(Object value)
          Provides the representation (to be displayed in the combo box) for an object in the box's model.
 void setNullRepresentation(Object nullRep)
          Sets the representation for the null item.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColumnCellRenderer

public ColumnCellRenderer(JComboBox comboBox)
Sets up a ColumnCellRenderer for a given combo box. The only use of the combo box is that its tooltip text will be set to that of the description of the selected column (if there is one).

Parameters:
comboBox - box to watch

ColumnCellRenderer

public ColumnCellRenderer()
Constructs a default renderer.

Method Detail

getListCellRendererComponent

public Component getListCellRendererComponent(JList list,
                                              Object value,
                                              int index,
                                              boolean isSelected,
                                              boolean hasFocus)
Specified by:
getListCellRendererComponent in interface ListCellRenderer

mapValue

public Object mapValue(Object value)
Provides the representation (to be displayed in the combo box) for an object in the box's model.

Parameters:
value - input value
Returns:
to which value is mapped

setNullRepresentation

public void setNullRepresentation(Object nullRep)
Sets the representation for the null item.

Parameters:
nullRep - null representation object to appear in combo box


Copyright © 2003-2018 CCLRC: Council for the Central Laboratory of the Research Councils. All Rights Reserved.