All Downloads are FREE. Search and download functionalities are using the official Maven repository.

src.com.toedter.calendar.IDateEvaluator Maven / Gradle / Ivy

Go to download

JCalendar is a Java date chooser bean for graphically picking a date. JCalendar is composed of several other Java beans, a JDayChooser, a JMonthChooser and a JYearChooser. All these beans have a locale property, provide several icons (Color 16x16, Color 32x32, Mono 16x16 and Mono 32x32) and their own locale property editor. So they can easily be used in GUI builders. Also part of the package is a JDateChooser, a bean composed of an IDateEditor (for direct date editing) and a button for opening a JCalendar for selecting the date.

The newest version!
/*
 *  Copyright (C) 2011 Kai Toedter 
 *  [email protected]
 *  www.toedter.com
 *
 *  This program is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public License
 *  as published by the Free Software Foundation; either version 2
 *  of the License, or (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

package com.toedter.calendar;

import java.awt.Color;
import java.util.Date;

/**
 * Implementations of this interface can be added to various JCalendar
 * components to check if certain dates are valid for selection.
 * 
 * @author Kai Toedter
 * @version $LastChangedRevision: 142 $
 * @version $LastChangedDate: 2011-06-05 07:06:03 +0200 (So, 05 Jun 2011) $
 * 
 */
public interface IDateEvaluator {
	/**
	 * Checks if a date is a special date (might have different colors and tooltips)
	 * 
	 * @param date
	 *            the date to check
	 * @return true, if the date can be selected
	 */
	boolean isSpecial(Date date);

	/**
	 * @return the foreground color (used by JDayChooser)
	 */
	Color getSpecialForegroundColor();

	/**
	 * @return the background color (used by JDayChooser)
	 */
	Color getSpecialBackroundColor();
	
	/**
	 * @return the tooltip (used by JDayChooser)
	 */
	String getSpecialTooltip();
	
	/**
	 * Checks if a date is invalid for selection
	 * 
	 * @param date
	 *            the date to check
	 * @return true, if the date is invalid and cannot be selected
	 */
	boolean isInvalid(Date date);

	/**
	 * @return the foreground color (used by JDayChooser)
	 */
	Color getInvalidForegroundColor();

	/**
	 * @return the background color (used by JDayChooser)
	 */
	Color getInvalidBackroundColor();
	
	/**
	 * @return the tooltip (used by JDayChooser)
	 */
	String getInvalidTooltip();

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy