Package org.meteoinfo.ui.calendar
Class MinMaxDateEvaluator
- java.lang.Object
-
- org.meteoinfo.ui.calendar.MinMaxDateEvaluator
-
- All Implemented Interfaces:
IDateEvaluator
public class MinMaxDateEvaluator extends java.lang.Object implements IDateEvaluator
-
-
Constructor Summary
Constructors Constructor Description MinMaxDateEvaluator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.ColorgetInvalidBackroundColor()java.awt.ColorgetInvalidForegroundColor()java.lang.StringgetInvalidTooltip()java.util.DategetMaxSelectableDate()Gets the maximum selectable date.java.util.DategetMinSelectableDate()Gets the minimum selectable date.java.awt.ColorgetSpecialBackroundColor()java.awt.ColorgetSpecialForegroundColor()java.lang.StringgetSpecialTooltip()booleanisInvalid(java.util.Date date)Checks if a date is invalid for selectionbooleanisSpecial(java.util.Date date)Checks if a date is a special date (might have different colors and tooltips)java.util.DatesetMaxSelectableDate(java.util.Date max)Sets the maximum selectable date.java.util.DatesetMinSelectableDate(java.util.Date min)Sets the minimum selectable date.
-
-
-
Method Detail
-
isSpecial
public boolean isSpecial(java.util.Date date)
Description copied from interface:IDateEvaluatorChecks if a date is a special date (might have different colors and tooltips)- Specified by:
isSpecialin interfaceIDateEvaluator- Parameters:
date- the date to check- Returns:
- true, if the date can be selected
-
getSpecialForegroundColor
public java.awt.Color getSpecialForegroundColor()
- Specified by:
getSpecialForegroundColorin interfaceIDateEvaluator- Returns:
- the foreground color (used by JDayChooser)
-
getSpecialBackroundColor
public java.awt.Color getSpecialBackroundColor()
- Specified by:
getSpecialBackroundColorin interfaceIDateEvaluator- Returns:
- the background color (used by JDayChooser)
-
getSpecialTooltip
public java.lang.String getSpecialTooltip()
- Specified by:
getSpecialTooltipin interfaceIDateEvaluator- Returns:
- the tooltip (used by JDayChooser)
-
isInvalid
public boolean isInvalid(java.util.Date date)
Description copied from interface:IDateEvaluatorChecks if a date is invalid for selection- Specified by:
isInvalidin interfaceIDateEvaluator- Parameters:
date- the date to check- Returns:
- true, if the date is invalid and cannot be selected
-
getInvalidForegroundColor
public java.awt.Color getInvalidForegroundColor()
- Specified by:
getInvalidForegroundColorin interfaceIDateEvaluator- Returns:
- the foreground color (used by JDayChooser)
-
getInvalidBackroundColor
public java.awt.Color getInvalidBackroundColor()
- Specified by:
getInvalidBackroundColorin interfaceIDateEvaluator- Returns:
- the background color (used by JDayChooser)
-
getInvalidTooltip
public java.lang.String getInvalidTooltip()
- Specified by:
getInvalidTooltipin interfaceIDateEvaluator- Returns:
- the tooltip (used by JDayChooser)
-
setMaxSelectableDate
public java.util.Date setMaxSelectableDate(java.util.Date max)
Sets the maximum selectable date. If null, the date 01\01\9999 will be set instead.- Parameters:
max- the maximum selectable date- Returns:
- the maximum selectable date
-
setMinSelectableDate
public java.util.Date setMinSelectableDate(java.util.Date min)
Sets the minimum selectable date. If null, the date 01\01\0001 will be set instead.- Parameters:
min- the minimum selectable date- Returns:
- the minimum selectable date
-
getMaxSelectableDate
public java.util.Date getMaxSelectableDate()
Gets the maximum selectable date.- Returns:
- the maximum selectable date
-
getMinSelectableDate
public java.util.Date getMinSelectableDate()
Gets the minimum selectable date.- Returns:
- the minimum selectable date
-
-