source: tmcsimulator/trunk/src/tmcsim/client/cadclientgui/screens/IncidentNumberRenderer.java @ 290

Revision 290, 928 bytes checked in by jdalbey, 7 years ago (diff)

IncidentNumberRenderer?.java added to address #78.

Line 
1package tmcsim.client.cadclientgui.screens;
2
3import javax.swing.table.DefaultTableCellRenderer;
4
5/**
6 * This is a quick hack to meet a specific customer request.
7 * The customer desires that incident number 100 be displayed as "Media".
8 * This TableCellRenderer is used for Integer fields in the table
9 * (of which there is currently only one: the incident number).
10 * When displaying any Integers in the table this class will be used.
11 * It simply filters for the special case of the number 100
12 * and changes it to the string "Media".
13 * @author jdalbey
14 * @version 2019.3.2
15 */
16class IncidentNumberRenderer extends DefaultTableCellRenderer {
17    public IncidentNumberRenderer() { super(); }
18
19    public void setValue(Object value) 
20    {
21        super.setValue(value);
22        // Change 100 to "Media"
23        if (value != null && value.equals(new Integer(100)))
24        { 
25            setText("Media");
26        }
27    }
28}   
Note: See TracBrowser for help on using the repository browser.