Basic Customization > User Interface Customization > Presenting Information in the UI > Creating Custom Graphical Representations > Reference > Traffic Light
  
Traffic Light
Solution Elements
The code specific to the Traffic Light representation includes:
Element
Type
Description
MultiStateIconComponent
Java Class
This is the abstract parent class used for creating custom Multi State Icon graphical representations. This abstract class extends AbstractGraphicalComponent.
TrafficLightComponent
Java Class
This is the class that defines and supports the out of the box graphical representation of “Traffic Light.” It is a subclass of AbstractMultiStateIconComponent and defines a four-state enumeration allowing administrators to configure an attribute to display as a red, yellow or green traffic light, or the fourth state of blank.
This component leverages the existing IconComponent, which in turn utilizes the jsca.columns.imageRenderer JS renderer to actually render the multiple icons of the traffic light.
The TrafficLightComponent is an example of a Multi-State Icon Component. It implements a 4-state enumeration where one of the states simply displays a blank. This is a good example to look at when implementing a custom subclass of MultiStateIconComponent (which is explained in Procedure – Supporting Graphical Attributes in a Non-Configurable Table).
This component resides in the “com.ptc.core.components.rendering.guicomponents.TrafficLightComponent” class.