Class StationAnimation

java.lang.Object
common.animation.StationAnimation
All Implemented Interfaces:
Animation, JobContainer

public class StationAnimation extends Object implements 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

    Fields
    Modifier and Type
    Field
    Description
    protected Vector<JobAnimation>
    list of jobs currently passing through this station.
    protected long
    time a job must stay into this station
  • Constructor Summary

    Constructors
    Constructor
    Description
    StationAnimation(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 Type
    Method
    Description
    void
    addJob(JobAnimation jobAnimation)
    Adds a job to this station.
    returns background image for this animation.
    Returns bounding box for this animation, e.g.
    void
    Initialization method for implementing class.
    void
    Paints image currently handled in a rectangle defined within Animation.setBounds(Rectangle) method
    void
    Refreshes current settings for animation.
    void
    sets background image for this animation.
    void
    Sets bounding box for this animation.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • jobAnimations

      protected Vector<JobAnimation> jobAnimations
      list of jobs currently passing through this station.
    • residencetime

      protected long residencetime
      time a job must stay into this station
  • Constructor Details

    • StationAnimation

      public StationAnimation(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.
      Parameters:
      type - : type of this station
      bounds - : bounding box for this station
      residencetime - : number of millisecs an entering job must stay in this station
    • StationAnimation

      public 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.
      Parameters:
      type - : type of this station
      bounds - : bounding box for this station
      residencetime - : number of millisecs an entering job must stay in this station
      toolkit - : 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.
      Specified by:
      refresh in interface Animation
    • init

      public void init()
      Description copied from interface: Animation
      Initialization method for implementing class. The implementation of this method should prepare images for the animation, if this has not been done within constructor.
      Specified by:
      init in interface Animation
    • paint

      public void paint(Graphics g, ImageObserver io)
      Description copied from interface: Animation
      Paints image currently handled in a rectangle defined within Animation.setBounds(Rectangle) method
      Specified by:
      paint in interface Animation
    • getBGImage

      public Image getBGImage()
      Description copied from interface: Animation
      returns background image for this animation.
      Specified by:
      getBGImage in interface Animation
      Returns:
      :Background image for this animation
    • setBGImage

      public void setBGImage(Image img)
      Description copied from interface: Animation
      sets background image for this animation.
      Specified by:
      setBGImage in interface Animation
      Parameters:
      img - : background image for this animation
    • setBounds

      public void setBounds(Rectangle r)
      Description copied from interface: Animation
      Sets bounding box for this animation. If this box is set, animation will update only this certain area of the Graphics object passed within Animation.paint(Graphics, ImageObserver) method.
      Specified by:
      setBounds in interface Animation
      Parameters:
      r - : Bounding box for this animation.
    • getBounds

      public Rectangle getBounds()
      Description copied from interface: Animation
      Returns bounding box for this animation, e.g. the rectangle within which the frames for this animation will be painted
      Specified by:
      getBounds in interface Animation
      Returns:
      : Bounding box for this animation.
    • addJob

      public void addJob(JobAnimation jobAnimation)
      Adds a job to this station.
      Specified by:
      addJob in interface JobContainer
      Parameters:
      jobAnimation - : job to be added to this station.