View Javadoc
1   
2   /**
3    * Copyright 2004 Juan Heyns. All rights reserved.
4    *
5    * Redistribution and use in source and binary forms, with or without modification, are
6    * permitted provided that the following conditions are met:
7    *
8    * 1. Redistributions of source code must retain the above copyright notice, this list of
9    * conditions and the following disclaimer.
10   *
11   * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12   * of conditions and the following disclaimer in the documentation and/or other materials
13   * provided with the distribution.
14   *
15   * THIS SOFTWARE IS PROVIDED BY JUAN HEYNS ``AS IS'' AND ANY EXPRESS OR IMPLIED
16   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
17   * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JUAN HEYNS OR
18   * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19   * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
20   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
21   * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
22   * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
23   * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24   *
25   * The views and conclusions contained in the software and documentation are those of the
26   * authors and should not be interpreted as representing official policies, either expressed
27   * or implied, of Juan Heyns.
28   */
29  package org.jdatepicker;
30  
31  /*
32   * #%L
33   * Reef DB :: UI
34   * $Id:$
35   * $HeadURL:$
36   * %%
37   * Copyright (C) 2014 - 2015 Ifremer
38   * %%
39   * This program is free software: you can redistribute it and/or modify
40   * it under the terms of the GNU Affero General Public License as published by
41   * the Free Software Foundation, either version 3 of the License, or
42   * (at your option) any later version.
43   * 
44   * This program is distributed in the hope that it will be useful,
45   * but WITHOUT ANY WARRANTY; without even the implied warranty of
46   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
47   * GNU General Public License for more details.
48   * 
49   * You should have received a copy of the GNU Affero General Public License
50   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
51   * #L%
52   */
53  
54  import java.awt.*;
55  public final class ComponentColorDefaults extends AbstractComponentColor implements Cloneable {
56  
57      private static ComponentColorDefaults instance;
58  
59      /**
60       * <p>Getter for the field <code>instance</code>.</p>
61       *
62       * @return a {@link org.jdatepicker.ComponentColorDefaults} object.
63       */
64      public static ComponentColorDefaults getInstance() {
65          if (instance == null) {
66              instance = new ComponentColorDefaults();
67          }
68          return instance;
69      }
70  
71  
72      private ComponentColorDefaults() {
73  
74          colors.put(Key.FG_MONTH_SELECTOR, SystemColor.activeCaptionText);
75          colors.put(Key.BG_MONTH_SELECTOR, SystemColor.activeCaption);
76  
77          colors.put(Key.FG_GRID_HEADER, new Color(10, 36, 106));
78          colors.put(Key.BG_GRID_HEADER, Color.LIGHT_GRAY);
79  
80          colors.put(Key.FG_GRID_THIS_MONTH, Color.BLACK);
81          colors.put(Key.FG_GRID_OTHER_MONTH, Color.LIGHT_GRAY);
82          colors.put(Key.FG_GRID_TODAY, Color.RED);
83          colors.put(Key.BG_GRID, Color.WHITE);
84          colors.put(Key.BG_GRID_NOT_SELECTABLE, new Color(240, 240, 240));
85  
86          colors.put(Key.FG_GRID_SELECTED, Color.WHITE);
87          colors.put(Key.BG_GRID_SELECTED, new Color(10, 36, 106));
88  
89          colors.put(Key.FG_GRID_TODAY_SELECTED, Color.RED);
90          colors.put(Key.BG_GRID_TODAY_SELECTED, new Color(10, 36, 106));
91  
92          colors.put(Key.FG_TODAY_SELECTOR_ENABLED, Color.BLACK);
93          colors.put(Key.FG_TODAY_SELECTOR_DISABLED, Color.LIGHT_GRAY);
94          colors.put(Key.BG_TODAY_SELECTOR, Color.WHITE);
95  
96          colors.put(Key.POPUP_BORDER, Color.BLACK);
97      }
98  
99      /** {@inheritDoc} */
100     @Override
101     protected ComponentColorDefaults clone() throws CloneNotSupportedException {
102         return (ComponentColorDefaults) super.clone();
103     }
104 }