Class StatiDrawer

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, Notifier

public class StatiDrawer extends JPanel implements Notifier
Draws the statistics of the JMCH animation (queue length, utilization, response time).
See Also:
  • Constructor Details

    • StatiDrawer

      public StatiDrawer(QueueLogic ql)
    • StatiDrawer

      public StatiDrawer(boolean isDoubleBuffered)
      Parameters:
      isDoubleBuffered -
    • StatiDrawer

      public StatiDrawer(LayoutManager layout)
      Parameters:
      layout -
    • StatiDrawer

      public StatiDrawer(LayoutManager layout, boolean isDoubleBuffered)
      Parameters:
      layout -
      isDoubleBuffered -
  • Method Details

    • changeDrawSettings

      public void changeDrawSettings(DrawConstrains dCst)
    • paint

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

      public void drawStatus(int status, double probability, Graphics2D g2d, Color sc, Color pc, Color borderC, boolean bold)
    • drawLastStatus

      public void drawLastStatus(String jobStr, double probability, Graphics2D g2d, Color sc, Color pc)
    • drawMoreStatus

      public void drawMoreStatus(Graphics2D g2d)
    • drawArc

      public void drawArc(int from, int to, boolean bold, String txt, Graphics2D g2d, Color c)
    • drawLastArc

      public void drawLastArc(boolean bold, String txt, Graphics2D g2d, Color c)
    • probabilityToString

      public String probabilityToString(double p, int decimals)
      converting the probability into string
      Parameters:
      p - the probability to convert
      decimals - the number of decimal digits
      Returns:
      the probability formatted as a string
    • setMaxJobs

      public void setMaxJobs(int i)
      Parameters:
      i -
    • updateLogic

      public void updateLogic(QueueLogic ql)
    • setColors

      public void setColors(Color emptyC, Color queueC, Color probC, Color animC)
    • enterProcessor

      public void enterProcessor(int jobId, int processorId, double time, double executionTime)
      Specified by:
      enterProcessor in interface Notifier
    • enterQueue

      public void enterQueue(int jobId, double time)
      Specified by:
      enterQueue in interface Notifier
    • exitProcessor

      public void exitProcessor(int jobId, int processorId, double time)
      Specified by:
      exitProcessor in interface Notifier
    • exitQueue

      public void exitQueue(int jobId, double time)
      Specified by:
      exitQueue in interface Notifier
    • exitSystem

      public void exitSystem(int jobId, int processorId, double enterQueueTime, double enterCpuTime, double exitSystemTime)
      Specified by:
      exitSystem in interface Notifier
    • jobLost

      public void jobLost(int jobId, double time)
      Specified by:
      jobLost in interface Notifier
    • reset

      public void reset()
      Specified by:
      reset in interface Notifier
    • updateProcessor

      public void updateProcessor(int jobId, int processorId, double remainingTime, double time)
      Specified by:
      updateProcessor in interface Notifier
    • updateQueue

      public void updateQueue(int jobId, double time)
      Specified by:
      updateQueue in interface Notifier