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.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 JButton
private JButton
private JButton
private JButton
private JButton
private JButton
private JCheckBox
private JCheckBox
private JComboBox
private JComboBox
private JComboBox
private JComboBox
private static final boolean
Identification of the first date within selected period.private HistoryChart
History chart painter.private JTree
private static final boolean
Identification of the last date within selected period.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 Date
Currently selected time period.private JPanel
private JPanel
private JPanel
private JPanel
private JPanel
private JPanel
private JPanel
private JPanel
private Integer
Last correct value of spMinus setting specified by user.private Integer
Last correct value of spPlus setting specified by user.private JRadioButton
private JRadioButton
private JRadioButton
private static final int
Index of day time scaleprivate static final int
Index of month time scaleprivate static final int
Index of week time scaleprivate static final int
Index of year time scaleprivate JScrollPane
private JSpinner
private JSpinner
private JScrollPane
private JScrollPane
private JTable
private JTable
private JTabbedPane
private JTextField
private JTextField
private JTextField
private JTextField
private JTextField
private JTextField
private JTextField
private JTextField
private JTextField
private JTextField
Fields 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 void
Method called when Add Filter button was pressed.private void
Method called when backward button was pressed.private void
Method called when Edit Filter button was pressed.private void
Method called when forward button was pressed.private void
Method called when Remove Filter button was pressed.private void
Method called when generate report button was clicked.private void
Method called when checkbox "Group tasks with same name" is un/checked.private void
Method called when highlight tasks checkbox is un/checked.private void
Checks whether edit and remove filter buttons should be enabled.private void
Method called when selection of content item has changed.private void
Method called when selection of content rule item has changed.private void
Method called when selection of filter item has changed.private void
Method called when period scale should be changed.private void
Takes all tasks from days in the selected period and filters them using all defined filters.private void
formMouseMoved
(MouseEvent evt) private Date
getDate
(boolean date) Returns either first or last date of selected period interval whose data should be processed in the history view.private Vector
getDays()
Returns all days in selected period interval whose tasks will be processed.private AbstractTaskFilter
Returns 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 void
This method is called from within the constructor to initialize the form.private void
private void
Sets content rules and values according to saved user customizations.private void
private void
private void
void
Method called when some property of task was changed.private void
Method called when from/to chart type is required.private void
private void
Method called when total times chart type is required.void
Saves setup customized by user e.g.private void
Sets content rules and values according to currently selected task filter.private Date
shiftPeriod
(int step) Shifts selected period for given steps based on currently selected time scale.private void
private void
Method called when minus spinner was pressed.private void
Method called when plus spinner was pressed.private void
private void
private void
Method called when user clicked into tables of filters.private void
Method called when any key is typed in content textfield.private void
Method called when date textfield was clicked to select actual day/week/month/year.private void
Updates information about total time.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
-
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:
getFont
in interfaceMenuContainer
- Overrides:
getFont
in 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:
propertyChange
in interfacePropertyChangeListener
- Parameters:
evt
- Event describing what was changed.
-