Java Code Examples for com.sun.java.swing.plaf.windows.TMSchema.Prop

The following examples show how to use com.sun.java.swing.plaf.windows.TMSchema.Prop. These examples are extracted from open source projects. 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
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 2
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 3
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 4
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 5
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 6
Source Project: jdk8u60   Source File: AnimationController.java    License: 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 7
Source Project: JDKSourceCode1.8   Source File: AnimationController.java    License: 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 8
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 9
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 10
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 11
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 Project: hottub   Source File: AnimationController.java    License: 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
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
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
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);
        }
    }
}