com.sas.visuals
Class AnimationIconView

com.sas.visuals.AnimationIconView
All Implemented Interfaces:
com.sas.awt.print.PrintableInterface, VisualInterface, com.sas.beans.PropertyChangeSource, com.sas.beans.VetoableChangeSource, com.sas.ComponentInterface, com.sas.LinkPropertiesInterface, com.sas.ModelInterface, com.sas.PublicClonable, AlarmListener, com.sas.ViewInterface, com.sas.visuals.IconInterface, MultipleValueEventSourceInterface, com.sas.visuals.PainterInterface, java.awt.image.ImageObserver, java.awt.MenuContainer, java.beans.PropertyChangeListener, java.io.ObjectInputValidation, java.io.Serializable, java.lang.Cloneable, java.util.EventListener
Direct Known Subclasses:
Fireworks, ImageAnimation, Marquee

public class AnimationIconView
implements AlarmListener, com.sas.PublicClonable

AnimationIconView is a component that animates an AnimationIconInterface object. It increments or decrements an AnimationIconInterface object when an alarm is fired and paints the image in that state.

Notes:


See Also:
AnimationIconInterface, Serialized Form

Field Summary
protected  AlarmInterface alarm
          AlarmInterface that will listen for alarm events and trigger repaints for animation
protected  AnimationIconInterface animationIcon
          AnimationIconInterface object which holds all the animation information
protected  boolean decrement
          boolean flag indicating whether to decrement the AnimationIconInterface
protected  boolean running
          boolean flag that indicated whether or not the animation is running
 
Fields inherited from class com.sas.visuals.IconView
icon
 
Fields inherited from class com.sas.awt.Component
RB_KEY
 
Constructor Summary
AnimationIconView()
          Default Constructor
AnimationIconView(AnimationIconInterface animIcon)
          Constructor that sets the AnimationIconInterface property
 
Method Summary
 java.lang.Object clone()
          Returns a AnimationIcon clone of the original AnimationIcon component.
protected  AnimationIconView createIconObject(AnimationIconView icon)
          Creates a new Instance of the AnimationIcon.
 void fireAlarm(AlarmEvent e)
          Called when an AlarmEvent is fired by the AlarmInterface object.
 AlarmInterface getAlarm()
          Returns the AlarmInterface object being listened to.
 AnimationIconInterface getAnimationIcon()
          Returns the AnimationIconInterface object being painted by the AnimationIconView.
 boolean isDecrement()
          Returns whether the AnimationIconInterface object is being decremented or not.
 boolean isRunning()
          Returns true if the alarm is running.
 void setAlarm(AlarmInterface a)
          Sets the alarm to send off the events that will increment/decrement and paint the AnimationIconInterface object.
 void setAnimationIcon(AnimationIconInterface animIcon)
          Sets the AnimationIconInterface object to be incremented/decremented and painted.
 void setDecrement(boolean d)
          Sets the AnimationIconInterface object to be decremented when the alarm fires.
 void setDefaultValues()
          Sets the default internal values for the AnimationIconView.
 void setRunning(boolean r)
          Sets the state of the alarm that runs the animation.
 void start()
          Start the animation.
 void stop()
          Stop the animation.
 
Methods inherited from class com.sas.visuals.IconView
computePreferredSize, getIcon, getInsets, paint, paint, setIcon, update
 
Methods inherited from class com.sas.awt.Component
getDefaultHeight, getDefaultWidth, getExtendedBeanInfo, getMinimumSize, setDefaultHeight, setDefaultWidth
 
Methods inherited from class com.sas.awt.ComponentVisualComponent
addLink, addPropertyChangeListener, addVetoableChangeListener, anyPropertyChangeListeners, attachModel, attachView, detachModel, detachView, dumpComponent, firePropertyChange, firePropertyChange, fireVetoableChange, getBackgroundColor, getBorder, getComponentDescription, getComponentSupportInfo, getEventMethod, getEventValues, getFont, getForegroundColor, getHeight, getHorizontalPosition, getLinkInfo, getModelInterface, getPageBounds, getPreferredSize, getPrePainter, getPrintOptionsPanel, getRequiredInterfaces, getVerticalPosition, getViewInterfaceSupportInfo, getVisualInterfaceSupportInfo, getWidth, initialize, initializeComponent, isDesignTime, isEnabled, isFocus, isLinked, isTransparent, isVisible, pageExists, print, printFinalize, printInitialize, propertyChange, queryLinks, queryLinks, refresh, removeAllLinks, removeInterfaceTraps, removeLink, removePropertyChangeListener, removeVetoableChangeListener, setBackgroundColor, setBorder, setBounds, setComponentDescription, setComponentSupportInfo, setEnabled, setFocus, setFont, setForegroundColor, setHeight, setHorizontalPosition, setLinkInfo, setModelInterface, setPreferredSize, setPrePainter, setRequiredInterfaces, setTransparent, setVerticalPosition, setViewInterfaceSupportInfo, setVisible, setVisualInterfaceSupportInfo, setWidth, superGetFont, superGetMinimumSize, superGetPreferredSize, superIsEnabled, superIsVisible, superPaint, superSetBounds, superSetEnabled, superSetFont, superSetVisible, superUpdate, supportsListenerInterface, supportsRequiredInterfaces, trapInterfaceEvents, validateObject
 
Methods inherited from interface com.sas.visuals.IconInterface
getPreferredSize
 

Field Detail

alarm

protected AlarmInterface alarm
AlarmInterface that will listen for alarm events and trigger repaints for animation


animationIcon

protected AnimationIconInterface animationIcon
AnimationIconInterface object which holds all the animation information


running

protected boolean running
boolean flag that indicated whether or not the animation is running


decrement

protected boolean decrement
boolean flag indicating whether to decrement the AnimationIconInterface

Constructor Detail

AnimationIconView

public AnimationIconView()
Default Constructor


AnimationIconView

public AnimationIconView(AnimationIconInterface animIcon)
Constructor that sets the AnimationIconInterface property

Method Detail

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Returns a AnimationIcon clone of the original AnimationIcon component.

Specified by:
clone in interface com.sas.PublicClonable
Overrides:
clone in class ComponentVisualComponent
Returns:
a clone object which is an AnimationIconView
Throws:
java.lang.CloneNotSupportedException - if it component cannot be cloned.

createIconObject

protected AnimationIconView createIconObject(AnimationIconView icon)
Creates a new Instance of the AnimationIcon. Meant to be overriden from within each Icon.

Returns:
AnimationIconInterface for the clone method

fireAlarm

public void fireAlarm(AlarmEvent e)
Called when an AlarmEvent is fired by the AlarmInterface object. The function calls increment() or decrement() based on the state of the "decrement" property and then calls paintAnimation() on the AnimationIconInterface object.

Specified by:
fireAlarm in interface AlarmListener
Parameters:
e - the AlarmEvent fired
See Also:
AlarmListener, AlarmListener.fireAlarm( com.sas.util.AlarmEvent )

getAlarm

public AlarmInterface getAlarm()
Returns the AlarmInterface object being listened to.

Returns:
the AlarmInterface object
See Also:
setAlarm(com.sas.util.AlarmInterface)

getAnimationIcon

public AnimationIconInterface getAnimationIcon()
Returns the AnimationIconInterface object being painted by the AnimationIconView.

Returns:
AnimationIconInterface object being animated
See Also:
setAnimationIcon(com.sas.visuals.AnimationIconInterface)

isRunning

public boolean isRunning()
Returns true if the alarm is running.

Returns:
true if stop() has not been called since start() was last called; false otherwise.
See Also:
setRunning(boolean)

isDecrement

public boolean isDecrement()
Returns whether the AnimationIconInterface object is being decremented or not.

Returns:
true if decrement() is being called on the AnimationIconInterface object; false if increment() is being called.
See Also:
setDecrement(boolean)

setAlarm

public void setAlarm(AlarmInterface a)
Sets the alarm to send off the events that will increment/decrement and paint the AnimationIconInterface object.

Parameters:
a - the alarm that causes the AnimationIconInterface object to be painted.
See Also:
getAlarm()

setAnimationIcon

public void setAnimationIcon(AnimationIconInterface animIcon)
Sets the AnimationIconInterface object to be incremented/decremented and painted.

Parameters:
animIcon - the AnimationIconInterface object animated by this class.
See Also:
getAnimationIcon()

setDecrement

public void setDecrement(boolean d)
Sets the AnimationIconInterface object to be decremented when the alarm fires. If set to true the animationIcon will be decremented; else if false it will be incremented.

Parameters:
d - true to decrement animationIcon; false to increment
See Also:
isDecrement()

setDefaultValues

public void setDefaultValues()
Sets the default internal values for the AnimationIconView.

Specified by:
setDefaultValues in interface VisualInterface
Specified by:
setDefaultValues in interface com.sas.ComponentInterface
Overrides:
setDefaultValues in class Component
See Also:
ComponentInterface.setDefaultValues()

setRunning

public void setRunning(boolean r)
Sets the state of the alarm that runs the animation.

Parameters:
r - true will start the animation; false will stop the animation
See Also:
isRunning()

start

public void start()
Start the animation. This will call start() on the alarm and reset the animationIcon.

See Also:
stop()

stop

public void stop()
Stop the animation. This will call stop() on the alarm.

See Also:
start()



Copyright © 2009 SAS Institute Inc. All Rights Reserved.