Java Code Examples for com.sun.java.swing.plaf.windows.TMSchema.State#DEFAULTED

The following examples show how to use com.sun.java.swing.plaf.windows.TMSchema.State#DEFAULTED . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AnimationController.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
private synchronized void startAnimation(JComponent component,
                                 Part part,
                                 State startState,
                                 State endState,
                                 long millis) {
    boolean isForwardAndReverse = false;
    if (endState == State.DEFAULTED) {
        isForwardAndReverse = true;
    }
    Map<Part, AnimationState> map = animationStateMap.get(component);
    if (millis <= 0) {
        if (map != null) {
            map.remove(part);
            if (map.size() == 0) {
                animationStateMap.remove(component);
            }
        }
        return;
    }
    if (map == null) {
        map = new EnumMap<Part, AnimationState>(Part.class);
        animationStateMap.put(component, map);
    }
    map.put(part,
            new AnimationState(startState, millis, isForwardAndReverse));
    if (! timer.isRunning()) {
        timer.start();
    }
}
 
Example 2
Source File: AnimationController.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private synchronized void startAnimation(JComponent component,
                                 Part part,
                                 State startState,
                                 State endState,
                                 long millis) {
    boolean isForwardAndReverse = false;
    if (endState == State.DEFAULTED) {
        isForwardAndReverse = true;
    }
    Map<Part, AnimationState> map = animationStateMap.get(component);
    if (millis <= 0) {
        if (map != null) {
            map.remove(part);
            if (map.size() == 0) {
                animationStateMap.remove(component);
            }
        }
        return;
    }
    if (map == null) {
        map = new EnumMap<Part, AnimationState>(Part.class);
        animationStateMap.put(component, map);
    }
    map.put(part,
            new AnimationState(startState, millis, isForwardAndReverse));
    if (! timer.isRunning()) {
        timer.start();
    }
}
 
Example 3
Source File: AnimationController.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private synchronized void startAnimation(JComponent component,
                                 Part part,
                                 State startState,
                                 State endState,
                                 long millis) {
    boolean isForwardAndReverse = false;
    if (endState == State.DEFAULTED) {
        isForwardAndReverse = true;
    }
    Map<Part, AnimationState> map = animationStateMap.get(component);
    if (millis <= 0) {
        if (map != null) {
            map.remove(part);
            if (map.size() == 0) {
                animationStateMap.remove(component);
            }
        }
        return;
    }
    if (map == null) {
        map = new EnumMap<Part, AnimationState>(Part.class);
        animationStateMap.put(component, map);
    }
    map.put(part,
            new AnimationState(startState, millis, isForwardAndReverse));
    if (! timer.isRunning()) {
        timer.start();
    }
}
 
Example 4
Source File: AnimationController.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private static void triggerAnimation(JComponent c,
                       Part part, State newState) {
    if (c instanceof javax.swing.JTabbedPane
        || part == Part.TP_BUTTON) {
        //idk: we can not handle tabs animation because
        //the same (component,part) is used to handle all the tabs
        //and we can not track the states
        //Vista theme might have transition duration for toolbar buttons
        //but native application does not seem to animate them
        return;
    }
    AnimationController controller =
        AnimationController.getAnimationController();
    State oldState = controller.getState(c, part);
    if (oldState != newState) {
        controller.putState(c, part, newState);
        if (newState == State.DEFAULTED) {
            // it seems for DEFAULTED button state Vista does animation from
            // HOT
            oldState = State.HOT;
        }
        if (oldState != null) {
            long duration;
            if (newState == State.DEFAULTED) {
                //Only button might have DEFAULTED state
                //idk: do not know how to get the value from Vista
                //one second seems plausible value
                duration = 1000;
            } else {
                 duration = XPStyle.getXP().getThemeTransitionDuration(
                       c, part,
                       normalizeState(oldState),
                       normalizeState(newState),
                       Prop.TRANSITIONDURATIONS);
            }
            controller.startAnimation(c, part, oldState, newState, duration);
        }
    }
}
 
