Package org.cesilko.rachota.gui
Class TaskDialog
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- java.awt.Window
-
- java.awt.Dialog
-
- javax.swing.JDialog
-
- org.cesilko.rachota.gui.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.JDialogVisualizer 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
-
-
Field Summary
Fields Modifier and Type Field Description private javax.swing.JButtonbtCancelprivate javax.swing.JButtonbtOKprivate javax.swing.JCheckBoxchbAutoStartprivate javax.swing.JCheckBoxchbNotificationprivate javax.swing.JCheckBoxchbPrivateprivate javax.swing.JCheckBoxchbRegularprivate javax.swing.JCheckBoxchbStartTaskprivate javax.swing.JComboBoxcmbPriorityprivate javax.swing.JComboBoxcmbRepetitionprivate DaydayDay which new task should be added to.private javax.swing.JLabellblCategoryprivate javax.swing.JLabellblColonprivate javax.swing.JLabellblDescriptionprivate javax.swing.JLabellblNotesprivate javax.swing.JLabellblPriorityprivate javax.swing.JPanelpnButtonsprivate booleanreadOnlyFlag determining if task can be edited or not.private javax.swing.JSpinnerspHoursprivate javax.swing.JSpinnerspMinutesprivate javax.swing.JScrollPanespNotesprivate javax.swing.JTextAreataNotesprivate TasktaskTask that is being edited.private javax.swing.JTextFieldtxtCategoryprivate javax.swing.JTextFieldtxtDescription-
Fields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabled
-
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
-
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 voidbtCancelActionPerformed(java.awt.event.ActionEvent evt)Method called when cancel button was pressed.private voidbtOKActionPerformed(java.awt.event.ActionEvent evt)Method called when ok button was pressed.private voidchbAutoStartKeyPressed(java.awt.event.KeyEvent evt)private voidchbNotificationChanged(java.awt.event.ActionEvent evt)Method called when notification was turned on/off.private voidchbNotificationKeyPressed(java.awt.event.KeyEvent evt)private voidchbPrivateKeyPressed(java.awt.event.KeyEvent evt)private voidchbRegularKeyPressed(java.awt.event.KeyEvent evt)private voidchbStartTaskKeyPressed(java.awt.event.KeyEvent evt)private voidcloseDialog(java.awt.event.WindowEvent evt)Method called when dialog should be closed.private voidcmbPriorityKeyPressed(java.awt.event.KeyEvent evt)private voidcmbRepetitionKeyPressed(java.awt.event.KeyEvent evt)private voidformMouseEntered(java.awt.event.MouseEvent evt)java.awt.FontgetFont()Returns font that should be used for all widgets in this component based on the language preferences specified by user.TaskgetTask()Return task that was edited or created by this dialog.private voidinitComponents()This method is called from within the constructor to initialize the form.voidrequestFocus()private voidspHoursKeyPressed(java.awt.event.KeyEvent evt)private voidspHoursStateChanged(javax.swing.event.ChangeEvent evt)Method called when hours of notification time were changed.private voidspMinutesKeyPressed(java.awt.event.KeyEvent evt)private voidspMinutesStateChanged(javax.swing.event.ChangeEvent evt)Method called when minutes of notification time were changed.private voidtaNotesKeyPressed(java.awt.event.KeyEvent evt)private voidtxtCategoryFocusGained(java.awt.event.FocusEvent evt)private voidtxtCategoryFocusLost(java.awt.event.FocusEvent evt)private voidtxtCategoryKeyPressed(java.awt.event.KeyEvent evt)private voidtxtCategoryKeyTyped(java.awt.event.KeyEvent evt)private voidtxtDescriptionKeyPressed(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
-
-
-
-
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:
getFontin interfacejava.awt.MenuContainer- Overrides:
getFontin classjava.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:
requestFocusin classjava.awt.Component
-
-