Class TaskDialog

  • All Implemented Interfaces:
    java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants

    public class TaskDialog
    extends javax.swing.JDialog
    Visualizer of task.
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class javax.swing.JDialog

        javax.swing.JDialog.AccessibleJDialog
      • Nested classes/interfaces inherited from class java.awt.Dialog

        java.awt.Dialog.AccessibleAWTDialog, java.awt.Dialog.ModalExclusionType, java.awt.Dialog.ModalityType
      • Nested classes/interfaces inherited from class java.awt.Window

        java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
      • Nested classes/interfaces inherited from class java.awt.Container

        java.awt.Container.AccessibleAWTContainer
      • Nested classes/interfaces inherited from class java.awt.Component

        java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private javax.swing.JButton btCancel  
      private javax.swing.JButton btOK  
      private javax.swing.JCheckBox chbAutoStart  
      private javax.swing.JCheckBox chbNotification  
      private javax.swing.JCheckBox chbPrivate  
      private javax.swing.JCheckBox chbRegular  
      private javax.swing.JCheckBox chbStartTask  
      private javax.swing.JComboBox cmbPriority  
      private javax.swing.JComboBox cmbRepetition  
      private Day day
      Day which new task should be added to.
      private javax.swing.JLabel lblCategory  
      private javax.swing.JLabel lblColon  
      private javax.swing.JLabel lblDescription  
      private javax.swing.JLabel lblNotes  
      private javax.swing.JLabel lblPriority  
      private javax.swing.JPanel pnButtons  
      private boolean readOnly
      Flag determining if task can be edited or not.
      private javax.swing.JSpinner spHours  
      private javax.swing.JSpinner spMinutes  
      private javax.swing.JScrollPane spNotes  
      private javax.swing.JTextArea taNotes  
      private Task task
      Task that is being edited.
      private javax.swing.JTextField txtCategory  
      private javax.swing.JTextField txtDescription  
      • Fields inherited from class javax.swing.JDialog

        accessibleContext, rootPane, rootPaneCheckingEnabled
      • Fields inherited from class java.awt.Dialog

        DEFAULT_MODALITY_TYPE
      • Fields inherited from class java.awt.Component

        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
      • Fields inherited from interface javax.swing.WindowConstants

        DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
    • Constructor Summary

      Constructors 
      Constructor Description
      TaskDialog()
      Creates new dialog for creating new regular task.
      TaskDialog​(Day day)
      Creates new dialog for creating new task for given day.
      TaskDialog​(RegularTask regularTask)
      Creates new dialog for editing existing regular task.
      TaskDialog​(Task task, Day day, boolean readOnly)
      Creates new dialog for editing of given task.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void btCancelActionPerformed​(java.awt.event.ActionEvent evt)
      Method called when cancel button was pressed.
      private void btOKActionPerformed​(java.awt.event.ActionEvent evt)
      Method called when ok button was pressed.
      private void chbAutoStartKeyPressed​(java.awt.event.KeyEvent evt)  
      private void chbNotificationChanged​(java.awt.event.ActionEvent evt)
      Method called when notification was turned on/off.
      private void chbNotificationKeyPressed​(java.awt.event.KeyEvent evt)  
      private void chbPrivateKeyPressed​(java.awt.event.KeyEvent evt)  
      private void chbRegularKeyPressed​(java.awt.event.KeyEvent evt)  
      private void chbStartTaskKeyPressed​(java.awt.event.KeyEvent evt)  
      private void closeDialog​(java.awt.event.WindowEvent evt)
      Method called when dialog should be closed.
      private void cmbPriorityKeyPressed​(java.awt.event.KeyEvent evt)  
      private void cmbRepetitionKeyPressed​(java.awt.event.KeyEvent evt)  
      private void formMouseEntered​(java.awt.event.MouseEvent evt)  
      java.awt.Font getFont()
      Returns font that should be used for all widgets in this component based on the language preferences specified by user.
      Task getTask()
      Return task that was edited or created by this dialog.
      private void initComponents()
      This method is called from within the constructor to initialize the form.
      void requestFocus()  
      private void spHoursKeyPressed​(java.awt.event.KeyEvent evt)  
      private void spHoursStateChanged​(javax.swing.event.ChangeEvent evt)
      Method called when hours of notification time were changed.
      private void spMinutesKeyPressed​(java.awt.event.KeyEvent evt)  
      private void spMinutesStateChanged​(javax.swing.event.ChangeEvent evt)
      Method called when minutes of notification time were changed.
      private void taNotesKeyPressed​(java.awt.event.KeyEvent evt)  
      private void txtCategoryFocusGained​(java.awt.event.FocusEvent evt)  
      private void txtCategoryFocusLost​(java.awt.event.FocusEvent evt)  
      private void txtCategoryKeyPressed​(java.awt.event.KeyEvent evt)  
      private void txtCategoryKeyTyped​(java.awt.event.KeyEvent evt)  
      private void txtDescriptionKeyPressed​(java.awt.event.KeyEvent evt)  
      • Methods inherited from class javax.swing.JDialog

        addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
      • Methods inherited from class java.awt.Dialog

        addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, setVisible, show, toBack
      • Methods inherited from class java.awt.Window

        addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, toFront
      • Methods inherited from class java.awt.Container

        add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • task

        private Task task
        Task that is being edited.
      • day

        private Day day
        Day which new task should be added to.
      • readOnly

        private boolean readOnly
        Flag determining if task can be edited or not.
      • btCancel

        private javax.swing.JButton btCancel
      • btOK

        private javax.swing.JButton btOK
      • chbAutoStart

        private javax.swing.JCheckBox chbAutoStart
      • chbNotification

        private javax.swing.JCheckBox chbNotification
      • chbPrivate

        private javax.swing.JCheckBox chbPrivate
      • chbRegular

        private javax.swing.JCheckBox chbRegular
      • chbStartTask

        private javax.swing.JCheckBox chbStartTask
      • cmbPriority

        private javax.swing.JComboBox cmbPriority
      • cmbRepetition

        private javax.swing.JComboBox cmbRepetition
      • lblCategory

        private javax.swing.JLabel lblCategory
      • lblColon

        private javax.swing.JLabel lblColon
      • lblDescription

        private javax.swing.JLabel lblDescription
      • lblNotes

        private javax.swing.JLabel lblNotes
      • lblPriority

        private javax.swing.JLabel lblPriority
      • pnButtons

        private javax.swing.JPanel pnButtons
      • spHours

        private javax.swing.JSpinner spHours
      • spMinutes

        private javax.swing.JSpinner spMinutes
      • spNotes

        private javax.swing.JScrollPane spNotes
      • taNotes

        private javax.swing.JTextArea taNotes
      • txtCategory

        private javax.swing.JTextField txtCategory
      • txtDescription

        private javax.swing.JTextField txtDescription
    • Constructor Detail

      • TaskDialog

        public TaskDialog​(Task task,
                          Day day,
                          boolean readOnly)
        Creates new dialog for editing of given task.
        Parameters:
        task - Task which is going to be edited.
        day - Day which the task belongs to.
        readOnly - Flag determining if task can be edited or not.
      • TaskDialog

        public TaskDialog​(Day day)
        Creates new dialog for creating new task for given day.
        Parameters:
        day - Day which new task should be added to.
      • TaskDialog

        public TaskDialog​(RegularTask regularTask)
        Creates new dialog for editing existing regular task.
        Parameters:
        regularTask - Regular task that should be edited.
      • TaskDialog

        public TaskDialog()
        Creates new dialog for creating new regular task.
    • Method Detail

      • getFont

        public java.awt.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 java.awt.MenuContainer
        Overrides:
        getFont in class java.awt.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.
      • chbPrivateKeyPressed

        private void chbPrivateKeyPressed​(java.awt.event.KeyEvent evt)
      • cmbRepetitionKeyPressed

        private void cmbRepetitionKeyPressed​(java.awt.event.KeyEvent evt)
      • chbRegularKeyPressed

        private void chbRegularKeyPressed​(java.awt.event.KeyEvent evt)
      • chbAutoStartKeyPressed

        private void chbAutoStartKeyPressed​(java.awt.event.KeyEvent evt)
      • spMinutesKeyPressed

        private void spMinutesKeyPressed​(java.awt.event.KeyEvent evt)
      • spHoursKeyPressed

        private void spHoursKeyPressed​(java.awt.event.KeyEvent evt)
      • chbNotificationKeyPressed

        private void chbNotificationKeyPressed​(java.awt.event.KeyEvent evt)
      • cmbPriorityKeyPressed

        private void cmbPriorityKeyPressed​(java.awt.event.KeyEvent evt)
      • taNotesKeyPressed

        private void taNotesKeyPressed​(java.awt.event.KeyEvent evt)
      • txtCategoryKeyPressed

        private void txtCategoryKeyPressed​(java.awt.event.KeyEvent evt)
      • txtDescriptionKeyPressed

        private void txtDescriptionKeyPressed​(java.awt.event.KeyEvent evt)
      • txtCategoryFocusLost

        private void txtCategoryFocusLost​(java.awt.event.FocusEvent evt)
      • txtCategoryFocusGained

        private void txtCategoryFocusGained​(java.awt.event.FocusEvent evt)
      • txtCategoryKeyTyped

        private void txtCategoryKeyTyped​(java.awt.event.KeyEvent evt)
      • btOKActionPerformed

        private void btOKActionPerformed​(java.awt.event.ActionEvent evt)
        Method called when ok button was pressed.
        Parameters:
        evt - Event that invoked this method call.
      • btCancelActionPerformed

        private void btCancelActionPerformed​(java.awt.event.ActionEvent evt)
        Method called when cancel button was pressed.
        Parameters:
        evt - Event that invoked this method call.
      • spMinutesStateChanged

        private void spMinutesStateChanged​(javax.swing.event.ChangeEvent evt)
        Method called when minutes of notification time were changed.
        Parameters:
        evt - Event that invoked this method call.
      • spHoursStateChanged

        private void spHoursStateChanged​(javax.swing.event.ChangeEvent evt)
        Method called when hours of notification time were changed.
        Parameters:
        evt - Event that invoked this method call.
      • chbNotificationChanged

        private void chbNotificationChanged​(java.awt.event.ActionEvent evt)
        Method called when notification was turned on/off.
        Parameters:
        evt - Event that invoked this method call.
      • closeDialog

        private void closeDialog​(java.awt.event.WindowEvent evt)
        Method called when dialog should be closed.
        Parameters:
        evt - Event that invoked this method call.
      • chbStartTaskKeyPressed

        private void chbStartTaskKeyPressed​(java.awt.event.KeyEvent evt)
      • formMouseEntered

        private void formMouseEntered​(java.awt.event.MouseEvent evt)
      • getTask

        public Task getTask()
        Return task that was edited or created by this dialog.
        Returns:
        Task that was edited or created by this dialog.
      • requestFocus

        public void requestFocus()
        Overrides:
        requestFocus in class java.awt.Component