Package org.cesilko.rachota.gui
Class AnalyticsView
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.cesilko.rachota.gui.AnalyticsView
- All Implemented Interfaces:
ImageObserver
,MenuContainer
,PropertyChangeListener
,Serializable
,EventListener
,Accessible
Panel providing comparison of current user's weekly times with
other Rachota users and analytics summary and recommendations.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate float
Usage of categories across tasks.private ComparisonChart
Comparison chart showing average weekly usage timesprivate float
How much user is effective in using his working hours.private float
How much time an average task take.private JLabel
private JLabel
private JLabel
private JLabel
private JLabel
private JLabel
private JLabel
private JLabel
private JLabel
private JLabel
private JLabel
private JLabel
private JPanel
private JPanel
private JPanel
private JPanel
private float
Distribution of priorities across tasks.private JRadioButton
private JRadioButton
private JRadioButton
private float
Clever usage of regular tasks.static final int
Index of past month scalestatic final int
Index of past week scalestatic final int
Index of whole time scaleprivate JScrollPane
private float
Usage of all statuses.private JTextPane
private String
Usage times downloaded from Rachota Analytics server in format: totalTime|idleTime|privateTimeprivate String
Usage times calculated for user in format: totalTime|idleTime|privateTimeFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Fields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate float
countCategorization
(int scale) Counts usage of categories across tasks in given period.private float
countEffectivity
(int scale) Counts how much user is effective in using his/her working hours in given period.private float
countGranularity
(int scale) In given period counts distribution of tasks durations in selected shares intervals and compares it to normal distribution.private float
countPrioritization
(int scale) Counts distribution of priorities across tasks in given period.private float
countRepetition
(int scale) Verifies clever usage of regular tasks in given period.private float
countStatusing
(int scale) Counts usage of DONE status in given period.private void
countUserTimes
(int scale) Computes total, idle and private times of current user in given time scale.private boolean
Tries to download usage times from Rachota Analytics server and reports success or failure.private void
formMouseMoved
(MouseEvent evt) getFont()
Returns font that should be used for all widgets in this component based on the language preferences specified by user.private ImageIcon
getIcon
(int ranking) Returns image with appropriate number of highlighted stars based on given ranking.private long
Returns idle time of all Rachota users worldwide in milliseconds.private long
Returns idle time of current Rachota user in milliseconds.private long
Returns private time of all Rachota users worldwide in milliseconds.private long
Returns private time of current Rachota user in milliseconds.private String
Returns compiled summary of all suitable suggestions.private long
Returns total working time of all Rachota users worldwide in milliseconds.private long
Returns total working time of current Rachota user in milliseconds.Returns all efficiency factors as a text separated by | character.private void
This method is called from within the constructor to initialize the form.void
Method called when some setting has changed.private void
Method called when All time radio button was clicked.private void
Method called when Last month radio button was clicked.private void
Method called when Last week radio button was clicked.private void
updateAnalysis
(int scale) Updates all efficiency factors in selected time scale.private void
updateCategorization
(int scale) Counts categorization factor in given period and updates users star ranking.void
Downloads working times of other users and updates comparison chart.private void
updateEffectivity
(int scale) Counts effectivity factor in given period and updates users star ranking.private void
updateGranularity
(int scale) Counts granularity factor in given period and updates users star ranking.private void
updatePrioritization
(int scale) Counts prioritization factor in given period and updates users star ranking.private void
updateRepetition
(int scale) Counts repetition factor in given period and updates users star ranking.private void
updateStatusing
(int scale) Counts statusing factor in given period and updates users star ranking.private void
Prepares suggestions and displays them.Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
lbCategorization
-
lbCategorizationResult
-
lbEffectivity
-
lbEffectivityResult
-
lbGranularity
-
lbGranularityResult
-
lbPrioritization
-
lbPrioritizationResult
-
lbRepetition
-
lbRepetitionResult
-
lbStatusing
-
lbStatusingResult
-
pnAnalysis
-
pnChart
-
pnSuggestions
-
pnTimeUsage
-
rbAllTime
-
rbMonth
-
rbWeek
-
spSuggestions
-
tpSuggestions
-
SCALE_PAST_WEEK
public static final int SCALE_PAST_WEEKIndex of past week scale- See Also:
-
SCALE_PAST_MONTH
public static final int SCALE_PAST_MONTHIndex of past month scale- See Also:
-
SCALE_WHOLE_TIME
public static final int SCALE_WHOLE_TIMEIndex of whole time scale- See Also:
-
usageTimesAll
Usage times downloaded from Rachota Analytics server in format: totalTime|idleTime|privateTime -
usageTimesUser
Usage times calculated for user in format: totalTime|idleTime|privateTime -
comparisonChart
Comparison chart showing average weekly usage times -
effectivity
private float effectivityHow much user is effective in using his working hours. More idle time means less effectivity. -
granularity
private float granularityHow much time an average task take. Does user create too many or too little tasks? -
prioritization
private float prioritizationDistribution of priorities across tasks. Does user utilize task priorities enough? -
categorization
private float categorizationUsage of categories across tasks. Does user specify categories for tasks enough? -
statusing
private float statusingUsage of all statuses. Does user close tasks or leaves them open forever? -
repetition
private float repetitionClever 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
Returns font that should be used for all widgets in this component based on the language preferences specified by user.- Specified by:
getFont
in interfaceMenuContainer
- Overrides:
getFont
in classComponent
- 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
Method called when All time radio button was clicked.- Parameters:
evt
- Event that invoked the action.
-
rbWeekActionPerformed
Method called when Last week radio button was clicked.- Parameters:
evt
- Event that invoked the action.
-
rbMonthActionPerformed
Method called when Last month radio button was clicked.- Parameters:
evt
- Event that invoked the action.
-
formMouseMoved
-
updateChart
public void updateChart()Downloads working times of other users and updates comparison chart. -
propertyChange
Method called when some setting has changed.- Specified by:
propertyChange
in interfacePropertyChangeListener
- 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
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
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
Returns compiled summary of all suitable suggestions.- Returns:
- Summary of all suitable suggestions based on effectivity of user.
-