public void propertyChange ( PropertyChangeEvent event ) { /*log.fine("void propertyChange(PropertyChangeEvent): called");*/ /*log.fine("source class = " + event.getSource().getClass());*/ /*log.fine("source object = " + event.getSource());*/ /*log.fine("property name = " + event.getPropertyName());*/ /*log.fine("new value = " + event.getNewValue());*/ /*log.fine("old value = " + event.getOldValue());*/ Object source = event . getSource ( ) ; Object oldValue = event . getOldValue ( ) ; String propertyName = event . getPropertyName ( ) ; // Check if the event source is an individual screen state if ( source instanceof WorkFlowScreenState ) { WorkFlowScreenState wfsState = ( WorkFlowScreenState ) source ; // Update the buttons to reflect the change in screen state updateButtonsForScreen ( wfsState ) ; } // Check if the event source is the whole work flow if ( source instanceof WorkFlowState ) { WorkFlowState wfState = ( WorkFlowState ) source ; // Check if the event cause is a change in current screen if ( "currentScreenState" . equals ( propertyName ) ) { WorkFlowScreenState newScreenState = wfState . getCurrentScreenState ( ) ; WorkFlowScreenState oldScreenState = ( WorkFlowScreenState ) oldValue ; // De-register this as a listener for the old current screen state if ( oldScreenState != null ) { oldScreenState . removePropertyChangeListener ( this ) ; } // Register this as a listener for the new current screen state if ( newScreenState != null ) { newScreenState . addPropertyChangeListener ( this ) ; } // Update the buttons to reflect the current screen state updateButtonsForScreen ( newScreenState ) ; } // Check if the event cause is a change in the work flow state else if ( "state" . equals ( propertyName ) ) { // Update the buttons to reflect the change in state updateButtonsForWorkFlow ( wfState ) ; } } }
Called when a property in the work flow state is changed .