Class DayView

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

public class DayView extends JPanel implements ClockListener, PropertyChangeListener
Panel showing tasks planned for one day and manipulation with them.
See Also:
  • Constructor Details

    • DayView

      public DayView()
      Creates new DayView panel containing tasks planned for given day.
  • 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.
    • adjustStartTime

      public void adjustStartTime(Frame parent)
      Method called when user wants to adjust day start time.
      Parameters:
      parent - Main window which called this method to set correct location.
    • switchDate

      public void switchDate(Frame parent)
      Method called when switch date action is required.
    • moveTime

      public void moveTime(Frame parent)
      Method called when move time action is required.
    • copyTask

      public void copyTask(Frame parent)
      Method called when copy task action is required.
    • correctTaskDuration

      public void correctTaskDuration(Frame parent)
      Method called when correct task duration action is required.
      Parameters:
      parent - Main window which called this method to set correct location.
    • addNote

      public void addNote(Frame parent)
      Method called when add note to task action is required.
      Parameters:
      parent - Main window which called this method to set correct location.
    • setFinishedTasksVisibility

      public void setFinishedTasksVisibility(boolean visibility)
      Set whether finished tasks should be displayed or not.
      Parameters:
      visibility - Should be finished tasks displayed or not ?
    • getTitleSuffix

      public String getTitleSuffix()
      Get suffix to be appended to title of application depending on user preference.
      Returns:
      Title suffix: name of current task and/or total/task time or nothing.
    • tick

      public void tick()
      Method called when one clock tick is over.
      Specified by:
      tick in interface ClockListener
    • setTask

      public void setTask(Task task, boolean startTask)
      Set description of selected task and start it if required.
      Parameters:
      task - Task to be selected.
      startTask - Whether the task should be started.
    • getDay

      public Day getDay()
      Returns day that is currently being displayed.
      Returns:
      Day that is currently displayed by day view.
    • getTask

      public Task getTask()
      Returns task that is currently selected.
      Returns:
      Task that is currently selected or null if none is selected.
    • 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.
    • pauseTask

      public void pauseTask()
      Stops working on currently selected running task.
    • startTask

      public void startTask()
      Starts working on currently selected task.
    • finishTask

      public void finishTask()
      Finishes working on currently selected task.
    • selectTask

      public void selectTask(Task task)
      Sets given task as selected and starts to work on it.
      Parameters:
      task - Task that will be selected and run.