Class CircleStation

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, JobContainer

public class CircleStation extends JComponent implements JobContainer
Class for the server in the station
Author:
Lorenzo Torri Date: 25-mar-2024 Time: 15.35
See Also:
  • Constructor Details

    • CircleStation

      public CircleStation(Station st, float position)
      Constructor
      Parameters:
      st - , Station that has this circle
      position - , set it = 0.0f if it is a single server station. Otherwise set it equal to the correct position for multiple servers
  • 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
    • isWorking

      public boolean isWorking()
      To know if the station is currently processing a job or not
      Returns:
      true if it is processing a job, false otherwise
    • setPauseTime

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

      public void setPosition(Point pos)
    • setVelocityFactor

      public void setVelocityFactor(int value)
    • setProcessorSpeed

      public void setProcessorSpeed(double velocity)
    • updateCumulativeService

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

      public Job getJob()