Class HistoryChart

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

public class HistoryChart extends JPanel implements PropertyChangeListener
Chart showing either from/to or total times in given period scale.
See Also:
  • Field Details

    • TYPE_TOTAL

      public static final int TYPE_TOTAL
      Chart displaying total times for days.
      See Also:
    • TYPE_FROM_TO

      public static final int TYPE_FROM_TO
      Chart displaying from/to times for days.
      See Also:
    • TYPE_TIME_USAGE

      public static final int TYPE_TIME_USAGE
      Chart displaying used/wasted time ratio.
      See Also:
  • Constructor Details

    • HistoryChart

      public HistoryChart(Vector days, AbstractTaskFilter taskFilter, int chartType)
      Creates a new history chart.
      Parameters:
      days - Days that should be used to draw history chart.
      taskFilter - Filter for highlighting tasks when drawing chart.
      chartType - Type of history chart to be drawn.
  • Method Details

    • setDays

      public void setDays(Vector days)
      Sets which days should be used to draw history chart.
      Parameters:
      days - Days that should be used to draw history chart.
    • setHighlightingFilter

      public void setHighlightingFilter(AbstractTaskFilter taskFilter)
      Sets task filter for highlighting tasks when drawing chart.
      Parameters:
      taskFilter - Filter that will be used to select tasks that will be highlighted when drawing total times chart.
    • setChartType

      public void setChartType(int chartType)
      Sets type of history chart to be drawn.
      Parameters:
      chartType - Type of history chart to be drawn.
    • paint

      public void paint(Graphics graphics)
      Draws the chart of specified type from given days.
      Overrides:
      paint in class JComponent
      Parameters:
      graphics - Graphics area where the chart should be drawn.
    • getDayAt

      public Day getDayAt(Point point)
      Returns day represented by column at specified point.
      Parameters:
      point - Point to be checked for existency of day column.
      Returns:
      Day painted at given point or null if there is no day column at specified X position.
    • 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.