Package org.cesilko.rachota.gui
Class HistoryView
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.cesilko.rachota.gui.HistoryView
- All Implemented Interfaces:
ImageObserver,MenuContainer,PropertyChangeListener,Serializable,EventListener,Accessible
Panel providing history view on tasks from the past.
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanelNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate JButtonprivate JButtonprivate JButtonprivate JButtonprivate JButtonprivate JButtonprivate JCheckBoxprivate JCheckBoxprivate JComboBoxprivate JComboBoxprivate JComboBoxprivate JComboBoxprivate static final booleanIdentification of the first date within selected period.private HistoryChartHistory chart painter.private JTreeprivate static final booleanIdentification of the last date within selected period.private JLabelprivate JLabelprivate JLabelprivate JLabelprivate JLabelprivate JLabelprivate JLabelprivate JLabelprivate JLabelprivate JLabelprivate JLabelprivate JLabelprivate DateCurrently selected time period.private JPanelprivate JPanelprivate JPanelprivate JPanelprivate JPanelprivate JPanelprivate JPanelprivate JPanelprivate IntegerLast correct value of spMinus setting specified by user.private IntegerLast correct value of spPlus setting specified by user.private JRadioButtonprivate JRadioButtonprivate JRadioButtonprivate static final intIndex of day time scaleprivate static final intIndex of month time scaleprivate static final intIndex of week time scaleprivate static final intIndex of year time scaleprivate JScrollPaneprivate JSpinnerprivate JSpinnerprivate JScrollPaneprivate JScrollPaneprivate JTableprivate JTableprivate JTabbedPaneprivate JTextFieldprivate JTextFieldprivate JTextFieldprivate JTextFieldprivate JTextFieldprivate JTextFieldprivate JTextFieldprivate JTextFieldprivate JTextFieldprivate JTextFieldFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidMethod called when Add Filter button was pressed.private voidMethod called when backward button was pressed.private voidMethod called when Edit Filter button was pressed.private voidMethod called when forward button was pressed.private voidMethod called when Remove Filter button was pressed.private voidMethod called when generate report button was clicked.private voidMethod called when checkbox "Group tasks with same name" is un/checked.private voidMethod called when highlight tasks checkbox is un/checked.private voidChecks whether edit and remove filter buttons should be enabled.private voidMethod called when selection of content item has changed.private voidMethod called when selection of content rule item has changed.private voidMethod called when selection of filter item has changed.private voidMethod called when period scale should be changed.private voidTakes all tasks from days in the selected period and filters them using all defined filters.private voidformMouseMoved(MouseEvent evt) private DategetDate(boolean date) Returns either first or last date of selected period interval whose data should be processed in the history view.private VectorgetDays()Returns all days in selected period interval whose tasks will be processed.private AbstractTaskFilterReturns task filter object based on currently selected options.getFont()Returns font that should be used for all widgets in this component based on the language preferences specified by user.private voidThis method is called from within the constructor to initialize the form.private voidprivate voidSets content rules and values according to saved user customizations.private voidprivate voidprivate voidvoidMethod called when some property of task was changed.private voidMethod called when from/to chart type is required.private voidprivate voidMethod called when total times chart type is required.voidSaves setup customized by user e.g.private voidSets content rules and values according to currently selected task filter.private DateshiftPeriod(int step) Shifts selected period for given steps based on currently selected time scale.private voidprivate voidMethod called when minus spinner was pressed.private voidMethod called when plus spinner was pressed.private voidprivate voidprivate voidMethod called when user clicked into tables of filters.private voidMethod called when any key is typed in content textfield.private voidMethod called when date textfield was clicked to select actual day/week/month/year.private voidUpdates information about total time.Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods 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, updateMethods 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, validateTreeMethods 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
-
btAddFilter
-
btBackward
-
btEditFilter
-
btForward
-
btRemoveFilter
-
btReport
-
chbGroupTasks
-
chbHighlightTasks
-
cmbContent
-
cmbContentRule
-
cmbFilterName
-
cmbPeriod
-
jtProjects
-
lbTasks
-
lblChartType
-
lblFilteredTime
-
lblFilters
-
lblName
-
lblPercentage
-
lblPeriod
-
lblPriority
-
lblState
-
lblTasks
-
lblTime
-
lblTotalTime
-
pnButtons
-
pnDetails
-
pnPeriod
-
pnProjects
-
pnTasks
-
pnTimes
-
pnTotalTime
-
rbFromTo
-
rbTimeUsage
-
rbTotal
-
spFilters
-
spMinus
-
spPlus
-
spProjects
-
spTasks
-
tbFilters
-
tbTasks
-
tpViews
-
txtContent
-
txtDate
-
txtFilteredTime
-
txtName
-
txtPercentage
-
txtPriority
-
txtState
-
txtTasks
-
txtTime
-
txtTotalTime
-
SCALE_DAY
private static final int SCALE_DAYIndex of day time scale- See Also:
-
SCALE_WEEK
private static final int SCALE_WEEKIndex of week time scale- See Also:
-
SCALE_MONTH
private static final int SCALE_MONTHIndex of month time scale- See Also:
-
SCALE_YEAR
private static final int SCALE_YEARIndex of year time scale- See Also:
-
previousPlus
Last correct value of spPlus setting specified by user. -
previousMinus
Last correct value of spMinus setting specified by user. -
historyChart
History chart painter. -
period
Currently selected time period. -
FIRST_DATE
private static final boolean FIRST_DATEIdentification of the first date within selected period.- See Also:
-
LAST_DATE
private static final boolean LAST_DATEIdentification of the last date within selected period.- See Also:
-
-
Constructor Details
-
HistoryView
public HistoryView()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:
getFontin interfaceMenuContainer- Overrides:
getFontin classComponent- Returns:
- Font to be used in this component.
-
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. -
rbTimeUsageActionPerformed
-
tbFiltersKeyReleased
-
btReportActionPerformed
Method called when generate report button was clicked.- Parameters:
evt- Event that invoked the action.
-
chbHighlightTasksActionPerformed
Method called when highlight tasks checkbox is un/checked.- Parameters:
evt- Event that invoked the action.
-
rbFromToActionPerformed
Method called when from/to chart type is required.- Parameters:
evt- Event that invoked the action.
-
rbTotalActionPerformed
Method called when total times chart type is required.- Parameters:
evt- Event that invoked the action.
-
txtContentKeyTyped
Method called when any key is typed in content textfield.- Parameters:
evt- Event that invoked the action.
-
cmbContentItemStateChanged
Method called when selection of content item has changed.- Parameters:
evt- Event that invoked the action.
-
cmbContentRuleItemStateChanged
Method called when selection of content rule item has changed.- Parameters:
evt- Event that invoked the action.
-
cmbFilterNameItemStateChanged
Method called when selection of filter item has changed.- Parameters:
evt- Event that invoked the action.
-
chbGroupTasksActionPerformed
Method called when checkbox "Group tasks with same name" is un/checked.- Parameters:
evt- Event that invoked this action.
-
tbFiltersMouseClicked
Method called when user clicked into tables of filters.- Parameters:
evt- Event that invoked this action.
-
btEditFilterActionPerformed
Method called when Edit Filter button was pressed.- Parameters:
evt- Event that invoked this action.
-
btRemoveFilterActionPerformed
Method called when Remove Filter button was pressed.- Parameters:
evt- Event that invoked this action.
-
btAddFilterActionPerformed
Method called when Add Filter button was pressed.- Parameters:
evt- Event that invoked this action.
-
txtDateMouseClicked
Method called when date textfield was clicked to select actual day/week/month/year.- Parameters:
evt- Event that invoked the action.
-
cmbPeriodItemStateChanged
Method called when period scale should be changed.- Parameters:
evt- Event that invoked the action.
-
btForwardActionPerformed
Method called when forward button was pressed.- Parameters:
evt- Event that invoked the action.
-
btBackwardActionPerformed
Method called when backward button was pressed.- Parameters:
evt- Event that invoked the action.
-
spPlusStateChanged
Method called when plus spinner was pressed.- Parameters:
evt- Event that invoked the action.
-
spMinusStateChanged
Method called when minus spinner was pressed.- Parameters:
evt- Event that invoked the action.
-
formMouseMoved
-
pnTimesMouseMoved
-
pnTasksMouseMoved
-
pnProjectsMouseMoved
-
jtProjectsMouseMoved
-
spFiltersMouseMoved
-
spTasksMouseMoved
-
shiftPeriod
Shifts selected period for given steps based on currently selected time scale. For example if "day" is selected and step is -1, it returns date before selected one.- Parameters:
step- Number of units to be added/substracted.- Returns:
- Date determined as period + step * scale.
-
getDate
Returns either first or last date of selected period interval whose data should be processed in the history view.- Parameters:
date- If true, first date of period interval will be returned or last interval date if false.- Returns:
- First or last date of period interval.
-
getDays
Returns all days in selected period interval whose tasks will be processed.- Returns:
- All days in selected period interval whose tasks will be processed.
-
checkButtons
private void checkButtons()Checks whether edit and remove filter buttons should be enabled. -
filterTasks
private void filterTasks()Takes all tasks from days in the selected period and filters them using all defined filters. -
loadSetup
private void loadSetup()Sets content rules and values according to saved user customizations. -
setComponents
private void setComponents()Sets content rules and values according to currently selected task filter. -
getFilter
Returns task filter object based on currently selected options.- Returns:
- Task filter object based on currently selected options.
-
updateTotalTime
private void updateTotalTime()Updates information about total time. -
saveSetup
public void saveSetup()Saves setup customized by user e.g. time scale, highlighted tasks etc. -
propertyChange
Method called when some property of task was changed.- Specified by:
propertyChangein interfacePropertyChangeListener- Parameters:
evt- Event describing what was changed.
-