Example 5
Source File: AnimationController.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private synchronized void startAnimation(JComponent component,
                                 Part part,
                                 State startState,
                                 State endState,
                                 long millis) {
    boolean isForwardAndReverse = false;
    if (endState == State.DEFAULTED) {
        isForwardAndReverse = true;
    }
    Map<Part, AnimationState> map = animationStateMap.get(component);
    if (millis <= 0) {
        if (map != null) {
            map.remove(part);
            if (map.size() == 0) {
                animationStateMap.remove(component);
            }
        }
        return;
    }
    if (map == null) {
        map = new EnumMap<Part, AnimationState>(Part.class);
        animationStateMap.put(component, map);
    }
    map.put(part,
            new AnimationState(startState, millis, isForwardAndReverse));
    if (! timer.isRunning()) {
        timer.start();
    }
}
 
Example 6
Source File: AnimationController.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
private synchronized void startAnimation(JComponent component,
                                 Part part,
                                 State startState,
                                 State endState,
                                 long millis) {
    boolean isForwardAndReverse = false;
    if (endState == State.DEFAULTED) {
        isForwardAndReverse = true;
    }
    Map<Part, AnimationState> map = animationStateMap.get(component);
    if (millis <= 0) {
        if (map != null) {
            map.remove(part);
            if (map.size() == 0) {
                animationStateMap.remove(component);
            }
        }
        return;
    }
    if (map == null) {
        map = new EnumMap<Part, AnimationState>(Part.class);
        animationStateMap.put(component, map);
    }
    map.put(part,
            new AnimationState(startState, millis, isForwardAndReverse));
    if (! timer.isRunning()) {
        timer.start();
    }
}
 
Example 7
Source File: AnimationController.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private static void triggerAnimation(JComponent c,
                       Part part, State newState) {
    if (c instanceof javax.swing.JTabbedPane
        || part == Part.TP_BUTTON) {
        //idk: we can not handle tabs animation because
        //the same (component,part) is used to handle all the tabs
        //and we can not track the states
        //Vista theme might have transition duration for toolbar buttons
        //but native application does not seem to animate them
        return;
    }
    AnimationController controller =
        AnimationController.getAnimationController();
    State oldState = controller.getState(c, part);
    if (oldState != newState) {
        controller.putState(c, part, newState);
        if (newState == State.DEFAULTED) {
            // it seems for DEFAULTED button state Vista does animation from
            // HOT
            oldState = State.HOT;
        }
        if (oldState != null) {
            long duration;
            if (newState == State.DEFAULTED) {
                //Only button might have DEFAULTED state
                //idk: do not know how to get the value from Vista
                //one second seems plausible value
                duration = 1000;
            } else {
                 duration = XPStyle.getXP().getThemeTransitionDuration(
                       c, part,
                       normalizeState(oldState),
                       normalizeState(newState),
                       Prop.TRANSITIONDURATIONS);
            }
            controller.startAnimation(c, part, oldState, newState, duration);
        }
    }
}
 
Example 8
Source File: AnimationController.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private synchronized void startAnimation(JComponent component,
                                 Part part,
                                 State startState,
                                 State endState,
                                 long millis) {
    boolean isForwardAndReverse = false;
    if (endState == State.DEFAULTED) {
        isForwardAndReverse = true;
    }
    Map<Part, AnimationState> map = animationStateMap.get(component);
    if (millis <= 0) {
        if (map != null) {
            map.remove(part);
            if (map.size() == 0) {
                animationStateMap.remove(component);
            }
        }
        return;
    }
    if (map == null) {
        map = new EnumMap<Part, AnimationState>(Part.class);
        animationStateMap.put(component, map);
    }
    map.put(part,
            new AnimationState(startState, millis, isForwardAndReverse));
    if (! timer.isRunning()) {
        timer.start();
    }
}
 
