There's three ways this method can get called. First, it's
triggered when the refreshStyleComboBox method rebuilds the combo
box. These are meaningless events that are trapped by the
'rebuilding' flag set by refreshStyleComboBox that tells this
method to skip the event.
Second, when the visual style is changed in the underlying
VisualMappingManager, it calls the stateChanged method. That
method updates the current style and selects it in the combo box,
triggering this method. Since there's nothing for this method to
do in this case, we recognize this by doing nothing if the 'new'
style is the same as the current style.
The third case is when the user actually selected a style from
the user interface, and this method is supposed to make a change
in the underlying VisualMappingManager. In that case (after
checking that the new style is really new) this method updates
the current style and changes the style in the underlying
VisualMappingManager, which triggers the stateChanged method,
which does nothing since this method has already updated the
current style.
- Specified by:
itemStateChanged
in interface ItemListener