Changeset 17322 in josm


Ignore:
Timestamp:
2020-11-17T02:38:27+01:00 (2 weeks ago)
Author:
Don-vip
Message:

fix #20018 - disable repaint timer when no animation extension is enabled

Location:
trunk/src/org/openstreetmap/josm/gui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/GettingStarted.java

    r17299 r17322  
    155155    @Override
    156156    public void addNotify() {
    157         timer.start();
     157        if (AnimationExtensionManager.isExtensionEnabled()) {
     158            timer.start();
     159        }
    158160        super.addNotify();
    159161    }
     
    161163    @Override
    162164    public void removeNotify() {
    163         timer.stop();
     165        if (timer.isRunning()) {
     166            timer.stop();
     167        }
    164168        super.removeNotify();
    165169    }
  • trunk/src/org/openstreetmap/josm/gui/animation/AnimationExtensionManager.java

    r15602 r17322  
    3535    }
    3636
     37    /**
     38     * Determines if an extension other than {@link NoExtension} is enabled.
     39     * @return {@code true} if an extension other than {@code NoExtension} is enabled.
     40     * @since 17322
     41     */
     42    public static boolean isExtensionEnabled() {
     43        return !(getExtension() instanceof NoExtension);
     44    }
     45
    3746    private static boolean isChristmas() {
    3847        Calendar c = new GregorianCalendar();
Note: See TracChangeset for help on using the changeset viewer.