Example 9
Source File: AnimationController.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
private synchronized void startAnimation(JComponent component,
                                 Part part,
                                 State startState,
                                 State endState,
                                 long millis) {
    boolean isForwardAndReverse = false;
    if (endState == State.DEFAULTED) {
        isForwardAndReverse = true;
    }
    Map<Part, AnimationState> map = animationStateMap.get(component);
    if (millis <= 0) {
        if (map != null) {
            map.remove(part);
            if (map.size() == 0) {
                animationStateMap.remove(component);
            }
        }
        return;
    }
    if (map == null) {
        map = new EnumMap<Part, AnimationState>(Part.class);
        animationStateMap.put(component, map);
    }
    map.put(part,
            new AnimationState(startState, millis, isForwardAndReverse));
    if (! timer.isRunning()) {
        timer.start();
    }
}
 
Example 10
Source File: AnimationController.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
private synchronized void startAnimation(JComponent component,
                                 Part part,
                                 State startState,
                                 State endState,
                                 long millis) {
    boolean isForwardAndReverse = false;
    if (endState == State.DEFAULTED) {
        isForwardAndReverse = true;
    }
    Map<Part, AnimationState> map = animationStateMap.get(component);
    if (millis <= 0) {
        if (map != null) {
            map.remove(part);
            if (map.size() == 0) {
                animationStateMap.remove(component);
            }
        }
        return;
    }
    if (map == null) {
        map = new EnumMap<Part, AnimationState>(Part.class);
        animationStateMap.put(component, map);
    }
    map.put(part,
            new AnimationState(startState, millis, isForwardAndReverse));
    if (! timer.isRunning()) {
        timer.start();
    }
}
 
Example 11
Source File: AnimationController.java    From JDKSourceCode1.8 with MIT License 4 votes vote down vote up
private static void triggerAnimation(JComponent c,
                       Part part, State newState) {
    if (c instanceof javax.swing.JTabbedPane
        || part == Part.TP_BUTTON) {
        //idk: we can not handle tabs animation because
        //the same (component,part) is used to handle all the tabs
        //and we can not track the states
        //Vista theme might have transition duration for toolbar buttons
        //but native application does not seem to animate them
        return;
    }
    AnimationController controller =
        AnimationController.getAnimationController();
    State oldState = controller.getState(c, part);
    if (oldState != newState) {
        controller.putState(c, part, newState);
        if (newState == State.DEFAULTED) {
            // it seems for DEFAULTED button state Vista does animation from
            // HOT
            oldState = State.HOT;
        }
        if (oldState != null) {
            long duration;
            if (newState == State.DEFAULTED) {
                //Only button might have DEFAULTED state
                //idk: do not know how to get the value from Vista
                //one second seems plausible value
                duration = 1000;
            } else {
                XPStyle xp = XPStyle.getXP();
                duration = (xp != null)
                           ? xp.getThemeTransitionDuration(
                                   c, part,
                                   normalizeState(oldState),
                                   normalizeState(newState),
                                   Prop.TRANSITIONDURATIONS)
                           : 1000;
            }
            controller.startAnimation(c, part, oldState, newState, duration);
        }
    }
}
 
Example 12
Source File: AnimationController.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
private static void triggerAnimation(JComponent c,
                       Part part, State newState) {
    if (c instanceof javax.swing.JTabbedPane
        || part == Part.TP_BUTTON) {
        //idk: we can not handle tabs animation because
        //the same (component,part) is used to handle all the tabs
        //and we can not track the states
        //Vista theme might have transition duration for toolbar buttons
        //but native application does not seem to animate them
        return;
    }
    AnimationController controller =
        AnimationController.getAnimationController();
    State oldState = controller.getState(c, part);
    if (oldState != newState) {
        controller.putState(c, part, newState);
        if (newState == State.DEFAULTED) {
            // it seems for DEFAULTED button state Vista does animation from
            // HOT
            oldState = State.HOT;
        }
        if (oldState != null) {
            long duration;
            if (newState == State.DEFAULTED) {
                //Only button might have DEFAULTED state
                //idk: do not know how to get the value from Vista
                //one second seems plausible value
                duration = 1000;
            } else {
                XPStyle xp = XPStyle.getXP();
                duration = (xp != null)
                           ? xp.getThemeTransitionDuration(
                                   c, part,
                                   normalizeState(oldState),
                                   normalizeState(newState),
                                   Prop.TRANSITIONDURATIONS)
                           : 1000;
            }
            controller.startAnimation(c, part, oldState, newState, duration);
        }
    }
}
 
