All Packages Class Hierarchy This Package Previous Next Index
Class net.e2technologies.util.ECalendar
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----javax.swing.JComponent
|
+----javax.swing.JPanel
|
+----net.e2technologies.util.ECalendar
- public class ECalendar
- extends JPanel
- implements Serializable, ActionListener
ECalendar is a versital class that can be used for selecting a calendar day. This class is very
flexible in its use. The font, grid, and all colors are easily changed via the API. ECalendar takes
on characteristics of a common component (i.e. ActionEvents can be captured, data can be retrieved
and set). The year and month spinners are based on the ENumericSpinner and ETextSpinner. This
component is build of all Swing components, and therefore can leverage all the Swing features, such
as changing Look & Feel.
-
ECalendar(Date, ECalendarListener)
- Constructor for ECalendar.
-
ECalendar(Date, ECalendarListener, boolean)
- Constructor for ECalendar.
-
ECalendar(Date, ECalendarListener, boolean, boolean, Color, Color, Color, Color, Color, Color, Color, Color, Color, Color, Color, Font)
- Constructor for ECalendar.
-
ECalendar(Date, ECalendarListener, boolean, Color, Color)
- Constructor for ECalendar.
-
ECalendar(ECalendarListener)
- Default Constructor for ECalendar.
-
ECalendar(ECalendarListener, boolean)
- Constructor for ECalendar.
-
actionPerformed(ActionEvent)
- notifies the calendar when some action has been performed that is should be aware of.
-
addActionListener(ActionListener)
- adds a ActionListener to the calendar's list of action listners to be notified
when the calendar fires an ActionEvent.
-
getCalendar()
- gets the calendars' current date in the form of java.util.Calenar.
-
getDate()
- gets the current date selected within the calendar
-
getDay()
- gets the day of the month currently selected
-
getMonth()
- gets the month currently selected within the calendar.
-
getYear()
- gets the value of the year currently selected
-
setActiveBackground(Color)
- sets the Active Cells' background color.
-
setActiveForeground(Color)
- sets the Active Cell's foreground color.
-
setBlankBackground(Color)
- sets the Blank Days Cells' background color.
-
setBlankForeground(Color)
- sets the Blank Days Cells' foreground color.
-
setBlankGridColor(Color)
- sets the grid color for the Blank Cells.
-
setCalendar(Calendar)
- will set the internal month, day, and year of the calendar and then update the calendar visually.
-
setCalendarFont(Font)
- sets the Font to be used within the foreground of all the cells.
-
setDate(Date)
- will set the internal month, day and year of the calendar and then update the calendar visually.
-
setDateAndExit(int)
- This is called when the user selects a new date.
-
setDay(int)
- sets the day of the current month within the calendar
-
setDayBackground(Color)
- sets the Day Cells' background
-
setDayForeground(Color)
- sets the Day Cells' foreground
-
setDayGridColor(Color)
- sets the grid color for the Day Cells.
-
setMonth(int)
- sets the month within the calendar.
-
setShowGrid(boolean)
- turns on/off the grid within the calendar.
-
setShowOpaque(boolean)
- turs on/off the background colors in the cells of the calendar.
-
setWeekDayBackground(Color)
- sets the Week Day Cells' background.
-
setWeekDayForeground(Color)
- sets the Week Day Cells' foreground
-
setWeekDayGridColor(Color)
- sets the grid color for the Week Day Cells.
-
setYear(int)
- sets the year within the calendar
ECalendar
public ECalendar(ECalendarListener p_listener)
- Default Constructor for ECalendar. This will build a ECalendar will all the default options.
By default, the grid will not be displayed, the grid will not be opaque, and the default
Font is TimesNewRoman. The current date will be displayed by default.
- Parameters:
- ECalendarListener - p_listener - this is required so that the listener can be
notified when a new day is selected.
ECalendar
public ECalendar(ECalendarListener p_listener,
boolean p_showGrid)
- Constructor for ECalendar.
- Parameters:
- ECalendarListener - p_listener - this is required so that the listener can be
notified when a new day is selected. The current date will be displayed by default.
- boolean - p_showGrid - true will show the grid in the calendar, false will not.
ECalendar
public ECalendar(Date p_date,
ECalendarListener p_listener)
- Constructor for ECalendar.
- Parameters:
- Date - p_date - the initial date to display within the calendar.
- ECalendarListener - p_listener - this is required so that the listener can
be notified when a new day is selected.
ECalendar
public ECalendar(Date p_date,
ECalendarListener p_listener,
boolean p_showGrid)
- Constructor for ECalendar.
- Parameters:
- Date - p_date - the initial date to display within the calendar.
- ECalendarListener - p_listener - this is required so that the listener can
be notified when a new day is selected.
- boolean - p_showGrid - true will show the grid in the calendar, false will not.
ECalendar
public ECalendar(Date p_date,
ECalendarListener p_listener,
boolean p_showGrid,
Color p_weekDayColor,
Color p_dayColor)
- Constructor for ECalendar.
- Parameters:
- Date - p_date - the initial date to display within the calendar.
- ECalendarListener - - this is required so that the listener can
be notified when a new day is selected.
- boolean - p_showGrid - true will show the grid in the calendar, false will not.
- Color - p_weekDayColor - the color of the foreground text for the week days.
- Color - p_dayColor - the color of the foreground number for the days.
ECalendar
public ECalendar(Date p_date,
ECalendarListener p_listener,
boolean p_showGrid,
boolean p_isOpaque,
Color p_weekDayForeground,
Color p_weekDayBackground,
Color p_dayForeground,
Color p_dayBackground,
Color p_activeForeground,
Color p_activeBackground,
Color p_blankForeground,
Color p_blankBackground,
Color p_weekDayGridColor,
Color p_dayGridColor,
Color p_blankGridColor,
Font p_font)
- Constructor for ECalendar. This contains the most options at contruction.
- Parameters:
- Date - p_date - the initial date to display within the calendar.
- ECalendarListener - - this is required so that the listener can be
notified when a new day is selected.
- boolean - p_showGrid - true will show the grid in the calendar, false will not.
- boolean - p_isOpaque - true will not show the grid background colors, false will.
- Color - p_weekDayForeground - the color for the Week Day cells' foreground text.
- Color - p_weekDayBackground - the color for the Week Day cells' background.
- Color - p_dayForeground - the color for the Day cells' foreground number.
- Color - p_dayBackground - the color for the Day cells' background.
- Color - p_activeForeground - the color for the selected (active) cell's foreground.
- Color - p_activeBackground - the color for the selected (active) cell's background.
- Color - p_blankForeground - the color for the blank day cells' foreground (this will
not be shown unless the code for this class is altered since nothing is shown in the foreground
by default).
- Color - p_blankBackground - the color for the blank day cells' background.
- Color - p_weekDayGridColor - the color of the grid surrounding the week days.
- Color - p_dayGridColor - the color of the grid surrounding the days.
- Color - p_blankGirdColor - the color of the grid surrounding the blank days.
- Font - p_font - the font to use for the week day text and the day numbers.
getDate
public Date getDate()
- gets the current date selected within the calendar
- Returns:
- Date - the current date stored within the calendar
setDate
public void setDate(Date p_newDate)
- will set the internal month, day and year of the calendar and then update the calendar visually.
- Parameters:
- Date - p_newDate - the new Date to set the calendar to
setCalendar
public void setCalendar(Calendar p_newCalendar)
- will set the internal month, day, and year of the calendar and then update the calendar visually.
- Parameters:
- Calendar - p_newCalendar - the Calendar date to set the calendar to
getYear
public int getYear()
- gets the value of the year currently selected
- Parameters:
- int - - the year stored within the calendar
setYear
public void setYear(int p_newYear)
- sets the year within the calendar
- Parameters:
- int - p_newYear - the new year to set the calendar to
getMonth
public int getMonth()
- gets the month currently selected within the calendar.
- Returns:
- int - the current month selected within the calendar.
setMonth
public void setMonth(int p_newMonth)
- sets the month within the calendar.
- Parameters:
- int - p_newMonth - the new month to set the calendar to.
getDay
public int getDay()
- gets the day of the month currently selected
- Returns:
- int - the current day of the month
setDay
public void setDay(int p_newDay)
- sets the day of the current month within the calendar
- Parameters:
- int - p_newDay - the new day of the month to set the calendar to.
getCalendar
public Calendar getCalendar()
- gets the calendars' current date in the form of java.util.Calenar.
- Returns:
- Calendar - the current date selected within the calendar
- See Also:
- Calendar
actionPerformed
public void actionPerformed(ActionEvent e)
- notifies the calendar when some action has been performed that is should be aware of.
- Parameters:
- ActionEvent - e - the ActionEvent fired by one of its internal components.
setWeekDayBackground
public void setWeekDayBackground(Color p_newColor)
- sets the Week Day Cells' background.
- Parameters:
- Color - p_newColor - the new background color for the week day cells.
setWeekDayForeground
public void setWeekDayForeground(Color p_newColor)
- sets the Week Day Cells' foreground
- Parameters:
- Color - p_newColor - the new foreground color for the week day cells.
setDayForeground
public void setDayForeground(Color p_newColor)
- sets the Day Cells' foreground
- Parameters:
- Color - p_newColor - the new foreground color for the day cells.
setDayBackground
public void setDayBackground(Color p_newColor)
- sets the Day Cells' background
- Parameters:
- Color - p_newColor - the new background color for the day cells.
setActiveForeground
public void setActiveForeground(Color p_newColor)
- sets the Active Cell's foreground color. Since there is nothing shown in
the blank cell's foreground, this will not display anything unless over written.
- Parameters:
- Color - p_newColor - the new color for the selected or active cell
setActiveBackground
public void setActiveBackground(Color p_newColor)
- sets the Active Cells' background color.
- Parameters:
- Color - p_newColor - the new color for the selected or active cell
setBlankForeground
public void setBlankForeground(Color p_newColor)
- sets the Blank Days Cells' foreground color.
- Parameters:
- Color - p_newColor - the new color for the blank cells.
setBlankBackground
public void setBlankBackground(Color p_newColor)
- sets the Blank Days Cells' background color.
- Parameters:
- Color - p_newColor - the new color for the blank cells.
setWeekDayGridColor
public void setWeekDayGridColor(Color p_newColor)
- sets the grid color for the Week Day Cells. The flag for showing the grid must be true to see
effect.
- Parameters:
- Color - p_newColor - the new color for the week days grid.
setDayGridColor
public void setDayGridColor(Color p_newColor)
- sets the grid color for the Day Cells. The flag for showing the grid must be true to see effect.
- Parameters:
- Color - p_newColor - the new color for the day grid.
setBlankGridColor
public void setBlankGridColor(Color p_newColor)
- sets the grid color for the Blank Cells. The flag for showing the grid must be true to see the
effect.
- Parameters:
- Color - p_newColor - the new color for the blank day grid.
setShowGrid
public void setShowGrid(boolean p_showGrid)
- turns on/off the grid within the calendar.
- Parameters:
- boolean - p_showGrid - true will show the grid, false will not show grid
setShowOpaque
public void setShowOpaque(boolean p_showOpaque)
- turs on/off the background colors in the cells of the calendar.
- Parameters:
- boolean - p_showOpaque - true will show the background color of the container in the cells,
false will show the background colors for each of the cells types (Week Day, Day, Active, and Blank).
setCalendarFont
public void setCalendarFont(Font p_newFont)
- sets the Font to be used within the foreground of all the cells.
- Parameters:
- Font - p_newFont - the new Font type to use within the calendar
addActionListener
public void addActionListener(ActionListener p_listener)
- adds a ActionListener to the calendar's list of action listners to be notified
when the calendar fires an ActionEvent. The only action event genereated is when
this calendar is ready to exit. The Action Command will be 'DISPOSE' when this occurs.
- Parameters:
- ActionListener - p_listener - a ActionListener to recieve action events when fired.
setDateAndExit
public void setDateAndExit(int p_newDay)
- This is called when the user selects a new date. This will not always cause the
calendar to disappear. Instead, it will fire an ActionEvent with 'DISPOSE' as the
Action Command, in case another class wishes to close it (namely the one that created it).
- Parameters:
- int - p_newDay - the new day to be selected.
All Packages Class Hierarchy This Package Previous Next Index