Class ComparisonChart

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class ComparisonChart extends JPanel
Chart showing comparison of current user's usage times with other Rachota users.
See Also:
  • Field Details

    • totalTimeUser

      private long totalTimeUser
      Total working time of current user.
    • totalTimeAll

      private long totalTimeAll
      Total working time of all users.
    • idleTimeUser

      private long idleTimeUser
      Total idle time of current user.
    • idleTimeAll

      private long idleTimeAll
      Total idle time of all users.
    • privateTimeUser

      private long privateTimeUser
      Total private time of current user.
    • privateTimeAll

      private long privateTimeAll
      Total private time of all users.
    • message

      private String message
      Error message to be displayed instead of chart in case of problems.
    • hint

      private String hint
      Hint message to help user understand/resolve possible problems.
    • INSET_TOP

      private static int INSET_TOP
      Top inset
    • INSET_BOTTOM

      private static int INSET_BOTTOM
      Bottom inset
    • INSET_LEFT

      private static int INSET_LEFT
      Left inset
    • INSET_RIGHT

      private static int INSET_RIGHT
      Right inset
  • Constructor Details

    • ComparisonChart

      public ComparisonChart()
      Creates a new comparison chart.
  • Method Details

    • paint

      public void paint(Graphics graphics)
      Draws the pie chart given set share.
      Overrides:
      paint in class JComponent
      Parameters:
      graphics - Graphics area where the chart should be drawn.
    • setTimes

      public void setTimes(long totalTimeUser, long totalTimeAll, long idleTimeUser, long idleTimeAll, long privateTimeUser, long privateTimeAll)
    • setMessage

      void setMessage(String message, String hint)
    • drawColumn

      private void drawColumn(int x, int y, int columnWidth, int columnHeight, Color color, String textBelow, String textAbove, Graphics graphics)