Example 13
Source File: AnimationController.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
private static void triggerAnimation(JComponent c,
                       Part part, State newState) {
    if (c instanceof javax.swing.JTabbedPane
        || part == Part.TP_BUTTON) {
        //idk: we can not handle tabs animation because
        //the same (component,part) is used to handle all the tabs
        //and we can not track the states
        //Vista theme might have transition duration for toolbar buttons
        //but native application does not seem to animate them
        return;
    }
    AnimationController controller =
        AnimationController.getAnimationController();
    State oldState = controller.getState(c, part);
    if (oldState != newState) {
        controller.putState(c, part, newState);
        if (newState == State.DEFAULTED) {
            // it seems for DEFAULTED button state Vista does animation from
            // HOT
            oldState = State.HOT;
        }
        if (oldState != null) {
            long duration;
            if (newState == State.DEFAULTED) {
                //Only button might have DEFAULTED state
                //idk: do not know how to get the value from Vista
                //one second seems plausible value
                duration = 1000;
            } else {
                XPStyle xp = XPStyle.getXP();
                duration = (xp != null)
                           ? xp.getThemeTransitionDuration(
                                   c, part,
                                   normalizeState(oldState),
                                   normalizeState(newState),
                                   Prop.TRANSITIONDURATIONS)
                           : 1000;
            }
            controller.startAnimation(c, part, oldState, newState, duration);
        }
    }
}
 
Example 14
Source File: AnimationController.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
private static void triggerAnimation(JComponent c,
                       Part part, State newState) {
    if (c instanceof javax.swing.JTabbedPane
        || part == Part.TP_BUTTON) {
        //idk: we can not handle tabs animation because
        //the same (component,part) is used to handle all the tabs
        //and we can not track the states
        //Vista theme might have transition duration for toolbar buttons
        //but native application does not seem to animate them
        return;
    }
    AnimationController controller =
        AnimationController.getAnimationController();
    State oldState = controller.getState(c, part);
    if (oldState != newState) {
        controller.putState(c, part, newState);
        if (newState == State.DEFAULTED) {
            // it seems for DEFAULTED button state Vista does animation from
            // HOT
            oldState = State.HOT;
        }
        if (oldState != null) {
            long duration;
            if (newState == State.DEFAULTED) {
                //Only button might have DEFAULTED state
                //idk: do not know how to get the value from Vista
                //one second seems plausible value
                duration = 1000;
            } else {
                XPStyle xp = XPStyle.getXP();
                duration = (xp != null)
                           ? xp.getThemeTransitionDuration(
                                   c, part,
                                   normalizeState(oldState),
                                   normalizeState(newState),
                                   Prop.TRANSITIONDURATIONS)
                           : 1000;
            }
            controller.startAnimation(c, part, oldState, newState, duration);
        }
    }
}
 
