vipratech.beans.standardbeans
Class Timer

java.lang.Object
  |
  +--java.awt.Component
        |
        +--vipratech.beans.standardbeans.Timer

public class Timer
extends java.awt.Component
implements java.lang.Runnable

See Also:
Serialized Form

Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
Timer()
          Constructor.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener pcl)
          Method to register property change listeners at design time.
 void dataChanged(AdjustmentFloatEvent event)
          Sets the value of the pause for the thread sleep method.
 void destroy()
          Method to clean up thread.
 void propertyChange(java.beans.PropertyChangeEvent event)
           
 void removePropertyChangeListener(java.beans.PropertyChangeListener pcl)
          Method to de-register property change listeners at design time.
 void reset()
          Resets to initial values.
 void run()
          The thread.
 void start()
          Starts the thread.
 void stop()
          Stops the thread.
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, deliverEvent, disable, dispatchEvent, doLayout, enable, enable, enableInputMethods, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPeer, getPreferredSize, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paint, paintAll, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Timer

public Timer()
Constructor.
Method Detail

start

public final void start()
Starts the thread.

stop

public final void stop()
Stops the thread.

run

public final void run()
The thread.
Specified by:
run in interface java.lang.Runnable

dataChanged

public final void dataChanged(AdjustmentFloatEvent event)
Sets the value of the pause for the thread sleep method. This method can be used receive adjustment events from a slider control. Vipratech.beans.HorizontalSlider or Vipratech.beans.VertcialSlider can thus be wired up to this method at design time. public final void adjustmentValueChanged(AdjustmentEvent event) { int value = event.getValue(); //avoid division by zero if(value>0) { //set the pause whether the thead is suspended or not pause = 100*(100/value);//gives pause=200ms at 50 in range 0 -100 if(runner!=null) { try{runner.resume();} catch(IllegalThreadStateException e){e.printStackTrace();} } } }

propertyChange

public final void propertyChange(java.beans.PropertyChangeEvent event)

reset

public final void reset()
Resets to initial values.

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener pcl)
Method to register property change listeners at design time.
Overrides:
addPropertyChangeListener in class java.awt.Component

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener pcl)
Method to de-register property change listeners at design time.
Overrides:
removePropertyChangeListener in class java.awt.Component

destroy

public final void destroy()
Method to clean up thread. Should be called by an applet destroy() method.

dathe@chemie.uni-leipzig.de"

http://leipzig.vernetztes-studium.de