CalendarBean
Class CalendarBn

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--CalendarBean.CalendarBn

public class CalendarBn
extends java.awt.Panel

See Also:
Serialized Form

Field Summary
static int dd_mm_yyyy
           
static int dd_mmm_yyyy
           
static int dd_mmmm_yyyy
           
static int ldow_dd_mmm_yyyy
           
static int ldow_dd_mmmm_yyyy
           
static int ldow_mmm_dd_yyyy
           
static int ldow_mmmm_dd_yyyy
           
static int mm_dd_yyyy
           
static int mmm_dd_yyyy
           
static int mmmm_dd_yyyy
           
static int sdow_dd_mmm_yyyy
           
static int sdow_dd_mmmm_yyyy
           
static int sdow_mmm_dd_yyyy
          Default Date Format
static int sdow_mmmm_dd_yyyy
           
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
CalendarBn()
Default Date is Today.
Default Min Date is 'Previous years 1st January' and
Default Max Date is 'Next years 31st December'           
CalendarBn(java.sql.Date date)
           
CalendarBn(java.sql.Date date, java.sql.Date mindate, java.sql.Date maxdate)
           
CalendarBn(java.util.GregorianCalendar date)
           
CalendarBn(java.util.GregorianCalendar date, java.util.GregorianCalendar mindate, java.util.GregorianCalendar maxdate)
           
CalendarBn(int yyyy, int mm, int dd)
           
 
Method Summary
 int addCalendarBnListener(CalendarBnListener dpl)
           
static int CompareDates(java.util.GregorianCalendar date1, java.util.GregorianCalendar date2)
          Returns -1 if date1 < date2
Returns 0 if date1 = date2
Returns +1 if date1 > date2
This method ignores the Time Factor while comparing
static int CompareDates(int dy1, int dm1, int dd1, int dy2, int dm2, int dd2)
          Returns -1 if date1 < date2
Returns 0 if date1 = date2
Returns +1 if date1 > date2
This method ignores the Time Factor while comparing
 java.awt.Color getArrowColor()
           
 java.awt.Color getBackground()
           
 java.awt.Color getBorderColor()
           
 java.util.GregorianCalendar getDate()
          Returns the Currently Selected Date.
 int getDateFormat()
           
 CalendarBn getDateValues()
           
 int getDay()
           
 int getDayFrom(java.util.GregorianCalendar date)
           
 java.awt.Color getDaysColor()
           
 java.lang.String getDOW(java.util.GregorianCalendar date)
          Returns the Day Of Week in String Format for the given GregorianCalendar Object.
eg."Sunday".
 boolean getEditableYearVisible()
           
 java.lang.String getFormat()
           
 java.lang.String getFormattedDate()
          This method returns the current date in the current format of your datepicker object.
 java.lang.String getFormattedDate(java.util.GregorianCalendar dt, int dtformat)
          Returns a Date in String Format for the given GregorianCalendar Object with the specified Date Format Constant.
String str=yourCalendarBnObj.getFormattedDate(new GregorianCalendar(),CalendarBn.dd_mm_yyyy);
str will contain "31/12/2000".
 java.util.GregorianCalendar getMaxDate()
           
 java.util.GregorianCalendar getMinDate()
           
 int getMonth()
           
 java.awt.Color getMonthColor()
           
 java.awt.Color getMouseOverYear_Color()
           
 int getMonthFrom(java.util.GregorianCalendar date)
           
 java.lang.String getMonthStr(java.util.GregorianCalendar date)
          Returns the Month in String Format for the given GregorianCalendar Object.
eg."January".
 java.awt.Color getSelectionColor()
           
 boolean getShowDateRange()
           
 boolean getShowToday()
           
 java.lang.String getTitle()
           
 java.awt.Color getTitleBackground()
           
 java.awt.Color getTitleColor()
           
 java.awt.Color getWeekdaysColor()
           
 int getYear()
           
 java.awt.Color getYearColor()
           
 int getYearFrom(java.util.GregorianCalendar date)
           
 int removeCalendarBnListener(CalendarBnListener dpl)
           
 void setArrowColor(java.awt.Color color)
           
 void setBackground(java.awt.Color color)
           
 void setBorderColor(java.awt.Color color)
           
 void setDate(java.sql.Date date)
          Check if the CalendarBnException is an instance of InvalidDateException, GreaterThanMaxDateException or LessThanMinDateException.
 void setDate(java.util.GregorianCalendar date)
          Check if the CalendarBnException is an instance of InvalidDateException, GreaterThanMaxDateException or LessThanMinDateException.
 void setDate(int yyyy, int mm, int dd)
          Check if the CalendarBnException is an instance of InvalidDateException, GreaterThanMaxDateException or LessThanMinDateException.
 void setDateFormat(int dateformat)
          Sets the Date Format to as specified in .
Use one of the above formats.
eg.
 void setDateValues(CalendarBn dp)
          Sets the Date, Minimum Date and Maximum date of your CalendarBn Object with the specified CalendarBn Object's Date, MinDate and MaxDate respectively.
 void setDateValues(int cury, int curm, int curd, int miny, int minm, int mind, int maxy, int maxm, int maxd)
          Please Do not use this method.
This method will be used by your IDE to Generate JAVA Code.

Use setDateValues(CalendarBn dp) instead.
This method Will be Deprecated in future versions.
 void setDaysColor(java.awt.Color color)
           
 void setEditableYearVisible(boolean flag)
           
 void setFormat(java.lang.String dateformat)
          Please Do not use this method.
This method will be used by your IDE to Generate JAVA Code.

Use setFormat(int) instead.
This method Will be Deprecated in future versions.
 void setMaxDate(java.sql.Date date)
           
 void setMaxDate(java.util.GregorianCalendar date)
           
 void setMaxDate(int yyyy, int mm, int dd)
          Check if the CalendarBnException is an instance of InvalidDateException or LessThanMinDateException
 void setMinDate(java.sql.Date date)
           
 void setMinDate(java.util.GregorianCalendar date)
           
 void setMinDate(int yyyy, int mm, int dd)
          Check if the CalendarBnException is an instance of InvalidDateException or GreaterThanMaxDateException.
 void setMonthColor(java.awt.Color color)
           
 void setMouseOverYear_Color(java.awt.Color color)
           
 void setSelectionColor(java.awt.Color color)
           
 void setShowDateRange(boolean flag)
           
 void setShowToday(boolean flag)
           
 void setTitle(java.lang.String title)
           
 void setTitleBackground(java.awt.Color color)
           
 void setTitleColor(java.awt.Color color)
           
 void setWeekdaysColor(java.awt.Color color)
           
 void setYearColor(java.awt.Color color)
           
 void showDateRange(boolean flag)
           
 void showToday(boolean flag)
           
 java.lang.String toString()
          Returns current contents of you object as
Current Date :Thursday, April 19, 2001
Min Date :Wednesday, May 12, 1999
Max Date :Wednesday, April 21, 2010
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, removeNotify, setFont, setLayout, update, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, disable, dispatchEvent, enable, enable, enableInputMethods, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, transferFocus
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

dd_mm_yyyy

public static final int dd_mm_yyyy

mm_dd_yyyy

public static final int mm_dd_yyyy

dd_mmm_yyyy

public static final int dd_mmm_yyyy

dd_mmmm_yyyy

public static final int dd_mmmm_yyyy

mmm_dd_yyyy

public static final int mmm_dd_yyyy

mmmm_dd_yyyy

public static final int mmmm_dd_yyyy

ldow_dd_mmm_yyyy

public static final int ldow_dd_mmm_yyyy

ldow_dd_mmmm_yyyy

public static final int ldow_dd_mmmm_yyyy

ldow_mmm_dd_yyyy

public static final int ldow_mmm_dd_yyyy

ldow_mmmm_dd_yyyy

public static final int ldow_mmmm_dd_yyyy

sdow_dd_mmm_yyyy

public static final int sdow_dd_mmm_yyyy

sdow_dd_mmmm_yyyy

public static final int sdow_dd_mmmm_yyyy

sdow_mmm_dd_yyyy

public static final int sdow_mmm_dd_yyyy
Default Date Format

sdow_mmmm_dd_yyyy

public static final int sdow_mmmm_dd_yyyy
Constructor Detail

CalendarBn

public CalendarBn()
Default Date is Today.
Default Min Date is 'Previous years 1st January' and
Default Max Date is 'Next years 31st December'

           

CalendarBn

public CalendarBn(java.sql.Date date)
           throws CalendarBnException

CalendarBn

public CalendarBn(java.util.GregorianCalendar date)
           throws CalendarBnException

CalendarBn

public CalendarBn(int yyyy,
                  int mm,
                  int dd)
           throws CalendarBnException

CalendarBn

public CalendarBn(java.sql.Date date,
                  java.sql.Date mindate,
                  java.sql.Date maxdate)
           throws CalendarBnException

CalendarBn

public CalendarBn(java.util.GregorianCalendar date,
                  java.util.GregorianCalendar mindate,
                  java.util.GregorianCalendar maxdate)
           throws CalendarBnException
Method Detail

addCalendarBnListener

public int addCalendarBnListener(CalendarBnListener dpl)

removeCalendarBnListener

public int removeCalendarBnListener(CalendarBnListener dpl)

setEditableYearVisible

public void setEditableYearVisible(boolean flag)

getEditableYearVisible

public boolean getEditableYearVisible()

showToday

public void showToday(boolean flag)

setShowToday

public void setShowToday(boolean flag)

getShowToday

public boolean getShowToday()

showDateRange

public void showDateRange(boolean flag)

setShowDateRange

public void setShowDateRange(boolean flag)

getShowDateRange

public boolean getShowDateRange()

setTitle

public void setTitle(java.lang.String title)

getTitle

public java.lang.String getTitle()

setTitleBackground

public void setTitleBackground(java.awt.Color color)

getTitleBackground

public java.awt.Color getTitleBackground()

setTitleColor

public void setTitleColor(java.awt.Color color)

getTitleColor

public java.awt.Color getTitleColor()

setBorderColor

public void setBorderColor(java.awt.Color color)

getBorderColor

public java.awt.Color getBorderColor()

setBackground

public void setBackground(java.awt.Color color)
Overrides:
setBackground in class java.awt.Component

getBackground

public java.awt.Color getBackground()
Overrides:
getBackground in class java.awt.Component

setArrowColor

public void setArrowColor(java.awt.Color color)

getArrowColor

public java.awt.Color getArrowColor()

setWeekdaysColor

public void setWeekdaysColor(java.awt.Color color)

getWeekdaysColor

public java.awt.Color getWeekdaysColor()

setDaysColor

public void setDaysColor(java.awt.Color color)

getDaysColor

public java.awt.Color getDaysColor()

setMonthColor

public void setMonthColor(java.awt.Color color)

setMouseOverYear_Color

public void setMouseOverYear_Color(java.awt.Color color)

getMouseOverYear_Color

public java.awt.Color getMouseOverYear_Color()

getMonthColor

public java.awt.Color getMonthColor()

setYearColor

public void setYearColor(java.awt.Color color)

getYearColor

public java.awt.Color getYearColor()

setSelectionColor

public void setSelectionColor(java.awt.Color color)

getSelectionColor

public java.awt.Color getSelectionColor()

setDateFormat

public void setDateFormat(int dateformat)
Sets the Date Format to as specified in .
Use one of the above formats.
eg. yourDatePickerObj.setDateFormat(DatePicker.ldow_mmm_dd_yyyy);

getFormat

public java.lang.String getFormat()

setFormat

public void setFormat(java.lang.String dateformat)
Please Do not use this method.
This method will be used by your IDE to Generate JAVA Code.

Use setFormat(int) instead.
This method Will be Deprecated in future versions.

setDate

public void setDate(java.sql.Date date)
             throws CalendarBnException
Check if the CalendarBnException is an instance of InvalidDateException, GreaterThanMaxDateException or LessThanMinDateException.

setDate

public void setDate(java.util.GregorianCalendar date)
             throws CalendarBnException
Check if the CalendarBnException is an instance of InvalidDateException, GreaterThanMaxDateException or LessThanMinDateException.

setDate

public void setDate(int yyyy,
                    int mm,
                    int dd)
             throws CalendarBnException
Check if the CalendarBnException is an instance of InvalidDateException, GreaterThanMaxDateException or LessThanMinDateException.

setMinDate

public void setMinDate(java.sql.Date date)
                throws GreaterThanMaxDateException

setMinDate

public void setMinDate(int yyyy,
                       int mm,
                       int dd)
                throws CalendarBnException
Check if the CalendarBnException is an instance of InvalidDateException or GreaterThanMaxDateException.

setMinDate

public void setMinDate(java.util.GregorianCalendar date)
                throws GreaterThanMaxDateException

setMaxDate

public void setMaxDate(java.sql.Date date)
                throws LessThanMinDateException

setMaxDate

public void setMaxDate(int yyyy,
                       int mm,
                       int dd)
                throws CalendarBnException
Check if the CalendarBnException is an instance of InvalidDateException or LessThanMinDateException

setMaxDate

public void setMaxDate(java.util.GregorianCalendar date)
                throws LessThanMinDateException

toString

public java.lang.String toString()
Returns current contents of you object as
Current Date :Thursday, April 19, 2001
Min Date :Wednesday, May 12, 1999
Max Date :Wednesday, April 21, 2010
Overrides:
toString in class java.awt.Component

getDateFormat

public int getDateFormat()

getDate

public java.util.GregorianCalendar getDate()
Returns the Currently Selected Date.

getYear

public int getYear()

getMonth

public int getMonth()

getDay

public int getDay()

getMinDate

public java.util.GregorianCalendar getMinDate()

getMaxDate

public java.util.GregorianCalendar getMaxDate()

getYearFrom

public int getYearFrom(java.util.GregorianCalendar date)

getMonthFrom

public int getMonthFrom(java.util.GregorianCalendar date)

getDayFrom

public int getDayFrom(java.util.GregorianCalendar date)

getMonthStr

public java.lang.String getMonthStr(java.util.GregorianCalendar date)
Returns the Month in String Format for the given GregorianCalendar Object.
eg."January".

getDOW

public java.lang.String getDOW(java.util.GregorianCalendar date)
Returns the Day Of Week in String Format for the given GregorianCalendar Object.
eg."Sunday".

getFormattedDate

public java.lang.String getFormattedDate(java.util.GregorianCalendar dt,
                                         int dtformat)
Returns a Date in String Format for the given GregorianCalendar Object with the specified Date Format Constant.
String str=yourCalendarBnObj.getFormattedDate(new GregorianCalendar(),CalendarBn.dd_mm_yyyy);
str will contain "31/12/2000".

getFormattedDate

public java.lang.String getFormattedDate()
This method returns the current date in the current format of your datepicker object.

setDateValues

public void setDateValues(CalendarBn dp)
Sets the Date, Minimum Date and Maximum date of your CalendarBn Object with the specified CalendarBn Object's Date, MinDate and MaxDate respectively.

setDateValues

public void setDateValues(int cury,
                          int curm,
                          int curd,
                          int miny,
                          int minm,
                          int mind,
                          int maxy,
                          int maxm,
                          int maxd)
Please Do not use this method.
This method will be used by your IDE to Generate JAVA Code.

Use setDateValues(CalendarBn dp) instead.
This method Will be Deprecated in future versions.

getDateValues

public CalendarBn getDateValues()

CompareDates

public static int CompareDates(java.util.GregorianCalendar date1,
                               java.util.GregorianCalendar date2)
Returns -1 if date1 < date2
Returns 0 if date1 = date2
Returns +1 if date1 > date2
This method ignores the Time Factor while comparing

CompareDates

public static int CompareDates(int dy1,
                               int dm1,
                               int dd1,
                               int dy2,
                               int dm2,
                               int dd2)
Returns -1 if date1 < date2
Returns 0 if date1 = date2
Returns +1 if date1 > date2
This method ignores the Time Factor while comparing