Here you can find the source of getAnimationSpeed()
Parameter | Description |
---|---|
Exception | If an error occurs. |
public static long getAnimationSpeed() throws Exception
//package com.java2s; /*// ww w .java2 s. c om * 11/11/2010 * * SubstanceUtils.java - Utility methods for Java 1.4-compatible applications * looking to support Substance 6.1 if the current JRE is 1.6+. * Copyright (C) 2003 Robert Futrell * http://fifesoft.com/rtext * Licensed under a modified BSD license. * See the included license file for details. */ import java.lang.reflect.Method; import javax.swing.UIManager; public class Main { private static final String LAFWIDGET_PKG = "org.pushingpixels.lafwidget."; /** * Returns the length of time GUI animations take, in milliseconds. * * @return The length of time, in milliseconds. * @throws Exception If an error occurs. * @see #setAnimationSpeed(long) */ public static long getAnimationSpeed() throws Exception { long speed = -1; ClassLoader cl = (ClassLoader) UIManager.get("ClassLoader"); if (cl != null) { String managerClassName = LAFWIDGET_PKG + "animation.AnimationConfigurationManager"; Class<?> managerClazz = Class.forName(managerClassName, true, cl); Method m = managerClazz.getMethod("getInstance"); Object manager = m.invoke(null); m = managerClazz.getMethod("getTimelineDuration"); Long millis = (Long) m.invoke(manager); speed = millis.longValue(); } return speed; } }