com.xj.anylogic.engine.presentation
Class SnapshotEventListener

java.lang.Object
  extended by com.xj.anylogic.engine.presentation.SnapshotEventListener

public class SnapshotEventListener
extends java.lang.Object

Listener of snapshot events, it is notified about changes performed by Presentation.saveSnapshot(String) and Presentation.loadSnapshot(String) methods
Listener is not notified about operations performed using save/restore snapshot buttons on the toolbar as well as on automatic root object loads in the corresponding experiments

Author:
XJ Technologies Company Ltd. www.anylogic.com

Constructor Summary
SnapshotEventListener()
          Creates new listener which will be notified on each snapshot operation, until it is manually removed from presentation using Presentation.removeSnapshotEventListener(SnapshotEventListener) method
SnapshotEventListener(boolean actOnlyOnce)
          Creates new listener
 
Method Summary
 void errorOccured(java.lang.String snapshotFileName, java.lang.Throwable e)
          This callback is invoked when snapshot save/load operation was unsuccessful
Default implementation does nothing
 void snapshotLoaded(java.lang.String snapshotFileName)
          This callback is invoked when snapshot is successfully loaded
Default implementation does nothing
 void snapshotSaved(java.lang.String snapshotFileName)
          This callback is invoked when snapshot is successfully saved
Default implementation does nothing
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SnapshotEventListener

public SnapshotEventListener()
Creates new listener which will be notified on each snapshot operation, until it is manually removed from presentation using Presentation.removeSnapshotEventListener(SnapshotEventListener) method


SnapshotEventListener

public SnapshotEventListener(boolean actOnlyOnce)
Creates new listener

Parameters:
actOnlyOnce -
  • if true, this listener will be automatically removed from Presentation after the next single operation (load or save snapshot) completes (or fails). Use true if listener is designed to act only once
  • if false, this listener will be notified on each snapshot operation, until it is manually removed from presentation using Presentation.removeSnapshotEventListener(SnapshotEventListener) method
Method Detail

snapshotLoaded

public void snapshotLoaded(java.lang.String snapshotFileName)
This callback is invoked when snapshot is successfully loaded
Default implementation does nothing

Parameters:
snapshotFileName - the name of loaded snapshot file

snapshotSaved

public void snapshotSaved(java.lang.String snapshotFileName)
This callback is invoked when snapshot is successfully saved
Default implementation does nothing

Parameters:
snapshotFileName - the name of saved snapshot file

errorOccured

public void errorOccured(java.lang.String snapshotFileName,
                         java.lang.Throwable e)
This callback is invoked when snapshot save/load operation was unsuccessful
Default implementation does nothing

Parameters:
snapshotFileName - the name of snapshot file
e - the exception/error which was the reason of snapshot operation termination


Copyright © 1991-2008 XJ Technlogies. All Rights Reserved.