Example 15
Source File: AnimationController.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
private static void triggerAnimation(JComponent c,
                       Part part, State newState) {
    if (c instanceof javax.swing.JTabbedPane
        || part == Part.TP_BUTTON) {
        //idk: we can not handle tabs animation because
        //the same (component,part) is used to handle all the tabs
        //and we can not track the states
        //Vista theme might have transition duration for toolbar buttons
        //but native application does not seem to animate them
        return;
    }
    AnimationController controller =
        AnimationController.getAnimationController();
    State oldState = controller.getState(c, part);
    if (oldState != newState) {
        controller.putState(c, part, newState);
        if (newState == State.DEFAULTED) {
            // it seems for DEFAULTED button state Vista does animation from
            // HOT
            oldState = State.HOT;
        }
        if (oldState != null) {
            long duration;
            if (newState == State.DEFAULTED) {
                //Only button might have DEFAULTED state
                //idk: do not know how to get the value from Vista
                //one second seems plausible value
                duration = 1000;
            } else {
                XPStyle xp = XPStyle.getXP();
                duration = (xp != null)
                           ? xp.getThemeTransitionDuration(
                                   c, part,
                                   normalizeState(oldState),
                                   normalizeState(newState),
                                   Prop.TRANSITIONDURATIONS)
                           : 1000;
            }
            controller.startAnimation(c, part, oldState, newState, duration);
        }
    }
}
 
Example 16
Source File: AnimationController.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
private static void triggerAnimation(JComponent c,
                       Part part, State newState) {
    if (c instanceof javax.swing.JTabbedPane
        || part == Part.TP_BUTTON) {
        //idk: we can not handle tabs animation because
        //the same (component,part) is used to handle all the tabs
        //and we can not track the states
        //Vista theme might have transition duration for toolbar buttons
        //but native application does not seem to animate them
        return;
    }
    AnimationController controller =
        AnimationController.getAnimationController();
    State oldState = controller.getState(c, part);
    if (oldState != newState) {
        controller.putState(c, part, newState);
        if (newState == State.DEFAULTED) {
            // it seems for DEFAULTED button state Vista does animation from
            // HOT
            oldState = State.HOT;
        }
        if (oldState != null) {
            long duration;
            if (newState == State.DEFAULTED) {
                //Only button might have DEFAULTED state
                //idk: do not know how to get the value from Vista
                //one second seems plausible value
                duration = 1000;
            } else {
                XPStyle xp = XPStyle.getXP();
                duration = (xp != null)
                           ? xp.getThemeTransitionDuration(
                                   c, part,
                                   normalizeState(oldState),
                                   normalizeState(newState),
                                   Prop.TRANSITIONDURATIONS)
                           : 1000;
            }
            controller.startAnimation(c, part, oldState, newState, duration);
        }
    }
}
 
Example 17
Source File: AnimationController.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
private static void triggerAnimation(JComponent c,
                       Part part, State newState) {
    if (c instanceof javax.swing.JTabbedPane
        || part == Part.TP_BUTTON) {
        //idk: we can not handle tabs animation because
        //the same (component,part) is used to handle all the tabs
        //and we can not track the states
        //Vista theme might have transition duration for toolbar buttons
        //but native application does not seem to animate them
        return;
    }
    AnimationController controller =
        AnimationController.getAnimationController();
    State oldState = controller.getState(c, part);
    if (oldState != newState) {
        controller.putState(c, part, newState);
        if (newState == State.DEFAULTED) {
            // it seems for DEFAULTED button state Vista does animation from
            // HOT
            oldState = State.HOT;
        }
        if (oldState != null) {
            long duration;
            if (newState == State.DEFAULTED) {
                //Only button might have DEFAULTED state
                //idk: do not know how to get the value from Vista
                //one second seems plausible value
                duration = 1000;
            } else {
                XPStyle xp = XPStyle.getXP();
                duration = (xp != null)
                           ? xp.getThemeTransitionDuration(
                                   c, part,
                                   normalizeState(oldState),
                                   normalizeState(newState),
                                   Prop.TRANSITIONDURATIONS)
                           : 1000;
            }
            controller.startAnimation(c, part, oldState, newState, duration);
        }
    }
}
 
