SilverStream
Application Server 3.5

com.sssw.rt.form
Class AgcTimer

java.lang.Object
 |
 +--java.awt.Component
       |
       +--java.awt.Container
             |
             +--javax.swing.JComponent
                   |
                   +--javax.swing.JPanel
                         |
                         +--com.sssw.rt.atlas.AtPanel
                               |
                               +--com.sssw.rt.atlas.AtCanvas
                                     |
                                     +--com.sssw.rt.form.PvBaseCanvas
                                           |
                                           +--com.sssw.rt.form.PvInvisibleControlBase
                                                 |
                                                 +--com.sssw.rt.form.AgcTimer
All Implemented Interfaces:
Accessible, AgiControl, AgiHelpInfo, ImageObserver, MenuContainer, Serializable

public class AgcTimer
extends com.sssw.rt.form.PvInvisibleControlBase

The AgcTimer control (Timer) is an invisible control used to trigger actions at specified intervals (in seconds). The Interval can be set at design time using the Interval property, or at run time using the AgcTimer.setInterval(double) method.

Note: The ancestor methods in this class, that is all methods inherited from the non-public PvInvisibleControlBase (including JComponent and Component) are not visible at run time, and are primarily for use by SilverStream. The useful methods are contained in the AgcTimer class itself.

Properties:
Interval, Name, Start Automatically
Events:
timeIntervalExpired
See Also:
Serialized Form

Inner classes inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Inner classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Fields inherited from class com.sssw.rt.atlas.AtPanel
BGIMAGE_DRAW_CENTERED, BGIMAGE_DRAW_NORMAL, BGIMAGE_DRAW_STRETCH, BGIMAGE_DRAW_TILED
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
AgcTimer()
           
 
Method Summary
 void addAgiTimerListener(AgiTimerListener listener)
          Add a listener to receive timer events.
 double getInterval()
          Returns the interval between events in seconds.
 void removeAgiTimerListener(AgiTimerListener listener)
          Remove a timer listener.
 void setInterval(double interval)
          Set the interval for the timer events, and starts the timer if it is inactive.
 void startTimer()
          Starts the Timer control.
 void stopTimer()
          Stops the Timer control.
 
Methods inherited from class com.sssw.rt.form.PvInvisibleControlBase
setBounds, setLocation, setSize
 
Methods inherited from class com.sssw.rt.form.PvBaseCanvas
getBackgroundColor, getFontIdentifier, setBackgroundColor, setFontIdentifier
 
Methods inherited from class com.sssw.rt.atlas.AtPanel
addImpl, addNotify, clientPaint, clientPaint, deliverMouseEvent, deliverMouseMoveEvent, doAtCommand, drawTiledImage, enableAtCommands, getBackgroundImage, getBackgroundImageMode, getHelper, getTransparent, hide, hideToolTip, imageUpdate, isFocusTraversable, isOptimizedDrawingEnabled, ownedImage, paintBorder, paintComponent, paintImmediately, paintImmediately, paintNow, preprocessKeyEvent, processEvent, reshape, setBackgroundImage, setBackgroundImageMode, setTransparent, show, showToolTip
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUIClassID, paramString, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInsets, getInsets, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, isDoubleBuffered, isFocusCycleRoot, isLightweightComponent, isManagingFocus, isOpaque, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintChildren, print, printAll, processComponentKeyEvent, processFocusEvent, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, revalidate, scrollRectToVisible, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, setCursor, setLayout, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setComponentOrientation, setDropTarget, setLocale, setLocation, setName, setSize, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods implemented from interface com.sssw.rt.form.AgiControl
getComponent, getHelpInfo, setHelpInfo
 

Constructor Detail

AgcTimer

public AgcTimer()
Method Detail

setInterval

public void setInterval(double interval)
Set the interval for the timer events, and starts the timer if it is inactive.
Parameters:
interval - the interval between events in seconds
Example:

The following example illustrates how to set the interval to 3.2 seconds.

  timer1.setInterval(3.2);
 
See Also:
AgcTimer.stopTimer(), AgcTimer.startTimer(), AgcTimer.getInterval()

getInterval

public double getInterval()
Returns the interval between events in seconds.
Usage:

An Interval is the amount of time (in seconds) at which the timeIntervalExpired event fires.

Example:

The following example illustrates how to obtain the current Interval.

  double interval;
  interval = timer1.getInterval();
 
See Also:
AgcTimer.stopTimer(), AgcTimer.startTimer(), AgcTimer.setInterval(double)

startTimer

public void startTimer()
Starts the Timer control.
Usage:

The Timer control has an Interval specified. The Interval determines the number of seconds between timer events. The timer will start automatically when the application is started if the Start Automatically property is set to true at design time. If this property is false, then the timer must be started with the startTimer() method.

The stopTimer() method will stop the timer at runtime.

Example:

The following example illustrates how to use the startTimer() method.

  timer1.startTimer();
 
See Also:
AgcTimer.stopTimer(), AgcTimer.setInterval(double), AgcTimer.getInterval()

stopTimer

public void stopTimer()
Stops the Timer control.
Usage:

The Timer control has an Interval specified. The Interval determines the number of seconds between timer events. The Timer can be started automatically when the application is started by setting the Start Automatically property to true at design time. If this property is false, then the timer must be started by calling the startTimer() method.

The startTimer() method is also used to restart the timer at runtime.

Example:

The following example illustrates how to use the stopTimer method.

  timer1.stopTimer();
 
See Also:
AgcTimer.startTimer(), AgcTimer.setInterval(double), AgcTimer.getInterval()

addAgiTimerListener

public void addAgiTimerListener(AgiTimerListener listener)
Add a listener to receive timer events.
Parameters:
listener - the object to receive timer events
Usage:

As an alternative to coding on the timeIntervalExpired method, an object receive timer events if the object implements the AgiTimerListener interface.

Example:
 	timer1.addAgiTimerListener(myTimerListener);
 

removeAgiTimerListener

public void removeAgiTimerListener(AgiTimerListener listener)
Remove a timer listener.
Parameters:
listener - the object to be removed
Usage:

If the listener has not previously been added with addAgiTimerListener(), then this call is ignored.

Example:
 	timer1.removeAgiTimerListener(myTimerListener);
 

SilverStream
Application Server 3.5