001    /*
002     * $Id: CalendarRenderingHandler.java 3166 2009-01-02 13:27:18Z rah003 $
003     *
004     * Copyright 2007 Sun Microsystems, Inc., 4150 Network Circle,
005     * Santa Clara, California 95054, U.S.A. All rights reserved.
006     *
007     * This library is free software; you can redistribute it and/or
008     * modify it under the terms of the GNU Lesser General Public
009     * License as published by the Free Software Foundation; either
010     * version 2.1 of the License, or (at your option) any later version.
011     * 
012     * This library is distributed in the hope that it will be useful,
013     * but WITHOUT ANY WARRANTY; without even the implied warranty of
014     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
015     * Lesser General Public License for more details.
016     * 
017     * You should have received a copy of the GNU Lesser General Public
018     * License along with this library; if not, write to the Free Software
019     * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
020     */
021    package org.jdesktop.swingx.plaf.basic;
022    
023    import java.util.Calendar;
024    import java.util.Locale;
025    
026    import javax.swing.JComponent;
027    
028    import org.jdesktop.swingx.JXMonthView;
029    
030    /**
031     * The RenderingHandler responsible for text rendering. It provides 
032     * and configures a rendering component for the given cell of
033     * a JXMonthView. <p>
034     * 
035     * @author Jeanette Winzenburg
036     */
037    public interface CalendarRenderingHandler {
038    
039        /**
040         * Configures and returns a component for rendering of the given monthView cell.
041         * 
042         * @param monthView the JXMonthView to render onto
043         * @param calendar the cell value
044         * @param state the DayState of the cell
045         * @return a component configured for rendering the given cell
046         */
047        public JComponent prepareRenderingComponent(JXMonthView monthView,
048                Calendar calendar, CalendarState state);
049    
050        /**
051         * Updates internal state to the given Locale.
052         * 
053         * PENDING JW: ideally, the handler should be stateless and this method
054         * removed. Currently needed because there is no way to get the Locale 
055         * from a Calendar. 
056         * 
057         * @param locale the new Locale.
058         */
059        public void setLocale(Locale locale);
060    
061    }