LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.app.behavior
Class LyWaitBehavior

java.lang.Object
  extended by leon.app.behavior.LyBehavior
      extended by leon.app.behavior.LyActionBehavior
          extended by leon.app.behavior.LyWaitBehavior
All Implemented Interfaces:
LyActionBehaviorInterface, LyBehaviorInterface, LyWaitBehaviorInterface, LyGetSessionInterface

public class LyWaitBehavior
extends LyActionBehavior
implements LyWaitBehaviorInterface

Basic implementation of the wait behavior.

See Also:
LyWaitController, LyWaitBehaviorInterface

Field Summary
static java.lang.String __VERSION
          File version
static long MIN_DURATION
          Minimum duration for the waiting view before closing (in milliseconds).
static boolean WAIT_FOR_DISPLAY
          Indicates if the program has to wait for screen update when a value is modified.
 
Constructor Summary
LyWaitBehavior()
          Default construtor.
 
Method Summary
 void endWaiting(LyWaitController controller)
          Method invoked at the end of the wait, when it is over.
 java.lang.String getWaitIcon(LyWaitController controller)
          Gets the current icon for the waiting view.
 java.lang.String getWaitLabel(LyWaitController controller)
          Gets the current label for the waiting view.
 int getWaitValue(LyWaitController controller)
          Gets the current progress value.
 void increaseOffset(LyWaitController controller)
          Increases the current offset.
 void setWaitIcon(LyWaitController controller, java.lang.String icon)
          Sets the icon if the waiting view.
 void setWaitLabel(LyWaitController controller, java.lang.String label)
          Sets the label of the waiting view.
 void setWaitValue(LyWaitController controller, int value)
          Sets the value of the waiting view progress.
 void startWaiting(LyWaitController controller)
          Method called when the waiting starts.
 
Methods inherited from class leon.app.behavior.LyActionBehavior
endAction, getClientContext, getContextTitle, getHelpFile, getImage, getImageTooltip, getKeyValue, getMenuItemImage, getTitle, reset, startAction
 
Methods inherited from class leon.app.behavior.LyBehavior
free, getSession, handleDemand, init
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface leon.app.behaviorinterface.LyActionBehaviorInterface
endAction, getClientContext, getContextTitle, getHelpFile, getImage, getImageTooltip, getKeyValue, getMenuItemImage, getTitle, reset, startAction
 
Methods inherited from interface leon.app.behaviorinterface.LyBehaviorInterface
free, handleDemand, init
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
File version

See Also:
Constant Field Values

MIN_DURATION

public static long MIN_DURATION
Minimum duration for the waiting view before closing (in milliseconds).


WAIT_FOR_DISPLAY

public static boolean WAIT_FOR_DISPLAY
Indicates if the program has to wait for screen update when a value is modified.

Constructor Detail

LyWaitBehavior

public LyWaitBehavior()
Default construtor.
Calls the super implementation and sets the current value to 0, the offset value too, sets the _waitingForDisplay attribute to false and store the current date into _startTime.

Method Detail

getWaitValue

public int getWaitValue(LyWaitController controller)
Gets the current progress value. This method is invoked when the view is updated.
The default implementation stops the wait (sets _waitingForDisplay to false) and computes the progress value depending on the controller maximum and minimum values, the current progress value and the offset value.

Specified by:
getWaitValue in interface LyWaitBehaviorInterface
Parameters:
controller - the current LyWaitController instance
Returns:
the current progress value

getWaitLabel

public java.lang.String getWaitLabel(LyWaitController controller)
Gets the current label for the waiting view. This method is invoked when the view is updated. May update the label of the waiting view.
The default implementation does nothing and return the wait label.

Specified by:
getWaitLabel in interface LyWaitBehaviorInterface
Parameters:
controller - the current LyWaitController instance
Returns:
the label or null if the label should not change

getWaitIcon

public java.lang.String getWaitIcon(LyWaitController controller)
Gets the current icon for the waiting view. This method is invoked when the view is updated. May update the icon of the waiting view.
The default implementation does nothing and return the wait icon.

Specified by:
getWaitIcon in interface LyWaitBehaviorInterface
Parameters:
controller - the current LyWaitController instance
Returns:
the current icon or null if the current icon should not change

increaseOffset

public void increaseOffset(LyWaitController controller)
Increases the current offset. This method is used to simulate smoth progression of the bar.
The default implementation increments the _offsetValue.

Specified by:
increaseOffset in interface LyWaitBehaviorInterface
Parameters:
controller - the current LyWaitController instance

startWaiting

public void startWaiting(LyWaitController controller)
Method called when the waiting starts. May be overriden to do extra work.
The default implementation does nothing.

Specified by:
startWaiting in interface LyWaitBehaviorInterface
Parameters:
controller - current LyWaitController instance

endWaiting

public void endWaiting(LyWaitController controller)
Method invoked at the end of the wait, when it is over. Should complete progress bar because the controller has ended the progression. May do extra work here, or close the view.
The default implementation does nothing.

Specified by:
endWaiting in interface LyWaitBehaviorInterface
Parameters:
controller - the current LyWaitController instance

setWaitValue

public void setWaitValue(LyWaitController controller,
                         int value)
Sets the value of the waiting view progress.
The default implementation calls waitForDisplay(value) and set the current progress value with the given value.

Parameters:
controller - the current LyWaitController instance
value - new progress value

setWaitLabel

public void setWaitLabel(LyWaitController controller,
                         java.lang.String label)
Sets the label of the waiting view.

Parameters:
controller - the current LyWaitController instance
label - new label to display

setWaitIcon

public void setWaitIcon(LyWaitController controller,
                        java.lang.String icon)
Sets the icon if the waiting view.

Parameters:
controller - the current LyWaitController instance
icon - new icon to display

(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com