Skip to content
This repository was archived by the owner on Feb 15, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
build
drop
www/webstart/*.jar
.gradle
.idea
*.iml
*.iws
*.ipr
.classpath
.project
.settings
build
drop
www/webstart/*.jar
.gradle
.idea
*.iml
*.iws
*.ipr
.classpath
.project
.settings
# NetBeans files: .nb-gradle/ (directory) and .nb-gradle-properties
**/.nb-gradle/
**/.nb-gradle-properties
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

/**
* Screenshot robot for {@link org.pushingpixels.substance.api.skin.CeruleanSkin}.
*
*
* @author Kirill Grouchnikov
*/
public class Cerulean extends SkinRobot {
Expand All @@ -44,7 +44,7 @@ public class Cerulean extends SkinRobot {
*/
public Cerulean() {
super(
new Cerulean(),
new CeruleanSkin(),
"/Users/kirillg/JProjects/substance-flamingo/www/images/screenshots/skins/cerulean");
}
}
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
/*
* Copyright (c) 2005-2010 Substance Kirill Grouchnikov. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* o Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* o Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* o Neither the name of Substance Kirill Grouchnikov nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* o Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* o Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* o Neither the name of Substance Kirill Grouchnikov nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.pushingpixels.substance.internal.animation;

Expand All @@ -45,7 +45,7 @@
/**
* Tracker for pulsating (default and focused) <code>JButton</code>s. This class
* is <b>for internal use only</b>.
*
*
* @author Kirill Grouchnikov
*/
public class RootPaneDefaultButtonTracker extends
Expand All @@ -69,7 +69,7 @@ public class RootPaneDefaultButtonTracker extends

/**
* Simple constructor.
*
*
* @param jbutton
*/
private RootPaneDefaultButtonTracker(JButton jbutton) {
Expand All @@ -85,7 +85,7 @@ private RootPaneDefaultButtonTracker(JButton jbutton) {
/**
* Recursively checks whether the specified component or one of its inner
* components has focus.
*
*
* @param component
* Component to check.
* @return <code>true</code> if the specified component or one of its inner
Expand Down Expand Up @@ -115,7 +115,7 @@ private static boolean isInFocusedWindow(Component component) {
/**
* Recursively checks whether the specified component has visible glass
* pane.
*
*
* @param component
* Component to check.
* @return <code>true</code> if the specified component has visible glass
Expand Down Expand Up @@ -170,9 +170,13 @@ void onTimelineEvent() {
if (!isPulsating(jButton)) {
// has since lost its default status
RootPaneDefaultButtonTracker tracker = trackers.get(jButton);
tracker.stopTimer();
tracker.buttonRef.clear();
trackers.remove(jButton);
if (tracker != null) {
// value has been observed to be null in rare cases, so check for it;
// https://github.com/Insubstantial/insubstantial/issues/137
tracker.stopTimer();
tracker.buttonRef.clear();
trackers.remove(jButton);
}
} else {
if (!RootPaneDefaultButtonTracker.isInFocusedWindow(jButton
.getTopLevelAncestor())) {
Expand Down Expand Up @@ -228,7 +232,7 @@ private void stopTimer() {

/**
* Returns the status of the associated timer.
*
*
* @return <code>true</code> is the associated timer is running,
* <code>false</code> otherwise.
*/
Expand All @@ -240,7 +244,7 @@ private boolean isRunning() {
/**
* Updates the state of the specified button which must be a default button
* in some window. The button state is determined based on focus ownership.
*
*
* @param jButton
* Button.
*/
Expand Down Expand Up @@ -268,8 +272,8 @@ public static void update(JButton jButton) {
return;
}
tracker = new RootPaneDefaultButtonTracker(jButton);
tracker.startTimer();
trackers.put(jButton, tracker);
tracker.startTimer();
// long initialCycle = isAttentionDrawingCloseButton(jButton) ? -80
// : 0;
// cycles.put(jButton, initialCycle);
Expand All @@ -279,7 +283,7 @@ public static void update(JButton jButton) {

/**
* Retrieves the current cycle count for the specified button.
*
*
* @param jButton
* Button.
* @return Current cycle count for the specified button.
Expand All @@ -301,7 +305,7 @@ public static float getTimelinePosition(JButton jButton) {

/**
* Retrieves the animation state for the specified button.
*
*
* @param jButton
* Button.
* @return <code>true</code> if the specified button is being animated,
Expand All @@ -317,7 +321,7 @@ public static boolean isAnimating(JButton jButton) {

/**
* Returns memory usage.
*
*
* @return Memory usage string.
*/
static String getMemoryUsage() {
Expand Down Expand Up @@ -379,7 +383,7 @@ static String getMemoryUsage() {

/**
* Checks whether the specified button is pulsating.
*
*
* @param jButton
* Button.
* @return <code>true</code> if the specified button is pulsating,
Expand Down
Loading