source: josm/trunk/src/org/openstreetmap/josm/gui/animation/AnimationExtensionManager.java@ 14628

Last change on this file since 14628 was 14578, checked in by Don-vip, 5 years ago

It's Christmas time! Animate our "Getting Started" page with shining stars.

Adapted from Icedtea-Web, original code by Jiri Vanek (Red Hat).
See http://icedtea.classpath.org/hg/icedtea-web/rev/87d3081ab573

  • Property svn:eol-style set to native
File size: 1.1 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.gui.animation;
3
4import java.util.Calendar;
5import java.util.Date;
6import java.util.GregorianCalendar;
7
8/**
9 * Animation extension manager. Copied from Icedtea-Web.
10 * @author Jiri Vanek (Red Hat)
11 * @see <a href="http://icedtea.classpath.org/hg/icedtea-web/rev/87d3081ab573">Initial commit</a>
12 * @since 14578
13 */
14public final class AnimationExtensionManager {
15
16 private static AnimationExtension currentExtension;
17
18 private AnimationExtensionManager() {
19 // Hide default constructor for utility classes
20 }
21
22 /**
23 * Returns the current animation extension.
24 * @return the current animation extension
25 */
26 public static AnimationExtension getExtension() {
27 if (currentExtension == null) {
28 currentExtension = isChristmas() ? new ChristmasExtension() : new NoExtension();
29 }
30 return currentExtension;
31 }
32
33 private static boolean isChristmas() {
34 Calendar c = new GregorianCalendar();
35 c.setTime(new Date());
36 return c.get(Calendar.DAY_OF_YEAR) > 350;
37 }
38}
Note: See TracBrowser for help on using the repository browser.