Class HistoryView

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

public class HistoryView extends JPanel implements PropertyChangeListener
Panel providing history view on tasks from the past.
See Also:
  • Field Details

    • btAddFilter

      private JButton btAddFilter
    • btBackward

      private JButton btBackward
    • btEditFilter

      private JButton btEditFilter
    • btForward

      private JButton btForward
    • btRemoveFilter

      private JButton btRemoveFilter
    • btReport

      private JButton btReport
    • chbGroupTasks

      private JCheckBox chbGroupTasks
    • chbHighlightTasks

      private JCheckBox chbHighlightTasks
    • cmbContent

      private JComboBox cmbContent
    • cmbContentRule

      private JComboBox cmbContentRule
    • cmbFilterName

      private JComboBox cmbFilterName
    • cmbPeriod

      private JComboBox cmbPeriod
    • jtProjects

      private JTree jtProjects
    • lbTasks

      private JLabel lbTasks
    • lblChartType

      private JLabel lblChartType
    • lblFilteredTime

      private JLabel lblFilteredTime
    • lblFilters

      private JLabel lblFilters
    • lblName

      private JLabel lblName
    • lblPercentage

      private JLabel lblPercentage
    • lblPeriod

      private JLabel lblPeriod
    • lblPriority

      private JLabel lblPriority
    • lblState

      private JLabel lblState
    • lblTasks

      private JLabel lblTasks
    • lblTime

      private JLabel lblTime
    • lblTotalTime

      private JLabel lblTotalTime
    • pnButtons

      private JPanel pnButtons
    • pnDetails

      private JPanel pnDetails
    • pnPeriod

      private JPanel pnPeriod
    • pnProjects

      private JPanel pnProjects
    • pnShare

      private JPanel pnShare
    • pnTasks

      private JPanel pnTasks
    • pnTimes

      private JPanel pnTimes
    • pnTotalTime

      private JPanel pnTotalTime
    • rbFromTo

      private JRadioButton rbFromTo
    • rbTimeUsage

      private JRadioButton rbTimeUsage
    • rbTotal

      private JRadioButton rbTotal
    • spFilters

      private JScrollPane spFilters
    • spMinus

      private JSpinner spMinus
    • spPlus

      private JSpinner spPlus
    • spProjects

      private JScrollPane spProjects
    • spTasks

      private JScrollPane spTasks
    • tbFilters

      private JTable tbFilters
    • tbTasks

      private JTable tbTasks
    • tpViews

      private JTabbedPane tpViews
    • txtContent

      private JTextField txtContent
    • txtDate

      private JTextField txtDate
    • txtFilteredTime

      private JTextField txtFilteredTime
    • txtName

      private JTextField txtName
    • txtPercentage

      private JTextField txtPercentage
    • txtPriority

      private JTextField txtPriority
    • txtState

      private JTextField txtState
    • txtTasks

      private JTextField txtTasks
    • txtTime

      private JTextField txtTime
    • txtTotalTime

      private JTextField txtTotalTime
    • SCALE_DAY

      private static final int SCALE_DAY
      Index of day time scale
      See Also:
    • SCALE_WEEK

      private static final int SCALE_WEEK
      Index of week time scale
      See Also:
    • SCALE_MONTH

      private static final int SCALE_MONTH
      Index of month time scale
      See Also:
    • SCALE_YEAR

      private static final int SCALE_YEAR
      Index of year time scale
      See Also:
    • previousPlus

      private Integer previousPlus
      Last correct value of spPlus setting specified by user.
    • previousMinus

      private Integer previousMinus
      Last correct value of spMinus setting specified by user.
    • historyChart

      private HistoryChart historyChart
      History chart painter.
    • period

      private Date period
      Currently selected time period.
    • FIRST_DATE

      private static final boolean FIRST_DATE
      Identification of the first date within selected period.
      See Also:
    • LAST_DATE

      private static final boolean LAST_DATE
      Identification of the last date within selected period.
      See Also:
  • Constructor Details

    • HistoryView

      public HistoryView()
      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.
    • 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

      private void rbTimeUsageActionPerformed(ActionEvent evt)
    • tbFiltersKeyReleased

      private void tbFiltersKeyReleased(KeyEvent evt)
    • btReportActionPerformed

      private void btReportActionPerformed(ActionEvent evt)
      Method called when generate report button was clicked.
      Parameters:
      evt - Event that invoked the action.
    • chbHighlightTasksActionPerformed

      private void chbHighlightTasksActionPerformed(ActionEvent evt)
      Method called when highlight tasks checkbox is un/checked.
      Parameters:
      evt - Event that invoked the action.
    • rbFromToActionPerformed

      private void rbFromToActionPerformed(ActionEvent evt)
      Method called when from/to chart type is required.
      Parameters:
      evt - Event that invoked the action.
    • rbTotalActionPerformed

      private void rbTotalActionPerformed(ActionEvent evt)
      Method called when total times chart type is required.
      Parameters:
      evt - Event that invoked the action.
    • txtContentKeyTyped

      private void txtContentKeyTyped(KeyEvent evt)
      Method called when any key is typed in content textfield.
      Parameters:
      evt - Event that invoked the action.
    • cmbContentItemStateChanged

      private void cmbContentItemStateChanged(ItemEvent evt)
      Method called when selection of content item has changed.
      Parameters:
      evt - Event that invoked the action.
    • cmbContentRuleItemStateChanged

      private void cmbContentRuleItemStateChanged(ItemEvent evt)
      Method called when selection of content rule item has changed.
      Parameters:
      evt - Event that invoked the action.
    • cmbFilterNameItemStateChanged

      private void cmbFilterNameItemStateChanged(ItemEvent evt)
      Method called when selection of filter item has changed.
      Parameters:
      evt - Event that invoked the action.
    • chbGroupTasksActionPerformed

      private void chbGroupTasksActionPerformed(ActionEvent evt)
      Method called when checkbox "Group tasks with same name" is un/checked.
      Parameters:
      evt - Event that invoked this action.
    • tbFiltersMouseClicked

      private void tbFiltersMouseClicked(MouseEvent evt)
      Method called when user clicked into tables of filters.
      Parameters:
      evt - Event that invoked this action.
    • btEditFilterActionPerformed

      private void btEditFilterActionPerformed(ActionEvent evt)
      Method called when Edit Filter button was pressed.
      Parameters:
      evt - Event that invoked this action.
    • btRemoveFilterActionPerformed

      private void btRemoveFilterActionPerformed(ActionEvent evt)
      Method called when Remove Filter button was pressed.
      Parameters:
      evt - Event that invoked this action.
    • btAddFilterActionPerformed

      private void btAddFilterActionPerformed(ActionEvent evt)
      Method called when Add Filter button was pressed.
      Parameters:
      evt - Event that invoked this action.
    • txtDateMouseClicked

      private void txtDateMouseClicked(MouseEvent evt)
      Method called when date textfield was clicked to select actual day/week/month/year.
      Parameters:
      evt - Event that invoked the action.
    • cmbPeriodItemStateChanged

      private void cmbPeriodItemStateChanged(ItemEvent evt)
      Method called when period scale should be changed.
      Parameters:
      evt - Event that invoked the action.
    • btForwardActionPerformed

      private void btForwardActionPerformed(ActionEvent evt)
      Method called when forward button was pressed.
      Parameters:
      evt - Event that invoked the action.
    • btBackwardActionPerformed

      private void btBackwardActionPerformed(ActionEvent evt)
      Method called when backward button was pressed.
      Parameters:
      evt - Event that invoked the action.
    • spPlusStateChanged

      private void spPlusStateChanged(ChangeEvent evt)
      Method called when plus spinner was pressed.
      Parameters:
      evt - Event that invoked the action.
    • spMinusStateChanged

      private void spMinusStateChanged(ChangeEvent evt)
      Method called when minus spinner was pressed.
      Parameters:
      evt - Event that invoked the action.
    • formMouseMoved

      private void formMouseMoved(MouseEvent evt)
    • pnTimesMouseMoved

      private void pnTimesMouseMoved(MouseEvent evt)
    • pnTasksMouseMoved

      private void pnTasksMouseMoved(MouseEvent evt)
    • pnProjectsMouseMoved

      private void pnProjectsMouseMoved(MouseEvent evt)
    • jtProjectsMouseMoved

      private void jtProjectsMouseMoved(MouseEvent evt)
    • spFiltersMouseMoved

      private void spFiltersMouseMoved(MouseEvent evt)
    • spTasksMouseMoved

      private void spTasksMouseMoved(MouseEvent evt)
    • shiftPeriod

      private Date shiftPeriod(int step)
      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

      private Date getDate(boolean date)
      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

      private Vector 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

      private AbstractTaskFilter 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

      public void propertyChange(PropertyChangeEvent evt)
      Method called when some property of task was changed.
      Specified by:
      propertyChange in interface PropertyChangeListener
      Parameters:
      evt - Event describing what was changed.