cytoscape.visual.ui
Class VizMapUI.StyleSelector.StyleSelectionListener

java.lang.Object
  extended by cytoscape.visual.ui.VizMapUI.StyleSelector.StyleSelectionListener
All Implemented Interfaces:
ItemListener, EventListener
Enclosing class:
VizMapUI.StyleSelector

protected class VizMapUI.StyleSelector.StyleSelectionListener
extends Object
implements ItemListener


Constructor Summary
protected VizMapUI.StyleSelector.StyleSelectionListener()
           
 
Method Summary
 void itemStateChanged(ItemEvent e)
          There's three ways this method can get called.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VizMapUI.StyleSelector.StyleSelectionListener

protected VizMapUI.StyleSelector.StyleSelectionListener()
Method Detail

itemStateChanged

public void itemStateChanged(ItemEvent e)
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