|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IXRenderer
A renderer for list or table cells. Can use text, colour, symbol, maybe image. Expects to use a TwoField, ThreeField or FourField object to obtain up to four values, which are represented using text, colour, an image and a symbol.
The IXRenderer is created with a boolean argument which determines whether the cell has a border or not. The border is used to show whether the cell/row is selected or not.
The fields unselectedBorder, selectedBorder, and isBordered are used to handle the borders of the cell if it has one. The class sub-classes RendererJLabel rather than JLabel for performance reasons (see Java API documentation of TableCellRenderer or ListCellRenderer for more detail).
Method Summary | |
---|---|
void |
setInfo(java.lang.Object object)
Provides the information to be displayed. |
Methods inherited from interface javax.swing.table.TableCellRenderer |
---|
getTableCellRendererComponent |
Methods inherited from interface javax.swing.ListCellRenderer |
---|
getListCellRendererComponent |
Method Detail |
---|
void setInfo(java.lang.Object object)
Example1:
protected void setInfo(Object object) {
if (object == null) setText("");
else setText(((UIRefinement)object).getName());
}
Example2 (NDRenderer):
protected void setInfo(Object object) {
FourField fourField = (FourField) object;
Color colour = (Color) fourField.toColour();
if (colour != null) this.setBackground(colour);
char fieldSymbol = fourField.toSymbol();
String fieldString = fourField.toString();
if (java.lang.Character.isDefined(fieldSymbol)) {
this.setText((String) fieldString + " " + fieldSymbol);}
else this.setText((String) fieldString);
Icon fieldIcon = fourField.toImage();
if (fieldIcon != null) this.setIcon(fieldIcon);
}
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |