Class StationAnimation
java.lang.Object
common.animation.StationAnimation
- All Implemented Interfaces:
Animation, JobContainer
Created by IntelliJ IDEA.
User: orsotronIII
Date: 17-gen-2005
Time: 13.56.04
This class provides a representation for a service station. No animation is provided by
default. Implementing classes must override refresh method to implement and customize
animation and job management.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Vector<JobAnimation> list of jobs currently passing through this station.protected longtime a job must stay into this station -
Constructor Summary
ConstructorsConstructorDescriptionStationAnimation(String type, Rectangle bounds, long residencetime) Creates a new instance of a station animation and initializes it with given type, (which can be source, server, delay, terminal, sink, fork, join), bounding box to set the area the rendered image must fill, and the number of millisecs an entering job must stay into this station during animation.StationAnimation(String type, Rectangle bounds, long residencetime, IconsToolkit toolkit) Creates a new instance of a station animation and initializes it with given type, (which can be source, server, delay, terminal, sink, fork, join), bounding box to set the area the rendered image must fill, and the number of millisecs an entering job must stay into this station during animation. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddJob(JobAnimation jobAnimation) Adds a job to this station.returns background image for this animation.Returns bounding box for this animation, e.g.voidinit()Initialization method for implementing class.voidpaint(Graphics g, ImageObserver io) Paints image currently handled in a rectangle defined withinAnimation.setBounds(Rectangle)methodvoidrefresh()Refreshes current settings for animation.voidsetBGImage(Image img) sets background image for this animation.voidSets bounding box for this animation.
-
Field Details
-
jobAnimations
list of jobs currently passing through this station. -
residencetime
protected long residencetimetime a job must stay into this station
-
-
Constructor Details
-
StationAnimation
Creates a new instance of a station animation and initializes it with given type, (which can be source, server, delay, terminal, sink, fork, join), bounding box to set the area the rendered image must fill, and the number of millisecs an entering job must stay into this station during animation.- Parameters:
type- : type of this stationbounds- : bounding box for this stationresidencetime- : number of millisecs an entering job must stay in this station
-
StationAnimation
Creates a new instance of a station animation and initializes it with given type, (which can be source, server, delay, terminal, sink, fork, join), bounding box to set the area the rendered image must fill, and the number of millisecs an entering job must stay into this station during animation.- Parameters:
type- : type of this stationbounds- : bounding box for this stationresidencetime- : number of millisecs an entering job must stay in this stationtoolkit- : image toolkit for customized renderization of this station.
-
-
Method Details
-
refresh
public void refresh()Refreshes current settings for animation. An extending class should override this method to implement a customized animation. This method also implements job treatement, so that overriding method must implement job routing or recall this method. -
init
-
paint
Description copied from interface:AnimationPaints image currently handled in a rectangle defined withinAnimation.setBounds(Rectangle)method -
getBGImage
Description copied from interface:Animationreturns background image for this animation.- Specified by:
getBGImagein interfaceAnimation- Returns:
- :Background image for this animation
-
setBGImage
Description copied from interface:Animationsets background image for this animation.- Specified by:
setBGImagein interfaceAnimation- Parameters:
img- : background image for this animation
-
setBounds
Description copied from interface:AnimationSets bounding box for this animation. If this box is set, animation will update only this certain area of the Graphics object passed withinAnimation.paint(Graphics, ImageObserver)method. -
getBounds
-
addJob
Adds a job to this station.- Specified by:
addJobin interfaceJobContainer- Parameters:
jobAnimation- : job to be added to this station.
-