Class AnalyticsView

All Implemented Interfaces:
ImageObserver, MenuContainer, PropertyChangeListener, Serializable, EventListener, Accessible

public class AnalyticsView extends JPanel implements PropertyChangeListener
Panel providing comparison of current user's weekly times with other Rachota users and analytics summary and recommendations.
See Also:
  • Field Details

    • lbCategorization

      private JLabel lbCategorization
    • lbCategorizationResult

      private JLabel lbCategorizationResult
    • lbEffectivity

      private JLabel lbEffectivity
    • lbEffectivityResult

      private JLabel lbEffectivityResult
    • lbGranularity

      private JLabel lbGranularity
    • lbGranularityResult

      private JLabel lbGranularityResult
    • lbPrioritization

      private JLabel lbPrioritization
    • lbPrioritizationResult

      private JLabel lbPrioritizationResult
    • lbRepetition

      private JLabel lbRepetition
    • lbRepetitionResult

      private JLabel lbRepetitionResult
    • lbStatusing

      private JLabel lbStatusing
    • lbStatusingResult

      private JLabel lbStatusingResult
    • pnAnalysis

      private JPanel pnAnalysis
    • pnChart

      private JPanel pnChart
    • pnSuggestions

      private JPanel pnSuggestions
    • pnTimeUsage

      private JPanel pnTimeUsage
    • rbAllTime

      private JRadioButton rbAllTime
    • rbMonth

      private JRadioButton rbMonth
    • rbWeek

      private JRadioButton rbWeek
    • spSuggestions

      private JScrollPane spSuggestions
    • tpSuggestions

      private JTextPane tpSuggestions
    • SCALE_PAST_WEEK

      public static final int SCALE_PAST_WEEK
      Index of past week scale
      See Also:
    • SCALE_PAST_MONTH

      public static final int SCALE_PAST_MONTH
      Index of past month scale
      See Also:
    • SCALE_WHOLE_TIME

      public static final int SCALE_WHOLE_TIME
      Index of whole time scale
      See Also:
    • usageTimesAll

      private String usageTimesAll
      Usage times downloaded from Rachota Analytics server in format: totalTime|idleTime|privateTime
    • usageTimesUser

      private String usageTimesUser
      Usage times calculated for user in format: totalTime|idleTime|privateTime
    • comparisonChart

      private ComparisonChart comparisonChart
      Comparison chart showing average weekly usage times
    • effectivity

      private float effectivity
      How much user is effective in using his working hours. More idle time means less effectivity.
    • granularity

      private float granularity
      How much time an average task take. Does user create too many or too little tasks?
    • prioritization

      private float prioritization
      Distribution of priorities across tasks. Does user utilize task priorities enough?
    • categorization

      private float categorization
      Usage of categories across tasks. Does user specify categories for tasks enough?
    • statusing

      private float statusing
      Usage of all statuses. Does user close tasks or leaves them open forever?
    • repetition

      private float repetition
      Clever usage of regular tasks. How many irregular tasks do actually repeat often?
  • Constructor Details

    • AnalyticsView

      public AnalyticsView()
      Creates new HistoryView panel charts and table.
  • Method Details

    • getFont

      public Font getFont()
      Returns font that should be used for all widgets in this component based on the language preferences specified by user.
      Specified by:
      getFont in interface MenuContainer
      Overrides:
      getFont in class Component
      Returns:
      Font to be used in this component.
    • countEffectivity

      private float countEffectivity(int scale)
      Counts how much user is effective in using his/her working hours in given period. More idle time means less effectivity.
      Parameters:
      scale - One of three possible time scales.
      Returns:
      Computed effectivity factor.
    • updateEffectivity

      private void updateEffectivity(int scale)
      Counts effectivity factor in given period and updates users star ranking.
      Parameters:
      scale - One of three possible time scales.
    • countCategorization

      private float countCategorization(int scale)
      Counts usage of categories across tasks in given period. Does user specify categories for tasks enough?
      Parameters:
      scale - One of three possible time scales.
      Returns:
      Computed categorization factor.
    • updateCategorization

      private void updateCategorization(int scale)
      Counts categorization factor in given period and updates users star ranking.
      Parameters:
      scale - One of three possible time scales.
    • countGranularity

      private float countGranularity(int scale)
      In given period counts distribution of tasks durations in selected shares intervals and compares it to normal distribution. Does user create too many or too little tasks?
      Parameters:
      scale - One of three possible time scales.
      Returns:
      Computed granularity factor.
    • updateGranularity

      private void updateGranularity(int scale)
      Counts granularity factor in given period and updates users star ranking.
      Parameters:
      scale - One of three possible time scales.
    • countPrioritization

      private float countPrioritization(int scale)
      Counts distribution of priorities across tasks in given period. Does user utilize task priorities enough?
      Parameters:
      scale - One of three possible time scales.
      Returns:
      Computed prioritization factor.
    • updatePrioritization

      private void updatePrioritization(int scale)
      Counts prioritization factor in given period and updates users star ranking.
      Parameters:
      scale - One of three possible time scales.
    • countRepetition

      private float countRepetition(int scale)
      Verifies clever usage of regular tasks in given period. How many irregular tasks do actually repeat often? And how many regular tasks are useless?
      Parameters:
      scale - One of three possible time scales.
      Returns:
      Computed repetition factor.
    • updateRepetition

      private void updateRepetition(int scale)
      Counts repetition factor in given period and updates users star ranking.
      Parameters:
      scale - One of three possible time scales.
    • countStatusing

      private float countStatusing(int scale)
      Counts usage of DONE status in given period. Does user close tasks or leaves them open forever?
      Parameters:
      scale - One of three possible time scales.
      Returns:
      Computed statusing factor.
    • updateStatusing

      private void updateStatusing(int scale)
      Counts statusing factor in given period and updates users star ranking.
      Parameters:
      scale - One of three possible time scales.
    • getIdleTimeAll

      private long getIdleTimeAll()
      Returns idle time of all Rachota users worldwide in milliseconds.
      Returns:
      Time of all Rachota users worldwide spent in idle mode in milliseconds.
    • getPrivateTimeAll

      private long getPrivateTimeAll()
      Returns private time of all Rachota users worldwide in milliseconds.
      Returns:
      Time spent on private tasks of all Rachota users worldwide in milliseconds.
    • getTotalTimeAll

      private long getTotalTimeAll()
      Returns total working time of all Rachota users worldwide in milliseconds.
      Returns:
      Time spent on non-private and non-idle tasks of all Rachota users worldwide in milliseconds.
    • getIdleTimeUser

      private long getIdleTimeUser()
      Returns idle time of current Rachota user in milliseconds.
      Returns:
      Time of current Rachota user spent in idle mode in milliseconds.
    • getPrivateTimeUser

      private long getPrivateTimeUser()
      Returns private time of current Rachota user in milliseconds.
      Returns:
      Time of current Rachota user spent on private tasks in milliseconds.
    • getTotalTimeUser

      private long getTotalTimeUser()
      Returns total working time of current Rachota user in milliseconds.
      Returns:
      Time of current Rachota user spent on working in milliseconds.
    • downloadTimesAll

      private boolean downloadTimesAll()
      Tries to download usage times from Rachota Analytics server and reports success or failure.
      Returns:
      Returns true if usage times were successfully downloaded. If server didn't provide the number due to missing activity report or it couldn't be even contacted false is returned.
    • countUserTimes

      private void countUserTimes(int scale)
      Computes total, idle and private times of current user in given time scale.
      Parameters:
      scale - One of three possible time scales: past week, past month or whole time.
    • initComponents

      private void initComponents()
      This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
    • rbAllTimeActionPerformed

      private void rbAllTimeActionPerformed(ActionEvent evt)
      Method called when All time radio button was clicked.
      Parameters:
      evt - Event that invoked the action.
    • rbWeekActionPerformed

      private void rbWeekActionPerformed(ActionEvent evt)
      Method called when Last week radio button was clicked.
      Parameters:
      evt - Event that invoked the action.
    • rbMonthActionPerformed

      private void rbMonthActionPerformed(ActionEvent evt)
      Method called when Last month radio button was clicked.
      Parameters:
      evt - Event that invoked the action.
    • formMouseMoved

      private void formMouseMoved(MouseEvent evt)
    • updateChart

      public void updateChart()
      Downloads working times of other users and updates comparison chart.
    • propertyChange

      public void propertyChange(PropertyChangeEvent evt)
      Method called when some setting has changed.
      Specified by:
      propertyChange in interface PropertyChangeListener
      Parameters:
      evt - Event describing what was changed.
    • updateAnalysis

      private void updateAnalysis(int scale)
      Updates all efficiency factors in selected time scale.
      Parameters:
      scale - One of three possible time scales: past week, past month or whole time.
    • getWeeklyAnalysis

      public String getWeeklyAnalysis()
      Returns all efficiency factors as a text separated by | character.
      Returns:
      All efficiency factors as a text separated by | character.
    • updateSuggestions

      private void updateSuggestions()
      Prepares suggestions and displays them.
    • getIcon

      private ImageIcon getIcon(int ranking)
      Returns image with appropriate number of highlighted stars based on given ranking.
      Parameters:
      ranking - Number (0-5) specifying required ranking.
      Returns:
      Image with appropriate number of highlighted stars.
    • getSuggestions

      private String getSuggestions()
      Returns compiled summary of all suitable suggestions.
      Returns:
      Summary of all suitable suggestions based on effectivity of user.