001    /*
002     * $Id: MonthViewUI.java 3100 2008-10-14 22:33:10Z rah003 $
003     *
004     * Copyright 2008 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;
022    
023    import java.util.Date;
024    
025    import javax.swing.plaf.ComponentUI;
026    
027    public abstract class MonthViewUI extends ComponentUI {
028    
029        /**
030         * Returns an array of String to use as names for the days of the week.
031         *  
032         * @return array of names for the days of the week.
033         */
034        public abstract String[] getDaysOfTheWeek();
035    
036        
037        /**
038         * Returns the Date at the given location. May be null if the
039         * coordinates don't map to a day in the month which contains the 
040         * coordinates. Specifically: hitting leading/trailing dates returns null.
041         * 
042         * Mapping pixel to calendar day.
043         *
044         * @param x the x position of the location in pixel
045         * @param y the y position of the location in pixel
046         * @return the day at the given location or null if the location
047         *   doesn't map to a day in the month which contains the coordinates.
048         */ 
049        public abstract Date getDayAtLocation(int x, int y);
050    
051        
052    
053    
054        /**
055         * Returns the last possible date that can be displayed.
056         * This is implemented by the UI since it is in control of layout
057         * and may possibly yeild different results based on implementation. <p>
058         * 
059         * It's up to the UI to keep this property, based on internal state and
060         * the firstDisplayed as controlled by the JXMonthView.
061         * 
062         * @return Date The date.
063         */
064        public abstract Date getLastDisplayedDay();
065        
066    
067    
068    }