Class BoxStation

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, JobContainer

public class BoxStation extends JComponent implements JobContainer
Class for a single space inside the queue of the station
Author:
Lorenzo Torri Date: 25-mar-2024 Time: 15.03
See Also:
  • Constructor Details

    • BoxStation

      public BoxStation(Station st, int i)
      Constructor
      Parameters:
      st - , station of this boxstation
      i - , index in the list of boxstations
  • Method Details

    • paint

      public void paint(Graphics g)
      Overrides:
      paint in class JComponent
    • refresh

      public void refresh()
      Specified by:
      refresh in interface JobContainer
    • addJob

      public void addJob(JobContainer prec, Job newJob)
      Description copied from interface: JobContainer
      Add a new Job to this JobContainer
      Specified by:
      addJob in interface JobContainer
      Parameters:
      newJob - Job to add to this Container
    • clear

      public void clear()
      Paint the box white, since we do not have any job to display
    • setPauseTime

      public void setPauseTime(long value)
      To know for how long the animator has stopped
      Parameters:
      value - the time of pausing
    • setProcessorSpeed

      public void setProcessorSpeed(double velocity)
    • setVelocityFactor

      public void setVelocityFactor(int value)
    • setPosition

      public void setPosition(Point pos)
    • updateCumulativeService

      public void updateCumulativeService(double speed, double value)
    • getJob

      public Job getJob()