Example 18
Source File: AnimationController.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
private static void triggerAnimation(JComponent c,
                       Part part, State newState) {
    if (c instanceof javax.swing.JTabbedPane
        || part == Part.TP_BUTTON) {
        //idk: we can not handle tabs animation because
        //the same (component,part) is used to handle all the tabs
        //and we can not track the states
        //Vista theme might have transition duration for toolbar buttons
        //but native application does not seem to animate them
        return;
    }
    AnimationController controller =
        AnimationController.getAnimationController();
    State oldState = controller.getState(c, part);
    if (oldState != newState) {
        controller.putState(c, part, newState);
        if (newState == State.DEFAULTED) {
            // it seems for DEFAULTED button state Vista does animation from
            // HOT
            oldState = State.HOT;
        }
        if (oldState != null) {
            long duration;
            if (newState == State.DEFAULTED) {
                //Only button might have DEFAULTED state
                //idk: do not know how to get the value from Vista
                //one second seems plausible value
                duration = 1000;
            } else {
                XPStyle xp = XPStyle.getXP();
                duration = (xp != null)
                           ? xp.getThemeTransitionDuration(
                                   c, part,
                                   normalizeState(oldState),
                                   normalizeState(newState),
                                   Prop.TRANSITIONDURATIONS)
                           : 1000;
            }
            controller.startAnimation(c, part, oldState, newState, duration);
        }
    }
}
 
Example 19
Source File: AnimationController.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
private static void triggerAnimation(JComponent c,
                       Part part, State newState) {
    if (c instanceof javax.swing.JTabbedPane
        || part == Part.TP_BUTTON) {
        //idk: we can not handle tabs animation because
        //the same (component,part) is used to handle all the tabs
        //and we can not track the states
        //Vista theme might have transition duration for toolbar buttons
        //but native application does not seem to animate them
        return;
    }
    AnimationController controller =
        AnimationController.getAnimationController();
    State oldState = controller.getState(c, part);
    if (oldState != newState) {
        controller.putState(c, part, newState);
        if (newState == State.DEFAULTED) {
            // it seems for DEFAULTED button state Vista does animation from
            // HOT
            oldState = State.HOT;
        }
        if (oldState != null) {
            long duration;
            if (newState == State.DEFAULTED) {
                //Only button might have DEFAULTED state
                //idk: do not know how to get the value from Vista
                //one second seems plausible value
                duration = 1000;
            } else {
                XPStyle xp = XPStyle.getXP();
                duration = (xp != null)
                           ? xp.getThemeTransitionDuration(
                                   c, part,
                                   normalizeState(oldState),
                                   normalizeState(newState),
                                   Prop.TRANSITIONDURATIONS)
                           : 1000;
            }
            controller.startAnimation(c, part, oldState, newState, duration);
        }
    }
}
 
Example 20
Source File: AnimationController.java    From jdk1.8-source-analysis with Apache License 2.0 4 votes vote down vote up
private static void triggerAnimation(JComponent c,
                       Part part, State newState) {
    if (c instanceof javax.swing.JTabbedPane
        || part == Part.TP_BUTTON) {
        //idk: we can not handle tabs animation because
        //the same (component,part) is used to handle all the tabs
        //and we can not track the states
        //Vista theme might have transition duration for toolbar buttons
        //but native application does not seem to animate them
        return;
    }
    AnimationController controller =
        AnimationController.getAnimationController();
    State oldState = controller.getState(c, part);
    if (oldState != newState) {
        controller.putState(c, part, newState);
        if (newState == State.DEFAULTED) {
            // it seems for DEFAULTED button state Vista does animation from
            // HOT
            oldState = State.HOT;
        }
        if (oldState != null) {
            long duration;
            if (newState == State.DEFAULTED) {
                //Only button might have DEFAULTED state
                //idk: do not know how to get the value from Vista
                //one second seems plausible value
                duration = 1000;
            } else {
                XPStyle xp = XPStyle.getXP();
                duration = (xp != null)
                           ? xp.getThemeTransitionDuration(
                                   c, part,
                                   normalizeState(oldState),
                                   normalizeState(newState),
                                   Prop.TRANSITIONDURATIONS)
                           : 1000;
            }
            controller.startAnimation(c, part, oldState, newState, duration);
        }
    }
}