|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmvp.View
caltool.caltool_ui.CalendarToolWindow
caltool.schedule_ui.ScheduleEventDialog
public class ScheduleEventDialog
Class ScheduleEventDialog provides a view of Event as an input to the scheduleEvent method. Hence, the dialog is a view of both an Event object as well as the scheduleEvent method. The data-entry components of the dialog constitute the Event view. The 'OK' button is the view of the scheduleEvent method.
The data components consist of JLabels, JTextFields, and a JComboBox. The 'OK', 'Clear', and 'Cancel' buttons are JButtons. The description of the compose method has details of how the components are laid out in the dialog window.
The companion model for ScheduleEventDialog is the Schedule class, since Schedule has the method that is invoked from the 'OK' button action listener. See class OKScheduleEventButtonListener.html for details of how the Schedule.scheduleEvent method is invoked.
Field Summary | |
---|---|
protected javax.swing.JComboBox |
categoryComboBox
The Categories combo box |
protected javax.swing.JTextField |
endDateTextField
The end date text field |
protected double |
maxComponentHeight
The max height of a text field or combobox; this is necessary since these components stretch when the outer frame is resized, and look very funky when they do. |
protected int |
maxComponentWidth
The max width of any component; this is only necessary because the max height cannot be set separately, so we must pick some max width. |
protected javax.swing.JPanel |
panel
The background panel of this |
protected javax.swing.JComboBox |
securityComboBox
The security text field |
protected javax.swing.JTextField |
startDateTextField
The start date text field |
protected javax.swing.JTextField |
titleTextField
The title text field |
Fields inherited from class caltool.caltool_ui.CalendarToolWindow |
---|
calToolUI |
Fields inherited from class mvp.View |
---|
closeAdapter, editable, model, screen, shown, widget, window |
Constructor Summary | |
---|---|
ScheduleEventDialog(mvp.Screen screen,
Schedule schedule,
CalendarToolUI calToolUI)
Construct this with the given Schedule as companion model. |
Method Summary | |
---|---|
protected void |
clear()
Clear each of the text fields of this to empty. |
java.awt.Component |
compose()
Compose this as a vertical Box of four rows. |
protected javax.swing.Box |
composeButtonRow()
Compose the buttons row with three JButtons. |
protected javax.swing.Box |
composeCategoryAndSecurityRow()
Compose the category/security row using a JComboBox and JTextField, with JLabels next to each. |
protected javax.swing.Box |
composeStartAndEndDateRow()
Compose the start/end date row using two pairs of JLabel and JTextField. |
protected javax.swing.Box |
composeTitleRow()
Compose the title row using a JLabel and JTextField. |
void |
displayErrors(ScheduleEventPrecondViolation errors)
Display the error messages in the given exception object in a modal pop-up window. |
Category |
getCategory()
Return selected category as a Category value. |
Date |
getEndDate()
Return the end date as a Date value. |
SimpleSecurity |
getSecurity()
Return the security as a simple security value. |
Date |
getStartDate()
Return the start date as a Date value. |
java.lang.String |
getTitle()
Return the title as a string. |
Methods inherited from class caltool.caltool_ui.CalendarToolWindow |
---|
show |
Methods inherited from class mvp.View |
---|
getModel, getWidget, getWindow, hide, isEditable, isShown, run, setEditable, setExitOnClose, setModel, show, update |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected javax.swing.JPanel panel
protected javax.swing.JTextField titleTextField
protected javax.swing.JTextField startDateTextField
protected javax.swing.JTextField endDateTextField
protected javax.swing.JComboBox categoryComboBox
protected javax.swing.JComboBox securityComboBox
protected final double maxComponentHeight
protected final int maxComponentWidth
Constructor Detail |
---|
public ScheduleEventDialog(mvp.Screen screen, Schedule schedule, CalendarToolUI calToolUI)
Method Detail |
---|
public java.awt.Component compose()
Vertical and horizontal struts are used for spacing among all of the components.
compose
in class mvp.View
public java.lang.String getTitle()
public Date getStartDate()
public Date getEndDate()
public Category getCategory()
public SimpleSecurity getSecurity()
public void displayErrors(ScheduleEventPrecondViolation errors)
protected javax.swing.Box composeTitleRow()
protected javax.swing.Box composeStartAndEndDateRow()
protected javax.swing.Box composeCategoryAndSecurityRow()
protected javax.swing.Box composeButtonRow()
protected void clear()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |